Altera Home Page
Literature Licensing
Buy On-Line Download

  Home   |   Products   |   Support   |   End Markets   |   Technology Center   |   Education & Events   |   Corporate   |   Buy On-Line  
  Knowledge Database   |   Devices   |   Design Software   |   Intellectual Property   |   Design Examples   |   mySupport   |   Reference Designs  

 Products
      MAX/MAX II
      Stratix/Stratix GX
      Nios II
  
 Functionality
      Arithmetic
      Memory
      Bus & I/O
      Logic
      Interfaces & Peripherals
      DSP
      Communications
      PLL & Clocking
  
 Design Entry
      Quartus II Project
      Tcl
      VHDL
      Verilog HDL
      C Code Examples
      DSP Builder
      TimeQuest
   On-Chip Debugging
  
 Simulation Tools
      Mentor Graphics ModelSim
      Cadence NCsim
      Synopsys VCS
  
 Legacy Examples
      Graphic Editor
      AHDL
  

AHDL: Creating a Hierarchical Design

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:


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);

Feedback

Did this information help you?

If not, please log onto mySupport to file a technical request or enhancement.


Altera does not warrant that this solution will work for the customer's intended purpose and disclaims all liability for use of or reliance on the solution.

  Please Give Us Feedback