CSR Daisy-Chain Flow
CSR Daisy-Chain Flow is the technique by which core CSR requests are propagated from one CSR group to the next in a daisy-chain topology within the CSRBox-generated design. The goal is to locate the CSR group that owns the requested address, then return a CSR response on a hit.
Mechanism
- Core requests are queued and forwarded group-to-group in a daisy-chain manner until they reach the group whose address space contains the requested CSR.
- On a miss in the current group, the request is forwarded to the next node using an
ActionValuemethod in combination with a FIFO buffer. - On a hit (the requested address matches an address registered by the CSR decoder for that group), a CSR Response is recorded.
Place in the CSRBox pipeline
The daisy-chain is the output-side response/dataflow portion of CSRBox's overall working pipeline:
- Input: an ISA spec YAML (normalized via
riscv-config) and a grouping spec YAML describing how CSRs are grouped. - Process: the CSRs present in both YAMLs are checked for size, description, address, and shadow CSRs. This drives generation of the attribute YAML, CSR decoder (a Bluespec demultiplexer-like address comparator that produces a validity
bool), CSR defines (auto-generated address macros), and WARL support (regex-driven legalization of WARL strings into Bluespec code). - Output: generated Bluespec is placed under a working directory; the daisy-chain request/response flow is one of the artifacts produced after successful Bluesim and Verilog compilation.
CSR coverage scope
CSRBox 1.0.1 supports all machine-mode CSRs and the corresponding supervisor- and user-mode CSRs that depend only on the 'U' extension (machine CSRs include MVENDORID, MARCHID, MIMPID, MHARTID, MISA, MTVEC, MEDELEG, MIDELEG, MIE, MCOUNTEREN, MSTATUS, MIP, MSCRATCH, MEPC, MCAUSE, MTVAL, PMPCFG0–PMPCFG15, PMPADDR0–PMPADDR63, MCYCLE, MINSTRET, MHPMCOUNTER3–MHPMCOUNTER31 and their high halves, MCOUTNINHIBIT, and MHPMEVENT3–MHPMEVENT31; user CSRs include USTATUS, UIP, UIE, UTVEC, UEPC, UTVAL, UCAUSE, USCRATCH, CYCLE, INSTRET, HPMCOUNTER3+).
Notes
- The daisy-chain relies on each group exposing an address-decoding function (the CSR Decoder) so misses can be detected and forwarded.
- Forwarding between groups uses an
ActionValueplus a FIFO rather than combinational broadcast across all groups.