• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
            • Vl-mux-occform
            • Vl-basic-binary-op-occform
            • Vl-occform-mkports
            • Vl-unary-reduction-op-occform
            • Vl-make-n-bit-mux
            • Vl-bitselect-occform
            • Vl-assign-occform
            • Vl-plusminus-occform
            • Vl-shift-occform
            • Vl-gte-occform
            • Vl-plain-occform
            • Vl-unary-not-occform
            • Vl-rem-occform
            • Vl-div-occform
            • Vl-ceq-occform
            • Vl-mult-occform
            • Vl-make-n-bit-dynamic-bitselect-m
            • Vl-simple-instantiate
            • Vl-occform-mkwires
            • Vl-assignlist-occform
            • Vl-occform-argfix
            • Vl-make-n-bit-unsigned-gte
            • Vl-make-2^n-bit-dynamic-bitselect
            • Vl-make-n-bit-div-rem
            • Vl-make-n-bit-plusminus
            • Vl-make-n-bit-signed-gte
            • Vl-make-n-bit-shr-by-m-bits
            • Vl-make-n-bit-shl-by-m-bits
            • Vl-occform-mkport
            • Vl-make-n-bit-dynamic-bitselect
            • Vl-make-n-bit-reduction-op
            • Vl-make-n-bit-adder-core
            • Vl-make-n-bit-xdetect
            • Vl-make-n-bit-x-propagator
              • Vl-make-n-bit-shl-place-p
              • Vl-make-n-bit-shr-place-p
              • Vl-make-n-bit-mult
              • Vl-occform-mkwire
              • Vl-make-nedgeflop-vec
              • Vl-make-n-bit-binary-op
              • Vl-make-list-of-netdecls
              • Vl-make-n-bit-delay-1
              • Vl-make-n-bit-zmux
              • *vl-2-bit-dynamic-bitselect*
              • Vl-make-n-bit-unsigned-rem
              • Vl-make-n-bit-unsigned-div
              • Vl-make-n-bit-shr-place-ps
              • Vl-make-n-bit-shl-place-ps
              • Vl-make-n-bit-assign
              • Vl-make-n-bit-x
              • Vl-make-n-bit-ceq
              • Vl-make-n-bit-xor-each
              • Vl-make-n-bit-not
              • Vl-make-1-bit-delay-m
              • Vl-make-n-bit-delay-m
              • *vl-1-bit-signed-gte*
              • *vl-1-bit-div-rem*
              • *vl-1-bit-adder-core*
              • Vl-make-nedgeflop
              • *vl-1-bit-mult*
              • *vl-1-bit-dynamic-bitselect*
            • Oprewrite
            • Expand-functions
            • Delayredux
            • Unparameterization
            • Caseelim
            • Split
            • Selresolve
            • Weirdint-elim
            • Vl-delta
            • Replicate-insts
            • 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
    • Occform

    Vl-make-n-bit-x-propagator

    Generate a module that propagates Xes from inputs into an answer.

    Signature
    (vl-make-n-bit-x-propagator n m) → mods
    Arguments
    n — Guard (posp n).
    m — Guard (posp m).
    Returns
    mods — A non-empty module list. The first module in the list is the desired module; the other modules are any necessary supporting modules.
        Type (vl-modulelist-p mods).

    We generate a gate-based module that has the following interface:

    module VL_N_BY_M_XPROP (out, ans, a, b);
      output [m-1:0] out;
      input [m-1:0] ans;
      input [n-1:0] a;
      input [n-1:0] b;
    endmodule

    This propagator module can be understood as: if any bit of a or b is X/Z, then out will be all X bits. Otherwise out is just a copy of ans.

    Definitions and Theorems

    Function: vl-make-n-bit-x-propagator

    (defun vl-make-n-bit-x-propagator (n m)
     (declare (xargs :guard (and (posp n) (posp m))))
     (declare (xargs :guard t))
     (let ((__function__ 'vl-make-n-bit-x-propagator))
      (declare (ignorable __function__))
      (b* ((n (lposfix n))
           (m (lposfix m))
           (name (hons-copy (cat "VL_" (natstr n)
                                 "_BY_" (natstr m)
                                 "_XPROP")))
           ((mv out-expr
                out-port out-portdecl out-vardecl)
            (vl-occform-mkport "out" :vl-output m))
           ((mv ans-expr
                ans-port ans-portdecl ans-vardecl)
            (vl-occform-mkport "ans" :vl-input m))
           ((mv a-expr a-port a-portdecl a-vardecl)
            (vl-occform-mkport "a" :vl-input n))
           ((mv b-expr b-port b-portdecl b-vardecl)
            (vl-occform-mkport "b" :vl-input n))
           ((mv xdeta-expr xdeta-vardecl)
            (vl-occform-mkwire "xdet_a" 1))
           ((mv xdetb-expr xdetb-vardecl)
            (vl-occform-mkwire "xdet_b" 1))
           ((mv xdet-expr xdet-vardecl)
            (vl-occform-mkwire "xdet_ab" 1))
           ((cons xdet-mod xdet-support)
            (vl-make-n-bit-xdetect n))
           ((cons xeach-mod xeach-support)
            (vl-make-n-bit-xor-each m))
           (xdeta-inst
                (vl-simple-inst xdet-mod "mk_xdet_a" xdeta-expr a-expr))
           (xdetb-inst
                (vl-simple-inst xdet-mod "mk_xdet_b" xdetb-expr b-expr))
           (xdet-inst (vl-simple-inst *vl-1-bit-xor* "mk_xdet_ab"
                                      xdet-expr xdeta-expr xdetb-expr))
           (xeach-inst
                (vl-simple-inst xeach-mod
                                "mk_out" out-expr xdet-expr ans-expr)))
        (list* (make-vl-module
                    :name name
                    :origname name
                    :ports (list out-port ans-port a-port b-port)
                    :portdecls (list out-portdecl
                                     ans-portdecl a-portdecl b-portdecl)
                    :vardecls (list out-vardecl ans-vardecl
                                    a-vardecl b-vardecl xdeta-vardecl
                                    xdetb-vardecl xdet-vardecl)
                    :modinsts (list xdeta-inst
                                    xdetb-inst xdet-inst xeach-inst)
                    :minloc *vl-fakeloc*
                    :maxloc *vl-fakeloc*)
               xdet-mod xeach-mod
               (append xdet-support xeach-support)))))

    Theorem: vl-modulelist-p-of-vl-make-n-bit-x-propagator

    (defthm vl-modulelist-p-of-vl-make-n-bit-x-propagator
      (b* ((mods (vl-make-n-bit-x-propagator n m)))
        (vl-modulelist-p mods))
      :rule-classes :rewrite)

    Theorem: type-of-vl-make-n-bit-x-propagator

    (defthm type-of-vl-make-n-bit-x-propagator
      (and (true-listp (vl-make-n-bit-x-propagator n m))
           (consp (vl-make-n-bit-x-propagator n m)))
      :rule-classes :type-prescription)

    Theorem: vl-make-n-bit-x-propagator-of-pos-fix-n

    (defthm vl-make-n-bit-x-propagator-of-pos-fix-n
      (equal (vl-make-n-bit-x-propagator (pos-fix n)
                                         m)
             (vl-make-n-bit-x-propagator n m)))

    Theorem: vl-make-n-bit-x-propagator-pos-equiv-congruence-on-n

    (defthm vl-make-n-bit-x-propagator-pos-equiv-congruence-on-n
      (implies (acl2::pos-equiv n n-equiv)
               (equal (vl-make-n-bit-x-propagator n m)
                      (vl-make-n-bit-x-propagator n-equiv m)))
      :rule-classes :congruence)

    Theorem: vl-make-n-bit-x-propagator-of-pos-fix-m

    (defthm vl-make-n-bit-x-propagator-of-pos-fix-m
      (equal (vl-make-n-bit-x-propagator n (pos-fix m))
             (vl-make-n-bit-x-propagator n m)))

    Theorem: vl-make-n-bit-x-propagator-pos-equiv-congruence-on-m

    (defthm vl-make-n-bit-x-propagator-pos-equiv-congruence-on-m
      (implies (acl2::pos-equiv m m-equiv)
               (equal (vl-make-n-bit-x-propagator n m)
                      (vl-make-n-bit-x-propagator n m-equiv)))
      :rule-classes :congruence)