RE: [sv-cc] vpiVirtualInterfaceVar and vpiClassVar as vpiRefObj

From: Radosław Nawrot <Radoslaw.Nawrot@aldec.com.pl>
Date: Thu Dec 19 2013 - 00:33:25 PST
Hi, Jim,
Thank You for Your answer,
So we have in that case we have multiple combinations of actual .
Reference can point  to another class var and class var can ne bound with
different class object,
Regards,
Radek Nawrot
 

  _____  

From: Jim Vellenga [mailto:vellenga@cadence.com] 
Sent: Tuesday, December 17, 2013 2:23 PM
To: Radosław Nawrot; sv-cc@eda.org
Subject: RE: [sv-cc] vpiVirtualInterfaceVar and vpiClassVar as vpiRefObj



Radek, it depends on the mental model of what these objects are.

 

I think (although I was not part of the original definition) that a
vpiRefObj is effectively an alias for another object -- at least at certain
points in simulation time.  It is in fact intended to be "different from"
the actual instantiated object: "The vpiActual relationship always returns
the actual instantiated object if the ref obj is bound to an actual object
at the time of the query."

 

Note that this raises another reason for keeping "C.i" separate.  At some
points in simulation time, the class variable "C" is not bound to an actual
class object.  So at those times, "C.i" is also not bound to a variable in
an actual class object.

 

So I expect that these are the reasons that selected elements of a ref obj
are also ref objs.

 

Regards,
Jim Vellenga

 

From: owner-sv-cc@eda.org [mailto:owner-sv-cc@eda.org] On Behalf Of Radoslaw
Nawrot
Sent: Tuesday, December 17, 2013 4:33 AM
To: sv-cc@eda.org
Subject: [sv-cc] vpiVirtualInterfaceVar and vpiClassVar as vpiRefObj

 

Hi All,

I was thinking about part of LRM:

 

"A ref obj represents a declared object or subelement of that object that is
a reference to an actual instantiated object.

A ref obj exists for ports with ref direction, for an interface port, a
modport port, or for formal task function ref

arguments. The specific cases for a ref obj are as follows:

- A variable, named event, named event array that is the lowconn of a ref
port

- Any subelement expression of the above

- A local declaration of an interface or modport passed through a port or
any net, variable, named event, named

event array of those

- A ref formal argument of a task or function, or subelement expression of
it 

"

I have an example:

 

 

module top;
 class C;
  int i;
 endclass
 function automatic void afct(ref C c);
  $vpiF(c.i);
 endfunction

 

 C x=new;

 

 initial #2 afct(x);

 

endmodule

 

Is "c.i" really a ref object ? "i" is a part of vpiClassObj not vpiClassVar.

Should LRM exclude from being ref object class and virtual interface
member's ?

 

Regards,

Radek

 


-- 
This message has been scanned for viruses and 
dangerous content by  <http://www.mailscanner.info/> MailScanner, and is 
believed to be clean. 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Dec 19 00:34:16 2013

This archive was generated by hypermail 2.1.8 : Thu Dec 19 2013 - 00:34:33 PST