一句话:提出 YieldFSM 硬件描述语言,用生成器抽象表示时钟级时序,并编译为 Mealy 机,在 RTL 与 HLS 之间提供折中。
数字硬件设计主要采用 RTL 与 HLS 两类方法:RTL 需逐一指定每个组件,控制力强但细节繁琐;HLS 抽象掉硬件细节,却因同时抽象掉时钟而无法覆盖一类设计问题。本文提出硬件描述语言 YieldFSM,用生成器抽象表示电路中的时钟级时序,在 RTL 与 HLS 之间提供折中:抽象层次高于 RTL,又因显式保留时钟级时序而适用于传统 RTL 场景。其编译器借助函数式编程社区的方法,包括 CPS 变换与去函数化,将 YieldFSM 程序转换为 Mealy 机,并用 Template Haskell 与 Clash 实现。作者表明该方法可写出简短且概念简单的硬件描述。
The most widely used languages and methods used for designing digital hardware fall into two rough categories. One of them, register transfer level (RTL), requires specifying each and every component in the designed circuit. This gives the designer full control, but burdens the designer with many trivial details. The other, the high-level synthesis (HLS) method, allows the designer to abstract the details of hardware away and focus on the problem being solved. This method however cannot be used for a class of hardware design problems because the circuit's clock is also abstracted away. We present YieldFSM, a hardware description language that uses the generator abstraction to represent clock-level timing in a digital circuit. It represents a middle ground between the RTL and HLS approaches: the abstraction level is higher than in RTL, but thanks to explicit information about clock-level timing, it can be used in applications where RTL is traditionally used. We also present the YieldFSM compiler, which uses methods developed by the functional programming community -- including continuation-passsing style translation and defunctionalization -- to translate YieldFSM programs to Mealy machines. It is implemented using Template Haskell and the Clash functional hardware description language. We show that this approach leads to short and conceptually simple hardware descriptions.