Altera Home Page
文档资料 许可
在线购买 下载

  主页   |   产品   |   支持   |   最终市场   |   技术中心   |   教育与活动   |   公司介绍   |   在线购买  
  mySupport   |   器件   |   软件   |   IP   |   设计范例   |   参考设计  

 产品
      MAX/MAX II
      Stratix/Stratix GX
      Nios II
  
 功能
      算法
      存储器
      总线及I/O
      逻辑
      接口与外设
      DSP
      通信
      PLL & Clocking
  
 设计输入方法
      Quartus II软件工程
      Tcl
      VHDL
      Verilog HDL
      C Code 范例
      DSP Builder
      TimeQuest
   片内调试
  
 仿真工具
      Mentor Graphics ModelSim
      Cadence NCsim
      Synopsys VCS
  
 旧范例
      图形编辑器
      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.

  请填写反馈意见
  注册索取最新邮件通知