• 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
          • Preprocessor
          • Vl-loadconfig
          • Lexer
          • Vl-loadstate
          • Parser
            • Parse-expressions
            • Parse-udps
            • Vl-genelements
            • Parse-paramdecls
            • Parse-blockitems
            • Parse-utils
            • Parse-insts
            • Parse-datatype
            • Parse-functions
            • Parse-datatypes
            • Parse-strengths
            • Vl-parse-genvar-declaration
              • Vl-parse
              • Parse-ports
              • Seq
              • Parse-packages
            • Vl-load-merge-descriptions
            • Scope-of-defines
            • Vl-load-file
            • Vl-flush-out-descriptions
            • Vl-description
            • Vl-loadresult
            • Vl-read-file
            • Vl-find-basename/extension
            • Vl-find-file
            • Vl-read-files
            • Extended-characters
            • Vl-load
            • Vl-load-main
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • Vl-load-descriptions
            • Vl-load-files
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-descriptionlist
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Parser

    Vl-parse-genvar-declaration

    Match genvar_declaration.

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

    Verilog-2005 and SystemVerilog-2012 agree on the following rules:

    genvar_declaration ::= 'genvar' list_of_genvar_identifiers ';'
    list_of_genvar_identifiers ::= genvar_identifier { ',' genvar_identifier }
    genvar_identifier ::= identifier

    Definitions and Theorems

    Function: vl-parse-genvar-declaration-fn

    (defun vl-parse-genvar-declaration-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-genvar-declaration))
        (declare (ignorable __function__))
        (seq tokstream
             (:= (vl-match-token :vl-kwd-genvar))
             (names := (vl-parse-1+-identifiers-separated-by-commas))
             (:= (vl-match-token :vl-semi))
             (return (vl-idtokenlist->genvars names atts)))))

    Theorem: vl-parse-genvar-declaration-fails-gracefully

    (defthm vl-parse-genvar-declaration-fails-gracefully
      (implies (mv-nth 0 (vl-parse-genvar-declaration atts))
               (not (mv-nth 1 (vl-parse-genvar-declaration atts)))))

    Theorem: vl-warning-p-of-vl-parse-genvar-declaration

    (defthm vl-warning-p-of-vl-parse-genvar-declaration
      (iff (vl-warning-p (mv-nth 0 (vl-parse-genvar-declaration atts)))
           (mv-nth 0 (vl-parse-genvar-declaration atts))))

    Theorem: vl-parse-genvar-declaration-result

    (defthm vl-parse-genvar-declaration-result
      (implies (and (force (vl-atts-p atts)))
               (vl-modelementlist-p
                    (mv-nth 1 (vl-parse-genvar-declaration atts)))))

    Theorem: vl-parse-genvar-declaration-true-listp

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

    Theorem: vl-parse-genvar-declaration-count-strong

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