• 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
              • Vl-make-hidden-variables-for-portdecls
              • Vl-parse-function-declaration-2005
              • Vl-parse-task-declaration-2005
              • Vl-parse-task-item-declaration-noatts
              • Vl-parse-taskport-declaration
              • Parse-functions-sv2012
              • Vl-parse-taskport-list
              • Vl-make-fundecl-for-parser
                • Vl-make-taskdecl-for-parser
                • Vl-parse-0+-task-item-declarations
                • Vl-parse-optional-function-range-or-type
                • Vl-parse-task-item-declaration
                • Vl-skip-through-endfunction
                • Vl-skip-through-endtask
                • Vl-make-hidden-variable-for-portdecl
                • Vl-filter-portdecl-or-blockitem-list
                • Vl-build-taskports
                • Vl-portdecllist-find-noninput
              • Parse-assignments
              • 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-functions

    Vl-make-fundecl-for-parser

    Main function the parser uses for creating function declarations.

    Signature
    (vl-make-fundecl-for-parser &key name lifetime rettype 
                                inputs decls loaditems body atts loc) 
     
      → 
    fun
    Arguments
    name — Guard (stringp name).
    lifetime — Guard (vl-lifetime-p lifetime).
    rettype — Guard (vl-datatype-p rettype).
    inputs — Guard (vl-portdecllist-p inputs).
    decls — Guard (vl-blockitemlist-p decls).
    loaditems — Guard (vl-portdecl-or-blockitem-list-p loaditems).
    body — Guard (vl-stmt-p body).
    atts — Guard (vl-atts-p atts).
    loc — Guard (vl-location-p loc).
    Returns
    fun — Type (vl-fundecl-p fun).

    This mainly just adds the VL_HIDDEN_DECL_FOR_TASKPORT variables. See the description of decls in vl-fundecl for more information.

    Definitions and Theorems

    Function: vl-make-fundecl-for-parser-fn

    (defun vl-make-fundecl-for-parser-fn
           (name lifetime rettype
                 inputs decls loaditems body atts loc)
     (declare
          (xargs :guard (and (stringp name)
                             (vl-lifetime-p lifetime)
                             (vl-datatype-p rettype)
                             (vl-portdecllist-p inputs)
                             (vl-blockitemlist-p decls)
                             (vl-portdecl-or-blockitem-list-p loaditems)
                             (vl-stmt-p body)
                             (vl-atts-p atts)
                             (vl-location-p loc))))
     (let ((__function__ 'vl-make-fundecl-for-parser))
      (declare (ignorable __function__))
      (b*
       ((port-vars (vl-make-hidden-variables-for-portdecls inputs))
        (ret-var
         (make-vl-vardecl
           :name name
           :type rettype
           :atts (list (list (hons-copy "VL_HIDDEN_DECL_FOR_TASKPORT")))
           :loc loc))
        (decls (append port-vars (list ret-var) decls))
        ((mv vardecls paramdecls imports typedefs)
         (vl-sort-blockitems decls)))
       (make-vl-fundecl :name name
                        :lifetime lifetime
                        :rettype rettype
                        :portdecls inputs
                        :loaditems loaditems
                        :vardecls vardecls
                        :paramdecls paramdecls
                        :imports imports
                        :typedefs typedefs
                        :body body
                        :atts atts
                        :loc loc))))

    Theorem: vl-fundecl-p-of-vl-make-fundecl-for-parser

    (defthm vl-fundecl-p-of-vl-make-fundecl-for-parser
      (b* ((fun (vl-make-fundecl-for-parser-fn
                     name lifetime rettype
                     inputs decls loaditems body atts loc)))
        (vl-fundecl-p fun))
      :rule-classes :rewrite)