diff options
author | Curtis Dunham <Curtis.Dunham@arm.com> | 2017-11-03 17:39:45 -0500 |
---|---|---|
committer | Curtis Dunham <curtis.dunham@arm.com> | 2018-01-29 22:31:20 +0000 |
commit | c1513c69cad2c26c6dcb66416e152952ceb0597e (patch) | |
tree | 942112a2cdaf5901504288afce5cf0ed7a3300f7 /src/arch/arm/isa.hh | |
parent | 04251da6a92fa7b0779d58e194fb1bfa84b3514e (diff) | |
download | gem5-c1513c69cad2c26c6dcb66416e152952ceb0597e.tar.xz |
arm: extend MiscReg metadata structures
Implement proper handling of RES0/RES1 and RAZ/RAO bitfields.
Change-Id: I344c32c3fb1d142acfb0521ba3590ddd2b1f5360
Signed-off-by: Curtis Dunham <Curtis.Dunham@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/6802
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/arch/arm/isa.hh')
-rw-r--r-- | src/arch/arm/isa.hh | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/arch/arm/isa.hh b/src/arch/arm/isa.hh index 2241be725..d903ed06a 100644 --- a/src/arch/arm/isa.hh +++ b/src/arch/arm/isa.hh @@ -89,10 +89,26 @@ namespace ArmISA bool haveLargeAsid64; uint8_t physAddrRange64; - /** Register translation entry used in lookUpMiscReg */ + /** MiscReg metadata **/ struct MiscRegLUTEntry { uint32_t lower; // Lower half mapped to this register uint32_t upper; // Upper half mapped to this register + uint64_t _reset; // value taken on reset (i.e. initialization) + uint64_t _res0; // reserved + uint64_t _res1; // reserved + uint64_t _raz; // read as zero (fixed at 0) + uint64_t _rao; // read as one (fixed at 1) + public: + MiscRegLUTEntry() : + lower(0), upper(0), + _reset(0), _res0(0), _res1(0), _raz(0), _rao(0) {} + uint64_t reset() const { return _reset; } + uint64_t res0() const { return _res0; } + uint64_t res1() const { return _res1; } + uint64_t raz() const { return _raz; } + uint64_t rao() const { return _rao; } + // raz/rao implies writes ignored + uint64_t wi() const { return _raz | _rao; } }; /** Metadata table accessible via the value of the register */ @@ -107,6 +123,22 @@ namespace ArmISA entry.upper = u; return *this; } + chain res0(uint64_t mask) const { + entry._res0 = mask; + return *this; + } + chain res1(uint64_t mask) const { + entry._res1 = mask; + return *this; + } + chain raz(uint64_t mask) const { + entry._raz = mask; + return *this; + } + chain rao(uint64_t mask) const { + entry._rao = mask; + return *this; + } MiscRegLUTEntryInitializer(struct MiscRegLUTEntry &e) : entry(e) {} |