• 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
        • Lint
        • Mlib
          • Scopestack
          • Filtering-by-name
          • Vl-namefactory
          • Substitution
          • Allexprs
          • Hid-tools
          • Vl-consteval
          • Range-tools
          • Lvalexprs
          • Hierarchy
          • Finding-by-name
          • Expr-tools
          • Expr-slicing
          • Stripping-functions
          • Stmt-tools
          • Modnamespace
          • Vl-parse-expr-from-str
          • Welltyped
          • Reordering-by-name
          • Flat-warnings
          • Genblob
          • Expr-building
          • Datatype-tools
          • Syscalls
            • Vl-syscall->returninfo
            • Vl-*ary-syscall-p
            • Vl-unary-syscall-p
            • Vl-0ary-syscall-p
            • Vl-sysfun-should-size-args-p
            • Vl-$random-expr-p
              • Vl-sysfunexpr->name
              • Vl-sysfunexpr-p
              • Vl-unary-syscall->arg
            • Relocate
            • Expr-cleaning
            • Namemangle
            • Caremask
            • Port-tools
            • Lvalues
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Syscalls

    Vl-$random-expr-p

    Recognize calls of the $random system function.

    Signature
    (vl-$random-expr-p x) → *
    Arguments
    x — Guard (vl-expr-p x).

    The $random system call is described in Verilog-2005, Section 17.9.1 on page 311, or in SystemVerilog-2012 Section 20.15. In either case the syntax is:

    random_function ::= $random[ '(' seed ')' ]

    Note that the seed is supposed to be a reg, integer, or time variable, but we do not check for this here.

    Definitions and Theorems

    Function: vl-$random-expr-p

    (defun vl-$random-expr-p (x)
      (declare (xargs :guard (vl-expr-p x)))
      (let ((__function__ 'vl-$random-expr-p))
        (declare (ignorable __function__))
        (or (vl-0ary-syscall-p "$random" x)
            (vl-unary-syscall-p "$random" x))))

    Theorem: vl-expr-kind-when-vl-$random-expr-p

    (defthm vl-expr-kind-when-vl-$random-expr-p
      (implies (vl-$random-expr-p x)
               (and (equal (vl-expr-kind x) :nonatom)
                    (equal (vl-nonatom->op x) :vl-syscall)))
      :rule-classes ((:forward-chaining)))

    Theorem: vl-$random-expr-p-of-vl-expr-fix-x

    (defthm vl-$random-expr-p-of-vl-expr-fix-x
      (equal (vl-$random-expr-p (vl-expr-fix x))
             (vl-$random-expr-p x)))

    Theorem: vl-$random-expr-p-vl-expr-equiv-congruence-on-x

    (defthm vl-$random-expr-p-vl-expr-equiv-congruence-on-x
      (implies (vl-expr-equiv x x-equiv)
               (equal (vl-$random-expr-p x)
                      (vl-$random-expr-p x-equiv)))
      :rule-classes :congruence)