Hi everybody,
I have to use an array of parametrized interface for my project but something is strange. The definition of the interface is:
interface itf_test #(
type PAYLOAD_TYPE = logic [31:0] // Default type
) (
input logic clk,
input logic reset
);
// ----------------------------------
// Signals
// ----------------------------------
PAYLOAD_TYPE payload;
logic vld;
endinterface: itf_test
In my testbench, when I instantiate my array:
parameter int N_TB = 4;
itf_test #(
.PAYLOAD_TYPE (PAYLOAD_ITF_TEST_T)
) itf_test [N_TB:1] (
.clk (clk),
.reset (reset)
);
where {PAYLOAD_ITF_TEST_T} is:
typedef struct packed {
logic [31:0] data;
logic [31:0] time_tag;
} PAYLOAD_ITF_TEST_T;
I have the following info from Questa 10.6b:
**
UVM_INFO @ 0: reporter [itf_test_tb] Size of PAYLOAD_ITF_TEST_T = 64
UVM_INFO @ 0: reporter [itf_test_tb] Size of itf_test[1].payload = 32
UVM_INFO @ 0: reporter [itf_test_tb] Size of itf_test[2].payload = 32
UVM_INFO @ 0: reporter [itf_test_tb] Size of itf_test[3].payload = 32
UVM_INFO @ 0: reporter [itf_test_tb] Size of itf_test[4].payload = 32
**
It seems like the parameter passed to the array is completly ignored. Instead, it is the default parameter which is used.
But, when I instantiate four {itf_test} interfaces (the ugliest way), I have the following info:
**
UVM_INFO @ 0: reporter [itf_test_tb] Size of PAYLOAD_ITF_TEST_T = 64
UVM_INFO @ 0: reporter [itf_test_tb] Size of itf_test_1.payload = 64
UVM_INFO @ 0: reporter [itf_test_tb] Size of itf_test_2.payload = 64
UVM_INFO @ 0: reporter [itf_test_tb] Size of itf_test_3.payload = 64
UVM_INFO @ 0: reporter [itf_test_tb] Size of itf_test_4.payload = 64
**
This is, honestly, above my understanding. If someone knows what happens, I’ll be very grateful. Thanks for your time.
Louis-Alexandre