How lowrisc/ariane works
Project Context
• The Ariane CPU is a 6-stage, in-order RISC-V core. Its L1 cache subsystem lives under src/cache_subsystem/. There are two flavors:
• The “std” (standard) cache subsystem (std_cache_subsystem.sv + supporting files)
• The “serpent” cache subsystem (serpent_cache_subsystem.sv + supporting files) for OpenPiton integration
Identifying Main Components
• cache_ctrl.sv – overall cache controller, coordinates requests and responses
• miss_handler.sv – tracks outstanding misses, arbitration, refill logic
• tag_cmp.sv – tag comparison logic for cache hits/misses
• std_cache_subsystem.sv – top-level wrapper for the standard L1 D-cache
• serpent_cache_subsystem.sv – wrapper for the serpent variant (write-through)
• serpent_dcache.sv, serpent_dcache_mem.sv, serpent_dcache_ctrl.sv, serpent_dcache_wbuffer.sv, serpent_icache.sv – sub-blocks specialized for serpent flavor
• std_nbdcache.sv, std_no_dcache.sv – alternative modes (no cache, non-blocking)
Relationships & Data Flow
• CPU pipeline issues load/store requests → enters cache_ctrl
• cache_ctrl forwards to tag_cmp and data RAM (hit path)
• On a miss, cache_ctrl signals miss_handler
• miss_handler sends read/write bursts over AXI (through axi_mem_if)
• refill data returns into data RAM; tag_ram is updated
• cache_ctrl releases data back to pipeline
Architectural Patterns & Principles
• Hierarchical design: top-level subsystem instantiates controller, tag comparison, miss logic, line RAM modules
• Decoupled hit vs. miss paths for performance (non-blocking)
• AXI bus interface for memory coherence and external connectivity
• Parameterizable for line size, associativity