vxkyyy commited on
Commit
81fa1c9
ยท
1 Parent(s): 900a7e7

Update README.md for AgentIC v3.0: new features, UI, formal verification, security, defense use cases

Browse files
Files changed (1) hide show
  1. README.md +136 -38
README.md CHANGED
@@ -1,10 +1,10 @@
1
  # AgentIC: Sovereign AI-Powered Silicon Design Framework
2
 
3
- ![Status](https://img.shields.io/badge/Status-Beta_v2.0-orange) ![Python](https://img.shields.io/badge/Python-3.10%2B-blue) ![License](https://img.shields.io/badge/License-MIT-green) ![OpenLane](https://img.shields.io/badge/OpenLane-Integrated-purple) ![Verification](https://img.shields.io/badge/Formal_Verification-SVA-red)
4
 
5
  **AgentIC** is an automated, sovereign AI Agent framework that transforms natural language descriptions directly into industry-standard physical chip layouts (GDSII). Unlike simple code generators, AgentIC employs a **Self-Correcting Multi-Agent System** that iteratively designs, verifies, fixes, and physically hardens custom silicon.
6
 
7
- It acts as a **"Text-to-Silicon" Compiler**, orchestrating a crew of specialized AI agents (Architect, Designer, Verification Engineer, Physical Design Lead) to ensure functional correctness and manufacturability.
8
 
9
  ---
10
 
@@ -26,8 +26,10 @@ graph TD
26
  end
27
 
28
  subgraph "Phase 2: Formal & Dynamic Verification"
29
- QA -- Approve --> Formal[SVA / SymbiYosys]
30
- Formal -->|Mathematical Proof| Testbench[Testbench Agent]
 
 
31
  Testbench -->|Simulation| Sim{Icarus Verilog}
32
  Sim -- Fail --> Debugger[Error Analyst]
33
  Debugger -->|Fix Logic| Designer
@@ -36,35 +38,61 @@ graph TD
36
 
37
  subgraph "Phase 3: Deep Physical Hardening"
38
  Sim -- Pass --> OpenLane[OpenLane Flow]
39
- OpenLane -->|GDSII| PPA[PPA Analyzer]
40
  PPA -- "Timing/Area Violations" --> Optimizer[Backend Engineer]
41
  Optimizer -->|Optimize RTL| Designer
42
  end
43
 
44
- PPA -- "Metrics OK" --> Tapeout([Final GDSII])
45
  ```
46
 
47
  ---
48
 
49
- ## ๐Ÿš€ Key Capabilities v2.0
50
 
51
- ### 1. ๐Ÿ›ก๏ธ Robust "Anti-Hallucination" Engine
52
- Traditional LLMs often leak "thought processes" or Markdown artifacts into code, breaking compilers. AgentIC v2.0 features:
53
- * **Hardened VLSI Tools**: Custom I/O handlers (`vlsi_tools.py`) that strictly sanitize outputs, stripping "Thought:", "Action:", and non-Verilog artifacts.
 
 
 
 
 
 
 
 
 
54
  * **Compiler-Aware Auto-Fix**: Automatically detects and repairs syntax errors (e.g., mismatched port widths, invalid SystemVerilog constructs) without human intervention.
55
- * **Filesystem Guard**: Enforces correct file extensions (`.sv`, `.v`, `.tcl`) and prevents file path hallucination.
 
 
 
 
 
 
 
56
 
57
- ### 2. ๐Ÿง  Autonomous Verification Loop
58
- * **Formal Verification (SVA)**: Before simulation, the `Verification Agent` writes **SystemVerilog Assertions** and runs **SymbiYosys** to mathematically prove safety properties (e.g., "Reset must clear registers").
59
- * **Dynamic Simulation**: Generates self-checking testbenches, runs `iverilog` simulations, and parses logs.
60
- * **Root Cause Analysis**: If a test fails, the `Error Analyst` determines if the bug is in the Design (RTL) or the Testbench, fixing the correct file.
 
 
 
61
 
62
- ### 3. ๐Ÿญ Physical Design Feedback Loop (PPA)
63
  * **Beyond Code**: AgentIC checks real-world metricsโ€”**Power, Performance (Timing), and Area**.
 
64
  * **Optimization Cycle**:
65
  * If **Timing** fails (Negative Slack), the agent inserts pipeline stages.
66
  * If **Area** is too high (Congestion), the agent simplifies logic or increases core size.
67
- * **OpenLane Integration**: Full control over `config.tcl` generation and disaster recovery (e.g., loosening density constraints when placement fails).
 
 
 
 
 
 
68
 
69
  ---
70
 
@@ -76,6 +104,7 @@ Traditional LLMs often leak "thought processes" or Markdown artifacts into code,
76
  * **Docker** (for OpenLane)
77
  * **Icarus Verilog** (`sudo apt install iverilog`)
78
  * **GTKWave** (optional, for viewing waveforms)
 
79
 
80
  ### Setup
81
 
@@ -93,10 +122,12 @@ Traditional LLMs often leak "thought processes" or Markdown artifacts into code,
93
  3. **Configure Environment**
94
  Create a `.env` file in the root directory:
95
  ```bash
96
- # LLM Provider (Examples)
97
- OPENAI_API_KEY="sk-..."
98
- # OR
99
  NVIDIA_API_KEY="nvapi-..."
 
 
 
 
100
 
101
  # Tool Paths (Optional, defaults provided)
102
  OPENLANE_ROOT="/home/user/OpenLane"
@@ -107,13 +138,20 @@ Traditional LLMs often leak "thought processes" or Markdown artifacts into code,
107
 
108
  ## ๐Ÿ’ป Usage
109
 
110
- ### 1. Build a Chip (The Command Center)
111
- The `build` command is the main entry point. It runs the full flow: Architecture -> RTL -> Verify -> GDSII.
 
 
 
 
 
 
 
112
 
113
  ```bash
114
  python3 AgentIC/main.py build \
115
- --name my_processor \
116
- --desc "A 5-stage pipelined RISC-V processor with hazard detection and forwarding unit. 32-bit width."
117
  ```
118
 
119
  **Options:**
@@ -121,29 +159,53 @@ python3 AgentIC/main.py build \
121
  * `--skip-openlane`: Stops after verification (useful for quick RTL iteration).
122
  * `--max-retries 5`: Sets how many times the agent can attempt to fix its own errors.
123
 
124
- ### 2. Manual Simulation & Fix
125
  If you have existing code and just want the agent to fix bugs:
126
  ```bash
127
- python3 AgentIC/main.py simulate --name my_processor
128
  ```
129
 
130
- ### 3. Hardening Only
131
  To run OpenLane physical design on an existing Verilog file:
132
  ```bash
133
- python3 AgentIC/main.py harden --name my_processor
134
  ```
 
135
 
136
  ---
137
 
138
- ## ๐Ÿ—๏ธ Internal Architecture
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
 
140
- | Component | Responsibility | Tools Used |
141
  | :--- | :--- | :--- |
142
- | **Architect Agent** | Defines Micro-Architecture, States, and Interfaces. | Markdown Spec |
143
- | **Designer Agent** | Writes Synthesizable SystemVerilog. | `vlsi_tools.write_verilog` |
144
- | **QA Agent** | "Senior Engineer" that rejects bad coding styles (Latches, Multi-drivers). | Static Analysis |
145
- | **Verification Agent** | Writes SVA properties and Testbenches. | `sby`, `iverilog` |
146
- | **Backend Agent** | Configures OpenLane (`config.tcl`) and optimizes for PPA. | OpenLane Docker |
 
 
147
 
148
  ---
149
 
@@ -155,12 +217,48 @@ python3 AgentIC/main.py harden --name my_processor
155
 
156
  ### "Simulation Failed (Compilation Error)"
157
  * **Cause**: LLM hallucinated invalid syntax.
158
- * **Fix**: AgentIC v2.0 usually fixes this automatically. If it persists, use `--max-retries 10` to give it more attempts.
 
 
 
 
 
 
 
 
 
 
 
159
 
160
- ### "Code contains 'Thought:' lines"
161
- * **Status**: **SOLVED**. The new `vlsi_tools.py` regex filters strip these artifacts automatically.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
 
163
  ---
164
 
165
  ## ๐Ÿ“œ License
166
  MIT License. Free for Research and Sovereign Development.
 
 
 
 
 
 
 
 
 
 
 
1
  # AgentIC: Sovereign AI-Powered Silicon Design Framework
2
 
3
+ ![Status](https://img.shields.io/badge/Status-Production_Ready-green) ![Python](https://img.shields.io/badge/Python-3.10%2B-blue) ![License](https://img.shields.io/badge/License-MIT-green) ![OpenLane](https://img.shields.io/badge/OpenLane-Integrated-purple) ![Verification](https://img.shields.io/badge/Formal_Verification-SVA-red) ![UI](https://img.shields.io/badge/Web_UI-Streamlit-FF4B4B)
4
 
5
  **AgentIC** is an automated, sovereign AI Agent framework that transforms natural language descriptions directly into industry-standard physical chip layouts (GDSII). Unlike simple code generators, AgentIC employs a **Self-Correcting Multi-Agent System** that iteratively designs, verifies, fixes, and physically hardens custom silicon.
6
 
7
+ It acts as a **"Text-to-Silicon" Compiler**, orchestrating a crew of specialized AI agents (Architect, Designer, Verification Engineer, Physical Design Lead) to ensure functional correctness and manufacturabilityโ€”with a focus on **Atmanirbhar (Self-Reliant) Defense Applications**.
8
 
9
  ---
10
 
 
26
  end
27
 
28
  subgraph "Phase 2: Formal & Dynamic Verification"
29
+ QA -- Approve --> Formal[Dual-Mode SVA]
30
+ Formal -->|Industry SVA| Commercial[Commercial EDA]
31
+ Formal -->|Yosys SVA| SymbiYosys[SymbiYosys Proof]
32
+ SymbiYosys -->|Mathematical Proof| Testbench[Testbench Agent]
33
  Testbench -->|Simulation| Sim{Icarus Verilog}
34
  Sim -- Fail --> Debugger[Error Analyst]
35
  Debugger -->|Fix Logic| Designer
 
38
 
39
  subgraph "Phase 3: Deep Physical Hardening"
40
  Sim -- Pass --> OpenLane[OpenLane Flow]
41
+ OpenLane -->|GDSII| PPA[PPA Dashboard]
42
  PPA -- "Timing/Area Violations" --> Optimizer[Backend Engineer]
43
  Optimizer -->|Optimize RTL| Designer
44
  end
45
 
46
+ PPA -- "Metrics OK" --> Tapeout([Final GDSII + 2D/3D Visualization])
47
  ```
48
 
49
  ---
50
 
51
+ ## ๐Ÿš€ Key Capabilities v3.0
52
 
53
+ ### 1. ๐Ÿ–ฅ๏ธ Mission Control Web UI (NEW)
54
+ A full-featured **Streamlit-based Web Dashboard** with a futuristic "Deep Space" glassmorphism theme:
55
+ * **Dashboard**: Real-time PPA metrics (WNS, Power, Area, Gate Count) with live extraction from OpenLane runs
56
+ * **AI Advisor**: Intelligent diagnostics and optimization recommendations based on design analysis
57
+ * **Design Studio**: Natural language design input + integrated Verilog code editor (Monaco/Ace)
58
+ * **Market Benchmarking**: Compare your indigenous designs against industry standards (Nvidia Jetson, Military FPGAs, etc.)
59
+ * **Fabrication**: 2D SVG layout preview + interactive 3D layer stack visualization (Sky130 layers)
60
+ * **GDSII Download**: One-click tapeout file download
61
+
62
+ ### 2. ๐Ÿ›ก๏ธ Robust "Anti-Hallucination" Engine
63
+ Traditional LLMs often leak "thought processes" or Markdown artifacts into code, breaking compilers. AgentIC v3.0 features:
64
+ * **Hardened VLSI Tools**: Custom I/O handlers (`vlsi_tools.py`) that strictly sanitize outputs, stripping `<think>` tags, "Thought:", "Action:", and non-Verilog artifacts.
65
  * **Compiler-Aware Auto-Fix**: Automatically detects and repairs syntax errors (e.g., mismatched port widths, invalid SystemVerilog constructs) without human intervention.
66
+ * **Security Audit**: Built-in `SecurityCheck()` function scans for malicious patterns (`$system`, shell commands, etc.)
67
+ * **Filesystem Guard**: Enforces correct file extensions (`.sv`, `.v`, `.tcl`) and prevents file path traversal attacks.
68
+
69
+ ### 3. ๐Ÿง  Dual-Mode Formal Verification (NEW)
70
+ * **Industry-Standard SVA**: Generates proper `property`/`assert property` SystemVerilog Assertions compatible with commercial tools (Synopsys, Cadence)
71
+ * **Yosys-Compatible SVA**: Auto-converts assertions to SymbiYosys format for open-source k-induction proofs
72
+ * **Dynamic Simulation**: Generates self-checking testbenches with proper FSM timing analysis
73
+ * **Root Cause Analysis**: AI `Error Analyst` determines if bugs are in RTL or Testbench, fixing the correct file
74
 
75
+ ### 4. ๐Ÿ”„ Resilient LLM Fallback Chain (NEW)
76
+ Multi-tier LLM failover for operational continuity:
77
+ ```
78
+ NVIDIA Nemotron/Llama 405B โ†’ NVIDIA Backup โ†’ Groq Cloud โ†’ Local LLM
79
+ ```
80
+ * Supports air-gapped deployment with local models (Qwen Coder, Llama)
81
+ * Automatic fallback on API failures
82
 
83
+ ### 5. ๐Ÿญ Physical Design Feedback Loop (PPA)
84
  * **Beyond Code**: AgentIC checks real-world metricsโ€”**Power, Performance (Timing), and Area**.
85
+ * **Dynamic Standards**: Automatically calculates expected PPA standards based on gate count and design complexity
86
  * **Optimization Cycle**:
87
  * If **Timing** fails (Negative Slack), the agent inserts pipeline stages.
88
  * If **Area** is too high (Congestion), the agent simplifies logic or increases core size.
89
+ * **OpenLane Integration**: Full control over `config.tcl` generation and disaster recovery.
90
+
91
+ ### 6. ๐Ÿ‡ฎ๐Ÿ‡ณ Atmanirbhar Benchmarking (NEW)
92
+ Compare your sovereign designs against market alternatives:
93
+ * **Cost Analysis**: INR-based unit cost comparison with savings calculation
94
+ * **Performance Radar**: Power efficiency, manufacturing readiness, supply chain independence, security trust
95
+ * **AI Verdict**: Automatic domain detection (Security, Edge AI, General Purpose) with deployment recommendations
96
 
97
  ---
98
 
 
104
  * **Docker** (for OpenLane)
105
  * **Icarus Verilog** (`sudo apt install iverilog`)
106
  * **GTKWave** (optional, for viewing waveforms)
107
+ * **SymbiYosys** (optional, for formal verification - install via [oss-cad-suite](https://github.com/YosysHQ/oss-cad-suite-build))
108
 
109
  ### Setup
110
 
 
122
  3. **Configure Environment**
123
  Create a `.env` file in the root directory:
124
  ```bash
125
+ # LLM Provider (Examples - uses fallback chain automatically)
 
 
126
  NVIDIA_API_KEY="nvapi-..."
127
+ # OR
128
+ GROQ_API_KEY="gsk_..."
129
+ # OR
130
+ OPENAI_API_KEY="sk-..."
131
 
132
  # Tool Paths (Optional, defaults provided)
133
  OPENLANE_ROOT="/home/user/OpenLane"
 
138
 
139
  ## ๐Ÿ’ป Usage
140
 
141
+ ### 1. ๐Ÿš€ Launch Web UI (Recommended)
142
+ The easiest way to use AgentIC is via the Mission Control dashboard:
143
+ ```bash
144
+ streamlit run AgentIC/app.py
145
+ ```
146
+ Then open `http://localhost:8501` in your browser.
147
+
148
+ ### 2. Build a Chip (CLI)
149
+ The `build` command runs the full flow: Architecture โ†’ RTL โ†’ Verify โ†’ GDSII.
150
 
151
  ```bash
152
  python3 AgentIC/main.py build \
153
+ --name bharat_secure_comm \
154
+ --desc "AES-256 encryption accelerator with key expansion and GCM authentication mode"
155
  ```
156
 
157
  **Options:**
 
159
  * `--skip-openlane`: Stops after verification (useful for quick RTL iteration).
160
  * `--max-retries 5`: Sets how many times the agent can attempt to fix its own errors.
161
 
162
+ ### 3. Manual Simulation & Fix
163
  If you have existing code and just want the agent to fix bugs:
164
  ```bash
165
+ python3 AgentIC/main.py simulate --name my_design --max-retries 10
166
  ```
167
 
168
+ ### 4. Hardening Only
169
  To run OpenLane physical design on an existing Verilog file:
170
  ```bash
171
+ python3 AgentIC/main.py harden --name my_design
172
  ```
173
+ Supports background execution for long runs (10-30+ minutes).
174
 
175
  ---
176
 
177
+ ## ๐Ÿ—๏ธ Project Structure
178
+
179
+ ```
180
+ AgentIC/
181
+ โ”œโ”€โ”€ app.py # Streamlit Web UI (Mission Control)
182
+ โ”œโ”€โ”€ main.py # CLI Entry Point
183
+ โ”œโ”€โ”€ requirements.txt
184
+ โ”œโ”€โ”€ src/
185
+ โ”‚ โ””โ”€โ”€ agentic/
186
+ โ”‚ โ”œโ”€โ”€ cli.py # Core pipeline commands
187
+ โ”‚ โ”œโ”€โ”€ config.py # LLM & path configuration
188
+ โ”‚ โ”œโ”€โ”€ agents/
189
+ โ”‚ โ”‚ โ”œโ”€โ”€ designer.py # RTL generation agent
190
+ โ”‚ โ”‚ โ”œโ”€โ”€ testbench_designer.py
191
+ โ”‚ โ”‚ โ””โ”€โ”€ verifier.py # SVA & error analysis agents
192
+ โ”‚ โ””โ”€โ”€ tools/
193
+ โ”‚ โ””โ”€โ”€ vlsi_tools.py # File I/O, simulation, OpenLane
194
+ โ”œโ”€โ”€ designs/ # Example designs
195
+ โ””โ”€โ”€ artifacts/ # Generated GDSII outputs
196
+ ```
197
+
198
+ ### Agent Crew Architecture
199
 
200
+ | Agent | Role | Primary Tools |
201
  | :--- | :--- | :--- |
202
+ | **Chief System Architect** | Defines Micro-Architecture, FSM States, Interfaces | Markdown Specs |
203
+ | **VLSI Designer** | Writes Synthesizable SystemVerilog RTL | `write_verilog`, `syntax_check_tool` |
204
+ | **Senior Silicon Architect** | QA - Rejects multi-drivers, latches, huge arrays | Static Analysis |
205
+ | **Verification Agent** | Industry SVA + Yosys SVA generation | `write_sby_config`, `convert_sva_to_yosys` |
206
+ | **Testbench Agent** | Self-checking testbench with FSM timing | `run_simulation` |
207
+ | **Error Analyst** | Root cause classification (RTL vs Testbench) | Log parsing |
208
+ | **Backend Engineer** | OpenLane config.tcl + PPA optimization | `run_openlane` |
209
 
210
  ---
211
 
 
217
 
218
  ### "Simulation Failed (Compilation Error)"
219
  * **Cause**: LLM hallucinated invalid syntax.
220
+ * **Fix**: AgentIC v3.0 auto-fixes most issues. Use `--max-retries 10` for complex designs.
221
+
222
+ ### "Code contains 'Thought:' or `<think>` lines"
223
+ * **Status**: **SOLVED**. The `vlsi_tools.py` regex filters strip these artifacts automatically.
224
+
225
+ ### "Formal Verification Skipped"
226
+ * **Cause**: SymbiYosys (sby) not installed.
227
+ * **Fix**: Install [OSS CAD Suite](https://github.com/YosysHQ/oss-cad-suite-build) or continue without (industry SVA still generated for commercial tools).
228
+
229
+ ### "LLM API Failed"
230
+ * **Cause**: API key invalid or service down.
231
+ * **Fix**: AgentIC automatically falls back through the chain: NVIDIA โ†’ Groq โ†’ Local. Ensure at least one valid key is set in `.env`.
232
 
233
+ ---
234
+
235
+ ## ๐Ÿ” Security Features
236
+
237
+ * **No Code Exfiltration**: Supports fully local/air-gapped LLM deployment
238
+ * **Input Sanitization**: Blocks `$system`, shell commands, and path traversal attacks
239
+ * **Auditable Output**: All generated code is human-readable SystemVerilog (no binary blobs)
240
+ * **Secure Communication Designs**: Built-in support for AES-256, GCM authentication, and tamper detection modules
241
+
242
+ ---
243
+
244
+ ## ๐ŸŽฏ Defense Application Examples
245
+
246
+ * **Secure Lockout Mechanism**: FSM-based PIN verification with lockout after N failed attempts
247
+ * **Bharat NPU**: Indigenous Neural Processing Unit for edge AI
248
+ * **Secure Communication Block**: AES-256 with key expansion, encryption/decryption/authentication modes
249
+ * **Tamper Detection**: Hardware-level tamper response with key zeroization
250
 
251
  ---
252
 
253
  ## ๐Ÿ“œ License
254
  MIT License. Free for Research and Sovereign Development.
255
+
256
+ ---
257
+
258
+ ## ๐Ÿค Contributing
259
+ Contributions are welcome! Please see the project wiki for development guidelines.
260
+
261
+ ## ๐Ÿ“š References
262
+ * [OpenLane Documentation](https://openlane.readthedocs.io/)
263
+ * [SkyWater 130nm PDK](https://skywater-pdk.readthedocs.io/)
264
+ * [SymbiYosys Documentation](https://symbiyosys.readthedocs.io/)