fastmodel: change the constructor of bridges

This CL changes the construction of bridges between amba and tlm. This
enables us to add parameters when using this bridge.

Change-Id: I4bbbe8fb1c2573a796a3a0a7976adf3553bbaa86
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/67297
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
This commit is contained in:
Wei-Han Chen
2023-01-17 02:52:52 +00:00
parent c9719b44a3
commit a2d321d475
4 changed files with 17 additions and 18 deletions

View File

@@ -37,7 +37,9 @@ namespace gem5
namespace fastmodel
{
AmbaFromTlmBridge64::AmbaFromTlmBridge64(const sc_core::sc_module_name& name) :
AmbaFromTlmBridge64::AmbaFromTlmBridge64(
const AmbaFromTlmBridge64Params &params,
const sc_core::sc_module_name& name) :
amba_pv::amba_pv_from_tlm_bridge<64>(name),
targetProxy("target_proxy"),
initiatorProxy("initiator_proxy"),
@@ -116,11 +118,4 @@ AmbaFromTlmBridge64::syncControlExtension(amba_pv::amba_pv_transaction &trans)
}
} // namespace fastmodel
fastmodel::AmbaFromTlmBridge64 *
AmbaFromTlmBridge64Params::create() const
{
return new fastmodel::AmbaFromTlmBridge64(name.c_str());
}
} // namespace gem5

View File

@@ -33,6 +33,7 @@
#include "amba_pv.h"
#pragma GCC diagnostic pop
#include "arch/arm/fastmodel/amba_ports.hh"
#include "params/AmbaFromTlmBridge64.hh"
#include "systemc/tlm_port_wrapper.hh"
namespace gem5
@@ -46,7 +47,11 @@ namespace fastmodel
class AmbaFromTlmBridge64 : public amba_pv::amba_pv_from_tlm_bridge<64>
{
public:
AmbaFromTlmBridge64(const sc_core::sc_module_name &name);
AmbaFromTlmBridge64(const AmbaFromTlmBridge64Params &params,
const sc_core::sc_module_name &name);
AmbaFromTlmBridge64(const AmbaFromTlmBridge64Params &params) :
AmbaFromTlmBridge64(params, params.name.c_str())
{}
gem5::Port &gem5_getPort(const std::string &if_name, int idx=-1) override;

View File

@@ -71,7 +71,8 @@ struct FarAtomicOpFunctor : public AtomicOpFunctor
namespace fastmodel
{
AmbaToTlmBridge64::AmbaToTlmBridge64(const sc_core::sc_module_name& name) :
AmbaToTlmBridge64::AmbaToTlmBridge64(const AmbaToTlmBridge64Params &params,
const sc_core::sc_module_name& name) :
amba_pv::amba_pv_to_tlm_bridge<64>(name),
targetProxy("target_proxy"),
initiatorProxy("initiator_proxy"),
@@ -198,11 +199,4 @@ AmbaToTlmBridge64::setupControlExtension(amba_pv::amba_pv_transaction &trans)
}
} // namespace fastmodel
fastmodel::AmbaToTlmBridge64 *
AmbaToTlmBridge64Params::create() const
{
return new fastmodel::AmbaToTlmBridge64(name.c_str());
}
} // namespace gem5

View File

@@ -33,6 +33,7 @@
#include "amba_pv.h"
#pragma GCC diagnostic pop
#include "arch/arm/fastmodel/amba_ports.hh"
#include "params/AmbaToTlmBridge64.hh"
#include "systemc/tlm_port_wrapper.hh"
namespace gem5
@@ -46,7 +47,11 @@ namespace fastmodel
class AmbaToTlmBridge64 : public amba_pv::amba_pv_to_tlm_bridge<64>
{
public:
AmbaToTlmBridge64(const sc_core::sc_module_name &name);
AmbaToTlmBridge64(const AmbaToTlmBridge64Params &params,
const sc_core::sc_module_name &name);
AmbaToTlmBridge64(const AmbaToTlmBridge64Params &params) :
AmbaToTlmBridge64(params, params.name.c_str())
{}
gem5::Port &gem5_getPort(const std::string &if_name, int idx=-1) override;