sysmon : added common namespace to all common tcl commands.

Signed-off-by: Nava kishore Manne <navam@xilinx.com>
This commit is contained in:
Nava kishore Manne 2015-04-10 12:17:05 +05:30
parent 222107e23d
commit 07041ca958
2 changed files with 31 additions and 31 deletions

View file

@ -44,31 +44,31 @@ proc generate {drv_handle} {
} }
proc xdefine_include_file {drv_handle file_name drv_string args} { proc xdefine_include_file {drv_handle file_name drv_string args} {
set args [::hsm::utils::get_exact_arg_list $args] set args [::hsi::utils::get_exact_arg_list $args]
# Open include file # Open include file
set file_handle [::hsm::utils::open_include_file $file_name] set file_handle [::hsi::utils::open_include_file $file_name]
# Get all peripherals connected to this driver # Get all peripherals connected to this driver
set periphs [::hsm::utils::get_common_driver_ips $drv_handle] set periphs [::hsi::utils::get_common_driver_ips $drv_handle]
# Handle special cases # Handle special cases
set arg "NUM_INSTANCES" set arg "NUM_INSTANCES"
set posn [lsearch -exact $args $arg] set posn [lsearch -exact $args $arg]
if {$posn > -1} { if {$posn > -1} {
puts $file_handle "/* Definitions for driver [string toupper [get_property name $drv_handle]] */" puts $file_handle "/* Definitions for driver [string toupper [common::get_property name $drv_handle]] */"
# Define NUM_INSTANCES # Define NUM_INSTANCES
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [llength $periphs]" puts $file_handle "#define [::hsi::utils::get_driver_param_name $drv_string $arg] [llength $periphs]"
set args [lreplace $args $posn $posn] set args [lreplace $args $posn $posn]
} }
# Check if it is a driver parameter # Check if it is a driver parameter
lappend newargs lappend newargs
foreach arg $args { foreach arg $args {
set value [get_property CONFIG.$arg $drv_handle] set value [common::get_property CONFIG.$arg $drv_handle]
if {[llength $value] == 0} { if {[llength $value] == 0} {
lappend newargs $arg lappend newargs $arg
} else { } else {
puts $file_handle "#define [::hsm::utils::get_driver_param_name $drv_string $arg] [get_property $arg $drv_handle]" puts $file_handle "#define [::hsi::utils::get_driver_param_name $drv_string $arg] [common::get_property $arg $drv_handle]"
} }
} }
set args $newargs set args $newargs
@ -77,13 +77,13 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
set device_id 0 set device_id 0
foreach periph $periphs { foreach periph $periphs {
puts $file_handle "" puts $file_handle ""
puts $file_handle "/* Definitions for peripheral [string toupper [get_property NAME $periph]] */" puts $file_handle "/* Definitions for peripheral [string toupper [common::get_property NAME $periph]] */"
set ipname [string tolower [get_property IP_NAME $periph]] set ipname [string tolower [common::get_property IP_NAME $periph]]
if {[string compare -nocase "system_management_wiz" $ipname] == 0} { if {[string compare -nocase "system_management_wiz" $ipname] == 0} {
puts $file_handle "#define [::hsm::utils::get_ip_param_name $periph "IP_TYPE"] 1" puts $file_handle "#define [::hsi::utils::get_ip_param_name $periph "IP_TYPE"] 1"
} else { } else {
puts $file_handle "#define [::hsm::utils::get_ip_param_name $periph "IP_TYPE"] 0" puts $file_handle "#define [::hsi::utils::get_ip_param_name $periph "IP_TYPE"] 0"
} }
foreach arg $args { foreach arg $args {
@ -91,16 +91,16 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
set value $device_id set value $device_id
incr device_id incr device_id
} else { } else {
set value [get_property CONFIG.$arg $periph] set value [common::get_property CONFIG.$arg $periph]
} }
if {[llength $value] == 0} { if {[llength $value] == 0} {
set value 0 set value 0
} }
set value [::hsm::utils::format_addr_string $value $arg] set value [::hsi::utils::format_addr_string $value $arg]
if {[string compare -nocase "HW_VER" $arg] == 0} { if {[string compare -nocase "HW_VER" $arg] == 0} {
puts $file_handle "#define [::hsm::utils::get_ip_param_name $periph $arg] \"$value\"" puts $file_handle "#define [::hsi::utils::get_ip_param_name $periph $arg] \"$value\""
} else { } else {
puts $file_handle "#define [::hsm::utils::get_ip_param_name $periph $arg] $value" puts $file_handle "#define [::hsi::utils::get_ip_param_name $periph $arg] $value"
} }
} }
puts $file_handle "" puts $file_handle ""
@ -110,16 +110,16 @@ proc xdefine_include_file {drv_handle file_name drv_string args} {
} }
proc xdefine_canonical_xpars {drv_handle file_name drv_string args} { proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
set args [::hsm::utils::get_exact_arg_list $args] set args [::hsi::utils::get_exact_arg_list $args]
# Open include file # Open include file
set file_handle [::hsm::utils::open_include_file $file_name] set file_handle [::hsi::utils::open_include_file $file_name]
# Get all the peripherals connected to this driver # Get all the peripherals connected to this driver
set periphs [::hsm::utils::get_common_driver_ips $drv_handle] set periphs [::hsi::utils::get_common_driver_ips $drv_handle]
# Get the names of all the peripherals connected to this driver # Get the names of all the peripherals connected to this driver
foreach periph $periphs { foreach periph $periphs {
set peripheral_name [string toupper [get_property NAME $periph]] set peripheral_name [string toupper [common::get_property NAME $periph]]
lappend peripherals $peripheral_name lappend peripherals $peripheral_name
} }
@ -141,7 +141,7 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
set i 0 set i 0
foreach periph $periphs { foreach periph $periphs {
set periph_name [string toupper [get_property NAME $periph]] set periph_name [string toupper [common::get_property NAME $periph]]
# Generate canonical definitions only for the peripherals whose # Generate canonical definitions only for the peripherals whose
# canonical name is not the same as hardware instance name # canonical name is not the same as hardware instance name
@ -149,24 +149,24 @@ proc xdefine_canonical_xpars {drv_handle file_name drv_string args} {
puts $file_handle "/* Canonical definitions for peripheral $periph_name */" puts $file_handle "/* Canonical definitions for peripheral $periph_name */"
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]] set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
set ipname [string tolower [get_property IP_NAME $periph]] set ipname [string tolower [common::get_property IP_NAME $periph]]
if {[string compare -nocase "system_management_wiz" $ipname] == 0} { if {[string compare -nocase "system_management_wiz" $ipname] == 0} {
puts $file_handle "#define [::hsm::utils::get_driver_param_name $canonical_name "IP_TYPE"] 1" puts $file_handle "#define [::hsi::utils::get_driver_param_name $canonical_name "IP_TYPE"] 1"
} else { } else {
puts $file_handle "#define [::hsm::utils::get_driver_param_name $canonical_name "IP_TYPE"] 0" puts $file_handle "#define [::hsi::utils::get_driver_param_name $canonical_name "IP_TYPE"] 0"
} }
foreach arg $args { foreach arg $args {
set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg] set lvalue [::hsi::utils::get_driver_param_name $canonical_name $arg]
# The commented out rvalue is the name of the instance-specific constant # The commented out rvalue is the name of the instance-specific constant
# set rvalue [::hsm::utils::get_ip_param_name $periph $arg] # set rvalue [::hsi::utils::get_ip_param_name $periph $arg]
# The rvalue set below is the actual value of the parameter # The rvalue set below is the actual value of the parameter
set rvalue [::hsm::utils::get_param_value $periph $arg] set rvalue [::hsi::utils::get_param_value $periph $arg]
if {[llength $rvalue] == 0} { if {[llength $rvalue] == 0} {
set rvalue 0 set rvalue 0
} }
set rvalue [::hsm::utils::format_addr_string $rvalue $arg] set rvalue [::hsi::utils::format_addr_string $rvalue $arg]
puts $file_handle "#define $lvalue $rvalue" puts $file_handle "#define $lvalue $rvalue"

View file

@ -96,7 +96,7 @@ proc gen_init_code {swproj mhsinst} {
} }
if {$swproj == 1} { if {$swproj == 1} {
set ipname [get_property NAME $mhsinst] set ipname [common::get_property NAME $mhsinst]
set ifsysmonintr [::hsi::utils::is_ip_interrupting_current_proc $mhsinst] set ifsysmonintr [::hsi::utils::is_ip_interrupting_current_proc $mhsinst]
if {$ifsysmonintr == 1} { if {$ifsysmonintr == 1} {
set decl " static XSysMon ${ipname}_SysMon_ADC;" set decl " static XSysMon ${ipname}_SysMon_ADC;"
@ -116,9 +116,9 @@ proc gen_testfunc_call {swproj mhsinst} {
} }
set ifsysmonintr [::hsi::utils::is_ip_interrupting_current_proc $mhsinst] set ifsysmonintr [::hsi::utils::is_ip_interrupting_current_proc $mhsinst]
set ipname [get_property NAME $mhsinst] set ipname [common::get_property NAME $mhsinst]
set deviceid [::hsi::utils::get_ip_param_name $mhsinst "DEVICE_ID"] set deviceid [::hsi::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [hsi::get_os]] set stdout [common::get_property CONFIG.STDOUT [hsi::get_os]]
if { $stdout == "" || $stdout == "none" } { if { $stdout == "" || $stdout == "none" } {
set hasStdout 0 set hasStdout 0
} else { } else {
@ -129,7 +129,7 @@ proc gen_testfunc_call {swproj mhsinst} {
set intr_pin_name [hsi::get_pins -of_objects [hsi::get_cells $ipname] -filter "TYPE==INTERRUPT"] set intr_pin_name [hsi::get_pins -of_objects [hsi::get_cells $ipname] -filter "TYPE==INTERRUPT"]
set intcname [::hsi::utils::get_connected_intr_cntrl $ipname $intr_pin_name] set intcname [::hsi::utils::get_connected_intr_cntrl $ipname $intr_pin_name]
set intcvar intc set intcvar intc
set proc [get_property IP_NAME [hsi::get_cells [hsi::get_sw_processor]]] set proc [common::get_property IP_NAME [hsi::get_cells [hsi::get_sw_processor]]]
} }
set testfunc_call "" set testfunc_call ""