Coprocessor Interface
ARM DDI 0301H
Copyright © 2004-2009 ARM Limited. All rights reserved.
11-10
ID012310
Non-Confidential, Unrestricted Access
A simple priority encoder, looking at the three flags, can supply the correct multiplexor select
signals. The state of the three flags can also determine how data are moved from one buffer to
another in the queue. Table 11-4 lists how the three flags are decoded.
New data can be moved into buffer A, provided the queue is not full, even if its flag is set,
because the current contents of buffer A are moved to buffer B. When the queue is read, the flag
associated with the buffer providing the information must be cleared. This operation can be
combined with an input operation so that the buffer is overwritten at the end of the cycle during
which it provides the queue output. This can be implemented by using the read enable signal to
mask the flag of the selected stage, making it available for input. Figure 11-5 shows reading and
writing a queue.
Figure 11-5 Queue reading and writing
Four valid inputs, labeled One, Two, Three, and Four, are written into the queue, and are clocked
into buffer A as they arrive. Figure 11-5 shows how these inputs are clocked from buffer to
buffer until the first input reaches buffer C. At this point a read from the queue is required.
Because buffer C is full, it is chosen to supply the data. Because it is being read, it is free to
accept more input, and so it receives the value Two from buffer B, that in turn receives the value
Three from buffer A. Because buffer A is being emptied by writing to buffer B, it can accept the
value Four from the input.
Table 11-4 Addressing of queue buffers
Flag C
Flag B
Flag A
S1
S0
Remarks
0
0
0
X
X
Queue is empty
0
0
1
0
0
B = A
0
1
0
0
1
C = B
0
1
1
0
1
C = B, B = A
1
0
0
1
X
-
1
0
1
1
X
B = A
1
1
0
1
X
-
1
1
1
1
X
Queue is full. Input inhibited
One
Two
Three
Four
One
Two
Three
One
Two
One
One
One
Two
Buffer A
Flag A
Buffer B
Flag B
Buffer C
Flag C
Read queue
Output
Valid input