diff --git a/src/arch/arm/decoder.hh b/src/arch/arm/decoder.hh index 5f0e68b6cb..14167eb6c7 100644 --- a/src/arch/arm/decoder.hh +++ b/src/arch/arm/decoder.hh @@ -66,7 +66,6 @@ class Decoder : public InstDecoder ExtMachInst emi; uint32_t data; bool bigThumb; - bool instDone; bool outOfBytes; int offset; bool foundIt; @@ -146,16 +145,6 @@ class Decoder : public InstDecoder */ bool needMoreBytes() const { return outOfBytes; } - /** - * Is an instruction ready to be decoded? - * - * CPU models call this method to determine if decode() will - * return a new instruction on the next call. It typically only - * returns false if the decoder hasn't received enough data to - * decode a full instruction. - */ - bool instReady() const { return instDone; } - /** * Feed data to the decoder. * diff --git a/src/arch/generic/decoder.hh b/src/arch/generic/decoder.hh index 6bfc199ec6..a6aaaf5945 100644 --- a/src/arch/generic/decoder.hh +++ b/src/arch/generic/decoder.hh @@ -43,6 +43,8 @@ class InstDecoder size_t _moreBytesSize; Addr _pcMask; + bool instDone = false; + public: template InstDecoder(MoreBytesType *mb_buf) : @@ -56,6 +58,16 @@ class InstDecoder void *moreBytesPtr() const { return _moreBytesPtr; } size_t moreBytesSize() const { return _moreBytesSize; } Addr pcMask() const { return _pcMask; } + + /** + * Is an instruction ready to be decoded? + * + * CPU models call this method to determine if decode() will + * return a new instruction on the next call. It typically only + * returns false if the decoder hasn't received enough data to + * decode a full instruction. + */ + bool instReady() const { return instDone; } }; } // namespace gem5 diff --git a/src/arch/mips/decoder.hh b/src/arch/mips/decoder.hh index d90e9c5dd6..25a84d3c1e 100644 --- a/src/arch/mips/decoder.hh +++ b/src/arch/mips/decoder.hh @@ -50,10 +50,9 @@ class Decoder : public InstDecoder //The extended machine instruction being generated ExtMachInst emi; uint32_t machInst; - bool instDone; public: - Decoder(ISA* isa = nullptr) : InstDecoder(&machInst), instDone(false) + Decoder(ISA* isa = nullptr) : InstDecoder(&machInst) {} void @@ -82,12 +81,6 @@ class Decoder : public InstDecoder return true; } - bool - instReady() - { - return instDone; - } - void takeOverFrom(Decoder *old) {} protected: diff --git a/src/arch/power/decoder.hh b/src/arch/power/decoder.hh index f3a272102a..3ec7031074 100644 --- a/src/arch/power/decoder.hh +++ b/src/arch/power/decoder.hh @@ -48,10 +48,9 @@ class Decoder : public InstDecoder protected: // The extended machine instruction being generated ExtMachInst emi; - bool instDone; public: - Decoder(ISA* isa=nullptr) : InstDecoder(&emi), instDone(false) {} + Decoder(ISA* isa=nullptr) : InstDecoder(&emi) {} void process() @@ -79,12 +78,6 @@ class Decoder : public InstDecoder return true; } - bool - instReady() - { - return instDone; - } - void takeOverFrom(Decoder *old) {} protected: diff --git a/src/arch/riscv/decoder.hh b/src/arch/riscv/decoder.hh index c12a48ad2f..f5866be165 100644 --- a/src/arch/riscv/decoder.hh +++ b/src/arch/riscv/decoder.hh @@ -57,7 +57,6 @@ class Decoder : public InstDecoder //The extended machine instruction being generated ExtMachInst emi; uint32_t machInst; - bool instDone; StaticInstPtr decodeInst(ExtMachInst mach_inst); @@ -79,7 +78,6 @@ class Decoder : public InstDecoder void moreBytes(const PCStateBase &pc, Addr fetchPC); bool needMoreBytes() { return more; } - bool instReady() { return instDone; } void takeOverFrom(Decoder *old) {} StaticInstPtr decode(PCStateBase &nextPC); diff --git a/src/arch/sparc/decoder.hh b/src/arch/sparc/decoder.hh index 44695e9ef1..af1c95aa6e 100644 --- a/src/arch/sparc/decoder.hh +++ b/src/arch/sparc/decoder.hh @@ -48,11 +48,10 @@ class Decoder : public InstDecoder // The extended machine instruction being generated ExtMachInst emi; uint32_t machInst; - bool instDone; RegVal asi; public: - Decoder(ISA* isa=nullptr) : InstDecoder(&machInst), instDone(false), asi(0) + Decoder(ISA* isa=nullptr) : InstDecoder(&machInst), asi(0) {} void process() {} @@ -89,12 +88,6 @@ class Decoder : public InstDecoder return true; } - bool - instReady() - { - return instDone; - } - void setContext(RegVal _asi) { diff --git a/src/arch/x86/decoder.hh b/src/arch/x86/decoder.hh index bf5906d575..c8722b96b6 100644 --- a/src/arch/x86/decoder.hh +++ b/src/arch/x86/decoder.hh @@ -176,8 +176,6 @@ class Decoder : public InstDecoder protected: // Whether or not we're out of bytes. bool outOfBytes = true; - // Whether we've completed generating an ExtMachInst. - bool instDone = false; // The size of the displacement value. int displacementSize; // The size of the immediate value. @@ -324,7 +322,6 @@ class Decoder : public InstDecoder } bool needMoreBytes() { return outOfBytes; } - bool instReady() { return instDone; } void updateNPC(X86ISA::PCState &nextPC)