From 1b323a9571152672423e1484910022e2fb792b10 Mon Sep 17 00:00:00 2001 From: Robert Hauser <85344819+robhau@users.noreply.github.com> Date: Thu, 25 Apr 2024 20:15:30 +0200 Subject: [PATCH] systemc: remove if clause in Gem5ToTlmBridgeBase (#1059) In the payload event queue in Gem5ToTlmBridgeBase, the phase is checked twice for BEGIN_RESP. This commit removes the second if clause since it is unnecessary. Duplicate if clause in line 234 & line 256 https://github.com/gem5/gem5/blob/dd2689905fcb77a65f190705ba5f2b793535e28c/src/systemc/tlm_bridge/gem5_to_tlm.cc#L234-L267 please correct me if I am missing something important --- src/systemc/tlm_bridge/gem5_to_tlm.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/systemc/tlm_bridge/gem5_to_tlm.cc b/src/systemc/tlm_bridge/gem5_to_tlm.cc index 461be11051..daa7779181 100644 --- a/src/systemc/tlm_bridge/gem5_to_tlm.cc +++ b/src/systemc/tlm_bridge/gem5_to_tlm.cc @@ -253,15 +253,13 @@ Gem5ToTlmBridge::pec( if (need_retry) { blockingResponse = &trans; } else { - if (phase == tlm::BEGIN_RESP) { - // Send END_RESP and we're finished: - tlm::tlm_phase fw_phase = tlm::END_RESP; - sc_core::sc_time delay = sc_core::SC_ZERO_TIME; - socket->nb_transport_fw(trans, fw_phase, delay); - // Release the transaction with all the extensions. - packetMap.erase(&trans); - trans.release(); - } + // Send END_RESP and we're finished: + tlm::tlm_phase fw_phase = tlm::END_RESP; + sc_core::sc_time delay = sc_core::SC_ZERO_TIME; + socket->nb_transport_fw(trans, fw_phase, delay); + // Release the transaction with all the extensions. + packetMap.erase(&trans); + trans.release(); } } }