Vl-portdecl
Representation of Verilog port declarations.
This is a product type introduced by defprod.
Fields
- name — stringp
- An ordinary string that should agree with some identifier used in
the "internal" wiring expressions from some port(s) in the
module.
- loc — vl-location
- Where the port was declared in the source code.
- dir — vl-direction-p
- Says whether this port is an input, output, or bidirectional
(inout) port.
- type — vl-datatype
- The type and size information for this port. Warning: per
Verilog-2005 page 175, port declarations and net/reg declarations
must be checked against one another: if either declaration
includes the signed keyword, then both are to be considered
signed. The loader DOES NOT do this cross-referencing
automatically; instead the portdecl-sign transformation
needs to be run.
- default — vl-maybe-expr
- Certain kinds of ports (e.g., those in functions and tasks) can
have default values.
- nettype — vl-maybe-nettypename
- atts — vl-atts
- Any attributes associated with this declaration.
See vl-port for related background. Port declarations,
described in Section 12.3.3 of the Verilog-2005 standard, ascribe certain
properties (direction, signedness, size, and so on) to the ports of a module.
Here is an example:
module m(a, b) ;
input [3:0] a ; // <--- port declaration
...
endmodule
Although Verilog allows multiple ports to be declared simultaneously, i.e.,
input w1, w2;, our parser splits these merged declarations to create
separate vl-portdecl-p objects for each port. Because of this, every
vl-portdecl-p has only a single name.
Most of the time, e.g., for a in module m above, the resulting
vl-module will have:
- A vl-port for a,
- A corresponding vl-portdecl that has the direction/type information, and
- A corresponding vl-vardecl that looks like an ordinary variable.
The exceptions to this are:
- Interface ports have no corresponding port/vardecl.
- The ports/portdecls do not necessarily line up when complex ports are used,
see vl-port for details.
Subtopics
- Vl-portdecl-p
- Recognizer for vl-portdecl structures.
- Vl-portdecl-fix
- Fixing function for vl-portdecl structures.
- Make-vl-portdecl
- Basic constructor macro for vl-portdecl structures.
- Vl-portdecl-equiv
- Basic equivalence relation for vl-portdecl structures.
- Vl-portdecl->nettype
- Get the nettype field from a vl-portdecl.
- Change-vl-portdecl
- Modifying constructor for vl-portdecl structures.
- Vl-portdecl->type
- Get the type field from a vl-portdecl.
- Vl-portdecl->name
- Get the name field from a vl-portdecl.
- Vl-portdecl->default
- Get the default field from a vl-portdecl.
- Vl-portdecl->loc
- Get the loc field from a vl-portdecl.
- Vl-portdecl->dir
- Get the dir field from a vl-portdecl.
- Vl-portdecl->atts
- Get the atts field from a vl-portdecl.