Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
NeurerCore.h
Go to the documentation of this file.
1 
8 #ifndef NeurerCore_h
9 #define NeurerCore_h
10 
11 //#include "Config.h"
12 //#include "scTypes.h"
13 
14 #include "NeurerProcessor.h"
15 //#include "scGridPoint.h"
16 
17 using namespace sc_core;
18 using namespace sc_dt;
19 
20 typedef SC_GRIDPOINT_ID_TYPE SC_CORE_ID_TYPE;
21 typedef SC_GRIDPOINT_MASK_TYPE SC_CORE_MASK_TYPE;
22 /*
23 #ifdef MEASURE_PERFORMANCE
24  #define PERFORMANCE_COUNTINSTRUCTION CountInstruction();
25  #define PERFORMANCE_COUNTMETAINSTRUCTION CountMetaInstruction();
26  #define PERFORMANCE_ADDINSTRUCTIONTIME(t) mInstructionTime +=t;
27  #define PERFORMANCE_ADDMETAINSTRUCTIONTIME(t) mMetaInstructionTime +=t;
28  #define PERFORMANCE_ADDMEMORYTIME(t) mMemoryTime +=t;
29  #define PERFORMANCE_ADDFETCHTIME(t) mFetchTime +=t;
30  #define PERFORMANCE_ADDWAITTIME(t) mWaitTime +=t;
31 #else
32  #define PERFORMANCE_COUNTINSTRUCTION
33  #define PERFORMANCE_COUNTMETAINSTRUCTION
34  #define PERFORMANCE_ADDINSTRUCTIONTIME(t)
35  #define PERFORMANCE_ADDMETAINSTRUCTIONTIME(t)
36  #define PERFORMANCE_ADDMEMORYTIME(t)
37  #define PERFORMANCE_ADDFETCHTIME(t)
38  #define PERFORMANCE_ADDWAITTIME(t)
39 #endif // MEASURE_PERFORMANCE
40 
41 */
42 
43 /*
44 #define USE_DEBUG_DATA_TYPES
45 
46 #ifdef USE_DEBUG_DATA_TYPES
47 typedef int32_t SC_REGISTER_TYPE;
48 typedef int SC_COOPERATION_MODE_TYPE;
49 typedef int32_t SC_REGISTER_MASK_TYPE;
50 #else
51 typedef sc_dt::sc_uint<CORE_REGISTER_BITS> SC_REGISTER_TYPE;
52 typedef sc_dt::sc_uint<COOPERATION_MODE_WIDTH> SC_COOPERATION_MODE_TYPE;
53 typedef sc_dt::sc_uint<MAX_NUMBER_OF_REGFteregicISTERS> SC_REGISTER_MASK_TYPE;
54 #endif //USE_DEBUG_DATA_TYPES
55 */
56 /*
57 // These includes and structure fields are needed until made processor-independent
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 #include "isaE.h"
63 #ifdef __cplusplus
64 }
65 #endif
66 */
67 
68 #if 0
69 /* Different QT operations */
74 typedef enum {
75  Q_TERM,
76  Q_WAIT, Q_IWAIT,
77  Q_ALLOC,
78  Q_CREATE, Q_CREATER, Q_CREATET, Q_CREATEF,
79  Q_CALL, Q_MUTEX,
80 
81  Q_HALT=0xE,
82  Q_INT, Q_ERR } qt_t;
83 #endif//0
84 
85 // Type for the one-hot bitmasks
86 //typedef int SC_CORE_MASK_TYPE;
87 typedef SC_GRIDPOINT_MASK_TYPE SC_CORE_MASK_TYPE;
88 typedef int SC_REGISTER_TYPE;
89 //#include "scIGPCB.h"
90 //#include <queue>
91 //#include <vector>
92 //#include <iostream>
93 
94 using namespace sc_core; using namespace std;
95 
96 class NeurerProcessor;
127 {
128  friend NeurerProcessor;
129  public:
141  NeurerCore(sc_core::sc_module_name nm
142  ,NeurerProcessor* Proc
143  ,const GridPoint GP
144  ,bool StandAlone
145  );
146 
147 // friend class TestY86Core;
149  ~NeurerCore(void);
150  SC_HAS_PROCESS(NeurerCore); // We have the constructor in the .cpp file
152  Processor_Get(void);
154  void
155  Reset(void);
236 protected:
237  /* void
238  doCreateQT(scIGPMessage* MyMessage);
239  void
240  doSkipQTCode(void){}
241  void
242  NEXT_thread(void);
243  void
244  EXECUTEMETA_thread(void);
245  void
246  FETCH_thread(void);
247 
248  void
249  QHALT_thread(void);
250  void
251  QTERM_thread(void);
252  void
253  QWAIT_thread(void);
254  void
255  QCREATE_thread(void);
256  void
257  QCREATEMETA_thread(void);
258  void
259  QWAITMETA_thread(void);
260  void
261  QALLOC_thread(void);
262  void
263  QCALL_thread(void);
264  void
265  QMUTEX_thread(void);
266  virtual AbstractCore*
267  doFindHostToProcess(SC_ADDRESS_TYPE Offs, SC_GRIDPOINT_MASK_TYPE Mask)
268  { return dynamic_cast<AbstractCore*>(scGridPoint::doFindHostToProcess(Offs, Mask));}
269 
270  void
271  doExecuteMetaInstruction();
272  void
273  HandleMetaInstruction(void);
274  void ///< A helper function for NEXT_thread
275  HandleConventionalInstruction(void);
276  void ///< A helper function for NEXT_thread
277  TerminateExecution(void);
278 
279  void
280  FinishPrefetching(void);
281  */
285 /* bool
286  doQTERM(void);
287  void
288  ReleasePreAllocatedCores(void);
289 
290  void
291  doKillQT(void);
292  uint64_t
293  readInstrMem(SC_WORD_TYPE addr);
294  void
295  writeInstrMem(SC_WORD_TYPE addr, uint32_t C);
296  bool
297  msPC_Affected; ///< If PC will be affected by executing this instruction
298  short int
299  mCSR; ///< The Control and Status codes
300  */
301 /*
302 #ifdef MAKE_PERFORMANCE_DIAGRAM
303  sc_time
304  msAllocationBegin; ///< The beginning of the allocation
305  sc_time
306  msMetaBegin; ///< The beginning of a meta instruction
307 
308  sc_time
309  AllocationBegin_Get(void) { return msAllocationBegin;} // Just to record the beginning of being allocated
310  void
311  AllocationBegin_Set(sc_time T) {msAllocationBegin = T;} // Just to record the beginning of being allocated
312 #endif //MAKE_PERFORMANCE_DIAGRAM
313  MetaEvent_Transfer_Type
314  msMeta; // The metainstruction fetched by the core
315 */
316 // msVectorMode
317 /* void /// Make the actual inspection; overwritten in subclasses
318  doInspect(vector<int32_t>& in, vector<int32_t>& out);*/
319 /*#ifdef MEASURE_PERFORMANCE
320 public:
321  sc_time
322  FetchTime_Get(){ return mFetchTime;}
323  sc_time
324  InstructionTime_Get(){ return mInstructionTime;}
325  sc_time
326  MetaInstructionTime_Get(){ return mMetaInstructionTime;}
327  sc_time
328  WaitTime_Get(){ return mFetchTime;}
329  void
330  AddFetchTime(sc_time T){mFetchTime += T;}
331  void
332  AddInstructionTime(sc_time T){mInstructionTime += T;}
333  void
334  AddMetaInstructionTime(sc_time T){mMetaInstructionTime += T;}
335  void
336  AddWaitTime(sc_time T){mFetchTime += T;}
337  uint32_t /// Return number of conventional instructions
338  InstructionCount_Get(){return mInstructionCount;}
339  uint32_t /// Returm number of metainstructions
340  MetaInstructionCount_Get(){return mMetaInstructionCount;}
341 #endif //MEASURE_PERFORMANCE
342  */
343 /*#ifdef MEASURE_PERFORMANCE
344 
345  uint32_t
346  mInstructionCount,
347  mMetaInstructionCount;
348  sc_time
349  mFetchTime,
350  mInstructionTime,
351  mMemoryTime,
352  mMetaInstructionTime,
353  mWaitTime;
354 #endif //MEASURE_PERFORMANCE
355 */
356 }; // of NeurerCore
357 
358 #endif // NeurerCore_h
359 
NeurerCore
The base class (i.e. must not be instantiated) of neurer cores, implementing their general behavior.
Definition: NeurerCore.h:126
GridPoint
This class handles the topological information for the modules. Provides a lot of math-only utility f...
Definition: GridPoint.h:33
NeurerProcessor.h
Function prototypes for the topology of electronic modules, placed on a die. It assumes 'Nerver' obje...
AbstractCore
The abstract base class (i.e. must not be instantiated) of concrete processors, implementing their ge...
Definition: AbstractCore.h:142
NeurerProcessor
The NeurerProcessor class.
Definition: NeurerProcessor.h:33