scc 2025.09
SystemC components library
axi4_target.h
1/*******************************************************************************
2 * Copyright 2021-2022 MINRES Technologies GmbH
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16
17#ifndef _BUS_AXI_PIN_AXI4_TARGET_H_
18#define _BUS_AXI_PIN_AXI4_TARGET_H_
19
20#include <axi/axi_tlm.h>
21#include <axi/fsm/base.h>
22#include <axi/fsm/protocol_fsm.h>
23#include <axi/signal_if.h>
24#include <scc/utilities.h>
25#include <systemc>
26#include <tlm/scc/tlm_mm.h>
27#include <util/ities.h>
28
30namespace axi {
32namespace pin {
33
34using namespace axi::fsm;
35
36template <typename CFG>
37struct axi4_target : public sc_core::sc_module,
38 public aw_axi<CFG, typename CFG::slave_types>,
39 public wdata_axi<CFG, typename CFG::slave_types>,
40 public b_axi<CFG, typename CFG::slave_types>,
41 public ar_axi<CFG, typename CFG::slave_types>,
42 public rresp_axi<CFG, typename CFG::slave_types>,
43 protected axi::fsm::base,
44 public axi::axi_bw_transport_if<axi::axi_protocol_types> {
45 SC_HAS_PROCESS(axi4_target);
46
47 using payload_type = axi::axi_protocol_types::tlm_payload_type;
48 using phase_type = axi::axi_protocol_types::tlm_phase_type;
49
50 sc_core::sc_in<bool> clk_i{"clk_i"};
51
53
54 axi4_target(sc_core::sc_module_name const& nm)
55 : sc_core::sc_module(nm)
56 , base(CFG::BUSWIDTH) {
57 instance_name = name();
58 isckt.bind(*this);
59 SC_METHOD(clk_delay);
60 sensitive << clk_i.pos();
61 dont_initialize();
62 SC_THREAD(ar_t);
63 SC_THREAD(rresp_t);
64 SC_THREAD(aw_t);
65 SC_THREAD(wdata_t);
66 SC_THREAD(bresp_t);
67 }
68
69private:
70 tlm::tlm_sync_enum nb_transport_bw(payload_type& trans, phase_type& phase, sc_core::sc_time& t) override;
71
72 void invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range) override;
73
74 void end_of_elaboration() override { clk_if = dynamic_cast<sc_core::sc_clock*>(clk_i.get_interface()); }
75
76 axi::fsm::fsm_handle* create_fsm_handle() override { return new fsm_handle(); }
77
78 void setup_callbacks(axi::fsm::fsm_handle*) override;
79
80 void clk_delay() {
81#ifdef DELTA_SYNC
82 if(sc_core::sc_delta_count_at_current_time() < 5) {
83 clk_self.notify(sc_core::SC_ZERO_TIME);
84 next_trigger(clk_self);
85 } else
86 clk_delayed.notify(sc_core::SC_ZERO_TIME /*clk_if ? clk_if->period() - 1_ps : 1_ps*/);
87#else
88 clk_delayed.notify(axi::CLK_DELAY);
89#endif
90 }
91 void ar_t();
92 void rresp_t();
93 void aw_t();
94 void wdata_t();
95 void bresp_t();
96 static typename CFG::data_t get_read_data_for_beat(fsm::fsm_handle* fsm_hndl);
97 struct aw_data {
98 unsigned id;
99 uint64_t addr;
100 unsigned prot;
101 unsigned size;
102 unsigned cache;
103 unsigned burst;
104 unsigned qos;
105 unsigned region;
106 unsigned len;
107 bool lock;
108 uint64_t user;
109 unsigned atop;
110 };
111 sc_core::sc_clock* clk_if{nullptr};
112 sc_core::sc_event clk_delayed, clk_self, ar_end_req_evt, wdata_end_req_evt;
113 std::array<fsm_handle*, 3> active_req_beat{nullptr, nullptr, nullptr};
114 std::array<fsm_handle*, 3> active_req{nullptr, nullptr, nullptr};
115 std::array<fsm_handle*, 3> active_resp_beat{nullptr, nullptr, nullptr};
116 scc::peq<aw_data> aw_que;
119};
120
121template <typename CFG> using axi5_target = axi4_target<CFG>;
122
123} // namespace pin
124} // namespace axi
125
126template <typename CFG>
127inline tlm::tlm_sync_enum axi::pin::axi4_target<CFG>::nb_transport_bw(payload_type& trans, phase_type& phase, sc_core::sc_time& t) {
128 auto ret = tlm::TLM_ACCEPTED;
129 sc_core::sc_time delay = (clk_if && t < clk_if->period()) ? sc_core::SC_ZERO_TIME : t; // FIXME: calculate correct time
130 SCCTRACE(SCMOD) << "nb_transport_bw " << phase << " of trans " << trans;
131 if(phase == axi::END_PARTIAL_REQ || phase == tlm::END_REQ) { // read/write
132 schedule(phase == tlm::END_REQ ? EndReqE : EndPartReqE, &trans, delay, false);
133 } else if(phase == axi::BEGIN_PARTIAL_RESP || phase == tlm::BEGIN_RESP) { // read/write response
134 schedule(phase == tlm::BEGIN_RESP ? BegRespE : BegPartRespE, &trans, delay, false);
135 } else
136 SCCFATAL(SCMOD) << "Illegal phase received: " << phase;
137 return ret;
138}
139
140template <typename CFG>
141inline void axi::pin::axi4_target<CFG>::invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range) {}
142
143template <typename CFG> typename CFG::data_t axi::pin::axi4_target<CFG>::get_read_data_for_beat(fsm_handle* fsm_hndl) {
144 auto beat_count = fsm_hndl->beat_count;
145 auto size = axi::get_burst_size(*fsm_hndl->trans);
146 auto byte_offset = beat_count * size;
147 auto offset = (fsm_hndl->trans->get_address() + byte_offset) & (CFG::BUSWIDTH / 8 - 1);
148 typename CFG::data_t data{0};
149 if(offset && (size + offset) > (CFG::BUSWIDTH / 8)) { // un-aligned multi-beat access
150 if(beat_count == 0) {
151 auto dptr = fsm_hndl->trans->get_data_ptr();
152 for(size_t i = offset; i < size; ++i, ++dptr) {
153 auto bit_offs = i * 8;
154 data(bit_offs + 7, bit_offs) = *dptr;
155 }
156 } else {
157 auto beat_start_idx = byte_offset - offset;
158 auto data_len = fsm_hndl->trans->get_data_length();
159 auto dptr = fsm_hndl->trans->get_data_ptr() + beat_start_idx;
160 for(size_t i = 0; i < size && (beat_start_idx + i) < data_len; ++i, ++dptr) {
161 auto bit_offs = i * 8;
162 data(bit_offs + 7, bit_offs) = *dptr;
163 }
164 }
165 } else { // aligned or single beat access
166 auto dptr = fsm_hndl->trans->get_data_ptr() + byte_offset;
167 for(size_t i = 0; i < size; ++i, ++dptr) {
168 auto bit_offs = (offset + i) * 8;
169 data(bit_offs + 7, bit_offs) = *dptr;
170 }
171 }
172 return data;
173}
174
175template <typename CFG> inline void axi::pin::axi4_target<CFG>::setup_callbacks(fsm_handle* fsm_hndl) {
176 fsm_hndl->fsm->cb[RequestPhaseBeg] = [this, fsm_hndl]() -> void { fsm_hndl->beat_count = 0; };
177 fsm_hndl->fsm->cb[BegPartReqE] = [this, fsm_hndl]() -> void {
178 sc_assert(fsm_hndl->trans->get_command() == tlm::TLM_WRITE_COMMAND);
179 tlm::tlm_phase phase = axi::BEGIN_PARTIAL_REQ;
180 sc_core::sc_time t(sc_core::SC_ZERO_TIME);
181 auto ret = isckt->nb_transport_fw(*fsm_hndl->trans, phase, t);
182 if(ret == tlm::TLM_UPDATED) {
183 schedule(EndPartReqE, fsm_hndl->trans, t, true);
184 }
185 };
186 fsm_hndl->fsm->cb[EndPartReqE] = [this, fsm_hndl]() -> void {
187 wdata_end_req_evt.notify();
188 active_req_beat[tlm::TLM_WRITE_COMMAND] = nullptr;
189 fsm_hndl->beat_count++;
190 };
191 fsm_hndl->fsm->cb[BegReqE] = [this, fsm_hndl]() -> void {
192 tlm::tlm_phase phase = tlm::BEGIN_REQ;
193 sc_core::sc_time t(sc_core::SC_ZERO_TIME);
194 auto ret = isckt->nb_transport_fw(*fsm_hndl->trans, phase, t);
195 if(ret == tlm::TLM_UPDATED) {
196 schedule(EndReqE, fsm_hndl->trans, t, true);
197 }
198 };
199 fsm_hndl->fsm->cb[EndReqE] = [this, fsm_hndl]() -> void {
200 switch(fsm_hndl->trans->get_command()) {
201 case tlm::TLM_READ_COMMAND:
202 ar_end_req_evt.notify();
203 active_req_beat[tlm::TLM_READ_COMMAND] = nullptr;
204 break;
205 case tlm::TLM_WRITE_COMMAND:
206 wdata_end_req_evt.notify();
207 active_req_beat[tlm::TLM_WRITE_COMMAND] = nullptr;
208 fsm_hndl->beat_count++;
209 break;
210 default:
211 break;
212 }
213 };
214 fsm_hndl->fsm->cb[BegPartRespE] = [this, fsm_hndl]() -> void {
215 assert(fsm_hndl->trans->is_read());
216 active_resp_beat[tlm::TLM_READ_COMMAND] = fsm_hndl;
217 rresp_vl.notify({1, fsm_hndl});
218 };
219 fsm_hndl->fsm->cb[EndPartRespE] = [this, fsm_hndl]() -> void {
220 // scheduling the response
221 assert(fsm_hndl->trans->is_read());
222 tlm::tlm_phase phase = axi::END_PARTIAL_RESP;
223 sc_core::sc_time t(clk_if ? ::scc::time_to_next_posedge(clk_if) - 1_ps : sc_core::SC_ZERO_TIME);
224 auto ret = isckt->nb_transport_fw(*fsm_hndl->trans, phase, t);
225 active_resp_beat[tlm::TLM_READ_COMMAND] = nullptr;
226 fsm_hndl->beat_count++;
227 };
228 fsm_hndl->fsm->cb[BegRespE] = [this, fsm_hndl]() -> void {
229 SCCTRACE(SCMOD) << "processing event BegRespE for trans " << *fsm_hndl->trans;
230 auto size = axi::get_burst_size(*fsm_hndl->trans);
231 active_resp_beat[fsm_hndl->trans->get_command()] = fsm_hndl;
232 switch(fsm_hndl->trans->get_command()) {
233 case tlm::TLM_READ_COMMAND:
234 rresp_vl.notify({3, fsm_hndl});
235 break;
236 case tlm::TLM_WRITE_COMMAND:
237 wresp_vl.notify({3, fsm_hndl});
238 break;
239 default:
240 break;
241 }
242 };
243 fsm_hndl->fsm->cb[EndRespE] = [this, fsm_hndl]() -> void {
244 // scheduling the response
245 tlm::tlm_phase phase = tlm::END_RESP;
246 sc_core::sc_time t(clk_if ? ::scc::time_to_next_posedge(clk_if) - 1_ps : sc_core::SC_ZERO_TIME);
247 auto ret = isckt->nb_transport_fw(*fsm_hndl->trans, phase, t);
248 fsm_hndl->finish.notify();
249 active_resp_beat[fsm_hndl->trans->get_command()] = nullptr;
250 };
251}
252
253template <typename CFG> inline void axi::pin::axi4_target<CFG>::ar_t() {
254 this->ar_ready.write(false);
255 wait(sc_core::SC_ZERO_TIME);
256 auto arid = 0U;
257 auto arlen = 0U;
258 auto arsize = util::ilog2(CFG::BUSWIDTH / 8);
259 auto data_len = (1 << arsize) * (arlen + 1);
260 while(true) {
261 wait(clk_delayed);
262 while(!this->ar_valid.read()) {
263 wait(this->ar_valid.posedge_event());
264 wait(CLK_DELAY); // verilator might create spurious events
265 }
266 SCCTRACE(SCMOD) << "ARVALID detected for 0x" << std::hex << this->ar_addr.read();
267 if(!CFG::IS_LITE) {
268 arid = this->ar_id->read().to_uint();
269 arlen = this->ar_len->read().to_uint();
270 arsize = this->ar_size->read().to_uint();
271 }
272 data_len = (1 << arsize) * (arlen + 1);
274 gp->set_address(this->ar_addr.read());
275 gp->set_command(tlm::TLM_READ_COMMAND);
276 gp->set_streaming_width(data_len);
278 gp->get_extension(ext);
279 ext->set_id(arid);
280 ext->set_length(arlen);
281 ext->set_size(arsize);
282 ext->set_burst(CFG::IS_LITE ? axi::burst_e::INCR : axi::into<axi::burst_e>(this->ar_burst->read()));
283 ext->set_exclusive(!CFG::IS_LITE && this->ar_lock->read());
284 ext->set_prot(this->ar_prot->read());
285 ext->set_qos(CFG::IS_LITE ? 0U : this->ar_qos->read().to_uint());
286 ext->set_region(CFG::IS_LITE ? 0U : this->ar_region->read().to_uint());
287
288 active_req_beat[tlm::TLM_READ_COMMAND] = find_or_create(gp);
289 react(axi::fsm::protocol_time_point_e::BegReqE, active_req_beat[tlm::TLM_READ_COMMAND]);
290 wait(ar_end_req_evt);
291 this->ar_ready.write(true);
292 wait(clk_i.posedge_event());
293 this->ar_ready.write(false);
294 }
295}
296
297template <typename CFG> inline void axi::pin::axi4_target<CFG>::rresp_t() {
298 this->r_valid.write(false);
299 wait(sc_core::SC_ZERO_TIME);
300 fsm_handle* fsm_hndl;
301 uint8_t val;
302 while(true) {
303 std::tie(val, fsm_hndl) = rresp_vl.get();
304 SCCTRACE(SCMOD) << "got read response beat of trans " << *fsm_hndl->trans;
305 auto ext = fsm_hndl->trans->get_extension<axi::axi4_extension>();
306 this->r_data.write(get_read_data_for_beat(fsm_hndl));
307 this->r_resp.write(axi::to_int(ext->get_resp()));
308 this->r_valid.write(val & 0x1);
309 if(!CFG::IS_LITE) {
310 this->r_id->write(ext->get_id());
311 this->r_last->write(val & 0x2);
312 }
313 do {
314 wait(this->r_ready.posedge_event() | clk_delayed);
315 if(this->r_ready.read()) {
316 auto evt =
317 CFG::IS_LITE || (val & 0x2) ? axi::fsm::protocol_time_point_e::EndRespE : axi::fsm::protocol_time_point_e::EndPartRespE;
318 react(evt, active_resp_beat[tlm::TLM_READ_COMMAND]);
319 }
320 } while(!this->r_ready.read());
321 SCCTRACE(SCMOD) << "finished read response beat of trans [" << fsm_hndl->trans << "]";
322 wait(clk_i.posedge_event());
323 this->r_valid.write(false);
324 if(!CFG::IS_LITE)
325 this->r_last->write(false);
326 }
327}
328
329template <typename CFG> inline void axi::pin::axi4_target<CFG>::aw_t() {
330 this->aw_ready.write(false);
331 wait(sc_core::SC_ZERO_TIME);
332 const auto awsize = util::ilog2(CFG::BUSWIDTH / 8);
333 while(true) {
334 wait(clk_delayed);
335 while(!this->aw_valid.read()) {
336 wait(this->aw_valid.posedge_event());
337 wait(CLK_DELAY); // verilator might create spurious events
338 }
339 SCCTRACE(SCMOD) << "AWVALID detected for 0x" << std::hex << this->aw_addr.read();
340 // clang-format off
341 aw_data awd = {CFG::IS_LITE ? 0U : this->aw_id->read().to_uint(),
342 this->aw_addr.read().to_uint64(),
343 this->aw_prot.read().to_uint(),
344 CFG::IS_LITE ? awsize : this->aw_size->read().to_uint(),
345 CFG::IS_LITE ? 0U : this->aw_cache->read().to_uint(),
346 CFG::IS_LITE ? 0U : this->aw_burst->read().to_uint(),
347 CFG::IS_LITE ? 0U : this->aw_qos->read().to_uint(),
348 CFG::IS_LITE ? 0U : this->aw_region->read().to_uint(),
349 CFG::IS_LITE ? 0U : this->aw_len->read().to_uint(),
350 CFG::IS_LITE ? false : this->aw_lock->read(),
351 0, // aw_user
352 CFG::IS_LITE ? 0U : this->aw_atop->read().to_uint()
353 };
354 // clang-format on
355 aw_que.notify(std::move(awd));
356 this->aw_ready.write(true);
357 wait(clk_i.posedge_event());
358 this->aw_ready.write(false);
359 }
360}
361
362template <typename CFG> inline void axi::pin::axi4_target<CFG>::wdata_t() {
363 this->w_ready.write(false);
364 wait(sc_core::SC_ZERO_TIME);
365 while(true) {
366 wait(this->w_valid.read() ? clk_delayed : this->w_valid.posedge_event());
367 if(this->w_valid.read()) {
368 if(!active_req[tlm::TLM_WRITE_COMMAND]) {
369 if(!aw_que.has_next())
370 wait(aw_que.event());
371 auto awd = aw_que.get();
372 auto data_len = (1 << awd.size) * (awd.len + 1);
373 auto gp = tlm::scc::tlm_mm<>::get().allocate<axi::axi4_extension>(data_len, true);
374 gp->set_address(awd.addr);
375 gp->set_command(tlm::TLM_WRITE_COMMAND);
377 gp->get_extension(ext);
378 ext->set_id(awd.id);
379 ext->set_length(awd.len);
380 ext->set_size(awd.size);
381 ext->set_burst(axi::into<axi::burst_e>(awd.burst));
382 ext->set_prot(awd.prot);
383 ext->set_qos(awd.qos);
384 ext->set_cache(awd.cache);
385 ext->set_region(awd.region);
386 ext->set_exclusive(awd.lock);
387 ext->set_atop(awd.atop);
388 if(CFG::USERWIDTH)
389 ext->set_user(axi::common::id_type::CTRL, awd.user);
390
391 active_req_beat[tlm::TLM_WRITE_COMMAND] = find_or_create(gp);
392 active_req[tlm::TLM_WRITE_COMMAND] = active_req_beat[tlm::TLM_WRITE_COMMAND];
393 active_req_beat[tlm::TLM_WRITE_COMMAND]->aux.i32.i0 = 0;
394 }
395 auto* fsm_hndl = active_req[tlm::TLM_WRITE_COMMAND];
396 SCCTRACE(SCMOD) << "WDATA detected for 0x" << std::hex << this->ar_addr.read();
397 auto& gp = fsm_hndl->trans;
398 auto data = this->w_data.read();
399 auto strb = this->w_strb.read();
400 auto last = CFG::IS_LITE ? true : this->w_last->read();
401 auto beat_count = fsm_hndl->beat_count;
402 auto size = axi::get_burst_size(*fsm_hndl->trans);
403 auto byte_offset = beat_count * size;
404 auto offset = (fsm_hndl->trans->get_address() + byte_offset) & (CFG::BUSWIDTH / 8 - 1);
405 if(offset && (size + offset) > (CFG::BUSWIDTH / 8)) { // un-aligned multi-beat access
406 if(beat_count == 0) {
407 auto dptr = fsm_hndl->trans->get_data_ptr();
408 auto beptr = fsm_hndl->trans->get_byte_enable_ptr();
409 for(size_t i = offset; i < size; ++i, ++dptr, ++beptr) {
410 auto bit_offs = i * 8;
411 *dptr = data(bit_offs + 7, bit_offs).to_uint();
412 *beptr = strb[i] ? 0xff : 0;
413 fsm_hndl->aux.i32.i0 += strb[i] ? 1 : 0;
414 }
415 } else {
416 auto beat_start_idx = byte_offset - offset;
417 auto data_len = fsm_hndl->trans->get_data_length();
418 auto dptr = fsm_hndl->trans->get_data_ptr() + beat_start_idx;
419 auto beptr = fsm_hndl->trans->get_byte_enable_ptr() + beat_start_idx;
420 for(size_t i = 0; i < size && (beat_start_idx + i) < data_len; ++i, ++dptr, ++beptr) {
421 auto bit_offs = i * 8;
422 *dptr = data(bit_offs + 7, bit_offs).to_uint();
423 *beptr = strb[i] ? 0xff : 0;
424 fsm_hndl->aux.i32.i0 += strb[i] ? 1 : 0;
425 }
426 }
427 } else { // aligned or single beat access
428 auto dptr = fsm_hndl->trans->get_data_ptr() + byte_offset;
429 auto beptr = fsm_hndl->trans->get_byte_enable_ptr() + byte_offset;
430 for(size_t i = 0; i < size; ++i, ++dptr, ++beptr) {
431 auto bit_offs = (offset + i) * 8;
432 *dptr = data(bit_offs + 7, bit_offs).to_uint();
433 *beptr = strb[offset + i] ? 0xff : 0;
434 fsm_hndl->aux.i32.i0 += strb[offset + i] ? 1 : 0;
435 }
436 }
437 // TODO: assuming consecutive write (not scattered)
438 auto strobe = strb.to_uint();
439 if(last) {
440 // If it is axi lite, number of strobes define the size, for axi4 aligned accesses, axsize & axburst determine size,
441 // for unaligned accesses strobe count determines size
442 auto act_data_len = CFG::IS_LITE ? util::bit_count(strobe) : offset == 0 ? (beat_count + 1) * size : fsm_hndl->aux.i32.i0;
443 gp->set_data_length(act_data_len);
444 gp->set_streaming_width(act_data_len);
445 if(fsm_hndl->aux.i32.i0 == act_data_len) {
446 gp->set_byte_enable_length(0);
447 } else {
448 gp->set_byte_enable_length(act_data_len);
449 }
450 }
451 auto tp = CFG::IS_LITE || this->w_last->read() ? axi::fsm::protocol_time_point_e::BegReqE
452 : axi::fsm::protocol_time_point_e::BegPartReqE;
453 react(tp, fsm_hndl);
454 wait(wdata_end_req_evt);
455 this->w_ready.write(true);
456 wait(clk_i.posedge_event());
457 this->w_ready.write(false);
458 if(last)
459 active_req[tlm::TLM_WRITE_COMMAND] = nullptr;
460 }
461 }
462}
463
464template <typename CFG> inline void axi::pin::axi4_target<CFG>::bresp_t() {
465 this->b_valid.write(false);
466 wait(sc_core::SC_ZERO_TIME);
467 fsm_handle* fsm_hndl;
468 uint8_t val;
469 while(true) {
470 std::tie(val, fsm_hndl) = wresp_vl.get();
471 SCCTRACE(SCMOD) << "got write response of trans " << *fsm_hndl->trans;
472 auto ext = fsm_hndl->trans->get_extension<axi::axi4_extension>();
473 this->b_resp.write(axi::to_int(ext->get_resp()));
474 this->b_valid.write(true);
475 if(!CFG::IS_LITE)
476 this->b_id->write(ext->get_id());
477 SCCTRACE(SCMOD) << "got write response for b_id= " << this->b_id;
478 do {
479 wait(this->b_ready.posedge_event() | clk_delayed);
480 if(this->b_ready.read()) {
481 react(axi::fsm::protocol_time_point_e::EndRespE, active_resp_beat[tlm::TLM_WRITE_COMMAND]);
482 }
483 } while(!this->b_ready.read());
484 SCCTRACE(SCMOD) << "finished write response of trans [" << fsm_hndl->trans << "]";
485 wait(clk_i.posedge_event());
486 this->b_valid.write(false);
487 }
488}
489
490#endif /* _BUS_AXI_PIN_AXI4_TARGET_H_ */
payload_type * allocate()
get a plain tlm_payload_type without extensions
Definition tlm_mm.h:218
pin level adapters
TLM2.0 components modeling AHB.
E into(typename std::underlying_type< E >::type t)
tlm::tlm_bw_transport_if< TYPES > axi_bw_transport_if
alias declaration for the backward interface:
Definition axi_tlm.h:956
constexpr ULT to_int(E t)
Definition axi_tlm.h:47
unsigned get_burst_size(const request &r)
Definition axi_tlm.h:1202
CONSTEXPR unsigned ilog2(uint32_t val)
Definition ities.h:235
void set_exclusive(bool=true)
get the exclusive bit of AxLOCK (AxLOCK[0])
Definition axi_tlm.h:1369
void set_id(unsigned int value)
Definition axi_tlm.h:1297
void set_user(id_type chnl, unsigned int value)
Definition axi_tlm.h:1301
unsigned int get_id() const
Definition axi_tlm.h:1299
base class of all AXITLM based adapters and interfaces.
Definition base.h:43
virtual axi::fsm::fsm_handle * create_fsm_handle()=0
function to create a fsm_handle. Needs to be implemented by the derived class
base(size_t transfer_width, bool coherent=false, axi::fsm::protocol_time_point_e wr_start=axi::fsm::RequestPhaseBeg)
the constructor
Definition base.cpp:43
tlm::scc::tlm_gp_shared_ptr trans
pointer to the associated AXITLM payload
Definition types.h:62
sc_core::sc_event finish
event indicating the end of the transaction
Definition types.h:68
size_t beat_count
beat count of this transaction
Definition types.h:64
AxiProtocolFsm *const fsm
pointer to the FSM
Definition types.h:60
void set_length(uint8_t)
set the AxLEN value of the transaction, the value denotes the burst length - 1
Definition axi_tlm.h:1452
void set_qos(uint8_t)
set the AxQOS (quality of service) value
Definition axi_tlm.h:1498
void set_cache(uint8_t)
set the AxCACHE value as POD, only value from 0..15 are allowed
Definition axi_tlm.h:1506
void set_region(uint8_t)
set the AxREGION value
Definition axi_tlm.h:1502
void set_burst(burst_e)
set the AxBURST value,
Definition axi_tlm.h:1463
void set_atop(uint8_t)
set the raw AWATOP value
Definition axi_tlm.h:1529
void set_size(uint8_t)
get the AxSIZE value of the transaction, the length is 2^size. It needs to be less than 10 (512 bit w...
Definition axi_tlm.h:1456
void set_prot(uint8_t)
set the AxPROT value as POD, only values from 0...7 are allowed
Definition axi_tlm.h:1467
resp_e get_resp() const
get the response status as POD
Definition axi_tlm.h:1574
priority event queue
Definition peq.h:41
static tlm_mm & get()
accessor function of the singleton
Definition tlm_mm.h:338