• 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
          • 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
            • Vl-latchcode-synth-always
            • Vl-match-latch-main
            • Vl-careful-match-latch
            • Vl-careless-match-latch
            • Vl-latchcode-synth-alwayses
            • Vl-make-n-bit-latch-vec
            • Vl-make-n-bit-latch
              • Vl-make-1-bit-latch-instances
            • 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
    • Vl-make-n-bit-latch

    Vl-make-1-bit-latch-instances

    Build a list of VL_1_BIT_LATCH instances.

    Signature
    (vl-make-1-bit-latch-instances q-wires 
                                   clk-wire d-wires &optional (n '0)) 
     
      → 
    insts
    Arguments
    q-wires — Guard (vl-exprlist-p q-wires).
    clk-wire — Guard (vl-expr-p clk-wire).
    d-wires — Guard (vl-exprlist-p d-wires).
    n — current index, for name generation, counts up.
        Guard (natp n).
    Returns
    insts — Type (vl-modinstlist-p insts).

    We produce a list of latch instances like:

    VL_1_BIT_LATCH bit_0 (q[0], clk, d[0]) ;
    VL_1_BIT_LATCH bit_1 (q[1], clk, d[1]) ;
    ...
    VL_1_BIT_LATCH bit_{n-1} (q[{n-1}], clk, d[{n-1}]) ;

    Definitions and Theorems

    Function: vl-make-1-bit-latch-instances-fn

    (defun vl-make-1-bit-latch-instances-fn (q-wires clk-wire d-wires n)
      (declare (xargs :guard (and (vl-exprlist-p q-wires)
                                  (vl-expr-p clk-wire)
                                  (vl-exprlist-p d-wires)
                                  (natp n))))
      (declare (xargs :guard (same-lengthp q-wires d-wires)))
      (let ((__function__ 'vl-make-1-bit-latch-instances))
        (declare (ignorable __function__))
        (if (atom q-wires)
            nil
          (cons (vl-simple-inst *vl-1-bit-latch*
                                (hons-copy (cat "bit_" (natstr n)))
                                (car q-wires)
                                clk-wire (car d-wires))
                (vl-make-1-bit-latch-instances (cdr q-wires)
                                               clk-wire (cdr d-wires)
                                               (+ n 1))))))

    Theorem: vl-modinstlist-p-of-vl-make-1-bit-latch-instances

    (defthm vl-modinstlist-p-of-vl-make-1-bit-latch-instances
     (b*
      ((insts
         (vl-make-1-bit-latch-instances-fn q-wires clk-wire d-wires n)))
      (vl-modinstlist-p insts))
     :rule-classes :rewrite)