• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
        • Symbolic-test-vectors
        • Esim-primitives
        • E-conversion
          • Vl-ealist-p
          • Modinsts-to-eoccs
          • Vl-module-make-esim
          • Exploding-vectors
            • Vl-wirealist-p
            • Emodwire-encoding
            • Vl-emodwire-p
            • Vl-emodwirelistlist
            • Vl-emodwirelist
          • Resolving-multiple-drivers
          • Vl-modulelist-make-esims
          • Vl-module-check-e-ok
          • Vl-collect-design-wires
          • Adding-z-drivers
          • Vl-design-to-e
          • Vl-design-to-e-check-ports
          • Vl-design-to-e-main
          • Port-bit-checking
        • Esim-steps
        • Patterns
        • Mod-internal-paths
        • Defmodules
        • Esim-simplify-update-fns
        • Esim-tutorial
        • Esim-vl
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • E-conversion

Exploding-vectors

How we convert Verilog wires (which might be vectors) into E wires (which are just bits).

A significant difference between E and Verilog is that there are no vectors in E. Whereas our Verilog module might have a vector like wire [7:0] w, our E module will instead have eight individual wires, whose names are ACL2::|w[7]| through ACL2::|w[0]|.

There is a fair bit of code geared towards making this bit-level conversion safe and efficient. As a quick summary:

  • We represent each of these "exploded" wires like ACL2::|w[0]| as an vl-emodwire-p. This representation includes an encoding scheme that usually produces readable names and avoids name clashes, even when escaped identifiers are used.
  • The E wires for all of a module's net and register declarations can be bundled into a vl-wirealist-p. A wire alist is generally constructed with vl-module-wirealist, which provides certain uniqueness guarantees.
  • Certain "simple" expressions (similar to sliceable expressions) can be converted into wires using vl-msb-expr-bitlist, which does lots of sanity checking to ensure that the sizes and bounds of the expressions are correct and that only defined wires are being used.

BOZO much of this code predates the exprsesion slicing code. We may wish to eventually redo significant portions of the wirealist stuff to instead be based on the expression-slicing code.

Subtopics

Vl-wirealist-p
Associates wire names (strings) to lists of vl-emodwire-ps which represent the wire's bits in msb-first order.
Emodwire-encoding
A simple encoding scheme to basenames that are free of certain special characters.
Vl-emodwire-p
(vl-emodwire-p x) recognizes symbols that VL generates as wire names for E modules.
Vl-emodwirelistlist
A list of vl-emodwire-p lists.
Vl-emodwirelist
A list of vl-emodwire-p objects.