There are 2 problems I’d like to solve.
- A parametrizable array of interfaces.
Let’s say I define an array of interfaces and pass them to a module instance:
module top;
base_interface [7:0] my_ifs;
super_dut #(NUM_IFS=8) dut (
.ifs (actual_ifs[NUM_IFS-1:0])
);
endmodule
That’s legal SV, right?
- “derived” interfaces
Suppose I have 10 different interfaces. In principle I’d like to have a “base interface” from which each is derived. Then I could use the code in #1 and get a “parametrizable generalized interface”. But SV doesn’t support the notion of “child” interfaces the way it supports derived classes.
Is there a way to implement such a concept?
Couldn’t you implement an interface that’s the union of all 10 interfaces, and make that the “base” interface? That gets a bit messy, but it seems like it would work.
Any way to do it more cleanly?
Thanks!