Re: [sv-bc] Re: implicit instantiation of top-level modules?


Subject: Re: [sv-bc] Re: implicit instantiation of top-level modules?
From: Michael McNamara (mac@verisity.com)
Date: Thu Jul 10 2003 - 11:55:22 PDT


Greg Jaxon writes:
> Michael McNamara wrote:
>
> > [T]his allows is an additional fairly powerfull
> > capability: Easy reference to a sibling.
> >
> > Let us say you have a module, implementing a Flip Flop:
> >
> > module ff (input D, CLK, output reg Q, Q_)
> > always @(CLK) Q = D;
> > assign Q_ = ~Q;
> > endmodule
> >
> > Then say you want to reuse this module to define the JTAG
> > version. Using upward relative references you could:
> >
> > module jtag_ff(input D, CLK, JTAG_D, JTAG_C, output Q, Q_)
> > ff flip_flop (D, CLK, Q, Q_);
> > add_jtag jt (JTAG_D, JTAG_C);
> > endmodule
> >
> > module add_jtag(input JTAG_D, JTAG_C);
> > always @(JTAG_C) ff.Q = JTAG_D;
> > endmodule
> >
> > The difference here is that the add_jtag doesn't need to know the
> > instance name of the ff it is mucking with: the rules of 12.4 require
> > the simulator to find the nearest neighbor up the hierarchy that
> > instanticate an 'ff' module. It does not affect every 'ff' module,
> > just the first one found using the upwards relative refernecing rules
> > defined in 12.4.1
> >
> > -mac
>
> I could not find the 12.4 "nearest neighbor" prescription - which document
> are you citing? In 1364-2001 section 12.5 says:
>
> "It shall only search in higher enclosing modules for the name, not instances."
>
> I understand the use of upward references to module_names to be analogous to
> C++ class references: i.e. something you'd use only to reach static data, typedefs,
> local functions, or other entities shared by all instances of the module.
>
> Greg
>

I was looking at 1364-1995, section 12.4.1. The syntax box called
12-5 has:

     upwards_name_reference ::= module_identifier.item_name

     item_name::= port_identifer
                  |reg_indetifier
                  ...
                   

This block is then followed by:
         
Upwards name references can also be done with named of the form:

    module_instance_name.item_name.

This same language exists in 1364-2001, where the section is 12.5, and
the syntax box is called 12-8.



This archive was generated by hypermail 2b28 : Thu Jul 10 2003 - 12:04:29 PDT