• 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
            • 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-nedgeflop

    Generate an N-bit register with K edges.

    Signature
    (vl-make-nedgeflop width nedges) → mods
    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).

    Definitions and Theorems

    Function: vl-make-nedgeflop

    (defun vl-make-nedgeflop (width nedges)
     (declare (xargs :guard (and (posp width) (posp nedges))))
     (let ((__function__ 'vl-make-nedgeflop))
       (declare (ignorable __function__))
       (b*
        ((width (lposfix width))
         (nedges (lposfix nedges))
         ((when (eql width 1))
          (list (vl-make-1-bit-n-edge-flop nedges)))
         (name (cat "VL_" (natstr width)
                    "_BIT_" (natstr nedges)
                    "_EDGE_FLOP"))
         ((mv q-expr q-port q-portdecl q-vardecl)
          (vl-occform-mkport "q"
                             :vl-output width))
         ((mv d-exprs d-ports d-portdecls d-vardecls)
          (vl-occform-mkports "d" 0 nedges
                              :dir :vl-input
                              :width width))
         ((mv clk-exprs
              clk-ports clk-portdecls clk-vardecls)
          (vl-occform-mkports "clk" 0 nedges
                              :dir :vl-input
                              :width 1))
         (primitive (vl-make-1-bit-n-edge-flop nedges))
         (modinsts
              (vl-make-nedgeflop-insts primitive
                                       q-expr d-exprs clk-exprs width)))
        (list (make-vl-module
                   :name name
                   :origname name
                   :ports (cons q-port (append d-ports clk-ports))
                   :portdecls (cons q-portdecl
                                    (append d-portdecls clk-portdecls))
                   :vardecls (cons q-vardecl
                                   (append d-vardecls clk-vardecls))
                   :modinsts modinsts
                   :minloc *vl-fakeloc*
                   :maxloc *vl-fakeloc*)
              primitive))))

    Theorem: vl-modulelist-p-of-vl-make-nedgeflop

    (defthm vl-modulelist-p-of-vl-make-nedgeflop
      (b* ((mods (vl-make-nedgeflop width nedges)))
        (vl-modulelist-p mods))
      :rule-classes :rewrite)

    Theorem: type-of-vl-make-nedgeflop

    (defthm type-of-vl-make-nedgeflop
      (and (true-listp (vl-make-nedgeflop width nedges))
           (consp (vl-make-nedgeflop width nedges)))
      :rule-classes :type-prescription)