00001 00002 #include "pose.h" 00003 00005 void spec::Step() 00006 { 00007 Event *ev; 00008 POSE_TimeType lastGVT = localPVT->getGVT(); 00009 int iter = 0; 00010 00011 if (!parent->cancels.IsEmpty()) CancelUnexecutedEvents(); 00012 if (eq->RBevent) Rollback(); 00013 if (!parent->cancels.IsEmpty()) CancelEvents(); 00014 parent->Status(); 00015 00016 // Shorten the leash as we near POSE_endtime 00017 if ((POSE_endtime > POSE_UnsetTS) && (lastGVT + timeLeash > POSE_endtime)) 00018 timeLeash = POSE_endtime - lastGVT + 1; 00019 00020 // Prepare to execute an event 00021 ev = eq->currentPtr; 00022 while ((ev->timestamp > POSE_UnsetTS) && 00023 (ev->timestamp <= lastGVT + timeLeash)) { 00024 // do all events within the speculative window 00025 iter++; 00026 currentEvent = ev; 00027 ev->done = 2; 00028 parent->ResolveFn(ev->fnIdx, ev->msg); // execute it 00029 ev->done = 1; // complete the event execution 00030 eq->mem_usage++; 00031 eq->ShiftEvent(); // shift to next event 00032 ev = eq->currentPtr; // reset ev 00033 } 00034 #if !CMK_TRACE_DISABLED 00035 if(pose_config.stats) 00036 if (iter > 0) localStats->Loop(); 00037 #endif 00038 } 00039