Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
AbstractProcessor.h
Go to the documentation of this file.
1 
9 #ifndef ABSTRACTPROCESSOR_H
10 #define ABSTRACTPROCESSOR_H
11 //#include "AbstractCore.h"
12 //#include "scProcessor.h"
13 #include "scFIFO.h"
14 
18 using namespace std;
19 // The modules can be the head of the cluster, a member of a cluster, or neither (stand-alone)
20 // These are the standard offsets of the neighbors in the order of
21 // the hexagonal Cluster Grid: Head, N, NE, SE, S, SW, NW
22 
23 // Here a two-dimensional topology is assumed, and a multi-layer one implied
24 
36 {
37  public:
38  //Channel/Submodule* definitions
39  MetaEvent_fifo* MetaEvents;
40  AbstractProcessor(sc_core::sc_module_name nm, vector<scGridPoint*> Specials, bool StandAlone);
41  SC_HAS_PROCESS(AbstractProcessor); // Will be defined in separate file
42  ~AbstractProcessor(void);
43  void
44  Reset(void);
45  // Directly HW-related functionality
46  void
47  Execute_thread(void);
48  void Initialize_method(void);
49  virtual void
50  Populate(vector<scGridPoint*>& Specials);
52  Core_Get(int i, int j){ return dynamic_cast<AbstractCore*>(scProcessor::ByIndex_Get(i,j));}
54  ClusterHead_Get(int i)
55  { return dynamic_cast<AbstractCore*>(AbstractTopology::ClusterHead_Get(i)); }
56  AbstractCore *GridPoint_Get(const int i, const int j)
57  {return dynamic_cast<AbstractCore *>(mGrid.at(i).at(j));}
58  AbstractCore *GridPoint_Get(scGridPoint *GP) // A kind of self-check: dynamic_cast will return NULL if wrong
59  {return dynamic_cast<AbstractCore *>(GP);}
60 
61  AbstractCore* ByIndex_Get(const int X, const int Y)
62  { return dynamic_cast<AbstractCore*>(AbstractTopology::ByIndex_Get(X, Y));}
63  AbstractCore* ByPosition_Get(const int X, const int Y)
64  { return dynamic_cast<AbstractCore*>(AbstractTopology::ByPosition_Get(X, Y));}
65  AbstractCore* ByClusterAddress_Get(ClusterAddress_t CA)
66  { return dynamic_cast<AbstractCore*>(AbstractTopology::ByClusterAddress_Get(CA));}
67  AbstractCore* ByClusterMember_Get(unsigned short int CN, ClusterNeighbor CM= cm_Head)
68  { return dynamic_cast<AbstractCore*>(AbstractTopology::ByClusterMember_Get(CN,CM));}
69 
70  AbstractCore* ByID_Get(int N)
71  { return dynamic_cast<AbstractCore*>(scProcessor::ByID_Get(N));}
72  string StringOfCore_Get(int N)
73  { return StringOfClusterAddress_Get(ByID_Get(N));}
74  AbstractCore* ByIDMask_Get(SC_CORE_MASK_TYPE Mask)
75  { return dynamic_cast<AbstractCore*>(scProcessor::ByIDMask_Get(Mask)); }
76 
77 /* AbstractCore*
78  ByClusterMember_Get(scGridPoint* GP, ClusterNeighbor N)
79  { return dynamic_cast<AbstractCore*>(scProcessor::ByClusterMember_Get(GP,N));}
80 */ AbstractCore*
81  ChildAllocateFor(scGridPoint* Parent, CorePreference_t CPT = cpt_AnyCore) override
82  { return dynamic_cast<AbstractCore*>(scProcessor::ChildAllocateFor(Parent,CPT));}
84  ChildPreAllocateFor(AbstractCore* Parent, CorePreference_t CPT = cpt_AnyCore)
85  { return dynamic_cast<AbstractCore*>(scProcessor::ChildPreAllocateFor(Parent,CPT));}
87  ChildFindCFor(AbstractCore* Parent, CorePreference_t CPT = cpt_AnyCore)
88  { return dynamic_cast<AbstractCore*>(scProcessor::ChildFindFor(Parent,CPT));}
89  AbstractProcessor* Processor_Get(void)
90  { return dynamic_cast<AbstractProcessor*>(scProcessor::Processor_Get());}
91  void
92  Reboot(void);
93  void
94  START_thread(void);
95  void
96  NEXT_thread(void);
97  /* void
98  ChildrenMaskBit_Set(AbstractCore* C);
99  void
100  ChildrenMaskBit_Clear(AbstractCore* C);*/
102  virtual scHThread*
103 // doReboot(SC_ADDRESS_TYPE A) = 0;
104  doReboot(SC_ADDRESS_TYPE A, HThreadPreference_t hpt_Any){ return (scHThread*)NULL;}
105  AbstractCore* // Allocate a new core for Parent and create a new QT
106  doQCREATE(AbstractCore* TheParent, AbstractCore* TheChild,
107  SC_CORE_MASK_TYPE CloneMask,
108  SC_CORE_MASK_TYPE BackLinkMask,
109  CorePreference_t CPT= cpt_Member);
110  string
111  FileName_Get(void){return lastFile;}
112 protected:
113 // SC_GRIDPOINT_MASK_TYPE
114 // msChildrenMask; ///< Account for allocated cores by bit masks
116  msMetaEvent;
117  uint32_t
119  uint32_t
121  string
123 
124  vector <AddressToLineRecord*> // Map the memory address to source line
125  AddressToLineMap;
126  SC_ADDRESS_TYPE
127  mInstructionAddress; // Used in loading object files
128 };// of class AbstractProcessor
129 
130 #endif // ABSTRACTPROCESSOR_H
AbstractProcessor::doReboot
virtual scHThread * doReboot(SC_ADDRESS_TYPE A, HThreadPreference_t hpt_Any)
!
Definition: AbstractProcessor.h:104
AbstractTopology::ByPosition_Get
GridPoint * ByPosition_Get(int X, int Y)
Get a gridpoint by its topological position (NOT index!)
scProcessor::ChildPreAllocateFor
scGridPoint * ChildPreAllocateFor(scGridPoint *Parent, CorePreference_t Pref=cpt_AnyCore)
Allocate a core with preference.
MetaEvent_Transfer_Type
Instruction-execution related variables.
Definition: scGridEnumTypes.h:60
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
scHThread
The scHThread class.
Definition: scHThread.h:138
scProcessor
Implements a module-name alias facility (i.e., user-provided names. Given that the basic units is scH...
Definition: scProcessor.h:130
AbstractTopology::ByClusterAddress_Get
GridPoint * ByClusterAddress_Get(ClusterAddress_t C)
Get a GridPoint pointer given by its ClusterAddress_t C, a specialized integer (network-like address)
HThreadPreference_t
HThreadPreference_t
Definition: scHThread.h:28
scProcessor::ChildFindFor
scGridPoint * ChildFindFor(scGridPoint *Parent, CorePreference_t CPT)
find an scGridPoint for this parent
AbstractTopology::ClusterHead_Get
GridPoint * ClusterHead_Get(unsigned int N)
Return pointer to the cluster head of the Nth cluster.
Definition: AbstractTopology.h:186
ClusterNeighbor
ClusterNeighbor
The neighborship in the cluster: the members are referred to with their geographic direction.
Definition: Clustering.h:34
scGridPoint
This class implements the autonomous grid point functionality: it is a communicating GridPoint....
Definition: scGridPoint.h:127
scProcessor::ByIndex_Get
scGridPoint * ByIndex_Get(const int X, const int Y)
Get an scGridPoint by its indices.
Definition: scProcessor.h:163
ClusterAddress_t
A GridPoint can be addressed also by its cluster address of type ClusterAddress_t....
Definition: Clustering.h:58
AbstractTopology::ByClusterMember_Get
GridPoint * ByClusterMember_Get(unsigned short int CN, ClusterNeighbor CM=cm_Head, ClusterNeighbor CP=cm_Head)
AbstractTopology::ByIndex_Get
GridPoint * ByIndex_Get(const int X, const int Y)
Get a gridpoint defined by its indices (!NOT position)
scFIFO.h
Function prototypes for the scEMPA simulator, FIFOs.
AbstractProcessor::lastFile
string lastFile
Remember name of the last object file.
Definition: AbstractProcessor.h:122
AbstractProcessor::mTotalBytes
uint32_t mTotalBytes
No of bytes loaded.
Definition: AbstractProcessor.h:118
AbstractProcessor
The AbstractProcessor class.
Definition: AbstractProcessor.h:35
cm_Head
@ cm_Head
The central gridpoint.
Definition: Clustering.h:35
AbstractCore
The abstract base class (i.e. must not be instantiated) of concrete processors, implementing their ge...
Definition: AbstractCore.h:142
AbstractProcessor::mTotalLines
uint32_t mTotalLines
No of lines read.
Definition: AbstractProcessor.h:120
CorePreference_t
CorePreference_t
Definition: scProcessor.h:62
scProcessor::ChildAllocateFor
virtual scGridPoint * ChildAllocateFor(scGridPoint *Parent, CorePreference_t Pref=cpt_AnyCore)
Allocate a core with preference.
AbstractProcessor::ChildAllocateFor
AbstractCore * ChildAllocateFor(scGridPoint *Parent, CorePreference_t CPT=cpt_AnyCore) override
Allocate a core with preference.
Definition: AbstractProcessor.h:81