Re: [sv-bc] Modport expression examples

From: Steven Sharp <sharp_at_.....>
Date: Mon Dec 01 2008 - 16:46:40 PST
>Second, because x is declared as const. How can a module input be const?
>x is the internal name of the port, whereas Q is the external name.

The "port" Q is an input to the module.  The const variable x is what
is "connected" to that input.  It is perfectly reasonable to have a
const variable, or the constant 2, connected to an input of the module.

It mat be convenient to view an interface or a modport as a set of
ports passed as a single object.  There is LRM text that takes that
view, and the modport syntax seems to be based on that view.  It works
in simple cases, but in more complex cases you have to abandon that
viewpoint and see what is really going on.  Here is my understanding
of that:

An interface instance is just a restricted version of a module instance.

An interface port is a way of passing a reference to an interface
instance through a module port.  The interface port can then be used as
a starting point for a hierarchical reference into the interface instance
that was passed.  It is essentially a "constant virtual interface" variable
passed through a port, whose constant value is set during elaboration and
cannot change during simulation.

Normally an interface port or virtual interface allows access to everything
inside the interface instance.  A modport changes that.  It gives access
to a specific subset of the contents, listed in its "port" list.  It can
give access to a "port" that is actually an alias for an expression made up
of items accessible inside the interface instance.  The declared direction
of the "port" places some unclear restrictions on the access that can be
made to that port.  Presumably an input "port" cannot be written through
that modport, if it is allowed to be a non-lvalue expression, which cannot
be written.

Steven Sharp
sharp@cadence.com


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

This archive was generated by hypermail 2.1.8 : Mon Dec 01 2008 - 16:47:47 PST