17 #ifndef _BUS_AHB_PIN_INITIATOR_H_
18 #define _BUS_AHB_PIN_INITIATOR_H_
20 #include <tlm/scc/target_mixin.h>
22 #include <tlm_utils/peq_with_get.h>
23 #include <type_traits>
28 template <
unsigned WIDTH>
class initiator : sc_core::sc_module {
29 static constexpr
bool is_larger(
unsigned x) {
return x > 64U; }
30 using data_t =
typename std::conditional<is_larger(WIDTH), sc_dt::sc_biguint<WIDTH>, sc_dt::sc_uint<WIDTH>>::type;
33 sc_core::sc_in<bool> HCLK_i{
"HCLK_i"};
34 sc_core::sc_in<bool> HRESETn_i{
"HRESETn_i"};
35 sc_core::sc_out<sc_dt::sc_uint<32>> HADDR_o{
"HADDR_o"};
36 sc_core::sc_out<sc_dt::sc_uint<3>> HBURST_o{
"HBURST_o"};
37 sc_core::sc_out<bool> HMASTLOCK_o{
"HMASTLOCK_o"};
38 sc_core::sc_out<sc_dt::sc_uint<4>> HPROT_o{
"HPROT_o"};
39 sc_core::sc_out<sc_dt::sc_uint<3>> HSIZE_o{
"HSIZE_o"};
40 sc_core::sc_out<sc_dt::sc_uint<2>> HTRANS_o{
"HTRANS_o"};
41 sc_core::sc_out<data_t> HWDATA_o{
"HWDATA_o"};
42 sc_core::sc_out<bool> HWRITE_o{
"HWRITE_o"};
43 sc_core::sc_in<data_t> HRDATA_i{
"HRDATA_i"};
44 sc_core::sc_in<bool> HREADY_i{
"HREADY_i"};
45 sc_core::sc_in<bool> HRESP_i{
"HRESP_i"};
49 initiator(
const sc_core::sc_module_name& nm);
53 struct data_phase_desc {
54 tlm::tlm_generic_payload* gp;
61 tlm_utils::peq_with_get<tlm::tlm_generic_payload> inqueue{
"inqueue"};
62 tlm_utils::peq_with_get<tlm::tlm_generic_payload> tx_in_flight{
"tx_in_flight"};
TLM2.0 components modeling AHB.