Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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".

Pre-requisities

  1. An x86-64 system.
  2. Linux/Windows operating system (we used Ubuntu 20.04).
  3. Python 3.10 or newer (3.11 is recommended).
  4. uv installed and available in PATH.

Dependencies Installation

Step1: Building EDA tool chains

verilator,vcs, vcf ... should be installed and configured in your system path. (for mcp server)

Step2: Building Python libs

Install the public SmartCraft agent and its development dependencies:

uv sync --python 3.11 --extra dev

Install your MCP separately:

uv sync --project SmartCraft-MCP --python 3.11 --extra dev

Usage

step1: config LLM API key

Copy .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=600

step2: config the mcp server

Configure 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, and vcs.
  • debug: uvllm_solution, meic_solution, assertsolve_model, iverilog_verify, and vcs.

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.

step3: Run smartcraft

The prototype accepts the following input options:

  • --task/-t: task kind, either generate or debug.
  • --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.json

Run 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.json

Run the RTL debugging task:

uv run smartcraft -t debug -b benchmark/debug/uvllm/accu_1.json

Generation 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/.

About

Work Smarter, Not Harder: An LLM-Enabled Agentic Framework for Automated RTL Generation and Debugging

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages