Skip to content

Regenerate missing or stale Verilog when linking#2

Open
nanavati wants to merge 3 commits into
verilog-codegen-stagefrom
vlink-regen
Open

Regenerate missing or stale Verilog when linking#2
nanavati wants to merge 3 commits into
verilog-codegen-stagefrom
vlink-regen

Conversation

@nanavati

@nanavati nanavati commented Jul 2, 2026

Copy link
Copy Markdown
Owner

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).

nanavati and others added 3 commits July 17, 2026 06:11
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>
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.

1 participant