Next: Dealing with Spin Compensation
Up: Problems Encountered
Previous: Execution Time Too Long
Detecting a missed deadline was itself a problem. The following
techniques were used to diagnose timing problems:
- Run-time check for missed deadline. A flag is used in the vertical retrace hander to check for a missed deadline.
- Logging errors in memory.
Compared with the frame time of 33 ms, it takes too
long to get a message to the screen using the PUT_LINE command (a predefined Ada
feature). It caused a missed deadline. Using procedures
TAKE_LOG and DUMP_LOG which are implemented previously ([7])
, this problem could be solved. The message is written to an array in memory and
then transferred to a file at program termination.
This was used also for debugging other errors since the taget-to-host I/O is
particularly slow, due to the serial 9600 baud interface.
- The ``dual loop'' method for measuring execution time. This is
a common method to measure execution time.
This method uses two loops, a null loop (which has no code) and a loop which has
the code, that needs to be measured. Both loops perform the same number of iterations.
First, it measures the execution time of the
null loop, and then the other loop containing the code.
Second, it estimates the total execution time for the code, by
subtracting the execution time of the null loop from the time of the
other. Finally, the
actual execution time for one iteration of the code is taken to be the result of averaging
by the number of iterations.
Data for execution times of the major code used in this project are in
Appendix A.
Ted &
Wed Feb 5 10:50:20 EST 1997