Marlin Handbook 🐟
Marlin is a hardware testing framework that just works. It comes as a normal Rust crate, so you don't need build scripts or preprocessing commands. That means:
- Unlike Verilator harnesses, then, you don't need to run a command to generate header and C++ files that you then connect to/run via a Makefile, Ninja, or other build system.
- Unlike cocotb tests, you don't have to use Makefiles or write Python driver code, use fancy decorators on the tests, and lose LSP information for hardware model ports.
Moreover, Marlin core is thread-safe, meaning you can use cargo test/#[test]
for your tests! It integrates perfectly and completely noninvasively into the
existing Rust ecosystem.
Features
Marlin comes with prebuilt integration for (System)Verilog and Spade (with experimental Veryl support), and offers:
- A declarative API for writing tests in plain Rust, treating the hardware
models as normal
structs with fields and member functions (learn more). - A safe procedural API for dynamically constructing bindings to Verilog and interacting with opaque hardware models at runtime (learn more).
- A library for any hardware description language (HDL) that compiles to Verilog to get all of the above.
You can also call Rust functions from Verilog.
Future Work
Planned features include: