Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
NeurerProcessor.h
Go to the documentation of this file.
1 
9 #ifndef NEURERPROCESSOR_H
10 #define NEURERPROCESSOR_H
11 #include "AbstractProcessor.h"
12 #include "Neurer.h"
13 
17 using namespace std;
18 // The modules can be the head of the cluster, a member of a cluster, or neither (stand-alone)
19 // These are the standard offsets of the neighbors in the order of
20 // the hexagonal Cluster Grid: Head, N, NE, SE, S, SW, NW
21 
22 // Here a two-dimensional topology is assumed, and a multi-layer one implied
34 {
35  public:
36  NeurerProcessor(sc_core::sc_module_name nm, vector<scGridPoint*> Specials, bool StandAlone);
37  SC_HAS_PROCESS(NeurerProcessor); // Will be defined in separate file
38  ~NeurerProcessor(void);
39  void
40  Reset(void);
41  // AbstractNeurer*
42 // doReboot(SC_ADDRESS_TYPE A){assert(0);};
43  void Initialize_method(void);
44  void
45  CreateNeurons(AbstractCore* C);
46  void
47  CreateConnections(void);
48  void
49  Populate(vector<scGridPoint*>& Specials);
50 /* AbstractNeurer*
51  Neurer_Get(int i, int j, SC_HTHREAD_ID_TYPE H)
52  {assert(H<MAX_HTHREADS);return dynamic_cast<AbstractNeurer *>(AbstractProcessor::GridPoint_Get(i,j)->HThread_Get(H));}
54  ByIndex_Get(const int X, const int Y, SC_HTHREAD_ID_TYPE H)
55  { assert(H<MAX_HTHREADS);
56  return dynamic_cast<AbstractNeurer*>(AbstractProcessor::ByIndex_Get(X, Y)->HThread_Get(H));}
57 /* AbstractNeurer* ByPosition_Get(const int X, const int Y, SC_HTHREAD_ID_TYPE H)
58  { return dynamic_cast<AbstractNeurer*>(AbstractProcessor::ByPosition_Get(X, Y)->HThread_Get(H));}
59  AbstractNeurer* ByClusterAddress_Get(ClusterAddress_t CA, SC_HTHREAD_ID_TYPE H)
60  { return dynamic_cast<AbstractNeurer*>(AbstractProcessor::ByClusterAddress_Get(CA)->HThread_Get(H));}
61  AbstractNeurer* ByClusterMember_Get(unsigned short int CN, ClusterNeighbor CM, SC_HTHREAD_ID_TYPE H)
62  { return dynamic_cast<AbstractNeurer*>(AbstractProcessor::ByClusterMember_Get(CN,CM)->HThread_Get(H));}
63  AbstractNeurer* ByName_Get(string N){ return dynamic_cast<AbstractNeurer*>(AbstractProcessor::ByName_Get(N));}
64 */ void
65  START_thread(void);
66 /* Neurer*
67  ClusterHead_Get(int i)
68  { return dynamic_cast<Neurer*>(AbstractProcessor::ClusterHead_Get(i)); }
69  scGridPoint *GridPoint_Get(const int i, const int j)
70  {return dynamic_cast<scGridPoint *>(mGrid.at(i).at(j));}
71  scGridPoint *GridPoint_Get(scGridPoint *GP) // A kind of self-check: dynamic_cast will return NULL if wrong
72  {return dynamic_cast<scGridPoint *>(GP);}
73 */
74  struct{
75  sc_core::sc_event
76  BASIC
77  ,ALPHA
78  ;
79  }EVENT_NEURERPROCESSOR;
80 
81  AbstractNeurer* ByID_Get(unsigned int N, unsigned int H)
82  { assert(H<MAX_HTHREADS);
83  assert(N<MAX_GRIDPOINTS);
84  return dynamic_cast<AbstractNeurer*>(AbstractProcessor::ByID_Get(N)->HThread_Get(H));
85  }
86  AbstractNeurer* ByIDMask_Get(SC_CORE_MASK_TYPE Mask, unsigned int H)
87  { assert(H<MAX_HTHREADS);
89  AbstractNeurer* T = dynamic_cast<AbstractNeurer*>(A->HThread_Get(H));
90  return T;
91 // return dynamic_cast<AbstractNeurer*>(AbstractProcessor::ByIDMask_Get(Mask));
92  }
93 
94 /* void Populate(void);
95  void ConnectIGPCBs(void);
96  bool
97  RouteMessageTo(ClusterAddress_t To);
98  SC_GRIDPOINT_MASK_TYPE
99  DeniedMask_Get(void) { return msSignalMask.Denied;}
100  void
101  DeniedMaskBit_Set(scGridPoint* GP, bool P=true);
102  SC_GRIDPOINT_MASK_TYPE
103  AllocatedMask_Get(void) { return msSignalMask.Allocated;}
104  void
105  AllocatedMaskBit_Set(scGridPoint* GP, bool P=true);
106  SC_GRIDPOINT_MASK_TYPE
107  PreAllocatedMask_Get(void) { return msSignalMask.PreAllocated;}
108  void
109  PreAllocatedMaskBit_Set(scGridPoint* GP, bool P=true);
110  SC_GRIDPOINT_MASK_TYPE
111  AvailableMask_Get(void)
112  { return ~UnavailableMask_Get();}
113  SC_GRIDPOINT_MASK_TYPE
114  UnavailableMask_Get(void);
115 */
116 protected:
120  void FrequencyBasic_method(void);
124  void FrequencyAlpha_method(void);
125  };// of class NeurerProcessor
126 
127 #endif // NEURERPROCESSOR_H
AbstractProcessor.h
Function prototypes for the topology of electronic modules, placed on a die. It assumes 'AbstractCore...
Neurer.h
Function prototypes for the Neurer simulator.
AbstractProcessor::ByIDMask_Get
AbstractCore * ByIDMask_Get(SC_CORE_MASK_TYPE Mask)
Return a pointer to gridpoint of the core given by its mask.
Definition: AbstractProcessor.h:74
NeurerProcessor::ByIDMask_Get
AbstractNeurer * ByIDMask_Get(SC_CORE_MASK_TYPE Mask, unsigned int H)
Return a pointer to gridpoint of the core given by its mask.
Definition: NeurerProcessor.h:86
AbstractProcessor
The AbstractProcessor class.
Definition: AbstractProcessor.h:35
AbstractCore
The abstract base class (i.e. must not be instantiated) of concrete processors, implementing their ge...
Definition: AbstractCore.h:142
AbstractNeurer
Definition: AbstractNeurer.h:69
NeurerProcessor
The NeurerProcessor class.
Definition: NeurerProcessor.h:33