From f15032fbb21802fc998dc38913441a4706944eae Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 27 Jul 2021 19:50:37 -0700 Subject: [PATCH] cpu: Use the newly promoted uReset in the minor CPU. Rather than use an #if THE_ISA check to see if the CPU can use the microPC accessirs, this change uses the newly promoted/exposed uReset for the same purpose. Jira Issue: https://gem5.atlassian.net/browse/GEM5-1060 Change-Id: I4ac931624a2c8e2bbcd5189a05d9ec174bd03d4a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48705 Reviewed-by: Hoa Nguyen Maintainer: Gabe Black Tested-by: kokoro --- src/cpu/minor/fetch2.cc | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/cpu/minor/fetch2.cc b/src/cpu/minor/fetch2.cc index a28018efb3..68c137143b 100644 --- a/src/cpu/minor/fetch2.cc +++ b/src/cpu/minor/fetch2.cc @@ -436,24 +436,21 @@ Fetch2::evaluate() line_in->lineWidth, output_index, fetch_info.inputIndex, fetch_info.pc, *dyn_inst); -#if THE_ISA == X86_ISA || THE_ISA == ARM_ISA - /* In SE mode, it's possible to branch to a microop when - * replaying faults such as page faults (or simply - * intra-microcode branches in X86). Unfortunately, - * as Minor has micro-op decomposition in a separate - * pipeline stage from instruction decomposition, the - * following advancePC (which may follow a branch with - * microPC() != 0) *must* see a fresh macroop. This - * kludge should be improved with an addition to PCState - * but I offer it in this form for the moment + /* + * In SE mode, it's possible to branch to a microop when + * replaying faults such as page faults (or simply + * intra-microcode branches in X86). Unfortunately, + * as Minor has micro-op decomposition in a separate + * pipeline stage from instruction decomposition, the + * following advancePC (which may follow a branch with + * microPC() != 0) *must* see a fresh macroop. * * X86 can branch within microops so we need to deal with * the case that, after a branch, the first un-advanced PC * may be pointing to a microop other than 0. Once - * advanced, however, the microop number *must* be 0 */ - fetch_info.pc.upc(0); - fetch_info.pc.nupc(1); -#endif + * advanced, however, the microop number *must* be 0 + */ + fetch_info.pc.uReset(); /* Advance PC for the next instruction */ decoded_inst->advancePC(fetch_info.pc);