How trnam41/verilogdb-ai works
VerilogDB-AI turns a Vietnamese or English hardware request into a verified Verilog-2001 design and Quartus project. Its main workflow plans a test contract, retrieves relevant examples, generates and lints RTL, simulates it with repair on failure, then optionally compiles and emits project artifacts. Separate data curation and model-training capabilities sustain the RAG database and LoRA adapter. Several internal links are based on README descriptions or SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: design.py Workflow coordinator · hardware_db.json VerilogDB · local_api.py Local model service · knowledge_matcher.py Semantic RAG
Components 24
Specification planning
- Workflow coordinator
agent/design.py - Spec analyzer
agent/spec_analyzer.py - Contract planner
agent/design_contract.py
RTL generation
- Local model service
agent/local_api.py - RTL generator
agent/rtl_generator.py
Verification and repair
- Verilog linter
agent/verilog_linter.py - Testbench generator
agent/tb_generator.py - Simulation runner
agent/simulator.py - Repair loop
agent/reflection_loop.py - Port auditor
agent/port_auditor.py
Quartus outputs
- Synthesis profiler
agent/synthesis_profiler.py - Block diagram exporter
agent/bdf_generator.py - Waveform exporter
agent/vwf_generator.py
Knowledge and training
- Semantic RAG
agent/knowledge_matcher.py - Verified-data flywheel
agent/flywheel.py - VerilogDB
knowledge_base/hardware_db.json - Database curation
training/curate_verilogdb.py - Dataset ingestion
training/ingest_clean_1000.py - Corpus builder
training/build_corpus.py - RAG training
training/train_semantic_rag.py - LoRA training
training/train_output_lora.py - LoRA adapter
training/artifacts/rtl-output-lora.gguf
Other components
- Hardware designer
- EDA toolchain
Connections 26
- Hardware designer → Workflow coordinator: submits request
README.md - Workflow coordinator → Spec analyzer: analyzes spec
agent/design.py - Workflow coordinator → Contract planner: plans contract
README.md - Workflow coordinator → Semantic RAG: retrieves examples
README.md - Workflow coordinator → Local model service: requests generation
README.md - Local model service → RTL generator: generates RTL
README.md - Workflow coordinator → Verilog linter: checks RTL
README.md - Workflow coordinator → Testbench generator: builds tests
README.md - Workflow coordinator → Simulation runner: runs simulation
README.md - Simulation runner → EDA toolchain: executes simulation
README.md - Workflow coordinator → Repair loop: repairs failures
README.md - Repair loop → Local model service: requests repair
README.md - Workflow coordinator → Port auditor: audits ports
- Workflow coordinator → Synthesis profiler: checks synthesis
- Synthesis profiler → EDA toolchain: reads reports
agent/synthesis_profiler.py - Workflow coordinator → Block diagram exporter: exports diagram
- Workflow coordinator → Waveform exporter: exports waveform
- Workflow coordinator → Verified-data flywheel: harvests successes
README.md - Verified-data flywheel → VerilogDB: updates database
README.md - Database curation → VerilogDB: curates entries
training/curate_verilogdb.py - Dataset ingestion → VerilogDB: ingests examples
training/ingest_clean_1000.py - Corpus builder → VerilogDB: builds corpus
- RAG training → Semantic RAG: trains retrieval
README.md - LoRA training → LoRA adapter: produces adapter
README.md - LoRA adapter → Local model service: configures model
README.md - VerilogDB → Semantic RAG: provides examples