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

From: Dave Rich <David.Rich@synopsys.com>
Date: Mon Apr 05 2004 - 17:13:43 PDT

Peter,

IMHO, This is an issue with the tool or style, not the LRM.

Dave

Peter Jensen wrote:

>Hi Dave,
>
>if the synthesis tool (or any other tool) chooses to inline a method, shouldn't
>it then generate/extend the modport itself, not requiring the designer to do
>this tedious job by hand?
>
>If the described system is behaviorally modelled using such methods, and later
>refined towards RTL synthesis, it seems ackward that the modport should be
>manually extended during such a refinement.
>
>- Peter
>
>-----Original Message-----
>From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org]On Behalf Of Dave
>Rich
>Sent: 31. marts 2004 17:49
>To: Peter Jensen
>Cc: sv-bc@eda.org
>Subject: Re: [sv-bc] Access to interfaces through methods rather than
>objects
>
>
>Peter,
>
>The language does not require that interface members be listed in
>modports if they are used by imported methods. In this way interfaces
>are like classes that keep members private and allow access only through
>their methods.
>
>However, a synthesis style might require them because of the way it
>in-lines the methods. That is an issue for the tool.
>
>Dave
>
>
>Peter Jensen wrote:
>
>
>
>>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
>>
>>
>>
>>
>>
>>
>>
>
>--
>--
>David.Rich@Synopsys.com
>Technical Marketing Consultant and/or
>Principal Product Engineer
>http://www.SystemVerilog.org
>tele: 650-584-4026
>cell: 510-589-2625
>
>
>
>
>
>
>

-- 
--
David.Rich@Synopsys.com
Technical Marketing Consultant and/or
Principal Product Engineer
http://www.SystemVerilog.org
tele:  650-584-4026
cell:  510-589-2625
Received on Mon Apr 5 17:13:49 2004

This archive was generated by hypermail 2.1.8 : Mon Apr 05 2004 - 17:14:02 PDT