Renaming of common TCL procs of HSM

CR: 767582

Wall Data:
  Originally submitted from RDI_kkorath_new
  Build Type: full
  Test Types: pre-commits, gui pre-commits
[git-p4: depot-paths = "//Rodin/HEAD/data/embeddedsw/": change = 926519]
This commit is contained in:
Kishore Kumar Korathaluri 2014-06-03 15:21:32 +05:30 committed by Jagannadha Sutradharudu Teki
parent faa2628852
commit 08092b8d48
63 changed files with 593 additions and 577 deletions

View file

@ -247,7 +247,7 @@ proc lwip_sw_drc {libhandle emacs_list} {
}
proc get_emac_periphs {processor} {
set periphs_list [xget_hw_proc_slave_periphs $processor]
set periphs_list [::hsm::utils::get_proc_slave_periphs $processor]
set emac_periphs_list {}
foreach periph $periphs_list {
@ -675,7 +675,7 @@ proc update_temac_topology {emac processor topologyvar} {
# find intc to which the interrupt line is connected
set emac_intr_port [get_pins -of_objects [get_cells $emac] TemacIntc0_Irpt]
set intr_ports [xget_sink_pins [get_pins -of_objects [get_cells $emac] TemacIntc0_Irpt]]
set intr_ports [::hsm::utils::get_sink_pins [get_pins -of_objects [get_cells $emac] TemacIntc0_Irpt]]
set l [llength $intr_ports]
@ -690,7 +690,7 @@ proc update_temac_topology {emac processor topologyvar} {
set intc_handle [get_cells -of_objects $intr_port]
# can we address this intc from the processor?
set proc_connected_periphs [xget_hw_proc_slave_periphs $processor]
set proc_connected_periphs [::hsm::utils::get_proc_slave_periphs $processor]
if { [lsearch -exact $proc_connected_periphs $intc_handle] == -1 } {
set intc_name [get_property NAME $intc_handle]
set proc_name [get_property NAME $processor]
@ -699,7 +699,7 @@ proc update_temac_topology {emac processor topologyvar} {
}
set topology(intc_baseaddr) [get_property CONFIG.C_BASEADDR $intc_handle]
set topology(intc_baseaddr) [xformat_addr_string $topology(intc_baseaddr) "C_BASEADDR"]
set topology(intc_baseaddr) [::hsm::utils::format_addr_string $topology(intc_baseaddr) "C_BASEADDR"]
set topology(scugic_baseaddr) "0x0"
set topology(scugic_emac_intr) "0x0"
}
@ -728,7 +728,7 @@ proc update_temac1_topology {emac processor topologyvar} {
set intc_handle [get_cells -of_objects $intr_port]
# can we address this intc from the processor?
set proc_connected_periphs [xget_hw_proc_slave_periphs $processor]
set proc_connected_periphs [::hsm::utils::get_proc_slave_periphs $processor]
if { [lsearch -exact $proc_connected_periphs $intc_handle] == -1 } {
set intc_name [get_property NAME $intc_handle]
set proc_name [get_property NAME $processor]
@ -737,7 +737,7 @@ proc update_temac1_topology {emac processor topologyvar} {
}
set topology(intc_baseaddr) [get_property CONFIG.C_BASEADDR $intc_handle]
set topology(intc_baseaddr) [xformat_addr_string $topology(intc_baseaddr) "C_BASEADDR"]
set topology(intc_baseaddr) [::hsm::utils::format_addr_string $topology(intc_baseaddr) "C_BASEADDR"]
set topology(scugic_baseaddr) "0x0"
set topology(scugic_emac_intr) "0x0"
}
@ -768,7 +768,7 @@ proc update_emaclite_topology {emac processor topologyvar} {
# find intc to which the interrupt line is connected
set emac_intr_port [get_pins -of_objects [get_cells $emac] IP2INTC_Irpt]
set mhs_handle [get_cells $emac]
set intr_ports [xget_sink_pins [get_pins -of_objects [get_cells $emac] IP2INTC_Irpt]]
set intr_ports [::hsm::utils::get_sink_pins [get_pins -of_objects [get_cells $emac] IP2INTC_Irpt]]
if { [llength $intr_ports] != 1 } {
set emac_name [get_property NAME $emac]
@ -781,7 +781,7 @@ proc update_emaclite_topology {emac processor topologyvar} {
set intc_handle [get_cells -of_objects $intr_port]
# can we address this intc from the processor?
set proc_connected_periphs [xget_hw_proc_slave_periphs $processor]
set proc_connected_periphs [::hsm::utils::get_proc_slave_periphs $processor]
if { [lsearch -exact $proc_connected_periphs $intc_handle] == -1 } {
set intc_name [get_property NAME $intc_handle]
set proc_name [get_property NAME $processor]
@ -815,7 +815,7 @@ proc update_axi_ethernet_topology {emac processor topologyvar} {
# find intc to which the interrupt line is connected
set emac_intr_port [get_pins -of_objects [get_cells $emac] INTERRUPT]
set intr_ports [xget_sink_pins [get_pins -of_objects [get_cells $emac] INTERRUPT]]
set intr_ports [::hsm::utils::get_sink_pins [get_pins -of_objects [get_cells $emac] INTERRUPT]]
set intr_cnt 0
foreach intr_sink $intr_ports {
set phandle [get_cells -of_objects $intr_sink]
@ -826,7 +826,7 @@ proc update_axi_ethernet_topology {emac processor topologyvar} {
set intc_periph_type [get_property NAME $intc_handle]
set intc_name [get_property NAME $intc_handle]
# can we address this intc from the processor?
set proc_connected_periphs [xget_hw_proc_slave_periphs $processor]
set proc_connected_periphs [::hsm::utils::get_proc_slave_periphs $processor]
if { [lsearch -exact $proc_connected_periphs $intc_handle] == -1 } {
set proc_name [get_property NAME $processor]
error "ERROR: $intc_name to which axi_ethernet interrupt is connected is not addressable \
@ -845,7 +845,7 @@ proc update_axi_ethernet_topology {emac processor topologyvar} {
if { $intc_periph_type != [format "ps7_scugic"] } {
set topology(intc_baseaddr) [get_property CONFIG.C_BASEADDR $intc_handle]
set topology(intc_baseaddr) [xformat_addr_string $topology(intc_baseaddr) "C_BASEADDR"]
set topology(intc_baseaddr) [::hsm::utils::format_addr_string $topology(intc_baseaddr) "C_BASEADDR"]
set topology(scugic_baseaddr) "0x0"
set topology(scugic_emac_intr) "0x0"
} else {
@ -986,7 +986,7 @@ proc generate_adapterconfig_makefile {libhandle} {
} elseif {$iptype == "axi_ethernet" || $iptype == "axi_ethernet_buffer"} {
set have_axi_ethernet 1
# Find the AXI FIFO or AXI DMA that this emac is connected to.
set connected_bus_name [xget_connected_intf $emac AXI_STR_RXD]
set connected_bus_name [::hsm::utils::get_connected_intf $emac AXI_STR_RXD]
set parent_handle [get_cells -of_objects $connected_bus_name]
set parent_name [get_property IP_NAME $parent_handle]
if {$parent_name == "axi_fifo_mm_s"} {
@ -1103,7 +1103,7 @@ proc generate_adapterconfig_include {libhandle} {
set have_temac 1
} elseif {$iptype == "axi_ethernet" || $iptype == "axi_ethernet_buffer"} {
# Find the AXI FIFO or AXI DMA that this emac is connected to.
set connected_bus_name [xget_connected_intf $emac AXI_STR_RXD]
set connected_bus_name [::hsm::utils::get_connected_intf $emac AXI_STR_RXD]
set parent_handle [get_cells -of_objects $connected_bus_name]
set parent_name [get_property IP_NAME $parent_handle]
if {$parent_name == "axi_fifo_mm_s"} {

View file

@ -68,7 +68,7 @@ proc gen_include_files {swproj mhsinst} {
if {$swproj == 1} {
set axicdmaintr [is_ip_interrupting_current_processor $mhsinst]
set axicdmaintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set sg [get_property CONFIG.C_INCLUDE_SG $mhsinst]
if {$sg == 1} {
@ -100,7 +100,7 @@ proc gen_src_files {swproj mhsinst} {
}
if {$swproj == 1} {
set axicdmaintr [is_ip_interrupting_current_processor $mhsinst]
set axicdmaintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set sg [get_property CONFIG.C_INCLUDE_SG $mhsinst]
if {$sg == 1} {
@ -145,7 +145,7 @@ proc gen_init_code {swproj mhsinst} {
if {$swproj == 1} {
set ipname [get_property NAME $mhsinst]
set axicdmaintr [is_ip_interrupting_current_processor $mhsinst]
set axicdmaintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$axicdmaintr == 1} {
set decl " static XAxiCdma ${ipname};"
set inc_file_lines $decl
@ -167,9 +167,9 @@ proc gen_testfunc_call {swproj mhsinst} {
return ""
}
set axicdmaintr [is_ip_interrupting_current_processor $mhsinst]
set axicdmaintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -180,7 +180,7 @@ proc gen_testfunc_call {swproj mhsinst} {
if {$axicdmaintr == 1} {
set intr_pin_name [get_pins -of_objects [get_cells $ipname] -filter "TYPE==INTERRUPT"]
set intcname [get_connected_interrupt_controller $ipname $intr_pin_name]
set intcname [::hsm::utils::get_connected_intr_cntrl $ipname $intr_pin_name]
set intcvar intc
set proc [get_property IP_NAME [get_cells [get_sw_processor]]]
}

View file

@ -61,7 +61,7 @@ proc add_field_to_periph_config_struct { deviceid fieldval } {
}
proc display_avb_warning_if_applicable { periph } {
set avb_param_val ""
set avb_param_val [xget_param_value $periph C_AVB]
set avb_param_val [::hsm::utils::get_param_value $periph C_AVB]
if { $avb_param_val == 1 } {
puts "*******************************************************************************\r\n"
puts "WARNING: Audio Video Bridging (AVB) functionality is ENABLED in the AXI Ethernet core."
@ -87,10 +87,10 @@ proc xdefine_axiethernet_include_file {drv_handle file_name drv_string} {
global periph_ninstances
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# ----------------------------------------------
# PART 1 - AXI Ethernet related parameters
@ -103,7 +103,7 @@ proc xdefine_axiethernet_include_file {drv_handle file_name drv_string} {
init_periph_config_struct $periph_ninstances
incr periph_ninstances 1
}
puts $file_handle "\#define [xget_dname $drv_string NUM_INSTANCES] $periph_ninstances"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $drv_string NUM_INSTANCES] $periph_ninstances"
# Now print all useful parameters for all peripherals
@ -181,7 +181,7 @@ proc xdefine_axi_target_params {periphs file_handle} {
foreach p2p_busif $p2p_busifs_i {
set busif_name [string toupper [get_property NAME $p2p_busif]]
set conn_busif_handle [xget_connected_intf $periph $busif_name]
set conn_busif_handle [::hsm::utils::get_connected_intf $periph $busif_name]
if { [string compare -nocase $conn_busif_handle ""] == 0} {
continue
} else {
@ -215,10 +215,10 @@ proc xdefine_axi_target_params {periphs file_handle} {
add_field_to_periph_config_struct $device_id $canonical_name
# FIFO Interrupts Handling
set int_pin [get_pins -of_objects [get_cells $tartget_per_name] INTERRUPT]
set intc_periph_type [get_connected_interrupt_controller $tartget_per_name $int_pin]
set intc_periph_type [::hsm::utils::get_connected_intr_cntrl $tartget_per_name $int_pin]
set intc_name [get_property IP_NAME $intc_periph_type]
if { $intc_name != [format "ps7_scugic"] } {
set int_id [xget_port_interrupt_id [get_cells $tartget_per_name] $int_pin]
set int_id [::hsm::utils::get_port_intr_id [get_cells $tartget_per_name] $int_pin]
set canonical_name [format "XPAR_%s_CONNECTED_FIFO_INTR" $canonical_tag]
puts $file_handle [format "#define $canonical_name %d" $int_id]
add_field_to_periph_config_struct $device_id $canonical_name
@ -281,15 +281,15 @@ proc xdefine_temac_params_canonical {file_handle periph device_id} {
# Handle BASEADDR specially
set canonical_name [format "%s_BASEADDR" $canonical_tag]
puts $file_handle "\#define $canonical_name [xget_param_value $periph C_BASEADDR]"
puts $file_handle "\#define $canonical_name [::hsm::utils::get_param_value $periph C_BASEADDR]"
add_field_to_periph_config_struct $device_id $canonical_name
# Handle HIGHADDR specially
set canonical_name [format "%s_HIGHADDR" $canonical_tag]
puts $file_handle "\#define $canonical_name [xget_param_value $periph C_HIGHADDR]"
puts $file_handle "\#define $canonical_name [::hsm::utils::get_param_value $periph C_HIGHADDR]"
set canonical_name [format "%s_TEMAC_TYPE" $canonical_tag]
set value [xget_param_value $periph C_TYPE]
set value [::hsm::utils::get_param_value $periph C_TYPE]
if {[llength $value] == 0} {
set value 0
}
@ -297,7 +297,7 @@ proc xdefine_temac_params_canonical {file_handle periph device_id} {
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_TXCSUM" $canonical_tag]
set value [xget_param_value $periph C_TXCSUM]
set value [::hsm::utils::get_param_value $periph C_TXCSUM]
if {[llength $value] == 0} {
set value 0
}
@ -305,7 +305,7 @@ proc xdefine_temac_params_canonical {file_handle periph device_id} {
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_RXCSUM" $canonical_tag]
set value [xget_param_value $periph C_RXCSUM]
set value [::hsm::utils::get_param_value $periph C_RXCSUM]
if {[llength $value] == 0} {
set value 0
}
@ -313,7 +313,7 @@ proc xdefine_temac_params_canonical {file_handle periph device_id} {
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_PHY_TYPE" $canonical_tag]
set value [xget_param_value $periph C_PHY_TYPE]
set value [::hsm::utils::get_param_value $periph C_PHY_TYPE]
if {[llength $value] == 0} {
set value 0
}
@ -321,7 +321,7 @@ proc xdefine_temac_params_canonical {file_handle periph device_id} {
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_TXVLAN_TRAN" $canonical_tag]
set value [xget_param_value $periph C_TXVLAN_TRAN]
set value [::hsm::utils::get_param_value $periph C_TXVLAN_TRAN]
if {[llength $value] == 0} {
set value 0
}
@ -329,7 +329,7 @@ proc xdefine_temac_params_canonical {file_handle periph device_id} {
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_RXVLAN_TRAN" $canonical_tag]
set value [xget_param_value $periph C_RXVLAN_TRAN]
set value [::hsm::utils::get_param_value $periph C_RXVLAN_TRAN]
if {[llength $value] == 0} {
set value 0
}
@ -337,7 +337,7 @@ proc xdefine_temac_params_canonical {file_handle periph device_id} {
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_TXVLAN_TAG" $canonical_tag]
set value [xget_param_value $periph C_TXVLAN_TAG]
set value [::hsm::utils::get_param_value $periph C_TXVLAN_TAG]
if {[llength $value] == 0} {
set value 0
}
@ -345,7 +345,7 @@ proc xdefine_temac_params_canonical {file_handle periph device_id} {
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_RXVLAN_TAG" $canonical_tag]
set value [xget_param_value $periph C_RXVLAN_TAG]
set value [::hsm::utils::get_param_value $periph C_RXVLAN_TAG]
if {[llength $value] == 0} {
set value 0
}
@ -353,7 +353,7 @@ proc xdefine_temac_params_canonical {file_handle periph device_id} {
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_TXVLAN_STRP" $canonical_tag]
set value [xget_param_value $periph C_TXVLAN_STRP]
set value [::hsm::utils::get_param_value $periph C_TXVLAN_STRP]
if {[llength $value] == 0} {
set value 0
}
@ -361,7 +361,7 @@ proc xdefine_temac_params_canonical {file_handle periph device_id} {
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_RXVLAN_STRP" $canonical_tag]
set value [xget_param_value $periph C_RXVLAN_STRP]
set value [::hsm::utils::get_param_value $periph C_RXVLAN_STRP]
if {[llength $value] == 0} {
set value 0
}
@ -369,7 +369,7 @@ proc xdefine_temac_params_canonical {file_handle periph device_id} {
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_MCAST_EXTEND" $canonical_tag]
set value [xget_param_value $periph C_MCAST_EXTEND]
set value [::hsm::utils::get_param_value $periph C_MCAST_EXTEND]
if {[llength $value] == 0} {
set value 0
}
@ -377,7 +377,7 @@ proc xdefine_temac_params_canonical {file_handle periph device_id} {
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_STATS" $canonical_tag]
set value [xget_param_value $periph C_STATS]
set value [::hsm::utils::get_param_value $periph C_STATS]
if {[llength $value] == 0} {
set value 0
}
@ -385,22 +385,22 @@ proc xdefine_temac_params_canonical {file_handle periph device_id} {
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_AVB" $canonical_tag]
set value [xget_param_value $periph C_AVB]
set value [::hsm::utils::get_param_value $periph C_AVB]
if {[llength $value] == 0} {
set value 0
}
puts $file_handle "\#define $canonical_name $value"
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_ENABLE_SGMII_OVER_LVDS" $canonical_tag]
set value [xget_param_value $periph C_ENABLE_LVDS]
set value [::hsm::utils::get_param_value $periph C_ENABLE_LVDS]
if {[llength $value] == 0} {
set value 0
}
puts $file_handle "\#define $canonical_name $value"
add_field_to_periph_config_struct $device_id $canonical_name
set canonical_name [format "%s_PHYADDR" $canonical_tag]
set phyaddr [xget_param_value $periph C_PHYADDR]
set value [xconvert_binary_to_decimal $phyaddr]
set phyaddr [::hsm::utils::get_param_value $periph C_PHYADDR]
set value [::hsm::utils::convert_binary_to_decimal $phyaddr]
if {[llength $value] == 0} {
set value 0
}
@ -417,7 +417,7 @@ proc xdefine_axiethernet_config_file {file_name drv_string} {
set filename [file join "src" $file_name]
file delete $filename
set config_file [open $filename w]
xprint_generated_header $config_file "Driver configuration"
::hsm::utils::write_c_header $config_file "Driver configuration"
puts $config_file "\#include \"xparameters.h\""
puts $config_file "\#include \"[string tolower $drv_string].h\""
puts $config_file "\n/*"
@ -475,7 +475,7 @@ proc xdefine_dma_interrupts {file_handle target_periph deviceid canonical_tag dm
if { $intc_port != "" } {
set found_intc ""
foreach intr_sink $intc_port {
set pname_type [get_connected_interrupt_controller $target_periph $intr_sink]
set pname_type [::hsm::utils::get_connected_intr_cntrl $target_periph $intr_sink]
if {$pname_type != "chipscope_ila"} {
set special [get_property IP_TYPE $pname_type]
if {[string compare -nocase $special "INTERRUPT_CNTLR"] == 0} {
@ -506,11 +506,11 @@ proc xdefine_dma_interrupts {file_handle target_periph deviceid canonical_tag dm
# matches the original interrupt signal we were tracking.
# If it does, put out the XPAR
if { $intc_periph_type != [format "ps7_scugic"] } {
set rx_int_id [xget_port_interrupt_id $target_periph $dmarx_signal]
set rx_int_id [::hsm::utils::get_port_intr_id $target_periph $dmarx_signal]
set canonical_name [format "XPAR_%s_CONNECTED_DMARX_INTR" $canonical_tag]
puts $file_handle [format "#define $canonical_name %d" $rx_int_id]
add_field_to_periph_config_struct $deviceid $canonical_name
set tx_int_id [xget_port_interrupt_id $target_periph $dmatx_signal]
set tx_int_id [::hsm::utils::get_port_intr_id $target_periph $dmatx_signal]
set canonical_name [format "XPAR_%s_CONNECTED_DMATX_INTR" $canonical_tag]
puts $file_handle [format "#define $canonical_name %d" $tx_int_id]
add_field_to_periph_config_struct $deviceid $canonical_name
@ -568,7 +568,7 @@ proc xdefine_temac_interrupt {file_handle periph device_id} {
set addentry 0
set interrupt_signal_name [get_property NAME $interrupt_port]
#set interrupt_signal [xget_hw_value $interrupt_port]
set intc_prt [xget_sink_pins [get_pins -of_objects [get_cells $periph] INTERRUPT]]
set intc_prt [::hsm::utils::get_sink_pins [get_pins -of_objects [get_cells $periph] INTERRUPT]]
# Make sure the interrupt signal was connected in this design. We assume
# at least one is. (could be a bug if user just wants polled mode)
@ -611,7 +611,7 @@ proc xdefine_temac_interrupt {file_handle periph device_id} {
if { $intc_periph_type != [format "ps7_scugic"] } {
set ethernet_int_signal_name [get_pins -of_objects $periph INTERRUPT]
set int_id [xget_port_interrupt_id $periph $ethernet_int_signal_name]
set int_id [::hsm::utils::get_port_intr_id $periph $ethernet_int_signal_name]
puts $file_handle "\#define $canonical_name $int_id"
add_field_to_periph_config_struct $device_id $canonical_name
set addentry 1

View file

@ -55,7 +55,7 @@ proc gen_include_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set ifintr [is_ip_interrupting_current_processor $mhsinst]
set ifintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set dmaType [get_dma_type $mhsinst]
if {$ifintr == 1} {
@ -87,7 +87,7 @@ proc gen_src_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set ifintr [is_ip_interrupting_current_processor $mhsinst]
set ifintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set dmaType [get_dma_type $mhsinst]
if {$ifintr == 1} {
@ -118,7 +118,7 @@ proc gen_init_code {swproj mhsinst} {
if {$swproj == 1} {
set ipname [get_property NAME $mhsinst]
set ifintr [is_ip_interrupting_current_processor $mhsinst]
set ifintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifintr == 1} {
set dmaType [get_dma_type $mhsinst]
@ -158,7 +158,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -166,7 +166,7 @@ proc gen_testfunc_call {swproj mhsinst} {
set hasStdout 1
}
set dma [get_dma_type $mhsinst]
set ifintr [is_ip_interrupting_current_processor $mhsinst]
set ifintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set fifo_deviceid [get_fifo_info $mhsinst "id"]
set fifo_ipname [get_fifo_info $mhsinst "name"]
@ -176,7 +176,7 @@ proc gen_testfunc_call {swproj mhsinst} {
if {$ifintr == 1} {
set intr_pin_name [get_pins -of_objects [get_cells $ipname] INTERRUPT]
set intcname [get_connected_interrupt_controller $ipname $intr_pin_name]
set intcname [::hsm::utils::get_connected_intr_cntrl $ipname $intr_pin_name]
set intcvar intc
set proc [get_property IP_NAME [get_cells [get_sw_processor]]]
}
@ -359,7 +359,7 @@ proc get_fifo_info {mhsHandle type} {
if {[string compare -nocase $coreName "axi_fifo_mm_s"] == 0} {
if {[string compare -nocase $type "id"] == 0} {
set deviceid [xget_name $ipinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $ipinst "DEVICE_ID"]
return $deviceid
}
if {[string compare -nocase $type "name"] == 0} {
@ -376,7 +376,7 @@ proc get_dma_info {mhsinst type} {
# Add p2p periphs
foreach p2p_busif $p2p_busifs_i {
set busif_name [string toupper [get_property NAME $p2p_busif]]
set conn_busif_handle [xget_connected_intf $mhsinst $busif_name]
set conn_busif_handle [::hsm::utils::get_connected_intf $mhsinst $busif_name]
if { [string compare -nocase $conn_busif_handle ""] == 0} {
continue
} else {
@ -392,7 +392,7 @@ proc get_dma_info {mhsinst type} {
set instName [get_property NAME $target_periph]
if {[string compare -nocase $target_periph_type "axi_dma"] == 0} {
if {[string compare -nocase $type "id"] == 0} {
set deviceid [xget_name $target_periph "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $target_periph "DEVICE_ID"]
return $deviceid
}
if {[string compare -nocase $type "name"] == 0} {

View file

@ -142,10 +142,10 @@ proc generate {drv_handle} {
proc xdefine_pcie_include_file {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Handle special cases
set arg "NUM_INSTANCES"
@ -153,7 +153,7 @@ proc xdefine_pcie_include_file {drv_handle file_name drv_string args} {
if {$posn > -1} {
puts $file_handle "/* Definitions for driver [string toupper [get_property NAME $drv_handle]] */"
# Define NUM_INSTANCES
puts $file_handle "#define [xget_dname $drv_string $arg] [llength $periphs]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [llength $periphs]"
set args [lreplace $args $posn $posn]
}
# Check if it is a driver parameter
@ -164,7 +164,7 @@ proc xdefine_pcie_include_file {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
lappend newargs $arg
} else {
puts $file_handle "#define [xget_dname $drv_string $arg] [get_property CONFIG.$arg $drv_handle]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [get_property CONFIG.$arg $drv_handle]"
}
}
set args $newargs
@ -179,7 +179,7 @@ proc xdefine_pcie_include_file {drv_handle file_name drv_string args} {
set value $device_id
incr device_id
} else {
set value [xget_param_value $periph $arg]
set value [::hsm::utils::get_param_value $periph $arg]
}
if {[llength $value] == 0} {
set value 0
@ -188,20 +188,20 @@ proc xdefine_pcie_include_file {drv_handle file_name drv_string args} {
# For Vivado, C_BASEADDR is renamed to BASEADDR
if { $value == 0 && $arg == "C_BASEADDR" } {
set arg "BASEADDR"
set value [xget_param_value $periph $arg]
set value [::hsm::utils::get_param_value $periph $arg]
}
# For Vivado, C_HIGHADDR is renamed to HIGHADDR
if { $value == 0 && $arg == "C_HIGHADDR" } {
set arg "HIGHADDR"
set value [xget_param_value $periph $arg]
set value [::hsm::utils::get_param_value $periph $arg]
}
set value [xformat_addr_string $value $arg]
set value [::hsm::utils::format_addr_string $value $arg]
if {[string compare -nocase "HW_VER" $arg] == 0} {
puts $file_handle "#define [xget_name $periph $arg] \"$value\""
puts $file_handle "#define [::hsm::utils::get_ip_param_name $periph $arg] \"$value\""
} else {
puts $file_handle "#define [xget_name $periph $arg] $value"
puts $file_handle "#define [::hsm::utils::get_ip_param_name $periph $arg] $value"
}
}
puts $file_handle ""
@ -212,10 +212,10 @@ proc xdefine_pcie_include_file {drv_handle file_name drv_string args} {
proc xdefine_pcie_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -250,12 +250,12 @@ proc xdefine_pcie_canonical_xpars {drv_handle file_name drv_string args} {
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
foreach arg $args {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
# The commented out rvalue is the name of the instance-specific constant
# set rvalue [xget_name $periph $arg]
# set rvalue [::hsm::utils::get_ip_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter
set rvalue [xget_param_value $periph $arg]
set rvalue [::hsm::utils::get_param_value $periph $arg]
if {[llength $rvalue] == 0} {
set rvalue 0
}
@ -263,16 +263,16 @@ proc xdefine_pcie_canonical_xpars {drv_handle file_name drv_string args} {
# For Vivado, C_BASEADDR is renamed to BASEADDR
if { $rvalue == 0 && $arg == "C_BASEADDR" } {
set arg "BASEADDR"
set rvalue [xget_param_value $periph $arg]
set rvalue [::hsm::utils::get_param_value $periph $arg]
}
# For Vivado, C_HIGHADDR is renamed to HIGHADDR
if { $rvalue == 0 && $arg == "C_HIGHADDR" } {
set arg "HIGHADDR"
set rvalue [xget_param_value $periph $arg]
set rvalue [::hsm::utils::get_param_value $periph $arg]
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue"

View file

@ -67,10 +67,10 @@ proc generate {drv_handle} {
proc xdefine_vdma_include_file {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [hsm::utils::get_common_driver_ips $drv_handle]
# Handle special cases
set arg "NUM_INSTANCES"
@ -78,7 +78,7 @@ proc xdefine_vdma_include_file {drv_handle file_name drv_string args} {
if {$posn > -1} {
puts $file_handle "/* Definitions for driver [string toupper [get_property NAME $drv_handle]] */"
# Define NUM_INSTANCES
puts $file_handle "#define [xget_dname $drv_string $arg] [llength $periphs]"
puts $file_handle "#define [hsm::utils::get_driver_param_name $drv_string $arg] [llength $periphs]"
set args [lreplace $args $posn $posn]
}
# Check if it is a driver parameter
@ -89,7 +89,7 @@ proc xdefine_vdma_include_file {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
lappend newargs $arg
} else {
puts $file_handle "#define [xget_dname $drv_string $arg] [get_property CONFIG.$arg $drv_handle]"
puts $file_handle "#define [hsm::utils::get_driver_param_name $drv_string $arg] [get_property CONFIG.$arg $drv_handle]"
}
}
set args $newargs
@ -104,7 +104,7 @@ proc xdefine_vdma_include_file {drv_handle file_name drv_string args} {
set value $device_id
incr device_id
} else {
set value [xget_param_value $periph $arg]
set value [::hsm::utils::get_param_value $periph $arg]
}
if {[llength $value] == 0} {
set value 0
@ -113,16 +113,16 @@ proc xdefine_vdma_include_file {drv_handle file_name drv_string args} {
# to VDMA IPv6.00a (IPI release). For all the previous versions these
# parameters should be set.
if {[string first "ENABLE_DEBUG" $arg] >= 0} {
set foundparam [xget_param_value $periph $arg]
set foundparam [::hsm::utils::get_param_value $periph $arg]
if {[llength $foundparam] == 0} {
set value 1
}
}
set value [xformat_addr_string $value $arg]
set value [hsm::utils::format_addr_string $value $arg]
if {[string compare -nocase "HW_VER" $arg] == 0} {
puts $file_handle "#define [xget_name $periph $arg] \"$value\""
puts $file_handle "#define [hsm::utils::get_ip_param_name $periph $arg] \"$value\""
} else {
puts $file_handle "#define [xget_name $periph $arg] $value"
puts $file_handle "#define [hsm::utils::get_ip_param_name $periph $arg] $value"
}
}
puts $file_handle ""
@ -133,10 +133,10 @@ proc xdefine_vdma_include_file {drv_handle file_name drv_string args} {
proc xdefine_vdma_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -171,12 +171,12 @@ proc xdefine_vdma_canonical_xpars {drv_handle file_name drv_string args} {
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
foreach arg $args {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [hsm::utils::get_driver_param_name $canonical_name $arg]
# The commented out rvalue is the name of the instance-specific constant
# set rvalue [xget_name $periph $arg]
# set rvalue [hsm::utils::get_driver_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter
set rvalue [xget_param_value $periph $arg]
set rvalue [::hsm::utils::get_param_value $periph $arg]
if {[llength $rvalue] == 0} {
set rvalue 0
}
@ -184,12 +184,12 @@ proc xdefine_vdma_canonical_xpars {drv_handle file_name drv_string args} {
# to VDMA IPv6.00a (IPI release). For all the previous versions these
# parameters should be set.
if {[string first "ENABLE_DEBUG" $arg] >= 0} {
set foundparam [xget_param_value $periph $arg]
set foundparam [::hsm::utils::get_param_value $periph $arg]
if {[llength $foundparam] == 0} {
set rvalue 1
}
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [hsm::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue"

View file

@ -60,7 +60,7 @@ proc generate {drv_handle} {
# and sort them in the following order: *BASE* *HIGH* *CTRL*BASE* *CTRL*HIGH*
#
proc find_addr_params {periph} {
set addr_params [xfind_addr_params $periph]
set addr_params [::hsm::utils::find_addr_params $periph]
set sorted_addr_params {}
foreach addr_param $addr_params {
@ -105,17 +105,17 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
]
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Handle special cases
set arg "NUM_INSTANCES"
set posn [lsearch -exact $args $arg]
if {$posn > -1} {
puts $file_handle "/* Definitions for driver [string toupper [get_property NAME $drv_handle]] */"
# Define NUM_INSTANCES
puts $file_handle "#define [xget_dname $drv_string $arg] [llength $periphs]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [llength $periphs]"
set args [lreplace $args $posn $posn]
}
@ -127,7 +127,7 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
lappend newargs $arg
} else {
puts $file_handle "#define [xget_dname $drv_string $arg] [xget_value $drv_handle "PARAMETER" $arg]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [xget_value $drv_handle "PARAMETER" $arg]"
}
}
set args $newargs
@ -157,7 +157,7 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
}
}
if {$match == 0} {
set value [xget_param_value $periph $arg]
set value [::hsm::utils::get_param_value $periph $arg]
}
} elseif { $periph_type == "lmb_bram_if_cntlr" && [string compare -nocase "C_S_AXI_DATA_WIDTH" $arg] == 0 } {
# DATA_WIDTH = 32 for lmb_bram_if_cntlr
@ -169,8 +169,8 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
set value 0
}
set value [xformat_addr_string $value $arg]
set arg_name [xget_dname $periph $arg]
set value [::hsm::utils::format_addr_string $value $arg]
set arg_name [::hsm::utils::get_driver_param_name $periph $arg]
if { [string compare -nocase "C_S_AXI_DATA_WIDTH" $arg] == 0 } {
regsub "S_AXI_" $arg_name "" arg_name
}
@ -181,8 +181,8 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
}
}
if {$have_ecc == 0} {
puts $file_handle "#define [xget_dname $periph "C_S_AXI_CTRL_BASEADDR" ] 0xFFFFFFFF "
puts $file_handle "#define [xget_dname $periph "C_S_AXI_CTRL_HIGHADDR" ] 0xFFFFFFFF "
puts $file_handle "#define [::hsm::utils::get_driver_param_name $periph "C_S_AXI_CTRL_BASEADDR" ] 0xFFFFFFFF "
puts $file_handle "#define [::hsm::utils::get_driver_param_name $periph "C_S_AXI_CTRL_HIGHADDR" ] 0xFFFFFFFF "
}
puts $file_handle ""
}
@ -197,7 +197,7 @@ proc xdefine_config_file {drv_handle file_name drv_string args} {
set filename [file join "src" $file_name]
file delete $filename
set config_file [open $filename w]
xprint_generated_header $config_file "Driver configuration"
::hsm::utils::write_c_header $config_file "Driver configuration"
puts $config_file "#include \"xparameters.h\""
puts $config_file "#include \"[string tolower $drv_string].h\""
puts $config_file "\n/*"
@ -205,7 +205,7 @@ proc xdefine_config_file {drv_handle file_name drv_string args} {
puts $config_file "*/\n"
puts $config_file [format "%s_Config %s_ConfigTable\[\] =" $drv_string $drv_string]
puts $config_file "\{"
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
set start_comma ""
foreach periph $periphs {
set have_ecc [get_property CONFIG.C_ECC $periph]
@ -216,13 +216,13 @@ proc xdefine_config_file {drv_handle file_name drv_string args} {
set arguments [concat $args $addr_params]
foreach arg $arguments {
set local_value [get_property CONFIG.$arg $periph]
set arg_name [xget_dname $periph $arg]
set arg_name [::hsm::utils::get_driver_param_name $periph $arg]
# If a parameter isn't found locally (in the current
# peripheral), we will (for some obscure and ancient reason)
# look in peripherals connected via point to point links
if { [string compare -nocase $local_value ""] == 0} {
set p2p_name ""
set p2p_name [xget_p2p_name $periph $arg]
set p2p_name [::hsm::utils::get_p2p_name $periph $arg]
if { [string compare -nocase $p2p_name ""] == 0} {
if { [string compare -nocase "C_S_AXI_DATA_WIDTH" $arg] == 0 } {
regsub "S_AXI_" $arg_name "" arg_name
@ -251,9 +251,9 @@ proc xdefine_config_file {drv_handle file_name drv_string args} {
set comma ",\n"
}
if {$have_ecc == 0} {
set arg_name [xget_dname $periph "C_S_AXI_CTRL_BASEADDR"]
set arg_name [::hsm::utils::get_driver_param_name $periph "C_S_AXI_CTRL_BASEADDR"]
puts -nonewline $config_file [format "%s\t\t%s" $comma $arg_name]
set arg_name [xget_dname $periph "C_S_AXI_CTRL_HIGHADDR"]
set arg_name [::hsm::utils::get_driver_param_name $periph "C_S_AXI_CTRL_HIGHADDR"]
puts -nonewline $config_file [format "%s\t\t%s" $comma $arg_name]
}
puts -nonewline $config_file "\n\t\}"
@ -283,10 +283,10 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
]
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -311,7 +311,7 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
set i 0
foreach periph $periphs {
#set have_ecc [xget_param_value $periph "C_ECC"]
#set have_ecc [::hsm::utils::get_param_value $periph "C_ECC"]
set have_ecc [get_property CONFIG.C_ECC $periph]
set periph_type [get_property IP_NAME $periph]
@ -330,7 +330,7 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
set arguments [concat $args $addr_params]
foreach arg $arguments {
set match 0
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
regsub "S_AXI_" $lvalue "" lvalue
if { $periph_type == "axi_bram_ctrl" && $have_ecc == 1 } {
@ -346,12 +346,12 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
# DATA_WIDTH = 32 for lmb_bram_if_cntlr
set rvalue 32
} elseif {$match == 0} {
set rvalue [xget_param_value $periph $arg]
set rvalue [::hsm::utils::get_param_value $periph $arg]
}
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue"
}

View file

@ -93,7 +93,7 @@ proc gen_include_files {swproj mhsinst} {
return ""
}
set bram_intr [is_ip_interrupting_current_processor $mhsinst]
set bram_intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if { ${bram_intr} == 1 } {
set inc_file_lines {xbram.h bram_header.h bram_intr_header.h}
} else {
@ -113,7 +113,7 @@ proc gen_src_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set bram_intr [is_ip_interrupting_current_processor $mhsinst]
set bram_intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if { ${bram_intr} == 1 } {
set inc_file_lines {examples/xbram_example.c examples/xbram_intr_example.c data/bram_header.h data/bram_intr_header.h}
} else {
@ -132,7 +132,7 @@ proc gen_init_code {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set bram_intr [is_ip_interrupting_current_processor $mhsinst]
set bram_intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set ipname [get_property NAME $mhsinst]
if { ${bram_intr} == 1 } {
set decl " static XBram ${ipname}_Bram;"
@ -151,18 +151,18 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
} else {
set hasStdout 1
}
set bram_intr [is_ip_interrupting_current_processor $mhsinst]
set bram_intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if { ${bram_intr} == 1 } {
set intr_pin_name [get_pins -of_objects [get_cells $ipname] -filter "TYPE==INTERRUPT"]
set intcname [get_connected_interrupt_controller $ipname $intr_pin_name]
set intcname [::hsm::utils::get_connected_intr_cntrl $ipname $intr_pin_name]
set intcvar intc
set proc [get_sw_processor]
set mbproc [string first "microblaze" $proc]
@ -285,7 +285,7 @@ proc gen_testfunc_call {swproj mhsinst} {
# Get XPAR_ macro for each baseaddr param
foreach baseaddr $baseaddrs {
lappend baseaddr_macros [xget_name $mhsinst $baseaddr]
lappend baseaddr_macros [::hsm::utils::get_ip_param_name $mhsinst $baseaddr]
}
foreach baseaddr $baseaddr_macros {

View file

@ -103,7 +103,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0

View file

@ -64,7 +64,7 @@ proc gen_src_files {swproj mhsinst} {
if {$swproj == 0} {
return ""
}
set isintr [is_ip_interrupting_current_processor $mhsinst]
set isintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$swproj == 1} {
if {$isintr == 1} {
set inc_file_lines {examples/xcanps_polled_example.c examples/xcanps_intr_example.c data/canps_header.h}
@ -102,14 +102,14 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
} else {
set hasStdout 1
}
set isintr [is_ip_interrupting_current_processor $mhsinst]
set isintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set intcvar intc
set testfunc_call ""

View file

@ -70,7 +70,7 @@ proc generate {drv_handle} {
global env
global tcl_platform
set osname "[xget_hostos_platform]/"
set osname "[::hsm::utils::get_hostos_platform]/"
#---------------------------------------------------------------------------
# Start of mb-gcc specific processing..
@ -251,7 +251,7 @@ proc generate {drv_handle} {
file copy -force [file join $env(XILINX_SDK) "data/embeddedsw/lib/microblaze/src" $filename] $targetdir
file mtime [file join $targetdir $filename] [clock seconds]
set xmd_addr_file [open "../../code/xmdstubaddr.s" w]
set xmdstub_periph_baseaddr [xformat_addr_string [xget_value $xmdstub_periph_handle "PARAMETER" "C_BASEADDR"] "C_BASEADDR"]
set xmdstub_periph_baseaddr [::hsm::utils::format_addr_string [xget_value $xmdstub_periph_handle "PARAMETER" "C_BASEADDR"] "C_BASEADDR"]
puts $xmd_addr_file ".equ DEBUG_PERIPHERAL_BASEADDRESS, $xmdstub_periph_baseaddr"
close $xmd_addr_file
# execute make
@ -270,10 +270,10 @@ proc generate {drv_handle} {
#--------------------------
# Handle the Bus Frequency
#--------------------------
set file_handle [xopen_include_file "xparameters.h"]
set file_handle [::hsm::utils::open_include_file "xparameters.h"]
puts $file_handle "/* Definitions for bus frequencies */"
set bus_array {"M_AXI_DP" "M_AXI_IP"}
set bus_freq [xget_ip_clk_pin_freq $periph "Clk"]
set bus_freq [::hsm::utils::get_clk_pin_freq $periph "Clk"]
if {[llength $bus_freq] == 0} {
set bus_freq "100000000"
}
@ -283,7 +283,7 @@ proc generate {drv_handle} {
if { $bhandle == "" } {
continue;
}
puts $file_handle "#define [xget_dname "cpu" [format "%s_FREQ_HZ" $bus_inst]] $bus_freq"
puts $file_handle "#define [::hsm::utils::get_driver_param_name "cpu" [format "%s_FREQ_HZ" $bus_inst]] $bus_freq"
}
puts $file_handle "/******************************************************************/"
@ -295,7 +295,7 @@ proc generate {drv_handle} {
if { $bhandle == "" } {
continue;
}
puts $file_handle "#define [xget_dname "PROC_BUS" [format "%d_FREQ_HZ" $bus_id]] $bus_freq"
puts $file_handle "#define [::hsm::utils::get_driver_param_name "PROC_BUS" [format "%d_FREQ_HZ" $bus_id]] $bus_freq"
incr bus_id
}
puts $file_handle "/******************************************************************/"
@ -304,8 +304,8 @@ proc generate {drv_handle} {
#--------------------------
# define CORE_CLOCK_FREQ_HZ
#--------------------------
set clk_freq [xget_ip_clk_pin_freq $periph "Clk"]
puts $file_handle "#define [xget_dname "cpu" CORE_CLOCK_FREQ_HZ] $clk_freq"
set clk_freq [::hsm::utils::get_clk_pin_freq $periph "Clk"]
puts $file_handle "#define [::hsm::utils::get_driver_param_name "cpu" CORE_CLOCK_FREQ_HZ] $clk_freq"
puts $file_handle "#define [format "XPAR_%s_CORE_CLOCK_FREQ_HZ" [string toupper $proctype]] $clk_freq"
puts $file_handle "\n/******************************************************************/\n"
@ -314,12 +314,12 @@ proc generate {drv_handle} {
#--------------------------
# define all params
#--------------------------
xdefine_all_params $drv_handle "xparameters.h"
::hsm::utils::define_all_params $drv_handle "xparameters.h"
#----------------------------------------
# define all params without instance name
#----------------------------------------
xdefine_processor_params $drv_handle "xparameters.h"
::hsm::utils::define_processor_params $drv_handle "xparameters.h"
xdefine_addr_params_for_ext_intf $drv_handle "xparameters.h"
}
proc xdefine_addr_params_for_ext_intf {drvhandle file_name} {
@ -327,7 +327,7 @@ proc xdefine_addr_params_for_ext_intf {drvhandle file_name} {
set hw_proc_handle [get_cells [get_property HW_INSTANCE $sw_proc_handle ]]
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
set mem_ranges [get_mem_ranges -of_objects $hw_proc_handle]
foreach mem_range $mem_ranges {
@ -349,7 +349,7 @@ proc xdefine_addr_params_for_ext_intf {drvhandle file_name} {
set name [format "XPAR_%s_" $name]
if {$bparam_value != ""} {
set value [xformat_addr_string $bparam_value $bparam_name]
set value [::hsm::utils::format_addr_string $bparam_value $bparam_name]
set param [string toupper $bparam_name]
if {[string match C_* $param]} {
set name [format "%s%s" $name [string range $param 2 end]]
@ -363,7 +363,7 @@ proc xdefine_addr_params_for_ext_intf {drvhandle file_name} {
set name [string toupper [get_property NAME $mem_range]]
set name [format "XPAR_%s_" $name]
if {$hparam_value != ""} {
set value [xformat_addr_string $hparam_value $hparam_name]
set value [::hsm::utils::format_addr_string $hparam_value $hparam_name]
set param [string toupper $hparam_name]
if {[string match C_* $param]} {
set name [format "%s%s" $name [string range $param 2 end]]

View file

@ -56,11 +56,11 @@ proc xdefine_cortexa9_params {drvhandle} {
set sw_proc_handle [get_sw_processor]
set hw_proc_handle [get_cells [get_property HW_INSTANCE $sw_proc_handle ]]
set periphs [xget_sw_iplist_for_driver $drvhandle]
set periphs [::hsm::utils::get_common_driver_ips $drvhandle]
set lprocs [get_cells -filter "IP_NAME==ps7_cortexa9"]
set lprocs [lsort $lprocs]
set config_inc [xopen_include_file "xparameters.h"]
set config_inc [::hsm::utils::open_include_file "xparameters.h"]
puts $config_inc "/* Definition for CPU ID */"
foreach periph $periphs {
@ -86,7 +86,7 @@ proc xdefine_addr_params_for_ext_intf {drvhandle file_name} {
set hw_proc_handle [get_cells [get_property HW_INSTANCE $sw_proc_handle ]]
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
set mem_ranges [get_mem_ranges -of_objects $hw_proc_handle]
foreach mem_range $mem_ranges {
@ -111,7 +111,7 @@ proc xdefine_addr_params_for_ext_intf {drvhandle file_name} {
if {$bparam_value != ""} {
set value [xformat_addr_string $bparam_value $bparam_name]
set value [::hsm::utils::format_addr_string $bparam_value $bparam_name]
set param [string toupper $bparam_name]
if {[string match C_* $param]} {
set name [format "%s%s" $name [string range $param 2 end]]
@ -125,7 +125,7 @@ proc xdefine_addr_params_for_ext_intf {drvhandle file_name} {
set name [string toupper [get_property NAME $mem_range]]
set name [format "XPAR_%s_" $name]
if {$hparam_value != ""} {
set value [xformat_addr_string $hparam_value $hparam_name]
set value [::hsm::utils::format_addr_string $hparam_value $hparam_name]
set param [string toupper $hparam_name]
if {[string match C_* $param]} {
set name [format "%s%s" $name [string range $param 2 end]]

View file

@ -53,10 +53,10 @@ proc generate {drv_handle} {
proc xdefine_include_file_zynq {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Handle special cases
set arg "NUM_INSTANCES"
@ -64,7 +64,7 @@ proc xdefine_include_file_zynq {drv_handle file_name drv_string args} {
if {$posn > -1} {
puts $file_handle "/* Definitions for driver [string toupper [get_property NAME $drv_handle]] */"
# Define NUM_INSTANCES
puts $file_handle "#define [xget_dname $drv_string $arg] [llength $periphs]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [llength $periphs]"
set args [lreplace $args $posn $posn]
}
# Check if it is a driver parameter
@ -75,7 +75,7 @@ proc xdefine_include_file_zynq {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
lappend newargs $arg
} else {
puts $file_handle "#define [xget_dname $drv_string $arg] [get_property CONFIG.$arg $drv_handle]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [get_property CONFIG.$arg $drv_handle]"
}
}
set args $newargs
@ -90,13 +90,13 @@ proc xdefine_include_file_zynq {drv_handle file_name drv_string args} {
set value $device_id
incr device_id
} else {
set value [xget_param_value $periph $arg]
set value [::hsm::utils::get_param_value $periph $arg]
}
if {[llength $value] == 0} {
set value 0
}
set value [xformat_addr_string $value $arg]
set arg_name [xget_name $periph $arg]
set value [::hsm::utils::format_addr_string $value $arg]
set arg_name [::hsm::utils::get_ip_param_name $periph $arg]
regsub "S_AXI_" $arg_name "" arg_name
if {[string compare -nocase "HW_VER" $arg] == 0} {
puts $file_handle "#define $arg_name \"$value\""
@ -114,7 +114,7 @@ proc xdefine_devcfg_config_file {drv_handle file_name drv_string args} {
set filename [file join "src" $file_name]
file delete $filename
set config_file [open $filename w]
xprint_generated_header $config_file "Driver configuration"
::hsm::utils::write_c_header $config_file "Driver configuration"
puts $config_file "#include \"xparameters.h\""
puts $config_file "#include \"xdevcfg.h\""
puts $config_file "\n/*"
@ -122,7 +122,7 @@ proc xdefine_devcfg_config_file {drv_handle file_name drv_string args} {
puts $config_file "*/\n"
puts $config_file [format "%s_Config %s_ConfigTable\[\] =" $drv_string $drv_string]
puts $config_file "\{"
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
set start_comma ""
foreach periph $periphs {
puts $config_file [format "%s\t\{" $start_comma]
@ -136,9 +136,9 @@ proc xdefine_devcfg_config_file {drv_handle file_name drv_string args} {
# peripheral), we will (for some obscure and ancient reason)
# look in peripherals connected via point to point links
if { [string compare -nocase $local_value ""] == 0} {
set p2p_name [xget_p2p_name $periph $arg]
set p2p_name [::hsm::utils::get_p2p_name $periph $arg]
if { [string compare -nocase $p2p_name ""] == 0} {
set arg_name [xget_name $periph $arg]
set arg_name [::hsm::utils::get_ip_param_name $periph $arg]
regsub "S_AXI_" $arg_name "" arg_name
puts -nonewline $config_file [format "%s\t\t%s" $comma $arg_name]
} else {
@ -146,12 +146,12 @@ proc xdefine_devcfg_config_file {drv_handle file_name drv_string args} {
puts -nonewline $config_file [format "%s\t\t%s" $comma $p2p_name]
}
} else {
set arg_name [xget_name $periph $arg]
set arg_name [::hsm::utils::get_ip_param_name $periph $arg]
regsub "S_AXI_" $arg_name "" arg_name
puts -nonewline $config_file [format "%s\t\t%s" $comma $arg_name]
}
} else {
set arg_name [xget_dname $drv_string $arg]
set arg_name [::hsm::utils::get_driver_param_name $drv_string $arg]
regsub "S_AXI_" $arg_name "" arg_name
puts -nonewline $config_file [format "%s\t\t%s" $comma $arg_name]
}
@ -175,10 +175,10 @@ proc xdefine_devcfg_config_file {drv_handle file_name drv_string args} {
#-----------------------------------------------------------------------------
proc xdefine_canonical_xpars_zynq {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -213,17 +213,17 @@ proc xdefine_canonical_xpars_zynq {drv_handle file_name drv_string args} {
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
foreach arg $args {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
regsub "S_AXI_" $lvalue "" lvalue
# The commented out rvalue is the name of the instance-specific constant
# set rvalue [xget_name $periph $arg]
# set rvalue [::hsm::utils::get_ip_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter
set rvalue [xget_param_value $periph $arg]
set rvalue [::hsm::utils::get_param_value $periph $arg]
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue"

View file

@ -92,7 +92,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0

View file

@ -96,7 +96,7 @@ proc gen_testfunc_call {swproj mhsinst} {
if {"ps7_dma_ns" == $ipname} {
return ""
}
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -104,7 +104,7 @@ proc gen_testfunc_call {swproj mhsinst} {
set hasStdout 1
}
set isintr [is_ip_interrupting_current_processor $mhsinst]
set isintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set intcvar intc
set testfunc_call ""

View file

@ -34,6 +34,7 @@
# 4.0 adk 10/12/13 Updated as per the New Tcl API's
##############################################################################
## @BEGIN_CHANGELOG EDK_I
##
## - include header files
@ -69,7 +70,7 @@ proc gen_include_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set ifemacliteintr [is_ip_interrupting_current_processor $mhsinst]
set ifemacliteintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifemacliteintr == 1} {
set inc_file_lines {xemaclite.h xemaclite_example.h emaclite_header.h emaclite_intr_header.h}
} else {
@ -84,7 +85,7 @@ proc gen_src_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set ifemacliteintr [is_ip_interrupting_current_processor $mhsinst]
set ifemacliteintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifemacliteintr == 1} {
set inc_file_lines {examples/xemaclite_example.h examples/xemaclite_polled_example.c examples/xemaclite_intr_example.c examples/xemaclite_example_util.c data/emaclite_header.h data/emaclite_intr_header.h}
} else {
@ -105,7 +106,7 @@ proc gen_init_code {swproj mhsinst} {
if {$swproj == 1} {
set ipname [get_property NAME $mhsinst]
set ifemacliteintr [is_ip_interrupting_current_processor $mhsinst]
set ifemacliteintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifemacliteintr == 1} {
set decl " static XEmacLite ${ipname}_EmacLite;"
set inc_file_lines $decl
@ -123,9 +124,9 @@ proc gen_testfunc_call {swproj mhsinst} {
return ""
}
set ifemacliteintr [is_ip_interrupting_current_processor $mhsinst]
set ifemacliteintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -136,7 +137,7 @@ proc gen_testfunc_call {swproj mhsinst} {
if {$ifemacliteintr == 1} {
set intr_pin_name [get_pins -of_objects [get_cells $ipname] -filter "TYPE==INTERRUPT"]
set intcname [get_connected_interrupt_controller $ipname $intr_pin_name]
set intcname [::hsm::utils::get_connected_intr_cntrl $ipname $intr_pin_name]
set intcvar intc
set proc [get_property IP_NAME [get_cells [get_sw_processor]]]
}

View file

@ -56,7 +56,7 @@ proc generate {drv_handle} {
}
proc generate_gmii2rgmii_params {drv_handle file_name} {
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
set proc_handle [get_sw_processor]
set hwproc_handle [get_cells $proc_handle]
set mhs_handle [get_cells]
@ -103,7 +103,7 @@ proc is_gmii2rgmii_conv_present {slave} {
}
}
if { $ipconv != 0 } {
set port_value [xget_hw_port_value $ipconv "gmii_txd"]
set port_value [::hsm::utils::get_net_name $ipconv "gmii_txd"]
if { $port_value != 0 } {
set tmp [string first "ENET0" $port_value]
if { $tmp >= 0 } {
@ -147,7 +147,7 @@ proc scan_int_parameter_value {ip_handle name} {
}
proc generate_sgmii_params {drv_handle file_name} {
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
set proc_handle [get_sw_processor]
set hwproc_handle [get_cells [get_property HW_INSTANCE $proc_handle]]
set mhs_handle [get_cells]
@ -184,7 +184,7 @@ proc is_gige_pcs_pma_ip_present {slave} {
set convipname [get_property NAME $ip]
set periph [get_property NAME $ip]
if { [string compare -nocase $periph "gig_ethernet_pcs_pma"] == 0} {
set sgmii_param [xget_param_value $ip c_is_sgmii]
set sgmii_param [::hsm::utils::get_param_value $ip c_is_sgmii]
if {$sgmii_param == true} {
set ipconv $ip
}
@ -192,7 +192,7 @@ proc is_gige_pcs_pma_ip_present {slave} {
}
}
if { $ipconv != 0 } {
set port_value [xget_hw_port_value $ipconv "gmii_txd"]
set port_value [::hsm::utils::get_net_name $ipconv "gmii_txd"]
if { $port_value != 0 } {
set tmp [string first "ENET0" $port_value]
if { $tmp >= 0 } {

View file

@ -99,7 +99,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -107,7 +107,7 @@ proc gen_testfunc_call {swproj mhsinst} {
set hasStdout 1
}
set isintr [is_ip_interrupting_current_processor $mhsinst]
set isintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set intcvar intc

View file

@ -65,12 +65,12 @@ proc generate {drv_handle} {
proc xdefine_include_file_membank {drv_handle file_name} {
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
foreach periph $periphs {
set addr_params ""
set addr_params [xfind_addr_params $periph]
xdefine_membank $periph $file_name $addr_params
set addr_params [::hsm::utils::find_addr_params $periph]
::hsm::utils::define_membank $periph $file_name $addr_params
}
}
@ -80,10 +80,10 @@ proc xdefine_include_file_membank {drv_handle file_name} {
#
proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -119,30 +119,30 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
# Generate canonical definitions for memory banks
set addr_params ""
set addr_params [xfind_addr_params $periph]
set addr_params [::hsm::utils::find_addr_params $periph]
set arguments [concat $args $addr_params]
foreach arg $arguments {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
# The commented out rvalue is the name of the instance-specific constant
# set rvalue [xget_name $periph $arg]
# set rvalue [::hsm::utils::get_ip_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter
set rvalue [get_property CONFIG.$arg $periph]
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue"
}
if {$i == 0} {
puts $file_handle ""
set bus_name [xget_hw_busif_value $periph "SPLB"]
set bus_name [::hsm::utils::get_intfnet_name $periph "SPLB"]
if { [string compare -nocase $bus_name ""] != 0 } {
puts $file_handle "#define XPAR_XPS_MCH_EMC"
} else {
set bus_name [xget_hw_busif_value $periph "S_AXI_MEM"]
set bus_name [::hsm::utils::get_intfnet_name $periph "S_AXI_MEM"]
if { [string compare -nocase $bus_name ""] != 0 } {
puts $file_handle "#define XPAR_AXI_EMC"
}

View file

@ -149,7 +149,7 @@ proc gen_testfunc_call {swproj mhsinst} {
# Get XPAR_ macro for each baseaddr param
foreach baseaddr $baseaddrs {
lappend baseaddr_macros [xget_name $mhsinst $baseaddr]
lappend baseaddr_macros [::hsm::utils::get_ip_param_name $mhsinst $baseaddr]
}
foreach baseaddr $baseaddr_macros {

View file

@ -39,5 +39,5 @@
proc generate {drv_handle} {
xdefine_addr_params $drv_handle "xparameters.h"
::hsm::utils::define_addr_params $drv_handle "xparameters.h"
}

View file

@ -88,7 +88,7 @@ proc gen_include_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set gpio_intr [is_ip_interrupting_current_processor $mhsinst]
set gpio_intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set all_inputs [get_property CONFIG.C_ALL_INPUTS $mhsinst]
if { ${gpio_intr} == 1 && ${all_inputs} == 1 } {
@ -108,7 +108,7 @@ proc gen_src_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set gpio_intr [is_ip_interrupting_current_processor $mhsinst]
set gpio_intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set all_inputs [get_property CONFIG.C_ALL_INPUTS $mhsinst]
if { ${gpio_intr} == 1 && ${all_inputs} == 1 } {
@ -127,7 +127,7 @@ proc gen_testfunc_def {swproj mhsinst} {
}
if {$swproj == 1} {
set gpio_isdual [get_property CONFIG.C_IS_DUAL $mhsinst]
set gpio_intr [is_ip_interrupting_current_processor $mhsinst]
set gpio_intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set all_inputs [get_property CONFIG.C_ALL_INPUTS $mhsinst]
if { ${gpio_intr} == 1 && ${all_inputs} == 1 } {
@ -153,7 +153,7 @@ proc gen_init_code {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set gpio_intr [is_ip_interrupting_current_processor $mhsinst]
set gpio_intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set all_inputs [get_property CONFIG.C_ALL_INPUTS $mhsinst]
set ipname [get_property NAME $mhsinst]
@ -174,9 +174,9 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set gpio_width [get_property CONFIG.C_GPIO_WIDTH $mhsinst]
set gpio_intr [is_ip_interrupting_current_processor $mhsinst]
set gpio_intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set gpio_isdual [get_property CONFIG.C_IS_DUAL $mhsinst]
set all_inputs [get_property CONFIG.C_ALL_INPUTS $mhsinst]
set stdout [get_property CONFIG.STDOUT [get_os]]
@ -187,7 +187,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
if { ${gpio_intr} == 1 && ${all_inputs} == 1 } {
set intr_pin_name [get_pins -of_objects [get_cells $ipname] -filter "TYPE==INTERRUPT"]
set intcname [get_connected_interrupt_controller $ipname $intr_pin_name]
set intcname [::hsm::utils::get_connected_intr_cntrl $ipname $intr_pin_name]
set intcvar intc
set proc [get_property IP_NAME [get_cells [get_sw_processor]]]
}

View file

@ -51,7 +51,7 @@ proc generate {drv_handle} {
# Create a definition in a header file
set filename "./src/xhwicap_family.h"
set filehandle [ open $filename a ]
xprint_generated_header $filehandle "Device family"
::hsm::utils::write_c_header $filehandle "Device family"
if {[string compare $family "kintex7"] == 0} {
puts $filehandle "#define XHI_FPGA_FAMILY 7\n"
} elseif {[string compare $family "virtex7"] == 0} {

View file

@ -89,7 +89,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0

View file

@ -95,7 +95,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0

View file

@ -91,7 +91,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0

View file

@ -96,7 +96,7 @@ proc generate {drv_handle} {
# Generate the following definitions in xparameters.h
# 2. BASEADDR, HIGHADDR, C_NUM_INTR_INPUTS, XPAR_INTC_MAX_NUM_INTR_INPUTS
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
set count [llength $periphs]
variable cascade
@ -105,30 +105,30 @@ proc generate {drv_handle} {
}
if {$cascade == 0} {
xdefine_max $drv_handle "xparameters.h" "XPAR_INTC_MAX_NUM_INTR_INPUTS" "C_NUM_INTR_INPUTS"
::hsm::utils::define_max $drv_handle "xparameters.h" "XPAR_INTC_MAX_NUM_INTR_INPUTS" "C_NUM_INTR_INPUTS"
} else {
set maxintrs 0
foreach periph $periphs {
set intrs [get_property CONFIG.C_NUM_INTR_INPUTS $periph]
set maxintrs [expr "$maxintrs + $intrs"]
}
set file_handle [xopen_include_file "xparameters.h"]
set file_handle [::hsm::utils::open_include_file "xparameters.h"]
puts $file_handle "#define XPAR_INTC_MAX_NUM_INTR_INPUTS $maxintrs"
close $file_handle
}
xdefine_if_all $drv_handle "xparameters.h" "XIntc" "C_HAS_IPR" "C_HAS_SIE" "C_HAS_CIE" "C_HAS_IVR"
::hsm::utils::define_if_all $drv_handle "xparameters.h" "XIntc" "C_HAS_IPR" "C_HAS_SIE" "C_HAS_CIE" "C_HAS_IVR"
xdefine_include_file $drv_handle "xparameters.h" "XIntc" "NUM_INSTANCES" "DEVICE_ID" "C_BASEADDR" "C_HIGHADDR" "C_KIND_OF_INTR" "C_HAS_FAST" "C_IVAR_RESET_VALUE" "C_NUM_INTR_INPUTS"
# Define XPAR_SINGLE_DEVICE_ID
if {$count == 1} {
xdefine_with_names $drv_handle [xget_sw_iplist_for_driver $drv_handle] "xparameters.h" "XPAR_INTC_SINGLE_BASEADDR" "C_BASEADDR" "XPAR_INTC_SINGLE_HIGHADDR" "C_HIGHADDR" "XPAR_INTC_SINGLE_DEVICE_ID" "DEVICE_ID"
::hsm::utils::define_with_names $drv_handle [::hsm::utils::get_common_driver_ips $drv_handle] "xparameters.h" "XPAR_INTC_SINGLE_BASEADDR" "C_BASEADDR" "XPAR_INTC_SINGLE_HIGHADDR" "C_HIGHADDR" "XPAR_INTC_SINGLE_DEVICE_ID" "DEVICE_ID"
}
set config_inc [xopen_include_file "xparameters.h"]
set config_inc [::hsm::utils::open_include_file "xparameters.h"]
# Generate config table, vector tables
intc_define_config_file $drv_handle $periphs $config_inc
@ -160,7 +160,7 @@ proc intc_define_config_file {drv_handle periphs config_inc} {
set filename [file join "src" $file_name]
file delete $filename
set config_file [open $filename w]
xprint_generated_header $config_file "Driver configuration"
::hsm::utils::write_c_header $config_file "Driver configuration"
puts $config_file "#include \"xparameters.h\""
puts $config_file "#include \"[string tolower $drv_string].h\""
puts $config_file "\n"
@ -187,9 +187,9 @@ proc intc_define_config_file {drv_handle periphs config_inc} {
# Check if this is a driver parameter or a peripheral parameter
set value [get_property CONFIG.$arg $drv_handle ]
if {[llength $value] == 0} {
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma [xget_name $periph $arg]]
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma [::hsm::utils::get_ip_param_name $periph $arg]]
} else {
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma [xget_dname $drv_string $arg]]
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma [::hsm::utils::get_driver_param_name $drv_string $arg]]
}
set comma ",\n"
}
@ -238,16 +238,16 @@ proc intc_define_vector_table {periph config_inc config_file} {
# Get pins/ports that are driving the interrupt
lappend source_pins
set source_pins [xget_source_pins $interrupt_pin]
set source_pins [::hsm::utils::get_source_pins $interrupt_pin]
set num_intr_inputs [get_property CONFIG.C_NUM_INTR_INPUTS $periph]
#calculate the total interrupt sources
set total_intr_ports [xget_connected_pin_count $interrupt_pin]
set total_intr_ports [::hsm::utils::get_connected_pin_count $interrupt_pin]
if {$num_intr_inputs != $total_intr_ports} {
puts "ERROR: Internal error: Num intr inputs $num_intr_inputs not the same as length of xget_interrupt_sources [llength $source_pins] hsm_error"
puts "ERROR: Internal error: Num intr inputs $num_intr_inputs not the same as length of ::hsm::utils::get_interrupt_sources [llength $source_pins] hsm_error"
return
}
@ -255,9 +255,9 @@ proc intc_define_vector_table {periph config_inc config_file} {
set i 0
foreach source_pin $source_pins {
if { [is_external_pin $source_pin]} {
if { [::hsm::utils::is_external_pin $source_pin]} {
#external interrupt port case
set width [xget_port_width $source_pin]
set width [::hsm::utils::get_port_width $source_pin]
for { set j 0 } { $j < $width } { incr j } {
set source_port_name($i) "[get_property NAME $source_pin]_$j"
set source_name($i) "system"
@ -333,10 +333,10 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
variable cascade
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -370,25 +370,25 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
foreach arg $args {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
# The commented out rvalue is the name of the instance-specific constant
# set rvalue [xget_name $periph $arg]
# set rvalue [::hsm::utils::get_ip_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter
set rvalue [xget_param_value $periph $arg]
set rvalue [::hsm::utils::get_param_value $periph $arg]
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue"
}
if {$cascade == 1} {
puts $file_handle "#define [xget_dname $canonical_name "INTC_TYPE"] [get_intctype $periph]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $canonical_name "INTC_TYPE"] [get_intctype $periph]"
} else {
puts $file_handle "#define [xget_dname $canonical_name "INTC_TYPE"] $cascade"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $canonical_name "INTC_TYPE"] $cascade"
}
puts $file_handle ""
incr i
@ -414,7 +414,7 @@ proc xredefine_intc {drvhandle config_inc} {
# Next define interrupt IDs for each connected peripheral
set periphs [xget_sw_iplist_for_driver $drvhandle]
set periphs [::hsm::utils::get_common_driver_ips $drvhandle]
set device_id 0
set periph_name [string toupper "intc"]
@ -424,7 +424,7 @@ proc xredefine_intc {drvhandle config_inc} {
set periph_ip_name [get_property NAME $periph]
# Get ports that are driving the interrupt
set source_pins [xget_interrupt_sources $periph]
set source_pins [::hsm::utils::get_interrupt_sources $periph]
if {$source_pins == ""} {
return
}
@ -432,7 +432,7 @@ proc xredefine_intc {drvhandle config_inc} {
lappend source_list
foreach source_pin $source_pins {
set source_pin_name($i) [get_property NAME $source_pin]
if {[is_external_pin $source_pin]} {
if {[::hsm::utils::is_external_pin $source_pin]} {
set source_name($i) "system"
} else {
set source_periph [get_cells -of_objects $source_pin]
@ -544,7 +544,7 @@ proc lcount {list match_entry} {
###################################################################
proc xfind_instance {drvhandle instname} {
set instlist [xget_sw_iplist_for_driver $drvhandle]
set instlist [::hsm::utils::get_common_driver_ips $drvhandle]
set i 0
foreach inst $instlist {
set name [get_property NAME $inst]
@ -563,13 +563,13 @@ proc xfind_instance {drvhandle instname} {
#
###################################################################################
proc check_cascade {drv_handle} {
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
foreach periph $periphs {
set i 0
set source_pins [xget_interrupt_sources $periph]
set source_pins [::hsm::utils::get_interrupt_sources $periph]
foreach source_pin $source_pins {
set source_pin_name($i) [get_property NAME $source_pin]
if { [is_external_pin $source_pin] } {
if { [::hsm::utils::is_external_pin $source_pin] } {
continue
}
set source_periph [get_cells -of_objects $source_pin ]
@ -592,8 +592,8 @@ proc check_cascade {drv_handle} {
##################################################################
proc get_intctype {periph} {
set iscascade [xget_param_value $periph "C_EN_CASCADE_MODE"]
set ismaster [xget_param_value $periph "C_CASCADE_MASTER"]
set iscascade [::hsm::utils::get_param_value $periph "C_EN_CASCADE_MODE"]
set ismaster [::hsm::utils::get_param_value $periph "C_CASCADE_MASTER"]
if {$iscascade == 1 && $ismaster == 1} {
set retval 1
} elseif {$iscascade == 1 && $ismaster == 0} {

View file

@ -108,7 +108,7 @@ if {$cascade == 1} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -129,7 +129,7 @@ if {$cascade == 1} {
}"
set ifintr [is_ip_interrupting_current_processor $mhsinst]
set ifintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifintr != 0} {
append testfunc_call "
@ -160,7 +160,7 @@ if {$cascade == 1} {
}
}"
set ifintr [is_ip_interrupting_current_processor $mhsinst]
set ifintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifintr != 0} {
append testfunc_call "
@ -186,13 +186,13 @@ if {$cascade == 1} {
proc check_cascade {mhsinst} {
set periphs [xget_sw_iplist_for_driver $mhsinst]
set periphs [::hsm::utils::get_common_driver_ips $mhsinst]
foreach periph $periphs {
set i 0
set source_pins [xget_interrupt_sources $periph]
set source_pins [::hsm::utils::get_interrupt_sources $periph]
foreach source_pin $source_pins {
set source_pin_name($i) [get_property NAME $source_pin]
if { [is_external_pin $source_pin] } {
if { [::hsm::utils::is_external_pin $source_pin] } {
continue
}
set source_periph [get_cells -of_objects $source_pin ]

View file

@ -121,7 +121,7 @@ proc generate {drv_handle} {
# 7. INTC: Set XPAR_IOMODULE_INTC_MAX_INTR_SIZE
set max_intr_size 0
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [hsm::utils::get_common_driver_ips $drv_handle]
foreach periph $periphs {
set periph_num_intr_internal [get_num_intr_internal $periph]
set periph_num_intr_inputs [get_num_intr_inputs $periph]
@ -132,16 +132,16 @@ proc generate {drv_handle} {
}
# 7. INTC: Define XPAR_SINGLE_BASEADDR, XPAR_SINGLE_HIGHADDR, and XPAR_SINGLE_DEVICE_ID
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [hsm::utils::get_common_driver_ips $drv_handle]
set count [llength $periphs]
if {$count == 1} {
xdefine_with_names $drv_handle [xget_sw_iplist_for_driver $drv_handle] "xparameters.h" \
hsm::utils::define_with_names $drv_handle [hsm::utils::get_common_driver_ips $drv_handle] "xparameters.h" \
"XPAR_IOMODULE_SINGLE_BASEADDR" "C_BASEADDR" \
"XPAR_IOMODULE_SINGLE_HIGHADDR" "C_HIGHADDR" \
"XPAR_IOMODULE_INTC_SINGLE_DEVICE_ID" "DEVICE_ID"
}
set config_inc [xopen_include_file "xparameters.h"]
set config_inc [hsm::utils::open_include_file "xparameters.h"]
puts $config_inc "#define XPAR_IOMODULE_INTC_MAX_INTR_SIZE $max_intr_size"
# 7. INTC: Generate config table, vector tables
iomodule_define_config_file $drv_handle $periphs $config_inc
@ -169,7 +169,7 @@ proc iomodule_define_config_file {drv_handle periphs config_inc} {
set filename [file join "src" $file_name]
file delete $filename
set config_file [open $filename w]
xprint_generated_header $config_file "Driver configuration"
hsm::utils::write_c_header $config_file "Driver configuration"
puts $config_file "#include \"xparameters.h\""
puts $config_file "#include \"[string tolower $drv_string].h\""
puts $config_file "\n"
@ -191,64 +191,64 @@ proc iomodule_define_config_file {drv_handle periphs config_inc} {
# Check if this is a driver parameter or a peripheral parameter
set value [get_property CONFIG.$arg $drv_handle]
if {[llength $value] == 0} {
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma [xget_name $periph $arg]]
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma [::hsm::utils::get_ip_param_name $periph $arg]]
} else {
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma [xget_dname $drv_string $arg]]
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma [hsm::utils::get_driver_param_name $drv_string $arg]]
}
set comma ",\n"
}
# add AckBeforeService as an arg to the config table - Ack Before for edge interrupts
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma "(([xget_name $periph C_INTC_LEVEL_EDGE] << 16) | 0x7FF)"]
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma "(([::hsm::utils::get_ip_param_name $periph C_INTC_LEVEL_EDGE] << 16) | 0x7FF)"]
# add the OPTIONS as an arg to the config table - default OPTIONS value is XIN_SVC_SGL_ISR_OPTION
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma $isr_options]
# add the FREQ as an arg to the config table
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma [xget_name $periph "C_FREQ"] ]
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma [::hsm::utils::get_ip_param_name $periph "C_FREQ"] ]
# add the BAUDRATE as an arg to the config table
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma [xget_name $periph "C_UART_BAUDRATE"] ]
puts -nonewline $tmp_config_file [format "%s\t\t%s" $comma [::hsm::utils::get_ip_param_name $periph "C_UART_BAUDRATE"] ]
# add the PIT use as an arg to the config table
puts $tmp_config_file [format "%s\t\t\{" $comma ]
for {set i 1} {$i <= 4} {incr i} {
puts $tmp_config_file [format "\t\t\t%s," [xget_name $periph "C_USE_PIT${i}"] ]
puts $tmp_config_file [format "\t\t\t%s," [::hsm::utils::get_ip_param_name $periph "C_USE_PIT${i}"] ]
}
puts -nonewline $tmp_config_file "\t\t\}"
# add the PIT sizes as an arg to the config table
puts $tmp_config_file [format "%s\t\t\{" $comma ]
for {set i 1} {$i <= 4} {incr i} {
puts $tmp_config_file [format "\t\t\t%s," [xget_name $periph "C_PIT${i}_SIZE"] ]
puts $tmp_config_file [format "\t\t\t%s," [::hsm::utils::get_ip_param_name $periph "C_PIT${i}_SIZE"] ]
}
puts -nonewline $tmp_config_file "\t\t\}"
# add the PIT sizes as an arg to the config table
puts $tmp_config_file [format "%s\t\t\{" $comma ]
for {set i 1} {$i <= 4} {incr i} {
puts $tmp_config_file [format "\t\t\t%s," [xget_name $periph "C_PIT${i}_EXPIRED_MASK"] ]
puts $tmp_config_file [format "\t\t\t%s," [::hsm::utils::get_ip_param_name $periph "C_PIT${i}_EXPIRED_MASK"] ]
}
puts -nonewline $tmp_config_file "\t\t\}"
# add the PIT prescalers as an arg to the config table
puts $tmp_config_file [format "%s\t\t\{" $comma ]
for {set i 1} {$i <= 4} {incr i} {
puts $tmp_config_file [format "\t\t\t%s," [xget_name $periph "C_PIT${i}_PRESCALER"] ]
puts $tmp_config_file [format "\t\t\t%s," [::hsm::utils::get_ip_param_name $periph "C_PIT${i}_PRESCALER"] ]
}
puts -nonewline $tmp_config_file "\t\t\}"
# add if PIT has readable counter as an arg to the config table
puts $tmp_config_file [format "%s\t\t\{" $comma ]
for {set i 1} {$i <= 4} {incr i} {
puts $tmp_config_file [format "\t\t\t%s," [xget_name $periph "C_PIT${i}_READABLE"] ]
puts $tmp_config_file [format "\t\t\t%s," [::hsm::utils::get_ip_param_name $periph "C_PIT${i}_READABLE"] ]
}
puts -nonewline $tmp_config_file "\t\t\}"
# add the GPO initialization values as an arg to the config table
puts $tmp_config_file [format "%s\t\t\{" $comma ]
for {set i 1} {$i <= 4} {incr i} {
puts $tmp_config_file [format "\t\t\t%s," [xget_name $periph "C_GPO${i}_INIT"] ]
puts $tmp_config_file [format "\t\t\t%s," [::hsm::utils::get_ip_param_name $periph "C_GPO${i}_INIT"] ]
}
puts -nonewline $tmp_config_file "\t\t\}"
@ -292,7 +292,7 @@ proc iomodule_define_vector_table {periph config_inc config_file} {
set periph_name [get_property NAME $periph]
# Get ports that are driving the interrupt
set source_ports [xget_interrupt_sources $periph]
set source_ports [hsm::utils::get_interrupt_sources $periph]
set num_intr_inputs [get_num_intr_inputs $periph]
set num_intr_internal [get_num_intr_internal $periph]
@ -306,7 +306,7 @@ proc iomodule_define_vector_table {periph config_inc config_file} {
set source_periph [get_cells -of_objects $source_pin ]
if { [llength $source_periph ] == 0} {
#external interrupt port case
set width [xget_port_width $source_pin]
set width [hsm::utils::get_port_width $source_pin]
for { set j 0 } { $j < $width } { incr j } {
set source_port_name($i) "[get_property NAME $source_pin]_$j"
set source_name($i) "system"
@ -339,7 +339,7 @@ proc iomodule_define_vector_table {periph config_inc config_file} {
iomodule_add_handler $source_interrupt_handler($i)
set source_handler_arg($i) [get_property CONFIG.int_handler_arg $int_array_elem]
if {[string compare -nocase $source_handler_arg($i) DEVICE_ID] == 0 } {
set source_handler_arg($i) [xget_name $source_periph "DEVICE_ID"]
set source_handler_arg($i) [::hsm::utils::get_ip_param_name $source_periph "DEVICE_ID"]
}
break
}
@ -410,12 +410,12 @@ proc iomodule_add_handler {handler} {
# using the driver name, in an include file.
##########################################################################
proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
set args [get_exact_arg_list $args]
set args [hsm::utils::get_exact_arg_list $args]
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [hsm::utils::get_common_driver_ips $drv_handle]
# Print canonical parameters for each peripheral
set device_id 0
@ -438,22 +438,22 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
set size [string index $arg [expr $charindex - 1]]
set sizearg [format "C_PIT%d_SIZE" $size]
set lvalue [format "C_PIT%d_EXPIRED_MASK" $size]
set lvalue [xget_dname $canonical_name $lvalue]
set lvalue [hsm::utils::get_driver_param_name $canonical_name $lvalue]
set rvalue [get_property CONFIG.$sizearg $periph]
set rvalue [expr pow(2, $rvalue) - 1]
set rvalue [format "%.0f" $rvalue]
set rvalue [format "0x%08X" $rvalue]
} else {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [hsm::utils::get_driver_param_name $canonical_name $arg]
# The commented out rvalue is the name of the instance-specific constant
# set rvalue [xget_name $periph $arg]
# set rvalue [::hsm::utils::get_ip_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter
set rvalue [get_property CONFIG.$arg $periph]
}
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [hsm::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue"
}
incr device_id
@ -478,7 +478,7 @@ proc xredefine_iomodule {drvhandle config_inc} {
# Next define interrupt IDs for each connected peripheral
set periphs [xget_sw_iplist_for_driver $drvhandle]
set periphs [hsm::utils::get_common_driver_ips $drvhandle]
set device_id 0
set periph_name [string toupper "iomodule"]
@ -488,7 +488,7 @@ proc xredefine_iomodule {drvhandle config_inc} {
set edk_periph_name [get_property NAME $periph]
# Get ports that are driving the interrupt
set source_ports [xget_interrupt_sources $periph]
set source_ports [hsm::utils::get_interrupt_sources $periph]
set i 0
lappend source_list
@ -496,7 +496,7 @@ proc xredefine_iomodule {drvhandle config_inc} {
set source_periph($i) [get_cells -of_objects $source_pin ]
if { [llength $source_periph($i) ] == 0} {
#external interrupt port case
set width [xget_port_width $source_pin]
set width [hsm::utils::get_port_width $source_pin]
for { set j 0 } { $j < $width } { incr j } {
set source_port_name($i) "[get_property NAME $source_pin]_$j"
set source_name($i) "system"
@ -614,7 +614,7 @@ proc lcount {list match_entry} {
##########################################################################
proc xfind_instance {drvhandle instname} {
set instlist [xget_sw_iplist_for_driver $drvhandle]
set instlist [hsm::utils::get_common_driver_ips $drvhandle]
set i 0
foreach inst $instlist {
set name [get_property NAME $inst]
@ -693,12 +693,12 @@ proc get_num_intr_internal {periph} {
# xdefine_include_file in "$XILINX_EDK/data/datastructure/xillib_sw.tcl".
##########################################################################
proc xdefine_include_file_hex {drv_handle file_name drv_string args} {
set args [get_exact_arg_list $args]
set args [hsm::utils::get_exact_arg_list $args]
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [hsm::utils::get_common_driver_ips $drv_handle]
# Print all parameters for all peripherals as hexadecimal strings
set device_id 0
@ -720,7 +720,7 @@ proc xdefine_include_file_hex {drv_handle file_name drv_string args} {
set value [format "0x%08x" $value_int]
}
puts $file_handle "#define [xget_name $periph $arg] $value"
puts $file_handle "#define [::hsm::utils::get_ip_param_name $periph $arg] $value"
}
puts $file_handle ""
}
@ -732,13 +732,13 @@ proc xdefine_include_file_hex {drv_handle file_name drv_string args} {
# Define parameters in xparameters.h and generate PIT_EXPIRED_MASK parameter
##############################################################################
proc xdefine_include_file {drv_handle file_name drv_string args} {
set args [get_exact_arg_list $args]
set args [hsm::utils::get_exact_arg_list $args]
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [hsm::utils::open_include_file $file_name]
set flag 0
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [hsm::utils::get_common_driver_ips $drv_handle]
# Handle special cases
set arg "NUM_INSTANCES"
@ -746,7 +746,7 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {$posn > -1} {
puts $file_handle "/* Definitions for driver [string toupper [get_property name $drv_handle]] */"
# Define NUM_INSTANCES
puts $file_handle "#define [xget_dname $drv_string $arg] [llength $periphs]"
puts $file_handle "#define [hsm::utils::get_driver_param_name $drv_string $arg] [llength $periphs]"
set args [lreplace $args $posn $posn]
}
@ -757,7 +757,7 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
lappend newargs $arg
} else {
puts $file_handle "#define [xget_dname $drv_string $arg] [get_property $arg $drv_handle]"
puts $file_handle "#define [hsm::utils::get_driver_param_name $drv_string $arg] [get_property $arg $drv_handle]"
}
}
set args $newargs
@ -790,12 +790,12 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
set value 0
}
set value [xformat_addr_string $value $arg]
set value [hsm::utils::format_addr_string $value $arg]
if {[string compare -nocase "HW_VER" $arg] == 0} {
puts $file_handle "#define [xget_name $periph $arg] \"$value\""
puts $file_handle "#define [::hsm::utils::get_ip_param_name $periph $arg] \"$value\""
} else {
if {$flag == 0} {
puts $file_handle "#define [xget_name $periph $arg] $value"
puts $file_handle "#define [::hsm::utils::get_ip_param_name $periph $arg] $value"
} else {
puts $file_handle "#define $lvalue $rvalue"
set flag 0

View file

@ -53,7 +53,7 @@ proc gen_include_files {swproj mhsinst} {
}
if {$swproj == 1} {
set ifintr [is_ip_interrupting_current_processor $mhsinst]
set ifintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifintr == 1} {
set inc_file_lines {xiomodule.h iomodule_header.h \
xil_exception.h iomodule_intr_header.h}
@ -70,7 +70,7 @@ proc gen_src_files {swproj mhsinst} {
}
if {$swproj == 1} {
set ifintr [is_ip_interrupting_current_processor $mhsinst]
set ifintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifintr == 1} {
set inc_file_lines {examples/xiomodule_selftest_example.c \
examples/xiomodule_intr_example.c \
@ -91,7 +91,7 @@ proc gen_testfunc_def {swproj mhsinst} {
proc gen_init_code {swproj mhsinst} {
if {$swproj == 1} {
set ipname [get_property NAME $mhsinst]
set ifintr [is_ip_interrupting_current_processor $mhsinst]
set ifintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifintr == 1} {
set decl " static XIOModule ${ipname}_IOModule;"
set inc_file_lines $decl
@ -107,7 +107,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -115,7 +115,7 @@ proc gen_testfunc_call {swproj mhsinst} {
set hasStdout 1
}
set iomodulevar "${ipname}_IOModule"
set ifintr [is_ip_interrupting_current_processor $mhsinst]
set ifintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set extintr [get_property CONFIG.C_INTC_USE_EXT_INTR $mhsinst]
set testfunc_call ""

View file

@ -127,12 +127,12 @@ proc xdefine_mbox_config_if {periph hfile_handle cfile_handle bus_if if_num dev_
proc xdefine_mbox_config_files {drv_handle hfile_name cfile_name drv_string} {
# Open include file
set hfile_handle [xopen_include_file $hfile_name]
set hfile_handle [::hsm::utils::open_include_file $hfile_name]
set cfile_name [file join "src" $cfile_name]
file delete $cfile_name
set cfile_handle [open $cfile_name w]
xprint_generated_header $cfile_handle "Driver configuration"
::hsm::utils::write_c_header $cfile_handle "Driver configuration"
puts $cfile_handle "#include \"xparameters.h\""
puts $cfile_handle "#include \"[string tolower $drv_string].h\""
puts $cfile_handle "\n/*"
@ -142,7 +142,7 @@ proc xdefine_mbox_config_files {drv_handle hfile_name cfile_name drv_string} {
puts $cfile_handle "\{"
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Print all parameters for all peripherals
set device_id 0
@ -199,7 +199,7 @@ proc check_if_connected {periph if_num bus_if} {
# Generate canonical definitions for device ID
proc gen_canonical_device_id {file_handle canonical_name periph_name if_num} {
set lvalue [xget_dname $canonical_name "DEVICE_ID"]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name "DEVICE_ID"]
set rvalue "XPAR_${periph_name}_IF_${if_num}_DEVICE_ID"
puts $file_handle "#define $lvalue $rvalue"
}
@ -212,14 +212,14 @@ proc gen_canonical_param_def {file_handle canonical_name periph param_prefix par
} else {
set actual_arg "${param_prefix}_${arg}"
}
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
# The rvalue set below is the actual value of the parameter
set rvalue [xget_param_value $periph $actual_arg]
set rvalue [::hsm::utils::get_param_value $periph $actual_arg]
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $actual_arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $actual_arg]
puts $file_handle "#define $lvalue $rvalue"
}
@ -228,9 +228,9 @@ proc gen_canonical_param_def {file_handle canonical_name periph param_prefix par
proc gen_canonical_fsl_param_def {file_handle canonical_name periph if_num} {
set periph_name [string toupper [get_property NAME $periph]]
puts $file_handle [format "#define [xget_dname $canonical_name "USE_FSL"] XPAR_%s_IF_%d_USE_FSL" $periph_name $if_num]
puts $file_handle [format "#define [xget_dname $canonical_name "SEND_FSL"] XPAR_%s_IF_%d_SEND_FSL" $periph_name $if_num]
puts $file_handle [format "#define [xget_dname $canonical_name "RECV_FSL"] XPAR_%s_IF_%d_RECV_FSL" $periph_name $if_num]
puts $file_handle [format "#define [::hsm::utils::get_driver_param_name $canonical_name "USE_FSL"] XPAR_%s_IF_%d_USE_FSL" $periph_name $if_num]
puts $file_handle [format "#define [::hsm::utils::get_driver_param_name $canonical_name "SEND_FSL"] XPAR_%s_IF_%d_SEND_FSL" $periph_name $if_num]
puts $file_handle [format "#define [::hsm::utils::get_driver_param_name $canonical_name "RECV_FSL"] XPAR_%s_IF_%d_RECV_FSL" $periph_name $if_num]
}
# Generate canonical definitions for an interface
@ -271,10 +271,10 @@ proc gen_canonical_if_def {file_handle periph if_num bus_if drv_string dev_id co
#
proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Print canonical parameters for each peripheral
set device_id 0
@ -300,7 +300,7 @@ proc handle_stream {periph bus_if if_num usefsl sendfsl recfsl} {
set periph_name [string toupper [get_property NAME $periph]]
set initiator_handle [xget_connected_intf $periph S${if_num}_AXIS]
set initiator_handle [::hsm::utils::get_connected_intf $periph S${if_num}_AXIS]
if { [llength $initiator_handle] != 1 } {
incr not_connected
} else {
@ -317,7 +317,7 @@ proc handle_stream {periph bus_if if_num usefsl sendfsl recfsl} {
}
}
set target_handle [xget_connected_intf $periph M${if_num}_AXIS]
set target_handle [::hsm::utils::get_connected_intf $periph M${if_num}_AXIS]
if { [llength $target_handle] != 1 } {
incr not_connected
} else {

View file

@ -92,7 +92,7 @@ proc gen_testfunc_call {swproj mhsinst} {
return $testfunc_call
}
set numproc [xget_procs]
set numproc [::hsm::utils::get_procs]
set numproc [llength $numproc]
if {$numproc == 1} {

View file

@ -45,7 +45,7 @@ proc generate {drv_handle} {
#---------------------------------
# memory_banks in xparameters.h
#---------------------------------
xdefine_addr_params $drv_handle "xparameters.h"
hsm::utils::define_addr_params $drv_handle "xparameters.h"
xdefine_canonical_xpars $drv_handle "xparameters.h" "Mig7series" "DEVICE_ID" "DDR_ROW_WIDTH" "DDR_COL_WIDTH" "DDR_BANK_WIDTH" "DDR_DQ_WIDTH"
@ -53,10 +53,10 @@ proc generate {drv_handle} {
proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -91,26 +91,26 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
set addr_params ""
set addr_params [xfind_addr_params $periph]
set addr_params [hsm::utils::find_addr_params $periph]
set arguments [concat $args $addr_params]
set memtype [get_property CONFIG.MEM_TYPE $periph]
foreach arg $arguments {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [hsm::utils::get_driver_param_name $canonical_name $arg]
# The commented out rvalue is the name of the instance-specific constant
# set rvalue [xget_name $periph $arg]
# set rvalue [hsm::utils::get_ip_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter
if { [string match *WIDTH* $arg] } {
set vars [split $arg "_"]
lassign $vars var1 var2 var3
set arg "${memtype}_${var2}_WIDTH"
}
set rvalue [xget_param_value $periph $arg]
set rvalue [hsm::utils::get_param_value $periph $arg]
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [hsm::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue"
}
@ -125,12 +125,12 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
}
proc xdefine_include_file {drv_handle file_name drv_string args} {
set args [get_exact_arg_list $args]
set args [hsm::utils::get_exact_arg_list $args]
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [hsm::utils::get_common_driver_ips $drv_handle]
# Handle special cases
set arg "NUM_INSTANCES"
@ -138,7 +138,7 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {$posn > -1} {
puts $file_handle "/* Definitions for driver [string toupper [get_property name $drv_handle]] */"
# Define NUM_INSTANCES
puts $file_handle "#define [xget_dname $drv_string $arg] [llength $periphs]"
puts $file_handle "#define [hsm::utils::get_driver_param_name $drv_string $arg] [llength $periphs]"
set args [lreplace $args $posn $posn]
}
@ -149,7 +149,7 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
lappend newargs $arg
} else {
puts $file_handle "#define [xget_dname $drv_string $arg] [get_property $arg $drv_handle]"
puts $file_handle "#define [hsm::utils::get_driver_param_name $drv_string $arg] [get_property $arg $drv_handle]"
}
}
set args $newargs
@ -170,14 +170,14 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
set value 0
}
set value [xformat_addr_string $value $arg]
set value [hsm::utils::format_addr_string $value $arg]
if {[string compare -nocase "HW_VER" $arg] == 0} {
puts $file_handle "#define [xget_name $periph $arg] \"$value\""
puts $file_handle "#define [hsm::utils::get_ip_param_name $periph $arg] \"$value\""
} else {
if { [string match *WIDTH* $arg] } {
puts $file_handle "#define [xget_name $periph ${memtype}_$arg] $value"
puts $file_handle "#define [hsm::utils::get_ip_param_name $periph ${memtype}_$arg] $value"
} else {
puts $file_handle "#define [xget_name $periph $arg] $value"
puts $file_handle "#define [hsm::utils::get_ip_param_name $periph $arg] $value"
}
}
}
@ -185,4 +185,4 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
}
puts $file_handle "\n/******************************************************************/\n"
close $file_handle
}
}

View file

@ -101,12 +101,12 @@ proc xdefine_mutex_config_if {periph hfile_handle cfile_handle num_ifs dev_id ha
proc xdefine_mutex_config_files {drv_handle hfile_name cfile_name drv_string} {
# Open include file
set hfile_handle [xopen_include_file $hfile_name]
set hfile_handle [::hsm::utils::open_include_file $hfile_name]
set cfile_name [file join "src" $cfile_name]
file delete $cfile_name
set cfile_handle [open $cfile_name w]
xprint_generated_header $cfile_handle "Driver configuration"
::hsm::utils::write_c_header $cfile_handle "Driver configuration"
puts $cfile_handle "#include \"xparameters.h\""
puts $cfile_handle "#include \"[string tolower $drv_string].h\""
puts $cfile_handle "\n/*"
@ -116,7 +116,7 @@ proc xdefine_mutex_config_files {drv_handle hfile_name cfile_name drv_string} {
puts $cfile_handle "\{"
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Print all parameters for all peripherals
set device_id 0
@ -164,7 +164,7 @@ proc check_if_connected {periph if_num} {
# the driver name, in an include file.
#
proc gen_canonical_device_id {file_handle canonical_name periph_name if_num} {
set lvalue [xget_dname $canonical_name "DEVICE_ID"]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name "DEVICE_ID"]
set rvalue "XPAR_${periph_name}_IF_${if_num}_DEVICE_ID"
puts $file_handle "#define $lvalue $rvalue"
}
@ -176,15 +176,15 @@ proc gen_canonical_param_def {file_handle canonical_name periph param_prefix par
} else {
set actual_arg "${param_prefix}_${arg}"
}
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
# The rvalue set below is the actual value of the parameter
set rvalue [xget_param_value $periph $actual_arg]
set rvalue [::hsm::utils::get_param_value $periph $actual_arg]
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $actual_arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $actual_arg]
puts $file_handle "#define $lvalue $rvalue"
}
@ -229,15 +229,15 @@ proc gen_canonical_if_def {file_handle periph num_ifs drv_string dev_id common_p
#
proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Print canonical parameters for each peripheral
set device_id 0
foreach periph $periphs {
set num_ifs [xget_param_value $periph "C_NUM_AXI"]
set num_ifs [::hsm::utils::get_param_value $periph "C_NUM_AXI"]
gen_canonical_if_def $file_handle $periph $num_ifs $drv_string device_id $args
}
puts $file_handle "\n/******************************************************************/\n"

View file

@ -59,10 +59,10 @@ proc generate {drv_handle} {
#
proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Handle special cases
set arg "NUM_INSTANCES"
@ -70,7 +70,7 @@ proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
if {$posn > -1} {
puts $file_handle "/* Definitions for driver [string toupper [get_property NAME $drv_handle]] */"
# Define NUM_INSTANCES
puts $file_handle "#define [xget_dname $drv_string $arg] [llength $periphs]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [llength $periphs]"
set args [lreplace $args $posn $posn]
}
# Check if it is a driver parameter
@ -81,7 +81,7 @@ proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
lappend newargs $arg
} else {
puts $file_handle "#define [xget_dname $drv_string $arg] [get_property CONFIG.$arg $drv_handle]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [get_property CONFIG.$arg $drv_handle]"
}
}
set args $newargs
@ -98,13 +98,13 @@ proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
} elseif {[string compare -nocase "C_SMC_BASEADDR" $arg] == 0} {
set value 0xE000E000
} else {
set value [xget_param_value $periph $arg]
set value [::hsm::utils::get_param_value $periph $arg]
}
if {[llength $value] == 0} {
set value 0
}
set value [xformat_addr_string $value $arg]
set arg_name [xget_name $periph $arg]
set value [::hsm::utils::format_addr_string $value $arg]
set arg_name [::hsm::utils::get_ip_param_name $periph $arg]
regsub "S_AXI_" $arg_name "" arg_name
if {[string compare -nocase "HW_VER" $arg] == 0} {
puts $file_handle "#define $arg_name \"$value\""
@ -125,10 +125,10 @@ proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
#-----------------------------------------------------------------------------
proc xdefine_zynq_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -163,23 +163,23 @@ proc xdefine_zynq_canonical_xpars {drv_handle file_name drv_string args} {
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
foreach arg $args {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
# replace S_SXI_ with CPU_. This is a temporary fix. Revist when the
# S_AXI_DIST_BASEADDR is generated by the tools
regsub "S_AXI_" $lvalue "CPU_" lvalue
# The commented out rvalue is the name of the instance-specific constant
# set rvalue [xget_name $periph $arg]
# set rvalue [::hsm::utils::get_ip_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter
if {[string compare -nocase "C_SMC_BASEADDR" $arg] == 0} {
set rvalue 0xE000E000
} else {
set rvalue [xget_param_value $periph $arg]
set rvalue [::hsm::utils::get_param_value $periph $arg]
}
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue"

View file

@ -1,34 +1,49 @@
###############################################################################
###############################################################
# (c) Copyright 2008-2014 Xilinx, Inc. All rights reserved.
#
# Copyright (C) 2008 - 2014 Xilinx, Inc. All rights reserved.
# This file contains confidential and proprietary information
# of Xilinx, Inc. and is protected under U.S. and
# international copyright and other intellectual property
# laws.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# DISCLAIMER
# This disclaimer is not a license and does not grant any
# rights to the materials distributed herewith. Except as
# otherwise provided in a valid license issued to you by
# Xilinx, and to the maximum extent permitted by applicable
# law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
# WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
# AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
# BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
# INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
# (2) Xilinx shall not be liable (whether in contract or tort,
# including negligence, or under any other theory of
# liability) for any loss or damage of any kind or nature
# related to, arising under or in connection with these
# materials, including for any direct, or any indirect,
# special, incidental, or consequential loss or damage
# (including loss of data, profits, goodwill, or any type of
# loss or damage suffered as a result of any action brought
# by a third party) even if such damage or loss was
# reasonably foreseeable or Xilinx had been advised of the
# possibility of the same.
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# CRITICAL APPLICATIONS
# Xilinx products are not designed or intended to be fail-
# safe, or for use in any application requiring fail-safe
# performance, such as life-support or safety devices or
# systems, Class III medical devices, nuclear facilities,
# applications related to the deployment of airbags, or any
# other applications that could lead to death, personal
# injury, or severe property or environmental damage
# (individually and collectively, "Critical
# Applications"). Customer assumes the sole risk and
# liability of any use of Xilinx products in Critical
# Applications, subject only to applicable laws and
# regulations governing limitations on product liability.
#
# Use of the Software is limited solely to applications:
# (a) running on a Xilinx device, or
# (b) that interact with a Xilinx device through a bus or interconnect.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# Except as contained in this notice, the name of the Xilinx shall not be used
# in advertising or otherwise to promote the sale, use or other dealings in
# this Software without prior written authorization from Xilinx.
#
###############################################################################
# THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
# PART OF THIS FILE AT ALL TIMES.
# MODIFICATION HISTORY:
# Ver Who Date Changes
# -------- ------ -------- ------------------------------------
@ -48,10 +63,10 @@ proc generate {drv_handle} {
#
proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -85,17 +100,17 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
foreach arg $args {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
# The commented out rvalue is the name of the instance-specific constant
# set rvalue [xget_name $periph $arg]
# set rvalue [::hsm::utils::get_ip_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter
set rvalue [get_property CONFIG.$arg $periph]
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue"

View file

@ -92,7 +92,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0

View file

@ -47,10 +47,10 @@ proc generate {drv_handle} {
#
proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -84,17 +84,17 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
foreach arg $args {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
# The commented out rvalue is the name of the instance-specific constant
# set rvalue [xget_name $periph $arg]
# set rvalue [::hsm::utils::get_ip_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter
set rvalue [get_property CONFIG.$arg $periph]
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue"

View file

@ -65,10 +65,10 @@ proc generate {drv_handle} {
#
proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Handle special cases
set arg "NUM_INSTANCES"
@ -76,7 +76,7 @@ proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
if {$posn > -1} {
puts $file_handle "/* Definitions for driver [string toupper [get_property NAME $drv_handle]] */"
# Define NUM_INSTANCES
puts $file_handle "#define [xget_dname $drv_string $arg] [llength $periphs]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [llength $periphs]"
set args [lreplace $args $posn $posn]
}
# Check if it is a driver parameter
@ -87,7 +87,7 @@ proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
lappend newargs $arg
} else {
puts $file_handle "#define [xget_dname $drv_string $arg] [get_property CONFIG.$arg $drv_handle]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [get_property CONFIG.$arg $drv_handle]"
}
}
set args $newargs
@ -109,8 +109,8 @@ proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
set value 0
}
set value [xformat_addr_string $value $arg]
set arg_name [xget_name $periph $arg]
set value [::hsm::utils::format_addr_string $value $arg]
set arg_name [::hsm::utils::get_ip_param_name $periph $arg]
regsub "S_AXI_" $arg_name "" arg_name
if {[string compare -nocase "HW_VER" $arg] == 0} {
puts $file_handle "#define $arg_name \"$value\""
@ -131,10 +131,10 @@ proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
#-----------------------------------------------------------------------------
proc xdefine_zynq_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -169,13 +169,13 @@ proc xdefine_zynq_canonical_xpars {drv_handle file_name drv_string args} {
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
foreach arg $args {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
# replace S_SXI_ with CPU_. This is a temporary fix. Revist when the
# S_AXI_DIST_BASEADDR is generated by the tools
regsub "S_AXI_" $lvalue "CPU_" lvalue
# The commented out rvalue is the name of the instance-specific constant
# set rvalue [xget_name $periph $arg]
# set rvalue [::hsm::utils::get_ip_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter
if {[string compare -nocase "C_DIST_BASEADDR" $arg] == 0} {
set rvalue 0xf8f01000
@ -185,7 +185,7 @@ proc xdefine_zynq_canonical_xpars {drv_handle file_name drv_string args} {
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue"
@ -201,10 +201,10 @@ proc xdefine_zynq_canonical_xpars {drv_handle file_name drv_string args} {
proc xdefine_gic_params {drvhandle} {
set config_inc [xopen_include_file "xparameters.h"]
set config_inc [::hsm::utils::open_include_file "xparameters.h"]
# Next define interrupt IDs for each connected peripheral
set periphs [xget_sw_iplist_for_driver $drvhandle]
set periphs [::hsm::utils::get_common_driver_ips $drvhandle]
set device_id 0
foreach periph $periphs {
@ -219,9 +219,9 @@ proc xdefine_gic_params {drvhandle} {
xhandle_coreirq_interrupts
# Get ports that are driving the interrupt
#set source_ports [xget_interrupt_sources $periph]
#set source_ports [::hsm::utils::get_interrupt_sources $periph]
set pin [get_pins -of_objects $periph IRQ_F2P]
set source_ports [xget_source_pins $pin]
set source_ports [::hsm::utils::get_source_pins $pin]
set i 0
lappend source_list
foreach source_port $source_ports {
@ -231,7 +231,7 @@ proc xdefine_gic_params {drvhandle} {
set source_periph($i) "DUMMY"
set source_name($i) "DUMMY"
} else {
set external_pin [is_external_pin $source_port]
set external_pin [::hsm::utils::is_external_pin $source_port]
if {$external_pin} {
set source_port_name($i) [get_property NAME $source_port]
set source_periph($i) "system"
@ -392,7 +392,7 @@ proc lcount {list match_entry} {
###################################################################
proc xfind_instance {drvhandle instname} {
set instlist [xget_sw_iplist_for_driver $drvhandle]
set instlist [::hsm::utils::get_common_driver_ips $drvhandle]
set i 0
foreach inst $instlist {
set name [get_property NAME $inst]
@ -424,21 +424,21 @@ proc xget_port_type {port} {
# Tcl procedure for generating Core IRQ interrupts in xparameters.h file
# ----------------------------------------------------------------------------------
proc xhandle_coreirq_interrupts { } {
set file_handle [xopen_include_file "xparameters.h"]
set file_handle [::hsm::utils::open_include_file "xparameters.h"]
puts $file_handle "\n/***Definitions for Core_nIRQ/nFIQ interrupts ****/"
close $file_handle
set periphs [get_cells *]
foreach periph $periphs {
set intr_pins [get_pins -of_objects $periph -filter "TYPE == INTERRUPT"]
foreach intr_piin $intr_pins {
set sink_pin [xget_sink_pins $intr_piin]
set sink_pin [::hsm::utils::get_sink_pins $intr_piin]
if { $sink_pin == "Core1_nIRQ" || $sink_pin == "Core0_nIRQ" } {
set ip_name [get_property IP_NAME [get_cells $periph]]
set periph [string toupper $periph]
set intr_pin [string toupper $intr_piin]
if {$ip_name != "ps7_scugic" } {
set intr_id "XPAR_FABRIC_${periph}_${intr_pin}_INTR"
set file_handle [xopen_include_file "xparameters.h"]
set file_handle [::hsm::utils::open_include_file "xparameters.h"]
puts $file_handle "#define ${intr_id} 31"
close $file_handle
}
@ -448,7 +448,7 @@ proc xhandle_coreirq_interrupts { } {
set intr_pin [string toupper $intr_piin]
if {$ip_name != "ps7_scugic" } {
set intr_id "XPAR_FABRIC_${periph}_${intr_pin}_INTR"
set file_handle [xopen_include_file "xparameters.h"]
set file_handle [::hsm::utils::open_include_file "xparameters.h"]
puts $file_handle "#define ${intr_id} 28"
close $file_handle
}

View file

@ -87,7 +87,7 @@ proc gen_testfunc_call {swproj mhsinst} {
set ipname [get_property NAME $mhsinst]
set decl " static XScuGic ${ipname};"
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0

View file

@ -97,7 +97,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -105,7 +105,7 @@ proc gen_testfunc_call {swproj mhsinst} {
set hasStdout 1
}
set isintr [is_ip_interrupting_current_processor $mhsinst]
set isintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set intcvar intc

View file

@ -98,7 +98,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -106,7 +106,7 @@ proc gen_testfunc_call {swproj mhsinst} {
set hasStdout 1
}
set isintr [is_ip_interrupting_current_processor $mhsinst]
set isintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set intcvar intc

View file

@ -72,10 +72,10 @@ proc xdefine_axispi_include_file {drv_handle file_name drv_string} {
global periph_ninstances
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Handle NUM_INSTANCES
set periph_ninstances 0
@ -84,7 +84,7 @@ proc xdefine_axispi_include_file {drv_handle file_name drv_string} {
init_periph_config_struct_spi $periph_ninstances
incr periph_ninstances 1
}
puts $file_handle "\#define [xget_dname $drv_string NUM_INSTANCES] $periph_ninstances"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $drv_string NUM_INSTANCES] $periph_ninstances"
# Now print all useful parameters for all peripherals
@ -122,18 +122,18 @@ proc xdefine_axispi_params_instance {file_handle periph device_id} {
}
puts $file_handle "/* Definitions for peripheral [string toupper [get_property NAME $periph]] */"
puts $file_handle "\#define [xget_dname $periph "DEVICE_ID"] $device_id"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "DEVICE_ID"] $device_id"
if {$xip_mode_value == 0} {
if {$axi_type_value == 0} {
puts $file_handle "\#define [xget_dname $periph "BASEADDR"] [get_property CONFIG.C_BASEADDR $periph]"
puts $file_handle "\#define [xget_dname $periph HIGHADDR] [get_property CONFIG.C_HIGHADDR $periph]"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "BASEADDR"] [get_property CONFIG.C_BASEADDR $periph]"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph HIGHADDR] [get_property CONFIG.C_HIGHADDR $periph]"
} else {
puts $file_handle "\#define [xget_dname $periph "BASEADDR"] $axi4_baseaddr_value"
puts $file_handle "\#define [xget_dname $periph HIGHADDR] $axi4_highaddr_value"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "BASEADDR"] $axi4_baseaddr_value"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph HIGHADDR] $axi4_highaddr_value"
}
} else {
puts $file_handle "\#define [xget_dname $periph "BASEADDR"] [get_property CONFIG.C_BASEADDR $periph]"
puts $file_handle "\#define [xget_dname $periph HIGHADDR] [get_property CONFIG.C_HIGHADDR $periph]"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "BASEADDR"] [get_property CONFIG.C_BASEADDR $periph]"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph HIGHADDR] [get_property CONFIG.C_HIGHADDR $periph]"
}
set value [get_property CONFIG.C_FIFO_EXIST $periph]
@ -143,7 +143,7 @@ proc xdefine_axispi_params_instance {file_handle periph device_id} {
set value1 0
} else {
set value1 [get_property CONFIG.C_FIFO_DEPTH $periph]
puts $file_handle "\#define [xget_dname $periph "FIFO_DEPTH"] $value1"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "FIFO_DEPTH"] $value1"
if {$value1 == 0} {
set value1 0
} else {
@ -153,32 +153,32 @@ proc xdefine_axispi_params_instance {file_handle periph device_id} {
} else {
set value1 $value
}
puts $file_handle "\#define [xget_dname $periph "FIFO_EXIST"] $value1"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "FIFO_EXIST"] $value1"
set value [get_property CONFIG.C_SPI_SLAVE_ONLY $periph]
if {[llength $value] == 0} {
set value 0
}
puts $file_handle "\#define [xget_dname $periph "SPI_SLAVE_ONLY"] $value"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "SPI_SLAVE_ONLY"] $value"
set value [get_property CONFIG.C_NUM_SS_BITS $periph]
if {[llength $value] == 0} {
set value 0
}
puts $file_handle "\#define [xget_dname $periph "NUM_SS_BITS"] $value"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "NUM_SS_BITS"] $value"
set value [get_property CONFIG.C_NUM_TRANSFER_BITS $periph]
if {[llength $value] == 0} {
set value 0
}
puts $file_handle "\#define [xget_dname $periph "NUM_TRANSFER_BITS"] $value"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "NUM_TRANSFER_BITS"] $value"
set value [get_property CONFIG.C_SPI_MODE $periph]
if {[llength $value] == 0} {
set value 0
}
puts $file_handle "\#define [xget_dname $periph "SPI_MODE"] $value"
puts $file_handle "\#define [xget_dname $periph "TYPE_OF_AXI4_INTERFACE"] $axi_type_value"
puts $file_handle "\#define [xget_dname $periph "AXI4_BASEADDR"] $axi4_baseaddr_value"
puts $file_handle "\#define [xget_dname $periph "AXI4_HIGHADDR"] $axi4_highaddr_value"
puts $file_handle "\#define [xget_dname $periph "XIP_MODE"] $xip_mode_value"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "SPI_MODE"] $value"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "TYPE_OF_AXI4_INTERFACE"] $axi_type_value"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "AXI4_BASEADDR"] $axi4_baseaddr_value"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "AXI4_HIGHADDR"] $axi4_highaddr_value"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $periph "XIP_MODE"] $xip_mode_value"
}
proc xdefine_axispi_params_canonical {file_handle periph device_id} {
@ -315,7 +315,7 @@ proc xdefine_axispi_config_file {file_name drv_string} {
set filename [file join "src" $file_name]
file delete $filename
set config_file [open $filename w]
xprint_generated_header $config_file "Driver configuration"
::hsm::utils::write_c_header $config_file "Driver configuration"
puts $config_file "\#include \"xparameters.h\""
puts $config_file "\#include \"[string tolower $drv_string].h\""
puts $config_file "\n/*"

View file

@ -81,7 +81,7 @@ proc gen_include_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set spi_intr [is_ip_interrupting_current_processor $mhsinst]
set spi_intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if { ${spi_intr} == 1} {
set inc_file_lines {xspi.h spi_header.h spi_intr_header.h}
} else {
@ -97,7 +97,7 @@ proc gen_src_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set spi_intr [is_ip_interrupting_current_processor $mhsinst]
set spi_intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if { ${spi_intr} == 1} {
set inc_file_lines {examples/xspi_selftest_example.c examples/xspi_intr_example.c data/spi_header.h data/spi_intr_header.h}
} else {
@ -117,7 +117,7 @@ proc gen_init_code {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set spi_intr [is_ip_interrupting_current_processor $mhsinst]
set spi_intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set ipname [get_property NAME $mhsinst]
if { ${spi_intr} == 1} {
@ -137,18 +137,18 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
} else {
set hasStdout 1
}
set spi_intr [is_ip_interrupting_current_processor $mhsinst]
set spi_intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if { ${spi_intr} == 1} {
set intr_pin_name [get_pins -of_objects [get_cells $ipname] -filter "TYPE==INTERRUPT"]
set intcname [get_connected_interrupt_controller $ipname $intr_pin_name]
set intcname [::hsm::utils::get_connected_intr_cntrl $ipname $intr_pin_name]
set intcvar intc
set proc [get_property IP_NAME [get_cells [get_sw_processor]]]
}

View file

@ -91,7 +91,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0

View file

@ -59,7 +59,7 @@ proc gen_include_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set ifsysmonintr [is_ip_interrupting_current_processor $mhsinst]
set ifsysmonintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifsysmonintr == 1} {
set inc_file_lines {xsysmon.h sysmon_header.h sysmon_intr_header.h}
} else {
@ -74,7 +74,7 @@ proc gen_src_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set ifsysmonintr [is_ip_interrupting_current_processor $mhsinst]
set ifsysmonintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifsysmonintr == 1} {
set inc_file_lines {examples/xsysmon_polled_example.c examples/xsysmon_intr_example.c data/sysmon_header.h data/sysmon_intr_header.h}
@ -97,7 +97,7 @@ proc gen_init_code {swproj mhsinst} {
if {$swproj == 1} {
set ipname [get_property NAME $mhsinst]
set ifsysmonintr [is_ip_interrupting_current_processor $mhsinst]
set ifsysmonintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifsysmonintr == 1} {
set decl " static XSysMon ${ipname}_SysMon_ADC;"
set inc_file_lines $decl
@ -115,9 +115,9 @@ proc gen_testfunc_call {swproj mhsinst} {
return ""
}
set ifsysmonintr [is_ip_interrupting_current_processor $mhsinst]
set ifsysmonintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -127,7 +127,7 @@ proc gen_testfunc_call {swproj mhsinst} {
if {$ifsysmonintr == 1} {
set intr_pin_name [get_pins -of_objects [get_cells $ipname] -filter "TYPE==INTERRUPT"]
set intcname [get_connected_interrupt_controller $ipname $intr_pin_name]
set intcname [::hsm::utils::get_connected_intr_cntrl $ipname $intr_pin_name]
set intcvar intc
set proc [get_property IP_NAME [get_cells [get_sw_processor]]]
}

View file

@ -61,10 +61,10 @@ proc generate {drv_handle} {
#
proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -98,23 +98,23 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
foreach arg $args {
if {[string compare -nocase "C_S_AXI_BASEADDR" $arg] == 0} {
set lvalue [xget_dname $canonical_name "C_BASEADDR"]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name "C_BASEADDR"]
} elseif {[string compare -nocase "C_S_AXI_HIGHADDR" $arg] == 0} {
set lvalue [xget_dname $canonical_name "C_HIGHADDR"]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name "C_HIGHADDR"]
} else {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
}
# The commented out rvalue is the name of the instance-specific constant
# set rvalue [xget_name $periph $arg]
# set rvalue [::hsm::utils::get_ip_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter
set rvalue [get_property CONFIG.$arg $periph]
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue"

View file

@ -51,10 +51,10 @@ proc generate {drv_handle} {
#
proc xdefine_include_file {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Handle special cases
set arg "NUM_INSTANCES"
@ -62,7 +62,7 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {$posn > -1} {
puts $file_handle "/* Definitions for driver [string toupper [get_property NAME $drv_handle]] */"
# Define NUM_INSTANCES
puts $file_handle "#define [xget_dname $drv_string $arg] [llength $periphs]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [llength $periphs]"
set args [lreplace $args $posn $posn]
}
@ -71,7 +71,7 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
foreach periph $periphs {
set periph_name [string toupper [get_property NAME $periph]]
#set freq [xget_freq $periph]
set freq [xget_ip_clk_pin_freq $periph "S_AXI_ACLK"]
set freq [::hsm::utils::get_clk_pin_freq $periph "S_AXI_ACLK"]
puts $file_handle ""
puts $file_handle "/* Definitions for peripheral $periph_name */"
@ -94,8 +94,8 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
set value 0
}
set value [xformat_addr_string $value $arg]
puts $file_handle "#define [xget_name $periph $arg] $value"
set value [::hsm::utils::format_addr_string $value $arg]
puts $file_handle "#define [::hsm::utils::get_ip_param_name $periph $arg] $value"
}
puts $file_handle ""
}
@ -110,10 +110,10 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
#
proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -147,17 +147,17 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
foreach arg $args {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
#handle CLOCK_FREQ_HZ as a special case
if {[string compare -nocase "CLOCK_FREQ_HZ" $arg] == 0} {
set rvalue [xget_name $periph $arg]
set rvalue [::hsm::utils::get_ip_param_name $periph $arg]
} else {
set rvalue [get_property CONFIG.$arg $periph]
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $arg]
}
puts $file_handle "#define $lvalue $rvalue"

View file

@ -66,7 +66,7 @@ proc gen_include_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set iftmrintr [is_ip_interrupting_current_processor $mhsinst]
set iftmrintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$iftmrintr == 1} {
set inc_file_lines {xtmrctr.h tmrctr_header.h tmrctr_intr_header.h}
} else {
@ -81,7 +81,7 @@ proc gen_src_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set iftmrintr [is_ip_interrupting_current_processor $mhsinst]
set iftmrintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$iftmrintr == 1} {
set inc_file_lines {examples/xtmrctr_selftest_example.c examples/xtmrctr_intr_example.c data/tmrctr_header.h data/tmrctr_intr_header.h}
@ -104,7 +104,7 @@ proc gen_init_code {swproj mhsinst} {
if {$swproj == 1} {
set ipname [get_property NAME $mhsinst]
set iftmrintr [is_ip_interrupting_current_processor $mhsinst]
set iftmrintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$iftmrintr == 1} {
set decl " static XTmrCtr ${ipname}_Timer;"
set inc_file_lines $decl
@ -122,9 +122,9 @@ proc gen_testfunc_call {swproj mhsinst} {
return ""
}
set iftmrintr [is_ip_interrupting_current_processor $mhsinst]
set iftmrintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -134,7 +134,7 @@ proc gen_testfunc_call {swproj mhsinst} {
if {$iftmrintr == 1} {
set intr_pin_name [get_pins -of_objects [get_cells $ipname] -filter "TYPE==INTERRUPT"]
set intcname [get_connected_interrupt_controller $ipname $intr_pin_name]
set intcname [::hsm::utils::get_connected_intr_cntrl $ipname $intr_pin_name]
set intcvar intc
set proc [get_property IP_NAME [get_cells [get_sw_processor]]]
}

View file

@ -78,10 +78,10 @@ proc xdefine_trafgen_include_file {drv_handle file_name drv_string} {
global periph_ninstances
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Handle NUM_INSTANCES
set periph_ninstances 0
@ -90,7 +90,7 @@ proc xdefine_trafgen_include_file {drv_handle file_name drv_string} {
init_periph_config_struct_atg $periph_ninstances
incr periph_ninstances 1
}
puts $file_handle "\#define [xget_dname $drv_string NUM_INSTANCES] $periph_ninstances"
puts $file_handle "\#define [::hsm::utils::get_driver_param_name $drv_string NUM_INSTANCES] $periph_ninstances"
# Now print all useful parameters for all peripherals
@ -115,7 +115,7 @@ proc xdfeine_trafgen_params_constants { periph } {
global baseaddr_value
global highaddr_value
set atg_mode_name [xget_param_value $periph C_ATG_MODE]
set atg_mode_name [::hsm::utils::get_param_value $periph C_ATG_MODE]
set axi4_name [string match -nocase $atg_mode_name "AXI4"]
set axi4_lite_name [string match -nocase $atg_mode_name "AXI4-Lite"]
set axi4_Stream_name [string match -nocase $atg_mode_name "AXI4-Stream"]
@ -133,7 +133,7 @@ proc xdfeine_trafgen_params_constants { periph } {
set atg_mode_value 0
}
set atg_mode_l2_name [xget_param_value $periph C_ATG_MODE_L2]
set atg_mode_l2_name [::hsm::utils::get_param_value $periph C_ATG_MODE_L2]
set adv_mode_name [string match -nocase $atg_mode_l2_name "Advanced"]
set basic_mode_name [string match -nocase $atg_mode_l2_name "Basic"]
set static_mode_name [string match -nocase $atg_mode_l2_name "Static"]
@ -149,7 +149,7 @@ proc xdfeine_trafgen_params_constants { periph } {
if {[llength $atg_mode_l2_name] == 0} {
set atg_mode_value_l2 0
}
set axi_mode_name [xget_param_value $periph C_AXIS_MODE]
set axi_mode_name [::hsm::utils::get_param_value $periph C_AXIS_MODE]
set master_name [string match -nocase $axi_mode_name "Master Only"]
set slave_name [string match -nocase $axi_mode_name "Slave Only"]
set master_loop_name [string match -nocase $axi_mode_name "Master Loop back"]
@ -170,11 +170,11 @@ proc xdfeine_trafgen_params_constants { periph } {
set axi_mode_value 0
}
set baseaddr_value [xget_param_value $periph C_BASEADDR]
set baseaddr_value [::hsm::utils::get_param_value $periph C_BASEADDR]
if {[llength $baseaddr_value] == 0} {
set baseaddr_value 0
}
set highaddr_value [xget_param_value $periph C_HIGHADDR]
set highaddr_value [::hsm::utils::get_param_value $periph C_HIGHADDR]
if {[llength $highaddr_value] == 0} {
set highaddr_value 0
}
@ -187,13 +187,13 @@ proc xdefine_trafgen_params_instance {file_handle periph device_id} {
global axi_mode_value
puts $file_handle "/* Definitions for peripheral [string toupper [get_property NAME $periph]] */"
puts $file_handle "\#define [xget_name $periph "DEVICE_ID"] $device_id"
puts $file_handle "\#define [xget_name $periph "BASEADDR"] [xget_param_value $periph C_BASEADDR]"
puts $file_handle "\#define [xget_name $periph "HIGHADDR"] [xget_param_value $periph C_HIGHADDR]"
puts $file_handle "\#define [::hsm::utils::get_ip_param_name $periph "DEVICE_ID"] $device_id"
puts $file_handle "\#define [::hsm::utils::get_ip_param_name $periph "BASEADDR"] [::hsm::utils::get_param_value $periph C_BASEADDR]"
puts $file_handle "\#define [::hsm::utils::get_ip_param_name $periph "HIGHADDR"] [::hsm::utils::get_param_value $periph C_HIGHADDR]"
puts $file_handle "\#define [xget_name $periph "C_ATG_MODE"] $atg_mode_value"
puts $file_handle "\#define [xget_name $periph "C_ATG_MODE_L2"] $atg_mode_value_l2"
puts $file_handle "\#define [xget_name $periph "C_AXIS_MODE"] $axi_mode_value"
puts $file_handle "\#define [::hsm::utils::get_ip_param_name $periph "C_ATG_MODE"] $atg_mode_value"
puts $file_handle "\#define [::hsm::utils::get_ip_param_name $periph "C_ATG_MODE_L2"] $atg_mode_value_l2"
puts $file_handle "\#define [::hsm::utils::get_ip_param_name $periph "C_AXIS_MODE"] $axi_mode_value"
}
proc xdefine_trafgen_params_canonical {file_handle periph device_id} {
@ -239,7 +239,7 @@ proc xdefine_trafgen_config_file {file_name drv_string} {
set filename [file join "src" $file_name]
file delete $filename
set config_file [open $filename w]
xprint_generated_header $config_file "Driver configuration"
::hsm::utils::write_c_header $config_file "Driver configuration"
puts $config_file "\#include \"xparameters.h\""
puts $config_file "\#include \"[string tolower $drv_string].h\""
puts $config_file "\n/*"

View file

@ -50,10 +50,10 @@ proc generate {drv_handle} {
proc xdefine_include_file {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Handle special cases
set arg "NUM_INSTANCES"
@ -61,7 +61,7 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {$posn > -1} {
puts $file_handle "/* Definitions for driver [string toupper [get_property NAME $drv_handle]] */"
# Define NUM_INSTANCES
puts $file_handle "#define [xget_dname $drv_string $arg] [expr [llength $periphs] * 3]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [expr [llength $periphs] * 3]"
set args [lreplace $args $posn $posn]
}
# Check if it is a driver parameter
@ -72,7 +72,7 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
lappend newargs $arg
} else {
puts $file_handle "#define [xget_dname $drv_string $arg] [get_property CONFIG.$arg $drv_handle]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [get_property CONFIG.$arg $drv_handle]"
}
}
set args $newargs
@ -87,16 +87,16 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {[string compare -nocase "DEVICE_ID" $arg] == 0} {
set value [expr $device_id * 3 + $x]
} elseif {[string compare -nocase "C_TTC_CLK_CLKSRC" $arg] == 0} {
set value [xget_param_value $periph [format "C_TTC_CLK%d_CLKSRC" $x]]
set value [::hsm::utils::get_param_value $periph [format "C_TTC_CLK%d_CLKSRC" $x]]
} elseif {[string compare -nocase "C_TTC_CLK_FREQ_HZ" $arg] == 0} {
set value [xget_param_value $periph [format "C_TTC_CLK%d_FREQ_HZ" $x]]
set value [::hsm::utils::get_param_value $periph [format "C_TTC_CLK%d_FREQ_HZ" $x]]
} else {
set value [xget_param_value $periph $arg]
set value [::hsm::utils::get_param_value $periph $arg]
}
if {[llength $value] == 0} {
set value 0
}
set value [xformat_addr_string $value $arg]
set value [::hsm::utils::format_addr_string $value $arg]
if {[string match C_* $arg]} {
set arg_name [string range $arg 2 end]
} else {
@ -126,7 +126,7 @@ proc xdefine_config_file {drv_handle file_name drv_string args} {
set filename [file join "src" $file_name]
file delete $filename
set config_file [open $filename w]
xprint_generated_header $config_file "Driver configuration"
::hsm::utils::write_c_header $config_file "Driver configuration"
puts $config_file "#include \"xparameters.h\""
puts $config_file "#include \"[string tolower $drv_string].h\""
puts $config_file "\n/*"
@ -134,7 +134,7 @@ proc xdefine_config_file {drv_handle file_name drv_string args} {
puts $config_file "*/\n"
puts $config_file [format "%s_Config %s_ConfigTable\[\] =" $drv_string $drv_string]
puts $config_file "\{"
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
set start_comma ""
set device_id 0
foreach periph $periphs {
@ -150,7 +150,7 @@ proc xdefine_config_file {drv_handle file_name drv_string args} {
# peripheral), we will (for some obscure and ancient reason)
# look in peripherals connected via point to point links
if { [string compare -nocase $local_value ""] == 0} {
set p2p_name [xget_p2p_name $periph $arg]
set p2p_name [::hsm::utils::get_p2p_name $periph $arg]
if { [string compare -nocase $p2p_name ""] == 0} {
if {[string match C_* $arg]} {
set arg_name [string range $arg 2 end]
@ -175,7 +175,7 @@ proc xdefine_config_file {drv_handle file_name drv_string args} {
puts -nonewline $config_file [format "%s\t\t%s" $comma $arg_name]
}
} else {
set arg_name [xget_dname $drv_string $arg]
set arg_name [::hsm::utils::get_driver_param_name $drv_string $arg]
regsub "S_AXI_" $arg_name "" arg_name
puts -nonewline $config_file [format "%s\t\t%s" $comma $arg_name]
}
@ -200,10 +200,10 @@ proc xdefine_config_file {drv_handle file_name drv_string args} {
#-----------------------------------------------------------------------------
proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -251,17 +251,17 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
regsub "S_AXI_" $lvalue "" lvalue
# The commented out rvalue is the name of the instance-specific constant
# set rvalue [xget_name $periph $arg]
# set rvalue [::hsm::utils::get_ip_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter
if {[string compare -nocase "DEVICE_ID" $arg] == 0} {
set rvalue [format "XPAR_%s_%d_%s" [string toupper [string range [get_property NAME $periph] 0 end-2]] [expr $device_id * 3 + $x] $arg]
} else {
if {[string compare -nocase "C_TTC_CLK_CLKSRC" $arg] == 0} {
set rvalue [xget_param_value $periph [format "C_TTC_CLK%d_CLKSRC" $x]]
set rvalue [::hsm::utils::get_param_value $periph [format "C_TTC_CLK%d_CLKSRC" $x]]
} elseif {[string compare -nocase "C_TTC_CLK_FREQ_HZ" $arg] == 0} {
set rvalue [xget_param_value $periph [format "C_TTC_CLK%d_FREQ_HZ" $x]]
set rvalue [::hsm::utils::get_param_value $periph [format "C_TTC_CLK%d_FREQ_HZ" $x]]
} else {
set rvalue [xget_param_value $periph $arg]
set rvalue [::hsm::utils::get_param_value $periph $arg]
if {[string compare -nocase "C_S_AXI_BASEADDR" $arg] == 0} {
set rvalue [string toupper [format 0x%08x [expr $rvalue + $x * 4]]]
}
@ -269,7 +269,7 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $arg]
}
puts $file_handle "#define $lvalue $rvalue"

View file

@ -71,7 +71,7 @@ proc gen_include_files {swproj mhsinst} {
set isStdout [string match $stdout $mhsinst]
set ipname [get_property IP_NAME $mhsinst]
if {${isStdout} == 0} {
set ifuartliteintr [is_ip_interrupting_current_processor $mhsinst]
set ifuartliteintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifuartliteintr == 1} {
if {$ipname == "mdm"} {
set inc_file_lines {uartlite_header.h}
@ -98,7 +98,7 @@ proc gen_src_files {swproj mhsinst} {
set stdout [get_property CONFIG.STDOUT [get_os]]
set isStdout [string match $stdout $mhsinst]
if {${isStdout} == 0} {
set ifuartliteintr [is_ip_interrupting_current_processor $mhsinst]
set ifuartliteintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifuartliteintr == 1} {
if {$ipname == "mdm"} {
set inc_file_lines {examples/xuartlite_selftest_example.c data/uartlite_header.h}
@ -131,7 +131,7 @@ proc gen_init_code {swproj mhsinst} {
if {${isStdout} == 0} {
set ipname [get_property NAME $mhsinst]
set ifuartliteintr [is_ip_interrupting_current_processor $mhsinst]
set ifuartliteintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set mdm_name [get_property IP_NAME $mhsinst]
if {$ifuartliteintr == 1} {
if {$mdm_name == "mdm"} {
@ -151,7 +151,7 @@ proc gen_init_code {swproj mhsinst} {
proc gen_testfunc_call {swproj mhsinst} {
set ipname [get_property NAME $mhsinst]
set ifuartliteintr [is_ip_interrupting_current_processor $mhsinst]
set ifuartliteintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set testfunc_call ""
if {$swproj == 0} {
@ -172,7 +172,7 @@ proc gen_testfunc_call {swproj mhsinst} {
return $testfunc_call
}
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -181,7 +181,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
if {$ifuartliteintr == 1} {
set intr_pin_name [get_pins -of_objects [get_cells $ipname] -filter "TYPE==INTERRUPT"]
set intcname [get_connected_interrupt_controller $ipname $intr_pin_name]
set intcname [::hsm::utils::get_connected_intr_cntrl $ipname $intr_pin_name]
set intcvar intc
set proc [get_property IP_NAME [get_cells [get_sw_processor]]]
set mdm_name [get_property IP_NAME $mhsinst]

View file

@ -64,10 +64,10 @@ proc generate {drv_handle} {
#
proc xdefine_include_file {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Handle special cases
set arg "NUM_INSTANCES"
@ -75,7 +75,7 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {$posn > -1} {
puts $file_handle "/* Definitions for driver [string toupper [get_property NAME $drv_handle]] */"
# Define NUM_INSTANCES
puts $file_handle "#define [xget_dname $drv_string $arg] [llength $periphs]"
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [llength $periphs]"
set args [lreplace $args $posn $posn]
}
@ -90,7 +90,7 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
set freq "100000000"
}
}
puts $file_handle "#define [format "%s" [xget_dname $drv_string $arg]] $freq"
puts $file_handle "#define [format "%s" [::hsm::utils::get_driver_param_name $drv_string $arg]] $freq"
# Print all parameters for all peripherals
set device_id 0
@ -123,8 +123,8 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
if {[llength $value] == 0} {
set value 0
}
set value [xformat_addr_string $value $arg]
puts $file_handle "#define [xget_name $periph $arg] $value"
set value [::hsm::utils::format_addr_string $value $arg]
puts $file_handle "#define [::hsm::utils::get_ip_param_name $periph $arg] $value"
}
puts $file_handle ""
}
@ -140,7 +140,7 @@ proc xdefine_config_file {drv_handle file_name drv_string args} {
set filename [file join "src" $file_name]
file delete $filename
set config_file [open $filename w]
xprint_generated_header $config_file "Driver configuration"
::hsm::utils::write_c_header $config_file "Driver configuration"
puts $config_file "#include \"xparameters.h\""
puts $config_file "#include \"[string tolower $drv_string].h\""
puts $config_file "\n/*"
@ -148,7 +148,7 @@ proc xdefine_config_file {drv_handle file_name drv_string args} {
puts $config_file " */\n"
puts $config_file [format "%s_Config %s_ConfigTable\[\] =" $drv_string $drv_string]
puts $config_file "\{"
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
set start_comma ""
set device_id 0
foreach periph $periphs {
@ -157,7 +157,7 @@ proc xdefine_config_file {drv_handle file_name drv_string args} {
set canonical_name [format "%s_%s" "UartNs550" $device_id]
foreach arg $args {
puts -nonewline $config_file [format "%s\t\t%s" $comma [xget_dname $canonical_name $arg]]
puts -nonewline $config_file [format "%s\t\t%s" $comma [::hsm::utils::get_driver_param_name $canonical_name $arg]]
set comma ",\n"
}
puts -nonewline $config_file "\n\t\}"
@ -178,10 +178,10 @@ proc xdefine_config_file {drv_handle file_name drv_string args} {
#
proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
# Open include file
set file_handle [xopen_include_file $file_name]
set file_handle [::hsm::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver
set periphs [xget_sw_iplist_for_driver $drv_handle]
set periphs [::hsm::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver
foreach periph $periphs {
@ -215,17 +215,17 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
foreach arg $args {
set lvalue [xget_dname $canonical_name $arg]
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg]
#handle CLOCK_FREQ_HZ as a special case
if {[string compare -nocase "CLOCK_FREQ_HZ" $arg] == 0} {
set rvalue [xget_name $periph $arg]
set rvalue [::hsm::utils::get_ip_param_name $periph $arg]
} else {
set rvalue [get_property CONFIG.$arg $periph]
if {[llength $rvalue] == 0} {
set rvalue 0
}
set rvalue [xformat_addr_string $rvalue $arg]
set rvalue [::hsm::utils::format_addr_string $rvalue $arg]
}
puts $file_handle "#define $lvalue $rvalue"
@ -251,7 +251,7 @@ proc xget_freq {periph} {
set port_name "xin"
}
set freq [xget_ip_clk_pin_freq $periph "S_AXI_ACLK"]
set freq [::hsm::utils::get_clk_pin_freq $periph "S_AXI_ACLK"]
# If the clock frequency can not be obtained from "xin" port,
# read the value of the parameter C_EXTERNAL_XIN_CLK_HZ to get

View file

@ -85,7 +85,7 @@ proc gen_include_files {swproj mhsinst} {
set stdout [get_property CONFIG.STDOUT [get_os]]
set isStdout [string match $stdout $mhsinst]
if {${isStdout} == 0} {
set ifuartns550intr [is_ip_interrupting_current_processor $mhsinst]
set ifuartns550intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifuartns550intr == 1} {
set inc_file_lines {xuartns550_l.h uartns550_header.h xuartns550.h uartns550_intr_header.h}
} else {
@ -107,7 +107,7 @@ proc gen_src_files {swproj mhsinst} {
set stdout [get_property CONFIG.STDOUT [get_os]]
set isStdout [string match $stdout $mhsinst]
if {${isStdout} == 0} {
set ifuartns550intr [is_ip_interrupting_current_processor $mhsinst]
set ifuartns550intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifuartns550intr == 1} {
set inc_file_lines {examples/xuartns550_selftest_example.c examples/xuartns550_intr_example.c data/uartns550_header.h data/uartns550_intr_header.h}
} else {
@ -130,7 +130,7 @@ proc gen_init_code {swproj mhsinst} {
if {${isStdout} == 0} {
if {$swproj == 1} {
set ipname [get_property NAME $mhsinst]
set ifuartns550intr [is_ip_interrupting_current_processor $mhsinst]
set ifuartns550intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifuartns550intr == 1} {
set decl " static XUartNs550 ${ipname}_UartNs550;"
set inc_file_lines $decl
@ -142,8 +142,8 @@ proc gen_init_code {swproj mhsinst} {
return ""
}
set clockhz [xget_dname "XUartNs550" "CLOCK_HZ"]
set baseaddr [xget_name $mhsinst "BASEADDR"]
set clockhz [::hsm::utils::get_driver_param_name "XUartNs550" "CLOCK_HZ"]
set baseaddr [::hsm::utils::get_ip_param_name $mhsinst "BASEADDR"]
set ipname [get_property NAME $mhsinst]
append testfunc_call "
@ -157,7 +157,7 @@ proc gen_init_code {swproj mhsinst} {
proc gen_testfunc_call {swproj mhsinst} {
set ipname [get_property NAME $mhsinst]
set ifuartns550intr [is_ip_interrupting_current_processor $mhsinst]
set ifuartns550intr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set testfunc_call ""
if {$swproj == 0} {
@ -176,7 +176,7 @@ proc gen_testfunc_call {swproj mhsinst} {
return $testfunc_call
}
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -185,7 +185,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
if {$ifuartns550intr == 1} {
set intr_pin_name [get_pins -of_objects [get_cells $ipname] -filter "TYPE==INTERRUPT"]
set intcname [get_connected_interrupt_controller $ipname $intr_pin_name]
set intcname [::hsm::utils::get_connected_intr_cntrl $ipname $intr_pin_name]
set intcvar intc
set proc [get_property IP_NAME [get_cells [get_sw_processor]]]
}

View file

@ -121,7 +121,7 @@ proc gen_testfunc_call {swproj mhsinst} {
return $testfunc_call
}
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -129,7 +129,7 @@ proc gen_testfunc_call {swproj mhsinst} {
set hasStdout 1
}
set isintr [is_ip_interrupting_current_processor $mhsinst]
set isintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set intcvar intc

View file

@ -90,7 +90,7 @@ proc gen_testfunc_call {swproj mhsinst} {
}
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0

View file

@ -73,7 +73,7 @@ proc gen_include_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set iftmrintr [is_ip_interrupting_current_processor $mhsinst]
set iftmrintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$iftmrintr == 1} {
set inc_file_lines {xwdttb.h wdttb_header.h wdttb_intr_header.h}
} else {
@ -88,7 +88,7 @@ proc gen_src_files {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
set iftmrintr [is_ip_interrupting_current_processor $mhsinst]
set iftmrintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$iftmrintr == 1} {
set inc_file_lines {examples/xwdttb_selftest_example.c examples/xwdttb_intr_example.c data/wdttb_header.h data/wdttb_intr_header.h}
@ -111,7 +111,7 @@ proc gen_init_code {swproj mhsinst} {
if {$swproj == 1} {
set ipname [get_property NAME $mhsinst]
set iftmrintr [is_ip_interrupting_current_processor $mhsinst]
set iftmrintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
if {$iftmrintr == 1} {
set decl " static XWdtTb ${ipname}_Wdttb;"
set inc_file_lines $decl
@ -129,9 +129,9 @@ proc gen_testfunc_call {swproj mhsinst} {
return ""
}
set iftmrintr [is_ip_interrupting_current_processor $mhsinst]
set iftmrintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set ipname [get_property NAME $mhsinst]
set deviceid [xget_name $mhsinst "DEVICE_ID"]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]]
if { $stdout == "" || $stdout == "none" } {
set hasStdout 0
@ -141,7 +141,7 @@ proc gen_testfunc_call {swproj mhsinst} {
if {$iftmrintr == 1} {
set intr_pin_name [get_pins -of_objects [get_cells $ipname] WDT_INTERRUPT]
set intcname [get_connected_interrupt_controller $ipname $intr_pin_name]
set intcname [::hsm::utils::get_connected_intr_cntrl $ipname $intr_pin_name]
set intcvar intc
set proc [get_property IP_NAME [get_cells [get_sw_processor]]]
}

View file

@ -104,7 +104,7 @@ proc generate {os_handle} {
file delete -force "./src/profile"
set enable_sw_profile "false"
}
set file_handle [xopen_include_file "xparameters.h"]
set file_handle [::hsm::utils::open_include_file "xparameters.h"]
puts $file_handle "#include \"xparameters_ps.h\""
puts $file_handle ""
close $file_handle
@ -141,15 +141,15 @@ proc generate {os_handle} {
file delete -force $commonsrcdir
# Handle stdin and stdout
handle_stdin $os_handle
handle_stdout $os_handle
::hsm::utils::handle_stdin $os_handle
::hsm::utils::handle_stdout $os_handle
#Handle Profile configuration
if { $enable_sw_profile == "true" } {
handle_profile $os_handle $proctype
}
set file_handle [xopen_include_file "xparameters.h"]
set file_handle [::hsm::utils::open_include_file "xparameters.h"]
puts $file_handle "\n/******************************************************************/\n"
close $file_handle
@ -167,7 +167,7 @@ proc generate {os_handle} {
set bspcfg_fn [file join "src" "bspconfig.h"]
file delete $bspcfg_fn
set bspcfg_fh [open $bspcfg_fn w]
xprint_generated_header $bspcfg_fh "Configurations for Standalone BSP"
::hsm::utils::write_c_header $bspcfg_fh "Configurations for Standalone BSP"
if { $proctype == "microblaze" && [mb_has_pvr $hw_proc_handle] } {
@ -208,7 +208,7 @@ proc xhandle_mb_interrupts {} {
# Handle the interrupt pin
set sw_proc_handle [get_sw_processor]
set periph [get_cells [get_property HW_INSTANCE $sw_proc_handle] ]
set source_ports [xget_interrupt_sources $periph]
set source_ports [::hsm::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"
return
@ -228,9 +228,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 [xget_name $source_periph "DEVICE_ID"]
set source_handler_arg [::hsm::utils::get_ip_param_name $source_periph "DEVICE_ID"]
} else {
set source_handler_arg [xget_name $source_periph "C_BASEADDR"]
set source_handler_arg [::hsm::utils::get_ip_param_name $source_periph "C_BASEADDR"]
}
}
}
@ -254,7 +254,7 @@ proc xcreate_mb_intr_config_file {handler arg} {
file delete $filename
set config_file [open $filename w]
xprint_generated_header $config_file "Interrupt Handler Table for MicroBlaze Processor"
::hsm::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\""
@ -280,7 +280,7 @@ proc xcreate_mb_exc_config_file {os_handle} {
set hfilename [file join "src" "microblaze_exceptions_g.h"]
file delete $hfilename
set hconfig_file [open $hfilename w]
xprint_generated_header $hconfig_file "Exception Handling Header for MicroBlaze Processor"
::hsm::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]
@ -538,7 +538,7 @@ proc handle_profile { os_handle proctype } {
file delete -force $filename
set config_file [open $filename w]
xprint_generated_header $config_file "Profiling Configuration parameters. These parameters
::hsm::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"
@ -625,7 +625,7 @@ 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 [xformat_addr_string $timer_baseaddr "C_BASEADDR"]"
puts $config_file "#define PROFILE_TIMER_BASEADDR [::hsm::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]
@ -634,13 +634,13 @@ proc handle_profile_opbtimer { config_file timer_inst } {
}
#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 [xget_sink_pins [get_pins -of_objects [get_cells $timer_intr] INTERRUPT]]
set intr_port_list [::hsm::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 { [is_external_pin $intr_port] } {
if { [::hsm::utils::is_external_pin $intr_port] } {
continue
}
set iptype [get_property CONFIG.EDK_IPTYPE $intc_handle]
@ -663,7 +663,7 @@ proc handle_profile_opbtimer { config_file timer_inst } {
# }
#set signals [split [xget_value $intr_port "VALUE"] "&"]
set signals [xget_source_pins $intr_port]
set signals [::hsm::utils::get_source_pins $intr_port]
set i 1
foreach signal $signals {
set signal [string trim $signal]

View file

@ -158,7 +158,7 @@ proc generate {os_handle} {
# Write the arch.make file
set makecpu [open "./src/cpu.make" w]
xprint_generated_header_tcl $makecpu "Configuration parameters for PPC Xilkernel Makefile"
::hsm::utils::write_tcl_header $makecpu "Configuration parameters for PPC Xilkernel Makefile"
if { [string match -nocase ppc440* $proctype] } {
puts $makecpu "CPU_TYPE=440"
} else {
@ -181,7 +181,7 @@ proc generate {os_handle} {
# Write the config.make file
set makeconfig [open "../standalone/src/config.make" w]
#xprint_generated_header_tcl $makeconfig "Configuration parameters for Standalone Makefile"
#::hsm::utils::write_tcl_header $makeconfig "Configuration parameters for Standalone Makefile"
if { $proctype == "microblaze" } {
if { [mb_has_exceptions $hw_proc_handle] } {
@ -199,8 +199,8 @@ proc generate {os_handle} {
file delete -force $datadir
# Handle stdin and stdout
handle_stdin $os_handle
handle_stdout $os_handle
::hsm::utils::handle_stdin $os_handle
::hsm::utils::handle_stdout $os_handle
# Modify Makefile based on whether inbyte.c and outbyte.c been created
if {[file exists "./src/inbyte.c"] && [file exists "./src/inbyte.c"]} {
@ -245,7 +245,7 @@ proc generate {os_handle} {
set bspcfg_fn [file join ".." "standalone" "src" "bspconfig.h"]
file delete $bspcfg_fn
set bspcfg_fh [open $bspcfg_fn w]
xprint_generated_header $bspcfg_fh "Configurations for Standalone BSP"
::hsm::utils::write_c_header $bspcfg_fh "Configurations for Standalone BSP"
if { $proctype == "microblaze" && [mb_has_pvr $hw_proc_handle] } {
@ -271,7 +271,7 @@ proc generate {os_handle} {
set config_file [xopen_new_include_file "./src/include/os_config.h" "XilKernel Configuration parameters"]
set init_file [xopen_new_include_file "./src/include/config/config_init.h" "XilKernel Configuration parameters"]
xprint_generated_header $init_file "LibXilKernel Initialization structures"
::hsm::utils::write_c_header $init_file "LibXilKernel Initialization structures"
puts $init_file "\#include <sys/init.h>"
puts $init_file "\#include <os_config.h>\n\n"
@ -407,8 +407,8 @@ proc generate {os_handle} {
if { $sysintc_spec != "none" } {
xput_define $config_file "CONFIG_INTC" "true"
set sysintc_dev_handle [get_cells $sysintc_spec]
set sysintc_baseaddr [xget_name $sysintc_dev_handle "C_BASEADDR"]
set sysintc_device_id [xget_name $sysintc_dev_handle "DEVICE_ID"]
set sysintc_baseaddr [::hsm::utils::get_ip_param_name $sysintc_dev_handle "C_BASEADDR"]
set sysintc_device_id [::hsm::utils::get_ip_param_name $sysintc_dev_handle "DEVICE_ID"]
xput_define $config_file "sysintc_baseaddr" $sysintc_baseaddr
xput_define $config_file "sysintc_device_id" $sysintc_device_id
@ -421,7 +421,7 @@ proc generate {os_handle} {
error "ERROR: System Timer Interrupt PORT is not specified" "" "mdt_error"
}
#set mhs_handle [get_cells -of_object $systmr_handle]
set intr_ports [xget_sink_pins [get_pins -of_objects [get_cells $systmr_intr] INTERRUPT]]
set intr_ports [::hsm::utils::get_sink_pins [get_pins -of_objects [get_cells $systmr_intr] INTERRUPT]]
#set intr_ports [xget_connected_ports_handle $mhs_handle $systmr_intr "sink"]
foreach intr_port $intr_ports {
set intr_port_type [get_property TYPE $intr_port]
@ -436,7 +436,7 @@ proc generate {os_handle} {
continue
}
set systmr_intrpin [get_pins -of_objects [get_cells $systmr_handle] -filter "TYPE == INTERRUPT"]
set intr_id [xget_port_interrupt_id $systmr_handle $systmr_intrpin]
set intr_id [::hsm::utils::get_port_intr_id $systmr_handle $systmr_intrpin]
puts $config_file "#define SYSTMR_INTR_ID $intr_id\n"
}
}
@ -539,7 +539,7 @@ proc generate {os_handle} {
set dbus_if_name "M_AXI_DP"
}
set dbus_name [xget_hw_busif_value $hw_proc_handle $dbus_if_name]
set dbus_name [::hsm::utils::get_intfnet_name $hw_proc_handle $dbus_if_name]
set dbus_handle [get_cells $dbus_name]
if { $interconnect == 2 } {
set dcachelink_handle [get_cells "DXCL"]
@ -570,7 +570,7 @@ proc generate {os_handle} {
foreach {base high} $addrlist {
set skip 0
foreach {memcon_handle} $memcon_handles {
set memcon_addrlist [xget_ip_mem_ranges $memcon_handle]
set memcon_addrlist [::hsm::utils::get_ip_mem_ranges $memcon_handle]
foreach mem_range $memcon_addrlist {
set mc_base [get_property BASE_VALUE $mem_range]
set mc_high [get_property HIGH_VALUE $mem_range]
@ -625,7 +625,7 @@ proc generate {os_handle} {
proc xopen_new_include_file { filename description } {
set inc_file [open $filename w]
xprint_generated_header $inc_file $description
::hsm::utils::write_c_header $inc_file $description
set newfname [string map {. _} [lindex [split $filename {\/}] end]]
puts $inc_file "\#ifndef _[string toupper $newfname]"
puts $inc_file "\#define _[string toupper $newfname]\n\n"
@ -740,7 +740,7 @@ proc xhandle_mb_interrupts {} {
# Handle the interrupt pin
set sw_proc_handle [get_sw_processor]
set periph [get_cells [get_property HW_INSTANCE $sw_proc_handle]]
set source_ports [xget_interrupt_sources $periph]
set source_ports [::hsm::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"
return
@ -767,12 +767,12 @@ proc xhandle_mb_interrupts {} {
set source_interrupt_handler [get_property CONFIG.int_handler $int_array_elem]
set source_handler_arg [get_property CONFIG.int_handler_arg $int_array_elem]
if {[string compare -nocase $source_handler_arg DEVICE_ID] == 0 } {
set source_handler_arg [xget_name $source_periph "DEVICE_ID"]
set source_handler_arg [::hsm::utils::get_ip_param_name $source_periph "DEVICE_ID"]
} else {
if {[string compare -nocase "global" [get_property TYPE $source_port]] == 0} {
set source_handler_arg $default_arg
} else {
set source_handler_arg [xget_name $source_periph "C_BASEADDR"]
set source_handler_arg [::hsm::utils::get_ip_param_name $source_periph "C_BASEADDR"]
}
}
break
@ -800,7 +800,7 @@ proc xcreate_mb_intr_config_file {handler arg} {
file delete $filename
set config_file [open $filename w]
xprint_generated_header $config_file "Interrupt Handler Table for MicroBlaze Processor"
::hsm::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\""
@ -828,7 +828,7 @@ proc xcreate_mb_exc_config_file { } {
file delete $hfilename
set hconfig_file [open $hfilename w]
xprint_generated_header $hconfig_file "Exception Handling Header for MicroBlaze Processor"
::hsm::utils::write_c_header $hconfig_file "Exception Handling Header for MicroBlaze Processor"
puts $hconfig_file "\n"
@ -993,7 +993,7 @@ proc xget_memory_controller_handles { mhs } {
foreach mhsinst $mhsinsts {
# Gets all parameters of the component
set mem_ranges [xget_ip_mem_ranges $mhsinst]
set mem_ranges [::hsm::utils::get_ip_mem_ranges $mhsinst]
# Loop thru each param and find tag "ADDR_TYPE = MEMORY"
foreach mem_range $mem_ranges {

View file

@ -59,7 +59,7 @@ proc ffs_drc {libhandle} {
}
proc get_ffs_periphs {processor} {
set periphs_list [xget_hw_proc_slave_periphs $processor]
set periphs_list [hsm::utils::get_proc_slave_periphs $processor]
set ffs_periphs_list {}
global ffs_periphs_name_list
@ -102,7 +102,7 @@ proc execs_generate {libhandle} {
proc xgen_opts_file {libhandle} {
# Open xparameters.h file
set file_handle [xopen_include_file "xparameters.h"]
set file_handle [hsm::utils::open_include_file "xparameters.h"]
# Generate parameters for "file system with SD" and "MMC support"
puts $file_handle "/* Xilinx FAT File System Library (XilFFs) User Settings */"

View file

@ -77,7 +77,7 @@ proc execs_generate {libhandle} {
proc xgen_opts_file {libhandle} {
# Open xparameters.h file
set file_handle [xopen_include_file "xparameters.h"]
set file_handle [::hsm::utils::open_include_file "xparameters.h"]
# Generate parameters for Flash family support
puts $file_handle "/* Xilinx EDK Parallel Flash Library (XilFlash) User Settings */"

View file

@ -68,7 +68,7 @@ proc isf_drc {libhandle} {
}
proc get_spi_periphs {processor} {
set periphs_list [xget_hw_proc_slave_periphs $processor]
set periphs_list [::hsm::utils::get_proc_slave_periphs $processor]
set spi_periphs_list {}
global spi_periphs_name_list
@ -129,7 +129,7 @@ proc execs_generate {libhandle} {
proc xgen_opts_file {libhandle} {
# Open xparameters.h file
set file_handle [xopen_include_file "xparameters.h"]
set file_handle [::hsm::utils::open_include_file "xparameters.h"]
# -----------------------------
# Generate Flash options

View file

@ -40,7 +40,7 @@ proc mfs_open_include_file {file_name} {
set config_inc [open $filename a]
} else {
set config_inc [open $filename a]
xprint_generated_header $config_inc "MFS Parameters"
::hsm::utils::write_c_header $config_inc "MFS Parameters"
}
return $config_inc
}