next up previous
Next: Semantics of C HDL Up: Silicon C: A Hardware Previous: Silicon C: A Hardware

Hardware Description Languages

The two most common hardware description languages used are VHDL (the Very High Speed Integrated Circuit -- VHSIC -- Hardware Description Language) [8] and Verilog [12]. These are roughly equivalent: VHDL is mandated for Department of Defense work, while Verilog is more common in industry [2].

David Galloway writes:

There is one compelling reason why a C language based hardware description language may prove successful: there are millions of C programmers in the world who might be quick to adopt the language. This is in contrast to the agony suffered by a C programmer trying to learn moden hardware description languages such as VHDL or Verilog. [4]

In Galloway's FPGA synthesis context, other benefits of C as an HDL are evident as well; flexible codesign/partitioning and integrated simulation foremost. In the FPGA-coprocessor context, it is very useful to be able to swap out arbitrary portions of a C-coded application to be compiled into custom hardware for speed. If the C program expresses the entire application process, a conventionally-compiled executable of identical sources may be used for debugging or execution on a machine without an FPGA coprocessor.

These properties prove desirable for more general hardware targets. In developing an application-specific integrated circuit or custom DSP, for example, it is very useful to be able to completely simulate both the hardware and the driving software in the same framework during development. This is facilitated by using a single general purpose language for application software and hardware description. Similarly, if testing of the preliminary design proves unsatisfactory, it is convenient to be able to repartition the software/hardware division of the system without having to recode portions of the combined model. 1

The main drawback to such an approach is the expressivity of C. It is desirable to obtain a straight-forward mapping between specification and hardware synthesis, but C contains several features which prove difficult to support on a hardware target. It may be noted, however, that C is not alone in this regard: both VHDL and Verilog contain ``unsynthesizable'' language constructs, as well. There is an IEEE working group (1076.3) charged with the creation of a standard synthesizable subset of VHDL; it is not unreasonable for us to define a similar subset of C for use with hardware targets.

In other cases, however, a superset of C's semantics seems warranted. The particular case this paper will address concerns non-standard bit-width integer types. In synthesis contexts, it is often known at specification time exactly how wide the representation of a given signal need be. Using a 16- or 32-bit C datatype to represent a 12-bit datapath seems wasteful, foreboding an inefficient translation to hardware. It appears that we ought to define an int12_t type for this case to correspond to C's standard int8_t, int16_t and int32_t types. We have resisted the temptation to add features to C, in order to preserve the ability to compile and simulate a unified hardware/software model with standard C tools.2


next up previous
Next: Semantics of C HDL Up: Silicon C: A Hardware Previous: Silicon C: A Hardware
C. Scott Ananian
1999-09-01