J
Jonathan Bromley
Guest
On 30 Apr 2007 17:16:05 -0700,
lingwitt <lingwitt@gmail.com> wrote:
regular port of the lower-level module. Synthesis
will strip it away, so it costs you nothing. Or, if
this is simulation-only code, provide a function in
the lower-level module that reports the relevant value,
and call it from above.
Historically the rules for parameter visibility in
Verilog have been hard to understand, but the only
sensible way to deal with parameters is strictly
top-down in the same way that VHDL does it. And
your complaint about circularity being easy to see
is just not true - particularly when combined with
generates and/or arrays of instances, the relationships
among parameter values can easily become extremely
obscure unless you adhere to strict top-down propagation.
Surely you would expect the module instance tree to be
strictly acyclic? The relationships among parameters
should be likewise.
At first glance, it always seems frustrating that
parent modules cannot use parameters/generics to
enquire about their children's characteristics.
If you follow through the repercussions of that,
though, I think you'll agree that other approaches
make more sense.
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@MYCOMPANY.com
http://www.MYCOMPANY.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
lingwitt <lingwitt@gmail.com> wrote:
In that case, drive a constant value out through aI require going from the leaf up.
regular port of the lower-level module. Synthesis
will strip it away, so it costs you nothing. Or, if
this is simulation-only code, provide a function in
the lower-level module that reports the relevant value,
and call it from above.
Historically the rules for parameter visibility in
Verilog have been hard to understand, but the only
sensible way to deal with parameters is strictly
top-down in the same way that VHDL does it. And
your complaint about circularity being easy to see
is just not true - particularly when combined with
generates and/or arrays of instances, the relationships
among parameter values can easily become extremely
obscure unless you adhere to strict top-down propagation.
Surely you would expect the module instance tree to be
strictly acyclic? The relationships among parameters
should be likewise.
At first glance, it always seems frustrating that
parent modules cannot use parameters/generics to
enquire about their children's characteristics.
If you follow through the repercussions of that,
though, I think you'll agree that other approaches
make more sense.
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@MYCOMPANY.com
http://www.MYCOMPANY.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.