TLM-2.0  2.0.3
Accellera TLM-2.0 proof-of-concept library
tlm_gp.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  The following code is derived, directly or indirectly, from the SystemC
4  source code Copyright (c) 1996-2014 by all Contributors.
5  All Rights reserved.
6 
7  The contents of this file are subject to the restrictions and limitations
8  set forth in the SystemC Open Source License (the "License");
9  You may not use this file except in compliance with such restrictions and
10  limitations. You may obtain instructions on how to receive a copy of the
11  License at http://www.accellera.org/. Software distributed by Contributors
12  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
13  ANY KIND, either express or implied. See the License for the specific
14  language governing rights and limitations under the License.
15 
16 *****************************************************************************/
17 
18 // 12-Jan-2009 John Aynsley Bug fix. has_mm() and get_ref_count() should both be const
19 // 23-Mar-2009 John Aynsley Add method update_original_from()
20 // 20-Apr-2009 John Aynsley Bug fix for 64-bit machines: unsigned long int -> unsigned int
21 // 5-May-2011 JA and Philipp Hartmann Add tlm_gp_option, set_gp_option, get_gp_option
22 // 11-May-2011 John Aynsley Add run-time check to release()
23 
24 
25 #ifndef __TLM_GP_H__
26 #define __TLM_GP_H__
27 
28 #include <systemc>
30 
31 namespace tlm {
32 
33 class
34 tlm_generic_payload;
35 
37 public:
38  virtual void free(tlm_generic_payload*) = 0;
39  virtual ~tlm_mm_interface() {}
40 };
41 
42 //---------------------------------------------------------------------------
43 // Classes and helper functions for the extension mechanism
44 //---------------------------------------------------------------------------
45 // Helper function:
46 inline unsigned int max_num_extensions(bool increment=false)
47 {
48  static unsigned int max_num = 0;
49  if (increment) ++max_num;
50  return max_num;
51 }
52 
53 // This class can be used for storing pointers to the extension classes, used
54 // in tlm_generic_payload:
56 {
57 public:
58  virtual tlm_extension_base* clone() const = 0;
59  virtual void free() { delete this; }
60  virtual void copy_from(tlm_extension_base const &) = 0;
61 protected:
62  virtual ~tlm_extension_base() {}
63  static unsigned int register_extension()
64  {
65  return (max_num_extensions(true) - 1);
66  };
67 };
68 
69 // Base class for all extension classes, derive your extension class in
70 // the following way:
71 // class my_extension : public tlm_extension<my_extension> { ...
72 // This triggers proper extension registration during C++ static
73 // contruction time. my_extension::ID will hold the unique index in the
74 // tlm_generic_payload::m_extensions array.
75 template <typename T>
77 {
78 public:
79  virtual tlm_extension_base* clone() const = 0;
80  virtual void copy_from(tlm_extension_base const &ext) = 0; //{assert(typeid(this)==typeid(ext)); assert(ID === ext.ID); assert(0);}
81  virtual ~tlm_extension() {}
82  const static unsigned int ID;
83 };
84 
85 template <typename T>
86 const
88 
89 //---------------------------------------------------------------------------
90 // enumeration types
91 //---------------------------------------------------------------------------
96 };
97 
106 };
107 
112 };
113 
114 #define TLM_BYTE_DISABLED 0x0
115 #define TLM_BYTE_ENABLED 0xff
116 
117 //---------------------------------------------------------------------------
118 // The generic payload class:
119 //---------------------------------------------------------------------------
121 
122 public:
123  //---------------
124  // Constructors
125  //---------------
126 
127  // Default constructor
129  : m_address(0)
130  , m_command(TLM_IGNORE_COMMAND)
131  , m_data(0)
132  , m_length(0)
133  , m_response_status(TLM_INCOMPLETE_RESPONSE)
134  , m_dmi(false)
135  , m_byte_enable(0)
136  , m_byte_enable_length(0)
137  , m_streaming_width(0)
138  , m_gp_option(TLM_MIN_PAYLOAD)
139  , m_extensions(max_num_extensions())
140  , m_mm(0)
141  , m_ref_count(0)
142  {
143  }
144 
146  : m_address(0)
147  , m_command(TLM_IGNORE_COMMAND)
148  , m_data(0)
149  , m_length(0)
150  , m_response_status(TLM_INCOMPLETE_RESPONSE)
151  , m_dmi(false)
152  , m_byte_enable(0)
153  , m_byte_enable_length(0)
154  , m_streaming_width(0)
155  , m_gp_option(TLM_MIN_PAYLOAD)
156  , m_extensions(max_num_extensions())
157  , m_mm(mm)
158  , m_ref_count(0)
159  {
160  }
161 
162  void acquire(){assert(m_mm != 0); m_ref_count++;}
163  void release(){assert(m_mm != 0 && m_ref_count > 0); if (--m_ref_count==0) m_mm->free(this);}
164  int get_ref_count() const {return m_ref_count;}
165  void set_mm(tlm_mm_interface* mm) { m_mm = mm; }
166  bool has_mm() const { return m_mm != 0; }
167 
168  void reset(){
169  //should the other members be reset too?
170  m_gp_option = TLM_MIN_PAYLOAD;
171  m_extensions.free_entire_cache();
172  };
173 
174 
175 private:
176  //disabled copy ctor and assignment operator.
177  // Copy constructor
179  : m_address(x.get_address())
180  , m_command(x.get_command())
181  , m_data(x.get_data_ptr())
182  , m_length(x.get_data_length())
183  , m_response_status(x.get_response_status())
184  , m_dmi(x.is_dmi_allowed())
185  , m_byte_enable(x.get_byte_enable_ptr())
186  , m_byte_enable_length(x.get_byte_enable_length())
187  , m_streaming_width(x.get_streaming_width())
188  , m_gp_option(x.m_gp_option)
189  , m_extensions(max_num_extensions())
190  {
191  // copy all extensions
192  for(unsigned int i=0; i<m_extensions.size(); i++)
193  {
194  m_extensions[i] = x.get_extension(i);
195  }
196  }
197 
198  // Assignment operator
199  tlm_generic_payload& operator= (const tlm_generic_payload& x)
200  {
201  m_command = x.get_command();
202  m_address = x.get_address();
203  m_data = x.get_data_ptr();
204  m_length = x.get_data_length();
205  m_response_status = x.get_response_status();
206  m_byte_enable = x.get_byte_enable_ptr();
207  m_byte_enable_length = x.get_byte_enable_length();
208  m_streaming_width = x.get_streaming_width();
209  m_gp_option = x.get_gp_option();
210  m_dmi = x.is_dmi_allowed();
211 
212  // extension copy: all extension arrays must be of equal size by
213  // construction (i.e. it must either be constructed after C++
214  // static construction time, or the resize_extensions() method must
215  // have been called prior to using the object)
216  for(unsigned int i=0; i<m_extensions.size(); i++)
217  {
218  m_extensions[i] = x.get_extension(i);
219  }
220  return (*this);
221  }
222 public:
223  // non-virtual deep-copying of the object
225  {
226  m_command = other.get_command();
227  m_address = other.get_address();
228  m_length = other.get_data_length();
229  m_response_status = other.get_response_status();
230  m_byte_enable_length = other.get_byte_enable_length();
231  m_streaming_width = other.get_streaming_width();
232  m_gp_option = other.get_gp_option();
233  m_dmi = other.is_dmi_allowed();
234 
235  // deep copy data
236  // there must be enough space in the target transaction!
237  if(m_data && other.m_data)
238  {
239  memcpy(m_data, other.m_data, m_length);
240  }
241  // deep copy byte enables
242  // there must be enough space in the target transaction!
243  if(m_byte_enable && other.m_byte_enable)
244  {
245  memcpy(m_byte_enable, other.m_byte_enable, m_byte_enable_length);
246  }
247  // deep copy extensions (sticky and non-sticky)
248  for(unsigned int i=0; i<other.m_extensions.size(); i++)
249  {
250  if(other.m_extensions[i])
251  { //original has extension i
252  if(!m_extensions[i])
253  { //We don't: clone.
254  tlm_extension_base *ext = other.m_extensions[i]->clone();
255  if(ext) //extension may not be clonable.
256  {
257  if(has_mm())
258  { //mm can take care of removing cloned extensions
259  set_auto_extension(i, ext);
260  }
261  else
262  { // no mm, user will call free_all_extensions().
263  set_extension(i, ext);
264  }
265  }
266  }
267  else
268  { //We already have such extension. Copy original over it.
269  m_extensions[i]->copy_from(*other.m_extensions[i]);
270  }
271  }
272  }
273  }
274 
275  // To update the state of the original generic payload from a deep copy
276  // Assumes that "other" was created from the original by calling deep_copy_from
277  // Argument use_byte_enable_on_read determines whether to use or ignores byte enables
278  // when copying back the data array on a read command
279 
281  bool use_byte_enable_on_read = true)
282  {
283  // Copy back extensions that are present on the original
284  update_extensions_from(other);
285 
286  // Copy back the response status and DMI hint attributes
287  m_response_status = other.get_response_status();
288  m_dmi = other.is_dmi_allowed();
289 
290  // Copy back the data array for a read command only
291  // deep_copy_from allowed null pointers, and so will we
292  // We assume the arrays are the same size
293  // We test for equal pointers in case the original and the copy share the same array
294 
295  if(is_read() && m_data && other.m_data && m_data != other.m_data)
296  {
297  if (m_byte_enable && use_byte_enable_on_read)
298  {
299  if (m_byte_enable_length == 8 && m_length % 8 == 0 )
300  {
301  // Optimized implementation copies 64-bit words by masking
302  for (unsigned int i = 0; i < m_length; i += 8)
303  {
304  typedef sc_dt::uint64* u;
305  *reinterpret_cast<u>(&m_data[i]) &= ~*reinterpret_cast<u>(m_byte_enable);
306  *reinterpret_cast<u>(&m_data[i]) |= *reinterpret_cast<u>(&other.m_data[i]) &
307  *reinterpret_cast<u>(m_byte_enable);
308  }
309  }
310  else if (m_byte_enable_length == 4 && m_length % 4 == 0 )
311  {
312  // Optimized implementation copies 32-bit words by masking
313  for (unsigned int i = 0; i < m_length; i += 4)
314  {
315  typedef unsigned int* u;
316  *reinterpret_cast<u>(&m_data[i]) &= ~*reinterpret_cast<u>(m_byte_enable);
317  *reinterpret_cast<u>(&m_data[i]) |= *reinterpret_cast<u>(&other.m_data[i]) &
318  *reinterpret_cast<u>(m_byte_enable);
319  }
320  }
321  else
322  // Unoptimized implementation
323  for (unsigned int i = 0; i < m_length; i++)
324  if ( m_byte_enable[i % m_byte_enable_length] )
325  m_data[i] = other.m_data[i];
326  }
327  else
328  memcpy(m_data, other.m_data, m_length);
329  }
330  }
331 
333  {
334  // deep copy extensions that are already present
335  for(unsigned int i=0; i<other.m_extensions.size(); i++)
336  {
337  if(other.m_extensions[i])
338  { //original has extension i
339  if(m_extensions[i])
340  { //We have it too. copy.
341  m_extensions[i]->copy_from(*other.m_extensions[i]);
342  }
343  }
344  }
345  }
346 
347  // Free all extensions. Useful when reusing a cloned transaction that doesn't have memory manager.
348  // normal and sticky extensions are freed and extension array cleared.
350  {
351  m_extensions.free_entire_cache();
352  for(unsigned int i=0; i<m_extensions.size(); i++)
353  {
354  if(m_extensions[i])
355  {
356  m_extensions[i]->free();
357  m_extensions[i] = 0;
358  }
359  }
360  }
361  //--------------
362  // Destructor
363  //--------------
365  for(unsigned int i=0; i<m_extensions.size(); i++)
366  if(m_extensions[i]) m_extensions[i]->free();
367  }
368 
369  //----------------
370  // API (including setters & getters)
371  //---------------
372 
373  // Command related method
374  bool is_read() const {return (m_command == TLM_READ_COMMAND);}
375  void set_read() {m_command = TLM_READ_COMMAND;}
376  bool is_write() const {return (m_command == TLM_WRITE_COMMAND);}
377  void set_write() {m_command = TLM_WRITE_COMMAND;}
378  tlm_command get_command() const {return m_command;}
379  void set_command(const tlm_command command) {m_command = command;}
380 
381  // Address related methods
382  sc_dt::uint64 get_address() const {return m_address;}
383  void set_address(const sc_dt::uint64 address) {m_address = address;}
384 
385  // Data related methods
386  unsigned char* get_data_ptr() const {return m_data;}
387  void set_data_ptr(unsigned char* data) {m_data = data;}
388 
389  // Transaction length (in bytes) related methods
390  unsigned int get_data_length() const {return m_length;}
391  void set_data_length(const unsigned int length) {m_length = length;}
392 
393  // Response status related methods
394  bool is_response_ok() const {return (m_response_status > 0);}
395  bool is_response_error() const {return (m_response_status <= 0);}
396  tlm_response_status get_response_status() const {return m_response_status;}
397  void set_response_status(const tlm_response_status response_status)
398  {m_response_status = response_status;}
399  std::string get_response_string() const
400  {
401  switch(m_response_status)
402  {
403  case TLM_OK_RESPONSE: return "TLM_OK_RESPONSE";
404  case TLM_INCOMPLETE_RESPONSE: return "TLM_INCOMPLETE_RESPONSE";
405  case TLM_GENERIC_ERROR_RESPONSE: return "TLM_GENERIC_ERROR_RESPONSE";
406  case TLM_ADDRESS_ERROR_RESPONSE: return "TLM_ADDRESS_ERROR_RESPONSE";
407  case TLM_COMMAND_ERROR_RESPONSE: return "TLM_COMMAND_ERROR_RESPONSE";
408  case TLM_BURST_ERROR_RESPONSE: return "TLM_BURST_ERROR_RESPONSE";
409  case TLM_BYTE_ENABLE_ERROR_RESPONSE: return "TLM_BYTE_ENABLE_ERROR_RESPONSE";
410  }
411  return "TLM_UNKNOWN_RESPONSE";
412  }
413 
414  // Streaming related methods
415  unsigned int get_streaming_width() const {return m_streaming_width;}
416  void set_streaming_width(const unsigned int streaming_width) {m_streaming_width = streaming_width; }
417 
418  // Byte enable related methods
419  unsigned char* get_byte_enable_ptr() const {return m_byte_enable;}
420  void set_byte_enable_ptr(unsigned char* byte_enable){m_byte_enable = byte_enable;}
421  unsigned int get_byte_enable_length() const {return m_byte_enable_length;}
422  void set_byte_enable_length(const unsigned int byte_enable_length){m_byte_enable_length = byte_enable_length;}
423 
424  // This is the "DMI-hint" a slave can set this to true if it
425  // wants to indicate that a DMI request would be supported:
426  void set_dmi_allowed(bool dmi_allowed) { m_dmi = dmi_allowed; }
427  bool is_dmi_allowed() const { return m_dmi; }
428 
429  // Use full set of attributes in DMI/debug?
430  tlm_gp_option get_gp_option() const { return m_gp_option; }
431  void set_gp_option( const tlm_gp_option gp_opt ) { m_gp_option = gp_opt; }
432 
433 private:
434 
435  /* --------------------------------------------------------------------- */
436  /* Generic Payload attributes: */
437  /* --------------------------------------------------------------------- */
438  /* - m_command : Type of transaction. Three values supported: */
439  /* - TLM_WRITE_COMMAND */
440  /* - TLM_READ_COMMAND */
441  /* - TLM_IGNORE_COMMAND */
442  /* - m_address : Transaction base address (byte-addressing). */
443  /* - m_data : When m_command = TLM_WRITE_COMMAND contains a */
444  /* pointer to the data to be written in the target.*/
445  /* When m_command = TLM_READ_COMMAND contains a */
446  /* pointer where to copy the data read from the */
447  /* target. */
448  /* - m_length : Total number of bytes of the transaction. */
449  /* - m_response_status : This attribute indicates whether an error has */
450  /* occurred during the transaction. */
451  /* Values supported are: */
452  /* - TLM_OK_RESP */
453  /* - TLM_INCOMPLETE_RESP */
454  /* - TLM_GENERIC_ERROR_RESP */
455  /* - TLM_ADDRESS_ERROR_RESP */
456  /* - TLM_COMMAND_ERROR_RESP */
457  /* - TLM_BURST_ERROR_RESP */
458  /* - TLM_BYTE_ENABLE_ERROR_RESP */
459  /* */
460  /* - m_byte_enable : It can be used to create burst transfers where */
461  /* the address increment between each beat is greater */
462  /* than the word length of each beat, or to place */
463  /* words in selected byte lanes of a bus. */
464  /* - m_byte_enable_length : For a read or a write command, the target */
465  /* interpret the byte enable length attribute as the */
466  /* number of elements in the bytes enable array. */
467  /* - m_streaming_width : */
468  /* --------------------------------------------------------------------- */
469 
470  sc_dt::uint64 m_address;
471  tlm_command m_command;
472  unsigned char* m_data;
473  unsigned int m_length;
474  tlm_response_status m_response_status;
475  bool m_dmi;
476  unsigned char* m_byte_enable;
477  unsigned int m_byte_enable_length;
478  unsigned int m_streaming_width;
479  tlm_gp_option m_gp_option;
480 
481 public:
482 
483  /* --------------------------------------------------------------------- */
484  /* Dynamic extension mechanism: */
485  /* --------------------------------------------------------------------- */
486  /* The extension mechanism is intended to enable initiator modules to */
487  /* optionally and transparently add data fields to the */
488  /* tlm_generic_payload. Target modules are free to check for extensions */
489  /* and may or may not react to the data in the extension fields. The */
490  /* definition of the extensions' semantics is solely in the */
491  /* responsibility of the user. */
492  /* */
493  /* The following rules apply: */
494  /* */
495  /* - Every extension class must be derived from tlm_extension, e.g.: */
496  /* class my_extension : public tlm_extension<my_extension> { ... } */
497  /* */
498  /* - A tlm_generic_payload object should be constructed after C++ */
499  /* static initialization time. This way it is guaranteed that the */
500  /* extension array is of sufficient size to hold all possible */
501  /* extensions. Alternatively, the initiator module can enforce a valid */
502  /* extension array size by calling the resize_extensions() method */
503  /* once before the first transaction with the payload object is */
504  /* initiated. */
505  /* */
506  /* - Initiators should use the the set_extension(e) or clear_extension(e)*/
507  /* methods for manipulating the extension array. The type of the */
508  /* argument must be a pointer to the specific registered extension */
509  /* type (my_extension in the above example) and is used to */
510  /* automatically locate the appropriate index in the array. */
511  /* */
512  /* - Targets can check for a specific extension by calling */
513  /* get_extension(e). e will point to zero if the extension is not */
514  /* present. */
515  /* */
516  /* --------------------------------------------------------------------- */
517 
518  // Stick the pointer to an extension into the vector, return the
519  // previous value:
520  template <typename T> T* set_extension(T* ext)
521  {
522  return static_cast<T*>(set_extension(T::ID, ext));
523  }
524 
525  // non-templatized version with manual index:
526  tlm_extension_base* set_extension(unsigned int index,
527  tlm_extension_base* ext)
528  {
529  tlm_extension_base* tmp = m_extensions[index];
530  m_extensions[index] = ext;
531  return tmp;
532  }
533 
534  // Stick the pointer to an extension into the vector, return the
535  // previous value and schedule its release
536  template <typename T> T* set_auto_extension(T* ext)
537  {
538  return static_cast<T*>(set_auto_extension(T::ID, ext));
539  }
540 
541  // non-templatized version with manual index:
543  tlm_extension_base* ext)
544  {
545  tlm_extension_base* tmp = m_extensions[index];
546  m_extensions[index] = ext;
547  if (!tmp) m_extensions.insert_in_cache(&m_extensions[index]);
548  assert(m_mm != 0);
549  return tmp;
550  }
551 
552  // Check for an extension, ext will point to 0 if not present
553  template <typename T> void get_extension(T*& ext) const
554  {
555  ext = get_extension<T>();
556  }
557  template <typename T> T* get_extension() const
558  {
559  return static_cast<T*>(get_extension(T::ID));
560  }
561  // Non-templatized version with manual index:
562  tlm_extension_base* get_extension(unsigned int index) const
563  {
564  return m_extensions[index];
565  }
566 
567  //this call just removes the extension from the txn but does not
568  // call free() or tells the MM to do so
569  // it return false if there was active MM so you are now in an unsafe situation
570  // recommended use: when 100% sure there is no MM
571  template <typename T> void clear_extension(const T* ext)
572  {
573  clear_extension<T>();
574  }
575 
576  //this call just removes the extension from the txn but does not
577  // call free() or tells the MM to do so
578  // it return false if there was active MM so you are now in an unsafe situation
579  // recommended use: when 100% sure there is no MM
580  template <typename T> void clear_extension()
581  {
582  clear_extension(T::ID);
583  }
584 
585  //this call removes the extension from the txn and does
586  // call free() or tells the MM to do so when the txn is finally done
587  // recommended use: when not sure there is no MM
588  template <typename T> void release_extension(T* ext)
589  {
590  release_extension<T>();
591  }
592 
593  //this call removes the extension from the txn and does
594  // call free() or tells the MM to do so when the txn is finally done
595  // recommended use: when not sure there is no MM
596  template <typename T> void release_extension()
597  {
598  release_extension(T::ID);
599  }
600 
601 private:
602  // Non-templatized version with manual index
603  void clear_extension(unsigned int index)
604  {
605  m_extensions[index] = static_cast<tlm_extension_base*>(0);
606  }
607  // Non-templatized version with manual index
608  void release_extension(unsigned int index)
609  {
610  if (m_mm)
611  {
612  m_extensions.insert_in_cache(&m_extensions[index]);
613  }
614  else
615  {
616  m_extensions[index]->free();
617  m_extensions[index] = static_cast<tlm_extension_base*>(0);
618  }
619  }
620 
621 public:
622  // Make sure the extension array is large enough. Can be called once by
623  // an initiator module (before issuing the first transaction) to make
624  // sure that the extension array is of correct size. This is only needed
625  // if the initiator cannot guarantee that the generic payload object is
626  // allocated after C++ static construction time.
628  {
629  m_extensions.expand(max_num_extensions());
630  }
631 
632 private:
633  tlm_array<tlm_extension_base*> m_extensions;
634  tlm_mm_interface* m_mm;
635  unsigned int m_ref_count;
636 };
637 
638 } // namespace tlm
639 
640 #endif /* __TLM_GP_H__ */
tlm_command
Definition: tlm_gp.h:92
tlm_extension_base * set_extension(unsigned int index, tlm_extension_base *ext)
Definition: tlm_gp.h:526
unsigned int get_data_length() const
Definition: tlm_gp.h:390
void set_byte_enable_length(const unsigned int byte_enable_length)
Definition: tlm_gp.h:422
virtual ~tlm_generic_payload()
Definition: tlm_gp.h:364
void free_all_extensions()
Definition: tlm_gp.h:349
tlm_generic_payload(tlm_mm_interface *mm)
Definition: tlm_gp.h:145
static const unsigned int ID
Definition: tlm_gp.h:82
uint64_t uint64
void set_byte_enable_ptr(unsigned char *byte_enable)
Definition: tlm_gp.h:420
void set_dmi_allowed(bool dmi_allowed)
Definition: tlm_gp.h:426
void update_extensions_from(const tlm_generic_payload &other)
Definition: tlm_gp.h:332
unsigned int get_byte_enable_length() const
Definition: tlm_gp.h:421
void set_streaming_width(const unsigned int streaming_width)
Definition: tlm_gp.h:416
virtual ~tlm_mm_interface()
Definition: tlm_gp.h:39
bool is_read() const
Definition: tlm_gp.h:374
virtual void free(tlm_generic_payload *)=0
void set_response_status(const tlm_response_status response_status)
Definition: tlm_gp.h:397
virtual ~tlm_extension()
Definition: tlm_gp.h:81
void set_gp_option(const tlm_gp_option gp_opt)
Definition: tlm_gp.h:431
void get_extension(T *&ext) const
Definition: tlm_gp.h:553
bool is_response_ok() const
Definition: tlm_gp.h:394
static unsigned int register_extension()
Definition: tlm_gp.h:63
tlm_extension_base * set_auto_extension(unsigned int index, tlm_extension_base *ext)
Definition: tlm_gp.h:542
bool is_write() const
Definition: tlm_gp.h:376
T * set_extension(T *ext)
Definition: tlm_gp.h:520
int get_ref_count() const
Definition: tlm_gp.h:164
void set_command(const tlm_command command)
Definition: tlm_gp.h:379
tlm_response_status get_response_status() const
Definition: tlm_gp.h:396
bool is_response_error() const
Definition: tlm_gp.h:395
virtual tlm_extension_base * clone() const =0
virtual void free()
Definition: tlm_gp.h:59
unsigned int max_num_extensions(bool increment=false)
Definition: tlm_gp.h:46
T * set_auto_extension(T *ext)
Definition: tlm_gp.h:536
virtual ~tlm_extension_base()
Definition: tlm_gp.h:62
bool has_mm() const
Definition: tlm_gp.h:166
unsigned char * get_byte_enable_ptr() const
Definition: tlm_gp.h:419
void set_data_length(const unsigned int length)
Definition: tlm_gp.h:391
tlm_extension_base * get_extension(unsigned int index) const
Definition: tlm_gp.h:562
void release_extension(T *ext)
Definition: tlm_gp.h:588
std::string get_response_string() const
Definition: tlm_gp.h:399
virtual void copy_from(tlm_extension_base const &)=0
void set_address(const sc_dt::uint64 address)
Definition: tlm_gp.h:383
unsigned char * get_data_ptr() const
Definition: tlm_gp.h:386
unsigned int get_streaming_width() const
Definition: tlm_gp.h:415
bool is_dmi_allowed() const
Definition: tlm_gp.h:427
tlm_gp_option get_gp_option() const
Definition: tlm_gp.h:430
tlm_gp_option
Definition: tlm_gp.h:108
tlm_command get_command() const
Definition: tlm_gp.h:378
tlm_response_status
Definition: tlm_gp.h:98
void set_mm(tlm_mm_interface *mm)
Definition: tlm_gp.h:165
void deep_copy_from(const tlm_generic_payload &other)
Definition: tlm_gp.h:224
virtual void copy_from(tlm_extension_base const &ext)=0
void update_original_from(const tlm_generic_payload &other, bool use_byte_enable_on_read=true)
Definition: tlm_gp.h:280
void set_data_ptr(unsigned char *data)
Definition: tlm_gp.h:387
void clear_extension(const T *ext)
Definition: tlm_gp.h:571
T * get_extension() const
Definition: tlm_gp.h:557
sc_dt::uint64 get_address() const
Definition: tlm_gp.h:382
virtual tlm_extension_base * clone() const =0