• 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
            • Vl-modulelist-split
            • Vl-plainarg-split
            • Vl-assign-split
              • Vl-expr-split
              • Vl-arguments-split
              • Vl-plainarglist-split
              • Vl-gateinstlist-split
              • Vl-modinstlist-split
              • Vl-assignlist-split
              • Vl-module-split
              • Vl-modinst-split
              • Vl-gateinst-split
              • Vl-nosplitlist-p
              • Vl-nosplit-p
              • Vl-design-split
              • *vl-tmp-wire-atts*
            • 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
    • Split

    Vl-assign-split

    Split up assignments with complex right-hand sides.

    Signature
    (vl-assign-split x delta) → (mv new-x delta)
    Arguments
    x — Guard (vl-assign-p x).
    delta — Guard (vl-delta-p delta).
    Returns
    new-x — Type (vl-assign-p new-x), given the guard.
    delta — Type (vl-delta-p delta), given the guard.

    This is a little more interesting than usual. We want to split up the right-hand side of an assignment only if it is a compound expression that involves unsliceable arguments. That is, we don't want to split up assignments like:

    • foo = bar -- no operations
    • foo = bar[3] -- no "non-wiring" operations
    • foo = bar + 1 -- just one operation
    • foo = bar[3] & foo[4] -- just one "non-wiring" operation

    But we do want to split up anything more complicated, for instance, if we have:

    foo = bar + (baz + 1)

    Then we want to split, because we have a top-level operator who has an argument, (baz + 1), that isn't sliceable.

    Definitions and Theorems

    Function: vl-assign-split

    (defun vl-assign-split (x delta)
      (declare (xargs :guard (and (vl-assign-p x)
                                  (vl-delta-p delta))))
      (let ((__function__ 'vl-assign-split))
        (declare (ignorable __function__))
        (b* (((vl-assign x) x)
             ((when (vl-nosplit-p x.expr))
              (mv x delta))
             (args (vl-nonatom->args x.expr))
             ((when (vl-nosplitlist-p args))
              (mv x delta))
             ((mv new-args delta)
              (vl-exprlist-split args x delta))
             (new-expr (change-vl-nonatom x.expr
                                          :args new-args))
             (x-prime (change-vl-assign x :expr new-expr)))
          (mv x-prime delta))))

    Theorem: vl-assign-p-of-vl-assign-split.new-x

    (defthm vl-assign-p-of-vl-assign-split.new-x
      (implies (and (force (vl-assign-p x))
                    (force (vl-delta-p delta)))
               (b* (((mv ?new-x ?delta)
                     (vl-assign-split x delta)))
                 (vl-assign-p new-x)))
      :rule-classes :rewrite)

    Theorem: vl-delta-p-of-vl-assign-split.delta

    (defthm vl-delta-p-of-vl-assign-split.delta
      (implies (and (force (vl-assign-p x))
                    (force (vl-delta-p delta)))
               (b* (((mv ?new-x ?delta)
                     (vl-assign-split x delta)))
                 (vl-delta-p delta)))
      :rule-classes :rewrite)