You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(sv): class-scoped types and randomization of module subclasses for package classes #1892
Classes declared in packages and the compilation unit (#1850) are laid out and lowered in their own scope and exported as layouts. Two uses from an importing module still fail:
Class-scoped types of an imported class. For package p; class C; typedef bit [7:0] word_t; endclass endpackage, a module with import p::C; C::word_t value; cannot resolve word_t: member types live in the declaring analysis's specialization registry, which the exported Class layout does not carry. This affects non-parameterized classes too.
Randomization of module subclasses through a package-class handle. When a module declares D extends p::B and calls randomize() (or object-wide rand_mode) through a p::B handle holding a D, the call uses the package's p::B::randomize, whose dynamic-class cases were generated before D was visible, and fails with RandomizationClassMismatch. Virtual method dispatchers and $cast helpers are already rebuilt in the importing scope for its own classes; the built-in randomization dispatch is not.
Class qualifiers imported inside a generate block.if (1) begin : g import p::C; initial value = C::f(); end reports an unknown package C: import resolution tells class qualifiers from package qualifiers only through the module's own imports, while generate-block imports stay in the generate scopes.
Class qualifiers imported at compilation-unit scope. With import p::C; (or import p::*;) in the compilation unit before a module, C::f() inside the module reports an unknown package C: the module's ScopeImports does not include the compilation-unit imports visible before it, so the qualifier falls through to package lookup before unit.visibility.imports is consulted.
Expected
Export the resolved class-scoped types with the layouts and use them in member lookup; rebuild the imported randomization dispatch (and rand_mode) over the classes the importing scope sees; consult the enclosing generate imports and the compilation-unit imports when classifying C:: qualifiers.
Activity
feat(sv)!: support per-object constraint modes
feat(sv)!: support per-object constraint modes