How vortexgpgpu/vortex works
Main Components
• Simulation Backends (sim): Several simulation environments exist, for instance, simx (C++ based simulation), rtlsim, opaesim, and XRt simulation. These define the cycle-accurate or functional simulation paths.
• Runtime & Driver Infrastructure (runtime, kernel): The runtime folder contains kernel runtime libraries and host-side drivers that interface with the hardware or simulators. In addition, the kernel folder provides support libraries and scripts (including linker scripts and intrinsics) for the actual GPU execution.
• Testing and CI (tests, ci): Comprehensive regression, unit tests, and continuous integration scripts to automate builds and simulations.
• Build and Configuration Tools: Files such as configure, Makefiles, and various CI scripts orchestrate the build, toolchain installation, environment settings, and dependency management.
Relationships and Data Flow
• The Host Driver/Runtime Layer initiates the GPU kernel execution and interacts with whichever simulation backend or physical FPGA is selected. The driver script (located in “ci” as well as the host driver scripts in the top level “driver” or “runtime” folders) configures the target environment.
• The simulation subsystem is triggered by user selection – for example, simx is used during rapid prototyping. It interfaces with abstract models of the GPU cores and memory hierarchy.
• In a production environment (or for hardware validation), the RTL design (in hw/rtl and related subdirectories) synthesizes to FPGA bitstreams. Toolchain scripts (e.g., in “ci/toolchain_install.sh” and “ci/toolchain_env.sh”) set up the environment for compiling and deploying to the physical device.
• Testing and continuous integration modules (in tests and ci) are connected to every major component to validate design changes, simulate runtime traces (for debugging as per docs/debugging.md), and run regression benchmarks.
Architectural Patterns and Design Principles
• Modularity and Configurability: The architecture is split along functional boundaries (hardware kernels, simulation models, runtime libraries, and testing) while being highly configurable with options for different pipeline widths, core counts, cache hierarchies, etc.
• Multi-Layer Abstraction: There is clear separation between low-level hardware implementation (RTL source code) and high-level software drivers (runtime libraries, OpenCL support, host-side kernel drivers). This separation allows rapid prototyping in a simulator (simx) before migrating to an RTL or FPGA implementation.
• Multi-Backend Integration: The same high-level interface (driver script) selects among different backend implementations (e.g., C++ simulation, RTL simulation, or FPGA execution) using conditional flows in the code.
Final Assembly
• Below the “Hardware Implementation Block,” further subdivide into modules representing the GPU core microarchitecture (ALU, FPU, LSU units, caches, etc.) as seen in hw/rtl and hw/libs.
• Parallel to this, show the “Simulation” branch subdividing into simx, rtlsim, opaesim, and xrt—which the developer uses for prototyping, testing, and eventual deployment on FPGA.
• CI and regression testing tools with all these layers.