Hierarchy
In the lower-level source: (optional)
1. Identify lower-level I/O Ports (signals) with an Interface statement
In the top-level source:
2. Declare the lower-level source with an Interface declaration
3. Instantiate the lower-level source with Functional_block declarations.
You identify an ABEL-HDL source's input and output ports with an Interface
declaration directly following the Module statement. The Interface statement
defines the ports in the lower-level source that are used by the top-level source.
You must declare all input pins in the ABEL-HDL source as ports. You can
optionally specify default values of 0, 1, or don't-care.
You do not have to declare all output pins as ports. Any undeclared outputs
become no-connects or redundant nodes. Redundant nodes can later be removed
from the designs during post-link optimization.
The following source fragment is an example of a lower-level interface
statement.
To specify signal attributes:
Attributes specified for pins in a lower-level source are propagated up to the
higher-level source. For example, a lower-level pin with an 'invert'
attribute affects the higher-level signal wired to that pin, its preset, reset,
preload, and power-up value.
Output Enables (OE)
Connecting a lower-level tristate output to a higher-level pin results in the
output enable being specified for the higher-level pin. If another OE is
specified for the higher-level pin, it is flagged as an error. Since most tristate
outputs are used as bidirectionals, it might be important to keep the
lower-level OE.
Buried Nodes
Buried nodes in lower-level sources are handled as follows:
Dangling
Lower-level nodes that do not fanout are propagated to the higher-level source
and become dangling nodes. Optimization may remove dangling nodes from the
lower-level source.
Combinational
Combinational nodes in a lower-level source become collapsible nodes in the
higher-level source.
Registered
Registered nodes are preserved with hierarchical names assigned to them.
To instantiate the source declared above, add an interface declaration and
signal declarations to your top-level declarations, and port connection equations
to your top-level equations as shown in the source fragment below:
Hierarchy and Test Vectors (PLD JEDEC Simulation)
Note: A source can be referenced (“instantiated”) more than once. Also, a source can be both a lower-level and a top-level
source.
Caution: In a hierarchical design, you can’t Instantiate a top-level source from a source instantiated below that source.
Note: Hierarchy declarations are not required when instantiating an ABEL-HDL
source in a schematic. For instructions on instantiating lower-level source in
schematics, refer to your schematic reference.
Instantiating a Lower-level Source in an ABEL-HDL Source
interface (a=0, [d3..d0]=7 -> [z0..z7]) ;
title 'example of lower-level interface statement ' ...
low1 FUNCTIONAL_BLOCK lower ;
zed0..zed7 pin ; "upper-level outputs
atop pin ; "upper-level input
d3..d0 pin ; "upper-level inputs
EQUATIONS
low1.a = atop; "wire this source's inputs
low1.[d3..d0] = [d3..d0] ; " to lower-level inputs
[zed0..zed7] = low1.[z0..z7]; "wire this source's outputs to
" lower-level outputs
See Also