Dear all,
I have some problems about interface array. I want to design reusable interface array by for-loop or point assigning, but not each by each. What can I do for my issue?
Problem #1:
I declare an interface array in TOP module, and I want connect them to my OVM class environment.
Interface bus_if ;
……………… // declarations
endinterface
module top;
bus_if top_if [7:0];
endmodule
class env extends ovm_env;
virtual bus_if temp_if [7:0];
………….// other codes
function automatic void connect();
temp_if[0] = top.top_if[0] ;
temp_if[1] = top.top_if[1] ;
temp_if[2] = top.top_if[2] ;
temp_if[3] = top.top_if[3] ;
temp_if[4] = top.top_if[4] ;
……………………………
……
endfunction
endclass
, the “connect phase†codes can pass the compilation.(no error message)
But If I use the follows :
///////////////////////////////////////
for(int j=0;j<5i;j=j+1)
temp_if[j] = top.top_if[j];
///////////////////////////////////////
in connect phase
, I got error message:
ncvlog: *E,NOTPAR (sve.sv,): Illegal operand for constant expression [4(IEEE)].
module worklib.testbench:sv
errors: 1, warnings: 0
Problem #2
module top;
bus_if top_if [7:0];
virtual top_temp[7:0];
initial top_temp=top_if;
endmodule
there is a compile error:
ncvlog: *E,WOUPYR (uvc.sv,): As a temporary implementation restriction, array of virtual interfaces is not permitted in this context.
module worklib.testbench:sv
errors: 1, warnings: 0
It seems cadence tool doesn’t support this way.
How do I validly use “for-loop†or “point “to access or connect between interface array and virtual interface in OVM?