Skip to content

Commit 06042cd

Browse files
committed
synth: add SYNTH_MOCK_LARGE_MEMORIES
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 40674dd commit 06042cd

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

flow/designs/sky130hd/microwatt/config.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,4 @@ export SETUP_SLACK_MARGIN = 0.2
3636
# GRT non-default config
3737
export FASTROUTE_TCL = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NICKNAME)/fastroute.tcl
3838

39-
# This is high, some SRAMs should probably be converted
40-
# to real SRAMs and not instantiated as flops
41-
export SYNTH_MEMORY_MAX_BITS = 42000
42-
39+
export SYNTH_MOCK_LARGE_MEMORIES = 1

flow/scripts/synth.tcl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,20 @@ if { !$::env(SYNTH_HIERARCHICAL) } {
5555
synth -flatten -run coarse:fine {*}$synth_full_args
5656
}
5757

58+
59+
if { $::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+
}
68+
}
69+
}
70+
}
71+
5872
json -o $::env(RESULTS_DIR)/mem.json
5973
# Run report and check here so as to fail early if this synthesis run is doomed
6074
exec -- $::env(PYTHON_EXE) $::env(SCRIPTS_DIR)/mem_dump.py \

flow/scripts/variables.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,22 @@ SYNTH_MEMORY_MAX_BITS:
177177
default: 4096
178178
stages:
179179
- synth
180+
SYNTH_MOCK_LARGE_MEMORIES:
181+
description: >
182+
Reduce memories larger than SYNTH_MEMORY_MAX_BITS to 1 row.
183+
184+
This is useful to separate the concern of instantiating and placing
185+
memories from investigating other issues with a design.
186+
187+
Memories with a single 1 row will of course have unrealistically good
188+
timing and area characteristics, but timing will still correctly terminate
189+
in a register.
190+
191+
Also, large port memories, typically register files, will still have the
192+
retain a lot of the port logic that can be useful to investigate issues.
193+
default: 0
194+
stages:
195+
- synth
180196
SYNTH_HDL_FRONTEND:
181197
description: >
182198
Select an alternative language frontend to ingest the design. Available option

0 commit comments

Comments
 (0)