From 53d93ef9182aade99faa5996dece522d9aba88d1 Mon Sep 17 00:00:00 2001 From: Ali Saidi <saidi@eecs.umich.edu> Date: Fri, 28 Apr 2006 15:37:48 -0400 Subject: 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 --- mem/packet.hh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'mem/packet.hh') 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 -- cgit v1.2.3