From 6a4d111855318a054da9525948879e8081e76cc1 Mon Sep 17 00:00:00 2001
From: Earl Ou <shunhsingou@google.com>
Date: Tue, 4 Feb 2020 11:30:59 +0800
Subject: [PATCH] systemc: gem5_to_tlm: treat non-rw as ignorable command

Treat all kinds of non read/write requests in gem5_to_tlm bridge as ignorable
commands.

Change-Id: I5236e1b31f9a57470dc666d01cbe96249f48ed5d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25163
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
---
 src/systemc/tlm_bridge/gem5_to_tlm.cc | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/systemc/tlm_bridge/gem5_to_tlm.cc b/src/systemc/tlm_bridge/gem5_to_tlm.cc
index f6ea811bd..8c11c9721 100644
--- a/src/systemc/tlm_bridge/gem5_to_tlm.cc
+++ b/src/systemc/tlm_bridge/gem5_to_tlm.cc
@@ -105,13 +105,10 @@ packet2payload(PacketPtr packet)
         trans->set_command(tlm::TLM_IGNORE_COMMAND);
     } else if (packet->isRead()) {
         trans->set_command(tlm::TLM_READ_COMMAND);
-    } else if (packet->isInvalidate()) {
-        /* Do nothing */
-        trans->set_command(tlm::TLM_IGNORE_COMMAND);
     } else if (packet->isWrite()) {
         trans->set_command(tlm::TLM_WRITE_COMMAND);
     } else {
-        SC_REPORT_FATAL("Gem5ToTlmBridge", "No R/W packet");
+        trans->set_command(tlm::TLM_IGNORE_COMMAND);
     }
 
     // Attach the packet pointer to the TLM transaction to keep track.
@@ -284,10 +281,6 @@ Gem5ToTlmBridge<BITWIDTH>::recvTimingReq(PacketPtr packet)
     panic_if(packet->cacheResponding(),
              "Should not see packets where cache is responding");
 
-    panic_if(!(packet->isRead() || packet->isWrite()),
-             "Should only see read and writes at TLM memory\n");
-
-
     // We should never get a second request after noting that a retry is
     // required.
     sc_assert(!needToSendRequestRetry);
-- 
2.30.2