Replicate-insts
Eliminate arrays of gate and module instances.
We now introduce a transformation which eliminates "ranges" from
gate and module instances. The basic idea is to transform things like this:
type instname [N:0] (arg1, arg2, ..., argM) ;
Into things like this:
type instname_0 (arg1-0, arg2-0, ..., argM-0);
type instname_1 (arg1-1, arg2-1, ..., argM-1);
...
type instname_N (arg1-N, arg2-N, ..., argM-N);
Here, type might be a gate type (e.g., not, xor, etc.) or a
module name, instname is the name of this instance array, and the
arguments are expressions which represent the inputs and outputs.
Ordering Notes. We require that (1) argresolve has been
applied so there are only plain argument lists to deal with, that (2) all
expressions have been sized so we can determine the sizes of arguments and
ports, and (3) that drop-blankports has been run so that there are no
blank ports. We expect that all of the actuals are sliceable expressions. However, this transformation
should be run before blankargs, so there may be blank arguments (but not
blank ports.)
The semantics of instance arrays are covered in Section 7.1.5 and 7.1.6, and
per Section 12.1.2 they hold for both gate instances and module instances.
One minor issue to address is that the names of all instances throughout a
module need to be unique, and so we need to take care that the instance names
we are generating (i.e., instname_0, etc.) do not clash with other names in the
module; we discuss this further in vl-replicated-instnames.
But the most complicated thing about splitting instances is how to come up
with the new arguments for each new instance we are generating. This is
addressed in argument-partitioning.
Subtopics
- Vl-replicated-instnames
- Generate the new names that we'll use for replicated instances.
- Vl-modulelist-replicate
- Extend vl-module-replicate across the list of modules.
- Argument-partitioning
- How arguments to instance arrays are split up and given to the
individual instances.
- Vl-replicate-gateinst
- Convert a gate array instance into a list of gates (if necessary).
- Vl-replicate-gateinstlist
- Extend vl-replicate-gateinst across a vl-gateinstlist-p.
- Vl-module-port-widths
- Determine the widths of a module's ports.
- Vl-replicate-modinst
- Convert a module instance into a list of simpler instances, if
necessary.
- Vl-replicate-arguments
- Partition arguments for a module instance
- Vl-replicate-orig-instnames
- Generate the Verilog-style names of the original instances (e.g.,
names with square-bracketed indices).
- Vl-assemble-modinsts
- Build vl-modinst-p's from the sliced-up arguments.
- Vl-module-replicate
- Eliminate gate and module instance arrays from a module.
- Vl-replicate-modinstlist
- Extend vl-replicate-modinst across a vl-modinstlist-p
- Vl-modinst-origname/idx
- Retrieve the Verilog-style name for this module instance, like foo[3],
if it was modified by the replicate transform.
- Vl-modinst-origname
- Retrieve the original name of a module instance if it was modified by
the replicate transform.
- Vl-gateinst-origname/idx
- Retrieve the Verilog-style name for this gate instance, like foo[3],
if it was modified by the replicate transform.
- Vl-gateinst-origname
- Retrieve the original name of a gate instance if it was modified by
the replicate transform.
- Vl-gateinst-origidx
- Retrieve the Verilog-style name for this gate instance, like foo[3],
if it was modified by the replicate transform.
- Vl-modinst-origidx
- Retrieve the original index of a module instance if it was modified by
the replicate transform.
- Vl-design-replicate
- Top-level replicate-insts transform.
- Vl-some-modinst-array-p
- Are there any module instance arrays?
- Vl-some-gateinst-array-p
- Are there any gate instance arrays?