Interface Keyword (lower-level source)
Syntax
MODULE module_name
INTERFACE (input/set[=value] -> output/set [:> bidir/set]);
module_name - The standard module statement for the ABEL-HDL source.
signal/set - Signals or sets in the lower-level module used as ports to top-level modules. Use -> and :> to indicate the direction of each port of a functional block. Use commas to separate groups of signals
value - The default value for the port for input signals only. Default values do not apply to output and bidirectional signals.
Purpose
The interface declaration is optional for lower-level modules. Use the interface declaration in lower-level modules to assign a default port list and input values for the module when instantiated in top-level ABEL-HDL sources. If you use the interface statement in an instantiated module, you must declare the signals and sets in the top-level source in the same order and grouping as given in the interface statement in the lower-level module.
Declaring signals in the lower-level module, although optional, does allow the compiler to check for signal declaration mismatches and therefore reduces the possibility of wiring errors.
Declared Signals
Declared signals can be a list of lower-level pins, sets or a combination of both. The following constraints apply to the different signal types:
Signal Type Constraints
Output Unlisted outputs are interpreted as No connects
(NC). Unlisted, fed-back outputs are interpreted as
nodes in the top-level source following the naming
convention: instance_name/node_name
Bidirectional Listing bidirectional signals is optional, except for
those with output enable (OE). If you specify
bidirectional signals, the compiler checks for invalid
wire connections.
If you do not list some signals of the lower-level module in the interface statement, the following rules apply:
Unlisted Pins Are: The Compiler Interprets Them As:
Outputs No Connects (NC), and they can be removed
Feedback outputs Nodes in the top-level source, following the naming
convention:
instance_name/node_name
Example
The following interface statement declares inputs ce, ar, and clk, (giving default values for two of them) and outputs q3 through q0.
module cnt4 interface (ce=1,ar=1,clk -> [q3..q0]) ;
Specifying default values allows you to instantiate cnt4 without declaring the ce and ar inputs in the top-level source. If you do not declare these inputs, they are replaced with the constants 1 and 0, respectively. Since these constants may affect the optimization, you may need to re-optimize the lower-level source with the constants.
Interface - Declare Lower-level Sources for Hierarchical Designs
Output Enable Control of Lower Level Modules