HP (Hewlett-Packard) EZ-KIT Switch User Manual


 
Getting Started with ADSP-BF548 EZ-KIT Lite 2-7
Using ADSP-BF548 EZ-KIT Lite to Investigate Performance
Factors
employs. Since the profiler window shows that function
bubble_sort() is
using the largest percentage of processor time, we will move that function
further up the memory hierarchy and examine the results.
There are two commented-out section directives in the middle of the
Sorts.c file, immediately above the bubble_sort() definition. Uncom-
ment the directive that places bubble_sort() in the section named
L2_sram by removing the // characters, then rebuild and rerun the project.
Because the bubble sort’s instructions now are fetched from L2 memory
rather than external memory, the processor spends less time waiting,
resulting in a faster elapsed time and smaller cycle count. The profiler
window also shows that bubble_sort() is not dominating the execution of
the program as much as before.
Now replace the comment at the start of the L2_sram directive and
uncomment the directive on the line above. This will result in the bubble
sort’s instructions being placed in the portion of L1 memory reserved for
code. Rebuild and rerun the project. Your new results probably are not
much different from the previous set. One reason for this is that the access
time difference between L2 and L1 is rather less than the difference
between external memory and L2. However, other factors are at work as
we shall see in the next two steps.
All Blackfin processors have the option of using part of the L1 code and
data memory areas as caches. Enabling the caches allows the second and
subsequent accesses to external memory locations to happen at L1 speeds.
We are going to examine this now. Ensure that both section directives at
the start of
bubble_sort() are commented out—all of the program’s code
will be placed in external memory. Next we are going to enable the
instruction cache:
1. Open the project wizard (Project–>Project Options or ALT-F7).
2. In the Project tree control, locate the Startup Code Settings node.
Click Cache and Memory Protection under Startup Code
Settings.