changeset d5a97bfa8569 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=d5a97bfa8569
description:
mem: Tidy up a few variables in the bus
This patch does some minor housekeeping on the bus code, removing
redundant code, and moving the extraction of the destination id to the
top of the functions using it.
diffstat:
src/mem/coherent_bus.cc | 10 +++++-----
src/mem/noncoherent_bus.cc | 12 ++++++------
2 files changed, 11 insertions(+), 11 deletions(-)
diffs (75 lines):
diff -r 09deddf4e447 -r d5a97bfa8569 src/mem/coherent_bus.cc
--- a/src/mem/coherent_bus.cc Thu May 30 12:53:58 2013 -0400
+++ b/src/mem/coherent_bus.cc Thu May 30 12:53:59 2013 -0400
@@ -199,7 +199,7 @@
// update the bus state and schedule an idle event
reqLayer.failedTiming(src_port, master_port_id,
- clockEdge(Cycles(headerCycles)));
+ clockEdge(headerCycles));
} else {
// update the bus state and schedule an idle event
reqLayer.succeededTiming(packetFinishTime);
@@ -223,9 +223,12 @@
// determine the source port based on the id
MasterPort *src_port = masterPorts[master_port_id];
+ // determine the destination based on what is stored in the packet
+ PortID slave_port_id = pkt->getDest();
+
// test if the bus should be considered occupied for the current
// port
- if (!respLayer.tryTiming(src_port, pkt->getDest())) {
+ if (!respLayer.tryTiming(src_port, slave_port_id)) {
DPRINTF(CoherentBus, "recvTimingResp: src %s %s 0x%x BUSY\n",
src_port->name(), pkt->cmdString(), pkt->getAddr());
return false;
@@ -249,9 +252,6 @@
// remove it as outstanding
outstandingReq.erase(pkt->req);
- // determine the destination based on what is stored in the packet
- PortID slave_port_id = pkt->getDest();
-
// send the packet through the destination slave port
bool success M5_VAR_USED = slavePorts[slave_port_id]->sendTimingResp(pkt);
diff -r 09deddf4e447 -r d5a97bfa8569 src/mem/noncoherent_bus.cc
--- a/src/mem/noncoherent_bus.cc Thu May 30 12:53:58 2013 -0400
+++ b/src/mem/noncoherent_bus.cc Thu May 30 12:53:59 2013 -0400
@@ -138,7 +138,7 @@
// occupy until the header is sent
reqLayer.failedTiming(src_port, master_port_id,
- clockEdge(Cycles(headerCycles)));
+ clockEdge(headerCycles));
return false;
}
@@ -160,9 +160,12 @@
// determine the source port based on the id
MasterPort *src_port = masterPorts[master_port_id];
+ // determine the destination based on what is stored in the packet
+ PortID slave_port_id = pkt->getDest();
+
// test if the bus should be considered occupied for the current
// port
- if (!respLayer.tryTiming(src_port, pkt->getDest())) {
+ if (!respLayer.tryTiming(src_port, slave_port_id)) {
DPRINTF(NoncoherentBus, "recvTimingResp: src %s %s 0x%x BUSY\n",
src_port->name(), pkt->cmdString(), pkt->getAddr());
return false;
@@ -179,11 +182,8 @@
calcPacketTiming(pkt);
Tick packetFinishTime = pkt->busLastWordDelay + curTick();
- // determine the destination based on what is stored in the packet
- PortID slave_port_id = pkt->getDest();
-
// send the packet through the destination slave port
- bool success M5_VAR_USED = slavePorts[pkt->getDest()]->sendTimingResp(pkt);
+ bool success M5_VAR_USED = slavePorts[slave_port_id]->sendTimingResp(pkt);
// currently it is illegal to block responses... can lead to
// deadlock
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev