Skip to content

asap7/aes-block: synthesize with slang, fixed die so it smoke-tests BLOCKS, not mpl - #4681

Open
oharboe wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:aes-block-slang
Open

oharboe wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:aes-block-slang

Conversation

@oharboe

@oharboe oharboe commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Synthesize asap7/aes-block with slang, the better frontend: yosys's own Verilog frontend is on its way out.

  • --ignore-timing for the aes sources' #1 delays, as asap7/aes-mbff has, in config.mk and block.mk.
  • Fixed DIE_AREA/CORE_AREA for the parent and both blocks, with headroom: aes-block smoke-tests BLOCKS, and at CORE_UTILIZATION its macros sit at the edge of what mpl packs, so a small change in synthesis (here slang's slightly smaller netlist) flips it into MPL-0003.
  • The design's purpose, a smoke test of BLOCKS and not of macro placement, stated in config.mk.

Tested: the parent and both blocks build to final with slang.

🤖 Generated with Claude Code

yosys's own Verilog frontend is on its way out for SystemVerilog;
aes-block now reads its sources with slang, the parent (config.mk) and
its blocks (block.mk) alike.

TL;DR the snags:

- The aes sources write their registers with `<= #1`, which slang
  refuses as unsynthesizable timing control ("Compilation failed" at
  canonicalization); read_verilog ignored the delays silently.
  --ignore-timing does the same under slang, as asap7/aes-mbff has.
  The blocks need it too: a block runs from block.mk alone, while the
  parent blackboxes it, so a parent-only setting leaves aes_rcon
  failing on its own.
- slang's netlist is 1.3 % smaller (5,592 vs 5,667 um^2), so
  CORE_UTILIZATION 47 gave a smaller core, and rtl_macro_placer found
  no valid tiling for its 21 macros (MPL-0003).

The parent and each block now have DIE_AREA/CORE_AREA, today's result
of their utilizations with read_verilog. Absolute sizes keep the
macros fitting as yosys and OpenROAD improve: aes-block is the smoke
test of BLOCKS plus macro placement, not of utilization.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>

@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 switches the synthesis HDL frontend to slang and configures absolute die and core areas for the aes-block design to ensure stable smoke tests. A review comment suggests explicitly checking for aes_sbox using else ifeq instead of a default else block in block.mk to prevent maintenance hazards if new blocks are added in the future.

Comment thread flow/designs/asap7/aes-block/block.mk
A new block fell into the else arm and silently got aes_sbox's size.
Each block is now named; one that is not has no size and stops at
floorplan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe marked this pull request as ready for review October 15, 2026 11:44
@oharboe
oharboe requested a review from maliberty October 15, 2026 11:45
@oharboe

oharboe commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

@maliberty Switch to slang and lock down die/core area.

Improved QoR from slang caused die area to shrink when using CORE_UTILIZATION, which caused a phantom MPL error.

@openroad-ci

openroad-ci commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

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

Commit e81d764 · Jenkins build #3 · Baseline: build · View build on dashboard

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

@maliberty

Copy link
Copy Markdown
Member

CORE_UTILIZATION then gives a core too small for the macros, a phantom MPL-0003 sounds like a bug to fix rather than hide.

@oharboe

oharboe commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

CORE_UTILIZATION then gives a core too small for the macros, a phantom MPL-0003 sounds like a bug to fix rather than hide.

The parent gets smaller, but the macros dont.

But fair point, it could do with some double checking. If it is broken, then it needs an issue and a fix which is in mpl maintainer court.

If not, then it can merge as is.

Either way: requires a maintainers eye to see if this is an mpl bug or not and this PR is a reproduction case.

Please advise.

@oharboe

oharboe commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

@maliberty MPL-0003 here follows the core area, not the frontend: it is a change in die/core area, not a bug introduced by slang.

MPL-0003 against the parent core area

  • The 21 macros with their halos cover 9,792 um² in every run. Macro placement fails while they take more than ~82 % of the core and passes below that; the nearest failing and passing cores differ by one 0.108 um site column.
  • At the same core the two netlists agree: read_verilog and slang both fail at 11,875 um² (read_verilog's own CORE_UTILIZATION 47 core) and both pass at 12,028 um² (this PR's sizes).
  • CORE_UTILIZATION 47 gives slang 11,857 um² and read_verilog 11,875 um². Both fail in the bazel-orfs build; the 113.801 um die this PR vendors gives 12,028 um², larger than either.

The tiling search giving up at 82 % is mpl's to judge separately; this PR is the reproducer, at any core between 11,875 and 11,922 um².

Synthesis, read_verilog vs slang

Standard-cell area per module

module read_verilog slang
aes_sbox (x20) 568 cells, 56.32 um² 568 cells, 56.32 um² identical
aes_rcon 92 cells, 10.59 um² 92 cells, 10.59 um² identical
aes_key_expand_128 841 cells, 116.67 um² 797 cells, 107.09 um² -8.2 %
aes_cipher_top own logic 2,813 cells, 370.06 um² 2,759 cells, 366.26 um² -1.0 %

Where slang differs:

  • reg [31:0] w[3:0] in aes_key_expand_128.v: read_verilog warns Replacing memory \w with list of registers and splits it into four $dff; slang keeps one $mem_v2. After memory_map both are the same coarse logic (4 $dff, 4 $mux, 14 $xor), and aes_cipher_top's coarse logic is identical too (209 cells each). The area difference appears in ABC's mapping of the same logic, so it is incidental, not a better netlist.
  • The <= #1 delays: read_verilog drops them silently, slang refuses them unless told to (--ignore-timing).

Equivalence, kepler-formal LEC, read_verilog netlist as gold, slang as gate, the parent with its blocks' netlists:

check flops paired by name outputs compared SAT problem verdict
aes_sbox 0 8 trivial (identical) no difference
aes_rcon 12 56 trivial (identical) no difference
whole design 530 1,189 27,209 vars, 71,792 clauses, UNSAT in 0.4 s no difference
negative control: one NAND2 made a NOR2 530 1,189 SAT in 0.1 s difference found

No retiming, so both frontends name every flop alike and the netlists go in as synthesised. kepler-formal at acb85ea8, with two carried patches: one logs the problem size, the other (a skip for clock-gated flops) is not enabled here.

Floorplans at this PR's sizes, both after macro placement (odb-debug, headless):

slang read_verilog
slang floorplan read_verilog floorplan
Arms
arm frontend sizing core (um²) macro placement
A read_verilog CORE_UTILIZATION 47 11,874.9 MPL-0003
B slang CORE_UTILIZATION 47 11,857.2 MPL-0003
C slang this PR 12,028.4 passes
D read_verilog this PR 12,028.4 passes
sweep slang core upper right 111.2 ... 111.7 um 11,874.9 / 11,916.1 / 11,922.0 / 11,933.8 / 11,975.1 / 11,986.9 fail / fail / fail / pass / pass / pass

One run per point; built with bazel-orfs on ORFS 9c431405.

@oharboe

oharboe commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

@maliberty Good pushback, I did the yak-shave: The-OpenROAD-Project/bazel-orfs#1290.

TL;DR Good to go.

aes-block is the smoke test of BLOCKS, not of macro placement. At CORE_UTILIZATION 47 its macros sit at the edge of what mpl packs (~82 % of the core), so any small change upstream of mpl flips it into MPL-0003. Here that change was slang's slightly smaller netlist; read_verilog at the same setting fails too in the bazel-orfs build. A fixed die/core with headroom keeps mpl out of this test. The purpose is now stated in config.mk.

aes-block tests hierarchical synthesis, hardened blocks and their
macros in the parent, not macro placement or utilization. Say so in
config.mk, where the fixed die is set, and point block.mk at it.

The old comment called the parent's die "today's result of
CORE_UTILIZATION 47" with read_verilog; it is larger than that
(12,028 vs 11,875 um^2 core), by design: headroom keeps the macros off
the edge of what macro placement can pack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe oharboe changed the title asap7/aes-block: synthesize with slang, at absolute sizes asap7/aes-block: synthesize with slang, fixed die so it smoke-tests BLOCKS, not mpl Oct 17, 2026
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