Jump to content

Altera Hardware Description Language

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jeroen74~enwiki (talk | contribs) at 22:51, 12 October 2007 (Deleted the content that seems to have been copied from a product folder). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

AHDL is a proprietary Hardware Description Language (HDL) from Altera Corporation for programming their Complex Programmable Logic Devices (CPLD) and Field Programmable Gate Arrays (FPGA). Compiled with Altera's Quartus and Max+ series of compilers, this language has a C programming language-like syntax and similar operation to VHDL.

Example:

% a simple AHDL up counter, released to public domain 11/13/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 brakets 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;