scugic : added namespace for all HSI TCL commands.
Signed-off-by: Nava kishore Manne <navam@xilinx.com>
This commit is contained in:
parent
7ec407e342
commit
3ecea15617
2 changed files with 92 additions and 94 deletions
|
@ -65,10 +65,10 @@ proc generate {drv_handle} {
|
||||||
#
|
#
|
||||||
proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
|
proc xdefine_zynq_include_file {drv_handle file_name drv_string 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"
|
||||||
|
@ -76,7 +76,7 @@ proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
|
||||||
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 [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
|
||||||
|
@ -87,11 +87,11 @@ proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
|
||||||
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 CONFIG.$arg $drv_handle]"
|
puts $file_handle "#define [::hsi::utils::get_driver_param_name $drv_string $arg] [get_property CONFIG.$arg $drv_handle]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set args $newargs
|
set args $newargs
|
||||||
set procdrv [get_sw_processor]
|
set procdrv [hsi::get_sw_processor]
|
||||||
set compiler [get_property CONFIG.compiler $procdrv]
|
set compiler [get_property CONFIG.compiler $procdrv]
|
||||||
# Print all parameters for all peripherals
|
# Print all parameters for all peripherals
|
||||||
set device_id 0
|
set device_id 0
|
||||||
|
@ -132,8 +132,8 @@ proc xdefine_zynq_include_file {drv_handle file_name drv_string args} {
|
||||||
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]
|
||||||
set arg_name [::hsm::utils::get_ip_param_name $periph $arg]
|
set arg_name [::hsi::utils::get_ip_param_name $periph $arg]
|
||||||
regsub "S_AXI_" $arg_name "" arg_name
|
regsub "S_AXI_" $arg_name "" arg_name
|
||||||
if {[string compare -nocase "HW_VER" $arg] == 0} {
|
if {[string compare -nocase "HW_VER" $arg] == 0} {
|
||||||
puts $file_handle "#define $arg_name \"$value\""
|
puts $file_handle "#define $arg_name \"$value\""
|
||||||
|
@ -154,10 +154,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} {
|
proc xdefine_zynq_canonical_xpars {drv_handle file_name drv_string 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 {
|
||||||
|
@ -184,7 +184,7 @@ proc xdefine_zynq_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 [get_property NAME $periph]]
|
||||||
set procdrv [get_sw_processor]
|
set procdrv [hsi::get_sw_processor]
|
||||||
set compiler [get_property CONFIG.compiler $procdrv]
|
set compiler [get_property CONFIG.compiler $procdrv]
|
||||||
# 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
|
||||||
|
@ -193,13 +193,13 @@ proc xdefine_zynq_canonical_xpars {drv_handle file_name drv_string args} {
|
||||||
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
|
set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]]
|
||||||
|
|
||||||
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]
|
||||||
# replace S_SXI_ with CPU_. This is a temporary fix. Revist when the
|
# replace S_SXI_ with CPU_. This is a temporary fix. Revist when the
|
||||||
# S_AXI_DIST_BASEADDR is generated by the tools
|
# S_AXI_DIST_BASEADDR is generated by the tools
|
||||||
regsub "S_AXI_" $lvalue "CPU_" lvalue
|
regsub "S_AXI_" $lvalue "CPU_" lvalue
|
||||||
|
|
||||||
# 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
|
||||||
if {[string compare -nocase "C_S_AXI_BASEADDR" $arg] == 0} {
|
if {[string compare -nocase "C_S_AXI_BASEADDR" $arg] == 0} {
|
||||||
if {[string compare -nocase $compiler "arm-none-eabi-gcc"] == 0} {
|
if {[string compare -nocase $compiler "arm-none-eabi-gcc"] == 0} {
|
||||||
|
@ -231,7 +231,7 @@ proc xdefine_zynq_canonical_xpars {drv_handle file_name drv_string args} {
|
||||||
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"
|
||||||
|
|
||||||
|
@ -247,27 +247,27 @@ proc xdefine_zynq_canonical_xpars {drv_handle file_name drv_string args} {
|
||||||
|
|
||||||
proc xdefine_gic_params {drvhandle} {
|
proc xdefine_gic_params {drvhandle} {
|
||||||
|
|
||||||
set config_inc [::hsm::utils::open_include_file "xparameters.h"]
|
set config_inc [::hsi::utils::open_include_file "xparameters.h"]
|
||||||
# Next define interrupt IDs for each connected peripheral
|
# Next define interrupt IDs for each connected peripheral
|
||||||
|
|
||||||
set periphs [::hsm::utils::get_common_driver_ips $drvhandle]
|
set periphs [::hsi::utils::get_common_driver_ips $drvhandle]
|
||||||
set device_id 0
|
set device_id 0
|
||||||
|
|
||||||
foreach periph $periphs {
|
foreach periph $periphs {
|
||||||
|
|
||||||
# get the gic mode information
|
# get the gic mode information
|
||||||
set scugic_mode [get_property CONFIG.C_IRQ_F2P_MODE $periph]
|
set scugic_mode [get_property CONFIG.C_IRQ_F2P_MODE $periph]
|
||||||
|
|
||||||
# Get the edk based name of peripheral for printing redefines
|
# Get the edk based name of peripheral for printing redefines
|
||||||
set edk_periph_name [get_property NAME $periph]
|
set edk_periph_name [get_property NAME $periph]
|
||||||
|
|
||||||
# Handle CorenIRQ/FIQ interrupts
|
# Handle CorenIRQ/FIQ interrupts
|
||||||
xhandle_coreirq_interrupts
|
xhandle_coreirq_interrupts
|
||||||
|
|
||||||
# Get ports that are driving the interrupt
|
# Get ports that are driving the interrupt
|
||||||
#set source_ports [::hsm::utils::get_interrupt_sources $periph]
|
#set source_ports [::hsi::utils::get_interrupt_sources $periph]
|
||||||
set pin [get_pins -of_objects $periph IRQ_F2P]
|
set pin [hsi::get_pins -of_objects $periph IRQ_F2P]
|
||||||
set source_ports [::hsm::utils::get_source_pins $pin]
|
set source_ports [::hsi::utils::get_source_pins $pin]
|
||||||
set i 0
|
set i 0
|
||||||
lappend source_list
|
lappend source_list
|
||||||
foreach source_port $source_ports {
|
foreach source_port $source_ports {
|
||||||
|
@ -277,14 +277,14 @@ proc xdefine_gic_params {drvhandle} {
|
||||||
set source_periph($i) "DUMMY"
|
set source_periph($i) "DUMMY"
|
||||||
set source_name($i) "DUMMY"
|
set source_name($i) "DUMMY"
|
||||||
} else {
|
} else {
|
||||||
set external_pin [::hsm::utils::is_external_pin $source_port]
|
set external_pin [::hsi::utils::is_external_pin $source_port]
|
||||||
if {$external_pin} {
|
if {$external_pin} {
|
||||||
set source_port_name($i) [get_property NAME $source_port]
|
set source_port_name($i) [get_property NAME $source_port]
|
||||||
set source_periph($i) "system"
|
set source_periph($i) "system"
|
||||||
set source_name($i) "system"
|
set source_name($i) "system"
|
||||||
} else {
|
} else {
|
||||||
set source_port_name($i) [get_property NAME $source_port]
|
set source_port_name($i) [get_property NAME $source_port]
|
||||||
set source_periph($i) [get_cells -of_object $source_port]
|
set source_periph($i) [hsi::get_cells -of_object $source_port]
|
||||||
set source_name($i) [get_property NAME $source_periph($i)]
|
set source_name($i) [get_property NAME $source_periph($i)]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -304,39 +304,39 @@ proc xdefine_gic_params {drvhandle} {
|
||||||
|
|
||||||
if {[string compare -nocase $scugic_mode "DIRECT"] == 0} {
|
if {[string compare -nocase $scugic_mode "DIRECT"] == 0} {
|
||||||
|
|
||||||
for {set i 0} {$i < $num_intr_inputs} {incr i} {
|
for {set i 0} {$i < $num_intr_inputs} {incr i} {
|
||||||
|
|
||||||
# Skip dummy ports
|
# Skip dummy ports
|
||||||
if {[string compare -nocase $source_port_name($i) "DUMMY"] == 0} {
|
if {[string compare -nocase $source_port_name($i) "DUMMY"] == 0} {
|
||||||
incr k
|
incr k
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
set j [expr 61 + $k]
|
set j [expr 61 + $k]
|
||||||
if {$j >68} {
|
if {$j >68} {
|
||||||
set j [expr 84 + $k - 8]
|
set j [expr 84 + $k - 8]
|
||||||
}
|
}
|
||||||
puts $config_inc [format "#define XPAR_%s_%s_%s_INTR %d" "FABRIC" [string toupper $source_name($i)] [string toupper $source_port_name($i)] $j]
|
puts $config_inc [format "#define XPAR_%s_%s_%s_INTR %d" "FABRIC" [string toupper $source_name($i)] [string toupper $source_port_name($i)] $j]
|
||||||
incr k
|
incr k
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
for {set i [expr ($num_intr_inputs-1)]} {$i >= 0} {incr i -1} {
|
for {set i [expr ($num_intr_inputs-1)]} {$i >= 0} {incr i -1} {
|
||||||
|
|
||||||
# Skip dummy ports
|
# Skip dummy ports
|
||||||
if {[string compare -nocase $source_port_name($i) "DUMMY"] == 0} {
|
if {[string compare -nocase $source_port_name($i) "DUMMY"] == 0} {
|
||||||
incr k
|
incr k
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
set j [expr 91 - $k]
|
set j [expr 91 - $k]
|
||||||
if {$j < 84} {
|
if {$j < 84} {
|
||||||
set j [expr 68 - $k + 8]
|
set j [expr 68 - $k + 8]
|
||||||
}
|
}
|
||||||
puts $config_inc [format "#define XPAR_%s_%s_%s_INTR %d" "FABRIC" [string toupper $source_name($i)] [string toupper $source_port_name($i)] $j]
|
puts $config_inc [format "#define XPAR_%s_%s_%s_INTR %d" "FABRIC" [string toupper $source_name($i)] [string toupper $source_port_name($i)] $j]
|
||||||
incr k
|
incr k
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ proc xdefine_gic_params {drvhandle} {
|
||||||
if {[string compare -nocase $port_type "global"] == 0} {
|
if {[string compare -nocase $port_type "global"] == 0} {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
set drv [get_drivers -filter "HW_INSTANCE==$$source_name($i)"]
|
set drv [hsi::get_drivers -filter "HW_INSTANCE==$$source_name($i)"]
|
||||||
#set iptype [xget_value $source_periph($i) "OPTION" "IPTYPE"]
|
#set iptype [xget_value $source_periph($i) "OPTION" "IPTYPE"]
|
||||||
|
|
||||||
if {[llength $source_name($i)] != 0 && [llength $drv] != 0} {
|
if {[llength $source_name($i)] != 0 && [llength $drv] != 0} {
|
||||||
|
@ -438,7 +438,7 @@ proc lcount {list match_entry} {
|
||||||
###################################################################
|
###################################################################
|
||||||
proc xfind_instance {drvhandle instname} {
|
proc xfind_instance {drvhandle instname} {
|
||||||
|
|
||||||
set instlist [::hsm::utils::get_common_driver_ips $drvhandle]
|
set instlist [::hsi::utils::get_common_driver_ips $drvhandle]
|
||||||
set i 0
|
set i 0
|
||||||
foreach inst $instlist {
|
foreach inst $instlist {
|
||||||
set name [get_property NAME $inst]
|
set name [get_property NAME $inst]
|
||||||
|
@ -458,7 +458,7 @@ proc xfind_instance {drvhandle instname} {
|
||||||
#
|
#
|
||||||
###################################################################
|
###################################################################
|
||||||
proc xget_port_type {port} {
|
proc xget_port_type {port} {
|
||||||
set periph [get_cells -of_objects $port]
|
set periph [hsi::get_cells -of_objects $port]
|
||||||
if {[llength $periph] == 0} {
|
if {[llength $periph] == 0} {
|
||||||
return "global"
|
return "global"
|
||||||
} else {
|
} else {
|
||||||
|
@ -470,31 +470,31 @@ proc xget_port_type {port} {
|
||||||
# Tcl procedure for generating Core IRQ interrupts in xparameters.h file
|
# Tcl procedure for generating Core IRQ interrupts in xparameters.h file
|
||||||
# ----------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------
|
||||||
proc xhandle_coreirq_interrupts { } {
|
proc xhandle_coreirq_interrupts { } {
|
||||||
set file_handle [::hsm::utils::open_include_file "xparameters.h"]
|
set file_handle [::hsi::utils::open_include_file "xparameters.h"]
|
||||||
puts $file_handle "\n/***Definitions for Core_nIRQ/nFIQ interrupts ****/"
|
puts $file_handle "\n/***Definitions for Core_nIRQ/nFIQ interrupts ****/"
|
||||||
close $file_handle
|
close $file_handle
|
||||||
set periphs [get_cells *]
|
set periphs [hsi::get_cells *]
|
||||||
foreach periph $periphs {
|
foreach periph $periphs {
|
||||||
set intr_pins [get_pins -of_objects $periph -filter "TYPE == INTERRUPT"]
|
set intr_pins [hsi::get_pins -of_objects $periph -filter "TYPE == INTERRUPT"]
|
||||||
foreach intr_piin $intr_pins {
|
foreach intr_piin $intr_pins {
|
||||||
set sink_pin [::hsm::utils::get_sink_pins $intr_piin]
|
set sink_pin [::hsi::utils::get_sink_pins $intr_piin]
|
||||||
if { $sink_pin == "Core1_nIRQ" || $sink_pin == "Core0_nIRQ" } {
|
if { $sink_pin == "Core1_nIRQ" || $sink_pin == "Core0_nIRQ" } {
|
||||||
set ip_name [get_property IP_NAME [get_cells $periph]]
|
set ip_name [get_property IP_NAME [hsi::get_cells $periph]]
|
||||||
set periph [string toupper $periph]
|
set periph [string toupper $periph]
|
||||||
set intr_pin [string toupper $intr_piin]
|
set intr_pin [string toupper $intr_piin]
|
||||||
if {$ip_name != "ps7_scugic" } {
|
if {$ip_name != "ps7_scugic" } {
|
||||||
set intr_id "XPAR_FABRIC_${periph}_${intr_pin}_INTR"
|
set intr_id "XPAR_FABRIC_${periph}_${intr_pin}_INTR"
|
||||||
set file_handle [::hsm::utils::open_include_file "xparameters.h"]
|
set file_handle [::hsi::utils::open_include_file "xparameters.h"]
|
||||||
puts $file_handle "#define ${intr_id} 31"
|
puts $file_handle "#define ${intr_id} 31"
|
||||||
close $file_handle
|
close $file_handle
|
||||||
}
|
}
|
||||||
} elseif { $sink_pin == "Core0_nFIQ" || $sink_pin == "Core1_nFIQ" } {
|
} elseif { $sink_pin == "Core0_nFIQ" || $sink_pin == "Core1_nFIQ" } {
|
||||||
set ip_name [get_property IP_NAME [get_cells $periph]]
|
set ip_name [get_property IP_NAME [hsi::get_cells $periph]]
|
||||||
set periph [string toupper $periph]
|
set periph [string toupper $periph]
|
||||||
set intr_pin [string toupper $intr_piin]
|
set intr_pin [string toupper $intr_piin]
|
||||||
if {$ip_name != "ps7_scugic" } {
|
if {$ip_name != "ps7_scugic" } {
|
||||||
set intr_id "XPAR_FABRIC_${periph}_${intr_pin}_INTR"
|
set intr_id "XPAR_FABRIC_${periph}_${intr_pin}_INTR"
|
||||||
set file_handle [::hsm::utils::open_include_file "xparameters.h"]
|
set file_handle [::hsi::utils::open_include_file "xparameters.h"]
|
||||||
puts $file_handle "#define ${intr_id} 28"
|
puts $file_handle "#define ${intr_id} 28"
|
||||||
close $file_handle
|
close $file_handle
|
||||||
}
|
}
|
||||||
|
@ -502,4 +502,3 @@ proc xhandle_coreirq_interrupts { } {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,8 +87,8 @@ proc gen_testfunc_call {swproj mhsinst} {
|
||||||
|
|
||||||
set ipname [get_property NAME $mhsinst]
|
set ipname [get_property NAME $mhsinst]
|
||||||
set decl " static XScuGic ${ipname};"
|
set decl " static XScuGic ${ipname};"
|
||||||
set deviceid [::hsm::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 [get_os]]
|
set stdout [get_property CONFIG.STDOUT [hsi::get_os]]
|
||||||
if { $stdout == "" || $stdout == "none" } {
|
if { $stdout == "" || $stdout == "none" } {
|
||||||
set hasStdout 0
|
set hasStdout 0
|
||||||
} else {
|
} else {
|
||||||
|
@ -150,4 +150,3 @@ proc gen_testfunc_call {swproj mhsinst} {
|
||||||
return $testfunc_call
|
return $testfunc_call
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue