RE: [sv-bc] Modport expression examples

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Mon Dec 01 2008 - 07:18:32 PST
Jonathan,

Your answer brings up a more basic question that I should have thought of.

The example has:

interface I;
	logic [7:0] r;
	const int x=1;
	bit R;
	modport A (output .P(r[3:0]), input .Q(x), R);
	modport B (output .P(r[7:4]), input .Q(2), R);
endinterface

module M ( interface i);,
	initial i.P = i.Q;
endmodule
 
I want to ask about the initial statement in module M.
It has hierarchical references to the explicit port names in the modport declarations.
However, in the case of explicit port declarations in modules, you cannot do this.
You can only use these port names for port connections.

For example, 

module m(.P(a));
input a;
endmodule

module top;
initial $display(m.P);
endmodule

This code is not legal. I can only use P to connect to m, as in the following instantiation statement:
m m1(.P(0));

So how can I reference i.P and i.Q?

And if modport expressions work differently than explicit module port declarations, then its rules are very undefined.

> A modport expression is _not_ the same as an explicit port 
> declaration, despite the fact that the modport is at least in 
> some sense a description of part of a module's port list as I said.
> 
> Given
> 
>   interface I();
>     ...
>     modport M(input .P(E));
>     ...
> 
> the modport expression .P(E) says "when a module connects its 
> port "portname" to this modport in some instance of interface 
> I, the module's item portname.P should be connected not to 
> the internal object P of the connected interface instance, 
> but instead to the expression E in that instance". 
> It is perfectly sensible for a module's input port to be 
> connected either to a const int or to the literal '2', 
> surely.  I think the examples are OK.

Regards,
Shalom
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Dec 1 07:20:45 2008

This archive was generated by hypermail 2.1.8 : Mon Dec 01 2008 - 07:21:33 PST