17 #ifndef _AXI_CHECKER_AXI_PROTOCOL_H_
18 #define _AXI_CHECKER_AXI_PROTOCOL_H_
20 #include <axi/axi_tlm.h>
21 #include "checker_if.h"
22 #include <tlm/scc/tlm_gp_shared.h>
24 #include <unordered_map>
31 using payload_type=axi::axi_protocol_types::tlm_payload_type;
32 using phase_type=axi::axi_protocol_types::tlm_phase_type;
33 constexpr
static unsigned umax = std::numeric_limits<unsigned>::max();
35 axi_protocol(std::string
const& name,
unsigned bus_width_in_bytes,
unsigned rd_response_timeout,
unsigned wr_response_timeout)
37 , bw(bus_width_in_bytes)
38 , rd_response_timeout(rd_response_timeout)
39 , wr_response_timeout(wr_response_timeout)
46 void fw_pre(payload_type
const& trans, phase_type
const& phase)
override;
47 void fw_post(payload_type
const& trans, phase_type
const& phase, tlm::tlm_sync_enum rstat)
override;
48 void bw_pre(payload_type
const& trans, phase_type
const& phase)
override;
49 void bw_post(payload_type
const& trans, phase_type
const& phase, tlm::tlm_sync_enum rstat)
override;
50 std::string
const name;
52 unsigned const rd_response_timeout;
53 unsigned const wr_response_timeout;
55 std::array<phase_type, 3> req_beat;
56 std::array<phase_type, 3> resp_beat;
57 phase_type dataless_req;
58 std::array<unsigned, 3> req_id{{umax, umax, umax}};
59 std::array<unsigned, 3> resp_id{{umax, umax, umax}};
60 unsigned wr_req_beat_count{0};
61 std::array<std::unordered_map<unsigned, std::deque<uintptr_t>>, 3> open_tx_by_id;
62 std::unordered_map<unsigned, std::deque<uintptr_t>> resp_by_id;
63 std::unordered_map<unsigned, unsigned> rd_resp_beat_count;
64 bool check_phase_change(payload_type
const& trans,
const phase_type &phase);
65 void request_update(payload_type
const& trans);
66 void response_update(payload_type
const& trans);
67 void check_properties(payload_type
const& trans);
68 void check_datawith_settings(payload_type
const&trans);
TLM2.0 components modeling AHB.