• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
          • Expression-sizing
          • Occform
          • Oprewrite
          • Expand-functions
          • Delayredux
          • Unparameterization
          • Caseelim
          • Split
          • Selresolve
          • Weirdint-elim
          • Vl-delta
          • Replicate-insts
            • Vl-replicated-instnames
            • Vl-modulelist-replicate
            • Argument-partitioning
            • Vl-replicate-gateinst
            • Vl-replicate-gateinstlist
            • Vl-module-port-widths
            • Vl-replicate-modinst
            • Vl-replicate-arguments
            • Vl-replicate-orig-instnames
            • Vl-assemble-modinsts
            • Vl-module-replicate
            • Vl-replicate-modinstlist
            • Vl-modinst-origname/idx
            • Vl-modinst-origname
            • Vl-gateinst-origname/idx
            • Vl-gateinst-origname
            • Vl-gateinst-origidx
            • Vl-modinst-origidx
            • Vl-design-replicate
            • Vl-some-modinst-array-p
            • Vl-some-gateinst-array-p
          • Rangeresolve
          • Propagate
          • Clean-selects
          • Clean-params
          • Blankargs
          • Inline-mods
          • Expr-simp
          • Trunc
          • Always-top
          • Gatesplit
          • Gate-elim
          • Expression-optimization
          • Elim-supplies
          • Wildelim
          • Drop-blankports
          • Clean-warnings
          • Addinstnames
          • Custom-transform-hooks
          • Annotate
          • Latchcode
          • Elim-unused-vars
          • Problem-modules
        • Lint
        • Mlib
        • Server
        • Kit
        • Printer
        • Esim-vl
        • Well-formedness
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Transforms

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?