diff -r fc242bb34728 -r 9f5292877175 configs/common/CacheConfig.py --- a/configs/common/CacheConfig.py Thu Jul 18 12:34:18 2013 -0700 +++ b/configs/common/CacheConfig.py Thu Jul 18 12:43:01 2013 -0700 @@ -72,6 +72,7 @@ assoc=options.l2_assoc, hit_latency=options.l2_read_lat, write_latency=options.l2_write_lat, + enable_bank_model=options.l2_enable_bank, num_banks=options.l2_num_banks, bank_intlv_high_bit = options.l2_intlv_bit) @@ -87,12 +88,14 @@ assoc=options.l1i_assoc, hit_latency=options.l1_read_lat, write_latency=options.l1_write_lat, + enable_bank_model=options.l1_enable_bank, num_banks=options.l1_num_banks, bank_intlv_high_bit = options.l1_intlv_bit) dcache = dcache_class(size=options.l1d_size, assoc=options.l1d_assoc, hit_latency=options.l1_read_lat, write_latency=options.l1_write_lat, + enable_bank_model=options.l1_enable_bank, num_banks=options.l1_num_banks, bank_intlv_high_bit = options.l1_intlv_bit) diff -r fc242bb34728 -r 9f5292877175 configs/common/Options.py --- a/configs/common/Options.py Thu Jul 18 12:34:18 2013 -0700 +++ b/configs/common/Options.py Thu Jul 18 12:43:01 2013 -0700 @@ -115,6 +115,12 @@ help="L2 write latency.") parser.add_option("--l3_write_lat", type="int", default="40", help="L3 write latency.") + parser.add_option("--l1-enable-bank", action="store_true", + help="Enable L1 bank model") + parser.add_option("--l2-enable-bank", action="store_true", + help="Enable L2 bank model") + parser.add_option("--l3-enable-bank", action="store_true", + help="Enable L3 bank model") parser.add_option("--l1_num_banks", type="int", default="2", help="L1 bank count.") parser.add_option("--l2_num_banks", type="int", default="2", diff -r fc242bb34728 -r 9f5292877175 src/mem/cache/BaseCache.py --- a/src/mem/cache/BaseCache.py Thu Jul 18 12:34:18 2013 -0700 +++ b/src/mem/cache/BaseCache.py Thu Jul 18 12:43:01 2013 -0700 @@ -52,6 +52,8 @@ write_latency = Param.Cycles("The write latency for this cache") response_latency = Param.Cycles( "Additional cache latency for the return path to core on a miss") + enable_bank_model = Param.Bool(False, + "knob to control if the bank model is used") num_banks = Param.Int(2, "Number of cache data array banks") bank_intlv_high_bit = Param.Int(6, "Cache data array bank interleave highest bit") diff -r fc242bb34728 -r 9f5292877175 src/mem/cache/base.hh --- a/src/mem/cache/base.hh Thu Jul 18 12:34:18 2013 -0700 +++ b/src/mem/cache/base.hh Thu Jul 18 12:43:01 2013 -0700 @@ -305,6 +305,11 @@ const Cycles responseLatency; /** + * The knob to turn on/off cache data array bank model + */ + const bool enableBankModel; + + /** * The number of cache data array banks. */ const unsigned numBanks; diff -r fc242bb34728 -r 9f5292877175 src/mem/cache/base.cc --- a/src/mem/cache/base.cc Thu Jul 18 12:34:18 2013 -0700 +++ b/src/mem/cache/base.cc Thu Jul 18 12:43:01 2013 -0700 @@ -76,6 +76,7 @@ hitLatency(p->hit_latency), writeLatency(p->write_latency), responseLatency(p->response_latency), + enableBankModel(p->enable_bank_model), numBanks(p->num_banks), bankIntlvHighBit(p->bank_intlv_high_bit), numTarget(p->tgts_per_mshr), diff -r fc242bb34728 -r 9f5292877175 src/mem/cache/cache_impl.hh --- a/src/mem/cache/cache_impl.hh Thu Jul 18 12:34:18 2013 -0700 +++ b/src/mem/cache/cache_impl.hh Thu Jul 18 12:43:01 2013 -0700 @@ -531,14 +531,16 @@ pkt->busFirstWordDelay = pkt->busLastWordDelay = 0; cpuSidePort->schedTimingResp(pkt, clockEdge(lat)); // Mark the corresponding bank in service - bank[bankId]->markInService(clockEdge(lat)); + if (enableBankModel) + bank[bankId]->markInService(clockEdge(lat)); } else { /// @todo nominally we should just delete the packet here, /// however, until 4-phase stuff we can't because sending /// cache is still relying on it pendingDelete.push_back(pkt); // Mark the corresponding bank in service - bank[bankId]->markInService(clockEdge(lat)); + if (enableBankModel) + bank[bankId]->markInService(clockEdge(lat)); } } else { // miss @@ -927,12 +929,14 @@ blk = handleFill(pkt, blk, writebacks); assert(blk != NULL); - // mark the corresponding bank in service - unsigned bankId = getBankId(pkt->getAddr()); - if (bank[bankId]->isBusy()) { - bank[bankId]->extendService(writeLatency * clockPeriod()); - } else { - bank[bankId]->markInService(clockEdge(writeLatency)); + if (enableBankModel) { + // mark the corresponding bank in service + unsigned bankId = getBankId(pkt->getAddr()); + if (bank[bankId]->isBusy()) { + bank[bankId]->extendService(writeLatency * clockPeriod()); + } else { + bank[bankId]->markInService(clockEdge(writeLatency)); + } } } @@ -1799,12 +1803,14 @@ // nextIdleTick expires, but we will need to create new events to do that. // Instead, we only check-and-unmark the inService bit before we really // want to know the bank status. - for (unsigned i = 0; i < cache->bank.size(); ++i) - if (cache->bank[i]->serviceDone()) - cache->bank[i]->clearInService(); + if (cache->enableBankModel) + for (unsigned i = 0; i < cache->bank.size(); ++i) + if (cache->bank[i]->serviceDone()) + cache->bank[i]->clearInService(); unsigned bankId = cache->getBankId(pkt->getAddr()); - bool inService = cache->bank[bankId]->isBusy(); + bool inService = cache->enableBankModel && cache->bank[bankId]->isBusy(); + // always let inhibited requests through even if blocked if (!pkt->memInhibitAsserted() && (blocked || inService)) { assert(!cache->system->bypassCaches()); @@ -1865,9 +1871,10 @@ // nextIdleTick expires, but we will need to create new events to do that. // Instead, we only check-and-unmark the inService bit before we really // want to know the bank status. - for (unsigned i = 0; i < cache->bank.size(); ++i) - if (cache->bank[i]->serviceDone()) - cache->bank[i]->clearInService(); + if (cache->enableBankModel) + for (unsigned i = 0; i < cache->bank.size(); ++i) + if (cache->bank[i]->serviceDone()) + cache->bank[i]->clearInService(); cache->recvTimingResp(pkt); return true;