From 16ff3b4e03f8391babb332436792d114061c8d88 Mon Sep 17 00:00:00 2001 From: Nava kishore Manne Date: Thu, 9 Apr 2015 10:40:29 +0530 Subject: [PATCH] standalone : Modified namespace from HSM to HSI. Signed-off-by: Nava kishore Manne --- lib/bsp/standalone/data/standalone.tcl | 218 ++++++++++++------------- 1 file changed, 109 insertions(+), 109 deletions(-) diff --git a/lib/bsp/standalone/data/standalone.tcl b/lib/bsp/standalone/data/standalone.tcl index 2770ee69..0e0b2dba 100755 --- a/lib/bsp/standalone/data/standalone.tcl +++ b/lib/bsp/standalone/data/standalone.tcl @@ -109,7 +109,7 @@ proc generate {os_handle} { } file delete -force "./src/gcc" - set file_handle [::hsm::utils::open_include_file "xparameters.h"] + set file_handle [::hsi::utils::open_include_file "xparameters.h"] puts $file_handle "#include \"xparameters_ps.h\"" puts $file_handle "" close $file_handle @@ -125,42 +125,42 @@ proc generate {os_handle} { } file delete -force "./src/gcc" - set file_handle [::hsm::utils::open_include_file "xparameters.h"] + set file_handle [::hsi::utils::open_include_file "xparameters.h"] puts $file_handle "#include \"xparameters_ps.h\"" puts $file_handle "" close $file_handle } - "ps7_cortexa9" { - set procdrv [get_sw_processor] - set compiler [get_property CONFIG.compiler $procdrv] - if {[string compare -nocase $compiler "armcc"] == 0} { - set ccdir "./src/cortexa9/armcc" + "ps7_cortexa9" { + set procdrv [get_sw_processor] + set compiler [get_property CONFIG.compiler $procdrv] + if {[string compare -nocase $compiler "armcc"] == 0} { + set ccdir "./src/cortexa9/armcc" } elseif {[string compare -nocase $compiler "iccarm"] == 0} { set ccdir "./src/cortexa9/iccarm" - } else { - set ccdir "./src/cortexa9/gcc" - } - foreach entry [glob -nocomplain [file join $cortexa9srcdir *]] { - file copy -force $entry "./src/" - } - foreach entry [glob -nocomplain [file join $ccdir *]] { - file copy -force $entry "./src/" - } - file delete -force "./src/armcc" - file delete -force "./src/gcc" + } else { + set ccdir "./src/cortexa9/gcc" + } + foreach entry [glob -nocomplain [file join $cortexa9srcdir *]] { + file copy -force $entry "./src/" + } + foreach entry [glob -nocomplain [file join $ccdir *]] { + file copy -force $entry "./src/" + } + file delete -force "./src/armcc" + file delete -force "./src/gcc" file delete -force "./src/iccarm" - if {[string compare -nocase $compiler "armcc"] == 0} { - file delete -force "./src/profile" - set enable_sw_profile "false" + if {[string compare -nocase $compiler "armcc"] == 0} { + file delete -force "./src/profile" + set enable_sw_profile "false" } if {[string compare -nocase $compiler "iccarm"] == 0} { - file delete -force "./src/profile" - set enable_sw_profile "false" - } - set file_handle [::hsm::utils::open_include_file "xparameters.h"] - puts $file_handle "#include \"xparameters_ps.h\"" - puts $file_handle "" - close $file_handle + file delete -force "./src/profile" + set enable_sw_profile "false" + } + set file_handle [::hsi::utils::open_include_file "xparameters.h"] + puts $file_handle "#include \"xparameters_ps.h\"" + puts $file_handle "" + close $file_handle } "default" {puts "unknown processor type $proctype\n"} } @@ -193,7 +193,7 @@ proc generate {os_handle} { puts $makeconfig "LIBS = standalone_libs" } close $makeconfig - + # Remove microblaze, cortexr5, cortexa53 and common directories... file delete -force $mbsrcdir file delete -force $cortexr5srcdir @@ -202,15 +202,15 @@ proc generate {os_handle} { file delete -force $commonsrcdir # Handle stdin and stdout - ::hsm::utils::handle_stdin $os_handle - ::hsm::utils::handle_stdout $os_handle - + ::hsi::utils::handle_stdin $os_handle + ::hsi::utils::handle_stdout $os_handle + #Handle Profile configuration if { $enable_sw_profile == "true" } { - handle_profile $os_handle $proctype + handle_profile $os_handle $proctype } - - set file_handle [::hsm::utils::open_include_file "xparameters.h"] + + set file_handle [::hsi::utils::open_include_file "xparameters.h"] puts $file_handle "\n/******************************************************************/\n" close $file_handle @@ -222,18 +222,18 @@ proc generate {os_handle} { # Create config files for Microblaze exception handling if { $proctype == "microblaze" && [mb_has_exceptions $hw_proc_handle] } { xcreate_mb_exc_config_file $os_handle - } + } # Create bspconfig file - set bspcfg_fn [file join "src" "bspconfig.h"] + set bspcfg_fn [file join "src" "bspconfig.h"] file delete $bspcfg_fn set bspcfg_fh [open $bspcfg_fn w] - ::hsm::utils::write_c_header $bspcfg_fh "Configurations for Standalone BSP" + ::hsi::utils::write_c_header $bspcfg_fh "Configurations for Standalone BSP" if { $proctype == "microblaze" && [mb_has_pvr $hw_proc_handle] } { - + set pvr [get_property CONFIG.C_PVR $hw_proc_handle] - + switch $pvr { "0" { puts $bspcfg_fh "#define MICROBLAZE_PVR_NONE" @@ -247,7 +247,7 @@ proc generate {os_handle} { "default" { puts $bspcfg_fh "#define MICROBLAZE_PVR_NONE" } - } + } } else { puts $bspcfg_fh "#define MICROBLAZE_PVR_NONE" } @@ -265,15 +265,15 @@ proc xhandle_mb_interrupts {} { set source_interrupt_handler $default_interrupt_handler set source_handler_arg $default_arg - + # Handle the interrupt pin - set sw_proc_handle [get_sw_processor] + set sw_proc_handle [get_sw_processor] set periph [get_cells [get_property HW_INSTANCE $sw_proc_handle] ] - set source_ports [::hsm::utils::get_interrupt_sources $periph] + set source_ports [::hsi::utils::get_interrupt_sources $periph] if {[llength $source_ports] > 1} { - error "ERROR: Too many interrupting ports on the MicroBlaze. Should only find 1" "" "hsm_error" + error "ERROR: Too many interrupting ports on the MicroBlaze. Should only find 1" "" "hsi_error" return - } + } if { [llength $source_ports] != 0 } { set source_periph [get_cells -of_objects $source_ports] if { [llength $source_periph] != 0 } { @@ -289,9 +289,9 @@ proc xhandle_mb_interrupts {} { set source_interrupt_handler [lindex [get_property PARAM.int_handler $intr_array] $i] set source_handler_arg [lindex [get_property PARAM.int_handler_arg $intr_array] $i] if { [string compare -nocase $source_handler_arg DEVICE_ID] == 0 } { - set source_handler_arg [::hsm::utils::get_ip_param_name $source_periph "DEVICE_ID"] + set source_handler_arg [::hsi::utils::get_ip_param_name $source_periph "DEVICE_ID"] } else { - set source_handler_arg [::hsm::utils::get_ip_param_name $source_periph "C_BASEADDR"] + set source_handler_arg [::hsi::utils::get_ip_param_name $source_periph "C_BASEADDR"] } } } @@ -300,7 +300,7 @@ proc xhandle_mb_interrupts {} { } } } - + # Generate microblaze_interrupts_g.c file... xcreate_mb_intr_config_file $source_interrupt_handler $source_handler_arg } @@ -308,15 +308,15 @@ proc xhandle_mb_interrupts {} { # Tcl procedure xcreate_mb_intr_config file # ------------------------------------------- proc xcreate_mb_intr_config_file {handler arg} { - + set mb_table "MB_InterruptVectorTable" - set filename [file join "src" "microblaze_interrupts_g.c"] + set filename [file join "src" "microblaze_interrupts_g.c"] file delete $filename set config_file [open $filename w] - ::hsm::utils::write_c_header $config_file "Interrupt Handler Table for MicroBlaze Processor" - + ::hsi::utils::write_c_header $config_file "Interrupt Handler Table for MicroBlaze Processor" + puts $config_file "#include \"microblaze_interrupts_i.h\"" puts $config_file "#include \"xparameters.h\"" puts $config_file "\n" @@ -337,11 +337,11 @@ proc xcreate_mb_intr_config_file {handler arg} { # Tcl procedure xcreate_mb_exc_config file # ------------------------------------------- proc xcreate_mb_exc_config_file {os_handle} { - - set hfilename [file join "src" "microblaze_exceptions_g.h"] + + set hfilename [file join "src" "microblaze_exceptions_g.h"] file delete $hfilename set hconfig_file [open $hfilename w] - ::hsm::utils::write_c_header $hconfig_file "Exception Handling Header for MicroBlaze Processor" + ::hsi::utils::write_c_header $hconfig_file "Exception Handling Header for MicroBlaze Processor" set sw_proc_handle [get_sw_processor] set hw_proc_handle [get_cells [get_property HW_INSTANCE $sw_proc_handle] ] set procvlnv [get_property VLNV $hw_proc_handle] @@ -374,14 +374,14 @@ proc xcreate_mb_exc_config_file {os_handle} { set ft_ee 0 } - if { $ibus_ee == 0 && $dbus_ee == 0 && $ill_ee == 0 && $unalign_ee == 0 - && $div0_ee == 0 && $fpu_ee == 0 && $mmu_ee == 0 && $fsl_ee == 0 + if { $ibus_ee == 0 && $dbus_ee == 0 && $ill_ee == 0 && $unalign_ee == 0 + && $div0_ee == 0 && $fpu_ee == 0 && $mmu_ee == 0 && $fsl_ee == 0 && $sp_ee == 0 && $ft_ee == 0} { ;# NO exceptions are enabled ;# Do not generate any info in either the header or the C file close $hconfig_file return - } + } puts $hconfig_file "\#define MICROBLAZE_EXCEPTIONS_ENABLED 1" if { [mb_can_handle_exceptions_in_delay_slots $procver] } { @@ -390,18 +390,18 @@ proc xcreate_mb_exc_config_file {os_handle} { if { $unalign_ee == 0 } { puts $hconfig_file "\#define NO_UNALIGNED_EXCEPTIONS 1" } - if { $ibus_ee == 0 && $dbus_ee == 0 && $ill_ee == 0 && $div0_ee == 0 - && $fpu_ee == 0 && $mmu_ee == 0 && $fsl_ee == 0 } { + if { $ibus_ee == 0 && $dbus_ee == 0 && $ill_ee == 0 && $div0_ee == 0 + && $fpu_ee == 0 && $mmu_ee == 0 && $fsl_ee == 0 } { ;# NO other exceptions are enabled puts $hconfig_file "\#define NO_OTHER_EXCEPTIONS 1" } - + if { $fpu_ee != 0 } { - puts $hconfig_file "\#define MICROBLAZE_FP_EXCEPTION_ENABLED 1" + puts $hconfig_file "\#define MICROBLAZE_FP_EXCEPTION_ENABLED 1" set predecode_fpu_exceptions [get_property CONFIG.predecode_fpu_exceptions $os_handle] if {$predecode_fpu_exceptions != false } { - puts $hconfig_file "\#define MICROBLAZE_FP_EXCEPTION_DECODE 1" - } + puts $hconfig_file "\#define MICROBLAZE_FP_EXCEPTION_DECODE 1" + } } puts $hconfig_file "\n" @@ -416,7 +416,7 @@ proc xcreate_mb_exc_config_file {os_handle} { # from libxil.a # -------------------------------------- proc post_generate {os_handle} { - + set sw_proc_handle [get_sw_processor] set hw_proc_handle [get_cells [get_property HW_INSTANCE $sw_proc_handle] ] @@ -430,7 +430,7 @@ proc post_generate {os_handle} { set archiver [get_property CONFIG.archiver $procdrv] set libgloss_a [file join .. .. lib libgloss.a] if { ![file exists $libgloss_a] } { - set libgloss_a [file join .. .. lib libxil.a] + set libgloss_a [file join .. .. lib libxil.a] } exec $archiver -d $libgloss_a _interrupt_handler.o @@ -442,11 +442,11 @@ proc post_generate {os_handle} { } # -------------------------------------- -# Return true if this MB has +# Return true if this MB has # exception handling support # -------------------------------------- proc mb_has_exceptions { hw_proc_handle } { - + # Check if the following parameters exist on this MicroBlaze's MPD set ee [get_property CONFIG.C_UNALIGNED_EXCEPTIONS $hw_proc_handle] if { $ee != "" } { @@ -491,27 +491,27 @@ proc mb_has_exceptions { hw_proc_handle } { set ee [get_property CONFIG.C_DIV_BY_ZERO_EXCEPTION $hw_proc_handle] if { $ee != "" } { return true - } + } set ee [get_property CONFIG.C_DIV_ZERO_EXCEPTION $hw_proc_handle] if { $ee != "" } { return true - } + } set ee [get_property CONFIG.C_FPU_EXCEPTION $hw_proc_handle] if { $ee != "" } { return true - } + } set ee [get_property CONFIG.C_FSL_EXCEPTION $hw_proc_handle] if { $ee != "" } { return true - } + } set ee [get_property CONFIG.C_USE_MMU $hw_proc_handle] if { $ee != ""} { return true - } + } set ee [get_property CONFIG.C_USE_STACK_PROTECTION $hw_proc_handle] if { $ee != ""} { @@ -526,16 +526,16 @@ proc mb_has_exceptions { hw_proc_handle } { return false } # -------------------------------------- -# Return true if this MB has +# Return true if this MB has # FPU exception handling support # -------------------------------------- proc mb_has_fpu_exceptions { hw_proc_handle } { - + # Check if the following parameters exist on this MicroBlaze's MPD set ee [get_property CONFIG.C_FPU_EXCEPTION $hw_proc_handle] if { $ee != "" } { return true - } + } return false } @@ -544,23 +544,23 @@ proc mb_has_fpu_exceptions { hw_proc_handle } { # Return true if this MB has PVR support # -------------------------------------- proc mb_has_pvr { hw_proc_handle } { - + # Check if the following parameters exist on this MicroBlaze's MPD set pvr [get_property CONFIG.C_PVR $hw_proc_handle] if { $pvr != "" } { return true - } + } return false } # -------------------------------------- -# Return true if MB ver 'procver' has -# support for handling exceptions in +# Return true if MB ver 'procver' has +# support for handling exceptions in # delay slots # -------------------------------------- proc mb_can_handle_exceptions_in_delay_slots { procver } { - + if { [string compare -nocase $procver "5.00.a"] >= 0 } { return true } else { @@ -599,19 +599,19 @@ proc handle_profile { os_handle proctype } { file delete -force $filename set config_file [open $filename w] - ::hsm::utils::write_c_header $config_file "Profiling Configuration parameters. These parameters + ::hsi::utils::write_c_header $config_file "Profiling Configuration parameters. These parameters * can be overwritten thru run configuration in SDK" puts $config_file "#ifndef _PROFILE_CONFIG_H" puts $config_file "#define _PROFILE_CONFIG_H\n" - + puts $config_file "#define BINSIZE 4" puts $config_file "#define CPU_FREQ_HZ $cpu_freq" puts $config_file "#define SAMPLE_FREQ_HZ 100000" puts $config_file "#define TIMER_CLK_TICKS [expr $cpu_freq / 100000]" - + # proctype should be "microblaze" or "pss_cortexa53" switch $proctype { - "microblaze" { + "microblaze" { # Microblaze Processor. puts $config_file "#define PROC_MICROBLAZE 1" set timer_inst [get_property CONFIG.profile_timer $os_handle] @@ -654,20 +654,20 @@ proc handle_profile { os_handle proctype } { } } - "ps7_cortexa9" { - # Cortex A9 Processor. + "ps7_cortexa9" { + # Cortex A9 Processor. - puts $config_file "#define PROC_CORTEXA9 1" - set timer_inst [get_property CONFIG.profile_timer $os_handle] - if { [string compare -nocase $timer_inst "none"] == 0 } { - # SCU Timer - puts $config_file "#define ENABLE_SCU_TIMER 1" - puts $config_file "#define ENABLE_SYS_INTR 1" - puts $config_file "#define PROFILE_TIMER_BASEADDR $scutimer_baseaddr" - puts $config_file "#define PROFILE_TIMER_INTR_ID $scutimer_intr" - puts $config_file "#define SCUGIC_CPU_BASEADDR $scugic_cpu_base" - puts $config_file "#define SCUGIC_DIST_BASEADDR $scugic_dist_base" - } + puts $config_file "#define PROC_CORTEXA9 1" + set timer_inst [get_property CONFIG.profile_timer $os_handle] + if { [string compare -nocase $timer_inst "none"] == 0 } { + # SCU Timer + puts $config_file "#define ENABLE_SCU_TIMER 1" + puts $config_file "#define ENABLE_SYS_INTR 1" + puts $config_file "#define PROFILE_TIMER_BASEADDR $scutimer_baseaddr" + puts $config_file "#define PROFILE_TIMER_INTR_ID $scutimer_intr" + puts $config_file "#define SCUGIC_CPU_BASEADDR $scugic_cpu_base" + puts $config_file "#define SCUGIC_DIST_BASEADDR $scugic_dist_base" + } } "default" {error "ERROR: unknown processor type\n"} @@ -717,23 +717,23 @@ proc execpipe {COMMAND} { proc handle_profile_opbtimer { config_file timer_inst } { set timer_handle [get_cells $timer_inst] set timer_baseaddr [get_property CONFIG.C_BASEADDR $timer_handle] - puts $config_file "#define PROFILE_TIMER_BASEADDR [::hsm::utils::format_addr_string $timer_baseaddr "C_BASEADDR"]" + puts $config_file "#define PROFILE_TIMER_BASEADDR [::hsi::utils::format_addr_string $timer_baseaddr "C_BASEADDR"]" # Figure out how Timer is connected. set timer_intr [get_pins -of_objects [get_cells $timer_handle] Interrupt] if { [string compare -nocase $timer_intr ""] == 0 } { error "ERROR :: Timer Interrupt PORT is not specified" "" "mdt_error" - } + } #set mhs_handle [xget_handle $timer_handle "parent"] # CR 302300 - There can be multiple "sink" for the interrupt. So need to iterate through the list - set intr_port_list [::hsm::utils::get_sink_pins [get_pins -of_objects [get_cells $timer_intr] INTERRUPT]] + set intr_port_list [::hsi::utils::get_sink_pins [get_pins -of_objects [get_cells $timer_intr] INTERRUPT]] set timer_connection 0 foreach intr_port $intr_port_list { set intc_handle [get_cells -of_object $intr_port] # Check if the Sink is a Global Port. If so, Skip the Port Connection - - if { [::hsm::utils::is_external_pin $intr_port] } { - continue + + if { [::hsi::utils::is_external_pin $intr_port] } { + continue } set iptype [get_property CONFIG.EDK_IPTYPE $intc_handle] if { [string compare -nocase $iptype "PROCESSOR"] == 0 } { @@ -755,7 +755,7 @@ proc handle_profile_opbtimer { config_file timer_inst } { # } #set signals [split [xget_value $intr_port "VALUE"] "&"] - set signals [::hsm::utils::get_source_pins $intr_port] + set signals [::hsi::utils::get_source_pins $intr_port] set i 1 foreach signal $signals { set signal [string trim $signal] @@ -770,10 +770,10 @@ proc handle_profile_opbtimer { config_file timer_inst } { } set timer_connection 1 break - } + } } - + if { $timer_connection == 0 } { - error "ERROR :: Profile Timer Interrupt Signal Not Connected Properly" + error "ERROR :: Profile Timer Interrupt Signal Not Connected Properly" } }