systemc: Make tlm/gem5 packet conversion flexible
authorJui-min Lee <fcrh@google.com>
Wed, 18 Nov 2020 15:30:27 +0000 (23:30 +0800)
committerJui-min Lee <fcrh@google.com>
Thu, 19 Nov 2020 07:50:20 +0000 (07:50 +0000)
commitfc44c22d2d4f0efb630c0eb06b0e164bd74503dc
treee705e461987dcf6d3e8fde3d4cfdd326857b523c
parent995e1d2331f2b4c7fbf289763d1639c339e87023
systemc: Make tlm/gem5 packet conversion flexible

We used to have a hard-coded packet2payload and payload2packet in the
tlm_bridge implementation. However, as the conversion is operated on
generic tlm payload, we're not able to handle information stored in any
user defined SystemC extensions.

In this CL, we add a pair of function to register extra conversion steps
between tlm payload and gem5 packet. This decouples the exact conversion
logic and enables SystemC users to register any necessary steps for
their extensions.

Change-Id: I70b3405395fed0f757f0fb7e19136f47d84ac115
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/37075
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/systemc/tlm_bridge/gem5_to_tlm.cc
src/systemc/tlm_bridge/gem5_to_tlm.hh
src/systemc/tlm_bridge/tlm_to_gem5.cc
src/systemc/tlm_bridge/tlm_to_gem5.hh