Loop Carry Paths
6-79
Optimizing Assembly Code via Linear Assembly
6.7.3
Drawing a Dependency Graph
Figure 6–15 shows the dependency graph for the IIR filter. A loop carry path
exists from the store of yi+1 to the load of yi. The path between the STH and
the LDH is one cycle because the load and store instructions use the same
memory pipeline. Therefore, if a store is issued to a particular address on cycle
n and a load from that same address is issued on the next cycle, the load reads
the value that was written by the store instruction.
Figure 6–15. Dependency Graph of IIR Filter
LDH
ADD
SUB
cntr
LOOP
1
B
1
SHR
yi+1
mem
STH
s1
s0
MPY
xi
5
p0
2
LDH
MPY
xi+1
5
p1
2
ADD
LDH
MPY
yi
p2
1
A side
B side
5
2
1
1
1
Note:
The shaded numbers show the loop carry path: 5 + 2 + 1 + 1 + 1 = 10.