Bluesim
Bluesim is the Bluespec simulation/compilation backend invoked by hardware-generation flows that produce Bluespec source code. In the CSRBox generator pipeline, Bluesim is used together with Verilog compilation to validate the automatically generated Bluespec files before they are delivered as output.
Role in CSRBox
CSRBox consumes two YAML inputs (an ISA spec, normalized via riscv-config, and a user-defined Grouping spec) and produces:
- Bluespec attribute definitions (value methods, action methods, dependencies, WARL legalization helpers).
- A CSR decoder implemented as a Bluespec demultiplexer-style function that validates a CSR address.
- Auto-generated CSR address macros.
- Bluespec files implementing the CSR daisy-chain flow, in which core requests are forwarded group-to-group until a hit is recorded and a CSR response is returned.
According to the CSRBox documentation, "These bluespec files are generated after successful bluesim and verilog compilation," indicating that Bluesim is used as a compilation/simulation check gate on the generated Bluespec sources. Intermediate artifacts (the normalized ISA YAML and the generated Bluespec files) are placed under a work directory.
Supported CSR scope (as exercised through CSRBox)
The CSRBox release that documents Bluesim's use (Csrbox 1.0.1) supports:
- All machine-mode CSRs (e.g.,
MVENDORID,MARCHID,MIMPID,MHARTID,MISA,MTVEC,MEDELEG,MIDELEG,MIE,MCOUNTEREN,MSTATUS,MIP,MSCRATCH,MEPC,MCAUSE,MTVAL,PMPCFG0..15,PMPADDR0..63,MCYCLE,MINSTRET,MHPMCOUNTER3..31plus high-half counterparts,MCOUTNINHIBIT,MHPMEVENT3..31). - Corresponding supervisor-mode and user-mode CSRs that depend only on the 'U' extension (e.g.,
USTATUS,UIP,UIE,UTVEC,UEPC,UTVAL,UCAUSE,USCRATCH,CYCLE,INSTRET,HPMCOUNTER3, ...).
Related entity
- CSRBox — generator tool that uses Bluesim as part of its output verification step.