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:
parent
bd2c924e6a
commit
fbb6edaf03
21 changed files with 201 additions and 201 deletions
|
@ -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]]]
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -39,5 +39,5 @@
|
|||
|
||||
proc generate {drv_handle} {
|
||||
|
||||
xdefine_addr_params $drv_handle "xparameters.h"
|
||||
::hsm::utils::define_addr_params $drv_handle "xparameters.h"
|
||||
}
|
||||
|
|
|
@ -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]]]
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ""
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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} {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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]]]
|
||||
}
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]]]
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue