cpu: Track flat register indices in the Minor CPU with a vector.
That avoids having to know the maximum number of dest registers there can be in any instruction, and will likely not affect the performance of the Minor CPU overall. Change-Id: I4e49695ba06365d52eb4ce128d5cbb30db665bd7 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38387 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
@@ -356,7 +356,8 @@ Fetch2::evaluate()
|
||||
|
||||
/* Make a new instruction and pick up the line, stream,
|
||||
* prediction, thread ids from the incoming line */
|
||||
dyn_inst = new MinorDynInst(line_in->id);
|
||||
dyn_inst = new MinorDynInst(
|
||||
StaticInst::nullStaticInstPtr, line_in->id);
|
||||
|
||||
/* Fetch and prediction sequence numbers originate here */
|
||||
dyn_inst->id.fetchSeqNum = fetch_info.fetchSeqNum;
|
||||
@@ -393,9 +394,15 @@ Fetch2::evaluate()
|
||||
* instructions longer than sizeof(MachInst) */
|
||||
|
||||
if (decoder->instReady()) {
|
||||
/* Note that the decoder can update the given PC.
|
||||
* Remember not to assign it until *after* calling
|
||||
* decode */
|
||||
StaticInstPtr decoded_inst =
|
||||
decoder->decode(fetch_info.pc);
|
||||
|
||||
/* Make a new instruction and pick up the line, stream,
|
||||
* prediction, thread ids from the incoming line */
|
||||
dyn_inst = new MinorDynInst(line_in->id);
|
||||
dyn_inst = new MinorDynInst(decoded_inst, line_in->id);
|
||||
|
||||
/* Fetch and prediction sequence numbers originate here */
|
||||
dyn_inst->id.fetchSeqNum = fetch_info.fetchSeqNum;
|
||||
@@ -404,12 +411,6 @@ Fetch2::evaluate()
|
||||
* has not been set */
|
||||
assert(dyn_inst->id.execSeqNum == 0);
|
||||
|
||||
/* Note that the decoder can update the given PC.
|
||||
* Remember not to assign it until *after* calling
|
||||
* decode */
|
||||
StaticInstPtr decoded_inst = decoder->decode(fetch_info.pc);
|
||||
dyn_inst->staticInst = decoded_inst;
|
||||
|
||||
dyn_inst->pc = fetch_info.pc;
|
||||
DPRINTF(Fetch, "decoder inst %s\n", *dyn_inst);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user