Go to the documentation of this file.
27 #define MAKE_TIME_BENCHMARKING // uncomment to measure the time with benchmarking macros
28 #include "MacroTimeBenchmarking.h"
29 #define SC_MAKE_TIME_BENCHMARKING // uncomment to measure the time with benchmarking macros
30 #include "MacroScTimeBenchmarking.h"
41 extern string sc_time_to_nsec_Get(
const int d,
const int w, sc_time T);
128 ,
public scClusterBusSlave_if
177 SC_GRIDPOINT_MASK_TYPE
186 assert(H<MAX_HTHREADS);
189 AllocateAHThread(
void);
208 Parent_Get(
void) {
return msParent;}
216 return msIGPCB[index];
224 direct_read(
int *data,
unsigned int address);
226 direct_write(
int *data,
unsigned int address);
234 read(
int *data,
unsigned int address){
return CLUSTER_BUS_OK;}
236 write(
int *data,
unsigned int address){
return CLUSTER_BUS_OK;}
244 AllocatedBit_Set(
bool V=
true);
246 AllocatedBit_Get(
void) {
return msStatus.
Allocated;}
248 PreAllocatedBit_Set(
bool V=
true);
250 PreAllocatedBit_Get(
void){
return msStatus.
PreAllocated;}
252 DeniedBit_Set(
bool P=
true);
255 {
return msStatus.
Denied;}
257 AvailableBit_Get(
void)
260 MetaBit_Set(
bool P=
true);
262 MetaBit_Get(
void){
return msStatus.
Meta;}
264 WaitBit_Set(
bool P=
true);
266 WaitBit_Get(
void){
return msStatus.
Wait;}
269 {
return AvailableBit_Get();}
271 IsAllocated(
void) {
return AllocatedBit_Get();}
273 IsPreAllocated(
void) {
return PreAllocatedBit_Get();}
275 IsDenied(
void) {
return DeniedBit_Get();}
277 IsWaiting(
void) {
return msStatus.
Wait;}
280 MakeFetch, FetchReady
297 oss <<
"0x" << hex << std::setfill(
'0') << std::setw((FMEMORY_ADDRESS_WIDTH+3)/4) << msMemoryAddress << dec;
305 StringOfStatus_Get(
void)
308 oss <<
"0x" << hex << std::setfill(
'0') << std::setw(4) << mStatus << dec;
324 doWriteSignals(
void);
325 SC_GRIDPOINT_MASK_TYPE
326 PreAllocatedMask_Get(
void);
328 PreAllocatedMask_Set(SC_GRIDPOINT_MASK_TYPE Mask);
336 SC_GRIDPOINT_MASK_TYPE
339 ChildrenMask_Set(SC_GRIDPOINT_MASK_TYPE M) {
msMask.
Children = M;}
350 IsMorphingInstructionFetched(
scHThread* H){
return true;}
352 uint32_t readDataMem(uint32_t addr,
int size);
354 HandleSuspending(
void);
361 HThread_Get(SC_HTHREAD_ID_TYPE H)
362 { assert((H>=0) && (H<MAX_HTHREADS));
369 return mHThreadExec;}
372 return mHThreadFetch;}
375 return mHThreadSend;}
378 return mHThreadReceive;}
380 HThreadExec_Set(
scHThread* H){mHThreadExec = H; }
382 HThreadFetch_Set(
scHThread* H){mHThreadFetch = H; }
384 HThreadSend_Set(
scHThread* H){mHThreadSend = H; }
386 HThreadReceive_Set(
scHThread* H){mHThreadReceive = H; }
395 PrologString_Get(
void);
397 MemoryAddress_Set(SC_ADDRESS_TYPE MA) { msMemoryAddress = MA;}
399 QTOffset_Get(SC_HTHREAD_ID_TYPE H)
400 { assert((H>=0)&(H<MAX_HTHREADS));
return mHThreads[H]->QTOffset_Get();}
402 StringOfName_Get(SC_HTHREAD_ID_TYPE H)
413 CreateRegisterMessageTo(
scGridPoint* To, SC_GRIDPOINT_MASK_TYPE Mask);
428 CreateSpecialMessageTo(
scGridPoint* To, int16_t Key, int8_t RegNo, int32_t R);
430 Status_Set(uint16_t S) {mStatus = S;}
432 Status_Get(
void) {
return mStatus;}
434 ConnectToClusterBus(scClusterBus* ClusterBus);
436 CreateMemoryReadMessage(
unsigned int Address,
int Length);
438 CreateMemoryWriteMessage(
unsigned int Address,
int Length);
440 FlagWordLength_Get(
void) {
return 0;}
442 ConditionCode_Get(
void) {
return 0;}
444 ConditionCode_Set(int32_t C){}
445 SC_GRIDPOINT_MASK_TYPE
446 doWaitMask_Get(SC_ADDRESS_TYPE Offset);
448 doFindHostToProcess(SC_ADDRESS_TYPE Offs, SC_GRIDPOINT_MASK_TYPE Mask);
450 doCanTerminate( SC_GRIDPOINT_MASK_TYPE Address);
512 void NotifyThreadOnMemoryArrival()
513 { mHThreadFetch->
EVENT_HTHREAD.MemoryContentArrived.notify();}
528 int OperatingBits_Get(
void){
return mGridPointOperatingStateBit.to_ulong();}
529 bool IsObserved(
void)
542 InstanceCount_Get(
void) {
return mInstanceCount % 50;}
555 AvailableBit_Set(
void);
557 SleepingBit_Set(
void);
564 *mHThreadFetch, *mHThreadExec, *mHThreadSend, *mHThreadReceive;
600 mGridPointOperatingStateBit;
602 chrono::steady_clock::time_point
604 std::chrono::duration< int64_t, nano>
605 m_part_time, m_sum_time;
609 #endif // scGridPoint_h
bool IsMemory1(ClusterAddress_t CA)
If it is memory 1 (cache)
bool IsMemory0(ClusterAddress_t CA)
If it is memory 0 (register)
string Name_Get(void)
< Return the SC name of the module
Definition: scGridPoint.h:181
void FETCH_thread()
FETCH_thread makes the actual "instruction fetch".
bool IsMemory3(ClusterAddress_t CA)
If it is memory 3 (convential, "far")
core_cooperationmode_t CooperationMode_Get(void)
Send a notification to the thread that the requested memory content is available.
Definition: scGridPoint.h:391
scIGPCB * IGPCB_Get(ClusterNeighbor index)
< Get address of the communication block
Definition: scGridPoint.h:213
@ cm_Broadcast
All cluster members (broadcast)
Definition: Clustering.h:42
scHThread * HThreadReceive_Get(void)
< Return the fetching thread
Definition: scGridPoint.h:377
void ObservedHThreadBit_Set(SC_HTHREAD_MASK_TYPE M, bool B)
Set if HThread M is observed.
bool HThreadAllocatedBit_Get(SC_HTHREAD_ID_TYPE H)
< Return if HThread is active
Definition: scGridPoint.h:520
This class handles the topological information for the modules. Provides a lot of math-only utility f...
Definition: GridPoint.h:33
SC_GRIDPOINT_MASK_TYPE IDMask_Get(void)
< Return the mask form of the ID
Definition: scGridPoint.h:178
The signals issued by the scGridPoint.
Definition: scGridEnumTypes.h:92
virtual void CreateThreads(void)
< Create threads for HThreads sharing this processing unit
SC_GRIDPOINT_MASK_TYPE ID
One-hot bitmask corresponding to mID of the scGridPoint.
Definition: scGridEnumTypes.h:159
Functionality of scIGPMessage-related stuff.
scGridPoint(sc_core::sc_module_name nm, scProcessor *Processor, const GridPoint GP, bool StandAlone)
scGridPoint Creates an GP for Processor scGridPoint at position, with name nm
The scIGPMessage class.
Definition: scIGPMessage.h:97
SC_HTHREAD_MASK_TYPE mObservedHThreads
The observed HThreads of this scGridPoint.
Definition: scGridPoint.h:540
scHThread * HThreadExec_Get(void)
< Return the executing thread
Definition: scGridPoint.h:368
The scHThread class.
Definition: scHThread.h:138
The set of scGridPoint objects can be defined by by a mask word, the bits corresponding to single mod...
Definition: scGridEnumTypes.h:156
scIGPMessage * CreateMessageTo(scGridPoint *To, IGPMessageType Type, int Length)
Create a message and put the addresses into the message.
Implements a module-name alias facility (i.e., user-provided names. Given that the basic units is scH...
Definition: scProcessor.h:130
core_cooperationmode_t
Codes of mass processing operating modes.
Definition: scGridEnumTypes.h:174
bool PreAllocated
< Whether this scGridPoint is preallocated by another one
Definition: scGridEnumTypes.h:123
GridPointOperatingBit_t
the names of the bits in the bitset for operating them
Definition: scGridEnumTypes.h:23
scHThread * mHThreads[MAX_HTHREADS]
Stores the address of HThreads.
Definition: scGridPoint.h:594
bool IsMemory(ClusterAddress_t CA)
If it is any kind of memory.
string StringOfMemoryAddress_Get(void)
! Removed temporarily, until NEXT in AbstractCore fully implemented
Definition: scGridPoint.h:294
bool Allocated
< Whether this GridPoint is allocated by another one
Definition: scGridEnumTypes.h:120
ClusterNeighbor
The neighborship in the cluster: the members are referred to with their geographic direction.
Definition: Clustering.h:34
virtual bool doExecInstruction(scHThread *H)
Send a message.
This class implements the autonomous grid point functionality: it is a communicating GridPoint....
Definition: scGridPoint.h:127
The values are stored here, and set through writing into GridPointStatusBitSignal_t.
Definition: scGridEnumTypes.h:113
scIGPMessage * CreateQtCreateMessageTo(scGridPoint *To, SC_ADDRESS_TYPE PC, SC_GRIDPOINT_MASK_TYPE Mask, SC_GRIDPOINT_MASK_TYPE BackMask)
scGridPoint::CreateQtCreateMessageTo It can be needed to pass a QT message for Q_CREATE and Q_KILL
A GridPoint can be addressed also by its cluster address of type ClusterAddress_t....
Definition: Clustering.h:58
bool IsMemory2(ClusterAddress_t CA)
If it is memory 2 (I/O buffer)
string StringOfClusterAddress_Get(void)
void EXEC_thread()
EXEC_thread makes the actual "instruction exec".
sc_time msWaitBegin
The beginning of the waiting period.
Definition: scGridPoint.h:580
SC_GRIDPOINT_MASK_TYPE Children
(immediate) Children of this scGridPoint
Definition: scGridEnumTypes.h:160
bool Denied
< Whether this scGridPoint is denied, from any reason
Definition: scGridEnumTypes.h:118
std::bitset< MAX_HTHREADS > AllocatedHThreads
Stores the mask of registers to backlink.
Definition: scGridEnumTypes.h:169
void PreAllocatedMaskBit_Set(scGridPoint *C, bool V=true)
Get the mask of allocating cores.
GridPointMask_t msMask
This aggregate comprises all masks belonging to the GridPoint.
Definition: scGridPoint.h:572
string StringOfName_Get(void)
Return alias name of default name.
Function prototypes for the scEMPA simulator, simulator main file.
SC_GRIDPOINT_ID_TYPE ID_Get()
< Return the unique ID of the scGridPoint
Definition: scGridPoint.h:176
virtual void doSetQTAddresses(scGridPoint *Parent)
doSetQTAddresses
Definition: scGridPoint.h:466
void HThreadAllocatedBit_Set(SC_HTHREAD_ID_TYPE H, bool B)
< Set thread H either active or inactive
Definition: scGridPoint.h:517
scGridPoint * msParent
Parent gridpoint.
Definition: scGridPoint.h:566
GridPointSignal_t msSignal
This aggregate comprises all signals shown to the outer world.
Definition: scGridPoint.h:570
void SIGNAL_method(void)
ClusterHead_Get.
struct scHThread::@3 EVENT_HTHREAD
These events are handled at thread level.
void AddDefaultAliasNames(void)
virtual bool doFetchInstruction(scHThread *H)
doFetchInstruction The actual fetching is done in the subclassed routine Here it imitates the action ...
core_cooperationmode_t msCooperationMode
Definition: scGridPoint.h:590
Handles input from an axon of a remote neuron, firing to this synapsis. Handles the input broken-line...
Definition: AbstractNeurerConnection.h:37
scGridPoint * PreAllocateFor(scGridPoint *Parent)
Allocate this core for running a QT.
void SEND_thread()
SEND_thread Send the actual message.
SC_GRIDPOINT_ID_TYPE msID
ID if the scGridPoint.
Definition: scGridPoint.h:562
bool Wait
< The GridPoint is blocked (surely Allocated, maybe Meta)
Definition: scGridEnumTypes.h:126
Basic messaging forms between scGridPoints.
The basic message types of scIGPMessage messages.
scHThread * HThreadSend_Get(void)
< Return the fetching thread
Definition: scGridPoint.h:374
bool Available
< !(Denied | Allocated | PreAllocated)
Definition: scGridEnumTypes.h:128
void AddHThread(unsigned int H, scHThread *P)
< Add a HW thread to the scGridPoint
Definition: scGridPoint.h:184
This class communication interface for scIGPMessage communication for the autonous communication func...
Definition: scIGPMessage_if.h:109
Port declarations: these signals go out to the scProcessor.
Definition: scGridEnumTypes.h:74
scHThread * HThreadFetch_Get(void)
< Return the fetching thread
Definition: scGridPoint.h:371
bool Meta
< Executing a metainstruction (surely Allocated)
Definition: scGridEnumTypes.h:124