Metaprogramming with Combinators
summary
Haskell generators use quasiquotation and a mixed shallow/deep embedding plus a MonadCg codegen monad and scoped combinators to emit VHDL for Xilinx FPGAs. A 16-stage incrementer pipeline (serial vs parallel) is generated and measured against Clash and Kansas Lava; the combinator implementation produces the lowest LUT/FF counts and highest f_MAX, at the cost of about twice the LOC. Combinators gensym loop vars, tailor handshake protocol precisely, and produce runnable Haskell instances via shallow embeddings.
AI-written summary · about
chapters (10)
- 0:00Intro
- 0:15Metaprogramming with what?
- 2:30Hardware Pipelines
- 4:24But we can already generate hardware from Haskell!
- 5:24Motivating Example: Multi-stage Incrementer
- 7:49Multi-stage Incrementer Performance
- 10:14Running MWC Circuits (in Haskell)
- 10:53Running MWC Circuits as Haskell
- 11:56Implementation of piter (VHDL)
- 14:17One more metric...
related talks
24mSeamless Code Generator Synchronization in the Composition of Heterogeneous Modeli...
40mAn Introduction to Combinator Compilers and Graph Reduction Machines
27mClash: Haskell as an HDL
33mLightning Talks II
17mGenerating Circuits with Generators
17mQGAT: A Generate-and-Test Paradigm for Quantum Circuits
01h 06mMicroHs, a tiny Haskell Compiler
15mStaged Selective Parser Combinators
