riscemu.priv.CSR module
- class riscemu.priv.CSR.CSR
Bases:
object
This holds all Control and Status Registers (CSR)
- mstatus_cache_dirty = True
- __init__()
- virtual_regs: Dict[int, Callable[[], UInt32]]
list of virtual CSR registers, with values computed on read
- set_mstatus(name: str, val: UInt32)
Set mstatus bits using this helper. mstatus is a 32 bit register, holding various machine status flags Setting them by hand is super painful, so this helper allows you to set specific bits.
Please make sure your supplied value has the correct width!
- Parameters:
name –
val –
- Returns:
- callback(addr: Union[str, int])
- virtual_register(addr: Union[str, int])
- dump_mstatus()