Compilers for accelerator design languages (ADLs) translate high-level languages into application-specific hardware. ADL compilers rely on a hardware control interface to compose hardware units. There are two choices: static control, which relies on cycle-level timing; or dynamic control, which uses explicit signalling to avoid depending on timing details. Static control is efficient but brittle; dynamic control incurs hardware costs to support compositional reasoning. Piezo is an ADL compiler that unifies static and dynamic control in a single intermediate language (IL). Its key insight is that the IL's static fragment is a refinement of its dynamic fragment: static code admits a subset of the run-time behaviors of the dynamic equivalent. Piezo can optimize code by combining facts from static and dynamic submodules, and it opportunistically converts code from dynamic to static control styles. We implement Piezo as an extension to an existing dynamic ADL compiler, Calyx. We use Piezo to implement an MLIR frontend, a systolic array generator, and a packet-scheduling hardware generator to demonstrate its optimizations and the static-dynamic interactions it enables.
翻译:加速器设计语言(ADL)的编译器将高级语言转换为专用硬件。ADL编译器依赖硬件控制接口来组合硬件单元,目前有两种选择:静态控制(依赖周期级时序)和动态控制(使用显式信号避免依赖时序细节)。静态控制高效但脆弱,动态控制则需要硬件开销以支持组合推理。Piezo是一款ADL编译器,它在单一中间语言(IL)中统一了静态与动态控制。其关键洞察在于:IL的静态片段是动态片段的精炼——静态代码仅允许动态等价代码运行时行为的子集。Piezo通过结合来自静态与动态子模块的事实优化代码,并机会性地将代码从动态控制风格转换为静态控制风格。我们将Piezo作为现有动态ADL编译器Calyx的扩展实现,并利用Piezo实现MLIR前端、脉动阵列生成器及数据包调度硬件生成器,以展示其优化能力及启发的静态-动态交互。