Download EDK Reference Manual
Transcript
Tcl Example Procedures
Example 2
The following procedure explains how to get the list of cores that are memory controllers in
a design. Memory controller cores have the tag, ADDR_TYPE = MEMORY, in their address
parameter.
## Procedure to get a list of memory controllers in a design.
proc xget_hw_memory_controller_handles { merged_mhs } {
set ret_list “”
# Gets all MhsInsts in the system
set mhsinsts [xget_hw_ipinst_handle $merged_mhs “*” ]
# Loop through each MhsInst and determine if it has
#"ADDR_TYPE = MEMORY” in the parameters.
foreach mhsinst $mhsinsts {
# Gets all parameters of the IP
set params [xget_hw_parameter_handle $mhsinst “*”]
# Loop through each param and find tag “ADDR_TYPE = MEMORY”
foreach param $params {
if {$param == 0} {
continue
} elseif {$param == “”} {
continue
}
set addrTypeValue [xget_hw_subproperty_value $param”ADDR_TYPE”]
# Found tag! Add MhsInst to list and break to go to next MhsInst
if {[string compare -nocase $addrTypeValue “MEMORY”] == 0} {
lappend ret_list $mhsinst
break
}
}
}
return $ret_list
}
Embedded System Tools Reference Manual
UG111 July 06, 2011
www.xilinx.com
241