cpu: Update DRAM traffic gen
[gem5.git] / src / cpu / inorder / resources / agen_unit.cc
index 764cd9446e5e23b198fc3c1ff589bd9e862e69d5..f978b2fa78816c67654a5f35c5a0ba41a6c5e8b7 100644 (file)
  */
 
 #include "cpu/inorder/resources/agen_unit.hh"
+#include "debug/InOrderAGEN.hh"
 
 AGENUnit::AGENUnit(std::string res_name, int res_id, int res_width,
-                   int res_latency, InOrderCPU *_cpu,
+                   Cycles res_latency, InOrderCPU *_cpu,
                    ThePipeline::Params *params)
     : Resource(res_name, res_id, res_width, res_latency, _cpu)
 { }
@@ -55,7 +56,16 @@ AGENUnit::execute(int slot_num)
 #if TRACING_ON
     ThreadID tid = inst->readTid();
 #endif
-    int seq_num = inst->seqNum;
+    InstSeqNum seq_num = inst->seqNum;
+
+    if (inst->fault != NoFault) {
+        DPRINTF(InOrderAGEN,
+                "[tid:%i]: [sn:%i]: Detected %s fault @ %x. Forwarding to "
+                "next stage.\n", tid, inst->seqNum, inst->fault->name(),
+                inst->pcState());
+        agen_req->done();
+        return;
+    }
 
     switch (agen_req->cmd)
     {
@@ -77,8 +87,8 @@ AGENUnit::execute(int slot_num)
                 if (inst->fault == NoFault) {
                     agen_req->done();
                 } else {
-                    fatal("%s encountered while calculating address [sn:%i]",
-                          inst->fault->name(), seq_num);
+                    fatal("%s encountered while calculating address [sn:%i] %s",
+                          inst->fault->name(), seq_num, inst->instName());
                 }
 
                 agens++;