Chaining 链接

Computer Architecture
A Quantitative Approach, Fifth Edition
Prof. Zhang Gang
[email protected]
School of Computer Sci. & Tech.
Tianjin University, Tianjin, P. R. China
Computer Architecture
A Quantitative Approach, Fifth Edition
 The execution time of a vector instruction depends
on three factors:
 Length of operand vectors
 VMIPS functional units consume one
cycle
 Execution time is approximately the
 Structural hazards
 Are you remember what’s the mean
 Data dependencies
 Are you remember what’s the mean
element per clock
vector length
of structural hazard?
of data dependency?
Computer Architecture
A Quantitative Approach, Fifth Edition

Convoy 编队
 Set of vector instructions that could potentially
execute together
 No structural hazards and no data dependencies
 Example
LV
MULVS.D
LV
ADDVV.D
SV
V1,Rx
V2,V1,F0
V3,Ry
V4,V2,V3
Ry,V4
Convoys:
1
2
3
4
LV
MULVS.D
ADDVV.D
SV
LV
;load vector X
;vector-scalar multiply
;load vector Y
;add two vectors
;store the sum
Computer Architecture
A Quantitative Approach, Fifth Edition
 Operation
Start-up overhead (cycles)
Vector load/store
12
Vector multiply
7
Vector add
6
 Assume convoys don’t overlap; Vector length = n
 Convoy
Start
1st result last result
1.LV
0
12
12+n-1
2.MULV
12+n
12+n+7
18+2n
LV
12+n
12+n+12
23+2n
3.ADDV
24+2n
24+2n+6 29+3n
4.SV
30+3n
30+3n+12 41+4n
Computer Architecture
A Quantitative Approach, Fifth Edition
 Sequences with read-after-write dependency
hazards can be in the same convoy via chaining
 read-after-write dependency is data dependency

Chaining
 Allows a vector operation to start as soon as the
individual elements of its vector source operand
become available
Computer Architecture
A Quantitative Approach, Fifth Edition
 Example 1
LV
v1
MULV v3,v1,v2
ADDV v5, v3, v4
V1
V2
Chain
Load
Unit
Memory
V3
V4
Chain
Mult.
Add
V5
Computer Architecture
A Quantitative Approach, Fifth Edition
 Example 2
LV
V1,Rx
;load vector X
MULVS.D V2,V1,F0
;vector-scalar multiply
LV
V3,Ry
;load vector Y
ADDVV.D V4,V2,V3
;add two vectors
SV
Ry,V4
;store the sum
 We assume a single copy of each vector
functional unit
 Only one load/store functional unit
Convoys (using chaining):
1 LV, MULVS.D
2 LV, ADDVV.D
3 SV
Computer Architecture
A Quantitative Approach, Fifth Edition
• Without chaining, must wait for last element of result to be
written before starting dependent instruction
Load
Mul
Time
Add
• With chaining, can start dependent instruction as soon as
first result appears
Load
Mul
Add
Computer Architecture
A Quantitative Approach, Fifth Edition

Chime 基准时间
 Unit of time to execute one convoy
 m convoys executes in m chimes
 For vector length of n, requires m x
n clock cycles
 A chime ignores the startup overhead for a
vector operation.
Computer Architecture
A Quantitative Approach, Fifth Edition
What is the meaning of length of operand
vectors?
2. What is the meaning of convoy?
3. What are the advantages of using a chaining?
4. What is the meaning of chime?
1.