comparison VMS.h @ 236:d9053472d0db

minor bug fixes, and name chg
author Some Random Person <seanhalle@yahoo.com>
date Sat, 17 Mar 2012 00:41:34 -0700
parents 0ee1a3c8972d
children ce1f57e10fac
comparison
equal deleted inserted replaced
115:213264c14b13 116:aec69162ef00
29 29
30 //================================ Typedefs ================================= 30 //================================ Typedefs =================================
31 // 31 //
32 typedef unsigned long long TSCount; 32 typedef unsigned long long TSCount;
33 33
34 typedef struct _SchedSlot SchedSlot; 34 typedef struct _AnimSlot AnimSlot;
35 typedef struct _VMSReqst VMSReqst; 35 typedef struct _VMSReqst VMSReqst;
36 typedef struct _SlaveVP SlaveVP; 36 typedef struct _SlaveVP SlaveVP;
37 typedef struct _MasterVP MasterVP; 37 typedef struct _MasterVP MasterVP;
38 typedef struct _IntervalProbe IntervalProbe; 38 typedef struct _IntervalProbe IntervalProbe;
39 39
40 40
41 typedef SlaveVP *(*SlaveAssigner) ( void *, SchedSlot*); //semEnv, slot for HW info 41 typedef SlaveVP *(*SlaveAssigner) ( void *, AnimSlot*); //semEnv, slot for HW info
42 typedef void (*RequestHandler) ( SlaveVP *, void * ); //prWReqst, semEnv 42 typedef void (*RequestHandler) ( SlaveVP *, void * ); //prWReqst, semEnv
43 typedef void (*TopLevelFnPtr) ( void *, SlaveVP * ); //initData, animSlv 43 typedef void (*TopLevelFnPtr) ( void *, SlaveVP * ); //initData, animSlv
44 typedef void TopLevelFn ( void *, SlaveVP * ); //initData, animSlv 44 typedef void TopLevelFn ( void *, SlaveVP * ); //initData, animSlv
45 typedef void (*ResumeSlvFnPtr) ( SlaveVP *, void * ); 45 typedef void (*ResumeSlvFnPtr) ( SlaveVP *, void * );
46 //=========== MEASUREMENT STUFF ========== 46 //=========== MEASUREMENT STUFF ==========
94 { 94 {
95 //for future expansion 95 //for future expansion
96 } 96 }
97 SlotPerfInfo; 97 SlotPerfInfo;
98 98
99 struct _SchedSlot 99 struct _AnimSlot
100 { 100 {
101 int workIsDone; 101 int workIsDone;
102 int needsSlaveAssigned; 102 int needsSlaveAssigned;
103 SlaveVP *slaveAssignedToSlot; 103 SlaveVP *slaveAssignedToSlot;
104 104
105 int slotIdx; //needed by Holistic Model's data gathering 105 int slotIdx; //needed by Holistic Model's data gathering
106 int coreOfSlot; 106 int coreOfSlot;
107 SlotPerfInfo *perfInfo; //used by assigner to pick best slave for core 107 SlotPerfInfo *perfInfo; //used by assigner to pick best slave for core
108 }; 108 };
109 //SchedSlot 109 //AnimSlot
110 110
111 enum VPtype { 111 enum VPtype {
112 Slave = 1, //default 112 Slave = 1, //default
113 Master, 113 Master,
114 Shutdown 114 Shutdown
124 void *resumeInstrPtr; //save core's program-counter when suspend 124 void *resumeInstrPtr; //save core's program-counter when suspend
125 void *coreCtlrFramePtr; //restore before jmp back to core controller 125 void *coreCtlrFramePtr; //restore before jmp back to core controller
126 void *coreCtlrStackPtr; //restore before jmp back to core controller 126 void *coreCtlrStackPtr; //restore before jmp back to core controller
127 127
128 //============ below this, no fields are used in asm ============= 128 //============ below this, no fields are used in asm =============
129 int slaveID; //each slave given a globally unique ID 129
130 int coreAnimatedBy; 130 int slaveID; //each slave given a globally unique ID
131 int coreAnimatedBy;
131 void *startOfStack; //used to free, and to point slave to Fn 132 void *startOfStack; //used to free, and to point slave to Fn
133 enum VPtype typeOfVP; //Slave vs Master vs Shutdown..
134 int assignCount; //Each assign is for one work-unit, so IDs it
135 //note, a scheduling decision is uniquely identified by the triple:
136 // <slaveID, coreAnimatedBy, assignCount> -- used in record & replay
132 137
133 //for comm -- between master and coreCtlr & btwn wrapper lib and plugin 138 //for comm -- between master and coreCtlr & btwn wrapper lib and plugin
134 SchedSlot *schedSlotAssignedTo; 139 AnimSlot *animSlotAssignedTo;
135 VMSReqst *requests; //wrapper lib puts in requests, plugin takes out 140 VMSReqst *requests; //wrapper lib puts in requests, plugin takes out
136 void *dataRetFromReq;//Return vals from plugin to Wrapper Lib 141 void *dataRetFromReq;//Return vals from plugin to Wrapper Lib
137 142
138 //Slave used as carrier for data 143 //For using Slave as carrier for data
139 void *semanticData; //Lang saves lang-specific things in slave here 144 void *semanticData; //Lang saves lang-specific things in slave here
140 145
141 //=========== MEASUREMENT STUFF ========== 146 //=========== MEASUREMENT STUFF ==========
142 MEAS__Insert_Meas_Fields_into_Slave; 147 MEAS__Insert_Meas_Fields_into_Slave;
143 //======================================== 148 float64 createPtInSecs; //time VP created, in seconds
144 149 //========================================
145 enum VPtype type;
146 int numTimesAssigned;
147
148 float64 createPtInSecs; //have space but don't use on some configs
149 }; 150 };
150 //SlaveVP 151 //SlaveVP
151 152
152 153
153 /* The one and only global variable, holds many odds and ends 154 /* The one and only global variable, holds many odds and ends
154 */ 155 */
155 typedef struct 156 typedef struct
156 { //The offsets of these fields are hard-coded into assembly 157 { //The offsets of these fields are hard-coded into assembly
157 void *coreCtlrReturnPt; //offset of field used in asm 158 void *coreCtlrReturnPt; //offset of field used in asm
158 int32 masterLock __align_to_cacheline__; //used in asm 159 int8 falseSharePad1[256 - sizeof(void*)];
159 160 int32 masterLock; //offset of field used in asm
161 int8 falseSharePad2[256 - sizeof(int32)];
160 //============ below this, no fields are used in asm ============= 162 //============ below this, no fields are used in asm =============
161 163
162 //Basic VMS infrastructure 164 //Basic VMS infrastructure
163 SlaveVP **masterVPs; 165 SlaveVP **masterVPs;
164 SchedSlot ***allSchedSlots; 166 AnimSlot ***allAnimSlots;
165 167
166 //plugin related 168 //plugin related
167 SlaveAssigner slaveAssigner; 169 SlaveAssigner slaveAssigner;
168 RequestHandler requestHandler; 170 RequestHandler requestHandler;
169 void *semanticEnv; 171 void *semanticEnv;