• 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
            • Vl-vardecllist-reset-atts
            • Vl-inline-rename-portdecls
            • Vl-inline-mod-in-mods-aux
            • Vl-inline-mod-in-modinst
            • Vl-inline-mod-in-modinsts
            • Vl-make-inlining-assigns
            • Vl-inline-mod-in-mod
            • Vl-inline-mods
            • Vl-ok-to-inline-list-p
            • Vl-ok-to-inline-p
            • Vl-inline-rename-portdecl
            • Vl-design-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

Inline-mods

A transform for inlining basic modules.

This transform can be used to inline modules as long as they are very simple. The modules being inlined can't have always blocks, registers, and so forth; more specifically they must be accepted by vl-ok-to-inline-p.

WARNING: We assume that the modules involved are "sensible." That is, we are not trying to defend against modules with incoherent namespaces, divergent ports and portdecls, etc.

WARNING: For this transform to be sound, the submodule must have its ports properly declared as INPUT or OUTPUT ports. We do NOT try to handle inout ports. Why? Well, here is our basic strategy. If we have a module like:

module mymod ( output o, input a, input b ) ; ... endmodule

And we want to inline an instance such as:

mymod myinst (w, 1'b1, c + d) ;

Then the basic idea is to replace myinst with:

assign w = mangled_o;
assign mangled_a = 1'b1;
assign mangled_b = c + d;
[... mangled body of mymod ...]

These assignment statements are unidirectional and if, for instance, you incorrectly mark an output as an input, then the assignment will flow in the wrong way. This use of assignment statements is particularly simpleminded. We have considered doing something smarter to avoid temporaries, but it seems like a very tricky problem in general so we think it's best not to get too clever.

Subtopics

Vl-vardecllist-reset-atts
(vl-vardecllist-reset-atts x new-atts) maps change-vl-vardecl across a list.
Vl-inline-rename-portdecls
Rename portdecls using the renaming alist (which binds old names to their new, mangled names).
Vl-inline-mod-in-mods-aux
(vl-inline-mod-in-mods-aux sub x) maps vl-inline-mod-in-mod across a list.
Vl-inline-mod-in-modinst
Maybe replace a module instance with its inlined body.
Vl-inline-mod-in-modinsts
Replace any instance of a module with its inlined body.
Vl-make-inlining-assigns
Make assignments that hook up the superior module to the new, mangled wires that have been derived from the module's ports.
Vl-inline-mod-in-mod
Expand any instances of a submodule into its inlined body, throughout a module.
Vl-inline-mods
(vl-inline-mods x all-mods) inlines all modules in x throughout all-mods.
Vl-ok-to-inline-list-p
(vl-ok-to-inline-list-p x) recognizes lists where every element satisfies vl-ok-to-inline-p.
Vl-ok-to-inline-p
Check if a module is simple enough for us to inline.
Vl-inline-rename-portdecl
Vl-design-inline-mods