Compiler Support on StarCore
12.Type next to step through the code.
13.Look at the register contents in the session window and write the values in the Simulator Columns boxes above for both sections.
Congratulations, you have completed Exercise 4.
.
Good To Know
•Unaligned data accesses lead to erroneous results.You must consider these issues when developing assembly code.
5 Split Summation Exercise
The split summation exercise shows how to modify C code using the split summation technique to get better parallelization. The split summation technique helps to maximize the
N – 1 |
|
y = ∑ x2(i) , | (2) |
where x(i) is the signal input sample at iteration i, y is the power of the signal, and N is the signal length. As Exercise 2 shows, computing the signal energy directly from Equation 2 results in the use of only one ALU out of the four with one
N – 1 |
|
y = ∑ x( i)x(i) + x(i + 1)x(i + 1) + x( i + 2)x(i + 2) + x(i + 3)x(i + 3) | (3) |
i = 0, 4, 8, … |
|
Equation 3 explicitly highlights the four
y =
x(i) * x(i) + x(i+1) * x(i+1) + x(i+2) * x(i+2) + x(i+3) * x(i+3)
Group 0 (First cycle)
+
x(i+4) * x(i+4) + x(i+5) * x(i+5) + x(i+6) * x(i+6) + x(i+7) * x(i+7)
Group 1 (Second cycle)
+ ...
Figure 9. Signal Power Calculation Using the Split Summation Technique
16 | Introduction to the SC140 Tools |