Repository navigation
feat(sv)!: support classes with properties, methods and constructors - #1689
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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
a0c438a to
7539fd7
Compare
dc442b6 to
ff22f03
Compare
Revision history
|
7539fd7 to
ae04081
Compare
ff22f03 to
84585ca
Compare
|
Queued — the merge queue status continues in this comment ↓. |
ae04081 to
e3cc1c1
Compare
84585ca to
d9257ae
Compare
d9257ae to
bd253bf
Compare
Merge Queue Status
This pull request spent 1 hour 19 minutes 31 seconds in the queue, with no time running CI. ReasonThe pull request conflicts with the base branch The pull request was held in the queue, conflicting with at least one of 3 pull requests ahead of it. The conflict became a base branch one after #1741, #1744 merged. HintYou should update or rebase your pull request. If you want to requeue this pull request, you can post a Requeued — the merge queue status continues in this comment ↓. |
SystemVerilog classes declared in a module now simulate. A class variable is a 32-bit handle of an object in the simulator heap that already holds strings (IEEE 1800-2023 8.4). - The heap keeps objects as their class id and property bytes, with the offsets of handle properties so that collection follows them from object to object. Operations through `null` record a fault that the runtime reports as a runtime error after the step. - The parser records class declarations: name, base, qualifiers, properties and methods. - The analyzer lays out each class (2-state integral properties up to 64 bits, `string` and class handles; bases first) and rewrites property reads and writes into object operations that carry the layout. Methods become subroutines `C::m` whose first argument is `this`; a constructor, explicit or implicit, creates the object, runs the property initializers and returns the handle. Inside a method, properties shadow module names. `extern` methods use their out-of-block definitions; pure virtual methods and interface classes are not lowered. - A variable initialized with a bare `new` is kept when its type is a class instead of being dropped like a covergroup instance. - The frontend lowers object operations to calls of the heap helper. - Checkpoints keep objects. State files cannot record them: `StateSchema::capture` now returns a `Result` and fails with `StateError::Objects` while a variable holds an object. 4-state, `real`, array and wider properties, base-class constructors and `super`, virtual method calls, static members and parameterized classes remain unsupported. sv-tests: 8.4, 8.5, 8.6, 8.12-assignment, 8.24, 8.26.5-implemented class handle and 6.20.6-const now pass in both state modes (500 / 502). Verilator and Icarus limitations on the new shared cases are recorded. BREAKING CHANGE: `StateSchema::capture` returns `Result<StateFile, StateError>`, `StateError` has an `Objects` variant and `ValueKind` an `ObjRef` variant. Change-Id: I2389fee4f668b7d915cc475f31a0be37e4030255
bd253bf to
20012bc
Compare
Merge Queue Status
This pull request spent 1 hour 14 minutes 53 seconds in the queue, including 1 hour 11 minutes 29 seconds running CI. Required conditions to merge
|
SystemVerilog classes declared in a module now simulate. A class
variable is a 32-bit handle of an object in the simulator heap that
already holds strings (IEEE 1800-2023 8.4).
offsets of handle properties so that collection follows them from
object to object. Operations through
nullrecord a fault that theruntime reports as a runtime error after the step.
properties and methods.
64 bits,
stringand class handles; bases first) and rewritesproperty reads and writes into object operations that carry the
layout. Methods become subroutines
C::mwhose first argument isthis; a constructor, explicit or implicit, creates the object,runs the property initializers and returns the handle. Inside a
method, properties shadow module names.
externmethods use theirout-of-block definitions; pure virtual methods and interface classes
are not lowered.
newis kept when its type is aclass instead of being dropped like a covergroup instance.
StateSchema::capturenow returns aResultand fails withStateError::Objectswhile a variable holds an object.4-state,
real, array and wider properties, base-class constructors andsuper, virtual method calls, static members and parameterized classesremain unsupported.
sv-tests: 8.4, 8.5, 8.6, 8.12-assignment, 8.24, 8.26.5-implemented
class handle and 6.20.6-const now pass in both state modes (500 / 502).
Verilator and Icarus limitations on the new shared cases are recorded.
BREAKING CHANGE:
StateSchema::capturereturnsResult<StateFile, StateError>,StateErrorhas anObjectsvariantand
ValueKindanObjRefvariant.