Implement parsing memory map from ip.conf

This commit is contained in:
Madeline Busig 2025-11-11 00:06:17 -08:00
parent 49723910d8
commit cf43ac49d3

View File

@ -142,6 +142,38 @@ proc ParseInterfaceConf { iface_name iface_conf } {
InterfaceAddPortMaps $iface $port_maps InterfaceAddPortMaps $iface $port_maps
} }
proc AddMemoryMapBlock {memmap block_name block_conf} {
set disp_name [DictValueOr $block_conf "DISPLAY_NAME" ""]
set description [DictValueOr $block_conf "DESCRIPTION" ""]
set base_addr [DictValueOr $block_conf "BASE_ADDRESS" "0"]
set range [DictValueOr $block_conf "RANGE" "4096"]
set width [DictValueOr $block_conf "WIDTH" "0"]
set block [ipx::add_address_block $block_name $memmap]
set_property DISPLAY_NAME $disp_name $block
set_property DESCRIPTION $description $block
set_property BASE_ADDRESS $base_addr $block
set_property RANGE $range $block
set_property WIDTH $width $block
}
proc ParseMemoryMapConf {iface_name memmap_conf} {
set memmap_name "${iface_name}_mem"
set blocks [dict get $memmap_conf "BLOCKS"]
set memmap [ipx::add_memory_map $memmap_name [ipx::current_core]]
set associated_iface [ipx::get_bus_interfaces $iface_name -of_objects [ipx::current_core]]
set_property SLAVE_MEMORY_MAP_REF $memmap_name $associated_iface
foreach block_name $blocks {
puts "Parsing block $block_name of $memmap_name"
set block_conf [GetSubValues $memmap_conf $block_name]
AddMemoryMapBlock $memmap $block_name $block_conf
}
}
set gitroot [exec git rev-parse --show-toplevel] set gitroot [exec git rev-parse --show-toplevel]
set hogroot "$gitroot/Hog" set hogroot "$gitroot/Hog"
@ -241,6 +273,17 @@ foreach {key val} $ip_conf {
} }
} }
puts "Parsing memory maps"
set memmaps [GetSubValues $ip_conf "memmap"]
puts "Memmaps: $memmaps"
foreach {associated_iface memmap_conf} $memmaps {
puts "Parsing memory map for iface $associated_iface, conf: $memmap_conf"
ParseMemoryMapConf $associated_iface $memmap_conf
}
puts "Packaging IP" puts "Packaging IP"
# Increment revision # Increment revision