Difference between revisions of "Overlay generator"
From esoterum.org
(→Makefile settings) |
(→Auto configuration script for auto overlay) |
||
Line 18: | Line 18: | ||
*Makefile with linker.script.ed | *Makefile with linker.script.ed | ||
:<code>'''LDFLAGS= -Wl,-T,linker.script -Wl,-Map,spu.map -Wl,--gc-sections'''</code> (-gc-sections is used to dump unused .bss .txt and .data sections in spu.map) | :<code>'''LDFLAGS= -Wl,-T,linker.script -Wl,-Map,spu.map -Wl,--gc-sections'''</code> (-gc-sections is used to dump unused .bss .txt and .data sections in spu.map) | ||
+ | |||
+ | === Add timing code to project === | ||
+ | *<code>'''timing.h'''</code>: Add [www.esoterum.com/temp/timing.h timing.h] to main source file | ||
+ | *Add code to start and stop timer, i.e. at start and end of main(). STOP_TIMER will also print the elapsed time. | ||
+ | :'''Start timer''': | ||
+ | :<code>/***** add timing statements ************/</code> | ||
+ | :<code>START_TIMER</code> | ||
+ | :<code>/****************************************/</code> | ||
+ | |||
+ | |||
+ | :'''Stop timer''': | ||
+ | :<code>/*MAB 10 NOV 09 : add timing statements */</code> | ||
+ | :<code>STOP_TIMER</code> | ||
+ | :<code>/****************************************/</code> | ||
+ | |||
=== Auto configuration script for auto overlay === | === Auto configuration script for auto overlay === |
Revision as of 05:07, 15 November 2009
Contents
List of support files
function_sizes.nm
: Required by overlay_generator, generated from object files using the command line:
nm --size-sort *.o > function_sizes.nm
region_sizes_file.dat
: Used by script to describe what sizes of scratchpad memory to use, the contents are three space delimited numbers given in bytes: start_size stop_size step_sizeroot_node.configure_overlay_generator
: Used by script to describe the root function for the project folderobject_filename.cfg
: Needed by overlay generator to determine GCCFG of project code, one file is generated for each object file by gcc when the-fdump-tree-cfg
switch is given inCFLAGS
List of files generated by overlay_generator
common_ancestors.common
: Generated by overlay_generator to record common ancestor information so that it need not be recalculated laterincluded_functions.funcs
: List of functions included in overlay, generated by overlay_generatorgraph_[1-8].dot
andgraph_[1-8].ps
: dotty and postscript representations of GCCFG at various stages of construction, graphs following graph_4 each represent an overlay algorithm
Makefile settings
- Auto overlay Makefile:
MY_CFLAGS += -fdump-tree-cfg -ffunction-sections -Wl,--auto-overlay -Wl,--auto-overlay=linker.script
(note that the cfg switch is not required here)LDFLAGS += -Wl,-Map,spu.map -Wl,--auto-overlay -Wl,--gc-sections
(-Map,spu.map switch is not required, -gc-sections is used to dump unused .bss .txt and .data sections in spu.map)
- Makefile with linker.script.ed
LDFLAGS= -Wl,-T,linker.script -Wl,-Map,spu.map -Wl,--gc-sections
(-gc-sections is used to dump unused .bss .txt and .data sections in spu.map)
Add timing code to project
timing.h
: Add [www.esoterum.com/temp/timing.h timing.h] to main source file- Add code to start and stop timer, i.e. at start and end of main(). STOP_TIMER will also print the elapsed time.
- Start timer:
/***** add timing statements ************/
START_TIMER
/****************************************/
- Stop timer:
/*MAB 10 NOV 09 : add timing statements */
STOP_TIMER
/****************************************/
Auto configuration script for auto overlay
compile_config.sh
: Auto configuration script for auto overlay, recompiles project to create automatically generated </code>linker.script</code> files based on size constraints given in the script. The size constraints ("OPTIONS" in the script) describe the size of a buffer that will be added to the code to artificially restrict the size of the local store. A smaller number means more space will be available in the local store.compile_config.sh
requires the following declaration and assigment to be added to a global section such as the file containing "main" in the project:
- Declaration: place above main()'
/*************************************************************************************/
/****************** BUFFER TO WASTE SPACE TRYING TO GET LINKER SCRIPT TO WORK ********/
int waste_of_space_index;
#define WASTE_OF_SPACE_SIZE 0
unsigned char waste_of_space[WASTE_OF_SPACE_SIZE];
/*************************************************************************************/
/*************************************************************************************/
- Assignment (ensures the data section isn't dropped by --gc-sections): place within main()
/*************************************************************************************/
/****************** BUFFER TO WASTE SPACE TRYING TO GET LINKER SCRIPT TO WORK ********/
for(waste_of_space_index=0;waste_of_space_index<WASTE_OF_SPACE_SIZE;waste_of_space_index++){
waste_of_space[waste_of_space_index]=waste_of_space_index;
}
/*************************************************************************************/
/*************************************************************************************/