Repository navigation
synth: a ROM is not counted against SYNTH_MEMORY_MAX_BITS - #4744
Conversation
SYNTH_MEMORY_MAX_BITS is the AUTO_MEMORIES policy's tripwire: a read/write memory larger than it belongs in a macro (AUTO_MEMORIES, fakeram) or a mock, and must not go undetected into flip-flops. mem_dump.py counted ROMs too. A ROM, a $mem_v2 with no write port, holds constants that synthesis maps to logic like any other logic; it is not storage a RAM would replace, and it goes through the normal flow. Admitting a large ROM meant raising the limit, which let read/write memories of that size through as well. coralnpu's FPU divider has one (The-OpenROAD-Project#4653): its SRT bound table, 128 x 83 = 10,624 bits, which synthesises on its own in about 3 s to about 700 cells on asap7. ROMs are rare, so they get no limit of their own: they are not counted. The table still lists every memory, a ROM marked as one, and variables.yaml says so under SYNTH_MEMORY_MAX_BITS. test_mem_dump.py checks that a read/write memory over the limit stops synthesis and that a ROM of the same size does not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
There was a problem hiding this comment.
Code Review
This pull request updates the memory limit checks to exclude ROMs (inferred memories with no write ports) from the SYNTH_MEMORY_MAX_BITS constraint. It updates the documentation, modifies mem_dump.py to identify ROMs and bypass the limit check, and adds corresponding unit tests. The review feedback suggests making the ROM detection logic in mem_dump.py more robust by safely handling potential KeyError, ValueError, or TypeError exceptions when parsing the WR_PORTS parameter.
# Conflicts: # docs/user/FlowVariables.md Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 1 with regression(s), 1 without a comparable baseline. ❌ asap7/aes-block base — 2 failing metric(s)
|
A ROM, an inferred memory with no write port, is no longer counted against
SYNTH_MEMORY_MAX_BITS.The limit is the
AUTO_MEMORIESpolicy's tripwire. A read/write memory larger than it belongs in a macro (AUTO_MEMORIES, fakeram) or a mock, and must not go undetected into flip-flops. A ROM holds constants that synthesis maps to logic like any other logic, and it goes through the normal flow. Counting ROMs meant that admitting a large one raised the limit for read/write memories of that size as well.The coralnpu work in progress (#4653) needs this. coralnpu's FPU divider has an SRT bound table, a 128 x 83 ROM (10,624 bits), over the default of 4,096. On its own it synthesises on asap7 in about 3 s to about 700 cells (71 µm²). Random-content ROMs up to 128 kbit synthesise in about a minute, so ROMs, which are rare, get no limit of their own.
mem_dump.pystill lists every memory, a ROM marked as one, and stops on a read/write memory over the limit as before.variables.yamlsays underSYNTH_MEMORY_MAX_BITSthat ROMs are not counted, and why;variables.jsonandFlowVariables.mdare regenerated.flow/test/test_mem_dump.pychecks that a read/write memory over the limit stops synthesis, that a ROM of the same size does not, and that a read/write memory under the limit passes. Against the currentmem_dump.py, the ROM case fails.🤖 Generated with Claude Code