Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
scLatchFIFO.h
Go to the documentation of this file.
1 
5  /* @author János Végh (jvegh)
6  * @bug No known bugs.
7  */
8 
9 #ifndef scLatchFIFO_h
10 #define scLatchFIFO_h
11 #include "BasicConfig.h"
12 //#include <systemc>
13 //#include "Utils.h"
14 //#include "scGridPoint.h"
15 
16 using namespace sc_core;
17 //Submodule forward class declarations
18 
24 {
25 // ClusterAddress_t SenderCore;
26  SC_ADDRESS_TYPE QTOffset;
27  SC_WORD_TYPE RegisterContent;
28  int8_t RegisterSelect;
29 // bool ProxyMode;
30 // InterCoreTransferMode_t TransferMode;
31 };
32 
33 
34 class RegisterLatch_write_if : virtual public sc_interface
35 {
36  public:
37  virtual void write(RegisterLatch_Type) = 0;
38  virtual void reset() = 0;
39 };
40 
41 class RegisterLatch_read_if : virtual public sc_interface
42 {
43  public:
44  virtual bool read(RegisterLatch_Type &T, SC_ADDRESS_TYPE Offset) = 0;
45  virtual int num_available() = 0;
46 };
47 
48 
49 // This is the latch FIFO for the register values backlinked by the children
50 class RegisterLatch_fifo: public sc_core::sc_channel, RegisterLatch_write_if, RegisterLatch_read_if
51 {
52  public:
53  RegisterLatch_fifo(const sc_module_name& name) ;
54 
55  void write(RegisterLatch_Type T);
56  void dowrite(RegisterLatch_Type T);
57  bool read(RegisterLatch_Type &T, SC_ADDRESS_TYPE Offset);
58  bool doread(RegisterLatch_Type &T, SC_ADDRESS_TYPE Offset);
59  void reset() { num_elements = first = 0;}
60  int num_available() { return num_elements;}
61 
62  private:
63  enum e { max = 10 };
64  RegisterLatch_Type data[max];
65  int num_elements, first;
66  sc_event write_event, read_event;
67 };
68 
69 #endif // scLatchFIFO
RegisterLatch_Type
Definition: scLatchFIFO.h:23
RegisterLatch_Type::RegisterContent
SC_WORD_TYPE RegisterContent
The content of the register.
Definition: scLatchFIFO.h:27
RegisterLatch_Type::QTOffset
SC_ADDRESS_TYPE QTOffset
The offset the content belongs to.
Definition: scLatchFIFO.h:26
BasicConfig.h
Basic configuration information for the BASIC package.
RegisterLatch_Type::RegisterSelect
int8_t RegisterSelect
The register sequence number.
Definition: scLatchFIFO.h:28