diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-06-20 19:04:37 +0000 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-06-20 19:04:37 +0000 |
commit | 0a971cc0c9a6302afb6da5d561b7df24f443eca4 (patch) | |
tree | 4a56e8a6ee996bdf2381be4cbaf5f7c540d3af8e /src/mem | |
parent | a68ddf685c739220d09fdc44000dd217d0707f8e (diff) | |
parent | 4a7bc06553577f25e8dc895fa20506c62455a4b6 (diff) | |
download | gem5-0a971cc0c9a6302afb6da5d561b7df24f443eca4.tar.xz |
Merge zizzer.eecs.umich.edu:/bk/newmem
into ahchoo.blinky.homelinux.org:/home/gblack/m5/newmem-x86
--HG--
extra : convert_revision : f2fac2b1a09e709021cd8382a9fbe805df2177ef
Diffstat (limited to 'src/mem')
-rw-r--r-- | src/mem/bus.cc | 18 | ||||
-rw-r--r-- | src/mem/cache/BaseCache.py | 1 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/mem/bus.cc b/src/mem/bus.cc index 13e545064..d818a25ea 100644 --- a/src/mem/bus.cc +++ b/src/mem/bus.cc @@ -115,11 +115,14 @@ void Bus::occupyBus(PacketPtr pkt) //Bring tickNextIdle up to the present tick //There is some potential ambiguity where a cycle starts, which might make //a difference when devices are acting right around a cycle boundary. Using - //a < allows things which happen exactly on a cycle boundary to take up only - //the following cycle. Anthing that happens later will have to "wait" for - //the end of that cycle, and then start using the bus after that. - while (tickNextIdle < curTick) - tickNextIdle += clock; + //a < allows things which happen exactly on a cycle boundary to take up + //only the following cycle. Anything that happens later will have to "wait" + //for the end of that cycle, and then start using the bus after that. + if (tickNextIdle < curTick) { + tickNextIdle = curTick; + if (tickNextIdle % clock != 0) + tickNextIdle = curTick - (curTick % clock) + clock; + } // The packet will be sent. Figure out how long it occupies the bus, and // how much of that time is for the first "word", aka bus width. @@ -132,10 +135,9 @@ void Bus::occupyBus(PacketPtr pkt) // We're using the "adding instead of dividing" trick again here if (pkt->hasData()) { int dataSize = pkt->getSize(); - for (int transmitted = 0; transmitted < dataSize; - transmitted += width) { + numCycles += dataSize/width; + if (dataSize % width) numCycles++; - } } else { // If the packet didn't have data, it must have been a response. // Those use the bus for one cycle to send their data. diff --git a/src/mem/cache/BaseCache.py b/src/mem/cache/BaseCache.py index 32f3f0174..55b68f81f 100644 --- a/src/mem/cache/BaseCache.py +++ b/src/mem/cache/BaseCache.py @@ -90,3 +90,4 @@ class BaseCache(MemObject): "Only prefetch on data not on instruction accesses") cpu_side = Port("Port on side closer to CPU") mem_side = Port("Port on side closer to MEM") + addr_range = VectorParam.AddrRange(AllMemory, "The address range in bytes") |