inorder: InstSeqNum bug

Because int and not InstSeqNum was used in a couple of places, you can
overflow the int type and thus get wierd bugs when the sequence number
is negative (or some wierd value)
This commit is contained in:
Korey Sewell
2011-02-23 16:35:18 -05:00
parent 3e1ad73d08
commit 0a74246fb9
6 changed files with 6 additions and 6 deletions

View File

@@ -55,7 +55,7 @@ AGENUnit::execute(int slot_num)
#if TRACING_ON
ThreadID tid = inst->readTid();
#endif
int seq_num = inst->seqNum;
InstSeqNum seq_num = inst->seqNum;
switch (agen_req->cmd)
{

View File

@@ -69,7 +69,7 @@ BranchPredictor::execute(int slot_num)
ResourceRequest* bpred_req = reqs[slot_num];
DynInstPtr inst = bpred_req->inst;
ThreadID tid = inst->readTid();
int seq_num = inst->seqNum;
InstSeqNum seq_num = inst->seqNum;
switch (bpred_req->cmd)
{

View File

@@ -85,7 +85,7 @@ ExecutionUnit::execute(int slot_num)
ResourceRequest* exec_req = reqs[slot_num];
DynInstPtr inst = reqs[slot_num]->inst;
Fault fault = NoFault;
int seq_num = inst->seqNum;
InstSeqNum seq_num = inst->seqNum;
Tick cur_tick = curTick();
if (cur_tick == serializeTick) {

View File

@@ -76,7 +76,7 @@ FetchSeqUnit::execute(int slot_num)
DynInstPtr inst = fs_req->inst;
ThreadID tid = inst->readTid();
int stage_num = fs_req->getStageNum();
int seq_num = inst->seqNum;
InstSeqNum seq_num = inst->seqNum;
DPRINTF(InOrderFetchSeq, "[tid:%i]: Current PC is %s\n", tid,
pc[tid]);

View File

@@ -109,7 +109,7 @@ TLBUnit::execute(int slot_idx)
DynInstPtr inst = tlb_req->inst;
ThreadID tid = inst->readTid();
int seq_num = inst->seqNum;
InstSeqNum seq_num = inst->seqNum;
int stage_num = tlb_req->getStageNum();
tlb_req->fault = NoFault;

View File

@@ -145,7 +145,7 @@ UseDefUnit::execute(int slot_idx)
DynInstPtr inst = ud_req->inst;
ThreadID tid = inst->readTid();
int seq_num = inst->seqNum;
InstSeqNum seq_num = inst->seqNum;
int ud_idx = ud_req->useDefIdx;
// If there is a non-speculative instruction