📄 procstate.h
字号:
int cwp; /* current window pointer */ int cansave; /* # of reg. wins. that can be saved */ int canrestore; /* # of reg. wins. that can be restored */ int otherwin; /* reserved windows */ int cleanwin; /* unused windows */ long long tick_base; /* cycle counter register */ unsigned fp754_trap_mask; /* IEEE FP trap mask */ unsigned fp754_aexc; /* IEEE FP acrued traps */ unsigned fp754_cexc; /* IEEE FP current traps */ unsigned fp_trap_type; /* general FP trap type */ int exit; /* set by exit trap handler */ int interrupt_pending; /* indicates external interrupt */ class freelist *free_fp_list; /* Free register lists for FP */ class freelist *free_int_list; /* Free register lists for integer */ class activelist active_list; /* Active_list */ circq<TagtoInst*> tag_cvt; /* tagcvt queue definition */ unsigned short *fpmapper; /* fp logical-to-physical mapper */ unsigned short *intmapper; /* int logical-to-physical mapper */ MapTable *activemaptable; /* current mappers, to distinguish from shadow mappers */ char *fpregbusy; /* busy table for fp registers */ char *intregbusy; /* busy table for int registers */ int fetch_queue_size; Queue<fetch_queue_entry> *fetch_queue; unsigned fetch_pc; int fetch_done; instance *inst_save; int DELAY; /* Is the processor stalling */ long long stall_the_rest; /* flag indicating processor stall */ int stalledeff; /* efficiency loss due to stall */ eff_loss_stall type_of_stall_rest; /* classification of stall */ int log_int_reg_file[NO_OF_LOG_INT_REGS]; double log_fp_reg_file[NO_OF_LOG_FP_REGS]; int phy_int_reg_file[NO_OF_LOG_INT_REGS + MAX_MAX_ACTIVE_NUMBER]; double phy_fp_reg_file[NO_OF_LOG_FP_REGS + MAX_MAX_ACTIVE_NUMBER]; short *log_int_reg_map; short *log_state_reg_map; circq<tagged_inst> ReadyQueues[numUTYPES]; /* units are ready to issue */ int UnitsFree[numUTYPES]; /* number of units free of each type */ int MaxUnits[numUTYPES]; /* maximum number of FU's per type */ int active_instr[numUTYPES]; /* # of unissued/active instructions */ int max_active_instr[numUTYPES]; /* maximum # of active instructions */ /******** instruction issue, execution, and completion *******/ Heap<UTYPE> FreeingUnits; /* units get freed */ InstHeap Running; /* when instructions complete */ InstHeap DoneHeap; /* instructions that are done */ InstHeap MemDoneHeap; /* memory instructions that are done */ MiniStallQ UnitQ[numUTYPES]; /* instructions stalled at each unit */ MiniStallQ dist_stallq_int[NO_OF_LOG_INT_REGS + MAX_MAX_ACTIVE_NUMBER]; MiniStallQ dist_stallq_fp[NO_OF_LOG_FP_REGS + MAX_MAX_ACTIVE_NUMBER]; instance *in_exception; /* instance causing exception */ long long time_pre_exception; /* time before exception */ /********************* Prediction **************************/ MemQ<class BranchQElement*> branchq; /* Branch Queue class definition */ int unpredbranch; /* unpredicted branch outstanding */ MiniStallQ BranchDepQ; /* stalled branch instructions */ int *BranchPred; /* 1st bit of 2-bit BHT */ int *PrevPred; /* 2nd bit of 2-bit BHT */ unsigned *ReturnAddressStack; /* return address predictor */ int rasptr; /* return address stack pointer */ int rascnt; /* return address stack counter */ int copymappernext; /* copy shadow mapper on next instruction(delay slot) */ /********************* Prefetch ***************************/ int prefs; int max_prefs; instance **prefrdy; /* prefetch slots */ /********************* Allocator ***************************/ Allocator<instance> instances; /* pool of instances */ DynAllocator<instance> meminstances; /* pool of memop instances */ Allocator<BranchQElement> bqes; /* pool of branch queue elems */ Allocator<MapTable> mappers; /* pool of shadow mappers */ Allocator<MiniStallQElt> ministallqs; /* pool of mini stall queues */ Allocator<activelistelement> actives; /* pool of active list elems */ Allocator<TagtoInst> tagcvts; /* pool of tagcvt elements */ /************ Memory system related variables **************/ CACHE *l1i_argptr; CACHE *l1d_argptr; WBUFFER *wb_argptr; CACHE *l2_argptr; TLB *itlb; TLB *dtlb;#ifndef STORE_ORDERING MemQ<instance *> LoadQueue; /* load queue */ MemQ<instance *> StoreQueue; /* store queue */ int StoresToMem; /* keep track of outstanding sts */ MemQ<long long> st_tags; /* list of store tags */ MemQ<long long> rmw_tags; /* list of rmw tags */ MemQ<MembarInfo> membar_tags; /* list of membar tags */ long long SStag, LStag, SLtag, LLtag; /* various memory barrier tags */ long long MEMISSUEtag; /* memory issue/instruction sync. */ long long minload, minstore; /* last load and store instr. tags*/#else MemQ<instance *> MemQueue; /* unified memory queue */#endif int ReadyUnissuedStores; /* ready but unissued stores */ MemQ<long long> ambig_st_tags; /* ambiguous store tags */ int sync; int ktext_segment_low; int ktext_segment_high; int kdata_segment_low; int kdata_segment_high; /************************* Statistics ***************************/ long long start_time; /* start time for stats collection*/ long long start_icount; /* start instruction count */ long long last_graduated; /* last graduated instruction */ long long last_counted; /* last instruction */ long long graduates; /* number of graduates */ time_t sim_start_time; long long exceptions[MAX_EXCEPT]; /* number of except. of each class*/ long long graduated[MAX_EXCEPT]; /* # of graduates/exception class */ long long cycles[MAX_EXCEPT]; /* # of cycles per exception class*/ long long start_cycle[MAX_EXCEPT]; /* entry cycle count of exception */ /* handler */ long long start_graduated[MAX_EXCEPT]; /* entry instruction count */ long long start_halted; /* start of last halt period */ long long total_halted; /* total time processor is halted */ long long mem_refs; /* number of memory references */ long long bpb_good_predicts; /* number of correct predictions */ long long ras_good_predicts; /* number of correct returns */ long long bpb_bad_predicts; /* number of wrong predictions */ long long ras_bad_predicts; /* number of bad returns */ long long ras_overflows; /* number of RAS overflows */ long long ras_underflows; /* number of RAS underflows */ STATREC *BadPredFlushes; /* impact of mispredictions */ STATREC *ExceptFlushed; /* impact of exceptions */ STATREC *SpecStats; /* time at each spec level */ STATREC *FetchQueueStats; /* size of active list */ STATREC *ActiveListStats; /* size of active list */ STATREC *FUUsage[numUTYPES]; /* utilization of functional units*/#ifndef STORE_ORDERING STATREC *VSB; /* avg. virtual store buffer size */ STATREC *LoadQueueSize; /* load queue size */#else STATREC *MemQueueSize; /* memory queue size */#endif STATREC *lat_contrs[lNUM_LAT_TYPES]; /* execution time components */ STATREC *partial_otime; /* partial overlap times */ int stats_phase; /* stats collection phase */ STATREC *in_except; /* time spent waiting to trap */ /* classify read, write, and rmw times based on different metrics */ STATREC *readacc, *writeacc, *rmwacc; STATREC *readiss, *writeiss, *rmwiss; STATREC *readact, *writeact, *rmwact;#if 0 STATREC *demand_read[reqNUM_REQ_STAT_TYPE]; STATREC *demand_write[reqNUM_REQ_STAT_TYPE]; STATREC *demand_rmw[reqNUM_REQ_STAT_TYPE]; STATREC *demand_read_iss[reqNUM_REQ_STAT_TYPE]; STATREC *demand_write_iss[reqNUM_REQ_STAT_TYPE]; STATREC *demand_rmw_iss[reqNUM_REQ_STAT_TYPE]; STATREC *demand_read_act[reqNUM_REQ_STAT_TYPE]; STATREC *demand_write_act[reqNUM_REQ_STAT_TYPE]; STATREC *demand_rmw_act[reqNUM_REQ_STAT_TYPE]; STATREC *pref_sh[reqNUM_REQ_STAT_TYPE]; STATREC *pref_excl[reqNUM_REQ_STAT_TYPE];#endif /* classification of loads */ long long ldissues, ldspecs, limbos, unlimbos, redos, kills; /* forwarding stats */ long long vsbfwds, fwds, partial_overlaps; /* availability, efficiency and utility (BennetFlynn1995 TR) */ long long avail_fetch_slots; /* number of available slots lost to each cause */ long long avail_active_full_losses[lNUM_LAT_TYPES]; /* efficiency losses from each cause */ long long eff_losses[eNUM_EFF_STALLS]; /************************ Functions ****************************/ ProcState(int); ~ProcState() { if (corefile) fclose(corefile); } int reset_lists(); inline void ComputeAvail(); /* branch prediction functions */ inline void BPBSetup(); // set up BP table inline int BPBPredict(unsigned bpc, int statpred); // returns predicted pc inline void BPBComplete(unsigned bpc, int taken, int statpred); inline void RASSetup (); // set up RAS predictor inline void RASInsert (unsigned newpc); // insert on a CALL inline unsigned RASPredict (); // remove on a RETURN, this is a destructive prediction /* Statistics */ void report_stats (int); void reset_stats (); void report_phase (); void report_phase_fast (int); void report_phase_in (char *); void report_partial (); void endphase (int); void newphase (int);};/* Other useful function definitions (see .c files for descriptions) */extern int FlushActiveList (long long tag, ProcState * proc);extern void init_decode (ProcState *);extern int ExceptionHandler (long long, ProcState *);extern int PreExceptionHandler (instance *, ProcState *);extern int startup (char *, char **, char **, ProcState *);extern "C" void RSIM_EVENT();#define unstall_the_rest(proc) { \ if (proc->stall_the_rest) { \ proc->eff_losses[proc->type_of_stall_rest] += proc->stalledeff; \ proc->stall_the_rest = 0; \ proc->type_of_stall_rest = eNOEFF_LOSS; \ proc->stalledeff = 0; \ } \}inline short arch_to_log(ProcState *proc, int cwp, int iarch);inline void setup_arch_to_log_table(ProcState *proc);inline unsigned DOWN_TO_PAGE(unsigned i);inline unsigned UP_TO_PAGE(unsigned i);inline char* GetMap(instance * inst, ProcState * proc);#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -