• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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
          • Rangeresolve
          • Propagate
          • Clean-selects
          • Clean-params
          • Blankargs
          • Inline-mods
          • Expr-simp
          • Trunc
          • Always-top
            • Edgesynth
              • Vl-edgesynth-stmt-p
              • Vl-edgetable-p
              • Vl-always-edgesynth
              • Vl-edgesynth-merge-data-ifs
              • Vl-assignstmtlist->controls
              • Vl-assignstmtlist->lhses
              • Vl-assignstmtlist->rhses
              • Vl-edgesynth-flatten-data-ifs
              • Vl-edgesynth-pattern-match
              • Nedgeflop
              • Vl-edgesynth-make-data-inputs
              • Vl-edgesynth-make-clock-inputs
              • Vl-edgesynth-stmt-clklift
                • Vl-edgesynth-assignstmt-clklift
                • Vl-edgesynth-stmtlist-clklift
              • Vl-edgesynth-blockelim
              • Vl-alwayslist-edgesynth
              • Vl-edgesynth-create
              • Vl-edgesynth-classify-iftest
              • Vl-module-edgesynth
              • Vl-edgesynth-normalize-ifs
              • Vl-edgesynth-delays-okp
              • Vl-edgesynth-stmt-assigns
              • Vl-make-edgetable
              • Vl-edgesynth-sort-edges
              • Vl-modulelist-edgesynth
              • Vl-modulelist-edgesynth-aux
              • Vl-assignstmtlist-p
              • Vl-edgesynth-edgelist-p
              • Vl-assigncontrols-p
              • Vl-edgesynth-stmt-conditions
              • Vl-edgesynth-edge-p
              • Vl-design-edgesynth
              • Vl-edgesynth-get-delay
              • Vl-edgesynth-iftype-p
              • Edge-tables
            • Stmtrewrite
            • Cblock
            • Vl-always-convert-regports
            • Vl-always-convert-regs
            • Stmttemps
            • Edgesplit
            • Vl-always-check-reg
            • Vl-convert-regs
            • Latchsynth
            • Vl-always-check-regs
            • Vl-match-always-at-some-edges
            • Unelse
            • Vl-always-convert-reg
            • Vl-design-always-backend
            • Vl-stmt-guts
            • Vl-always-convert-regport
            • Vl-always-scary-regs
            • Eliminitial
            • Ifmerge
            • Vl-edge-control-p
            • Elimalways
          • 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
  • Edgesynth

Vl-edgesynth-stmt-clklift

Lightweight rewriting to support allow us to support right-hand, sides such as reset ? 0 : data.

Signature
(vl-edgesynth-stmt-clklift x edgetable) → new-x
Arguments
x — Guard (and (vl-stmt-p x) (vl-edgesynth-stmt-p x)).
edgetable — Guard (vl-edgetable-p edgetable).
Returns
new-x — Type (vl-edgesynth-stmt-p new-x), given the guard.

We generally want to prohibit clocks from occurring in right-hand sides, e.g., we don't want to try to support things like:

always @(posedge clk)
   q <= a + b + clk;

However, it's essentially reasonable for us to test the clocks in a ?: expression, such as:

always @(posedge clk or posedge reset)
   q <= reset ? 0 : data;

So as a special hack, we implement a very lightweight transform to try to recognize simple right-hand sides of the form:

 clk ? a : b
~clk ? a : b
!clk ? a : b

And replace them with equivalent if-then-else statements where the clocks is used in the condition. I think this works even when there are delays, since the delays affect when the update is made, not when the right hand side values are evaluated.

Theorem: return-type-of-vl-edgesynth-stmt-clklift.new-x

(defthm return-type-of-vl-edgesynth-stmt-clklift.new-x
  (implies (and (force (if (vl-stmt-p x)
                           (vl-edgesynth-stmt-p x)
                         'nil))
                (force (vl-edgetable-p edgetable)))
           (b* ((?new-x (vl-edgesynth-stmt-clklift x edgetable)))
             (vl-edgesynth-stmt-p new-x)))
  :rule-classes :rewrite)

Theorem: return-type-of-vl-edgesynth-stmtlist-clklift.new-x

(defthm return-type-of-vl-edgesynth-stmtlist-clklift.new-x
 (implies (and (force (if (vl-stmtlist-p x)
                          (vl-edgesynth-stmtlist-p x)
                        'nil))
               (force (vl-edgetable-p edgetable)))
          (b* ((?new-x (vl-edgesynth-stmtlist-clklift x edgetable)))
            (vl-edgesynth-stmtlist-p new-x)))
 :rule-classes :rewrite)

Subtopics

Vl-edgesynth-assignstmt-clklift
Vl-edgesynth-stmtlist-clklift