Regenerate missing or stale Verilog when linking#2
Open
nanavati wants to merge 3 commits into
Open
Conversation
nanavati
force-pushed
the
verilog-codegen-stage
branch
from
July 2, 2026 09:18
b215be6 to
71daa54
Compare
nanavati
force-pushed
the
verilog-codegen-stage
branch
from
July 2, 2026 09:55
71daa54 to
42e379e
Compare
nanavati
force-pushed
the
vlink-regen
branch
2 times, most recently
from
July 3, 2026 19:03
93eddd4 to
98881f6
Compare
Verilog linking already loaded the design's .ba hierarchy and discarded
it ("XXX Until we allow re-generation of Verilog files"). Now the link
regenerates any module .v that is missing or older than its .ba, reuses
the rest (reported like Bluesim's object reuse), and passes the module
.v files to the simulator explicitly. A .v given on the command line is
the user's to provide and is never regenerated; file arguments can be
glob patterns (bsc forwards them to the simulator's shell unexpanded),
so module names are matched against the patterns -- "*.v" keeps its
longstanding meaning of "the user provides every module". When no .ba
hierarchy can be found, the link warns (S0099) and uses the .v files as
found, as before. This makes a link self-sufficient regardless of which
subset of the design was pre-generated with -c: -c is point codegen,
link is the closure.
Rather than adding a third variant of generated-file staleness checking,
the timestamp conventions move to a shared StaleUtils (missing product
is never fresh, equal times are fresh), used by the -u check, Bluesim
object reuse, and the new VFileUtils; the checks now agree by
construction, and each keeps only its own validity details (options
descriptor for Bluesim objects, .ba usability for -u).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Describe the three compilation stages and the -c flag (generating code from a module's elaborated .ba file); note that .ba files are written by default for both back ends (-no-elab suppresses them); and describe how linking reuses up-to-date generated files and regenerates the rest, for both Bluesim and Verilog. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The link's .ba check is all-or-nothing per design: if any module's .ba is missing -- a submodule's while the top's is present, or the top's while a submodule's is present -- the link warns (S0099) and uses the .v files as found, never regenerating part of a design it cannot fully see. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
nanavati
force-pushed
the
verilog-codegen-stage
branch
from
July 17, 2026 06:20
42e379e to
9330b63
Compare
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.
Verilog linking already loaded the design's .ba hierarchy and discarded it ("XXX Until we allow re-generation of Verilog files"). Now the link regenerates any module .v that is missing or older than its .ba, reuses the rest (reported like Bluesim's object reuse), and passes the module .v files to the simulator explicitly. A .v given on the command line is the user's to provide and is never regenerated; file arguments can be glob patterns (bsc forwards them to the simulator's shell unexpanded), so module names are matched against the patterns -- "*.v" keeps its longstanding meaning of "the user provides every module". When no .ba hierarchy can be found, the link warns (S0099) and uses the .v files as found, as before. This makes a link self-sufficient regardless of which subset of the design was pre-generated with -c: -c is point codegen, link is the closure.
Rather than adding a third variant of generated-file staleness checking, the timestamp conventions move to a shared StaleUtils (missing product is never fresh, equal times are fresh), used by the -u check, Bluesim object reuse, and the new VFileUtils; the checks now agree by construction, and each keeps only its own validity details (options descriptor for Bluesim objects, .ba usability for -u).