I want to have a SystemVerilog class which contains an array of another class, like below:
class AggregateClass;
integer x;
OtherClass[x] otherClassArray;
extern function new(int x, logic in);
endclass: AggregateClass
class OtherClass;
// ...
extern function new(logic in);
// ...
endclass: OtherClass
- How do I define an array of classes in SystemVerilog?
- How can I have the number of class objects in said class array be set by the constructor?