• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
              • Vl-msb-expr-bitlist
              • Vl-plain-wire-name
              • Vl-module-wirealist
              • Vl-emodwires-from-high-to-low
              • Vl-vardecl-msb-emodwires
              • Vl-vardecllist-to-wirealist
              • Vl-emodwires-from-msb-to-lsb
              • Vl-verilogify-emodwirelist
                • Vl-match-contiguous-indices
                • Vl-verilogify-merged-indices
                  • Vl-merge-contiguous-indices
              • 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
    • Vl-verilogify-emodwirelist

    Vl-verilogify-merged-indices

    Transform a merged index list into Verilog-style wire names.

    (vl-verilogify-merged-indices name x) takes name, which should be a string, and x, a vl-merged-index-list-p such as vl-merge-contiguous-indices generates. It produces a list of strings that represent the Verilog bit- and part-selects of these indices from name. For instance,

    (vl-verilogify-merged-indices "foo" '(1 (3 . 6) 8))
    -->
    ("foo[1]" "foo[6:3]" "foo[8]")

    Definitions and Theorems

    Function: vl-verilogify-merged-indices

    (defun vl-verilogify-merged-indices (name x)
      (declare (xargs :guard (and (stringp name)
                                  (vl-merged-index-list-p x))))
      (if (atom x)
          nil
        (cons (cond ((not (car x)) name)
                    ((natp (car x))
                     (cat name "[" (natstr (car x)) "]"))
                    ((consp (car x))
                     (let ((low (caar x)) (high (cdar x)))
                       (cat name "[" (natstr high)
                            ":" (natstr low)
                            "]"))))
              (vl-verilogify-merged-indices name (cdr x)))))

    Theorem: string-listp-of-vl-verilogify-merged-indices

    (defthm string-listp-of-vl-verilogify-merged-indices
      (implies (and (force (stringp name))
                    (force (vl-merged-index-list-p x)))
               (string-listp (vl-verilogify-merged-indices name x))))