• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
          • Scopestack
          • Hid-tools
          • Filtering-by-name
          • Vl-interface-mocktype
          • Stripping-functions
          • Genblob
          • Expr-tools
          • Extract-vl-types
          • Hierarchy
          • Range-tools
          • Finding-by-name
          • Stmt-tools
          • Modnamespace
          • Flat-warnings
          • Reordering-by-name
          • Datatype-tools
          • Syscalls
            • Vl-syscall->returninfo
            • Vl-unary-syscall-p
            • Vl-typearg-syscall-p
            • Vl-0ary-syscall-p
            • Vl-*ary-syscall-p
            • Vl-$random-expr-p
              • Vl-simple-id-name
              • Vl-unary-syscall->arg
            • Allexprs
            • Lvalues
            • Port-tools
          • Transforms
        • 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)
               (vl-expr-case x
                             :vl-call x.systemp
                             :otherwise nil))
      :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)