• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
  • Parse-ports

Creating-portdecls/vardecls

Utilities for the initial creation of port declarations and (if the port declaration is complete) corresponding net declarations.

The creation of port declarations and net declarations is very subtle. See also portdecl-sign and make-implicit-wires.

From Verilog-2005, page 174:

  • If a port declaration includes a net or variable type, then the port is considered completely declared and it is an error for the port to be declared again in a variable or net data type declaration...
  • If the port declaration does NOT include a net or variable type, then the port can be declared again in a net or variable declaration. If the net or variable is declared as a vector, the range specification between the two declarations shall be identical.

So if the parser encounters a port declaration with a net or variable type, the port is completely declared and we are going to generate both (1) a port declaration and (2) the corresponding net declaration.

However, if we have no net type, then we'll instead only add the port declaration, which we will mark with the attribute VL_INCOMPLETE_DECLARATION. The corresponding net will either be found later in the module, or will be added automatically with the make-implicit-wires transform. Signedness is handled last, by portdecl-sign.

Subtopics

Vl-make-ports-and-maybe-nets
Top level routine for creating proper port and variable declarations.
Vl-parsed-port-identifier-p
Temporary structure created during port parsing.
Vl-build-netdecls-for-ports
Main loop for creating the associated vl-vardecls.
Vl-build-portdecls
Main loop for creating real vl-portdecls.
Vl-parsed-port-identifier-list-from-idtokenlist
Convert idtokens into trivial vl-parsed-port-identifier-ps.
Vl-parsed-port-identifier-list-p
(vl-parsed-port-identifier-list-p x) recognizes lists where every element satisfies vl-parsed-port-identifier-p.