Go to the documentation of this file.
23 using namespace sc_core;
using namespace std;
using namespace sc_dt;
141 friend class scAbstractCore;
142 friend class Y86Core;
181 ,MemoryContentArrived
191 { mTimedOut =
false; EVENT_HTHREAD.TIMEOUT.notify(T);}
193 AllocatedBit_Set(
bool B);
195 AllocatedBit_Get(
bool B);
198 PreAllocatedBit_Set(
bool V=
true);
203 ID_Get(
void){
return mID;}
205 ID_Mask_Get(
void) {
return 1 << mID;}
207 StringOfID_Get(
void);
209 ClusterAddress_Get(
void);
212 PrologString_Get(
void);
219 QTOffset_Get(
void){
return mQT.Offset;}
221 QTOffset_Set(SC_ADDRESS_TYPE O){mQT.Offset = O;}
223 QTLength_Get(
void){
return mQT.Length;}
225 QTLength_Set(
size_t L){mQT.Length = L;}
233 StringOfDefaultName_Get(
void);
235 StringOfClusterName_Get(
void);
237 StringOfAliasName_Get(
void){
return mAliasName;}
239 StringOfAliasName_Set(
string A);
242 Owner_Get(
void){
return mGridPoint;}
245 Parent_Get(
void){
return mParent;}
258 AllocatedBit_Set(SC_HTHREAD_ID_TYPE H,
bool V=
true);
260 AllocatedBit_Get(
void)
268 {assert((R>=0) && (R<32));
return REGS[R];}
270 Register_Set(
int R, SC_WORD_TYPE C)
271 {assert((R>=0) && (R<32)); REGS[R] = C;}
275 { assert(((exec.PC>=0) && (exec.PC<FMAX_MEMORY_SIZE)) || (exec.PC==(
unsigned)-1));
278 PC_Set(SC_ADDRESS_TYPE P)
279 { assert(((P>=0) && (P<FMAX_MEMORY_SIZE)) || (P==(
unsigned)-1));
282 fetchNewPC_Set(SC_ADDRESS_TYPE PC)
283 { assert((PC>=0) && (PC<FMAX_MEMORY_SIZE));
289 fetchFunctionCode_Get(
void)
290 {
return fetch.Stage.FunctCode;}
292 fetchPC_Set(SC_ADDRESS_TYPE PC){ assert((PC>=0) && (PC<FMAX_MEMORY_SIZE));
295 fetchImmediate_Get(
void)
296 {
return fetch.Stage.immediate; }
301 PC_Affected_Get(
void)
307 oss <<
"0x" << hex << std::setfill(
'0') << std::setw((FMEMORY_ADDRESS_WIDTH+3)/4) << PC_Get() << dec;
315 StringOfClusterAddress_Get(
void);
322 MemoryExpected_Set(
bool B,
bool D=
true)
325 InstPositionInBuffer(SC_ADDRESS_TYPE A=CORE_DEFAULT_ADDRESS);
327 DataPositionInBuffer(SC_ADDRESS_TYPE A);
336 FinishPrefetching(
void);
338 PrepareNextInstruction();
340 CatchedAllocationError(
scHThread* Parent){
return false;}
346 ObservedBit_Set(
bool B);
352 ChildCount_Get(
void){
return mChildren.size();}
356 Y86doFetchInstruction();
358 Y86doExecuteInstruction(
void);
360 InstanceCount_Get(){
return mInstanceCount % 50;;}
365 HandleMorphingInstruction();
367 HandleConventionalInstruction();
373 StringOfName_Get(
void);
377 TIMEOUT_method(
void);
385 mDataMemoryBuffer[MAX_IGPCBUFFER_SIZE],
386 mInstrMemoryBuffer[MAX_IGPCBUFFER_SIZE];
388 mDataMemoryAddressBegin, mDataMemoryAddressEnd,
439 MemoryContentArrived_method(
void);
441 doGetMemoryContent(
void){}
447 AllocationBegin_Set(sc_core::sc_time T)
448 { msAllocationBegin = T;}
451 mThreadOperatingBits;
461 mMemoryRequestAddress;
462 const SC_HTHREAD_ID_TYPE
478 #endif // scHThread_h
string ID
The string ID of the QT.
Definition: scHThread.h:40
Instruction-execution related variables.
Definition: scHThread.h:102
bool PreAllocatedBit_Get(void)
< Get 'PreAllocated' status of HThreadl
Definition: scHThread.h:201
uint32_t NewPC
The next PC to fetch.
Definition: scHThread.h:90
CoreFetch_t fetch
All info relating instruction fetch.
Definition: scHThread.h:381
int8_t RSource2
Second source.
Definition: scHThread.h:79
@ tob_MorphFetched
The fetched instruction is a morhphing instruction.
Definition: scHThread.h:60
Topology information for the electronic modules arranged in a grid.
uint32_t PC
The fetch PC.
Definition: scHThread.h:103
@ tob_Regime
The thread is working in "Modern" mode.
Definition: scHThread.h:48
int8_t FunctCode
Function subcode.
Definition: scHThread.h:76
The scHThread class.
Definition: scHThread.h:138
SC_WORD_TYPE * InstBufferPosition
Pointer to the fetched memory content.
Definition: scHThread.h:91
bool IsTimedOut(void) const
< The HThread can be time, true if the actin timed out
Definition: scHThread.h:185
CoreStage_t Stage
Fetch related storage.
Definition: scHThread.h:93
@ tob_DataExpected
The core can wait either for data memory or instruction memory.
Definition: scHThread.h:53
HThreadPreference_t
Definition: scHThread.h:28
SC_ADDRESS_TYPE Offset
Return offset of the code chunk.
Definition: scHThread.h:36
CoreExecute_t exec
All information relating to the execution.
Definition: scHThread.h:383
@ tob_Morphing
Executing a morphing instruction.
Definition: scHThread.h:61
int8_t RDest
Destination register.
Definition: scHThread.h:80
@ tob_ExecPending
The EXEC for this thread was issued, but not yet terminated.
Definition: scHThread.h:59
void PC_Affected_Set(bool B)
Definition: scHThread.h:298
This class implements the autonomous grid point functionality: it is a communicating GridPoint....
Definition: scGridPoint.h:127
sc_time ExecutionTime
The simulated execution time.
Definition: scHThread.h:96
@ tob_Observed
The HThread is observed (by the simulator)
Definition: scHThread.h:63
@ tob_PCAffected
If PC is affected by the instruction.
Definition: scHThread.h:62
A GridPoint can be addressed also by its cluster address of type ClusterAddress_t....
Definition: Clustering.h:58
ThreadOperatingBits_t
the names of the bits in the bitset
Definition: scHThread.h:46
@ tob_Blocked
The HThread is blocked for some reason.
Definition: scHThread.h:51
int8_t RSource1
First source.
Definition: scHThread.h:78
size_t Length
Return length of the code chunk.
Definition: scHThread.h:38
@ tob_MemoryExpected
Set when asked for data transfer from memory.
Definition: scHThread.h:52
This structure stores the quasi-thread related attributes.
Definition: scHThread.h:34
Instruction-fetching related variables.
Definition: scHThread.h:88
sc_time ExecutionTime
The simulated execution time.
Definition: scHThread.h:107
Variables passed between fetch/execute.
Definition: scHThread.h:70
SC_ADDRESS_TYPE mInstrMemoryAddressEnd
The first/last contents in the cache.
Definition: scHThread.h:389
@ tob_FetchPending
A fetch for this thread event was started, but not yet finished.
Definition: scHThread.h:56
bool mTimedOut
Is set when EVENT_GRID.TIMEOUT.notify() times out.
Definition: scHThread.h:443
@ tob_PreAllocated
The thread is allocated for another thread.
Definition: scHThread.h:50
void Timeout_Set(sc_time &T)
< Set timout facility for a thread
Definition: scHThread.h:190
sc_time WaitTimeBegin
When we started to wait for the FETCH.
Definition: scHThread.h:95
int8_t FunctCode7
Function subcode Funct7.
Definition: scHThread.h:77
uint32_t PC
The fetch PC.
Definition: scHThread.h:89
SC_WORD_TYPE * DataBufferPosition
Pointer to the fetched memory content.
Definition: scHThread.h:92
int8_t OpCode
The major operation code.
Definition: scHThread.h:75
@ tob_Allocated
The thread is allocated for another thread.
Definition: scHThread.h:49
CoreStage_t Stage
Fetch related storage.
Definition: scHThread.h:105
@ tob_FetchValid
If this thread has a valid prefetched instruction.
Definition: scHThread.h:57