Subject: Re: [sv-bc] Re: implicit instantiation of top-level modules?
From: Shalom.Bresticker@motorola.com
Date: Thu Jul 10 2003 - 12:11:05 PDT
Mac,
I don't think your example works.
I just tried something like that, and ff.Q does not work, but flip_flop.Q does.
I think "module name" is only found when it is on a straight upward path.
A module instance name, in contrast, is also found when it is enclosed in a
module in a straight upward path, which is actually an upward+downward search.
But within add_jtag you could reference jtag_ff.Q .
> 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
Shalom
-- Shalom Bresticker Shalom.Bresticker@motorola.com Design & Reuse Methodology Tel: +972 9 9522268 Motorola Semiconductor Israel, Ltd. Fax: +972 9 9522890 POB 2208, Herzlia 46120, ISRAEL Cell: +972 50 441478
This archive was generated by hypermail 2b28 : Thu Jul 10 2003 - 12:12:50 PDT