gitwtfhub

wtf is duck-rtl?

oniondas/duck-rtl — explained in plain English

Analysis updated 2026-05-18

5PythonAudience · developerLicenseSetup · moderate

TL;DR

A tool that lets AI coding agents write hardware chip design code (Verilog) and automatically checks it against a reference model instead of trusting the AI's judgment.

Mindmap

mindmap
  root((repo))
    What it does
      Verifies AI written Verilog
      Deterministic gates
      State machine extraction
    Tech stack
      Python
      Verilog
      cocotb
      Icarus Verilog
    Use cases
      Hardware design with AI
      FSM diagrams
      Cheap model reliability
    Audience
      Hardware engineers
      AI agent builders
    Setup
      Claude Code plugin
      Requires Python tools
      Requires Icarus and Graphviz

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Have an AI agent write a hardware circuit design and automatically verify it against a reference model.

REASON 2

Extract and diagram a state machine from Verilog code without manually tracing through it.

REASON 3

Use a cheaper, smaller AI model for hardware design work since the deterministic checks catch mistakes.

REASON 4

Plug the tool into Claude Code as a plugin with dedicated commands for the build and verify loop.

What's in the stack?

PythonVerilogcocotbIcarus VerilogGraphviz

How it stacks up

oniondas/duck-rtl1ncendium/aibusteraaronmayeux/ha-hurricane-tracker
Stars555
LanguagePythonPythonPython
Setup difficultymoderatemoderateeasy
Complexity3/52/5
Audiencedeveloperops devopsgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires Python plus system tools Icarus Verilog and Graphviz installed separately, not through pip.

Wtf does this do

Duck RTL is a tool that helps AI coding agents write and check hardware description code called Verilog, which is used to design digital chips and circuits. Writing this kind of code is easy for an AI model to get subtly wrong, so Duck RTL wraps the process in a series of automatic checks instead of trusting the model's judgment at each step. The workflow starts with the agent writing a reference model in Python describing how a piece of hardware should behave, then writing the actual Verilog for it. Duck RTL runs a syntax check on that Verilog, then runs a simulation test using a testing framework called cocotb to compare the Verilog's behavior against the Python reference. If a module has internal states that change over time, called a state machine, Duck RTL can also extract that state machine from the code and turn it into a diagram, without the model having to describe the structure from memory. The README stresses that every one of these checks is a deterministic tool, not a guess by the AI model, which is why even a smaller and cheaper model can work through the whole process reliably. As proof, the author says a minimal GPU design was built and verified using Claude's lowest cost model tier through this same loop. It installs as a plugin for Claude Code with two new commands: one that runs the full write, check, and verify loop, and one that turns a Verilog file into a diagram of its state machine. It can also run outside Claude Code as a plain command line tool for other coding agents, as long as Python and a couple of external hardware tools, Icarus Verilog and Graphviz, are installed on the system. The README lays out a strict order of operations: define the module structure first, then for each module write the reference model, write the Verilog, run the syntax check, then run the simulation, and only after that extract and check the state machine if the module needs one.

Yoink these prompts

Prompt 1
Install duck-rtl as a Claude Code plugin and use it to build a simple counter module in Verilog.
Prompt 2
Use duck-rtl to extract and diagram the state machine in this Verilog file.
Prompt 3
Walk me through the ledger, scaffold, check, and sim steps duck-rtl expects for a new module.
Prompt 4
Explain what tools I need installed on my system before duck-rtl can run its simulation step.

Frequently asked questions

wtf is duck-rtl?

A tool that lets AI coding agents write hardware chip design code (Verilog) and automatically checks it against a reference model instead of trusting the AI's judgment.

What language is duck-rtl written in?

Mainly Python. The stack also includes Python, Verilog, cocotb.

How hard is duck-rtl to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is duck-rtl for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.