How pulp-platform/ita works
Main Components
• Hardware RTL Modules: Represented by the files in the src directory. Within src, you have major subcomponents like control modules (e.g., ita_controller.sv), compute modules (e.g., ita_dotp.sv, ita_gelu.sv), and specialized blocks (e.g., ita_activation.sv, ita_softmax.sv) as well as other parts like register files and multiplexers.
• Testbenches: Found in src/tb and modelsim directories. These ensure verification and stimulus of the RTL design.
• Test Vector Generator: The PyITA directory and testGenerator.py script form the software front-end that generates ONNX graphs and test vectors.
• Simulation and Verification Infrastructure: Includes the ModelSim simulation scripts and Makefiles (in modelsim and top-level Makefile), along with Bender configuration files (Bender.yml, Bender.lock, etc.) to facilitate automated simulation runs.
• External Tools & Dependencies: Tools like ModelSim for RTL simulation, Bender for script generation, and Python libraries (see requirements.txt) that support test generation and verification.
Relationships and Interactions
• RTL Communication: Illustrate how various RTL modules interact. For example, the control unit coordinates with computation units (dot product, softmax, etc.), data buffers, and memory interfaces. Group these logical units together.
• Simulation Flow: Link the RTL modules with their respective testbenches (both in src/tb and modelsim). Indicate that the simulation scripts (e.g., Makefiles, shell scripts) trigger tests which run through the RTL design, leading to observable outputs (like power, performance, and correctness signals).
Architectural Patterns and Design Principles
• Modular Design: Emphasize the clear separation between functional RTL blocks (e.g., activation, accumulation, and weight control) and the corresponding testbenches. Show separate compartments or consolidation areas for each.
• Streaming and On-the-Fly Computation: Indicate the data streaming mode used by the softmax implementation, reducing data movement – a key architectural aspect.
• Verification and Automated Simulation: Show how the simulation environment (via Makefiles and Bender) automates the testing and validation of the RTL design.
• Software-side: Python for test vector generation, ONNX for representing neural network graphs, and integration with Netron for ONNX visualization.
• Hardware/RTL: SystemVerilog (with files in src/hwpe and other RTL files), and simulation tools like ModelSim.
• Build & Automation Tools: Bender (for simulation script generation), Makefiles, Git workflows, and CI/CD pipelines from .github/workflows.