Commit bf136442 authored by David Volz's avatar David Volz
Browse files

addrmap & statuscore for PEs with many intf and ipec

parent 07379d4f
Pipeline #2548 passed with stages
in 157 minutes and 32 seconds
...@@ -35,40 +35,65 @@ namespace eval arch { ...@@ -35,40 +35,65 @@ namespace eval arch {
set pes [lsort [get_processing_elements]] set pes [lsort [get_processing_elements]]
foreach pe $pes { foreach pe $pes {
puts " processing $pe registers ..." set reg_segs [lsort [get_bd_addr_segs -filter { USAGE == register } $pe/*]]
set usrs [lsort [get_bd_addr_segs -filter { USAGE == register } $pe/*]] set mem_segs [lsort [get_bd_addr_segs -filter { USAGE == memory } $pe/*]]
for {set i 0} {$i < [llength $usrs]} {incr i} { if {[llength $reg_segs] <= 1 && [llength $mem_segs] <= 1} {
set seg [lindex $usrs $i] puts " processing $pe registers ..."
puts " seg: $seg" for {set i 0} {$i < [llength $reg_segs]} {incr i} {
if {[get_property MODE [get_bd_intf_pins -of_objects $seg]] == "Master"} { set seg [lindex $reg_segs $i]
puts " skipping master seg $seg" puts " seg: $seg"
} else { if {[get_property MODE [get_bd_intf_pins -of_objects $seg]] == "Master"} {
set intf [get_bd_intf_pins -of_objects $seg] puts " skipping master seg $seg"
set range [get_property RANGE $seg] } else {
set offset [next_valid_address $offset $range] set intf [get_bd_intf_pins -of_objects $seg]
::platform::addressmap::add_processing_element [llength [dict keys $ret]] $offset $range set range [get_property RANGE $seg]
dict set ret $intf "interface $intf [format "offset 0x%08x range 0x%08x" $offset $range] kind register" set offset [next_valid_address $offset $range]
incr offset $range ::platform::addressmap::add_processing_element [llength [dict keys $ret]] $offset $range
dict set ret $intf "interface $intf [format "offset 0x%08x range 0x%08x" $offset $range] kind register"
incr offset $range
}
} }
} puts " processing $pe memories ..."
puts " processing $pe memories ..." for {set i 0} {$i < [llength $mem_segs]} {incr i} {
set usrs [lsort [get_bd_addr_segs -filter { USAGE == memory } $pe/*]] set seg [lindex $mem_segs $i]
for {set i 0} {$i < [llength $usrs]} {incr i} { puts " seg: $seg"
set seg [lindex $usrs $i] if {[get_property MODE [get_bd_intf_pins -of_objects $seg]] == "Master"} {
puts " seg: $seg" puts " skipping master seg $seg"
if {[get_property MODE [get_bd_intf_pins -of_objects $seg]] == "Master"} { } else {
puts " skipping master seg $seg" set intf [get_bd_intf_pins -of_objects $seg]
continue set range [get_property RANGE $seg]
} else { set offset [next_valid_address $offset $range]
set intf [get_bd_intf_pins -of_objects $seg] ::platform::addressmap::add_processing_element [llength [dict keys $ret]] $offset $range
set range [get_property RANGE $seg] dict set ret $intf "interface $intf [format "offset 0x%08x range 0x%08x" $offset $range] kind memory"
set offset [next_valid_address $offset $range] incr offset $range
::platform::addressmap::add_processing_element [llength [dict keys $ret]] $offset $range }
dict set ret $intf "interface $intf [format "offset 0x%08x range 0x%08x" $offset $range] kind memory" }
incr offset $range } else {
# if there is more than one reg/mem interface, we assume that the user knows what they are doing and add them in the same order
puts " processing $pe registers and memories ..."
set all_segs [lsort [get_bd_addr_segs $pe/*]]
for {set i 0} {$i < [llength $all_segs]} {incr i} {
set seg [lindex $all_segs $i]
puts " seg: $seg"
if {[get_property MODE [get_bd_intf_pins -of_objects $seg]] == "Master"} {
puts " skipping master seg $seg"
} else {
set intf [get_bd_intf_pins -of_objects $seg]
set range [get_property RANGE $seg]
set usage [get_property USAGE $seg]
set offset [next_valid_address $offset $range]
::platform::addressmap::add_processing_element [llength [dict keys $ret]] $offset $range
if { $usage == "register" } {
dict set ret $intf "interface $intf [format "offset 0x%08x range 0x%08x" $offset $range] kind register subintf $i"
} else {
dict set ret $intf "interface $intf [format "offset 0x%08x range 0x%08x" $offset $range] kind memory subintf $i"
}
incr offset $range
}
} }
} }
} }
return $ret return $ret
} }
} }
...@@ -540,6 +540,16 @@ namespace eval ::tapasco::ip { ...@@ -540,6 +540,16 @@ namespace eval ::tapasco::ip {
set kid [dict get [::tapasco::get_composition] $kind id] set kid [dict get [::tapasco::get_composition] $kind id]
set vlnv [dict get [::tapasco::get_composition] $kind vlnv] set vlnv [dict get [::tapasco::get_composition] $kind vlnv]
if {[tapasco::is_feature_enabled "IPEC"]} {
set feature [tapasco::get_feature "IPEC"]
if {[dict exists $feature $vlnv]} {
set subintf [dict get $addr $intf "subintf"]
set kid [lindex [dict get $feature $vlnv "kid"] $subintf]
set kid [expr int($kid)]
set vlnv [lindex [dict get $feature $vlnv "vlnv"] $subintf]
}
}
lappend slots [json::write object "Type" [json::write string "Kernel"] "SlotId" $slot_id "Kernel" $kid \ lappend slots [json::write object "Type" [json::write string "Kernel"] "SlotId" $slot_id "Kernel" $kid \
"Offset" [json::write string [format "0x%016x" [expr "[dict get $addr $intf "offset"] - [::platform::get_pe_base_address]"]]] \ "Offset" [json::write string [format "0x%016x" [expr "[dict get $addr $intf "offset"] - [::platform::get_pe_base_address]"]]] \
"Size" [json::write string [format "0x%016x" [dict get $addr $intf "range"]]] \ "Size" [json::write string [format "0x%016x" [dict get $addr $intf "range"]]] \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment