Turbostar logo Turbostar

The Three Things Every Agentic Hardware Loop Needs

Coding agents already know how to plan, edit, and iterate. What makes an autonomous hardware loop succeed—instead of flailing on raw CLI logs—are three tool primitives:

  • 1. Objective Measurement (the Scoreboard): A fast, low-noise metric against an explicit goal—target MHz vs. multi-seed median Fmax, line coverage %, formal mutation kill %, post-synthesis toggle rate, or functional pass/fail—so the agent knows unambiguously whether an experiment helped or regressed.
  • 2. Actionable Breadcrumbs (the Direction): A bare score (“42 MHz, FAILED” or “68% coverage”) leaves the agent guessing blindly. Every Turbostar tool runs native C++23 post-tool analysis to emit line-attributed breadcrumbs pointing straight at what to change next—the critical LUT cone, routed wire hotspot, uncovered branch, surviving mutant, or hottest toggling register.
  • 3. Proactive Guardrails (the Tripwires): Tools don’t wait for the human to spot a regression. Routine calls automatically check key invariants—reporting Fmax during compile/synthesis to trigger the timing-tuning loop when frequency drops below target, auditing formal suites for vacuous assume-without-cover or unchecked-output tripwires to trigger a formal-fix loop, and auto-diffing waveforms against .lastpass.vcd with protocol checks to trigger waveform triage.

Thin MCP wrappers just shell out to Verilator or Yosys and hand raw stdout back to the model. Every tool below combines Measure + Breadcrumbs + Guardrails, backed by the built-in AGENTS.md playbook.

# The Sub-Second Hardware Agent Inner Loop
0. One-Time Project Setup (turbostar.json)
   verilog_project_settings(target="ice40", device="hx8k", freq_mhz=75)
   verilog_configure_testbench(scan=true)

1. Edit SystemVerilog RTL
   fs_replace_content / fs_write_file

2. Fast Syntax & Lint Triage (~0.13s)
   verilog_compile(module="cpu", lint_only=true)

3. Focused Unit Testbench (~0.40s)
   verilog_simulate(module="alu8")

4. Full Bottom-Up Tree Regression (Parallel Multi-Core)
   verilog_simulate(hierarchical=true, module="top")

5. Logic Depth, LUT Area & In-Place Port Timing Annotations
   verilog_logic_depth(module="cpu") / verilog_update_timing()

6. Physical Place-and-Route Sign-Off
   verilog_pnr_timing(top_k=3)
Hardware Goal 1. Objective Measurement 2. Actionable Breadcrumbs 3. Proactive Guardrail Trigger
Lint & Synthesis Pass/fail verdict, correctness warning count, cell area, achieved Fmax file.sv:line hazards separated from style notes; latch & comb-loop flags Frequency drop during compile/synthesis triggers the timing-tuning loop
Simulation & Coverage Tiered PASS/FAIL, .lastpass.vcd diff status, per-module line/port coverage % First diverging tick & signal; ranked uncovered line/branch gap list (coverage.md) Auto-diff vs. .lastpass.vcd & AXI/handshake checks trigger waveform debug
Formal & Mutation Unbounded prove/cover verdict; Formal % & Combined % mutation kill rates Counterexample VCDs & mode="gaps" surviving-mutant blind spots with RTL lines Audits for vacuous assume-without-cover & unchecked outputs trigger FV-fix loop
Waveform Debug Zero-toggle inactive net counts & streaming cycle-accurate diffs Enum-decoded FSM states, strobe-qualified buses, opcode labels, vcd_signal_to_code ** dead-net flags & protocol violations immediately spotlight broken wiring
Timing Closure Target MHz vs. multi-seed median Fmax, setup slack, and max LUT depth Pre-PnR LUT depth cones + port annotations, and post-route critical paths mapped to RTL Negative slack or seed-median regression keeps the agent iterating until MET
Dynamic Power Post-synthesis gate_toggles=true weighted tog/cyc (Comb vs. FF) RTL fanout-weighted culprit ranking (Hot Bits) + post-synth hot-line attribution Comb-vs-FF breakdown catches fake “RTL wins” that actually increase gate switching

Dual-Engine Lint & Synthesis Triage

Catch hardware bugs before a single clock cycle is simulated. verilog_compile combines ultra-fast Verilator static linting (lint_only=true in ~0.13s) with full Yosys RTL synthesis checks in a single unified tool.

Measure: Pass/fail verdict, correctness warning count, and synthesized cell area. Breadcrumbs: Exact file.sv:line synthesis hazards (latches, width mismatches, combinational loops) separated cleanly from style notes.

  • Automatic Hierarchy Isolation: Pass module="cpu" and Turbostar automatically scopes the module's hierarchy across the RTL tree, resolves dependencies, and excludes unrelated testbenches—preventing duplicate symbol errors.
  • Structured Diagnostic Reporting: Compiler logs are cleanly separated into synthesis hazards vs. style and unused resource notes (UNUSEDPARAM, UNUSEDSIGNAL, PINMISSING) with exact file.sv:line locations.
  • Fast Inner Loop to Full PnR: Use lint_only=true for lightning-fast sub-second syntax checks during coding, then run full synthesis + nextpnr place-and-route with cell statistics before committing.
