diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2006-04-28 15:37:48 -0400 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2006-04-28 15:37:48 -0400 |
commit | 53d93ef9182aade99faa5996dece522d9aba88d1 (patch) | |
tree | 53edf6abec2b845dfad7ce70f8b96dafc353895a /mem/packet.hh | |
parent | c819a1c0e188a388cd1891fa5a36e81adcd6c279 (diff) | |
download | gem5-53d93ef9182aade99faa5996dece522d9aba88d1.tar.xz |
add a bridge object, modify bus object to be able to connect to other buses or bridges without panicing
SConscript:
add new cc files to scons
mem/bus.cc:
mem/bus.hh:
implement addressRanges() on the bus.
propigate address ranges to anyone who is interested stripping out ranges of who your propigating to (to avoid livelock)
mem/packet.hh:
add intersect function that returns true if two packets touch at least one byte of the same data (for functional access)
add fixPacket() that will eventually take the correct action giving a timing and functional packet, right now it panics
mem/physical.cc:
Don't panic if the physical memory recieves a status change, just ignore.
--HG--
extra : convert_revision : d470d51f2fb1db2700ad271e09792315ef33ba01
Diffstat (limited to 'mem/packet.hh')
-rw-r--r-- | mem/packet.hh | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/mem/packet.hh b/mem/packet.hh index 4329094d5..a5bd6bc59 100644 --- a/mem/packet.hh +++ b/mem/packet.hh @@ -142,7 +142,7 @@ struct Packet Packet() : data(NULL), staticData(false), dynamicData(false), arrayData(false), - result(Unknown) + time(curTick), result(Unknown) {} ~Packet() @@ -156,6 +156,7 @@ struct Packet deleteData(); dynamicData = false; arrayData = false; + time = curTick; } } @@ -231,6 +232,21 @@ struct Packet arrayData = true; data = new uint8_t[size]; } + + /** Do the packet modify the same addresses. */ + bool intersect(Packet *p) { + Addr s1 = addr; + Addr e1 = addr + size; + Addr s2 = p->addr; + Addr e2 = p->addr + p->size; + + if (s1 >= s2 && s1 < e2) + return true; + if (e1 >= s2 && e1 < e2) + return true; + return false; + } }; +bool fixPacket(Packet &func, Packet &timing); #endif //__MEM_PACKET_HH |