Handel-C is a language related to C and Occam, designed for the purpose of translating programs directly into hardware. Handel-C was available and in use about 10-20 years ago, I'm not sure whether anybody still uses it now. Originially developed and sold by Celoxica, the DK Design Suite product which includes an implementation of Handel-C has since been aquired by Mentor Graphics.
Although Handel-C allowed more-or-less direct compilation of ANSI-C programs to hardware circuits, the resulting circuits were seldom very good. More usually, Handel-C and the associated IDE served as a rapid development language and environment, in which a programmer could directly write parallelised, pipelined Handel-C programs which would result in a reasonably efficient circuit. It was also possible to use it to gradually refine an ANSI-C program into a form more suitable for hardware implemention.
The subset of Handel-C that I am working on is called 'Small-HC'. It supports some of the features of Handel-C, and more will be added over time. The following features are currently supported:
- 'unsigned' variables with specified width - generally these correspond to registers in the resulting circuit
- 'signal' qualifier to indicate that a variable represents a wire rather than a register.
- Internal RAM (on-FPGA) and external RAM (connected via device pins)
- 'par' and 'seq' constructs for parallel and sequential composition of statements
- Input ports, through which specified FPGA pins can be connected to signals
- Output ports, through which variables can be connected to FPGA pins
- Currently no direct support for multiplication,division,modulus
A short example program for flashing an LED (very quickly) is shown below:
unsigned 1 testbit;
port output(testbit) (163); // 163 is the output pin number on the FPGA
void main(void)
{
while(1)
{
testbit = 0;
testbit = 1;
}
}
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.