arch: Promote instReady to the base InstDecoder class.
Move the instDone flag, and the instReady function which was consistently implemented just to return it, to the base InstDecoder class. This flag can still be accessed easily from the subclasses, but now it can be retrieved with just an InstDecoder pointer without a virtual function call. Change-Id: I8c662aa01da8fe33ffe679071c701e0aadc1a795 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52072 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Gabe Black <gabe.black@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -43,6 +43,8 @@ class InstDecoder
|
||||
size_t _moreBytesSize;
|
||||
Addr _pcMask;
|
||||
|
||||
bool instDone = false;
|
||||
|
||||
public:
|
||||
template <typename MoreBytesType>
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user