summaryrefslogtreecommitdiff
path: root/src/mem/bus.hh
diff options
context:
space:
mode:
authorVincentius Robby <acolyte@umich.edu>2007-08-08 14:18:09 -0400
committerVincentius Robby <acolyte@umich.edu>2007-08-08 14:18:09 -0400
commit13d10e844c7465b4f7375da6e196cd36ffd0e37d (patch)
tree5ce24f04043b232bb7a658884f5e8adbf7f68d2e /src/mem/bus.hh
parentef32494e723283c5a0a8c27bcb657a0e9ca9e25c (diff)
downloadgem5-13d10e844c7465b4f7375da6e196cd36ffd0e37d.tar.xz
alpha: Make the TLB cache to actually work.
Improve MRU checking for StaticInst, Bus, TLB --HG-- extra : convert_revision : 9116b5655cd2986aeb4205438aad4a0f5a440006
Diffstat (limited to 'src/mem/bus.hh')
-rw-r--r--src/mem/bus.hh37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/mem/bus.hh b/src/mem/bus.hh
index f5cad0586..32a039335 100644
--- a/src/mem/bus.hh
+++ b/src/mem/bus.hh
@@ -193,15 +193,17 @@ class Bus : public MemObject
// Checks the cache and returns the id of the port that has the requested
// address within its range
inline int checkPortCache(Addr addr) {
- if (portCache[0].valid && addr >= portCache[0].start &&
- addr < portCache[0].end) {
- return portCache[0].id;
- } else if (portCache[1].valid && addr >= portCache[1].start &&
- addr < portCache[1].end) {
- return portCache[1].id;
- } else if (portCache[2].valid && addr >= portCache[2].start &&
- addr < portCache[2].end) {
- return portCache[2].id;
+ if (portCache[0].valid) {
+ if (addr >= portCache[0].start && addr < portCache[0].end) {
+ return portCache[0].id;
+ } else if (portCache[1].valid) {
+ if (addr >= portCache[1].start && addr < portCache[1].end) {
+ return portCache[1].id;
+ } else if (portCache[2].valid && addr >= portCache[2].start &&
+ addr < portCache[2].end) {
+ return portCache[2].id;
+ }
+ }
}
return -1;
@@ -310,12 +312,17 @@ class Bus : public MemObject
// Checks the peer port interfaces cache for the port id and returns
// a pointer to the matching port
inline BusPort* checkBusCache(short id) {
- if (busCache[0].valid && id == busCache[0].id) {
- return busCache[0].port;
- } else if (busCache[1].valid && id == busCache[1].id) {
- return busCache[1].port;
- } else if (busCache[2].valid && id == busCache[2].id) {
- return busCache[2].port;
+ if (busCache[0].valid) {
+ if (id == busCache[0].id) {
+ return busCache[0].port;
+ if (busCache[1].valid) {
+ if (id == busCache[1].id) {
+ return busCache[1].port;
+ if (busCache[2].valid && id == busCache[2].id)
+ return busCache[2].port;
+ }
+ }
+ }
}
return NULL;