Yes, indeed.
I think one can do this (not disallowed by the LRM see mantis 2694) :
interface subIFC;
integer i = 10;
endinterface
class C;
virtual interface subIFC vi;
function new(virtual interface subIFC varg);
vi = varg;
endfunction
endclass
interface IFC;
subIFC i2();
C hdl = new (i2);
initial
$display (hdl.vi);
endinterface
module top;
virtual interface IFC vm;
IFC i1();
initial begin
$display (vm.hdl.vi.i);
end
endmodule
Seems like there is a loop hole where one can refer to a virtual interface through a virtual
interface. Both IFC abd subIFC are legal interfaces to be assigned to virtual interface variables. I
carefully declared the class datatype in the cuscope.
What was the technical reason for why we disallowed virtual interfaces inside interfaces?
Francoise
'
________________________________
From: Bresticker, Shalom [mailto:shalom.bresticker@intel.com]
Sent: Wednesday, August 31, 2011 2:11 AM
To: Francoise Martinolle; sv-ec@eda.org
Subject: RE: virtual interface variables declarations
Mantis 2694 also discusses this sentence.
Shalom
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Francoise Martinolle
Sent: Tuesday, August 30, 2011 6:38 PM
To: sv-ec@eda.org
Subject: [sv-ec] virtual interface variables declarations
I found that the text in section 25.9 describing the limitations for virtual interfaces variables declarations is not
sufficient.
It currently states:
Virtual interfaces shall not be used as ports, interface items, or as members of unions.
Strictly reading this, I would expect I can have a virtual interface variable as a formal of a task/function declared
in an interface or as a variable declared in a scope inside (named begin end block, task/function decl) inside the interface.
However I think the intent was to disallow virtual interfaces completely inside interfaces.
can someone confirm that it was the intent?
interface I4;
I2 i2();
task t ();
static virtual interface I2 t1 = VI2; //Is this illegal?
VI2 = i2;
endtask
endinterface
-- This message has been scanned for viruses and dangerous content by MailScanner<http://www.mailscanner.info/>, and is believed to be clean. --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Wed Aug 31 07:40:34 2011
This archive was generated by hypermail 2.1.8 : Wed Aug 31 2011 - 07:40:44 PDT