Skip to content

yosys-slang is now sv-elab in BCR.#10884

Draft
hzeller wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
hzeller:feature-20260711-sv-elab
Draft

yosys-slang is now sv-elab in BCR.#10884
hzeller wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
hzeller:feature-20260711-sv-elab

Conversation

@hzeller

@hzeller hzeller commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@hzeller hzeller requested a review from a team as a code owner July 11, 2026 16:58
@hzeller hzeller requested a review from maliberty July 11, 2026 16:58

@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 replaces the yosys-slang dependency with sv-elab in MODULE.bazel and updates the plugin path accordingly, alongside updating MODULE.bazel.lock. Feedback suggests marking the new sv-elab dependency with dev_dependency = True to ensure it is not transitively pulled in by downstream consumers.

Comment thread MODULE.bazel Outdated
Signed-off-by: Henner Zeller <h.zeller@acm.org>
@hzeller hzeller force-pushed the feature-20260711-sv-elab branch from f0f9323 to d7d78fc Compare July 11, 2026 17:02
@hzeller

hzeller commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator Author

It looks like there is a different behavior with the slang 11-based sv-elab; it stumbles in mock-array

https://jenkins.openroad.tools/job/OpenROAD-Public/job/PR-10884-merge/2/stages/?start-byte=0&selected-node=452#log-452-820

@oharboe can you make sense of it ?

@oharboe

oharboe commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Looks like the root cause is swallowed...

tcl is misconfigured though

17:10:10 Warning: Tcl_Init() call failed - no such file or directory

@hzeller

hzeller commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator Author

When compiling locally, I see

$ bazel test -c opt //test/orfs/gcd:gcd_idempotent_test_cts
[WARNING ORD-0011] Hierarchical flow (-hier) is currently in development and may cause multiple issues. Do not use in production environments.
read_sdc bazel-out/k8-opt/bin/test/orfs/gcd/results/asap7/gcd/base/1_2_yosys.sdc
source external/orfs+/flow/platforms/asap7/setRC.tcl
eliminate_dead_logic
Removed 0 unused instances and 0 unused nets.
Design area 41 um^2 100% utilization.
write_db bazel-out/k8-opt/bin/test/orfs/gcd/results/asap7/gcd/base/1_synth.odb
write_sdc -no_timestamp bazel-out/k8-opt/bin/test/orfs/gcd/results/asap7/gcd/base/1_synth.sdc
Error: synth_odb.tcl, 36 cannot write file bazel-out/k8-opt/bin/test/orfs/gcd/results/asap7/gcd/base/1_synth.sdc.
Target //test/orfs/gcd:gcd_idempotent_test_cts failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /home/hzeller/src/my/OpenROAD/test/orfs/gcd/BUILD:62:11 RunfilesTree test/orfs/gcd/gcd_idempotent_test_cts.runfiles failed: (Exit 2): bash failed: error executing Action command (from orfs_synth_rule rule target //test/orfs/gcd:gcd_synth) /nix/store/c3sigsp51raq4cd127hx7vydiqzvy5c1-bash/bin/bash -c ... (remaining 7 arguments skipped)

which is the 1_synt.sdc write thing (but I also run in the RBE environment). But that is supposed to be fixed already, right ?

@oharboe

oharboe commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

I think this is unrelated, you can check. The-OpenROAD-Project/OpenROAD-flow-scripts#4333

Done, including lots of yak shaving. Waiting for merge or further yaks to shave.

@maliberty