# Tool call: verilog_compile(module="cpu", lint_only=true)
# Verilog Lint Report: `cpu`

- Status: PASSED (Lint Only, 0.13s)
- Target Scope: `cpu` (10 of 12 workspace RTL files)
- Diagnostics: 0 correctness warnings, 14 style/unused notes
- Full Log: `tmp://synthesis.log` (68 lines, 5481 bytes)

## Style & Unused Resource Notes (14)
- UNUSEDPARAM (2x) — Parameter not used: 'AC_BIT'
  (src/alu8.sv:43)
- UNUSEDSIGNAL (12x) — Bits not used: 'mem_req_addr'[15:14]
  (src/cpu.sv:30)

Tiered Simulation & Auto-Diffing Waveforms

Hardware verification requires fast inner loops during active debugging and exhaustive sweeps before sign-off. verilog_simulate and verilog_configure_testbench manage testbench execution, line coverage, and waveform history automatically.

Measure: Tiered PASS/FAIL counts, .lastpass.vcd identical/diverged status, and per-module line/port coverage % (coverage=true). Breadcrumbs: Exact first diverging clock tick & signal plus a ranked gap list of uncovered lines and branches in system://verilog/coverage.md.

  • Quick, Comprehensive & Extreme Levels: Classify testbenches by level (level="quick") so the agent runs sub-second unit tests after every edit and full instruction-set regressions before committing.
  • Hierarchical Bottom-Up Verification: Pass hierarchical=true on top modules to automatically compile and run testbenches in parallel across CPU cores in topological dependency order (e.g. decode_mod → alu8 → cpu → top), while automatically detecting and isolating colliding $dumpfile("dump.vcd") paths so parallel runs never clobber each other's waveforms.
  • Automatic Waveform Snapshots & Diffs: Passing runs snapshot .lastpass.vcd while every run preserves .previous.vcd. When a change breaks a testbench, verilog_simulate automatically diffs the new trace against the baseline and reports the exact diverging clock cycle and signal.
# Tool call: verilog_simulate(hierarchical=true, module="top")
## Module Verification Report: `top` (Hierarchical)

- Order: decode_mod -> alu8 -> alu16 -> ... -> cpu -> top
- Level Filter: comprehensive
- Summary: 34 Passed, 0 Failed (out of 34 testbench runs)

| Testbench            | Module     | Result | vs. Previous |
| :---                 | :---       | :---   | :---         |
| `tb/decode_tb.sv`    | decode_mod | PASS   | IDENTICAL    |
| `tb/push_pop_tb.sv`  | cpu        | PASS   | IDENTICAL    |
| `tb/call_ret_tb.sv`  | cpu        | PASS   | IDENTICAL    |
| `tb/lhld_shld_tb.sv` | cpu        | PASS   | IDENTICAL    |

SymbiYosys Formal Verification & Vacuity Checks

