• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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-build-subsequent-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
    • Vl-build-portdecls

    Vl-build-subsequent-portdecls

    Signature
    (vl-build-subsequent-portdecls x base-decl) → portdecls
    Arguments
    x — The subsequent ports, a1, ....
        Guard (vl-parsed-port-identifier-list-p x).
    base-decl — Possibly the portdecl for a0, but more generally it may be a portdecl that we are ``abusing'' to reuse structure. In particular, if a0 has unpacked dimensions, then base-decl is like a0 except that it does NOT have such dimensions.
        Guard (vl-portdecl-p base-decl).
    Returns
    portdecls — Type (vl-portdecllist-p portdecls).

    We have sometimes encountered very long port lists like input a0, a1, ...;. In these cases, we can win big for memory usage by reusing structure when we build the subsequent port declarations, by CHANGE-ing the declaration of a0 instead of MAKE-ing fresh ports.

    Definitions and Theorems

    Function: vl-build-subsequent-portdecls

    (defun vl-build-subsequent-portdecls (x base-decl)
     (declare (xargs :guard (and (vl-parsed-port-identifier-list-p x)
                                 (vl-portdecl-p base-decl))))
     (let ((__function__ 'vl-build-subsequent-portdecls))
      (declare (ignorable __function__))
      (b*
       (((when (atom x)) nil)
        ((vl-parsed-port-identifier x1) (car x))
        (basetype (vl-portdecl->type base-decl))
        (-
          (or (not (vl-datatype->udims basetype))
              (raise "Base datatype already has unpacked dimensions?")))
        (type1 (if (consp x1.udims)
                   (vl-datatype-update-udims x1.udims basetype)
                 basetype)))
       (cons (change-vl-portdecl base-decl
                                 :name (vl-idtoken->name x1.name)
                                 :loc (vl-token->loc x1.name)
                                 :type type1)
             (vl-build-subsequent-portdecls (cdr x)
                                            base-decl)))))

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

    (defthm vl-portdecllist-p-of-vl-build-subsequent-portdecls
      (b* ((portdecls (vl-build-subsequent-portdecls x base-decl)))
        (vl-portdecllist-p portdecls))
      :rule-classes :rewrite)

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

    (defthm true-listp-of-vl-build-subsequent-portdecls
      (b* ((portdecls (vl-build-subsequent-portdecls x base-decl)))
        (true-listp portdecls))
      :rule-classes :type-prescription)

    Theorem: len-of-vl-build-subsequent-portdecls

    (defthm len-of-vl-build-subsequent-portdecls
      (b* ((portdecls (vl-build-subsequent-portdecls x base-decl)))
        (equal (len portdecls) (len x)))
      :rule-classes :rewrite)

    Theorem: consp-of-vl-build-subsequent-portdecls

    (defthm consp-of-vl-build-subsequent-portdecls
      (b* ((portdecls (vl-build-subsequent-portdecls x base-decl)))
        (equal (consp portdecls) (consp x)))
      :rule-classes :rewrite)

    Theorem: vl-build-subsequent-portdecls-under-iff

    (defthm vl-build-subsequent-portdecls-under-iff
      (b* ((portdecls (vl-build-subsequent-portdecls x base-decl)))
        (iff portdecls (consp x)))
      :rule-classes :rewrite)