DRAMSim2 icon indicating copy to clipboard operation
DRAMSim2 copied to clipboard

rowbuffer hit rate issue

Open zhuzongwei opened this issue 12 years ago • 1 comments

Hi All,

I want to use MARSSx86+DramSim2 to count the row buffer hit ratio.

Several variables were added to class BankState as follows:

#######################################################
class BankState
{
    ostream &dramsim_log; 
public:
    //Fields
          ...
    unsigned stateChangeCountdown;
     #ifdef CONFIG_SUNNY
     unsigned lastOpenRow;
         unsigned long rowBufferAccessTimes;
         unsigned long rowBufferHitTimes;
         unsigned long rowBufferMissTimes;
     #endif

    //Functions
    BankState(ostream &dramsim_log_);
    void print();
};
#######################################################

lastOpenRow is the row accessed by the last memory request to this bank. If it equals to the row of current request to this bank, then row-buffer of this bank hits. This judgement was carried out in the following function:

#######################################################

void Rank::receiveFromBus(BusPacket *packet)
{
                ...

    switch (packet->busPacketType)
    {

    case READ:
            #ifdef CONFIG_SUNNY
                ++bankStates[packet->bank].rowBufferAccessTimes;

                if(packet->row == bankStates[packet->bank].lastOpenRow)
                    ++bankStates[packet->bank].rowBufferHitTimes;               
                else 
                    ++bankStates[packet->bank].rowBufferMissTimes;

                bankStates[packet->bank].lastOpenRow = packet->row;
            #endif
                    ...
          case WRITE:
            #ifdef CONFIG_SUNNY
                ++bankStates[packet->bank].rowBufferAccessTimes;

                if(packet->row == bankStates[packet->bank].lastOpenRow)
                    ++bankStates[packet->bank].rowBufferHitTimes;               
                else 
                    ++bankStates[packet->bank].rowBufferMissTimes;

                bankStates[packet->bank].lastOpenRow = packet->row;
            #endif
                    ...

             }
                ...
}
#######################################################

Is this a correct way to collect the row-buffer hit ratio information in DramSim2 ? Thanks...

Any reply is appreciated! Thanks...

zhuzongwei avatar Apr 16 '13 06:04 zhuzongwei

Is this the same question as in Issue #20?

This modification looks OK to me.

dramninjasUMD avatar Apr 16 '13 15:04 dramninjasUMD