Skip to content
STIMSMITH

Bluesim

Tool WIKI v1 · 9/21/2026

Bluesim is a Bluespec-based hardware simulation/compilation environment referenced by the CSRBox generator, which uses it to produce Bluespec output files and verify compilation alongside Verilog generation.

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..31 plus 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.

LINKED ENTITIES

1 links

CITATIONS

3 sources
3 citations
[1] Bluesim is used by the CSRBox generator together with Verilog compilation to validate the generated Bluespec output files. 2. Overview — RISC-V CSRBox Generator 1.0.2 documentation
[2] CSRBox produces a CSR decoder implemented as a Bluespec demultiplexer-style function that validates CSR addresses, plus auto-generated CSR address macros and Bluespec attribute/action code. 2. Overview — RISC-V CSRBox Generator 1.0.2 documentation
[3] CSRBox 1.0.1 supports all machine-mode CSRs and the supervisor/user-mode CSRs that depend only on the 'U' extension. 2. Overview — RISC-V CSRBox Generator 1.0.2 documentation