/****************************************************************************\
 *           Copyright (C) 2000 Texas Instruments Incorporated.             *
 *                           All Rights Reserved                            *
 *                                                                          *
 * GENERAL DISCLAIMER                                                       *
 * ------------------                                                       *
 * All software and related documentation is provided "AS IS" and without   *
 * warranty or support of any kind and Texas Instruments expressly disclaims*
 * all other warranties, express or implied, including, but not limited to, *
 * the implied warranties of merchantability and fitness for a particular   *
 * purpose.  Under no circumstances shall Texas Instruments be liable for   *
 * any incidental, special or consequential damages that result from the    *
 * use or inability to use the software or related documentation, even if   *
 * Texas Instruments has been advised of the liability.                     *
 ****************************************************************************
 *                                                                          *
 * Written by :                                                             *
 *            Sebastien Tomas  (VCP2/TCP2)                                  *
 *            Texas Instruments                                             * 
 *            12 May, 2005                                                  *
 * Updated by :                                                             *
 *            Sebastien Tomas  (VCP2/TCP2) 11 July,    2005                 *
 *            Sebastien Tomas  (VCP2)      08 August,  2005                 *
 *            Sebastien Tomas  (VCP2/TCP2) 30 August,  2005                 *
 *            Sebastien Tomas  (VCP2/TCP2) 24 October, 2005                 *
 *                                                                          *
 * The purpose of this test is to evaluate Bit-Error Rate performance for   *
 * both VCP2 and TCP2 co-processors in the TCI6482 (Himalaya)               *
 *                                                                          *
 * This test should not be redistributed for any reason without             *
 * permission.                                                              *
 *                                                                          *
\***************************************************************************/

The framework can be built with CCS3.2 Beta1. The CSL3.x is provided as lib.
The framework was only tested for VCP2/TCP2 Hard Decisions and in Sanity
Check mode. The intent of the framework was to validate the Himalaya
VCP2/TCP2 simulator DLLs and v1.1 Himalaya parts for 3GPP cases.
The framework was also validated with Faraday simulators (check device 
specific parameters (event and global address) in tcpvcp2_3gpp.h).

I. To run the framework:
    1. Use : a. Either TCI6482 simulator version >= 0.7.17 and enclosed 
                VCP2/TCP2 dlls (<install_dir>\tools)
		     b. Or TCI6482 v1.1 parts
    2. Open <install_dir>\source\HimBerCalculation.pjt
    3. Configure the compilation flags(Run_Vcp2Ber(WithCModel) and Run_Tcp2Ber 
           project configurations are predefined)/scenarios as desired: 

 RUN_TEST_VCP is used to run BER measurements on the VCP2 according to the
 scenarios contained in vcp2_frame_types.h	
 
 VCP2_C_MODEL is used to enable VCP2 C model to be run in parallel with VCP2					

 RUN_TEST_TCP is used to run BER measurements on the TCP2 according to the
 scenarios contained in tcp2_frame_types.h				

 SATURATE_ON_HIGH_SNR (compiler preprocessing symbol): The user can decide
 to saturate the symbols under a given level of noise (vcp2/tcp2_frame_types.h)		  								
            
    4. Configure the appropriate scenarios in t/vcp2_frame_types.h
    5. Build and load on Himalaya simulator target and run
    6. The following output files will be generated:
 vcp2results.txt if RUN_TEST_VCP is set
 tcp2results.txt and tcp2traceresults.txt if RUN_TEST_TCP is set

II. To set sigma range for a given SNR range:
sigma = sqrt(rate/(2*10^(SNR/10))
SNR = 10*log(sigma^2*2/rate)
If you look at rates between 2 -> 4 and expect SNR from 0 dB -> 3.5 dB		
Then		Range on sigma for rate 2 :	0.65 -> 1.00
        Range on sigma for rate 3 :	0.80 -> 1.20
        Range on sigma for rate 4 :	0.95 -> 1.40	

III. Documentation:
    1. http://focus.ti.com/lit/an/spra974/spra974.pdf is an app. note
         explaining the BER measurements methodology.
    2. The output files can be imported in Excel to draw BER curves.
