Compiling hardware using Handel C code

Future Shooters: Technology that removes the divide between software and hardware promises new opportunities to programmers....

Future Shooters: Technology that removes the divide between software and hardware promises new opportunities to programmers. Fiona Harvey visits the UK firm leading the way

Software engineers build software; hardware engineers build hardware; and never the twain shall meet, except maybe for a quick beer after work. That is the unwritten rule - and it works fairly well, until companies realise the gains that could be made from combining aspects of software and hardware development.

The gains are largely the result of the rapid take-up of a new form of chip architecture, field programmable gate array (FPGA) chips. These contain hundreds of thousands of logic gates that can be configured to create whatever digital circuit is required, so the same processor can be made into an audio chip or a video chip or a games chip, depending on the application.

FPGA chips have become increasingly popular as an alternative to application specific integrated circuits that power networking and telecoms technology, as well as some handheld devices.

This was revolutionary for chip designers, who were used to elaborately working out every aspect of their design before having it set in hardware - at which point there is no going back, and if bugs are discovered they really are showstoppers.

Software engineers, in contrast, are used to rebuilding their work dozens of times a day as they tweak parts of the code and check for and fix bugs. There are few engineers who boast equal proficiency in both disciplines, and hardware engineers tend to be highly paid specialists.

If chips are suddenly programmable, then surely they can be tweaked just like software? Well, not quite, but the idea is interesting enough for an Oxfordshire-based company, Celoxica, to experiment with a method of melding software engineering and hardware engineering to the benefit of both.

Celoxica's product allows software written in the common development language C to be rendered on an FPGA chip. Which means that software engineers can suddenly cross from their own discipline and jump into the previously inaccessible world of hardware design.

The Celoxica DK1 Design Suite has as its centrepiece Handel C, based on the ubiquitous Ansi/ISOC programming language, but extended specifically to cater for hardware development.

Mat Newman, senior vice-president for technology at Celoxica, said, "People are being asked to design a chip that is getting bigger and bigger, while the productivity gains of design tools [for chips] is growing only at about 20% a year, so there was a growing gap between what people were being asked for and the tools they were being given to do the design with."

With older models of chips, designers would have to deal with tens of thousands of logic gates, more or less by hand.

"When you get up to modern chips with millions of gates, it is not feasible to do the design work manually without risking introducing lots of errors, and taking an inordinate amount of time over the design," said Newman. "So you needed new development tools."

Speed gains in running programs can also be made by running more of the application in the hardware, rather than in the software. If software engineers could put part of their program into dedicated hardware, they could quickly realise greatly improved performance - a principle that could apply to a wide variety of applications.

Handel C combines aspects of software and hardware design to bring productivity gains. For instance, in hardware, processes can be completed more quickly than they normally can in software because they can be performed in parallel, with several running simultaneously and the results collated later. This is difficult to achieve in software programming - the sequential nature of the C language does not map very well to parallelism. The most important aspect of Handel C is that it deals with parallelism.

Another advantage of Handel C is its ability to deal with time. Standard C does not contain a notion of time, but to implement hardware effectively a notion of time is essential. Handel C's timing gives designers complete control over what happens in each clock cycle on the chip.

Existing technologies for hardware design generally involve hardware description languages that give the designer built-in mechanisms describing timing and parallelism. Celoxica's design suite also lets developers run simulations, displaying the state of each software variable for each clock cycle, so they can test for bugs easily many times before they have to commit any designs to silicon.

These tools have opened up an accelerated model of software development, said Newman. "It gives software guys access to new processing devices," he said.

Cisco is the biggest user of FPGAs in the world today. Using Celoxica's software-based approach, the network equipment specialist's engineers could develop products four to 10 times faster than they do using a traditional hardware-based design approach.

Cisco is currently evaluating the Celoxica products. The company should have more incentive to use the software now that it has initiated extensive staff cuts, Newman suggested. "They'll want to get the best productivity they can out of their remaining engineers."

Celoxica's biggest customer so far is Marconi, and Siemens, Ericsson, Matra and other manufacturers are all testing Handel C.

One company that has satisfactorily completed a pilot project using the new tools is Creative Technology, the entertainment hardware specialist. Two software engineers from Creative were set the task of taking an audio processor that had already been completely designed in software and making into a hardware audio processor - in other words, taking a software program and making it into a chip. Neither had any experience in chip design. They completed the task within seven weeks.

Michael Songy, who was one of Creative's pilot designers, said, "The language was very familiar, and so it was very easy to get up to speed quickly.

"The purpose of the exercise was to see if a software engineer who had never designed hardware before could use this methodology and come out with a usable hardware product at the other end. We proved that it did indeed work, and so could provide a whole new methodology for hardware design."

Songy is evidently delighted by his transformation into a hardware designer. "I was really excited - I never would have thought I was capable of designing a chip." In fact, he likes it so much that he left Creative to work for Celoxica.

Although programmable gate arrays will not compete with the likes of Intel and AMD in the arena of general processing, they will play an increasing role in mainstream computing as audio and video come to the average desktop.

As Songy's experience shows, the introduction of Handel C to develop hardware promises to accelerate the development of these technologies and open them up to a pool of talent previously confined to software design.

Fiona Harvey writes for the Financial Times and is a former editor of PC Week

Read more on Business applications