• 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-delay-m

    Generate an N-bit wide, M-tick delay module.

    Signature
    (vl-make-n-bit-delay-m n m &key vecp) → mods
    Arguments
    n — Guard (posp n).
    m — Guard (posp m).
    Returns
    mods — Type (vl-modulelist-p mods), given the guard.

    We generate a module in terms of primitives that is equivalent to:

    module VL_N_BIT_DELAY_M (out, in) ;
      output [N-1:0] out;
      input [N-1:0] in;
      assign #M out = in;
    endmodule

    In the special case that m is 1, we build a VL_N_BIT_DELAY_1 module using vl-make-n-bit-delay-1.

    Otherwise, we just chain together a list of these modules, one for each tick. For instance, a module that implements 4-bit wide delay for 3 ticks would look like this:

    module VL_4_BIT_DELAY_3 (out, in);
      output [3:0] out;
      output [3:0] in;
    
      wire [3:0] temp1;
      wire [3:0] temp2;
    
      VL_4_BIT_DELAY_1 bit0 (temp1, in);
      VL_4_BIT_DELAY_1 bit1 (temp2, temp1);
      VL_4_BIT_DELAY_1 bit2 (out, temp2);
    endmodule

    Definitions and Theorems

    Function: vl-make-n-bit-delay-m-fn

    (defun vl-make-n-bit-delay-m-fn (n m vecp)
     (declare (xargs :guard (and (posp n) (posp m))))
     (let ((__function__ 'vl-make-n-bit-delay-m))
       (declare (ignorable __function__))
       (b*
        ((base (vl-make-n-bit-delay-1 n :vecp vecp))
         ((when (= m 1)) base)
         (name (cat "VL_" (natstr n)
                    "_BIT_DELAY_" (natstr m)))
         ((mv out-expr
              out-port out-portdecl out-vardecl)
          (vl-occform-mkport "out" :vl-output n))
         ((mv in-expr in-port in-portdecl in-vardecl)
          (vl-occform-mkport "in" :vl-input n))
         ((mv tmp-exprs tmp-vardecls)
          (vl-occform-mkwires "temp" 1 m
                              :width n))
         (outs (append tmp-exprs (list out-expr)))
         (ins (cons in-expr tmp-exprs))
         (insts (vl-simple-inst-list (car base)
                                     "del" outs ins))
         (mod (make-vl-module
                   :name name
                   :origname name
                   :ports (list out-port in-port)
                   :portdecls (list out-portdecl in-portdecl)
                   :vardecls (list* out-vardecl in-vardecl tmp-vardecls)
                   :modinsts insts
                   :minloc *vl-fakeloc*
                   :maxloc *vl-fakeloc*)))
        (cons mod base))))

    Theorem: vl-modulelist-p-of-vl-make-n-bit-delay-m

    (defthm vl-modulelist-p-of-vl-make-n-bit-delay-m
      (implies (and (posp n) (posp m))
               (b* ((mods (vl-make-n-bit-delay-m-fn n m vecp)))
                 (vl-modulelist-p mods)))
      :rule-classes :rewrite)

    Theorem: type-of-vl-make-n-bit-delay-m

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