Jump to content

Altera Hardware Description Language

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by AZ1199 (talk | contribs) at 04:04, 4 February 2016 (top: Quartus is MAX-PLUS' successor). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Altera Hardware Description Language (AHDL) is a proprietary hardware description language (HDL) developed by Altera Corporation. AHDL is used for digital logic design entry for Altera's complex programmable logic devices (CPLDs) and field-programmable gate arrays (FPGAs). It is supported by Altera's MAX-PLUS and Quartus series of compilers. AHDL has an Ada-like syntax and its feature set is comparable to the synthesizable portions of the Verilog and VHDL hardware description languages.

By default Altera tools expect the AHDL source files to have a .tdf extension (Text Design Files).

An advantage of AHDL is that all language constructs are synthesizable. AHDL is to Verilog much as assembly language is to a higher-level programming language: in AHDL, you have more control but less high-level support.

Example

% a simple AHDL up counter, released to public domain 13 November 2006 %
% [block quotations achieved with percent sign] %
% like c, ahdl functions must be prototyped %

% PROTOTYPE:
 FUNCTION COUNTER (CLK)
	RETURNS (CNTOUT[7..0]); %

% function declaration, where inputs, outputs, and
bidirectional pins are declared %
% also like c, square brackets indicate an array %

SUBDESIGN COUNTER
(
	CLK		:INPUT;
	CNTOUT[7..0]	:OUTPUT;
)

% variables can be anything from flip-flops (as in this case),
tri-state buffers, state machines, to user defined functions %

VARIABLE
	TIMER[7..0]: DFF;

% as with all hardware description languages, think of this
 less as an algorithm and more as wiring nodes together %

BEGIN
	DEFAULTS

		TIMER[].prn = VCC; %  this takes care of d-ff resets %
		TIMER[].clrn = VCC;
	END DEFAULTS;

	TIMER[].d = TIMER[].q + H"1";
END;