Creating Better Hardware Generation Tools
Enabling agile hardware design requires solving two problems: how to provide a light-weight environment where designers can experiment at a high level to explore the solution space; and how to build a tool chain that can rapidly generate an implementation of a design choice. The key to solving both issues is creating clean design abstractions, which makes it possible to embed knowledge about optimization into the tools, enabling one to leverage other people’s tools and expertise. We plan to do this by investigating new programming language, compiler and system techniques that will aid in the development of effective hardware generation tools.
CoreIR is a hardware intermediate representation, as well as a compiler toolchain to allow for the rapid development of specific hardware compilers. It can be viewed as LLVM for hardware. As such, CoreIR is envisioned to be the "skinny middle" that can consume any hardware description language, and target any backend (e.g. ASIC or FPGA). CoreIR provides a set of core hardware primitives, but is designed to be extendable and flexible. This allows developers to leverage the fundamental abstractions and routines in CoreIR, while injecting target (or language) specific optimizations. Also, CoreIR was designed to be compatible with SMT BitVector semantics, allowing for natural integration with formal verification tools.
Magma is a hardware description language embedded in python. A key feature of Magma is the ease of metaprogramming -- writing a program that emits a hardware description. In the hardware community, these are referred to as generators. The fundamental abstraction in Magma is a circuit, which is analogous to modules in verilog. Because of the fundamental design abstractions and the fact that it is strongly typed, any valid Magma program is guaranteed to be synthesizable. Magma's approach to hardware design makes it possible to create higher-level domain-specific languages (DSLs) that produce hardware circuits. Examples include languages for finite state machines, memory controllers, image and signal processing, and even processors.
Gemstone is a novel hardware generator framework that makes it easy to design configurable and re-usable hardware components. Gemstone represents hardware modules as python classes, which unlocks the full object-oriented programming capabilities of python. Furthermore, generators in Gemstone can be written in a staged manner, wherein different levels of detail of the hardware can be elaborated over time. This can be contrasted with a top-down generator, in which all information needs to be known ahead of time and is propagated in one direction. Using Gemstone we can show how to design a chip for testing, tape-out, and application programming within the same flow.