This example describes how to create a hierarchical design using AHDL. This design is identical to the VHDL and schematic hierarchy examples. The file top.tdf is the top level, which calls the two lower level files bottom1.tdf and bottom2.tdf. The files bottom1.inc and bottom2.inc must be created for the lower level files so that they can be instantiated into the top level. When the project is set to either bottom1.tdf or bottom2.tdf, you can create bottom1.inc and bottom2.inc by choosing Create Default Include File (File menu) in MAX+PLUS II. This step creates the Include Files needed by the top-level AHDL file.
For more information on using this example in your project, go to:
- How to Use AHDL Examples
- Graphic Editor: Creating a Hierarchical Design
- MAX+PLUS II Help
top.tdf
INCLUDE "bottom1"; --File bottom1.inc contains function prototype
--of bottom1.tdf
INCLUDE "bottom2"; --File bottom2.inc contains function prototype
--of bottom2.tdf
SUBDESIGN top
(
q,p,r : INPUT;
z : OUTPUT;
)
VARIABLE
u1 : bottom1; --Instantiates bottom1.tdf
--The same TDF can be instantiated multiple times
u2 : bottom2; --Instantiates bottom2.tdf
BEGIN
u1.a = q; --These lines connect the ports
u1.b = p; --or the u1 and u2 instantiations.
u2.l = u1.c;
u2.m = r;
z = u2.n;
END;
bottom1.tdf
SUBDESIGN bottom1
(
a,b : INPUT;
c : OUTPUT;
)
BEGIN
c = a AND b;
END ;
bottom2.tdf
SUBDESIGN bottom2
(
l,m : INPUT;
n : OUTPUT;
)
BEGIN
n = l OR m;
END ;
bottom1.inc
-- Copyright (c) Altera Corporation, 1996. This file may contain
proprietary and confidential -- information of Altera Corporation that may be used, copied, and
disclosed only pursuant to -- the terms of Altera's Program License Agreement. Altera makes no
claim to any end-user or -- third-party proprietary information that also may be contained in
this file. This notice -- must be contained as part of this text at all times. -- MAX+plus II Include File -- Version 7.0 08/21/96 -- Created: Tue Sep 17 11:00:22 1996 FUNCTION bottom1 (a, b) RETURNS (c);
bottom2.inc
-- Copyright (c) Altera Corporation, 1996. This file may contain
proprietary and confidential -- information of Altera Corporation that may be used, copied, and
disclosed only pursuant to -- the terms of Altera's Program License Agreement. Altera makes no
claim to any end-user or -- third-party proprietary information that also may be contained in
this file. This notice -- must be contained as part of this text at all times. -- MAX+plus II Include File -- Version 7.0 08/21/96 -- Created: Tue Sep 17 11:00:04 1996 FUNCTION bottom2 (l, m) RETURNS (n);
Design Examples Disclaimer
These design examples may only be used within Altera Corporation devices and remain the property of Altera. They are being provided on an “as-is” basis and as an accommodation; therefore, all warranties, representations, or guarantees of any kind (whether express, implied, or statutory) including, without limitation, warranties of merchantability, non-infringement, or fitness for a particular purpose, are specifically disclaimed. Altera expressly does not recommend, suggest, or require that these examples be used in combination with any other product not provided by Altera.
