Repository navigation
refactor(sv)!: pass the analysis session explicitly instead of sharing it through RefCell - #2695
Conversation
|
This pull request is part of a Mergify stack:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
7fdf30a to
e83edf8
Compare
a32b2e1 to
5c74b5f
Compare
Revision history
|
e83edf8 to
4a2353c
Compare
5c74b5f to
37cf250
Compare
|
Queued — the merge queue status continues in this comment ↓. |
🚫 Left the queue12 min in the queue, with no time running CI. So far
Reason The pull request conflicts with Conflicting file: The pull request was held in the queue, conflicting with at least one of 2 pull requests ahead of it. The conflict became a base branch one after #2674, #2675 merged. Hint You should update or rebase your pull request. A pull request queued by a rule comes back to the queue once updated, as long as the rule still matches. If it was queued with a command, post a new Requeued — the merge queue status continues in this comment ↓. Times in UTC · dashboard · how the merge queue works |
…g it through RefCell An analysis kept its caches and what it reported in an AnalysisState that its contexts shared through an Rc, mutated behind RefCells and Cells: the classes and class specializations laid out so far, the class declaration scopes, the progress of nested specializations, the dimension discovery caches, the elaboration memo, the semantic type table, the registry of package class specializations, the call sites, the diagnostics and the inline randomizations. These are now plain fields of a Session that analysis owns and passes as `&mut Session` beside its context. A scope analyzed on its own starts a session; a package class specialization is analyzed in a session that takes over the registry, the types and the call sites and gives them back. Guards that undid state on drop are explicit steps after the work they bracket, and the constraint budget, the counters of unnamed generate blocks and the interface expansion cache are owned values too. What module analyses add to the packages they use (package class specializations, semantic types and call sites) was mutated through the shared `&Packages`. It is now a `Design`, which `Packages::design` starts from and which every analysis of a module of the design takes as `&mut Design`: `ParsedSource::analyze_module` and its siblings take `(&Packages, &mut Design)`, and `Packages::specialized_state_modules` reads the package state from a `Design`. The frontend keeps one `Design` per elaboration. Behavior is unchanged: the analyzer and frontend tests, the SystemVerilog suite and a UVM elaboration (same output, about 11 s and 1.0 GB before and after) agree. Change-Id: I45f5bd5855e3593db29f801e7ecc65846a9adc24
4a2353c to
079afbd
Compare
✅ Merged into
|
An analysis kept its caches and what it reported in an AnalysisState that
its contexts shared through an Rc, mutated behind RefCells and Cells: the
classes and class specializations laid out so far, the class declaration
scopes, the progress of nested specializations, the dimension discovery
caches, the elaboration memo, the semantic type table, the registry of
package class specializations, the call sites, the diagnostics and the
inline randomizations. These are now plain fields of a Session that
analysis owns and passes as
&mut Sessionbeside its context. A scopeanalyzed on its own starts a session; a package class specialization is
analyzed in a session that takes over the registry, the types and the call
sites and gives them back. Guards that undid state on drop are explicit
steps after the work they bracket, and the constraint budget, the counters
of unnamed generate blocks and the interface expansion cache are owned
values too.
What module analyses add to the packages they use (package class
specializations, semantic types and call sites) was mutated through the
shared
&Packages. It is now aDesign, whichPackages::designstartsfrom and which every analysis of a module of the design takes as
&mut Design:ParsedSource::analyze_moduleand its siblings take(&Packages, &mut Design), andPackages::specialized_state_modulesreadsthe package state from a
Design. The frontend keeps oneDesignperelaboration.
Behavior is unchanged: the analyzer and frontend tests, the SystemVerilog
suite and a UVM elaboration (same output, about 11 s and 1.0 GB before and
after) agree.