Rsp Yielding - Nintendo Ultra64 Programmer's Manual

Rsp
Table of Contents

Advertisement

Revision 1.0

RSP Yielding

RSP Yielding
One of the more complex issues of synchronization between the CPU and
yielding
the RSP is the concept of
. 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.
147

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents