• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
              • Parse-port-types
              • Sv-ansi-portdecls
              • Creating-portdecls/vardecls
                • Vl-make-ports-and-maybe-nets
                • Vl-parsed-port-identifier-p
                • Vl-build-portdecls
                  • Vl-build-netdecls-for-ports
                  • Vl-parsed-port-identifier-list-from-idtokenlist
                  • Vl-parsed-port-identifier-list-p
                • Sv-non-ansi-portdecls
                • Verilog-2005-ports
                • Sv-ansi-port-interpretation
                • Verilog-2005-portdecls
              • 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
    • Creating-portdecls/vardecls

    Vl-build-portdecls

    Main loop for creating real vl-portdecls.

    Signature
    (vl-build-portdecls x &key dir nettype type atts) → portdecls
    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).
    atts — Guard (vl-atts-p atts).
    Returns
    portdecls — Type (vl-portdecllist-p portdecls).

    Definitions and Theorems

    Function: vl-build-portdecls-fn

    (defun vl-build-portdecls-fn (x dir nettype type 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)
                                 (vl-atts-p atts))))
     (let ((__function__ 'vl-build-portdecls))
      (declare (ignorable __function__))
      (b*
       (((when (atom x)) nil)
        ((vl-parsed-port-identifier x1) (car x))
        (-
          (or (not (vl-datatype->udims type))
              (raise "Base datatype already has unpacked dimensions?")))
        (type1 (if (consp x1.udims)
                   (vl-datatype-update-udims x1.udims type)
                 type)))
       (cons (make-vl-portdecl :name (vl-idtoken->name x1.name)
                               :loc (vl-token->loc x1.name)
                               :dir dir
                               :nettype nettype
                               :type type1
                               :atts atts)
             (vl-build-portdecls (cdr x)
                                 :dir dir
                                 :nettype nettype
                                 :type type
                                 :atts atts)))))

    Theorem: vl-portdecllist-p-of-vl-build-portdecls

    (defthm vl-portdecllist-p-of-vl-build-portdecls
      (b* ((portdecls (vl-build-portdecls-fn x dir nettype type atts)))
        (vl-portdecllist-p portdecls))
      :rule-classes :rewrite)

    Theorem: true-listp-of-vl-build-portdecls

    (defthm true-listp-of-vl-build-portdecls
      (b* ((portdecls (vl-build-portdecls-fn x dir nettype type atts)))
        (true-listp portdecls))
      :rule-classes :type-prescription)

    Theorem: len-of-vl-build-portdecls

    (defthm len-of-vl-build-portdecls
      (b* ((portdecls (vl-build-portdecls-fn x dir nettype type atts)))
        (equal (len portdecls) (len x)))
      :rule-classes :rewrite)

    Theorem: consp-of-vl-build-portdecls

    (defthm consp-of-vl-build-portdecls
      (b* ((portdecls (vl-build-portdecls-fn x dir nettype type atts)))
        (equal (consp portdecls) (consp x)))
      :rule-classes :rewrite)

    Theorem: vl-build-portdecls-under-iff

    (defthm vl-build-portdecls-under-iff
      (b* ((portdecls (vl-build-portdecls-fn x dir nettype type atts)))
        (iff portdecls (consp x)))
      :rule-classes :rewrite)