[sv-bc] Access to interfaces through methods rather than objects

From: Peter Jensen <peter@syosil.dk>
Date: Thu Mar 25 2004 - 23:31:58 PST

Hi,

When using interface methods (functions/tasks) to access objects (e.g.
variables) within interfaces, it is clear that such methods should be listed
in the modport using the import keyword. But should the objects be listed as
well?

Example:

interface intf;
          bit a, b, q;

          function void f_calc();
             q = a & b;
          endfunction

          modport mp1 (import function f_calc());
          modport mp2 (input a, input b, output q, import function f_calc());
endinterface

module m1;
       intf intf_i ();
       m2 m2_i (.intf_i(intf_i.mp1));
endmodule;

module m2 (interface intf_i);
       always_comb
          intf_i.f_calc();
endmodule

Question:
Should modport m1 or m2 be used when connecting the interface to m2?

If m1 cannot be used, the use of real generic interfaces is partly
inhibited, as the objects a, b, q also can be accessed by the interface
client. Modport m1 forces the interface client to access the interface by
methods.

An EDA tool used for synthesis required that m2 was used in this example.

---
Peter Jensen
SyoSil Consulting
Himmelev Bygade 53
DK-4000 Roskilde
Tel/Fax +45 46 36 11 32
Mobile  +45 40 58 10 00
mailto:peter@syosil.dk
 
Received on Thu Mar 25 23:32:19 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 25 2004 - 23:32:30 PST