Ex3_main.c

...

main()

{

...

res=Prod(&array1[0],&array2[0]);

...

}

Compiler Support on StarCore

Ex3_prod.c

...

long Prod(short a1[], short a2[])

{

...

}

Figure 6. Files for the Local Versus Global Optimization Exercise

1. Open the two files and understand their functionality.

Local Optimization

2.Compile the two files:

ccsc100 -Ot2 Ex3_main.c Ex3_prod.c -o Ex3.eld

3.Run the code: runsc100 -t Ex3.eld.

The -toption for runsc100 enables the cycle count generation. Write the cycle count in the box below:

Local Optimization (Default Mode) Cycle Count

Global Optimization

4.Compile the files using global optimization:

ccsc100 -Ot2 -Og Ex3_main.c Ex3_prod.c -o Ex3_glo.eld where -Og is the global optimization option.

5.Run the code: runsc100 -t Ex3_glo.eld. Write the cycle count in the box below:

Global Optimization (-Og option) Cycle Count

Introduction to the SC140 Tools

11

Page 11
Image 11
Motorola SC140 user manual Local Optimization, Global Optimization