Sigmantic AI CLI - Intelligent RTL code generation with Claude and workspace management
Project description
Sigmantic AI CLI
An intelligent CLI tool for RTL (Register Transfer Level) code generation that follows an agentic workflow with workspace-based project management inspired by the Claude Agent SDK:
- Workspace Management: Every session starts with workspace creation/attachment
- Planning Phase: Structured todo planning with RTL specifications
- Verification First: Generates comprehensive testbenches before RTL code
- Iterative RTL Generation: Creates and refines RTL code using Verilator feedback
- Self-Explanation: Documents and explains the generated code functionality
Features
- ๐๏ธ Workspace-Based Projects: Claude Agent SDK-inspired project structure
- ๐ค Agentic Workflow: AI-driven planning and execution
- ๐งช Verification-First Approach: Testbenches generated before implementation
- ๐ Iterative Refinement: Uses Verilator feedback to improve code quality
- ๐ Self-Documenting: Explains generated code and design decisions
- ๐ฏ RTL-Focused: Specialized for hardware description languages (Verilog/SystemVerilog)
- ๐ ๏ธ Tool Integration: Built-in Verilator integration for compilation and verification
- ๐ Rich CLI Interface: Beautiful terminal interface with progress tracking
- ๐ File System Context: Uses workspace structure for agent context management
Quick Start
-
Setup:
./setup.sh
-
Configure:
cp env.example .env # Edit .env and add your Anthropic API key to key.cfg
-
Create your first RTL project:
sigmantic "Create a 32-bit ALU with add, subtract, and, or operations" # The system will prompt you to create or attach to a workspace
Workspace Management
Workspace Structure
Each RTL project workspace follows the Claude Agent SDK pattern:
my_rtl_project/
โโโ CLAUDE.md # Project context for Claude
โโโ .claude/ # Agent configuration
โ โโโ settings.json # Project settings
โ โโโ agents/ # Specialized RTL agents
โ โ โโโ rtl_designer.md # RTL design specialist
โ โ โโโ verification_specialist.md
โ โโโ commands/ # Custom slash commands
โ โโโ simulate.md # /simulate command
โ โโโ lint.md # /lint command
โโโ rtl/ # Generated RTL modules
โโโ testbenches/ # Verification testbenches
โโโ docs/ # Design documentation
โโโ sim/ # Simulation results
Workspace Commands
# List available workspaces
sigmantic --list-workspaces
# Show current workspace info
sigmantic --workspace-info
# Generate RTL in a specific workspace
sigmantic "Create a FIFO" --workspace /path/to/workspace
Installation
Option 1: Install from PyPI (Recommended)
pip install sigmantic
Option 2: Install from Source
git clone https://github.com/sigmantic-ai/sigmantic-cli.git
cd sigmantic-cli
pip install -e .
Option 3: Quick Setup Script
git clone https://github.com/sigmantic-ai/sigmantic-cli.git
cd sigmantic-cli
./install.sh
Configuration
After installation, configure your API key:
# Create config directory
mkdir -p ~/.sigmantic
# Add your Anthropic API key
echo "ANTHROPIC_API_KEY=your_api_key_here" > ~/.sigmantic/key.cfg
Verify Installation
sigmantic --help
sigmantic --list-workspaces
Usage
Basic Usage
python3 rtl_agent.py "Your RTL design description"
Options
--non-interactive, -n: Run without interactive prompts--workspace, -w: Specify workspace directory (default: ./workspace)--help: Show help message
Examples
# Simple counter
python3 rtl_agent.py "Create an 8-bit up counter with enable and reset"
# ALU design
python3 rtl_agent.py "Design a 16-bit ALU supporting add, subtract, AND, OR"
# FIFO buffer
python3 rtl_agent.py "Implement a synchronous FIFO with 32-bit width and 16 entries"
# State machine
python3 rtl_agent.py "Create a traffic light controller state machine"
Interactive Examples
python3 examples.py
Workflow Details
1. Planning Phase
- Analyzes user requirements
- Creates structured task breakdown
- Defines RTL specification (inputs, outputs, parameters)
- Plans verification strategy
2. Verification Phase
- Generates comprehensive testbench
- Creates test cases for all scenarios
- Defines coverage goals
- Explains verification strategy
3. RTL Generation Phase
- Generates initial RTL code
- Compiles with Verilator
- Iteratively fixes compilation errors
- Runs verification tests
- Optimizes based on feedback
4. Explanation Phase
- Documents design decisions
- Explains code functionality
- Creates comprehensive documentation
- Highlights key learning points
Architecture
SigmanticAICLi/
โโโ rtl_agent.py # Main CLI interface
โโโ models.py # Data models and types
โโโ verilator_utils.py # Verilator integration
โโโ agents/ # Individual agent modules
โ โโโ planning_agent.py # Task planning and specification
โ โโโ verification_agent.py # Testbench generation
โ โโโ rtl_generation_agent.py # RTL code generation
โ โโโ explanation_agent.py # Code explanation
โโโ templates/ # RTL and testbench templates
โโโ workspace/ # Generated files (created at runtime)
โโโ examples.py # Example usage scenarios
โโโ test_installation.py # Installation verification
โโโ setup.sh # Automated setup script
Output Files
For each RTL generation, the tool creates:
{module_name}.v- Generated RTL code{module_name}_tb.v- Verification testbench{module_name}_documentation.md- Comprehensive documentation- Verilator compilation and simulation results
Configuration
Environment variables (set in .env):
OPENAI_API_KEY- Your OpenAI API key (required)VERILATOR_PATH- Path to Verilator executable (optional)WORKSPACE_DIR- Workspace directory for generated files
Testing
Run the installation test:
python3 test_installation.py
This verifies:
- All dependencies are installed
- Imports work correctly
- CLI help functionality
- Environment setup
Examples and Use Cases
Digital Design Education
- Generate examples for learning RTL concepts
- Create testbenches for verification practice
- Understand design patterns and best practices
Rapid Prototyping
- Quickly generate RTL modules for system integration
- Create verification infrastructure
- Iterate on designs with AI feedback
Design Documentation
- Generate comprehensive design documentation
- Explain complex RTL designs
- Create educational materials
Limitations
- Requires OpenAI API access (costs apply)
- Generated code may need manual review for production use
- Verilator integration is optional but recommended
- Complex designs may require multiple iterations
Contributing
This is a demonstration project showcasing agentic AI workflows for RTL design. Feel free to extend and modify for your specific needs.
License
MIT License - See LICENSE file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sigmantic-0.2.0.tar.gz.
File metadata
- Download URL: sigmantic-0.2.0.tar.gz
- Upload date:
- Size: 53.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c86da7ba26b4b08a61f1e7dd57981525c98d7e7d95c4f23147da22d916e954de
|
|
| MD5 |
90319258f58a9e937248ff37b1e2cbbc
|
|
| BLAKE2b-256 |
f773f90c10a62a8e1f2e5661f26df77f9b0fb646edcf1ae913407d047458e213
|
File details
Details for the file sigmantic-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sigmantic-0.2.0-py3-none-any.whl
- Upload date:
- Size: 47.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
559dade6fa0499652ec869f983380ed88793157d8c2518362c410bef02776f00
|
|
| MD5 |
06ac73513be39b5d29c9a7d462205781
|
|
| BLAKE2b-256 |
f3e79be8e3426e31ce2bd22bbd3b4e63e38d8e8edd9f688c019af22aded1c60e
|