Repository navigation
memories: drop the Verilog scanner leftovers, detection is yosys-only - #4609
Conversation
There was a problem hiding this comment.
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.
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>
59367b2 to
cc5c30d
Compare
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 0 with regression(s), 0 without a comparable baseline. |
TL;DR: Removes what's left of the old Verilog memory scanner; AUTO_MEMORIES detection has used yosys only since d01a9c0.
gen_memories.py --verilogfed Verilog to a JSON parser and crashed. That includes the standalone command inAutoMemories.md. The--verilogarguments in the Makefile were never read.--yosys-jsonis now required, and a missing netlist fails loudly instead of reporting "no memories".AUTO_MEMORIESdescription andAutoMemories.mdnow describe the yosys$mem_v2pass instead of the firtool port-name scanner.Testing:
flow/scripts/memories/*_test.pypass. The newtest_missing_yosys_json_failsfails without the change.🤖 Generated with Claude Code