scc  2022.4.0
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 
30 namespace axi {
32 namespace pin {
33 
34 using namespace axi::fsm;
35 
36 template <typename CFG>
37 struct 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 
69 private:
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  };
110  sc_core::sc_clock* clk_if{nullptr};
111  sc_core::sc_event clk_delayed, clk_self, ar_end_req_evt, wdata_end_req_evt;
112  std::array<fsm_handle*, 3> active_req_beat{nullptr, nullptr, nullptr};
113  std::array<fsm_handle*, 3> active_req{nullptr, nullptr, nullptr};
114  std::array<fsm_handle*, 3> active_resp_beat{nullptr, nullptr, nullptr};
115  scc::peq<aw_data> aw_que;
118 };
119 
120 } // namespace pin
121 } // namespace axi
122 
123 template <typename CFG>
124 inline tlm::tlm_sync_enum axi::pin::axi4_target<CFG>::nb_transport_bw(payload_type& trans, phase_type& phase, sc_core::sc_time& t) {
125  auto ret = tlm::TLM_ACCEPTED;
126  sc_core::sc_time delay = t < clk_if->period() ? sc_core::SC_ZERO_TIME : t; // FIXME: calculate correct time
127  SCCTRACE(SCMOD) << "nb_transport_bw " << phase << " of trans " << trans;
128  if(phase == axi::END_PARTIAL_REQ || phase == tlm::END_REQ) { // read/write
129  schedule(phase == tlm::END_REQ ? EndReqE : EndPartReqE, &trans, delay, false);
130  } else if(phase == axi::BEGIN_PARTIAL_RESP || phase == tlm::BEGIN_RESP) { // read/write response
131  schedule(phase == tlm::BEGIN_RESP ? BegRespE : BegPartRespE, &trans, delay, false);
132  } else
133  SCCFATAL(SCMOD) << "Illegal phase received: " << phase;
134  return ret;
135 }
136 
137 template <typename CFG>
138 inline void axi::pin::axi4_target<CFG>::invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range) {}
139 
140 template <typename CFG> typename CFG::data_t axi::pin::axi4_target<CFG>::get_read_data_for_beat(fsm_handle* fsm_hndl) {
141  auto beat_count = fsm_hndl->beat_count;
142  auto size = axi::get_burst_size(*fsm_hndl->trans);
143  auto byte_offset = beat_count * size;
144  auto offset = (fsm_hndl->trans->get_address() + byte_offset) & (CFG::BUSWIDTH / 8 - 1);
145  typename CFG::data_t data{0};
146  if(offset && (size + offset) > (CFG::BUSWIDTH / 8)) { // un-aligned multi-beat access
147  if(beat_count == 0) {
148  auto dptr = fsm_hndl->trans->get_data_ptr();
149  for(size_t i = offset; i < size; ++i, ++dptr) {
150  auto bit_offs = i * 8;
151  data(bit_offs + 7, bit_offs) = *dptr;
152  }
153  } else {
154  auto beat_start_idx = byte_offset - offset;
155  auto data_len = fsm_hndl->trans->get_data_length();
156  auto dptr = fsm_hndl->trans->get_data_ptr() + beat_start_idx;
157  for(size_t i = 0; i < size && (beat_start_idx + i) < data_len; ++i, ++dptr) {
158  auto bit_offs = i * 8;
159  data(bit_offs + 7, bit_offs) = *dptr;
160  }
161  }
162  } else { // aligned or single beat access
163  auto dptr = fsm_hndl->trans->get_data_ptr() + byte_offset;
164  for(size_t i = 0; i < size; ++i, ++dptr) {
165  auto bit_offs = (offset + i) * 8;
166  data(bit_offs + 7, bit_offs) = *dptr;
167  }
168  }
169  return data;
170 }
171 
172 template <typename CFG> inline void axi::pin::axi4_target<CFG>::setup_callbacks(fsm_handle* fsm_hndl) {
173  fsm_hndl->fsm->cb[RequestPhaseBeg] = [this, fsm_hndl]() -> void { fsm_hndl->beat_count = 0; };
174  fsm_hndl->fsm->cb[BegPartReqE] = [this, fsm_hndl]() -> void {
175  sc_assert(fsm_hndl->trans->get_command() == tlm::TLM_WRITE_COMMAND);
176  tlm::tlm_phase phase = axi::BEGIN_PARTIAL_REQ;
177  sc_core::sc_time t(sc_core::SC_ZERO_TIME);
178  auto ret = isckt->nb_transport_fw(*fsm_hndl->trans, phase, t);
179  if(ret == tlm::TLM_UPDATED) {
180  schedule(EndPartReqE, fsm_hndl->trans, t, true);
181  }
182  };
183  fsm_hndl->fsm->cb[EndPartReqE] = [this, fsm_hndl]() -> void {
184  wdata_end_req_evt.notify();
185  active_req_beat[tlm::TLM_WRITE_COMMAND] = nullptr;
186  fsm_hndl->beat_count++;
187  };
188  fsm_hndl->fsm->cb[BegReqE] = [this, fsm_hndl]() -> void {
189  tlm::tlm_phase phase = tlm::BEGIN_REQ;
190  sc_core::sc_time t(sc_core::SC_ZERO_TIME);
191  auto ret = isckt->nb_transport_fw(*fsm_hndl->trans, phase, t);
192  if(ret == tlm::TLM_UPDATED) {
193  schedule(EndReqE, fsm_hndl->trans, t, true);
194  }
195  };
196  fsm_hndl->fsm->cb[EndReqE] = [this, fsm_hndl]() -> void {
197  switch(fsm_hndl->trans->get_command()) {
198  case tlm::TLM_READ_COMMAND:
199  ar_end_req_evt.notify();
200  active_req_beat[tlm::TLM_READ_COMMAND] = nullptr;
201  break;
202  case tlm::TLM_WRITE_COMMAND:
203  wdata_end_req_evt.notify();
204  active_req_beat[tlm::TLM_WRITE_COMMAND] = nullptr;
205  fsm_hndl->beat_count++;
206  break;
207  default:
208  break;
209  }
210  };
211  fsm_hndl->fsm->cb[BegPartRespE] = [this, fsm_hndl]() -> void {
212  assert(fsm_hndl->trans->is_read());
213  active_resp_beat[tlm::TLM_READ_COMMAND] = fsm_hndl;
214  rresp_vl.notify({1, fsm_hndl});
215  };
216  fsm_hndl->fsm->cb[EndPartRespE] = [this, fsm_hndl]() -> void {
217  // scheduling the response
218  assert(fsm_hndl->trans->is_read());
219  tlm::tlm_phase phase = axi::END_PARTIAL_RESP;
220  sc_core::sc_time t(clk_if ? ::scc::time_to_next_posedge(clk_if) - 1_ps : sc_core::SC_ZERO_TIME);
221  auto ret = isckt->nb_transport_fw(*fsm_hndl->trans, phase, t);
222  active_resp_beat[tlm::TLM_READ_COMMAND] = nullptr;
223  fsm_hndl->beat_count++;
224  };
225  fsm_hndl->fsm->cb[BegRespE] = [this, fsm_hndl]() -> void {
226  SCCTRACE(SCMOD) << "processing event BegRespE for trans " << *fsm_hndl->trans;
227  auto size = axi::get_burst_size(*fsm_hndl->trans);
228  active_resp_beat[fsm_hndl->trans->get_command()] = fsm_hndl;
229  switch(fsm_hndl->trans->get_command()) {
230  case tlm::TLM_READ_COMMAND:
231  rresp_vl.notify({3, fsm_hndl});
232  break;
233  case tlm::TLM_WRITE_COMMAND:
234  wresp_vl.notify({3, fsm_hndl});
235  break;
236  default:
237  break;
238  }
239  };
240  fsm_hndl->fsm->cb[EndRespE] = [this, fsm_hndl]() -> void {
241  // scheduling the response
242  tlm::tlm_phase phase = tlm::END_RESP;
243  sc_core::sc_time t(clk_if ? ::scc::time_to_next_posedge(clk_if) - 1_ps : sc_core::SC_ZERO_TIME);
244  auto ret = isckt->nb_transport_fw(*fsm_hndl->trans, phase, t);
245  fsm_hndl->finish.notify();
246  active_resp_beat[fsm_hndl->trans->get_command()] = nullptr;
247  };
248 }
249 
250 template <typename CFG> inline void axi::pin::axi4_target<CFG>::ar_t() {
251  this->ar_ready.write(false);
252  wait(sc_core::SC_ZERO_TIME);
253  auto arid = 0U;
254  auto arlen = 0U;
255  auto arsize = util::ilog2(CFG::BUSWIDTH / 8);
256  auto data_len = (1 << arsize) * (arlen + 1);
257  while(true) {
258  wait(clk_delayed);
259  while(!this->ar_valid.read()) {
260  wait(this->ar_valid.posedge_event());
261  wait(CLK_DELAY); // verilator might create spurious events
262  }
263  SCCTRACE(SCMOD) << "ARVALID detected for 0x" << std::hex << this->ar_addr.read();
264  if(!CFG::IS_LITE) {
265  arid = this->ar_id->read().to_uint();
266  arlen = this->ar_len->read().to_uint();
267  arsize = this->ar_size->read().to_uint();
268  }
269  data_len = (1 << arsize) * (arlen + 1);
271  gp->set_address(this->ar_addr.read());
272  gp->set_command(tlm::TLM_READ_COMMAND);
273  gp->set_streaming_width(data_len);
274  axi::axi4_extension* ext;
275  gp->get_extension(ext);
276  ext->set_id(arid);
277  ext->set_length(arlen);
278  ext->set_size(arsize);
279  ext->set_burst(CFG::IS_LITE ? axi::burst_e::INCR : axi::into<axi::burst_e>(this->ar_burst->read()));
280  ext->set_exclusive(!CFG::IS_LITE && this->ar_lock->read());
281  ext->set_prot(this->ar_prot->read());
282  ext->set_qos(CFG::IS_LITE ? 0U : this->ar_qos->read().to_uint());
283  ext->set_region(CFG::IS_LITE ? 0U : this->ar_region->read().to_uint());
284 
285  active_req_beat[tlm::TLM_READ_COMMAND] = find_or_create(gp);
286  react(axi::fsm::protocol_time_point_e::BegReqE, active_req_beat[tlm::TLM_READ_COMMAND]);
287  wait(ar_end_req_evt);
288  this->ar_ready.write(true);
289  wait(clk_i.posedge_event());
290  this->ar_ready.write(false);
291  }
292 }
293 
294 template <typename CFG> inline void axi::pin::axi4_target<CFG>::rresp_t() {
295  this->r_valid.write(false);
296  wait(sc_core::SC_ZERO_TIME);
297  fsm_handle* fsm_hndl;
298  uint8_t val;
299  while(true) {
300  std::tie(val, fsm_hndl) = rresp_vl.get();
301  SCCTRACE(SCMOD) << "got read response beat of trans " << *fsm_hndl->trans;
302  auto ext = fsm_hndl->trans->get_extension<axi::axi4_extension>();
303  this->r_data.write(get_read_data_for_beat(fsm_hndl));
304  this->r_resp.write(axi::to_int(ext->get_resp()));
305  this->r_valid.write(val & 0x1);
306  if(!CFG::IS_LITE) {
307  this->r_id->write(ext->get_id());
308  this->r_last->write(val & 0x2);
309  }
310  do {
311  wait(this->r_ready.posedge_event() | clk_delayed);
312  if(this->r_ready.read()) {
313  auto evt =
314  CFG::IS_LITE || (val & 0x2) ? axi::fsm::protocol_time_point_e::EndRespE : axi::fsm::protocol_time_point_e::EndPartRespE;
315  react(evt, active_resp_beat[tlm::TLM_READ_COMMAND]);
316  }
317  } while(!this->r_ready.read());
318  SCCTRACE(SCMOD) << "finished read response beat of trans [" << fsm_hndl->trans << "]";
319  wait(clk_i.posedge_event());
320  this->r_valid.write(false);
321  if(!CFG::IS_LITE)
322  this->r_last->write(false);
323  }
324 }
325 
326 template <typename CFG> inline void axi::pin::axi4_target<CFG>::aw_t() {
327  this->aw_ready.write(false);
328  wait(sc_core::SC_ZERO_TIME);
329  const auto awsize = util::ilog2(CFG::BUSWIDTH / 8);
330  while(true) {
331  wait(this->aw_valid.posedge_event() | clk_delayed);
332  if(this->aw_valid.event() || (!active_req_beat[tlm::TLM_IGNORE_COMMAND] && this->aw_valid.read())) {
333  SCCTRACE(SCMOD) << "AWVALID detected for 0x" << std::hex << this->aw_addr.read();
334  // clang-format off
335  aw_data awd = {CFG::IS_LITE ? 0U : this->aw_id->read().to_uint(),
336  this->aw_addr.read().to_uint64(),
337  this->aw_prot.read().to_uint(),
338  CFG::IS_LITE ? awsize : this->aw_size->read().to_uint(),
339  CFG::IS_LITE ? 0U : this->aw_cache->read().to_uint(),
340  CFG::IS_LITE ? 0U : this->aw_burst->read().to_uint(),
341  CFG::IS_LITE ? 0U : this->aw_qos->read().to_uint(),
342  CFG::IS_LITE ? 0U : this->aw_region->read().to_uint(),
343  CFG::IS_LITE ? 0U : this->aw_len->read().to_uint(),
344  CFG::IS_LITE ? false : this->aw_lock->read(),
345  0};
346  // clang-format on
347  aw_que.notify(std::move(awd));
348  this->aw_ready.write(true);
349  wait(clk_i.posedge_event());
350  this->aw_ready.write(false);
351  }
352  }
353 }
354 
355 template <typename CFG> inline void axi::pin::axi4_target<CFG>::wdata_t() {
356  this->w_ready.write(false);
357  wait(sc_core::SC_ZERO_TIME);
358  while(true) {
359  wait(this->w_valid.posedge_event() | clk_delayed);
360  this->w_ready.write(false);
361  if(this->w_valid.event() || (!active_req_beat[tlm::TLM_WRITE_COMMAND] && this->w_valid.read())) {
362  if(!active_req[tlm::TLM_WRITE_COMMAND]) {
363  if(!aw_que.has_next())
364  wait(aw_que.event());
365  auto awd = aw_que.get();
366  auto data_len = (1 << awd.size) * (awd.len + 1);
367  auto gp = tlm::scc::tlm_mm<>::get().allocate<axi::axi4_extension>(data_len, true);
368  gp->set_address(awd.addr);
369  gp->set_command(tlm::TLM_WRITE_COMMAND);
370  axi::axi4_extension* ext;
371  gp->get_extension(ext);
372  ext->set_id(awd.id);
373  ext->set_length(awd.len);
374  ext->set_size(awd.size);
375  ext->set_burst(axi::into<axi::burst_e>(awd.burst));
376  ext->set_prot(awd.prot);
377  ext->set_qos(awd.qos);
378  ext->set_cache(awd.cache);
379  ext->set_region(awd.region);
380  ext->set_exclusive(awd.lock);
381  if(CFG::USERWIDTH)
382  ext->set_user(axi::common::id_type::CTRL, awd.user);
383 
384  active_req_beat[tlm::TLM_WRITE_COMMAND] = find_or_create(gp);
385  active_req[tlm::TLM_WRITE_COMMAND] = active_req_beat[tlm::TLM_WRITE_COMMAND];
386  }
387  auto* fsm_hndl = active_req[tlm::TLM_WRITE_COMMAND];
388  SCCTRACE(SCMOD) << "WDATA detected for 0x" << std::hex << this->ar_addr.read();
389  auto& gp = fsm_hndl->trans;
390  auto data = this->w_data.read();
391  auto strb = this->w_strb.read();
392  auto last = CFG::IS_LITE ? true : this->w_last->read();
393  auto beat_count = fsm_hndl->beat_count;
394  auto size = axi::get_burst_size(*fsm_hndl->trans);
395  auto byte_offset = beat_count * size;
396  auto offset = (fsm_hndl->trans->get_address() + byte_offset) & (CFG::BUSWIDTH / 8 - 1);
397  if(offset && (size + offset) > (CFG::BUSWIDTH / 8)) { // un-aligned multi-beat access
398  if(beat_count == 0) {
399  auto dptr = fsm_hndl->trans->get_data_ptr();
400  auto beptr = fsm_hndl->trans->get_byte_enable_ptr();
401  for(size_t i = offset; i < size; ++i, ++dptr, ++beptr) {
402  auto bit_offs = i * 8;
403  *dptr = data(bit_offs + 7, bit_offs).to_uint();
404  *beptr = strb[i] ? 0xff : 0;
405  }
406  } else {
407  auto beat_start_idx = byte_offset - offset;
408  auto data_len = fsm_hndl->trans->get_data_length();
409  auto dptr = fsm_hndl->trans->get_data_ptr() + beat_start_idx;
410  auto beptr = fsm_hndl->trans->get_byte_enable_ptr() + beat_start_idx;
411  for(size_t i = 0; i < size && (beat_start_idx + i) < data_len; ++i, ++dptr, ++beptr) {
412  auto bit_offs = i * 8;
413  *dptr = data(bit_offs + 7, bit_offs).to_uint();
414  *beptr = strb[i] ? 0xff : 0;
415  }
416  }
417  } else { // aligned or single beat access
418  auto dptr = fsm_hndl->trans->get_data_ptr() + byte_offset;
419  auto beptr = fsm_hndl->trans->get_byte_enable_ptr() + byte_offset;
420  for(size_t i = 0; i < size; ++i, ++dptr, ++beptr) {
421  auto bit_offs = (offset + i) * 8;
422  *dptr = data(bit_offs + 7, bit_offs).to_uint();
423  *beptr = strb[offset + i] ? 0xff : 0;
424  }
425  }
426  // TODO: assuming consecutive write (not scattered)
427  auto strobe = strb.to_uint();
428  if(last) {
429  auto act_data_len = CFG::IS_LITE ? util::bit_count(strobe) : (beat_count + 1) * size;
430  // if(CFG::IS_LITE && act_data_len<CFG::BUSWIDTH/8) {
431  // std::fill(gp->get_byte_enable_ptr(), gp->get_byte_enable_ptr() + act_data_len, 0xff);
432  // std::fill(gp->get_byte_enable_ptr() + act_data_len, gp->get_byte_enable_ptr() +
433  // gp->get_byte_enable_length(), 0x0);
434  // }
435  gp->set_data_length(act_data_len);
436  gp->set_byte_enable_length(act_data_len);
437  gp->set_streaming_width(act_data_len);
438  }
439  auto tp = CFG::IS_LITE || this->w_last->read() ? axi::fsm::protocol_time_point_e::BegReqE
440  : axi::fsm::protocol_time_point_e::BegPartReqE;
441  react(tp, fsm_hndl);
442  wait(wdata_end_req_evt);
443  this->w_ready.write(true);
444  wait(clk_i.posedge_event());
445  this->w_ready.write(false);
446  if(last)
447  active_req[tlm::TLM_WRITE_COMMAND] = nullptr;
448  }
449  }
450 }
451 
452 template <typename CFG> inline void axi::pin::axi4_target<CFG>::bresp_t() {
453  this->b_valid.write(false);
454  wait(sc_core::SC_ZERO_TIME);
455  fsm_handle* fsm_hndl;
456  uint8_t val;
457  while(true) {
458  std::tie(val, fsm_hndl) = wresp_vl.get();
459  SCCTRACE(SCMOD) << "got write response of trans " << *fsm_hndl->trans;
460  auto ext = fsm_hndl->trans->get_extension<axi::axi4_extension>();
461  this->b_resp.write(axi::to_int(ext->get_resp()));
462  this->b_valid.write(true);
463  if(!CFG::IS_LITE)
464  this->b_id->write(ext->get_id());
465  SCCTRACE(SCMOD) << "got write response";
466  do {
467  wait(this->b_ready.posedge_event() | clk_delayed);
468  if(this->b_ready.read()) {
469  react(axi::fsm::protocol_time_point_e::EndRespE, active_resp_beat[tlm::TLM_WRITE_COMMAND]);
470  }
471  } while(!this->b_ready.read());
472  SCCTRACE(SCMOD) << "finished write response of trans [" << fsm_hndl->trans << "]";
473  wait(clk_i.posedge_event());
474  this->b_valid.write(false);
475  }
476 }
477 
478 #endif /* _BUS_AXI_PIN_AXI4_TARGET_H_ */
payload_type * allocate()
get a plain tlm_payload_type without extensions
Definition: tlm_mm.h:228
static tlm_mm & get()
accessor function of the singleton
Definition: tlm_mm.h:222
TLM2.0 components modeling AHB.
Definition: axi_initiator.h:30
tlm::tlm_bw_transport_if< TYPES > axi_bw_transport_if
alias declaration for the backward interface:
Definition: axi_tlm.h:918
constexpr ULT to_int(E t)
Definition: axi_tlm.h:47
unsigned get_burst_size(const request &r)
Definition: axi_tlm.h:1157
CONSTEXPR unsigned ilog2(uint32_t val)
Definition: ities.h:163
void set_exclusive(bool=true)
get the exclusive bit of AxLOCK (AxLOCK[0])
Definition: axi_tlm.h:1324
void set_id(unsigned int value)
Definition: axi_tlm.h:1252
void set_user(id_type chnl, unsigned int value)
Definition: axi_tlm.h:1256
unsigned int get_id() const
Definition: axi_tlm.h:1254
base class of all AXITLM based adapters and interfaces.
Definition: base.h: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:1380
void set_qos(uint8_t)
set the AxQOS (quality of service) value
Definition: axi_tlm.h:1426
void set_cache(uint8_t)
set the AxCACHE value as POD, only value from 0..15 are allowed
Definition: axi_tlm.h:1434
void set_region(uint8_t)
set the AxREGION value
Definition: axi_tlm.h:1430
void set_burst(burst_e)
set the AxBURST value,
Definition: axi_tlm.h:1391
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:1384
void set_prot(uint8_t)
set the AxPROT value as POD, only values from 0...7 are allowed
Definition: axi_tlm.h:1395
resp_e get_resp() const
get the response status as POD
Definition: axi_tlm.h:1502