[sv-bc] Interfaces in port lists

From: Neil Korpusik <neil.korpusik@oracle.com>
Date: Fri Sep 17 2010 - 16:40:13 PDT

<forwarding bounced email from james@keithan.com>
<Was originally posted to sv-ec - redirecting to sv-bc>

-------- Original Message --------
Date: Thu, 16 Sep 2010 08:17:54 -0500
From: Keithan <james@keithan.com>
To: "sv-ec@eda.org" <sv-ec@eda.org>
Subject: Interfaces in port lists

Folks,
   A question about parameterized interfaces in a module port list.
   It is my understanding that the following is the SV way to use
   interfaces in module port lists:

   interface A #( int unsigned WIDTH = 32);
     logic[WIDTH-1:0] a;
     logic[WIDTH-1:0] b;
     modport o_a(
        output a,
        input b);
     modport i_a(
        input a,
        output b);
   endinterface

   module B (interface b); // this works
     // use example
     initial b.a <= 1;
     initial b.c <= 0; // this will compile?
   endmodule

   module C (A#(16) c); // This does not compile
   //
   endmodule

The question is, why can't you declare an interface
[and parameter] [and modport]
in the port list directly? It is a fully qualified type. The corollary
doesn't this introduce virtual interfaces into modules? Is this good?

How does the compiler resolve interface pin references (ex. b.a)
with just the 'interface' type? Doesn't this only get resolved
at load time?

My objective here is to use interfaces in module port lists
to simplify connections and catch directional issues early,
through the use or modports. It does not seem that is the case
with the 'interface' key word.

James Keithan

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Sep 17 16:41:45 2010

This archive was generated by hypermail 2.1.8 : Fri Sep 17 2010 - 16:44:39 PDT