How ztachip/ztachip works
Main Components
• Hardware Block:
• RISC-V Core: Typically implemented by the VexRiscv CPU that coordinates system control.
• Mcore (Scheduling Processor): Manages scheduling on the accelerator.
• Dataplane: Feeds data and instructions to the tensor engine.
• Tensor Engine: Contains 28 (configurable) Pcores configured as a systolic array for in-memory computation, with individual ALUs and multi-threaded execution.
• Scratch-Pad Memory: For temporary data storage.
• Stream Processor: Handles I/O operations across the bus.
• Peripherals: Such as DRAM, camera interfaces, VGA output, and additional I/O.
• AXI Bus: The central communication fabric that wires together the main hardware components and peripherals.
• FPGA/ASIC Wrapper: Under “HW/platform”, show different implementation branches (Xilinx, Altera, simulation).
• Software Block:
• Ztachip DSL Compiler (in SW/compiler): Translates the C-like DSL into accelerator instructions.
• AI Vision Libraries and Application Examples (in SW/apps): Implements vision kernels (e.g., canny edge, Harris corner, neural nets, optical flow, etc.) demonstrating the acceleration.
• Runtime Libraries and Base Drivers (in SW/base & SW/src): Provide runtime support and SoC integration, including C/C++ or Micropython interfaces.
• Micropython Port: A separate branch (micropython folder) which offers a Python programming interface to run on the accelerator.
• File System/Inference Data (in SW/fs): Holds AI models and other binary data transferred to the system.
• Tools & Documentation:
• FPGA build and simulation scripts (under tools) for firmware programming and hardware simulation.
• Documentation directories that offer detailed technical overviews and hardware/software design guides.
Relationships and Interactions
• A separation between the hardware (physical RTL components and interconnects) and the software (compiler, runtime, and applications).
• For the Hardware:
– Indicate “Platform” wrappers that allow for different FPGA/ASIC implementations.
• For the Software:
– Map out the flow from high-level application code (e.g., vision tasks) written in either C/C++ or Micropython down through the runtime libraries and the DSL compiler to the generated instructions that drive the hardware accelerator.
– Show the DSP compiler output connecting to the hardware accelerator.
• Build and simulation process to both hardware (verified via simulation RTL files) and software images (standalone image vs. micropython image).
Architectural Patterns and Design Principles
• Hardware/Software Co-design: The system is clearly divided into an accelerator hardware block and its corresponding software stack.
• Modular and Layered Approach: For the hardware, modules such as the dataplane, tensor engine, and peripherals are isolated; for the software, separate modules exist for the DSL compiler, application libraries, and runtime environment.
• Dual-Boot Options: Clearly indicate the two build images – one standalone (native C/C++ interface) and one micropython-based, emphasizing how applications interface with the system.