[problem] use interface array on Cadence tool

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?

Hi Superpanda,

There was a discussion last year on this forum about a similar requirement which you might find useful. There I suggested using a generate loop in the top-level test module to instantiate multiple interfaces and pass a reference to a virtual interface wrapper class. The virtual interface wrapper objects were then linked into the OVM environment during configuration (by calling set_config_object) - see

http://ovmworld.org/forums/showthread.php?t=197

The code in the examples shown is using OVM version 1 but the principles should still apply in OVM 2.x. It works with current versions of both IUS and Questa.

Regards,
Dave

Hi Superpanda,
There was a discussion last year on this forum about a similar requirement which you might find useful. There I suggested using a generate loop in the top-level test module to instantiate multiple interfaces and pass a reference to a virtual interface wrapper class. The virtual interface wrapper objects were then linked into the OVM environment during configuration (by calling set_config_object) - see
http://ovmworld.org/forums/showthread.php?t=197
The code in the examples shown is using OVM version 1 but the principles should still apply in OVM 2.x. It works with current versions of both IUS and Questa.
Regards,
Dave

Dear Dave, Thank you for your suggestion. It seems OVM doesn’t handle directly for this array issue and is more complex than VMM, but I would try the way.

Hi all,
I want to share good news with you. Candence has updated the simulation tool (IUS.) to version 8.2 s 008.
It can support initialize directly an interface array to a virtual one.
for example:

module top; 
  bus_if   top_if [7:0]; 
  virtual   top_temp[7:0];
  initial top_temp=top_if;
endmodule 

class env  extends ovm_env;
  virtual  bus_if  temp_if [7:0];
    ………….// other codes
 function automatic void connect();
  ///////////////////////////////////////
  foreach(temp_if[i])
  temp_if[j]  =  top.top_temp[j];
  ///////////////////////////////////////
 endfunction 
endclass

Now, we can use for-loop to connect interface array easily without any wrapper on cadence tool. :)

Dave,

I am using the method you suggested in the thread: http://ovmworld.org/forums/showthread.php?t=197

But when run on Cadence 08.20.011 version, it gives an internal error…When I comment out the generate block suggested in the post the internal error is gone…

But without the generate, I will have to hard-code the number of virtual interfaces which is not my use model…

Can you suggest if something has changed since the post in the way Cadence simulator behaves…

Is there some other workaround which you can suggest…FYI Iam using OVM 2.0.3 version…

Pradeep

Hi Pradeep,

Could you post a cut-down version of your code showing the problem? It is hard to tell what is causing it without more information.

Thanks,
Dave

Dave,

Iam trying to connect virtual interface in the manner shown below:

module test;
genvar i;

generate
for(i=0; i < `NUM; i++)
begin: c_gen
chip_if dut_if(.clk);
chip dut ( .dut_if, .clk );
if_wrapper if_wr = new($psprintf(“if_wrapper_%0d”,i),dut_if);
end
endgenerate

endmodule: test

The above code from one of your quotes was working on a prior version of Cadence IUS, but this code starts giving me an internal error with the latest version…Any clue???

Pradeep

Hi Pradeep,

Does the internal error occur during compilation or at run time?

Does your code still work if you create a single instance of your dut, interface and wrapper without using generate? e.g.

chip_if dut_if(.clk);
chip dut ( .dut_if, .clk );
if_wrapper if_wr = new($psprintf("if_wrapper_%0d",0),dut_if);

BTW the “latest” version of IUS is 9.20 - is this what you are using?

If the above does not help to track down the problem, you might need to report this to Cadence support instead.

Regards,
Dave

Dave,

Creating individual virtual interface instances works fine, but when used within “generate” tool gives an internal error, during elaboration phase…

We are using 8.20, will try the same on 9.20 once we have this version installed at our site…I will try Cadence support as well on the same version and check the response…

Thanks for the help

Pradeep

Dave,

We are using IUS8.20 version of cadence simulator, and I only see INCISIV having 9.20 version, were you mentioning about this tool???

Pradeep

Hi Pradeep,

Dave,
We are using IUS8.20 version of cadence simulator, and I only see INCISIV having 9.20 version, were you mentioning about this tool???
Pradeep

“INCISIV” is the download that you require to install IUS 9.20

Regards,
Dave