Add ISA bit width to ISA info
MODIFY
src/isainfo.h
src/isainfo.h
@@ -15,6 +15,8 @@ public:
virtual QString regAlias(unsigned i) const = 0;
virtual QString regInfo(unsigned i) const = 0;
virtual bool regIsReadOnly(unsigned i) const = 0;
+ virtual unsigned bits() const = 0;
+ unsigned bytes() const { return bits() / CHAR_BIT; }
protected:
ISAInfoBase() {}
@@ -91,8 +93,9 @@ public:
QString name() const { return "RV32IM"; }
unsigned int regCnt() const override { return 32; }
- QString regName(unsigned i) const { return RVRegNames.at(i); }
- QString regAlias(unsigned i) const { return RVRegAliases.at(i); }
- QString regInfo(unsigned i) const { return RVRegDescs.at(i); }
- bool regIsReadOnly(unsigned i) const { return i == 0; }
+ QString regName(unsigned i) const override { return RVRegNames.at(i); }
+ QString regAlias(unsigned i) const override { return RVRegAliases.at(i); }
+ QString regInfo(unsigned i) const override { return RVRegDescs.at(i); }
+ bool regIsReadOnly(unsigned i) const override { return i == 0; }
+ unsigned int bits() const override { return 32; }
};

Add ISA bit width to ISA info