Skip to content

memories: drop the Verilog scanner leftovers, detection is yosys-only - #4609

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:memories-yosys-only
Oct 3, 2026
Merged

maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:memories-yosys-only

Conversation

@oharboe

@oharboe oharboe commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

TL;DR: Removes what's left of the old Verilog memory scanner; AUTO_MEMORIES detection has used yosys only since d01a9c0.

  • gen_memories.py --verilog fed Verilog to a JSON parser and crashed. That includes the standalone command in AutoMemories.md. The --verilog arguments in the Makefile were never read.
  • --yosys-json is now required, and a missing netlist fails loudly instead of reporting "no memories".
  • The AUTO_MEMORIES description and AutoMemories.md now describe the yosys $mem_v2 pass instead of the firtool port-name scanner.

Testing: flow/scripts/memories/*_test.py pass. The new test_missing_yosys_json_fails fails without the change.

🤖 Generated with Claude Code

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the memory detection mechanism in the AUTO_MEMORIES flow to rely on Yosys-inferred $mem_v2 cells rather than a custom Python Verilog scanner. It removes the --verilog option from the generator script, cleans up unused scanning functions, and updates the documentation and configuration variables accordingly. The review feedback suggests explicitly specifying encoding='utf-8' when reading files with Path.read_text() in detect.py to prevent potential platform-dependent decoding issues.

Comment thread flow/scripts/memories/detect.py Resolved
Detection moved from a Python scan of the Verilog for firtool-style
memory ports to yosys $mem_v2 inference (d01a9c0, 1cf0c31), but
the old path survived:

- gen_memories.py fell back to detect.scan_files(--verilog) when
  --yosys-json was absent. scan_files parses JSON, so that fallback
  crashed with JSONDecodeError on any .v file, including the
  standalone command documented in AutoMemories.md.
- the Makefile passed --verilog for every VERILOG_FILES entry, never
  read because it also passes --yosys-json.
- detect.scan_yosys_json() returned no memories for a missing file.

--yosys-json is now required, and a missing netlist raises
FileNotFoundError instead of reporting no memories. The AUTO_MEMORIES
variable description and AutoMemories.md's detection section and
standalone example now describe the yosys pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe force-pushed the memories-yosys-only branch from 59367b2 to cc5c30d Compare October 3, 2026 07:03
@oharboe
oharboe marked this pull request as ready for review October 3, 2026 07:08
@openroad-ci

openroad-ci commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch.

Commit 5efb8dd · Jenkins build #2 · Baseline: build · View build on dashboard

62 design(s) checked — 0 with regression(s), 0 without a comparable baseline.

@maliberty
maliberty merged commit 24a2d1c into The-OpenROAD-Project:master Oct 3, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants