How ct7-labs/argon-cpu works
Project Overview
• This is a RISC-like CPU written in SystemVerilog intended for an iCE40HX8K implementation. It’s part of the Oganesson SoC project and serves as a learning platform for optimized, resource-constrained digital design.
• Key features include a 16-bit datapath, 24-bit address space with banking, a 32-bit instruction width, and a classic five-stage RISC execution model (though not pipelined yet).
Main Components
• Top-Level Module (SimTop.sv): Acts as the integration point for the CPU design, tying together all core components.
• ALU (ArgonALU.v): The arithmetic and logic unit responsible for performing operations.
• Instruction Cache (ArgonInstructionCache.v): Contains a 64B I-cache dedicated to instruction fetching.
• Register File (ArgonRegFile.v): Houses the 16 general-purpose registers.
• System Cache (ArgonSysCache.v): This is likely responsible for the unified system caching (instruction and data or possibly split caches); note the 4kB system cache mentioned in the README.
• Testbench (testbench.cpp): Provides the testbench environment to simulate and verify the design.
Relationships and Interactions
• The SimTop module should be depicted as the central node, interfacing with all subsidiary modules.
• From SimTop to each core module (ALU, Instruction Cache, Register File, System Cache) to show data/control signals.
• How the instruction flow moves: Instructions are fetched via the Instruction Cache, processed using the Register File and ALU, and memory operations are handled by the System Cache.
• A feedback loop from the ALU for flag generation and control signal updates, if applicable.
Architectural Patterns & Design Principles
• This is a classic RISC design with a five-stage execution model (despite being non-pipelined in this version).
• Separation of concerns: Each module (ALU, caches, registers) is self-contained but integrated via the top-level module.
Technologies & Frameworks
• Mention that the design may involve simulation aspects (indicated by the testbench in C++), which suggests a mixed simulation environment.
Instructing the Principal Software Engineer
• Branch out nodes for:
• CPU datapath components (ALU, Register File).
• Memory interfaces (Instruction Cache, System Cache).
• The flow of instructions from the Instruction Cache into the CPU core.
• Data pathways between the CPU core (ALU, Register File) and the System Cache.
• With design notes about:
• The 5-stage, classic RISC pipeline model (even if not pipelined, the stages should be illustrated, perhaps with the plan for future versions).
• How resource optimizations might affect module interconnections.
• A separate section or note for the testbench indicating how simulation/verification interacts with the SimTop module.