How psychogenic/microcotb works
Main Components
a) Core Testing Framework Layer:
• Main microcotb components (Runner, Clock, Triggers, DUT base)
• Decorators subsystem (@cocotb.test, @parametrize)
b) Platform Abstraction Layer:
• Different platform implementations (RP2040, Raspberry Pi, FPGA)
• Platform detection and features management
• To hardware interaction components
c) Hardware Interface Layer:
• Various hardware connection methods (USB Bridge, GPIO, SPI)
• Signal monitoring and control paths
• VCD generation capabilities
Component Relationships
[Test Scripts] → [microcotb Core Framework]
• ↓
[Platform Abstraction Layer] ←→ [Feature Detection]
• ↓
[Hardware Interface Layer] → [Physical Hardware]
Detailed Component Breakdown
Core Framework (Center):
┌─ microcotb Core ─────────────┐
• Test Runner │
• Clock Management │
• Trigger System │
• DUT Base Class │
• Decorators │
• ┘
Platform Layer (Middle):
┌─ Platform Support ──────────┐
• ┌─RP2040─┐ ┌─RasPi─┐ ┌─FPGA┐│
• MicroPy │ │GPIO │ │USB ││
• ┘ └───────┘ └─────┘│
• ┘
Hardware Interface (Bottom):
┌─ Hardware Interface ────────┐
• Signal Monitoring │
• I/O Control │
• VCD Generation │
• Timing Management │
• ┘
Special Features to Highlight
• Bidirectional communication paths
• Platform-specific optimizations
• VCD waveform generation capability
• Clock management system
• Trigger system (RisingEdge, FallingEdge, Timer)
Implementation Details
• Relationship between test decorators and runner
• How platform detection affects hardware interaction
• Signal monitoring paths
• Timing management system
→ Data Flow
↔ Bidirectional Communication
□ Core Component
○ Platform-Specific Implementation
◇ Hardware Interface