Skip to content

Latest commit

 

History

History
170 lines (130 loc) · 5.74 KB

File metadata and controls

170 lines (130 loc) · 5.74 KB

RTL Copilot - TDD Implementation Task List

Current Focus: Phase 3 - FSM Editor (Weeks 8-11)

Based on the proposal.md and implementation.md documents, implementing visual FSM editor.


Phase 1: Foundation (COMPLETED ✅)

Week 1: Codebase Setup

  • Initialize Next.js 14 project with TypeScript strict mode
  • Configure ESLint/Prettier with Verilog-specific rules
  • Set up project structure (src/, lib/, components/, app/)

Week 2: Testing & CI

  • Configure testing framework (Vitest + React Testing Library)
  • Set up CI/CD pipeline (GitHub Actions)
  • Set up ESLint and linting workflows

Week 3: Database & API

  • Design and implement database schema (projects, modules, prompt_history, validation_cache)
  • Create database migrations with Drizzle ORM
  • Set up API structure scaffolding (Projects, Modules, FSM, LLM endpoints)

Phase 2: Verilog Core (COMPLETED ✅)

Week 4: Verilog Parser

  • Research parsing approaches (Chevrotain chosen)
  • Implement lexer for Verilog tokens (50 tests passing)
  • Implement parser for core subset (modules, always blocks, assign, FSMs)
  • Generate AST representation (types.ts with full type definitions)
  • Write comprehensive parser tests (86 tests total)

Week 5: Verilog Generator

  • Implement AST → Verilog code generator
  • Implement formatting rules (2-space indent, consistent style)
  • Add comment preservation logic (via options)
  • Create template system for common patterns
  • Verify round-trip parsing (8 tests)

Week 6: Validation Engine

  • Implement lint rules (6 rules: undriven-signal, blocking-in-sequential, nonblocking-in-combinational, missing-default-case, incomplete-sensitivity, multi-driven-signal)
  • Integrate with iverilog for syntax validation
  • Implement error message formatting and source mapping

Week 7: Testing & Documentation

  • Unit tests for all parser components
  • Integration tests with real Verilog files (19 tests)
  • Property-based testing with fast-check (13 tests)
  • Parser coverage: 99.22% lines, Lexer: 100% lines
  • Total: 179 tests passing

Phase 3: FSM Editor (Weeks 8-11) - COMPLETED ✅

Week 8: FSM Data Model & Graph Representation

  • Define FSM TypeScript interfaces (FSMState, FSMTransition, FSM)
  • Create FSM store using Zustand
  • Implement state encoding utilities (binary, one-hot, gray)
  • Set up ReactFlow with custom node/edge types
  • Create FSMState custom node component
  • Create FSMTransition custom edge component

Week 9: FSM → Verilog Generator

  • Implement state encoding generator (binary/onehot/gray)
  • Generate state register with reset logic
  • Generate combinational next-state logic
  • Generate output logic (Moore/Mealy)
  • Create FSM template system with customization options
  • Add FSM validation (unreachable states, dead transitions)

Week 10: Verilog → FSM Extractor

  • Pattern matching for FSM structures in AST
  • State encoding detection
  • Transition condition extraction
  • State output assignment extraction
  • Heuristic layout algorithm for visual representation
  • Handle complex FSM patterns (nested states, multiple FSMs)

Week 11: FSM Editor Features

  • State properties panel (name, outputs, isInitial)
  • Transition condition editor with autocomplete
  • Drag-and-drop state creation
  • Connection validation (no dangling transitions)
  • Auto-layout algorithm (force-directed)
  • Undo/redo support with Zustand middleware
  • Real-time Verilog sync (FSM changes → code updates)

Phase 4: LLM Integration (Weeks 12-15)

Week 12: Prompt Engineering

  • Design system prompt for Verilog generation
  • Build few-shot examples database
  • Context injection (existing module ports, signals)
  • Output formatting constraints

Week 13: LLM API Integration

  • Define LLM Provider Interface (Generic)
  • Implement Anthropic (Claude) Provider
  • Implement OpenAI (GPT/Ollama) Provider
  • Create Generic API Route

Week 14: Testbench Generation

  • Analyze module interface (inputs/outputs)
  • Generate clock/reset stimulus
  • Generate test vectors for common cases
  • Add assertion checks

Week 15: Context-Aware Suggestions

  • Autocomplete Logic (Signal names, Keywords)
  • Smart Suggestions (Linting/Fixes)
  • Module Instantiation Templates

Phase 5: Code Editor & UI (Weeks 16-18)

  • Editor Setup (Monaco Install, Theme)
  • Language Features (Completion, Linting)
  • Template Insertion Actions
  • File Tree: Visual explorer for projects/modules
  • Tab System: Manage state for multiple open files
  • Split-View: Integrate Code + FSM editors side-by-side

Week 19: Docker Simulation Environment

  • Dockerfile with iverilog/verilator
  • Simulation Runner (compile, run, parse output)
  • Simulation API Endpoint

Week 20: VCD Waveform Parser

  • VCD Parser (header, value changes)
  • Unit Tests for Parser

Week 21: Waveform Viewer UI

  • WaveformViewer Component (Canvas/SVG)
  • Integration with Toolbar

Phase 7: Polish & Deploy (Weeks 22-24)

  • Performance optimization (security headers, icon optimization)
  • E2E testing with Playwright (6 tests, CI workflow)
  • Security audit (npm audit, CSP headers)
  • Documentation & tutorials (QUICKSTART.md, ARCHITECTURE.md)
  • Production deployment (manual: Vercel setup)

Test Coverage Status

Component Coverage
Lexer 100%
Parser 99.22%
Generator ~85%
Validator ~90%

Commit Strategy

Each task completion = 1 commit with descriptive message following format: feat(scope): description or test(scope): description