Okay let’s be honest, nobody strives for slow in the computing world. We want fast computers, fast chips, and fast time to market, all while eating fast food. Field-programmable gate arrays (FPGAs) have been actively used since the mid-80s for the purpose of hardware acceleration. Speed! Unfortunately, one aspect of FPGAs has not been accelerated: compilation. Compiling FPGA programs is painfully slow. FPGAs are programmed using hardware description languages (HDLs). Although similar to software programming languages they differ in both the scope of the language and the output of the compiler. FPGA compilers need to produce a complex set of layout instructions and connections for a reconfigurable circuit board. Not a simple task. In fact, it’s NP complete!
VMware Researchers Eric Schkufza and Michael Wei wondered if applying the principals behind just-in-time compilation could help reduce the latency of FPGA development. It turns out it can! A proof of concept has been completed, and exciting possibilities have grown out of the initial work. Cascade is now a VMware open source tool which is available to everyone.
How does Cascade work? Starting with a Verilog source file, Cascade generates many smaller Verilog programs that in aggregate have the same semantics as the original program. Cascade then determines which of these smaller programs (specifically those that correspond to I/O peripherals such as LEDs) must be placed on the hardware immediately and loads them from a standard library on to the FPGA. In the meanwhile, the remainder of the programs are interpreted in software. Over time, these programs are compiled to hardware, and when the process is complete they are swapped onto the FPGA as well. A cascading effect. From the developer’s point of view, the code runs immediately and simply gets faster over time. No more waiting endlessly for your code to compile; a significant improvement over the state of the art!
Even if you are not interested in saving development cycle time, there are other advantages to using Cascade. Cascade currently supports software-style printf-debugging and will soon offer users the ability to take advantage of runtime-specific data-dependent optimizations. In the future, Cascade may also find use in the hypervisor. Supporting VMotion for VMs that use FPGAs is a known hard problem. But by using Cascade as the mechanism for providing a VM access to an FPGA, it may be possible to move a program from hardware back into software, move the software pieces from one host to another, and then back down into hardware in the new location.
To try Cascade out, visit us on GitHub, https://github.com/vmware/cascade.