arch,cpu-minor: Make the uReset method virtual in PCStateBase.

This is used in the minor CPU, but maybe shouldn't. This makes it
accessible from a generic PCStatePtr without having to cast it to a
PCState subclass.

Change-Id: Ied89e2c9c69b1a7d647129fdade10312e21dcaa1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52064
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: ZHENGRONG WANG <seanyukigeek@gmail.com>
Maintainer: ZHENGRONG WANG <seanyukigeek@gmail.com>
This commit is contained in:
Gabe Black
2021-10-16 03:51:28 -07:00
parent e75ae455ad
commit b1716fb8bd
2 changed files with 9 additions and 3 deletions

View File

@@ -120,6 +120,12 @@ class PCStateBase : public Serializable
return _upc;
}
virtual void
uReset()
{
_upc = 0;
}
void
serialize(CheckpointOut &cp) const override
{
@@ -265,9 +271,9 @@ class PCStateCommon : public PCStateBase
// Reset the macroop's upc without advancing the regular pc.
void
uReset()
uReset() override
{
_upc = 0;
PCStateBase::uReset();
_nupc = 1;
}

View File

@@ -447,7 +447,7 @@ Fetch2::evaluate()
* may be pointing to a microop other than 0. Once
* advanced, however, the microop number *must* be 0
*/
fetch_info.pc->as<TheISA::PCState>().uReset();
fetch_info.pc->uReset();
/* Advance PC for the next instruction */
decoded_inst->advancePC(*fetch_info.pc);