• 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-clocking
            • Parse-strengths
            • Vl-parse-genvar-declaration
            • Vl-parse
            • Parse-netdecls
            • Parse-asserts
            • Vl-maybe-parse-lifetime
            • Parse-dpi-import-export
            • Parse-ports
              • Parse-port-types
              • Creating-portdecls/vardecls
                • Vl-make-ports-and-maybe-nets
                  • Vl-parsed-port-identifier-p
                  • Vl-build-netdecls-for-ports
                  • Vl-build-portdecls
                  • Vl-parsed-port-identifier-list-from-idtokenlist
                  • Vl-parsed-port-identifier-list-p
                • Verilog-2005-ports
                • Sv-non-ansi-portdecls
                • Vl-parse-ansi-port-declaration-2005
                • Vl-parse-1+-port-declarations-separated-by-commas-2005
                • Vl-parse-ansi-port-declaration
                • Vl-parse-1+-ansi-port-declarations
                • Verilog-2005-portdecls
              • 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
    • Creating-portdecls/vardecls

    Vl-make-ports-and-maybe-nets

    Top level routine for creating proper port and variable declarations.

    Signature
    (vl-make-ports-and-maybe-nets 
         x &key dir nettype type complete-p atts) 
     
      → 
    val
    Arguments
    x — Guard (vl-parsed-port-identifier-list-p x).
    dir — Guard (vl-direction-p dir).
    nettype — Guard (vl-maybe-nettypename-p nettype).
    type — Guard (vl-datatype-p type).
    complete-p — Guard (booleanp complete-p).
    atts — Guard (vl-atts-p atts).
    Returns
    val — Type (and (consp val) (vl-portdecllist-p (car val)) (vl-vardecllist-p (cdr val))) .

    Definitions and Theorems

    Function: vl-make-ports-and-maybe-nets-fn

    (defun vl-make-ports-and-maybe-nets-fn
           (x dir nettype type complete-p atts)
     (declare (xargs :guard (and (vl-parsed-port-identifier-list-p x)
                                 (vl-direction-p dir)
                                 (vl-maybe-nettypename-p nettype)
                                 (vl-datatype-p type)
                                 (booleanp complete-p)
                                 (vl-atts-p atts))))
     (let ((__function__ 'vl-make-ports-and-maybe-nets))
       (declare (ignorable __function__))
       (b* ((atts (if complete-p atts
                    (hons '("VL_INCOMPLETE_DECLARATION")
                          atts)))
            (portdecls (vl-build-portdecls x
                                           :dir dir
                                           :nettype nettype
                                           :type type
                                           :atts atts))
            (netdecls (if (not complete-p)
                          nil
                        (vl-build-netdecls-for-ports
                             x
                             :type type
                             :nettype nettype
                             :atts (hons '("VL_PORT_IMPLICIT") atts)))))
         (cons portdecls netdecls))))

    Theorem: return-type-of-vl-make-ports-and-maybe-nets

    (defthm return-type-of-vl-make-ports-and-maybe-nets
      (b* ((val (vl-make-ports-and-maybe-nets-fn
                     x dir nettype type complete-p atts)))
        (and (consp val)
             (vl-portdecllist-p (car val))
             (vl-vardecllist-p (cdr val))))
      :rule-classes :rewrite)

    Theorem: true-listp-of-vl-make-ports-and-maybe-nets-1

    (defthm true-listp-of-vl-make-ports-and-maybe-nets-1
      (true-listp
           (car (vl-make-ports-and-maybe-nets x
                                              :dir dir
                                              :type type
                                              :complete-p complete-p
                                              :nettype nettype
                                              :atts atts)))
      :rule-classes :type-prescription)

    Theorem: true-listp-of-vl-make-ports-and-maybe-nets-2

    (defthm true-listp-of-vl-make-ports-and-maybe-nets-2
      (true-listp
           (cdr (vl-make-ports-and-maybe-nets x
                                              :dir dir
                                              :type type
                                              :complete-p complete-p
                                              :nettype nettype
                                              :atts atts)))
      :rule-classes :type-prescription)

    Theorem: basics-of-vl-make-ports-and-maybe-nets

    (defthm basics-of-vl-make-ports-and-maybe-nets
      (b* (((cons portdecls netdecls)
            (vl-make-ports-and-maybe-nets x
                                          :dir dir
                                          :type type
                                          :complete-p complete-p
                                          :nettype nettype
                                          :atts atts)))
        (and (equal (len portdecls) (len x))
             (equal (consp portdecls) (consp x))
             (iff portdecls (consp x))
             (equal (len netdecls)
                    (if complete-p (len x) 0))
             (equal (consp netdecls)
                    (and complete-p (consp x)))
             (iff netdecls (and complete-p (consp x))))))