cpu: Set ContextId on request from trace CPU
authorJason Lowe-Power <jason@lowepower.com>
Thu, 3 Sep 2020 15:21:14 +0000 (08:21 -0700)
committerJason Lowe-Power <power.jg@gmail.com>
Fri, 4 Sep 2020 18:48:27 +0000 (18:48 +0000)
Adds a contextId to the trace CPU in one more case that was missing.
Without this a panic is triggered in the cache.

Change-Id: I78bd70ad1e3657c9a6a1d56c234c007c2e2b586c
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34035
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
src/cpu/trace/trace_cpu.cc

index dd9125737a5a76454d2acb25a830213905b9cb24..13f194c84a485e733db8482e1e1ee3e7ab30b2ba 100644 (file)
@@ -653,6 +653,9 @@ TraceCPU::ElasticDataGen::executeMemReq(GraphNode* node_ptr)
         node_ptr->physAddr, node_ptr->size, node_ptr->flags, masterID);
     req->setReqInstSeqNum(node_ptr->seqNum);
 
+    // If this is not done it triggers assert in L1 cache for invalid contextId
+    req->setContext(ContextID(0));
+
     req->setPC(node_ptr->pc);
     // If virtual address is valid, set the virtual address field
     // of the request.