• 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
          • Preprocessor
          • Vl-loadconfig
          • Vl-loadstate
          • Lexer
          • Parser
            • Parse-expressions
            • Parse-udps
            • Parse-statements
            • Parse-property
            • Vl-genelements
            • Parse-paramdecls
            • Parse-blockitems
            • Parse-utils
            • Parse-insts
            • Parse-functions
            • Parse-assignments
              • Parse-lvalues-2005
              • Vl-parse-continuous-assign
                • Vl-parse-list-of-variable-assignments
                • Vl-parse-list-of-net-assignments
                • Vl-parse-variable-lvalue-2012-aux
                • Vl-parse-net-lvalue-2012-aux
                • Vl-parse-variable-lvalue-2012
                • Vl-parse-variable-assignment
                • Vl-parse-net-lvalue-2012
                • Vl-parse-net-assignment
                • Vl-build-assignments
                • Vl-parse-variable-lvalue
                • Vl-parse-net-lvalue
              • Parse-clocking
              • Parse-strengths
              • Vl-parse-genvar-declaration
              • Vl-parse
              • Parse-netdecls
              • Parse-asserts
              • Vl-maybe-parse-lifetime
              • Parse-dpi-import-export
              • Parse-ports
              • Parse-timeunits
              • Seq
              • Parse-packages
              • Parse-eventctrl
            • Vl-load-merge-descriptions
            • Vl-find-basename/extension
            • Vl-load-file
            • Vl-loadresult
            • Scope-of-defines
            • Vl-find-file
            • Vl-flush-out-descriptions
            • Vl-description
            • Vl-read-file
            • Vl-includeskips-report-gather
            • Vl-load-main
            • Extended-characters
            • Vl-load
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • Vl-preprocess-debug
            • Vl-write-preprocessor-debug-file
            • Vl-read-file-report-gather
            • Vl-load-descriptions
            • Vl-load-files
            • Translate-off
            • Vl-load-read-file-hook
            • Vl-read-file-report
            • Vl-loadstate-pad
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-loadstate->warnings
            • Vl-iskips-report
            • Vl-descriptionlist
          • Warnings
          • Getting-started
          • Utilities
          • Printer
          • Kit
          • Mlib
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Parse-assignments

    Vl-parse-continuous-assign

    Parse a continuous_assign into a vl-assignlist-p.

    Signature
    (vl-parse-continuous-assign atts &key (tokstream 'tokstream) 
                                (config 'config)) 
     
      → 
    (mv errmsg? value new-tokstream)
    Arguments
    config — Guard (vl-loadconfig-p config).

    Verilog-2005:

    continuous_assign ::= 'assign' [drive_strength] [delay3] list_of_net_assignments ';'

    SystemVerilog-2012:

    continuous_assign ::= 'assign' [drive_strength] [delay3] list_of_net_assignments ';'
                        | 'assign' [delay_control] list_of_variable_assignments ';'

    Note that the delay_control here is just a small subset of a delay3:

    delay_control ::= '#' delay_value
                    | '# '(' mintypmax_expression ')'
    
    delay3 ::= '#' delay_value
             | '#' '(' mintypmax_expression [...optional stuff...] ')'

    Definitions and Theorems

    Function: vl-parse-continuous-assign-fn

    (defun vl-parse-continuous-assign-fn (atts tokstream config)
     (declare (xargs :stobjs (tokstream)))
     (declare (xargs :guard (vl-loadconfig-p config)))
     (declare (ignorable config))
     (declare (xargs :guard (vl-atts-p atts)))
     (let ((__function__ 'vl-parse-continuous-assign))
      (declare (ignorable __function__))
      (seq
       tokstream
       (assignkwd := (vl-match-token :vl-kwd-assign))
       (when (vl-is-token? :vl-lparen)
             (strength := (vl-parse-drive-strength-or-charge-strength)))
       (when
        (vl-cstrength-p strength)
        (return-raw
         (vl-parse-error
             "Assign statement illegally contains a charge strength.")))
       (when (vl-is-token? :vl-pound)
             (delay := (vl-parse-delay3)))
       (pairs :=
              (if (eq (vl-loadconfig->edition config)
                      :verilog-2005)
                  (vl-parse-list-of-net-assignments)
                (vl-parse-list-of-variable-assignments)))
       (:= (vl-match-token :vl-semi))
       (return (vl-build-assignments (vl-token->loc assignkwd)
                                     pairs strength delay atts)))))

    Theorem: vl-parse-continuous-assign-fails-gracefully

    (defthm vl-parse-continuous-assign-fails-gracefully
      (implies (mv-nth 0 (vl-parse-continuous-assign atts))
               (not (mv-nth 1 (vl-parse-continuous-assign atts)))))

    Theorem: vl-warning-p-of-vl-parse-continuous-assign

    (defthm vl-warning-p-of-vl-parse-continuous-assign
      (iff (vl-warning-p (mv-nth 0 (vl-parse-continuous-assign atts)))
           (mv-nth 0 (vl-parse-continuous-assign atts))))

    Theorem: vl-parse-continuous-assign-result

    (defthm vl-parse-continuous-assign-result
     (implies
        (and (force (vl-atts-p atts)))
        (vl-assignlist-p (mv-nth 1 (vl-parse-continuous-assign atts)))))

    Theorem: vl-parse-continuous-assign-true-listp

    (defthm vl-parse-continuous-assign-true-listp
      (true-listp (mv-nth 1 (vl-parse-continuous-assign atts)))
      :rule-classes :type-prescription)

    Theorem: vl-parse-continuous-assign-count-strong

    (defthm vl-parse-continuous-assign-count-strong
     (and
      (<= (vl-tokstream-measure
               :tokstream (mv-nth 2 (vl-parse-continuous-assign atts)))
          (vl-tokstream-measure))
      (implies
        (not (mv-nth 0 (vl-parse-continuous-assign atts)))
        (< (vl-tokstream-measure
                :tokstream (mv-nth 2 (vl-parse-continuous-assign atts)))
           (vl-tokstream-measure))))
     :rule-classes ((:rewrite) (:linear)))