Work Smarter, Not Harder: An LLM-Enabled Agentic Framework for Automated RTL Generation and Debugging
This repository contains the code for our paper "Work Smarter, Not Harder: An LLM-Enabled Agentic Framework for Automated RTL Generation and Debugging".
- An x86-64 system.
- Linux/Windows operating system (we used Ubuntu 20.04).
- Python 3.10 or newer (
3.11is recommended). uvinstalled and available inPATH.
verilator,vcs, vcf ... should be installed and configured in your system path. (for mcp server)
Install the public SmartCraft agent and its development dependencies:
uv sync --python 3.11 --extra devInstall your MCP separately:
uv sync --project SmartCraft-MCP --python 3.11 --extra devCopy .env.example to .env and configure the OpenAI-compatible model endpoint:
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxx
OPENAI_API_URL=https://example.com/v1
MODEL_NAME=your-model-name
TIMEOUT=600Configure the private stdio MCP server in .env. SmartCraft starts it automatically when tools are needed:
SMARTCRAFT_MCP_STDIO=["./SmartCraft-MCP/.venv/bin/smartcraft-mcp"]SmartCraft first selects an MCP candidate group from the top-level task:
generate:extract_fsm,solve_kmap,waveform_read,iverilog_verify, andvcs.debug:uvllm_solution,meic_solution,assertsolve_model,iverilog_verify, andvcs.
Within the selected group, the LLM reads the tool schemas and dynamically chooses which tools to call from the benchmark contents.
waveform_read, uvllm_solution, meic_solution, assertsolve_model, and vcs are currently protocol placeholders: they are discoverable and return a structured not_implemented result, but do not yet run a backend.
The prototype accepts the following input options:
--task/-t: task kind, eithergenerateordebug.--benchmark/-b: path to one benchmark JSON task.
Run the FSM generation task:
uv run smartcraft -t generate -b benchmark/generate/hard/fsm-prob-1-mealy.jsonRun the K-map generation task. It uses the same generate task kind; the Agent inspects the MCP tool schemas and dynamically selects the deterministic K-map solver from the benchmark contents:
uv run smartcraft -t generate -b benchmark/generate/hard/kmap-prob-1-null.jsonRun the RTL debugging task:
uv run smartcraft -t debug -b benchmark/debug/uvllm/accu_1.jsonGeneration tasks accept uname, spec or desc, tb, and optional ref fields. Debugging tasks additionally use buggy_code. Each run writes candidate.v and metadata.json to a unique directory under runs/.