• 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
          • 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
            • Make-implicit-wires
            • Resolve-indexing
            • Origexprs
            • Argresolve
              • Vl-convert-namedargs
              • Vl-modulelist-argresolve
              • Vl-arguments-argresolve
              • Vl-gateinst-dirassign
              • Vl-check-blankargs
              • Vl-annotate-plainargs
              • Vl-modinst-argresolve
              • Vl-modinstlist-argresolve
              • Vl-gateinstlist-dirassign
              • Vl-module-argresolve
              • Vl-design-argresolve
            • Portdecl-sign
            • Designwires
            • Udp-elim
            • Vl-annotate-design
          • 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
  • Annotate

Argresolve

Converts named argument lists into plain argument lists, and annotates each plain argument with its direction.

We prefer to use plain (or positional) argument lists as our internal representation for module and gate instances.

We have little choice but to support plain argument lists internally, because the are the only way to instantiate gates and are also the only way to instantiate modules with ports like foo[3:0] without external names. But it is basically straightforward to eliminate all named argument lists by replacing them with their plain equivalents, reducing the number of syntactic constructs that later transformations need to deal with.

In this transformation, we simplify module instances as follows:

  • We try to expand out any SystemVerilog .*-style port connections,
  • We try to get rid of all the named argument lists by replacing them with plain argument lists; see vl-convert-namedargs,
  • We try to annotate each vl-plainarg-p with its dir and portname fields, so that the direction and name of many ports will be available for use in error messages; see vl-annotate-plainargs,
  • We check that each module instance has the proper arity, and
  • We check that any "blank" ports are connected only to blank arguments, and vice-versa; see vl-check-blankargs.

We also simplify gate instances as follows:

  • We check that the arity of each gate instance is acceptable and annotate each vl-plainarg-p with its dir field; see vl-gateinst-dirassign, and
  • We check that no "blank" arguments are given to gates, and issue a warning if such a connection is made. This is actually also done by vl-gateinst-dirassign, just because it is convenient.

Subtopics

Vl-convert-namedargs
Coerce arguments into plain (positional) style.
Vl-modulelist-argresolve
(vl-modulelist-argresolve x ss) maps vl-module-argresolve across a list.
Vl-arguments-argresolve
Apply the argresolve transformation to some arguments.
Vl-gateinst-dirassign
Arity-checks a gate instance and annotates its arguments with their directions.
Vl-check-blankargs
Warn about expressions connected to blank ports and for blanks connected to non-blank, non-output ports.
Vl-annotate-plainargs
Annotates a plain argument list with port names and directions.
Vl-modinst-argresolve
Resolve arguments in a vl-modinst-p.
Vl-modinstlist-argresolve
Resolve arguments in a vl-modinstlist-p.
Vl-gateinstlist-dirassign
Projects vl-gateinst-dirassign across a list of vl-gateinst-ps.
Vl-module-argresolve
Apply the argresolve transformation to a vl-module-p.
Vl-design-argresolve
Top-level argresolve transform.