Revision 1.0
RSP Yielding
147
RSP Yielding
One of the more complex issues of synchronization between the CPU and
the RSP is the concept of
yielding
. The motivation for yielding is discussed
at length in higher-level documentation; some of the implementation details
are discussed here.
For typical applications with graphics and audio processing that must share
the resources of the RSP, there must be a higher-level synchronization to
assure that neither task is starved.
It is the nature of graphics processing that the amount of RSP processing
required on a frame-to-frame basis may be difficult to predict. The amount
of graphics computations can depend on the data in the scene, the location
of the camera, and other parameters of visual complexity. A varying amount
of graphics processing determines the “frame rate” of an application. If a
new graphics frame is not computed, the video circuitry will just re-display
the old frame.
Audio processing, on the other hand, is usually a function of sample rate,
number of voices, or other data which is more constant and easier to predict.
Audio processing is more susceptible to discontinuities caused by processor
starvation, however. If the next frame of audio is not computed, the audio
circuitry will not have any data to play, and the sound will stop (or click or
pop).
The solution implemented is to allow graphics tasks to
yield
, meaning that
at quiescent times, the graphics task politely inquires to see if the CPU is
requesting that it stop computation. If the answer is yes, the graphics task
saves its state to DMEM sufficiently so that it can be restarted, and the task
will exit.
The operating system discriminates a yield condition from a normal task
completion using the status register of the RSP. It then saves the contents of
DMEM and returns to the application so that the audio task may be
scheduled. When the graphics task is to be resumed, flags in the
OSTask
structure tell the rspboot microcode to behave slightly differently and
restore the previously-yielded task.
Содержание Ultra64
Страница 2: ...2 ...
Страница 10: ...10 ...
Страница 12: ...12 Figure 6 2 buildtask Operation 137 ...
Страница 14: ...14 ...
Страница 80: ...80 Vector Unit Instructions vmadm dres_int dres_int vconst 3 vmadn dres_frac vconst vconst 0 ...
Страница 104: ...104 RSP Coprocessor 0 ...
Страница 150: ...150 Advanced Information ...
Страница 155: ...Revision 1 0 155 ...
Страница 248: ...248 Exceptions None ...
Страница 251: ...Revision 1 0 251 Exceptions None ...
Страница 254: ...254 Exceptions None ...
Страница 257: ...Revision 1 0 257 Exceptions None ...
Страница 293: ...Revision 1 0 293 Exceptions None ...
Страница 316: ...316 Exceptions None ...