Modports -- which port identifiers may be legally included?


Subject: Modports -- which port identifiers may be legally included?
From: Brad Pierce (Brad.Pierce@synopsys.com)
Date: Thu Nov 21 2002 - 10:32:56 PST


At a recent internal meeting, Yong Xiao raised some interesting
questions about modports --

1) If a modport mentions a port identifier that has not
    been previously declared is that an error or an implicit
    declaration?

    We are of the opinion that the following code should yield
    an error and that a modport is purely a *view* of the interface.

       interface i;
          modport master(input a, b, output c, d);
          modport slave(output a, b, output c, d);
       endinterface

    (According to the Webopedia: "In database management systems,
     a view is a particular way of looking at a database. A single
     database can support numerous different views. Typically, a
     view arranges the records in some order and makes only certain
     fields visible. Note that different views do not affect the
     physical organization of the database.")

2) In a hierarchical interface, can a lower-level modport include
    port identifiers from higher levels? Is the following legal? --

       interface i1;
         wire x, y;
         interface i2;
           wire a, b, c, d;
           modport master(input a, b, x, output c, d, y);
           modport slave(input a, b, x, output c, d, y);
         endinterface
         i2 ch1, ch2;
         modport master2 (chi.master, ch2.master);
       endinterface

    Although textually, it's tempting to say, "Yeah, why not?", intuitively
    it seems weird to allow a modport to be a view onto multiple interfaces.

-- Brad



This archive was generated by hypermail 2b28 : Thu Nov 21 2002 - 10:33:53 PST