File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -57,14 +57,19 @@ if { !$::env(SYNTH_HIERARCHICAL) } {
5757
5858
5959if { $::env(SYNTH_MOCK_LARGE_MEMORIES) } {
60- foreach module [get_modules] {
61- foreach mem [get_memories $module ] {
62- set size [memory_get $module $mem SIZE]
63-
64- if {$size > $::env(SYNTH_MEMORY_MAX_BITS) } {
65- memory_set $module $mem SIZE 1
66- puts " Shrunk memory $mem in module $module from $size to 1"
67- }
60+ memory_collect
61+ foreach path [tee -q -s result.string select -list t:\$ mem_v2] {
62+ set index [string first " /" $path ]
63+ set module [string range $path 0 [expr {$index - 1}]]
64+ set instance [string range $path [expr {$index + 1}] end]
65+
66+ set width [rtlil::get_param -uint $module $instance WIDTH]
67+ set size [rtlil::get_param -uint $module $instance SIZE]
68+ set nbits [expr $width * $size ]
69+ puts " Memory $path has dimensions $size x $width = $nbits "
70+ if {$nbits > $::env(SYNTH_MEMORY_MAX_BITS) } {
71+ rtlil::set_param -uint $module $instance SIZE 1
72+ puts " Shrunk memory $path from $size rows to 1"
6873 }
6974 }
7075}
You can’t perform that action at this time.
0 commit comments