The (unary) n-bit find first one circuit (FFO) and the (unary) n-bit find
last one circuit (FLO) calculate the following function:
This means that the circuit finds the first (last) active signal within a
set of signals. If the signals are ascending numbered, the circuit
calculates the minimum (maximum) of the set of active signals. This value is
returned unary, i.e., by an set of signals as big as the input set.
Furthermore, a signal zero is returned, which is set iff the minimum
(maximum) is undefined.
It is used by the reservation station control (section 3.6.4, page
??) and by the CDB control (section 3.8, page
??).
A.1.2 Construction
Figure A.1 and A.2 depict a recursive definition of the
unary find first one circuit. The cost and delay run at:
Cffo(1)
=
Cinv
Cffo(n)
=
Cffo(é n/2 ù) + Cffo(ë n/2 û) +
Cinv +
(ë n/2 û) · Cand + Cand
Dffo(1)
=
Dinv
Dffo(n)
=
Dffo(é n/2 ù) + Dinv + Dand
Figure A.1: 1-bit find first one
Figure A.2: n-bit find first one
A.2 Conditional Sign Extension
The conditional sign extension circuit is used for the data memory interface
and calculates the following function:
sextn,m:
{0,1}n+1 ® {0,1}m,
(an-1,...,a0,s) |® (bm-1,...,b0), such that
bi = {
ai
:
i<n
an-1
:
i ³ n Ù (s=1)
0
:
otherwise
.
This means that sextn,m(a,0) extends an unsigned n-bit integer value a
to m bits, whereas sextn,m(a,1) extends a signed n-bit integer
value a to m bits.
Figure A.3: Sext(n,m)
A.3 The Integer Function Unit
The integer function unit (figure A.4) handles all integer
operations, which are the ALU functions and shifting instructions. Table
3.10. page ?? specifies the interface. The function unit
consists of the ALU and shifter environment presented in [MP95] with
one small modification: The overflow bit ovf, which is generated by the
ALU, is masked, since it is only used for two instructions. The mask bit is
calculated by the ovfmask circuit, which implements the following function:
Figure A.4: Integer function unit environment
A.4 ROB Auxiliary Circuits
The ROB requires three auxiliary circuits, which calculate the ROB.full and
ROB.empty signals and provide the ROB pointers ROB.head and ROB.tail. The
circuits are literally taken from [Lei98].
The ROB pointers ROB.head and ROB.tail are stored in registers (figure
A.5). A pointer register is incremented by one (modulo 16,
the ROB size), if ROB.tailce or ROB.headce is active, respectively. In case
of an interrupt, the JISR signal causes that a zero is clocked into the
counter register.
The ROB flags circuit (figure A.6) provides the ROB.full and
ROB.empty signals. The ROB.full signal is active, iff the reorder buffer is
full, the ROB.empty signal is active iff the reorder buffer is empty. In
both cases, the values of the pointer registers are equal, a comparator
therefore is not suited to calculate the signals. A counter register, which
holds the current number of instructions in the ROB, is used instead. The
counter is updated if ROB.tailce or ROB.headce is active:
ROB.countce = ROB.tailce Ú ROB.headce
Figure A.5: Reorder buffer pointer
Figure A.6: Reorder buffer flags
A.5 Calculation of EPC/EPCn
During retire, the instruction in the ROB is checked for interrupts. In case
of an interrupt, a jump to the interrupt service routine (JISR) is
performed. During JISR, the EPC and EPCn special purpose registers are
filled with values calculated from values from the ROB. The EPC and EPCn
registers hold the addresses of the two PC at which the program is to be
resumed after processing the interrupt. The circuit for this calculation
(figure A.7) is identical to the circuit presented in
[Lei98].