Copy link
Copy Markdown
Member
[2026-07-11T17:10:01.794Z] (17:10:01) ERROR: /home/jenkins/agent/workspace/OpenROAD-Public_PR-10884-merge-2-bazel-ci/test/orfs/mock-array/BUILD:71:9: Canonicalizing RTL for Element failed: (Exit 2): bash failed: error executing Action command (from orfs_synth_rule rule target //test/orfs/mock-array:Element_4x4_slang_synth) /bin/bash -c ... (remaining 6 arguments skipped)

seems like a real issue and not flakiness

@oharboe

oharboe commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Probably a garden variety configuration problem. Since the error is swallowed, I am thinking yosys-abc. Maybe better now, but abc segfaults/asserts were swallowed in the past.

Claude will use the bazel-orfs _deps flow to iterate on it and create a fix.

The _deps.flow is documented in .md files

@hzeller hzeller marked this pull request as draft July 11, 2026 19:35
@hzeller

hzeller commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator Author

Ok, handing it to you. You can start with this patch to sv-elab and then see what happens. Setting this to draft.

@oharboe

oharboe commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Chased the mock-array regression down. Short version: mock-array passes --ignore-unknown-modules, which sv-elab retired — so under the BCR sv-elab 2026-07-07 plugin it's now a hard error and the Element canonicalize aborts. But the more useful finding is why it was hard to see, so let me lead with that.

Why it only says "Canonicalizing RTL for Element failed"

The real diagnostic is being swallowed by yosys verbosity. Running the exact read_slang command the flow generates for the Element synth, against the sv-elab 2026-07-07 plugin + yosys 0.64, and only varying YOSYS_FLAGS:

YOSYS_FLAGS actual error shown? what you see
(empty) error: '--ignore-unknown-modules' no longer supported with sv-elab; visit .../wiki/No-unknown-modules
-q ERROR: Compilation failed
-v 3 (ORFS default) 1. Executing SLANG frontend.ERROR: Compilation failed

So with the default YOSYS_FLAGS=-v 3 the specific error never reaches the log — the flow just reports the generic "Canonicalizing RTL for Element failed."

How to fish (any "Canonicalizing RTL for X failed" / "Compilation failed" in the slang path): re-run with YOSYS_FLAGS= (empty) to unmask, or replay read_slang standalone with the args from results/**/logs/**/1_1_yosys_canonicalize.log. That's what surfaced the real message here.

Durable upstream bug (worth its own fix): a hard error should be emitted regardless of -v/-q. Right now sv-elab's NoIgnoreUnknownModules diagnostic is suppressed at both -q and -v 3 and only prints when no verbosity flag is set. Errors that stop the build should never be gated by verbosity.

Root cause

povik/sv-elab@3774661 ("Retire unknown module support") removes handle(UninstantiatedDefSymbol) and adds, in catch_forbidden_options:

if (driver.options.compilationFlags[ast::CompilationFlags::IgnoreUnknownModules])
    engine.issue({diag::NoIgnoreUnknownModules, slang::SourceLocation::NoLocation});

i.e. --ignore-unknown-modules is now rejected outright. That commit is in the window between the pin OpenROAD currently vendors (6760afa, which still accepts the flag) and the 2026-07-07 release this PR adopts (6760afa is 35 commits behind the tag; master == 2026-07-07, so there's no later upstream fix).

test/orfs/mock-array/mock-array.bzl passes the flag in two places (the Element synth and the MockArray synth):

"SYNTH_SLANG_ARGS": "--ignore-unknown-modules --empty-blackboxes -DELEMENT_COLS={}".format(config["cols"]),

Fix

Drop --ignore-unknown-modules. It's redundant: multiplier (and Element at the array level) are already declared empty blackboxes via --empty-blackboxes + --blackboxed-module, so nothing is actually "unknown." Verified against sv-elab 2026-07-07 + yosys 0.64 — with the flag removed both tops elaborate cleanly:

  • --top Element → 4 multiplier blackbox cells, ElementInner submodule.
  • --top MockArray (8×8) → 64 Element blackbox cells.

Reference

bazel-orfs PR #763 (The-OpenROAD-Project/bazel-orfs#763) migrates the from-source EDA stack to BCR sv-elab 2026-07-07 and validates it end-to-end (a slang design + a gallery slang design synthesize cleanly). Neither bazel-orfs nor ORFS core inject --ignore-unknown-modules, so only mock-array's per-design args need this change.

@oharboe

oharboe commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Filed the "errors always suppressed by verbosity" diagnosability bug upstream: povik/sv-elab#364 (root cause + suggested fix). That is separate from the --ignore-unknown-modules fix above; it is why this was hard to see in the first place.

@oharboe

oharboe commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

@hzeller Will you fix the problem here? See above... The error propagation fix in sv-elab is orthogonal + it yosys has always swallowed some errors in the past, it keeps improving.

Once you have this merged, I'll update bazel-orfs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants