بنقرة واحدة
workflow
Full auto-toolchain: parse, generate Chisel, compile, lint, testbench, simulate, report.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Full auto-toolchain: parse, generate Chisel, compile, lint, testbench, simulate, report.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Run full Chipyard-to-ORFS PnR flow for large designs (SmallBOOM etc.) using All-Mock memory blackboxing in Docker: generate RTL, preprocess nosram, run multi-round ORFS synth->finish with mock SRAMs to avoid OOM.
Docker Chipyard flow: generate RTL from a Chipyard config via Docker, run SRAM mapping, stage artifacts into MyDesign, and hand off to PnR.
Run full Chipyard-to-ORFS PnR flow with multi-round parameter iteration in Docker: generate RTL from Chipyard Docker, preprocess nosram+SRAM override, run 3 rounds of ORFS synth→finish on sky130hd with progressive clock/utilization/density tuning for optimal PPA.
Run full Chipyard-to-ORFS PnR flow with multi-round parameter iteration: generate RTL from Chipyard with ENABLE_YOSYS_FLOW, preprocess nosram+SRAM override, run 3 rounds of ORFS synth→finish on sky130hd with progressive clock/utilization/density tuning for optimal PPA.
Unified Chipyard PnR flow: automatically routes to local or Docker workflow based on backend_mode setting.
Unified Chipyard flow: automatically routes to local or Docker workflow based on backend_mode setting.
| name | workflow |
| description | Full auto-toolchain: parse, generate Chisel, compile, lint, testbench, simulate, report. |
| disable-model-invocation | true |
| allowed-tools | ["Bash","Read","Write","Edit","Grep","Glob"] |
Full auto-toolchain pipeline: turn a natural language hardware description into simulation-verified Verilog.
Given a plain-English description of a digital hardware module, this command orchestrates a multi-stage pipeline that produces lint-clean, simulation-verified Verilog output.
Create the checklist and go on.
□ Initialize Project structure
□ Parse Requirements
□ Confirm Spec
□ Generate Chisel code
□ Compile to Verilog
□ Lint verification
□ Generate testbench
□ Run simulation
□ Generate verification report
/chip-agent:workflow <hardware description>
Example:
/chip-agent:workflow An 8-bit ALU that supports ADD, SUB, AND, OR, XOR, and SLT operations with a zero flag output
Determine the project root directory by finding the nearest ancestor directory '.claude'. Use that directory as the base for all relative paths below.
After the module name is determined from the spec (Step 1), run the project-init subagent to set up the per-module project structure inside the MyDesign/ container.
Bash commands to execute:
PROJECT_ROOT="<project-root>" # e.g. /home/aa/snap/ChipAgent-main
CONTAINER="MyDesign" # all projects live inside this folder
MODULE="<ModuleName>" # e.g. ALU8
PROJECT_DIR="$PROJECT_ROOT/$CONTAINER/$MODULE"
WORKSPACE_DIR="$PROJECT_DIR/workspace"
# Create MyDesign container if it doesn't exist
mkdir -p "$PROJECT_ROOT/$CONTAINER"
# Create project folder and workspace
mkdir -p "$WORKSPACE_DIR/generated" "$WORKSPACE_DIR/sim/logs"
# Symlink chisel-project (two levels up from MyDesign/<Module>/)
rm -f "$PROJECT_DIR/chisel-project"
ln -s "../../chisel-project" "$PROJECT_DIR/chisel-project"
echo "Project initialized: $PROJECT_DIR"
Project folder structure:
<project-root>/
├── chisel-project/ ← shared, all module source lives here
├── MyDesign/ ← project container
│ ├── ALU8/
│ │ ├── chisel-project/ ← symlink → ../../chisel-project
│ │ └── workspace/
│ │ ├── generated/
│ │ ├── sim/
│ │ └── spec.json
│ ├── ALU4/
│ │ ├── chisel-project/ ← symlink → ../../chisel-project
│ │ └── workspace/
│ └── PriorityEncoder4/
│ ├── chisel-project/
│ └── workspace/
If the project folder already exists inside MyDesign/, skip creation and continue.
If the project folder already exists, skip creation and continue.
Read the requirement-parser agent definition at agents/requirement-parser.md (relative to project root) and follow its rules to extract a structured JSON spec from the user's hardware description ($ARGUMENTS).Run the agentto return the json spec.
The agent returns a JSON object. For simple designs: moduleName, type: "simple", ports, operations, flags, and constraints. For complex designs: moduleName, type: "complex", modules[], and topModule.
Validation: Verify the JSON is valid -- moduleName is PascalCase, all ports have direction/type/width, operations have opcodes. For complex specs, verify that topModule.submodules matches the names in modules[]. If the JSON is malformed, retry the parser once.
Step 0 MUST run first to create the project folder before writing spec.json.
Write spec to disk using the Write tool:
MyDesign/<ModuleName>/workspace/spec.json
The requirement-parser agent returns JSON to conversation only -- it does NOT write files. This step MUST capture the JSON and write it to disk so that all downstream steps can read it.
Before generating code, present the parsed spec to the user for approval.
Format the spec preview:
Ask for confirmation using AskUserQuestion with these options:
Only proceed to Step 2 after the user selects "Approve and generate".
Read the chisel-generator agent definition at agents/chisel-generator.md (relative to project root) and follow its rules with the JSON spec to produce Chisel source files. Run the agent to generate the Chisel source code.
For simple specs (type: "simple"):
The agent writes two files:
MyDesign/<ModuleName>/chisel-project/src/main/scala/chipagent/<ModuleName>.scalaGenerate.scala with the new module in the match statementFor complex specs (type: "complex"):
The agent writes N+1 files:
MyDesign/<ModuleName>/chisel-project/src/main/scala/chipagent/<SubModuleName>.scala for each entry in modules[]MyDesign/<ModuleName>/chisel-project/src/main/scala/chipagent/<TopModuleName>.scala that instantiates and wires all sub-modulesGenerate.scala with the top module name (the top module pulls in sub-modules automatically)Read and correct the Generate.scala in chisel-project first to generate your own module,then run the compilation script EXPLICITLY with the module name:
<project-root>/scripts/compile.sh <ModuleName>
The compile script resolves paths as:
PROJECT_DIR = <project-root>/MyDesign/<ModuleName>/chisel-projectOUTPUT_DIR = <project-root>/MyDesign/<ModuleName>/workspace/generatedDo NOT rely on the PostToolUse hook for compilation. The orchestrator calls compile.sh directly.
If compilation fails:
agents/chisel-generator.md) to fix the issues in the generated Scala files<project-root>/scripts/compile.sh <ModuleName> after fixingCOMPILE AUTO-FIX FAILED after 3 attempts.
Remaining errors:
<paste compile error output>
Run Verilator lint on the generated Verilog with the module name:
<project-root>/scripts/lint.sh <ModuleName>
If lint passes (exit 0), continue to Step 5.
If lint fails (non-zero exit):
agents/chisel-generator.md) to fix the Chisel source (NOT the generated Verilog -- never edit generated files)<project-root>/scripts/compile.sh <ModuleName> after fixing<project-root>/scripts/lint.sh <ModuleName> after compile succeedsIf lint still fails after 3 attempts, STOP the pipeline and report:
LINT AUTO-FIX FAILED after 3 attempts.
Remaining errors:
<paste lint error output>
After lint passes, check MyDesign/<ModuleName>/workspace/generated/lint-warnings.log. If non-empty, note the warnings:
Lint passed with N warnings (suppressed/non-blocking):
<paste warning summary>
Read the testbench-generator agent definition at agents/testbench-generator.md (relative to project root). Run the agent to generate the testbench.
Run the simulation script with the module name:
<project-root>/scripts/simulate.sh <ModuleName>
If simulation fails (non-zero exit):
MyDesign/<ModuleName>/workspace/sim/logs/sim_result.log for failure detailsMyDesign/<ModuleName>/workspace/sim/tb_<ModuleName>.cpp with corrected test vectors<project-root>/scripts/simulate.sh <ModuleName> after fixingSIM AUTO-FIX FAILED after 3 attempts.
Remaining failures:
<paste sim_result.log content>
On success, proceed to Step 7.
Format the simulation results into a verification report:
MyDesign/<ModuleName>/workspace/sim/logs/sim_result.logMyDesign/<ModuleName>/workspace/generated/lint-warnings.log), include them=== Verification Report: <ModuleName> ===
Verilog: MyDesign/<ModuleName>/workspace/generated/<ModuleName>.v
Testbench: MyDesign/<ModuleName>/workspace/sim/tb_<ModuleName>.cpp
Simulation: PASSED X/Y tests
[per-test results from sim_result.log]
Lint: PASSED (N warnings suppressed)
[warning details if any]
| # | Stage | Description |
|---|---|---|
| 0 | Initialize Project | Create per-module folder with symlink + workspace |
| 1 | Parse Requirements | Extract module name, ports, operations from NL |
| 1.5 | Confirm Spec | Present parsed spec for user approval |
| 2 | Generate Chisel | Produce Chisel source from structured spec |
| 3 | Compile to Verilog | sbt compiles Chisel to SystemVerilog via firtool |
| 4 | Lint | Verilator lint-only check on generated Verilog |
| 5 | Generate Testbench | Create C++ testbench for Verilator simulation |
| 6 | Simulate | Run Verilator simulation and collect results |
| 7 | Report | Format test results into verification report |
$ARGUMENTS
A natural language description of a digital hardware module. The description should include:
Upon pipeline completion, the following artifacts are produced in MyDesign/<ModuleName>/:
workspace/spec.json -- structured JSON specificationworkspace/generated/<ModuleName>.v -- synthesizable Verilogworkspace/generated/<ModuleName>.sv -- SystemVerilog variant (when firtool is available)workspace/generated/lint-warnings.log -- any remaining Verilator warnings with explanationsworkspace/sim/tb_<ModuleName>.cpp -- C++ Verilator testbenchworkspace/sim/logs/sim_result.log -- simulation test report