Repository navigation
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>
Contributor
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.
oharboe
marked this pull request as ready for review
October 27, 2026 08:04
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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