Merge Gabe's changes from head.
[gem5.git] / src / mem / bus.cc
index 1fad13c5a2b78ea793c0ab27907e2a6e883e7683..cb359734b515d3422ba6f9038649d9be3bc3440d 100644 (file)
@@ -39,7 +39,7 @@
 #include "base/misc.hh"
 #include "base/trace.hh"
 #include "mem/bus.hh"
-#include "sim/builder.hh"
+#include "params/Bus.hh"
 
 Port *
 Bus::getPort(const std::string &if_name, int idx)
@@ -180,7 +180,7 @@ Bus::recvTiming(PacketPtr pkt)
 
     // If the bus is busy, or other devices are in line ahead of the current
     // one, put this device on the retry list.
-    if (!(pkt->isResponse() || pkt->isExpressSnoop()) &&
+    if (!pkt->isExpressSnoop() &&
         (tickNextIdle > curTick ||
          (retryList.size() && (!inRetry || src_port != retryList.front()))))
     {
@@ -189,7 +189,9 @@ Bus::recvTiming(PacketPtr pkt)
         return false;
     }
 
-    occupyBus(pkt);
+    if (!pkt->isExpressSnoop()) {
+        occupyBus(pkt);
+    }
 
     short dest = pkt->getDest();
     int dest_port_id;
@@ -599,28 +601,8 @@ Bus::startup()
         tickNextIdle = (curTick / clock) * clock + clock;
 }
 
-BEGIN_DECLARE_SIM_OBJECT_PARAMS(Bus)
-
-    Param<int> bus_id;
-    Param<int> clock;
-    Param<int> width;
-    Param<bool> responder_set;
-    Param<int> block_size;
-
-END_DECLARE_SIM_OBJECT_PARAMS(Bus)
-
-BEGIN_INIT_SIM_OBJECT_PARAMS(Bus)
-    INIT_PARAM(bus_id, "a globally unique bus id"),
-    INIT_PARAM(clock, "bus clock speed"),
-    INIT_PARAM(width, "width of the bus (bits)"),
-    INIT_PARAM(responder_set, "Is a default responder set by the user"),
-    INIT_PARAM(block_size, "Default blocksize if no device has one")
-END_INIT_SIM_OBJECT_PARAMS(Bus)
-
-CREATE_SIM_OBJECT(Bus)
+Bus *
+BusParams::create()
 {
-    return new Bus(getInstanceName(), bus_id, clock, width, responder_set,
-            block_size);
+    return new Bus(name, bus_id, clock, width, responder_set, block_size);
 }
-
-REGISTER_SIM_OBJECT("Bus", Bus)