• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
        • Transforms
          • Unparameterization
          • Elaborate
          • Addnames
          • Annotate
            • Increment-elim
            • Make-implicit-wires
            • Basic-bind-elim
              • Vl-modulelist-apply-binddelta
              • Vl-interfacelist-apply-binddelta
              • Vl-bindelim-main
              • Vl-bindelim-bindlist
              • Vl-bindelim-find-global-target
              • Vl-interfacelist-bindelim
              • Vl-modulelist-bindelim
              • Vl-interface-bindelim
              • Vl-module-bindelim
              • Vl-bindelim-institem
              • Vl-warn-bindintentlist-undefined
              • Vl-warn-bindintent-undefined
              • Vl-interfacelist-bindelim-insttable
              • Vl-modulelist-bindelim-insttable
              • Vl-warn-binddelta-undefined
              • Vl-interface-bindelim-insttable
              • Vl-interface-apply-binddelta
              • Vl-design-bindelim-pass2
              • Vl-bindelim-modinstlist-add-atts
              • Vl-module-bindelim-insttable
              • Vl-module-apply-binddelta
              • Vl-bindelim-modinst-add-atts
              • Vl-design-bindelim-pass1
              • Vl-bindcontext
              • Vl-bindintent->modinsts
              • Vl-bindelim-insttable
              • Vl-bindintentlist->modinsts
              • Vl-binddelta
              • Vl-design-bindelim
              • Vl-bindelim-institemlist
            • Argresolve
            • Basicsanity
            • Portdecl-sign
            • Enum-names
            • Port-resolve
            • Udp-elim
            • Vl-annotate-design
            • Vl-annotate-module
          • Clean-warnings
          • Eliminitial
          • Custom-transform-hooks
          • Problem-modules
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Annotate

Basic-bind-elim

Handling of basic SystemVerilog bind constructs.

See SystemVerilog-2012 23.11, Binding auxiliary code to scopes or instances. Bind constructs allow you to essentially inject module instances into other modules at run-time.

This transform, as part of the initial annotate process, is meant to handle ``global'' (our word) bind statements—those that add code to whole modules/interfaces—but not (most) ``local'' binds that tamper with a particular module instance. For instance:

module wheelChecker (...); ... endmodule

module beetle (...); ... endmodule
module transAm (...); ... endmodule

module top ;

   beetle herbie1(...);
   beetle herbie2(...);

   transAm kit();
   transAm kat();

   // This is a 'global' bind because it affects all beetles
   // We support this here.
   bind beetle wheelChecker frontWheelCheck(...);

   // This is a 'local' bind because it only affects kit and not kat.
   // We don't support these kinds of binds.
   bind transAm: kit wheelChecker frontWheelCheck(...);

endmodule

Global binds are easier (and perhaps more efficient) to support because we can add them without having to ``fork'' the definitions of modules. That is, in the above example, adding the wheelChecker to only kit and not kat means that we need to fork transAm into two separate modules: one with the extra binding and one without. It seems tricky to do this efficiently.

We actually do support a very limited subset of local binds that may as well have been global. That is, if some particular module foo is only ever instantiated in a single place, then a local bind that adds submodules to that single instance may as well have been a global bind that adds its submodules to foo. Note that this is a very limited facility, mainly intended to support bind statements that are applied to very high-level modules.

Ordering notes.

  • We should run this after preliminaries like make-implicit-wires so that scopes are correct. We rely on scopes making sense in order to look up which instances a non-global bind is referring to.
  • We should run this before argresolve so that any bindings we introduce will get resolved as per usual. We should also run this before basicsanity so that we check namespaces correctly and to report unhandled bind statements easily.

Subtopics

Vl-modulelist-apply-binddelta
(vl-modulelist-apply-binddelta x delta) maps vl-module-apply-binddelta across a list.
Vl-interfacelist-apply-binddelta
(vl-interfacelist-apply-binddelta x delta) maps vl-interface-apply-binddelta across a list.
Vl-bindelim-main
Vl-bindelim-bindlist
Vl-bindelim-find-global-target
Vl-interfacelist-bindelim
Vl-modulelist-bindelim
Vl-interface-bindelim
Vl-module-bindelim
Vl-bindelim-institem
Vl-warn-bindintentlist-undefined
Vl-warn-bindintent-undefined
Vl-interfacelist-bindelim-insttable
Vl-modulelist-bindelim-insttable
Vl-warn-binddelta-undefined
Vl-interface-bindelim-insttable
Vl-interface-apply-binddelta
Vl-design-bindelim-pass2
Vl-bindelim-modinstlist-add-atts
Vl-module-bindelim-insttable
Vl-module-apply-binddelta
Vl-bindelim-modinst-add-atts
Vl-design-bindelim-pass1
Vl-bindcontext
Places where a bind statement may occur.
Vl-bindintent->modinsts
Get the modinsts to add to some module that arise from a vl-bind, annotated with attributes that say where they came from.
Vl-bindelim-insttable
Table associating module names to all the instances of that module and where they occur.
Vl-bindintentlist->modinsts
Vl-binddelta
Table that summarizes our intended changes to the design in order to process all supported bind statements.
Vl-design-bindelim
Vl-bindelim-institemlist
A list of vl-bindelim-institem-p objects.