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

Limitations

The above semantics show some inherent limitations of C as a hardware description language. At the most basic level, C is defined with a general memory and computation model that does not hold for hardware. This leads to difficulties implementing, for example, pointer arithmetic. Its operator and type set are over-rich for the target; also, ingrained conventions of C coding (the use of strings and char *) are essentially meaningless in a hardware context.

More serious, though, is the lack of a timing grammar to define input/output behavior. These constraints must be specified in some manner outside the scope of the language, or by strong reliance on the inherently synchronous definition of our looping constructs. We would prefer to eliminate the notion of external visibility at sequence points and allow flexible unrolling, retiming, register insertion/deletion, and other sequence optimizations subject only to user-defined time/cycle contraints. This requires some external timing specification in addition to the C source.

Also, function calls are very inflexible models of hardware. The single return value restriction is especially difficult. This can in large measure be alleviated by moving to an object-oriented programming language/style; this is discussed further in section 6.

Other limitations are specific to the current implementation, although many are likely to be found in most or all implementations of these semantics. Floating point math is extremely expensive in hardware and very difficult to do combinationally, as our semantics mandate. Therefore we have omitted support for floating point types in our implementation.5

Integer addition and subtraction are easy, but multiplication and division are, again, very expensive to perform combinationally. Division is not supported in this implementation, but multiplication is, with the warning that it is not generally a good idea.

This implementation does not attempt to support arrays and pointer arithmetic in any form, although the previous section suggested ways in which it might be done. Similarly, there is no support for static variables in this implementation, for reasons of simplicity only.


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