RE: [sv-bc] Virtual interface with modport selected

From: Rich, Dave <Dave_Rich_at_.....>
Date: Fri Jan 09 2009 - 07:49:05 PST
The LRM says, from mantis 1330,

"The actual values and types of those parameters shall match for an
interface and virtual interface to be of the same type and to be
assignment compatible. A virtual interface declaration may select a
modport of an interface in which case the modport is also part of its
type."

So from this I expect the interface instance to have a matching modport
selected. But the next sentence make this exception:

"An interface instance or virtual interface with no modport selected may
be assigned to a virtual interface with a modport selected."

This allows you to go from no modport selected to a modport selected,
but not the other way around. These rules are slightly more restrictive
than interface instance to interface port connections because we cannot
allow dynamic types to creep in.

v16 = p16.phy; //Is it allowed? No, modport selected assigned to none
selected
> v16_phy = p16.phy; // Is it allowed? Yes, modports match

I agree with you that the syntax is incorrect in the example. Mantis
2563.

> -----Original Message-----
> From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org]
On
> Behalf Of Surya Pratik Saha
> Sent: Friday, January 09, 2009 3:46 AM
> To: sv-bc@eda.org
> Subject: [sv-bc] Virtual interface with modport selected
> 
> Hi,
> Is it allowed to assign a modport to a virtual interface with/without
> modport selection?
> For e.g.:
> interface PBus #(parameter WIDTH=8); // A parameterized bus interface
> logic req, grant;
> logic [WIDTH-1:0] addr, data;
> modport phy(input addr, ref data);
> endinterface
> module top;
> PBus #(16) p16();
> PBus #(32) p32();
> virtual Pbus V8; // legal declaration, but no legal assignments
> virtual Pbus #(16).phy v16_phy;
> initial begin
> v16 = p16.phy; // Is it allowed?
> v16_phy = p16.phy; // Is it allowed?
> end
> endmodule
> 
> I can see in SV 2009 draft LRM, it is mentioned:
> Only the following operations are directly allowed on virtual
interface
> variables:
> - Assignment ( = ) to the following:
> - Another virtual interface of the same type
> - An interface instance of the same type
> - The special constant null
> 
> So modport should not be allowed. But I just want to reconfirm.
> 
> Another point is, the example shown there is wrong as per BNF, the
> interface declaration should be "interface PBus #(parameter WIDTH=8);"
> instead of "interface #(parameter WIDTH=8) PBus;".
> 
> --
> Regards
> Surya
> 
> 
> 
> 
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 
> 
> --
> This email was Anti Virus checked by Astaro Security Gateway.
> http://www.astaro.com

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Jan 9 07:49:10 2009

This archive was generated by hypermail 2.1.8 : Fri Jan 09 2009 - 07:49:27 PST