RSIM Bug Report #7

Version of RSIM1.0
Bug number7
Bug class3
Date10/7/97
Reported byChen Ding, Rice University
AffectsAll
Filesbus.c

Problem Description

The bus utilization statistics are incorrect, as they are being doubly updated. This can lead to utilizations over 100%.

This occurs because bus utilization is incremented in the following two code segments (in case SERVICE), but the field begin_util is not properly reset.

Code segment #1:

if (checkQ(bptr->out_port_ptr[oport_num]) == -1) { /* port not available */ if (MemsimStatOn) { bptr->wait++; bptr->utilization += YS__Simtime - bptr->begin_util + (BUSCYCLE*FASTER_PROC); } Code segment #2:

if (MemsimStatOn) { bptr->utilization += YS__Simtime - bptr->begin_util + (delay*FASTER_PROC); }

Problem Fix

Two lines of code must be added to reset the begin_util field. The above code segments should be replaced with:

Code segment #1:

if (checkQ(bptr->out_port_ptr[oport_num]) == -1) { /* port not available */ if (MemsimStatOn) { bptr->wait++; bptr->utilization += YS__Simtime - bptr->begin_util + (BUSCYCLE*FASTER_PROC); bptr->begin_util = YS__Simtime + (BUSCYCLE*FASTER_PROC); /* reset this */ } Code segment #2:

if (MemsimStatOn) { bptr->utilization += YS__Simtime - bptr->begin_util + (delay*FASTER_PROC); bptr->begin_util = YS__Simtime + (delay*FASTER_PROC); /* reset this */ }