avadhpatel / marss

PTLsim and QEMU based Computer Architecture Research Simulator
http://www.marss86.org
129 stars 63 forks source link

Small bug related to architectural register write stats #47

Open hayesti opened 9 years ago

hayesti commented 9 years ago

In ooo-pipe.cpp::ReorderBufferEntry::commit() I have found a small bug.

if likely (archdest_can_commit[uop.rd]) {
    thread.commitrrt[uop.rd]->uncommitref(uop.rd, thread.threadid);
    thread.commitrrt[uop.rd] = physreg;
    thread.commitrrt[uop.rd]->addcommitref(uop.rd, thread.threadid);

    if likely (uop.rd < ARCHREG_COUNT) {
        ctx.set_reg(uop.rd, physreg->data);
    }

    if unlikely (opclassof(uop.opcode) == OPCLASS_FP)
        thread.thread_stats.fp_reg_writes++;
    else
        thread.thread_stats.reg_writes++;

    thread.thread_stats.physreg_reads[physreg->rfid]++;

    physreg->rob = NULL;
}

This line

if unlikely (opclassof(uop.opcode) == OPCLASS_FP)

should be changed to

if unlikely (isclass(uop.opcode, OPCLASS_FP))