arch: Make the decoder decode() method virtual.
Change-Id: I60f0c4ffbd63069caaee190a78f007df79b61808 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52078 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:
@@ -137,18 +137,7 @@ class Decoder : public InstDecoder
|
||||
|
||||
void moreBytes(const PCStateBase &pc, Addr fetchPC) override;
|
||||
|
||||
/**
|
||||
* Decode an instruction or fetch it from the code cache.
|
||||
*
|
||||
* This method decodes the currently pending pre-decoded
|
||||
* instruction. Data must be fed to the decoder using moreBytes()
|
||||
* until instReady() is true before calling this method.
|
||||
*
|
||||
* @param pc Instruction pointer that we are decoding.
|
||||
* @return A pointer to a static instruction or NULL if the
|
||||
* decoder isn't ready (see instReady()).
|
||||
*/
|
||||
StaticInstPtr decode(PCStateBase &pc);
|
||||
StaticInstPtr decode(PCStateBase &pc) override;
|
||||
|
||||
public: // ARM-specific decoder state manipulation
|
||||
void
|
||||
|
||||
@@ -124,6 +124,19 @@ class InstDecoder
|
||||
* @param fetchPC The address this chunk was fetched from.
|
||||
*/
|
||||
virtual void moreBytes(const PCStateBase &pc, Addr fetchPC) = 0;
|
||||
|
||||
/**
|
||||
* Decode an instruction or fetch it from the code cache.
|
||||
*
|
||||
* This method decodes the currently pending pre-decoded
|
||||
* instruction. Data must be fed to the decoder using moreBytes()
|
||||
* until instReady() is true before calling this method.
|
||||
*
|
||||
* @param pc Instruction pointer that we are decoding.
|
||||
* @return A pointer to a static instruction or NULL if the
|
||||
* decoder isn't ready (see instReady()).
|
||||
*/
|
||||
virtual StaticInstPtr decode(PCStateBase &pc) = 0;
|
||||
};
|
||||
|
||||
} // namespace gem5
|
||||
|
||||
@@ -85,7 +85,7 @@ class Decoder : public InstDecoder
|
||||
|
||||
public:
|
||||
StaticInstPtr
|
||||
decode(PCStateBase &next_pc)
|
||||
decode(PCStateBase &next_pc) override
|
||||
{
|
||||
if (!instDone)
|
||||
return NULL;
|
||||
|
||||
@@ -82,7 +82,7 @@ class Decoder : public InstDecoder
|
||||
|
||||
public:
|
||||
StaticInstPtr
|
||||
decode(PCStateBase &next_pc)
|
||||
decode(PCStateBase &next_pc) override
|
||||
{
|
||||
if (!instDone)
|
||||
return NULL;
|
||||
|
||||
@@ -75,7 +75,7 @@ class Decoder : public InstDecoder
|
||||
//when there is control flow.
|
||||
void moreBytes(const PCStateBase &pc, Addr fetchPC) override;
|
||||
|
||||
StaticInstPtr decode(PCStateBase &nextPC);
|
||||
StaticInstPtr decode(PCStateBase &nextPC) override;
|
||||
};
|
||||
|
||||
} // namespace RiscvISA
|
||||
|
||||
@@ -101,7 +101,7 @@ class Decoder : public InstDecoder
|
||||
|
||||
public:
|
||||
StaticInstPtr
|
||||
decode(PCStateBase &next_pc)
|
||||
decode(PCStateBase &next_pc) override
|
||||
{
|
||||
if (!instDone)
|
||||
return NULL;
|
||||
|
||||
@@ -344,7 +344,7 @@ class Decoder : public InstDecoder
|
||||
}
|
||||
|
||||
public:
|
||||
StaticInstPtr decode(PCStateBase &next_pc);
|
||||
StaticInstPtr decode(PCStateBase &next_pc) override;
|
||||
|
||||
StaticInstPtr fetchRomMicroop(
|
||||
MicroPC micropc, StaticInstPtr curMacroop) override;
|
||||
|
||||
Reference in New Issue
Block a user