****************************************************************************************************
This folder is associated with the Application Note


   	ADSP-CM40x Serial Flash Execute-in-Place Technology(EE-363)

that can be found at http://www.analog.com/ee-notes.

Date Created:	21/10/2015

****************************************************************************************************
CONTENTS

	1. DESCRIPTION
	2. VERSION INFORMATION
	3. DIRECTORY STRUCTURE
	4. EXTERNAL CONNECTIONS

****************************************************************************************************
1. DESCRIPTION
The folder contains the FFT project that which is CMSIS FFT code example that runs from Internal Flash upon Power-on. It shows how a complex but not critical algorithm code can be placed in Flash and can take advantage of cache for better performance. As long as the code fits inside the cache memory, user can see that all further accesses will be as Cache Hits and therefore the execution is as fast as the case of internal SRAM. It also gives an example of how to analyze the performance using Cache Counters.


Test Description :-

1. MACROS:

        Uncommenting "#define PLACE_FLASH " places the FFT code into flash.
	Commenting "#define BYPASS_CACHE" makes sure that the cache is not bypassed.
	Uncommenting "#define SET_CLOCKS" makes sure that CGU and SPI clock settings are made optimal. 
        The code will be executed "#define TEST_CNT 3" number of times. 
        Uncommenting #define PREFETCH_ENABLE enables the prefetch feature for cache. 
        Also, uncommenting #define XIP_ENABLE puts the flash into the Xip mode. 

2. Terminal IO captures the stdio output:

	TEST_RUN ::              //test execution number
	ICodeRefCnt =		 //cache I Code Reference Counter value
	ICodeMissCnt = 		 //cache I Code Miss Counter value
	ICodeFillCnt =           //cache I Code Fill Counter value
	CycleCOUNTn =            // provides number of core clock cycles required for FFT code execution
        TEST_PASS                //check if the test passed

3. Profiling is done as follows and it runs for TEST_CNT times.

	START_COUNT()        
	TestFFT();   
        STOP_COUNT()  

   TestFFT in turn calls the FFT related functions.

****************************************************************************************************
2. VERSION INFORMATION

Tested on:

IDE: 	  IAR Embedded Workbench for ARM 7.40.1
Hardware: ADSP-CM408F EZ-KIT board revision 0.2, BOM Revision 0.7
    	  ADSP-CM403F EZ-Kit board revision 1.0, BOM Revision 0.7
	  Silicon Revision H

****************************************************************************************************
3. DIRECTORY STRUCTURE
		
- FFT_f32
    -src

	Init_CGU.c - Initializes CGU.
	FFT.c - Contains main() function and places led blink code in configured memory location.
	FFT.h - Contains User configurable MACROs. 
	SystemUtil.c - Configures XIP mode, cache, clocks and different memory regions.
        cache_counter_util.c - Configures cache counters
	arm_cfft_radix_f32.c - FFT functions from CMSIS
        arm_cfft_radix_init_f32.c - FFT functions from CMSIS
        arm_cmplx_mag_f32.c - FFT functions from CMSIS
        arm_common_tables.c - FFT functions from CMSIS
        arm_fft_bin_data.c - FFT functions from CMSIS
        arm_max_f32.c - FFT functions from CMSIS

****************************************************************************************************
4. EXTERNAL CONNECTIONS

None