Multi2Sim / multi2sim

Multi2Sim source code
GNU General Public License v3.0
115 stars 66 forks source link

mshr_size is not respected when there is room for a new access and too many new access are requested. #47

Open agostini01 opened 7 years ago

agostini01 commented 7 years ago

mshr_size is not respected because the access list only gets updated after the mshr_size limit check (done in CanAccess() )

When there is room for a new access i.e. accesses.size()-num_coalesced_accesses < mshr_size every single access submitted in the current clock cycle, gets processed.

Root of the error may start in src/Module.cc

bool Module::canAccess(int address) const
{
    ...
    if (num_locked_ports == num_ports)
        return false;

    ...

    // Module can be accessed if number of non-coalesced in-flight accesses
    // is smaller than the MSHR size.
    int num_non_coalesced_accesses = accesses.size() -
            num_coalesced_accesses; // ** PROBLEM HAPPENS HERE
    return num_non_coalesced_accesses < mshr_size;
}

At this point, because accesses is a list that only gets updated after all the checks, all the access are allowed to be processed, increasing accesses.size() far beyond mshr_size.