aboutsummaryrefslogtreecommitdiff
path: root/riscv/processor.h
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2022-03-16 10:02:46 -0700
committerTim Newsome <tim@sifive.com>2022-03-30 10:41:45 -0700
commit59f594a756ab68ec3f9010f5cc9f138be227f6ef (patch)
tree2d3f22f7a219be34bbdb60487e1abd2083426f3c /riscv/processor.h
parentfd315a0ddebdfbee71edbfb60680cdbf43bc4c38 (diff)
downloadspike-59f594a756ab68ec3f9010f5cc9f138be227f6ef.zip
spike-59f594a756ab68ec3f9010f5cc9f138be227f6ef.tar.gz
spike-59f594a756ab68ec3f9010f5cc9f138be227f6ef.tar.bz2
Make a few processor_t members const.
Members: get_xlen(), get_const_xlen(), get_flen() That doesn't mean the value they return will never be changed, but merely that those functions don't modify the processor_t object when called.
Diffstat (limited to 'riscv/processor.h')
-rw-r--r--riscv/processor.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/riscv/processor.h b/riscv/processor.h
index baa2934..e245e8a 100644
--- a/riscv/processor.h
+++ b/riscv/processor.h
@@ -247,14 +247,14 @@ public:
reg_t get_csr(int which) { return get_csr(which, insn_t(0), false, true); }
mmu_t* get_mmu() { return mmu; }
state_t* get_state() { return &state; }
- unsigned get_xlen() { return xlen; }
- unsigned get_const_xlen() {
+ unsigned get_xlen() const { return xlen; }
+ unsigned get_const_xlen() const {
// Any code that assumes a const xlen should use this method to
// document that assumption. If Spike ever changes to allow
// variable xlen, this method should be removed.
return xlen;
}
- unsigned get_flen() {
+ unsigned get_flen() const {
return extension_enabled('Q') ? 128 :
extension_enabled('D') ? 64 :
extension_enabled('F') ? 32 : 0;