• 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
            • Vl-replicated-instnames
            • Vl-modulelist-replicate
            • Argument-partitioning
            • Vl-replicate-gateinst
            • Vl-replicate-gateinstlist
            • Vl-module-port-widths
            • Vl-replicate-modinst
            • Vl-replicate-arguments
            • Vl-replicate-orig-instnames
            • Vl-assemble-modinsts
            • Vl-module-replicate
            • Vl-replicate-modinstlist
            • Vl-modinst-origname/idx
            • Vl-modinst-origname
            • Vl-gateinst-origname/idx
            • Vl-gateinst-origname
            • Vl-gateinst-origidx
            • Vl-modinst-origidx
              • Vl-design-replicate
              • Vl-some-modinst-array-p
              • Vl-some-gateinst-array-p
            • 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
            • 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
    • Replicate-insts

    Vl-modinst-origidx

    Retrieve the original index of a module instance if it was modified by the replicate transform.

    Signature
    (vl-modinst-origidx x) → index
    Arguments
    x — Guard (vl-modinst-p x).
    Returns
    index — Type (maybe-natp index).

    Definitions and Theorems

    Function: vl-modinst-origidx

    (defun vl-modinst-origidx (x)
      (declare (xargs :guard (vl-modinst-p x)))
      (let ((__function__ 'vl-modinst-origidx))
        (declare (ignorable __function__))
        (b* (((vl-modinst x) x)
             (look (assoc-equal "VL_REPLICATE_INDEX" x.atts))
             ((when (not (cdr look))) nil)
             ((when (not (vl-expr-resolved-p (cdr look))))
              (raise "Malformed VL_REPLICATE_INDEX attribute: ~x0~%"
                     (cdr look))
              nil))
          (vl-resolved->val (cdr look)))))

    Theorem: maybe-natp-of-vl-modinst-origidx

    (defthm maybe-natp-of-vl-modinst-origidx
      (b* ((index (vl-modinst-origidx x)))
        (maybe-natp index))
      :rule-classes :type-prescription)

    Theorem: vl-modinst-origidx-of-vl-modinst-fix-x

    (defthm vl-modinst-origidx-of-vl-modinst-fix-x
      (equal (vl-modinst-origidx (vl-modinst-fix x))
             (vl-modinst-origidx x)))

    Theorem: vl-modinst-origidx-vl-modinst-equiv-congruence-on-x

    (defthm vl-modinst-origidx-vl-modinst-equiv-congruence-on-x
      (implies (vl-modinst-equiv x x-equiv)
               (equal (vl-modinst-origidx x)
                      (vl-modinst-origidx x-equiv)))
      :rule-classes :congruence)