Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
scFIFO.h
Go to the documentation of this file.
1 
8 // Header for the scEMPA simulator, Inter-core block
9 
10 #ifndef scFIFO_h
11 #define scFIFO_h
12 //#include "Utils.h"
13 #include "AbstractCore.h"
14 
15 using namespace sc_core;
16 //Submodule forward class declarations
17 
18 // This is a FIFO for the prioritized metaevents
19 
20 class MetaEvent_write_if : virtual public sc_interface
21 {
22  public:
23  virtual void write(MetaEvent_Transfer_Type) = 0;
24  virtual void reset() = 0;
25 };
26 
27 class MetaEvent_read_if : virtual public sc_interface
28 {
29  public:
30  virtual void read(MetaEvent_Transfer_Type &) = 0;
31  virtual int num_available() = 0;
32 };
33 
34 // This is a FIFO for the prioritized metaevents
35 class MetaEvent_fifo: public sc_core::sc_channel, MetaEvent_write_if, MetaEvent_read_if
36 {
37  public:
38  MetaEvent_fifo(const sc_module_name& name) ;
39  virtual
40  ~MetaEvent_fifo(void){}
41  void write(MetaEvent_Transfer_Type T);
42  void read(MetaEvent_Transfer_Type &T);
43  void dowrite(MetaEvent_Transfer_Type T);
44  void doread(MetaEvent_Transfer_Type &T);
45  void reset() { num_elements = first = 0;}
46  int num_available() { return num_elements;}
47  bool NewPriorityHigher(MetaEvent_Transfer_Type New, MetaEvent_Transfer_Type Old);
48  int Length_Get(void){ return max;}
49  sc_event write_event, read_event;
50  private:
51 // enum e { max = MAX_NUMBER_OF_CORES };
52  enum e { max = 10 }; // Only for testing!
53  MetaEvent_Transfer_Type data[max];
54  int num_elements, first;
55 };
56 
57 
58 #endif // scFIFO
MetaEvent_Transfer_Type
Instruction-execution related variables.
Definition: scGridEnumTypes.h:60
AbstractCore.h
Function prototypes for the EMPA simulator, Core.