a hardware programming language - ahpl
DESCRIPTION
Descripción del lenguaje de programación AHPLTRANSCRIPT
-
AHPL (A HARDWARE
PROGRAMMING LANGUAGE)
-
Introduction HDL should have two capabilities, Simulation
and Synthesis.
Once the circuit described in an HDL is synthesized, the schematic of the circuit is generated which is used by the cad user.
Synthesis from VHDL doesnt produces optimum schematics. Even all simulation model in VHDL are not synthesizable. The alternative is to use a language that is designed for synthesis and yet posses all the power of VHDL.
AHPL is used for this purpose
-
VHDL synthesis subset can be described in AHPL at the same level of abstraction.
AHPL is a clock mode register transfer level language with the register as a primitive circuit element.
For compilation of AHPL codes, a hardware compiler is needed who is capable of generating a wire list specifying the inter connection of available integrated circuits and a functional simulator which interprets the AHPL description and executes the connection and register transfer.
-
Some HDLs
CDL: Computer Design Language
DDL: Digital System Design Language
ISP: Instruction Set Processor.
AHPL: A Hardware Programming Language.
Verilog
VHDL
The first four were developed at Academic institute and was used mainly by academia.
-
AHPL SYNTAX
Variables: Variables in AHPL can be upto 20 characters. First character must be alphabetic and the remaining may be alphabetic or numeric.
For example: Count, Bus..
Constant: Bit vector are inserted between two backslash separated by a comma (,).
For example: \0, 0, 0, 1, 1\
Its decimal value is equal to 3.
-
Function Symbol Example
AND &, A B
OR +, A B
XOR @ A @ B
ALL BITS OR +/, / A +/ B
ALL BITS AND &/ , / A / B
ENCODE $ 5$13=/0, 1, 1,0,1/
TRANSFER A B
BRANCH (3)
COMPLEMENT
ROW CONCATENATE ! A!B
COLUMN CONCATENATE , A,B
CONNECTION = Z=B
OPERATORS
-
Relational Operator in AHPL Sl. No Operation Symbol
1. Not Equal to NE
2. Equal to EQ
3. Greater Than GT
4. Greater than or Equal to GE
5. Less Than LT
6. Less Than or Equal to LE
-
Branch Operations in AHPL:
Unconditional Branch
(Destination)
Multiple Branch (expression)/(Destination)
Branching with conditional operation Operator(Operand1, Operand2) / (Dt.)
*Dt.= Destination
-
Selection Operator for Vector and Matrix:
Sl. No RTL Notation
Meaning AHPL
Notations
1. Aj Jth
Column of A A[j]
2. Am:n Column m to n
of A
A[m:n]
3. Aj Jth row of A A
4. Am:n Row m to n of A A
5. A,B Column
Catenation
A, B
6. A!B Row Catenation A!B
-
Standard Function in AHPL:
Sl. No Description Symbol
1. Addition ADD(X;Y)
2. Increment INC(X)
3. Decode DCD(X)
4. Decrement DEC(X)
5. Comparison COMPARE(X:Y)
6. Associate ASSOC(X:Y)
-
Clocked Transfer between Register:
Unconditional transfer of source register F to destination register R is represented by
RF
It is assumed that the size of source register and destination register is always same. The arrow pointing in the left denotes a register transfer operation in AHPL.
Conditional Transfer
a. One destination register R and several source register F1, F2, F3
R(F1!F2!F3)*(a, b, c)
-
Clocked Transfer b/w Register Contd.
b. One source register F and several destination register R1, R2, R3.
(R1!R2!R3)*(a, b, c)F
c. Several source register F1, F2, F3 and several destination register R1, R2, R3
(R1!R2!R3)*(a, b, c) (F1!F2!F3)*(d, e, f)
The asterisk on the right specifies the conditional selection of a vector to be transferred into a target register.
-
AHPL Programming A complete AHPL description of a system consists of Combinational Logic Units (CLUnits) and Module similarly as Entity Declaration and Architecture body in VHDL. Each module partitions the design into control and datapath sections. AHPL module consists of a number of register transfer and\or bus connection that take place in individual control steps. Module Declaration: Module description consist a sequence of steps specifying data transfer and or connection. The syntax for module declaration is: AHPL Module: Module_Name For Example: AHPL Module: Counter AHPL Module : FullAdder
-
Type Declaration It is used to declare data types including input and outputs. In AHPL types are little different as we had BIT, Integer, Real, etc. in VHDL.
1. MEMORY
2. INPUTS
3. OUTPUTS
4. BUSSES
5. EXINPUTS
6. EXOUTPUTS
7. EXBUSSES
8. CLUINTS.
-
Types Contd MEMORY, BUSSES AND CLUNITS are local
symbols. Their scope are limited to the module they are declared.
INPUTS and OUTPUTS are semi-local symbols. EXINPUTS and EXBUSSES are global symbols and can be valued externally and are common to all modules.
EXINPUTS and EXOUPUTS are external input and external output of the circuit. The syntax for type declaration is
TYPE: symbol [m];
-
In the above syntax, n and m are integer that indicates the number of rows and columns of the type. If n or m are 1 they can be eliminated. Some examples of type declaration
MEMORY: AC1[4]; AC2[4]; Busy.
EXINPUTS: DATAREADY.
CLUNITS: INC[2]; ADD[5].
-
Control sequence
The control sequence consist of a list of steps, each steps starting with a number followed by valid operation separated by semicolon. If two or more instruction are separated by a semicolon they will be executed on the same clock cycle.
-
AHPL-VHDL Mapping AHPL Description VHDL Description
MODULE: ADDER Entity adder is
EXINPUTS: A; B; C. Port(A, B, C: In bit;
EXOUTPUTS: SUM; CARRY. SUM, CARRY: Out bit);
. End adder;
ARCHITECTURE Dataflow OF
ADDER is
BODY SEQUENCE begin
END END Dataflow;
-
Handling memory array in AHPL Sometime it is required to select a word from a
memory array such as RAM. The write operation can be described by using the conditional transfer notation as explained below:
RAM*DCD(AR) MD
Here MD is the memory data register and AR is the address register. The content of memory data register is transferred to RAM memory at address AR. Similarly the following notation is used to read data from RAM memory.
MD RAM*DCD(AR)