synth: load the slang plugin when read_slang is not built in - #4476
Closed
oharboe wants to merge 1 commit into
Closed
synth: load the slang plugin when read_slang is not built in#4476oharboe wants to merge 1 commit into
oharboe wants to merge 1 commit into
Conversation
Yosys 0.67 vendors the slang frontend under frontends/slang, so read_slang is a built-in command there and the explicit plugin load was dropped. Yosys 0.66 and older do not have it, and the same code is available to them as an out-of-tree plugin (povik/sv-elab, formerly yosys-slang) -- which is what the Bazel build in bazel-orfs supplies, since the BCR yosys module is still on 0.64. On such a Yosys, SYNTH_HDL_FRONTEND=slang now fails with ERROR: No such command: read_slang (type 'help' for a command overview) even though the plugin is on YOSYS_PLUGIN_PATH, because nothing loads it any more. Load it when, and only when, the command is absent. `plugin -i slang` resolves through YOSYS_PLUGIN_PATH, and the guard makes this a no-op on a Yosys that has the frontend built in, so ORFS works against either without the caller having to say which it has. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the synthesis preamble script (flow/scripts/synth_preamble.tcl) to conditionally load the slang plugin if the read_slang command is not already available. This ensures compatibility with older Yosys versions that do not have the frontend built-in, while remaining a no-op for newer versions. There are no review comments, so I have no feedback to provide.
Collaborator
Author
|
let lie for now |
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.
b18e110c1("drop bundled yosys-slang, use Yosys 0.67 built-in read_slang") removed the explicit plugin load fromsynth_preamble.tcl, on the strength of Yosys 0.67 vendoring the slang frontend underfrontends/slang. That is correct for 0.67+ — I confirmedfrontends/slangis absent in v0.65/v0.66 and present in v0.67/v0.68.It leaves Yosys 0.66 and older with no way to use
SYNTH_HDL_FRONTEND=slang:even when the same code is available as the out-of-tree plugin (
povik/sv-elab, formerlyyosys-slang) and is already onYOSYS_PLUGIN_PATH— because nothing loads it any more.This is not hypothetical: the Bazel Central Registry
yosysmodule is still on 0.64. Yosys ships no Bazel files upstream, so that module is a hand-written overlay and nobody has carried it past 0.64. Every ORFS consumer building through BCR yosys is on 0.64 and cannot use the slang frontend today.The change
plugin -i slangresolves throughYOSYS_PLUGIN_PATH. The guard makes it a strict no-op on a Yosys that has the frontend built in, so ORFS works against either without the caller having to declare which it has — and 0.67+ behaviour is unchanged.Testing
Exercised through bazel-orfs, whose
//slang:testand//slang:blackbox_synthtargets are regression coverage for exactly this path (slang frontend, andSYNTH_BLACKBOXES+--empty-blackboxesthrough it). Both had been failing sinceb18e110c1; both build green with this patch against BCR yosys 0.64.