scc  2024.06
SystemC components library
ace_lite_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_ACE_LITE_TARGET_H_
18 #define _BUS_AXI_PIN_ACE_LITE_TARGET_H_
19 
20 #include <axi/axi_tlm.h>
21 #include <axi/fsm/base.h>
22 #include <axi/fsm/protocol_fsm.h>
23 #include <interfaces/axi/signal_if.h>
24 #include <systemc>
25 #include <tlm/scc/tlm_mm.h>
26 #include <util/ities.h>
27 
29 namespace axi {
31 namespace pin {
32 
33 using namespace axi::fsm;
34 
35 template <typename CFG>
36 struct ace_lite_target : public sc_core::sc_module,
37  public aw_ace_lite<CFG, typename CFG::slave_types>,
38  public wdata_ace_lite<CFG, typename CFG::slave_types>,
39  public b_ace_lite<CFG, typename CFG::slave_types>,
40  public ar_ace_lite<CFG, typename CFG::slave_types>,
41  public rresp_ace_lite<CFG, typename CFG::slave_types>,
42  protected axi::fsm::base,
43  public axi::axi_bw_transport_if<axi::axi_protocol_types> {
44  SC_HAS_PROCESS(ace_lite_target);
45 
46  using payload_type = axi::axi_protocol_types::tlm_payload_type;
47  using phase_type = axi::axi_protocol_types::tlm_phase_type;
48 
49  sc_core::sc_in<bool> clk_i{"clk_i"};
50 
52 
53  ace_lite_target(sc_core::sc_module_name const& nm)
54  : sc_core::sc_module(nm)
55  // ace_lite has no ack, therefore coherent= false
56  , base(CFG::BUSWIDTH, false) {
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  unsigned domain;
108  unsigned snoop;
109  unsigned bar;
110  unsigned unique;
111  unsigned stashnid;
112  unsigned stashlpid;
113  bool lock;
114  uint64_t user;
115  };
116 
117  std::deque<axi::fsm::fsm_handle*> snp_resp_queue;
118 
119  sc_core::sc_clock* clk_if{nullptr};
120  sc_core::sc_event clk_delayed, clk_self, ar_end_req_evt, wdata_end_req_evt;
121  std::array<fsm_handle*, 3> active_req_beat{nullptr, nullptr, nullptr};
122  std::array<fsm_handle*, 3> active_req{nullptr, nullptr, nullptr};
123  std::array<fsm_handle*, 3> active_resp_beat{nullptr, nullptr, nullptr};
124  scc::peq<aw_data> aw_que;
127 };
128 } // namespace pin
129 } // namespace axi
130 
131 template <typename CFG>
132 inline tlm::tlm_sync_enum axi::pin::ace_lite_target<CFG>::nb_transport_bw(payload_type& trans, phase_type& phase, sc_core::sc_time& t) {
133  auto ret = tlm::TLM_ACCEPTED;
134  SCCTRACE(SCMOD) << "nb_transport_bw with " << phase << " with delay= " << t << " of trans " << trans;
135  if(phase == END_PARTIAL_REQ || phase == tlm::END_REQ) { // read/write
136  schedule(phase == tlm::END_REQ ? EndReqE : EndPartReqE, &trans, t, false);
137  } else if(phase == axi::BEGIN_PARTIAL_RESP || phase == tlm::BEGIN_RESP) { // read/write response
138  schedule(phase == tlm::BEGIN_RESP ? BegRespE : BegPartRespE, &trans, t, false);
139  } else
140  SCCFATAL(SCMOD) << "Illegal phase received: " << phase;
141  return ret;
142 }
143 
144 template <typename CFG>
145 inline void axi::pin::ace_lite_target<CFG>::invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range) {}
146 
147 template <typename CFG> typename CFG::data_t axi::pin::ace_lite_target<CFG>::get_read_data_for_beat(fsm_handle* fsm_hndl) {
148  auto beat_count = fsm_hndl->beat_count;
149  auto size = axi::get_burst_size(*fsm_hndl->trans);
150  auto byte_offset = beat_count * size;
151  auto offset = (fsm_hndl->trans->get_address() + byte_offset) & (CFG::BUSWIDTH / 8 - 1);
152  typename CFG::data_t data{0};
153  if(offset && (size + offset) > (CFG::BUSWIDTH / 8)) { // un-aligned multi-beat access
154  if(beat_count == 0) {
155  auto dptr = fsm_hndl->trans->get_data_ptr();
156  for(size_t i = offset; i < size; ++i, ++dptr) {
157  auto bit_offs = i * 8;
158  data(bit_offs + 7, bit_offs) = *dptr;
159  }
160  } else {
161  auto beat_start_idx = byte_offset - offset;
162  auto data_len = fsm_hndl->trans->get_data_length();
163  auto dptr = fsm_hndl->trans->get_data_ptr() + beat_start_idx;
164  for(size_t i = 0; i < size && (beat_start_idx + i) < data_len; ++i, ++dptr) {
165  auto bit_offs = i * 8;
166  data(bit_offs + 7, bit_offs) = *dptr;
167  }
168  }
169  } else { // aligned or single beat access
170  auto dptr = fsm_hndl->trans->get_data_ptr() + byte_offset;
171  for(size_t i = 0; i < size; ++i, ++dptr) {
172  auto bit_offs = (offset + i) * 8;
173  data(bit_offs + 7, bit_offs) = *dptr;
174  }
175  }
176  return data;
177 }
178 
179 template <typename CFG> inline void axi::pin::ace_lite_target<CFG>::setup_callbacks(fsm_handle* fsm_hndl) {
180  fsm_hndl->fsm->cb[RequestPhaseBeg] = [this, fsm_hndl]() -> void { fsm_hndl->beat_count = 0; };
181  fsm_hndl->fsm->cb[BegPartReqE] = [this, fsm_hndl]() -> void {
182  sc_assert(fsm_hndl->trans->get_command() == tlm::TLM_WRITE_COMMAND);
183  tlm::tlm_phase phase = axi::BEGIN_PARTIAL_REQ;
184  sc_core::sc_time t(sc_core::SC_ZERO_TIME);
185  auto ret = isckt->nb_transport_fw(*fsm_hndl->trans, phase, t);
186  if(ret == tlm::TLM_UPDATED) {
187  schedule(EndPartReqE, fsm_hndl->trans, t, true);
188  }
189  };
190  fsm_hndl->fsm->cb[EndPartReqE] = [this, fsm_hndl]() -> void {
191  wdata_end_req_evt.notify();
192  active_req_beat[tlm::TLM_WRITE_COMMAND] = nullptr;
193  fsm_hndl->beat_count++;
194  };
195  fsm_hndl->fsm->cb[BegReqE] = [this, fsm_hndl]() -> void {
196  tlm::tlm_phase phase = tlm::BEGIN_REQ;
197  sc_core::sc_time t(sc_core::SC_ZERO_TIME);
198  auto ret = isckt->nb_transport_fw(*fsm_hndl->trans, phase, t);
199  if(ret == tlm::TLM_UPDATED) {
200  schedule(EndReqE, fsm_hndl->trans, t, true);
201  }
202  };
203  fsm_hndl->fsm->cb[EndReqE] = [this, fsm_hndl]() -> void {
204  switch(fsm_hndl->trans->get_command()) {
205  case tlm::TLM_READ_COMMAND:
206  ar_end_req_evt.notify();
207  active_req_beat[tlm::TLM_READ_COMMAND] = nullptr;
208  break;
209  case tlm::TLM_WRITE_COMMAND:
210  wdata_end_req_evt.notify();
211  active_req_beat[tlm::TLM_WRITE_COMMAND] = nullptr;
212  fsm_hndl->beat_count++;
213  break;
214  default:
215  break;
216  }
217  };
218  fsm_hndl->fsm->cb[BegPartRespE] = [this, fsm_hndl]() -> void {
219  assert(fsm_hndl->trans->is_read());
220  active_resp_beat[tlm::TLM_READ_COMMAND] = fsm_hndl;
221  rresp_vl.notify({1, fsm_hndl});
222  };
223  fsm_hndl->fsm->cb[EndPartRespE] = [this, fsm_hndl]() -> void {
224  // scheduling the response
225  assert(fsm_hndl->trans->is_read());
226  tlm::tlm_phase phase = axi::END_PARTIAL_RESP;
227  sc_core::sc_time t(clk_if ? ::scc::time_to_next_posedge(clk_if) - 1_ps : sc_core::SC_ZERO_TIME);
228  auto ret = isckt->nb_transport_fw(*fsm_hndl->trans, phase, t);
229  active_resp_beat[tlm::TLM_READ_COMMAND] = nullptr;
230  fsm_hndl->beat_count++;
231  };
232  fsm_hndl->fsm->cb[BegRespE] = [this, fsm_hndl]() -> void {
233  SCCTRACE(SCMOD) << "processing event BegRespE for trans " << *fsm_hndl->trans;
234  auto size = axi::get_burst_size(*fsm_hndl->trans);
235  active_resp_beat[fsm_hndl->trans->get_command()] = fsm_hndl;
236  switch(fsm_hndl->trans->get_command()) {
237  case tlm::TLM_READ_COMMAND:
238  rresp_vl.notify({3, fsm_hndl});
239  break;
240  case tlm::TLM_WRITE_COMMAND:
241  wresp_vl.notify({3, fsm_hndl});
242  break;
243  default:
244  break;
245  }
246  };
247  fsm_hndl->fsm->cb[EndRespE] = [this, fsm_hndl]() -> void {
248  // scheduling the response
249  tlm::tlm_phase phase = tlm::END_RESP;
250  sc_core::sc_time t(clk_if ? ::scc::time_to_next_posedge(clk_if) - 1_ps : sc_core::SC_ZERO_TIME);
251  auto ret = isckt->nb_transport_fw(*fsm_hndl->trans, phase, t);
252  SCCTRACE(SCMOD) << "EndResp of setup_cb with coherent = " << coherent;
253  fsm_hndl->finish.notify();
254  active_resp_beat[fsm_hndl->trans->get_command()] = nullptr;
255  };
256 }
257 
258 template <typename CFG> inline void axi::pin::ace_lite_target<CFG>::ar_t() {
259  this->ar_ready.write(false);
260  wait(sc_core::SC_ZERO_TIME);
261  auto arid = 0U;
262  auto arlen = 0U;
263  auto arsize = util::ilog2(CFG::BUSWIDTH / 8);
264  auto data_len = (1 << arsize) * (arlen + 1);
265  while(true) {
266  wait(clk_delayed);
267  while(!this->ar_valid.read()) {
268  wait(this->ar_valid.posedge_event());
269  wait(CLK_DELAY); // verilator might create spurious events
270  }
271  SCCTRACE(SCMOD) << "ARVALID detected for 0x" << std::hex << this->ar_addr.read();
272  arid = this->ar_id->read().to_uint();
273  arlen = this->ar_len->read().to_uint();
274  arsize = this->ar_size->read().to_uint();
275  data_len = (1 << arsize) * (arlen + 1);
276  auto gp = tlm::scc::tlm_mm<>::get().allocate<axi::ace_extension>(data_len);
277  gp->set_address(this->ar_addr.read());
278  gp->set_command(tlm::TLM_READ_COMMAND);
279  gp->set_streaming_width(data_len);
280  axi::ace_extension* ext;
281  gp->get_extension(ext);
282  ext->set_id(arid);
283  ext->set_length(arlen);
284  if(this->ar_lock->read())
285  ext->set_exclusive(true);
286  ext->set_size(arsize);
287  ext->set_burst(axi::into<axi::burst_e>(this->ar_burst->read()));
288  ext->set_cache(this->ar_cache->read());
289  ext->set_prot(this->ar_prot->read());
290  ext->set_qos(this->ar_qos->read());
291  ext->set_region(this->ar_region->read());
292  ext->set_domain(axi::into<axi::domain_e>(this->ar_domain->read())); // ace extension
293  ext->set_snoop(axi::into<axi::snoop_e>(this->ar_snoop->read()));
294  ext->set_barrier(axi::into<axi::bar_e>(this->ar_bar->read()));
295 
296  active_req_beat[tlm::TLM_READ_COMMAND] = find_or_create(gp);
297  react(axi::fsm::protocol_time_point_e::BegReqE, active_req_beat[tlm::TLM_READ_COMMAND]);
298  wait(ar_end_req_evt);
299  this->ar_ready.write(true);
300  wait(clk_i.posedge_event());
301  this->ar_ready.write(false);
302  }
303 }
304 
305 template <typename CFG> inline void axi::pin::ace_lite_target<CFG>::rresp_t() {
306  this->r_valid.write(false);
307  wait(sc_core::SC_ZERO_TIME);
308  fsm_handle* fsm_hndl;
309  uint8_t val;
310  while(true) {
311  // rresp_vl notified in BEGIN_PARTIAL_REQ ( val=1 ??)or in BEG_RESP(val=3??)
312  std::tie(val, fsm_hndl) = rresp_vl.get();
313  SCCTRACE(SCMOD) << __FUNCTION__ << " val = " << (uint16_t)val << " beat count = " << fsm_hndl->beat_count;
314  SCCTRACE(SCMOD) << __FUNCTION__ << " got read response beat of trans " << *fsm_hndl->trans;
315  auto ext = fsm_hndl->trans->get_extension<axi::ace_extension>();
316  this->r_data.write(get_read_data_for_beat(fsm_hndl));
317  this->r_resp.write(ext->get_cresp());
318  this->r_valid.write(val & 0x1);
319  this->r_id->write(ext->get_id());
320  this->r_last->write(val & 0x2);
321  do {
322  wait(this->r_ready.posedge_event() | clk_delayed);
323  if(this->r_ready.read()) {
324  auto evt = (val & 0x2) ? axi::fsm::protocol_time_point_e::EndRespE : axi::fsm::protocol_time_point_e::EndPartRespE;
325  react(evt, active_resp_beat[tlm::TLM_READ_COMMAND]);
326  }
327  } while(!this->r_ready.read());
328  SCCTRACE(SCMOD) << "finished read response beat of trans [" << fsm_hndl->trans << "]";
329  wait(clk_i.posedge_event());
330  this->r_valid.write(false);
331  this->r_last->write(false);
332  }
333 }
334 
335 template <typename CFG> inline void axi::pin::ace_lite_target<CFG>::aw_t() {
336  this->aw_ready.write(false);
337  wait(sc_core::SC_ZERO_TIME);
338  const auto awsize = util::ilog2(CFG::BUSWIDTH / 8);
339  while(true) {
340  wait(clk_delayed);
341  while(!this->aw_valid.read()) {
342  wait(this->aw_valid.posedge_event());
343  wait(CLK_DELAY); // verilator might create spurious events
344  }
345  SCCTRACE(SCMOD) << "AWVALID detected for 0x" << std::hex << this->aw_addr.read();
346  // clang-format off
347  aw_data awd = { this->aw_id->read().to_uint(),
348  this->aw_addr.read().to_uint64(),
349  this->aw_prot.read().to_uint(),
350  this->aw_size->read().to_uint(),
351  this->aw_cache->read().to_uint(),
352  this->aw_burst->read().to_uint(),
353  this->aw_qos->read().to_uint(),
354  this->aw_region->read().to_uint(),
355  this->aw_len->read().to_uint(),
356  this->aw_domain->read().to_uint(),
357  this->aw_snoop->read().to_uint(),
358  this->aw_bar->read().to_uint(),
359  this->aw_unique->read(),
360  this->aw_stashniden->read() ? 0U : this->aw_stashnid->read().to_uint(),
361  this->aw_stashlpiden->read()? 0U : this->aw_stashlpid->read().to_uint(),
362  this->aw_lock->read() ? true : false,
363  0};
364  // clang-format on
365  aw_que.notify(awd);
366  this->aw_ready.write(true);
367  wait(clk_i.posedge_event());
368  this->aw_ready.write(false);
369  }
370 }
371 
372 template <typename CFG> inline void axi::pin::ace_lite_target<CFG>::wdata_t() {
373  this->w_ready.write(false);
374  wait(sc_core::SC_ZERO_TIME);
375  while(true) {
376  wait(this->w_valid.read() ? clk_delayed : this->w_valid.posedge_event());
377  if(this->w_valid.read()) {
378  if(!active_req[tlm::TLM_WRITE_COMMAND]) {
379  if(!aw_que.has_next())
380  wait(aw_que.event());
381  auto awd = aw_que.get();
382  auto data_len = (1 << awd.size) * (awd.len + 1);
383  auto gp = tlm::scc::tlm_mm<>::get().allocate<axi::ace_extension>(data_len, true);
384  gp->set_address(awd.addr);
385  gp->set_command(tlm::TLM_WRITE_COMMAND);
386  axi::ace_extension* ext;
387  gp->get_extension(ext);
388  ext->set_id(awd.id);
389  ext->set_length(awd.len);
390  ext->set_size(awd.size);
391  ext->set_burst(axi::into<axi::burst_e>(awd.burst));
392  ext->set_prot(awd.prot);
393  ext->set_qos(awd.qos);
394  ext->set_cache(awd.cache);
395  ext->set_region(awd.region);
396  ext->set_snoop(axi::into<axi::snoop_e>(awd.snoop));
397  ext->set_barrier(axi::into<axi::bar_e>(awd.bar));
398  // ace_lite does not have aw_unique ext->set_unique(awd.unique);
399  ext->set_stash_nid(awd.stashnid);
400  ext->set_stash_lpid(awd.stashlpid);
401  ext->set_exclusive(awd.lock);
402  if(CFG::USERWIDTH)
403  ext->set_user(axi::common::id_type::CTRL, awd.user);
404  active_req_beat[tlm::TLM_WRITE_COMMAND] = find_or_create(gp);
405  active_req[tlm::TLM_WRITE_COMMAND] = active_req_beat[tlm::TLM_WRITE_COMMAND];
406  active_req_beat[tlm::TLM_WRITE_COMMAND]->aux.i32.i0 = 0;
407  }
408  auto* fsm_hndl = active_req[tlm::TLM_WRITE_COMMAND];
409  SCCTRACE(SCMOD) << "WDATA detected for 0x" << std::hex << this->ar_addr.read();
410  auto& gp = fsm_hndl->trans;
411  auto data = this->w_data.read();
412  auto strb = this->w_strb.read();
413  auto last = this->w_last->read();
414  auto beat_count = fsm_hndl->beat_count;
415  auto size = axi::get_burst_size(*fsm_hndl->trans);
416  auto byte_offset = beat_count * size;
417  auto offset = (fsm_hndl->trans->get_address() + byte_offset) & (CFG::BUSWIDTH / 8 - 1);
418  if(offset && (size + offset) > (CFG::BUSWIDTH / 8)) { // un-aligned multi-beat access
419  if(beat_count == 0) {
420  auto dptr = fsm_hndl->trans->get_data_ptr();
421  auto beptr = fsm_hndl->trans->get_byte_enable_ptr();
422  for(size_t i = offset; i < size; ++i, ++dptr, ++beptr) {
423  auto bit_offs = i * 8;
424  *dptr = data(bit_offs + 7, bit_offs).to_uint();
425  *beptr = strb[i] ? 0xff : 0;
426  fsm_hndl->aux.i32.i0 += strb[i] ? 1 : 0;
427  }
428  } else {
429  auto beat_start_idx = byte_offset - offset;
430  auto data_len = fsm_hndl->trans->get_data_length();
431  auto dptr = fsm_hndl->trans->get_data_ptr() + beat_start_idx;
432  auto beptr = fsm_hndl->trans->get_byte_enable_ptr() + beat_start_idx;
433  for(size_t i = 0; i < size && (beat_start_idx + i) < data_len; ++i, ++dptr, ++beptr) {
434  auto bit_offs = i * 8;
435  *dptr = data(bit_offs + 7, bit_offs).to_uint();
436  *beptr = strb[i] ? 0xff : 0;
437  fsm_hndl->aux.i32.i0 += strb[i] ? 1 : 0;
438  }
439  }
440  } else { // aligned or single beat access
441  auto dptr = fsm_hndl->trans->get_data_ptr() + byte_offset;
442  auto beptr = fsm_hndl->trans->get_byte_enable_ptr() + byte_offset;
443  for(size_t i = 0; i < size; ++i, ++dptr, ++beptr) {
444  auto bit_offs = (offset + i) * 8;
445  *dptr = data(bit_offs + 7, bit_offs).to_uint();
446  *beptr = strb[offset + i] ? 0xff : 0;
447  fsm_hndl->aux.i32.i0 += strb[offset + i] ? 1 : 0;
448  }
449  }
450  // TODO: assuming consecutive write (not scattered)
451  auto strobe = strb.to_uint();
452  if(last) {
453  auto act_data_len = fsm_hndl->aux.i32.i0;
454  gp->set_data_length(act_data_len);
455  gp->set_byte_enable_length(act_data_len);
456  gp->set_streaming_width(act_data_len);
457  }
458  auto tp = this->w_last->read() ? axi::fsm::protocol_time_point_e::BegReqE : axi::fsm::protocol_time_point_e::BegPartReqE;
459  react(tp, fsm_hndl);
460  // notified in EndPartReqE/EndReq
461  wait(wdata_end_req_evt);
462  this->w_ready.write(true);
463  wait(clk_i.posedge_event());
464  this->w_ready.write(false);
465  if(last)
466  active_req[tlm::TLM_WRITE_COMMAND] = nullptr;
467  }
468  }
469 }
470 
471 template <typename CFG> inline void axi::pin::ace_lite_target<CFG>::bresp_t() {
472  this->b_valid.write(false);
473  wait(sc_core::SC_ZERO_TIME);
474  fsm_handle* fsm_hndl;
475  uint8_t val;
476  while(true) {
477  std::tie(val, fsm_hndl) = wresp_vl.get();
478  SCCTRACE(SCMOD) << "got write response of trans " << *fsm_hndl->trans;
479  auto ext = fsm_hndl->trans->get_extension<axi::ace_extension>();
480  this->b_resp.write(axi::to_int(ext->get_resp()));
481  this->b_valid.write(true);
482  this->b_id->write(ext->get_id());
483  SCCTRACE(SCMOD) << "got write response";
484  do {
485  wait(this->b_ready.posedge_event() | clk_delayed);
486  if(this->b_ready.read()) {
487  react(axi::fsm::protocol_time_point_e::EndRespE, active_resp_beat[tlm::TLM_WRITE_COMMAND]);
488  }
489  } while(!this->b_ready.read());
490  SCCTRACE(SCMOD) << "finished write response of trans [" << fsm_hndl->trans << "]";
491  wait(clk_i.posedge_event());
492  this->b_valid.write(false);
493  }
494 }
495 
496 #endif /* _BUS_AXI_PIN_ace_lite_TARGET_H_ */
payload_type * allocate()
get a plain tlm_payload_type without extensions
Definition: tlm_mm.h:185
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: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:194
uint8_t get_cresp() const
get the coherent response status
Definition: axi_tlm.h:1605
void set_barrier(bar_e)
set the AxBAR value
Definition: axi_tlm.h:1521
void set_domain(domain_e)
set the AxDOMAIN value
Definition: axi_tlm.h:1513
void set_snoop(snoop_e)
set the AxSNOOP value
Definition: axi_tlm.h:1517
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
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_stash_lpid(uint8_t)
set the raw AWSTASHLPID value
Definition: axi_tlm.h:1539
void set_burst(burst_e)
set the AxBURST value,
Definition: axi_tlm.h:1463
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
void set_stash_nid(uint8_t)
set the raw AWSTASHNID value
Definition: axi_tlm.h:1533
resp_e get_resp() const
get the response status as POD
Definition: axi_tlm.h:1574
static tlm_mm & get()
accessor function of the singleton
Definition: tlm_mm.h:293