Go beyond directed testbenches with verilog_formal, which runs SymbiYosys (sby) bounded model checking, k-induction proofs, and coverability checks directly against SystemVerilog bind property modules in formal/*_props.sv.

Measure: Unbounded prove/bmc/cover pass/fail verdicts and coverpoint hit counts. Breadcrumbs: Inline --> failing assertion source context, automatic vacuity warnings, and ready-to-inspect counterexample VCDs.

  • Zero-Boilerplate Setup: Auto-discovers bind <module> targets in formal/*.sv, resolves transitive RTL submodule hierarchies, stages $readmemh/$readmemb data files, uses Yosys read_slang when available, and auto-detects the fastest installed SMT solver (bitwuzla → yices → z3).
  • Unbounded Proofs, Parameter Overrides & Vacuity Warnings: Default mode="all" runs prove + cover together with per-module timing. Override large counter widths via parameters={"COUNTER_BITS": 4} without editing RTL defaults, and receive automatic Vacuity Risk warnings whenever a proof passes while any cover() is unreachable.
  • Instant Counterexample Triage: Failing assertions display --> source context with the failing step, copy the counterexample trace to wave/formal_<mod>_<task>.vcd, and emit a copy-pasteable vcd_wave(path="...", instance="...") command. Passing coverpoint tables collapse inline while the full report is served at system://verilog/formal.md.
  • Git-Backed Equivalence Checking (mode="git_equiv"): Refactor RTL for timing, area, or power and mathematically prove your working tree is cycle-for-cycle bit-exact equivalent to HEAD (or any git_ref) with zero hand-written *_props.sv required—catching port mismatches up front and saving a counterexample VCD on any divergence.
# Tool call: verilog_formal(module="eightsegment", parameters={"COUNTER_BITS": 4})
## Formal Verification Report (SymbiYosys `smtbmc bitwuzla`, depth=20)

*Config: auto-generated `.sby` (`read_slang`)* — *Parameters: `COUNTER_BITS=4`*

| Module       | Property File(s)             | Task  | Status   | Coverpoints | Time | Counterexample VCD                 |
| :---         | :---                         | :---  | :---     | :---        | :--- | :---                               |
| eightsegment | formal/eightsegment_props.sv | prove | PASS     | -           | 0.5s | -                                  |
| eightsegment | formal/eightsegment_props.sv | cover | PASS     | 6/6 hit     | -    | -                                  |

# On assertion failure, shows exact RTL context + VCD hint:
#### Assertion Failure Context (`register16` / `prove`)
- `assert` failed at `formal/register16_props.sv:41` (step 2)
-->   41:     assert (sp_minus_2 == (value - 16'd2))
- Inspect Counterexample: `vcd_wave(path="wave/formal_register16_prove.vcd", instance="register16")`

Native RTL Mutation Coverage (mutate & gaps)

Passing assertions don’t guarantee your properties actually pin down every bug. verilog_formal includes a native Yosys mutation-testing engine—zero config.mcy boilerplate and no external mcy dependency—that measures both Formal % and Combined % coverage and hands your agent concrete blind spots to fix.

Measure: Noise-filtered Formal % and Combined % mutation kill rates (with Stage-4 equivalence filtering). Breadcrumbs: mode="gaps" early-stops on confirmed non-equivalent surviving mutants with inline file.sv:line RTL snippets.

  • Statistical Overview (mode="mutate") & Smart Submodule Scoping: Injects source-tagged faults via yosys mutate -list, screens them in parallel against sby (assert failures or unreachable cover points both count as formal kills), and auto-scales per-module sample sizes from a persisted timing cache (overridable via // formal: mutations=N). By default, verified child submodules are excluded so parent scores measure the parent’s own logic and submodule glue without double-counting; pass include_submodules=true (or --include-submodules) for full-hierarchy screening, including sim-only top-level CPUs with no *_props.sv.
  • Compile-Once Verilator & Lazy Equivalence Filtering: Formal survivors are screened in parallel by your testbenches compiled once via yosys mutate -ctrl + +MUTSEL=k (prioritizing the highest-yield historical killer testbench first, catching assertion failures, VCD waveform diffs, and stdout diffs), and only remaining survivors go through a bounded miter -equiv check so dead/equivalent mutants never waste agent turns.
  • Actionable Hit-List (mode="gaps") & Line Coverage Loop: Early-stops as soon as max_findings (default 5) distinct, confirmed non-equivalent blind spots are found, printing exact file.sv:line RTL snippets inline (full report in system://verilog/formal_mutation.md). Pair with verilog_simulate(coverage=true) (system://verilog/coverage.md) to clear untoggled ports and strengthen unit testbenches first, then tighten formal/*_props.sv.
# Tool call: verilog_formal(module="alu_mod", mode="mutate")
# CLI:       turbostar-verilog formal mutate -m alu_mod
## Formal Mutation Coverage Overview

| Module  | Eval | Formal | Sim (Gap) | Uncov | Equiv | Formal % | Combined % | Time  |
| :---    | :--: | :----: | :-------: | :---: | :---: | :------: | :--------: | :---: |
| alu_mod |  21  |   5    |     6     |  10   |   0   |  23.8%   |   52.4%    | 56.2s |

### Top Actionable Verification Gaps (`mode="gaps"`)
1. `src/alu_mod.sv:156` — invert on `u_mul.is_signed[0]` — `[UNCOVERED (confirmed non-equiv)]`
        155:         .is_16bit  (is_16bit),
   -->  156:         .is_signed (is_aad_op ? 1'b0 : alu_op[0]),
        157:         .op1       (is_aad_op ? {8'h00, input1[15:8]} : input1),
2. `src/div_mod.sv:210` — stuck-at-1 on port `Y`[0] — `[UNCOVERED (confirmed non-equiv)]`
   -->  210:         neg_dvd_reg <= is_signed && dividend_hi[15];

Cycle-Accurate VCD Waveform Intelligence

Instead of dumping megabyte VCD text into the model's prompt, Turbostar's 7-tool VCD suite gives the agent an interactive logic analyzer tailored specifically for LLM context windows.

Measure: Zero-toggle inactive net counts, protocol violation counts, and streaming cycle-accurate diffs. Breadcrumbs: Enum-decoded FSM states, strobe-qualified bus tables, opcode mnemonics, and vcd_signal_to_code RTL driver/sink traces.

  • Live SystemVerilog Enum Discovery: Automatically parses RTL typedef enum declarations—rendering state machines as 0x1 (FETCH), 0x6 (STORE16_1), or 0x8 (RETIRE) instead of cryptic raw numbers.
  • Zero-Toggle Inactive Net Detection: vcd_file_info flags signals with zero transitions with **, immediately surfacing stuck resets, unwired nets, or dead control logic without manual inspection.
  • Strobe Qualification & Opcode Labels: Pair data buses with valid strobes via vcd_signal_qualifier so inactive cycles render as -, and register project-wide instruction decodes via vcd_signal_labels to label hex opcodes as readable mnemonics (e.g. 0xCD → CALL).
# Tool call: vcd_wave(path="wave/dump_call_ret_tb.vcd", ...)
### VCD Waveform: wave/dump_call_ret_tb.vcd
Sampled on: `clk` (posedge) | Timescale: 1ps | Rows: 8

| Tick | state           | pc     | opcode      | sp_val |
|:-----|:----------------|:-------|:------------|:-------|
| 1    | 0x8 (HALT)      | 0x0000 | 0x00 (NOP)  | 0x0200 |
| 3    | 0x0 (FETCH)     | 0x0001 | 0xCD (CALL) | 0x0200 |
| 5    | 0x1 (DECODE)    | 0x0003 | 0xCD (CALL) | 0x0200 |
| 6    | 0x6 (STORE16_1) | 0x0003 | 0xCD (CALL) | 0x0200 |
| 7    | 0x7 (STORE16_2) | 0x0003 | 0xCD (CALL) | 0x0200 |
| 8    | 0x8 (RETIRE)    | 0x0003 | 0xCD (CALL) | 0x0200 |
| 9    | 0x0 (FETCH)     | 0x0050 | 0xCD (CALL) | 0x01FE |
| 10   | 0x0 (FETCH)     | 0x0051 | 0x3E (MVI)  | 0x01FE |

Logic Depth, LUT Area & In-Place Port Annotations

Agents optimizing purely for clock frequency often duplicate logic cones until FPGA resource utilization explodes. verilog_logic_depth and verilog_update_timing give the agent simultaneous visibility into combinational depth and resource area in seconds.

Measure: Max Reg → Reg, In → Reg, and Reg → Out LUT depth plus synthesized LUT/FF/Carry cell counts. Breadcrumbs: Bottleneck-sink-grouped critical cones with inline RTL lines and in-place // [timing: ...] port annotations.

  • Bottleneck Sink Grouping & Inline RTL: Critical paths are grouped by destination sink with project-relative file.sv:line coordinates and inline 1-line SystemVerilog statements (show_code=1 default), decomposing each stage into LUT levels and carry chain hops.
  • Module Area Summary: Every report includes a synthesized cell breakdown (LUTs, Flip-Flops, Carry cells, and Total Cells) so the agent balances speed against logic budgets.
  • In-Place // [timing: ...] Port Annotations: verilog_update_timing (and turbostar-verilog -u) writes and updates vertically aligned timing comments directly on module port declarations in .sv files—giving agents instant awareness of deep inputs and outputs as they wire modules together.
# Tool call: verilog_logic_depth(module="cpu", top_k=2)
# Timing: `cpu` (Target: iCE40)
Max Internal Reg -> Reg Depth: 25

## Worst Combinational Paths (Grouped by Bottleneck Sink)
Path #1 [Reg -> Reg] Depth: 25 (10 LUTs + 15 carry) -> `H_reg.value`
- Sources: `alu.flags` (src/alu8.sv:62), `decode.opcode_valid` (src/decode.sv:138)
  1. `src/alu8.sv:178` (5 LUTs) -> `alu_out` | `{carry, alu_out} = in1_reg - imm8_reg;`
  2. `src/alu16.sv:68` (1 LUT) -> `C_load` | `assign C_load = (op == 4'd2) && valid;`
  3. `src/alu16.sv:80` (15 carry, from `value_reg`) -> `alu.next_flags`
  4. `src/cpu.sv:102` (1 LUT) -> `hi_val[7]` | `wire [7:0] hi_val = sel ? wz_hi : alu_out;`
- End: `cpu_8080.H_reg.value` (src/register.sv:20-26 | `value_reg <= load_value;`)

# Tool call: verilog_update_timing() — annotates .sv ports in-place
module alu_mod (
    input  wire        clk,     // [timing: clock]
    input  wire  [7:0] input1,  // [timing: 0 -> Reg]
    input  wire  [7:0] opcode,  // [timing: 8 -> Reg]
    output logic [7:0] alu_out, // [timing: 13 <- Reg]
    output logic [7:0] flags    // [timing: 0 <- Reg]
);

Physical Place-and-Route Timing Closure

Pre-synthesis logic depth is only half the story—on real FPGAs, long Manhattan wire routes and high-fanout control nets often dominate the critical path. Together, verilog_logic_depth and verilog_pnr_timing form a tight bottleneck-chasing loop: when an RTL edit shrinks LUT area without moving P&R Fmax, verilog_logic_depth immediately reveals whether a new In → Reg decode cone took over, while verilog_pnr_timing shows when the physical critical path jumps to a different module (e.g., ALU → BRAM or decoder)—enabling agents to drive a design from 50 MHz to 75 MHz Fmax (+50%) in a couple of hours.

Measure: Achieved multi-seed median Fmax and setup slack against your target clock constraint. Breadcrumbs: Post-route critical paths (logic vs. wire delay, tile span, and fanout) correlated back to exact RTL lines and register names.

  • Multi-Seed Fmax & Submodule PnR: Evaluates real post-routing setup slack across placement seeds against your target clock constraint, or runs unconstrained out-of-context PnR on individual submodules (module="alu8").
  • Wire-Driver Disambiguation & Inline Code: Resolves shared always_ff blocks and multi-instance submodules to their exact register names via Yosys wire connectivity, displaying the offending RTL statement inline at every hop without extra read_file round-trips.
  • Physical Tile Distance, Fanout & Segments: Reports net fanout and chip tile span alongside logic vs. routing delay splits, with optional hop-by-hop cell/pin inspection (show_segments=true).
# Tool call: verilog_pnr_timing(top_k=2)
## Clock Domain & Frequency Timing
| Clock Domain            | Constraint | Achieved Fmax | Slack     | Status |
| :---                    | :---:      | :---:         | :---:     | :---:  |
| `clk$SB_IO_IN_$glb_clk` | 75.00 MHz  | 75.42 MHz (median of 5 seeds: 72.10–77.80 MHz) | +0.074 ns | MET |

## Physical Critical Paths (Grouped by Bottleneck Sink)
### Path #1 [Reg -> Reg] Delay: 13.259 ns (30% logic, 70% routing)
- Start: `cpu_8080.alu.imm8_reg[2]` (src/alu8.sv:94-101 | `imm8_reg <= imm8;`)
- Chain:
  1. `src/alu8.sv:109` — 1.260 ns (1 LUT) | `next_flags = flags;`
  2. `src/alu8.sv:178` — 1.974 ns (3 LUTs) | `{carry, alu_out} = in1_reg - imm8_reg;`
  3. `src/cpu.sv:102`  — 1.589 ns (1 LUT, span: 6 tiles) | `wire [7:0] hi_val = ... : alu_out;`
- Dominant Routing Delays:
  • 1.589 ns routing via `cpu_8080.lo_val` (4 sinks, span: 6 tiles)
- End: `cpu_8080.H_reg.value[6]` (src/register.sv:20-26 | `value_reg <= load_value;`)

Dual-View Switching-Activity & Power Optimization

Just as timing closure needs both structural depth and physical P&R, power optimization needs both Action (which named RTL signals to gate or redesign) and Judgment (an ungameable post-synthesis switching score). Together, verilog_simulate(coverage=true) and verilog_simulate(gate_toggles=true) close the loop—guiding an agent on a 469k-cycle 8086 C prime-sieve workload to replace a shift-register prefetch FIFO with a circular ring buffer for -9.9% chip-wide gate-level switching (-34.9% FF toggling, -43 LUT4s) with zero Fmax or formal regression.

Measure: Ungameable post-synthesis gate_toggles=true chip-wide weighted tog/cyc (Comb vs. FF). Breadcrumbs: Fanout-weighted RTL culprit rankings (Hot Bits in toggles.md) paired with post-synthesis per-module and hot-line attribution in gate_toggles.md.

  • Action Loop (coverage=true → system://verilog/toggles.md): Piggybacks on Verilator --coverage-toggle at zero extra compile/sim cost (configurable via toggle_info: "coverage" / "always" / "never"), ranking modules by fanout-weighted Power Share alongside Avg Activity (α), bit-skew profiles (uniform vs. LSB-heavy), and inline RTL lines.
  • Judgment Score (gate_toggles=true → system://verilog/gate_toggles.md): Synthesizes the DUT via Yosys to LUT4/DFFs (or standard gates for ASIC targets) while keeping large $mem_v2 BRAMs behavioral, measuring exact post-synthesis Comb vs. FF weighted tog/cyc and attributing hot LUTs back to original RTL lines.
  • Graceful Multi-TB Handling: Testbenches that probe internal RTL signals are cleanly marked SKIPPED (internal probe) in gate-level mode while boundary-only benchmarks complete and report side-by-side without clobbering .toggles.md.
# Tool call: verilog_simulate(testbench="tb/tb_demo_nth_prime.sv", gate_toggles=true)
## Gate-Level Switching Activity / Power Judgment (LUT4/DFF, 469,096 cycles)
- Total Gate-Level Score: 188.95 weighted tog/cyc (-9.9% vs. 209.79 before)
  fetch_mod: 120.83 -> 98.69 (-18.3%) | FF: -34.9% | -43 LUT4s | Fmax 52.55 MHz MET

| Module        | Share | Weighted Tog/cyc | Comb   | FF     | Cells (Comb/FF) |
| :---          | ---:  | ---:             | ---:   | ---:   | ---:            |
| `fetch_mod`   | 52.2% | 98.69            | 18.69  | 8.94   | 514 / 115       |
| `sequencer`   | 14.2% | 26.82            | 3.21   | 3.65   | 103 / 6         |
| `decode_mod`  | 8.7%  | 16.38            | 2.89   | 6.10   | 398 / 135       |
| `lsu_mod`     | 8.0%  | 15.09            | 8.65   | 0.33   | 300 / 32        |
| `alu_mod`     | 7.5%  | 14.15            | 5.19   | 0.97   | 813 / 34        |

# Full hot RTL lines: fs_read_lines(path="system://verilog/design/src/fetch_mod.gate_toggles.md")

Standalone Unified CLI for Human Engineers

Why should AI agents have all the fun? turbostar-verilog packages the entire FPGA timing, configuration, compilation, simulation, and VCD waveform suite into a standalone command-line binary you can run directly in your terminal, Makefiles, or CI pipelines without launching the editor or MCP server.

  • Timing & In-Place Port Annotations (timing / default): Run turbostar-verilog -m alu_mod for instant LUT depth tables, --pnr for multi-seed Yosys + nextpnr physical timing closure, or -u, --update to write aligned // [timing: ...] port annotations directly in .sv files.
  • Project Setup, Compile & Simulate (config, compile, sim): Populate turbostar.json and register testbenches via turbostar-verilog config --target ice40 --device hx8k --top main, lint/synthesize with compile, and run simulations with sim.
  • VCD Waveform Inspection (vcd-*): Inspect and debug simulation dumps from the command line with vcd-info, vcd-wave, vcd-search, vcd-compare, vcd-trace, vcd-labels, and vcd-qualifier—all rendered with UTF-8 box-drawing tables.
Getting Started with turbostar-verilog →
$ turbostar-verilog -m alu_mod -k 1
# Timing: `alu_mod` (Target: iCE40, Max Reg -> Reg Depth: 14)

## Inputs
┌────────┬───────┬───────────┬──────────┐
│ Name   │ Width │ Layers to │ Sinks to │
├────────┼───────┼───────────┼──────────┤
│ clk    │ 1     │ -         │ Clock    │
│ input1 │ 8     │ 0         │ Register │
│ input2 │ 8     │ 0         │ Register │
│ opcode │ 8     │ 8         │ Register │
│ retire │ 1     │ 1         │ Register │
└────────┴───────┴───────────┴──────────┘

### Path #1 [Reg -> Reg] Depth: 14 (6 LUTs + 8 carry)
- Start: `input2_reg[0]` (`alu.sv:22-32` | `input2_reg <= input2;`)
  1. `alu.sv:163` (1 LUT + 7 carry) -> `carry` | `{carry, alu_out} = input1_reg - input2_reg;`
  2. `alu.sv:143` (1 LUT + 1 carry) -> `carry` | `{carry, alu_out} = input1_reg - input2_reg - ...;`
- End: `flags[0]` (`alu.sv:22-32` | `flags <= next_flags;`)
- Area: LUTs: 190 | Flip-Flops: 20 | Carry: 46 | Total Cells: 256

$ turbostar-verilog --pnr -m alu_mod -k 1
┌───────────────────────┬────────────┬──────────────────────────────────────────────────┬───────────┬────────┐
│ Clock Domain          │ Constraint │ Achieved Fmax                                    │ Slack     │ Status │
├───────────────────────┼────────────┼──────────────────────────────────────────────────┼───────────┼────────┤
│ clk$SB_IO_IN_$glb_clk │ 80.00 MHz  │ 102.63 MHz (median of 5 seeds: 99.90-103.90 MHz) │ +2.756 ns │ MET    │
└───────────────────────┴────────────┴──────────────────────────────────────────────────┴───────────┴────────┘

Interactive Schematic & Live Waveform Replay

Text-based timing tables and VCD dumps are fast for triage, but sometimes you want to see the circuit. turbostar-verilog gridcad-export synthesizes your SystemVerilog hierarchy into a clean word-level schematic for GridCad—preserving submodules, multi-bit buses, FSM label tables, and Verilog source-line provenance.

  • Word-Level Clarity: Maps registers, muxes, priority muxes, adders, comparators, reductions, memories, and multi-output LUT8 truth tables without flattening the hierarchy into a sea of 1-bit gates.
  • Clock-by-Clock VCD Replay: Pair the exported schematic with any sim VCD trace to scrub through cycles and watch live bus values, register states, and control signals propagate across the design.
  • RTL Source Provenance: Every block retains its originating file:line and SystemVerilog snippet so you can trace visual hardware straight back to TurboStar.
See the GridCad Export Workflow →
register16 synthesized schematic in GridCad with live VCD waveform replay

Built-In SystemVerilog Playbook (AGENTS.md)

Great tools are only half the equation—coding agents also need concrete hardware engineering discipline so they don’t fall into classic RTL traps like inferred latches, blanket verilator lint_off pragmas, tautological “RTL == RTL” formal proofs, or optimizations that fight FPGA control-set homogeneity.

Turbostar ships with a battle-tested, continuously refined SystemVerilog & FPGA AGENTS.md playbook distilled from real autonomous CPU builds (8-bit and 16-bit retro microprocessor cores) and real timing/power closure campaigns:

  • Design-First RTL Discipline: Enforces FSM .mermaid state diagrams before coding, clean synchronous BRAM templates (system://verilog/bram_template.sv), and contract-vs-implementation formal proofs (system://verilog/formal_template.sv).
  • End-to-End Verification & Optimization Loops: Guides agents through the exact golden loop—line coverage → formal mutation gaps → unit testbench → unbounded formal proof—plus multi-seed median Fmax timing closure and dual-view RTL/gate-level power profiling.
  • Hard-Won FPGA Architecture Rules: Captures concrete silicon learnings including control-set homogeneity, carry-chain consolidation, severing BRAM → Datapath critical cones with capture FFs, and registering early valid signals.
  • Zero-Friction Delivery: Served live as system://verilog/AGENTS.md over MCP Resources, installable into any repo with turbostar-verilog config --init-agents-md, and readable directly on the web.
# Available automatically over MCP Resources or one CLI command
MCP Resource:   fs_read_lines(path="system://verilog/AGENTS.md")
Install in Repo: turbostar-verilog config --init-agents-md

# What the Playbook Teaches Your Agent
1. Design-First FSMs & Templates
   - Author <module>.mermaid state diagrams before coding FSMs
   - Follow system://verilog/bram_template.sv for clean EBR inference

2. Contract-vs-Implementation Formal Proofs
   - Prove external behavior, never mirror internal RTL equations
   - Pair every $assume with reachability cover points (no vacuous proofs)

3. Golden Verification & Power/Timing Loops
   - Line coverage -> formal mutation gaps -> testbench -> formal prove
   - Judge PnR timing by multi-seed median Fmax (never single-seed luck)
   - Guide power refactors with coverage=true + gate_toggles=true

16 Specialized Tools Across the RTL Lifecycle

Activate the verilog tool family in Turbostar, or expose it directly to any external AI agent via standalone turbostar-verilog mcp (or full turbomcp).

🛠️

Lint, Synthesis & Config

Fast static verification and persistent FPGA target configuration without manual Makefiles.

  • verilog_compile: Dual Verilator lint (lint_only=true in ~0.13s) + Yosys synthesis with submodule scoping.
  • verilog_project_map: Instant RTL hierarchy tree with module ports, parameters, testbench bindings, and formal status.
  • verilog_project_settings: Inspect host EDA toolchain status (Verilator, verilator_coverage, C++ build tools, Yosys, installed nextpnr targets, SymbiYosys sby, SMT solvers, optional tools, versions, paths, and remediation hints) and configure target FPGA family, part, package, top module, target clock MHz, and optional sby_path.
⚡

Simulation & Formal Verification

Automated testbench discovery, coverage, SymbiYosys formal proofs, and regression waveform snapshots.

  • verilog_simulate: Run testbenches with hierarchical=true, RTL line/port/cover coverage (coverage=true → system://verilog/coverage.md), and auto-diffing against .lastpass.vcd.
  • verilog_formal: Run SymbiYosys (prove, bmc, cover) on formal/*_props.sv bind modules with parameter overrides, vacuity warnings, counterexample VCDs (system://verilog/formal.md), git-backed equivalence checking (mode="git_equiv" against HEAD or any git_ref), and native Yosys mutation coverage (mode="mutate" / mode="gaps", system://verilog/formal_mutation.md).
  • verilog_configure_testbench: Associate testbenches with modules in turbostar.json, assign levels (quick, comprehensive, extreme), and set defaults.
📈

Waveform Inspection

Token-efficient, clock-aligned VCD tables and temporal condition search.

  • vcd_file_info: Inspect hierarchy scopes, timescale, clock candidate ticks, and detect zero-toggle (**) inactive nets.
  • vcd_wave: Clock-aligned Markdown tables with posedge sampling, enum state names, and idle-cycle collapsing.
  • vcd_search: Find timestamps matching multi-signal boolean expressions or edge transitions.
🏷️

Semantic Trace & Diffing

Bridge raw signal bits back to high-level SystemVerilog types and source lines.

  • vcd_signal_labels: Auto-discover typedef enum state names and register project-wide value maps (vcd_labels.json).
  • vcd_signal_qualifier: Mask bus values with - during inactive valid/enable cycles.
  • vcd_compare: Cycle-by-cycle diff between two VCD traces with clock-edge alignment and divergence reports.
  • vcd_signal_to_code: Trace VCD nets to RTL declarations, drivers, and loads.
⏱️

Logic Depth & Area

Instant combinational LUT cone analysis and module resource tracking.

  • verilog_logic_depth: Per-module critical path hop traces, sink grouping, carry chain analysis, and LUT/FF area summaries.
  • verilog_update_timing: Batch updater writing aligned // [timing: ...] port annotations directly in .sv module interfaces.
📐

Physical Place & Route

Post-routing timing closure with physical chip coordinates and routing delay breakdowns.

  • verilog_pnr_timing: Full Yosys + nextpnr physical timing analysis reporting Fmax, slack, logic vs. wire delay, fanout, and tile span.
  • turbostar-verilog: Unified standalone CLI for project config (config), logic depth, physical PnR (--pnr), batch in-place port annotations (-u), compile/sim, and vcd-* waveform tools with UTF-8 framed terminal tables.
Getting Started Guide →

Standalone FPGA MCP Server (turbostar-verilog mcp)

Drop all 16 Verilog, Formal & VCD tools straight into Antigravity, Claude Code, Gemini CLI, or Cursor—single lightweight binary, zero editor overhead.

Built for External AI Agents

Already using an external AI coding agent and just want Turbostar’s hardware engineering engine? Run turbostar-verilog mcp as a dedicated stdio JSON-RPC 2.0 MCP server. All 16 Verilog/VCD tools are statically linked and active immediately—no activate_tool_family step and no .so plugins required.

  • Focused 21-Tool Surface: Exposes all 16 Verilog, Formal, Timing & VCD tools plus 5 minimal companion tools (manage_task, fs_read_lines, fs_batch_read, fs_list_dir, fs_grep_files) so it never clutters or conflicts with your host agent’s native file/git/shell tools.
  • Zero-Friction Onboarding: Automatically delivers the Verilog/FPGA workflow guide in MCP initialize.instructions and serves system:// guides, formal property templates, and system://tasks/index.md over MCP Resources (resources/list & resources/read).
  • Parallel Async Execution: Long simulations, formal proofs, and multi-seed PnR runs auto-background cleanly (or launch immediately with wait_sec=0) and can be tracked or awaited with manage_task(action="wait_any").
  • Host-Aware Schemas & Lean Footprint: Auto-detects antigravity (PascalCase), copilot (camelCase), or turbostar (snake_case) parameter naming from clientInfo (or --identity), with zero networking, TLS, SQLite, or YAML runtime dependencies.
// Add to mcp_config.json / claude_desktop_config.json / .cursor/mcp.json
{
  "mcpServers": {
    "turbostar-verilog": {
      "command": "turbostar-verilog",
      "args": [
        "mcp"
      ]
    }
  }
}

Tip: If your MCP host does not launch the server in your RTL repository root, pass "--project-dir", "/path/to/rtl-project" inside args.

Antigravity & Gemini CLI

Add to ~/.gemini/config/mcp_config.json (auto-detects PascalCase schemas):

{
  "mcpServers": {
    "turbostar-verilog": {
      "command": "/home/user/.local/bin/turbostar-verilog",
      "args": ["mcp", "--project-dir", "/path/to/rtl-project"]
    }
  }
}

Claude Code, Cursor & Generic MCP

Add to ~/.claude/mcp.json, claude_desktop_config.json, or .cursor/mcp.json:

{
  "mcpServers": {
    "turbostar-verilog": {
      "command": "turbostar-verilog",
      "args": ["mcp"]
    }
  }
}

Open-Source FPGA Toolchain Setup

Turbostar integrates directly with standard open-source SystemVerilog and FPGA synthesis packages.

1. Install EDA Dependencies & Project Template

Install the open-source verification and synthesis tools from your distribution package manager or OSS CAD Suite. Turbostar also ships with a ready-to-use systemverilog project template containing a pre-configured turbostar.json and an agent workflow guide (AGENTS.md).

  • Lint & Simulation: verilator.
  • Formal Verification (Optional): sby (SymbiYosys), Yosys with slang, and an SMT solver (bitwuzla, yices-smt2, or z3) via OSS CAD Suite (auto-detected from PATH or fpga.sby_path in turbostar.json).
  • Synthesis & Logic Depth: yosys (supports generic gate synthesis plus ice40, ecp5, gowin, and xilinx targets).
  • Physical Place & Route: nextpnr-ice40, nextpnr-ecp5, or nextpnr-gowin alongside fpga-icestorm / prjtrellis.
# 1. Install open-source RTL & FPGA tools (Debian/Ubuntu)
sudo apt install yosys verilator \
  nextpnr-ice40 fpga-icestorm
# 2. Expose to any external AI agent via standalone MCP
turbostar-verilog mcp --project-dir /path/to/rtl-project
# (or use full turbomcp / activate_tool_family("verilog") in Turbostar)

# 3. Or run the standalone human CLI
turbostar-verilog config --target ice40 --device hx8k --top main
turbostar-verilog formal
turbostar-verilog formal mutate
turbostar-verilog formal gaps -m alu_mod
turbostar-verilog -m alu_mod
turbostar-verilog --pnr --seeds 4
turbostar-verilog -u