示例#1
0
void test_run(void)
{	int i;
	
	for(i=0;i<BUFFER_SIZE;i++)
	{
	 fVal= (float)(BUFFER_SIZE - i)/(float)BUFFER_SIZE;
	 Cla1ForceTask1andWait();
	 y[i] = fResult; 
	}
    
#if 0
    Cla1ForceTask2andWait();

    Cla1ForceTask3andWait();

    Cla1ForceTask4andWait();

    Cla1ForceTask5andWait();

    Cla1ForceTask6andWait();

    Cla1ForceTask7andWait();

    Cla1ForceTask8andWait();
#endif
}
示例#2
0
void test_run(void)
{	
    unsigned int  i;
    for(i=0;i<BUFFER_SIZE;i++){
        x[0][0] = (float)i+1;
        x[0][1] = (float)i+2;
        x[0][2] = (float)i+3;
        x[1][0] = (float)i-1;
        x[1][1] = (float)i-2;
        x[1][2] = (float)i-3;
        x[2][0] = (float)i-7;
        x[2][1] = (float)i+3;
        x[2][2] = (float)i-9;
	 Cla1ForceTask1andWait();
     z[i] = fDet;
}
#if 0
    Cla1ForceTask2andWait();

    Cla1ForceTask3andWait();

    Cla1ForceTask4andWait();

    Cla1ForceTask5andWait();

    Cla1ForceTask6andWait();

    Cla1ForceTask7andWait();

    Cla1ForceTask8andWait();
#endif
}
//
// CLA_runTest - Execute CLA task tests for specified vectors
//
void CLA_runTest(void)
{
    int16_t i, error;

    //
    // Initialize the CPUToCLA1MsgRam variables here
    //
    PIBYTWO = 1.570796327;

    for(i=0; i < BUFFER_SIZE; i++)
    {
        fVal = (float)((BUFFER_SIZE/2) - i);

        Cla1ForceTask1andWait();

        y[i] = fResult;
        error = fabs(atan_expected[i]-y[i]);

        if(error < 0.01)
        {
            pass++;
        }
        else
        {
            fail++;
        }
    }

#if 0

    Cla1ForceTask2andWait();
    WAITSTEP;

    Cla1ForceTask3andWait();
    WAITSTEP;

    Cla1ForceTask4andWait();
    WAITSTEP;

    Cla1ForceTask5andWait();
    WAITSTEP;

    Cla1ForceTask6andWait();
    WAITSTEP;

    Cla1ForceTask7andWait();
    WAITSTEP;

    Cla1ForceTask8andWait();
    WAITSTEP;
#endif
}
示例#4
0
void test_run(void)
{
    Cla1ForceTask1andWait();

    Cla1ForceTask2andWait();

    Cla1ForceTask3andWait();

#if 0    
    Cla1ForceTask4andWait();

    Cla1ForceTask5andWait();

    Cla1ForceTask6andWait();

    Cla1ForceTask7andWait();

    Cla1ForceTask8andWait();
#endif
}
//
// CLA_runTest - Execute CLA task tests for specified vectors
//
void CLA_runTest(void)
{
    //
    //    x[][] = {{10,3,4}, {3,1,2}, {4,2,6}};
    //
    x[0][0] = 10;
    x[0][1] = 3;
    x[0][2] = 4;
    x[1][0] = 3;
    x[1][1] = 1;
    x[1][2] = 2;
    x[2][0] = 4;
    x[2][1] = 2;
    x[2][2] = 6;

    //
    //    y[][] = {{1,2,1}, {2,1,2}, {1,2,6}};
    //
    y[0][0] = 1;
    y[0][1] = 2;
    y[0][2] = 1;
    y[1][0] = 2;
    y[1][1] = 1;
    y[1][2] = 2;
    y[2][0] = 1;
    y[2][1] = 2;
    y[2][2] = 6;

    Cla1ForceTask1andWait();
    unsigned int i,j;

    int32_t fError[M][N];
    for(i=0; i < M; i++)
    {
        for(j=0; j < N; j++)
        {
            fError[i][j] = fabs(z_expected[i][j]-z[i][j]);

            if(fError[i][j] == 0)
            {
                pass++;
            }
            else
            {
                fail++;
            }
        }
    }

#if 0
    Cla1ForceTask2andWait();
    WAITSTEP;

    Cla1ForceTask3andWait();
    WAITSTEP;
    Cla1ForceTask4andWait();
    WAITSTEP;

    Cla1ForceTask5andWait();
    WAITSTEP;

    Cla1ForceTask6andWait();
    WAITSTEP;

    Cla1ForceTask7andWait();
    WAITSTEP;
#endif
}
//
// CLA_runTest - Performs vector test sequence
//
void CLA_runTest(void)
{
    //
    // vector1[5] = {1.0,4.0,8.0,.5,.25};
    //
    vector1[0] = 1.0;
    vector1[1] = 4.0;
    vector1[2] = 8.0;
    vector1[3] = .5;
    vector1[4] = .25;

    //
    // vector2[10] = {-.25,-.5,-.125,-2.0,-4.0,-8.0,8.0,4.0,.25,.125};
    //
    vector2[0] = -.25;
    vector2[1] = -.5;
    vector2[2] = -.125;
    vector2[3] = -2.0;
    vector2[4] = -4.0;
    vector2[5] = -8.0;
    vector2[6] = 8.0;
    vector2[7] = 4.0;
    vector2[8] = .25;
    vector2[9] = .125;

    Cla1ForceTask1andWait();

    Cla1ForceTask2andWait();

    Uint16 i;
    float vector1_gold[] = {1/1.0, 1/4.0, 1/8.0, 1/.5, 1/.25};
    float vector2_gold[] = {-1/.25,-1/.5,-1/.125,-1/2.0,-1/4.0,-1/8.0,
                            1/8.0,1/4.0,1/.25,1/.125};

    for(i=0; i < LENGTH1; i++)
    {
        if(vector1_inverse[i] != vector1_gold[i])
        {
            fail++;
        }
        else
        {
            pass++;
        }
    }

    //
    // Map the data memory back to the CPU so we can check the
    // results of task 2
    //
    EALLOW;
    MemCfgRegs.LSxMSEL.bit.MSEL_LS0 = 0;
    MemCfgRegs.LSxMSEL.bit.MSEL_LS1 = 0;
    EDIS;
   __asm("   NOP");
   __asm("   NOP");
   __asm("   NOP");
   __asm("   NOP");

    for(i=0; i < LENGTH2; i++)
    {
        if(vector2[i] != vector2_gold[i])
        {
            fail++;
        }
        else
        {
            pass++;
        }
    }
#if 0
    Cla1ForceTask3andWait();
    WAITSTEP;

    Cla1ForceTask4andWait();
    WAITSTEP;

    Cla1ForceTask5andWait();
    WAITSTEP;

    Cla1ForceTask6andWait();
    WAITSTEP;

    Cla1ForceTask7andWait();
    WAITSTEP;
#endif
}
示例#7
0
//! Main Function
void main(void)
{
	//! Step 1: Setup the system clock
	InitSysCtrl();

//! Step 2: Initialize PIE control
	/*! Intialize PIE control, disable all interrupts and
	 * then copy over the PIE Vector table from BootROM to RAM
	 */
	DINT;
	InitPieCtrl();
	IER = 0x00000000;
	IFR = 0x00000000;
	InitPieVectTable();
	
	/*! Assign user defined ISR to the PIE vector table */
	EALLOW;
	PieVectTable.CLA1_INT1  = &cla_task1_isr;
	PieVectTable.CLA1_INT2  = &cla_task2_isr;
	PieVectTable.CLA1_INT3  = &cla_task3_isr;
	PieVectTable.CLA1_INT4  = &cla_task4_isr;
	PieVectTable.CLA1_INT5  = &cla_task5_isr;
	PieVectTable.CLA1_INT6  = &cla_task6_isr;
	PieVectTable.CLA1_INT7  = &cla_task7_isr;
	PieVectTable.CLA1_INT8  = &cla_task8_isr;
	PieVectTable.ILLEGAL   = &NEW_ILLEGAL_ISR;
	EDIS;
	
	
	
	/*! Compute all CLA task vectors */ 
    EALLOW;
    Cla1Regs.MVECT1 = (Uint16) (&Cla1Task1 - &Cla1Prog_Start)*sizeof(Uint32);
    Cla1Regs.MVECT2 = (Uint16) (&Cla1Task2 - &Cla1Prog_Start)*sizeof(Uint32);
    Cla1Regs.MVECT3 = (Uint16) (&Cla1Task3 - &Cla1Prog_Start)*sizeof(Uint32);
    Cla1Regs.MVECT4 = (Uint16) (&Cla1Task4 - &Cla1Prog_Start)*sizeof(Uint32);
    Cla1Regs.MVECT5 = (Uint16) (&Cla1Task5 - &Cla1Prog_Start)*sizeof(Uint32);
    Cla1Regs.MVECT6 = (Uint16) (&Cla1Task6 - &Cla1Prog_Start)*sizeof(Uint32);
    Cla1Regs.MVECT7 = (Uint16) (&Cla1Task7 - &Cla1Prog_Start)*sizeof(Uint32);
    Cla1Regs.MVECT8 = (Uint16) (&Cla1Task8 - &Cla1Prog_Start)*sizeof(Uint32);    
    EDIS;
   
   	//! Step 3 : Mapping CLA tasks
    /*! All tasks are enabled and will be started by an ePWM trigger
     *  Map CLA program memory to the CLA and enable software breakpoints
     */
    EALLOW;
	Cla1Regs.MPISRCSEL1.bit.PERINT1SEL 	= CLA_INT1_NONE;
	Cla1Regs.MPISRCSEL1.bit.PERINT2SEL 	= CLA_INT2_NONE;
	Cla1Regs.MPISRCSEL1.bit.PERINT3SEL 	= CLA_INT3_NONE;
	Cla1Regs.MPISRCSEL1.bit.PERINT4SEL 	= CLA_INT4_NONE;
	Cla1Regs.MPISRCSEL1.bit.PERINT5SEL 	= CLA_INT5_NONE;
	Cla1Regs.MPISRCSEL1.bit.PERINT6SEL 	= CLA_INT6_NONE;
	Cla1Regs.MPISRCSEL1.bit.PERINT7SEL 	= CLA_INT7_NONE;
	Cla1Regs.MPISRCSEL1.bit.PERINT8SEL 	= CLA_INT8_NONE;
	Cla1Regs.MIER.all 		 		    				= 0x00FF;
	EDIS;		
    
      /*! Enable CLA interrupts at the group and subgroup levels */
	PieCtrlRegs.PIEIER11.all       = 0xFFFF;
	IER = (M_INT11);
	EINT;          						    // Enable Global interrupt INTM
   	ERTM;          						    // Enable Global realtime interrupt DBGM

	/*!Switch the CLA program space to the CLA and enable software forcing
	 * Also switch over CLA data ram 0 and 1
	 */
	
   	EALLOW;
   	Cla1Regs.MMEMCFG.bit.PROGE 		= 1;
   	Cla1Regs.MMEMCFG.bit.RAM1E		= 1;			
   	Cla1Regs.MCTL.bit.IACKE			= 1;
   	EDIS;
   	
/*-----------------------------------------------------------------------------
 * CLA Task 1: Does additions and subtractions
 * --------------------------------------------------------------------------*/
 	vInitDataForTask1();
   	Cla1ForceTask1andWait();
   	WAITSTEP;
   	(sCLAtoCPUMsg.y1.i32 == 0x40EED289)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y2.i32 == 0xC0E64DD2)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y3.i32 == 0xC000FDF3)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y4.i32 == 0xC12444D0)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y5.i32 == 0xC09FD07C)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y6.i32 == 0x413738EE)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y7.i32 == 0xC1072A99)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y8.i32 == 0xC07F0068)? PASS_COUNT++ : FAIL_COUNT++;						

/*-----------------------------------------------------------------------------
 * CLA Task 2: Multiplication and inverse
 * --------------------------------------------------------------------------*/
   	vInitDataForTask2();
   	Cla1ForceTask2andWait();
   	WAITSTEP;
   	(sCLAtoCPUMsg.y1.i32 == 0x40F60EFF)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y2.i32 == 0xC19EACED)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y3.i32 == 0xC1869C0B)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y4.i32 == 0x41B31040)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y5.i32 == 0x3F4F5F13)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y6.i32 == 0x3E246678)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y7.i32 == 0x3EF0B127)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y8.i32 == 0xBDDBA4BD)? PASS_COUNT++ : FAIL_COUNT++;
/*-----------------------------------------------------------------------------
 * CLA Task 3: Saturate upto either minimum or maximum values
 * --------------------------------------------------------------------------*/
   	vInitDataForTask3();
   	Cla1ForceTask3andWait();
   	WAITSTEP;
   	(sCLAtoCPUMsg.y1.i32 == 0x3F9E0419)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y2.i32 == 0xC1152FEC)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y3.i32 == 0xC0A76A16)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y4.i32 == 0xC0E404EA)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y5.i32 == 0x40C75183)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y6.i32 == 0x4008240B)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y7.i32 == 0x404DD639)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y8.i32 == 0xC049096C)? PASS_COUNT++ : FAIL_COUNT++;
/*-----------------------------------------------------------------------------
 * CLA Task 4: Saturate beyond a lower or upper bound
 * --------------------------------------------------------------------------*/
   	vInitDataForTask4();
   	Cla1ForceTask4andWait();
   	WAITSTEP;
   	(sCLAtoCPUMsg.y1.i32 == 0x3F9E0419)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y2.i32 == 0x00000000)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y3.i32 == 0x40082C3D)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y4.i32 == 0xC1220275)? PASS_COUNT++ : FAIL_COUNT++;
  
/*-----------------------------------------------------------------------------
 * CLA Task 5: Offset subtraction with zero saturation and absolute values
 * --------------------------------------------------------------------------*/
   	vInitDataForTask5();
   	Cla1ForceTask5andWait();
   	WAITSTEP;
   	(sCLAtoCPUMsg.y1.i32 == 0x3F9E075F)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y2.i32 == 0x3DFC84B6)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y3.i32 == 0x4047F62B)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y4.i32 == 0x3CA30553)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y5.i32 == 0x3F8E3F13)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y6.i32 == 0x00000000)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y7.i32 == 0x00000000)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y8.i32 == 0x40900000)? PASS_COUNT++ : FAIL_COUNT++;
/*-----------------------------------------------------------------------------
 * CLA Task 6: IQ24 to float with some arithmetic and then back to IQ24
 * --------------------------------------------------------------------------*/
   	vInitDataForTask6();
   	Cla1ForceTask6andWait();
   	WAITSTEP;
   	(sCLAtoCPUMsg.y1.i32 == 0x015B9F54)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y2.i32 == 0xFCDB0F2C)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y3.i32 == 0x0A5821B0)? PASS_COUNT++ : FAIL_COUNT++;
   	(sCLAtoCPUMsg.y4.i32 == 0x00000000)? PASS_COUNT++ : FAIL_COUNT++;
	
/*-----------------------------------------------------------------------------
 * CLA Task 7: Conditional execution. Setting the GOTOLABELx macros in the
 * 				CLAShared.h file will cause the execution in this task to go 
 * 				to label x.
 * 				NOTE: If setting GOTOLABELx to 1 set the other macros (GOTOLABELy)
 * 				to 0
 * --------------------------------------------------------------------------*/
   	vInitDataForTask7();
   	Cla1ForceTask7andWait();
   	WAITSTEP;
#if		GOTOLABEL7
	(sCLAtoCPUMsg.y1.f32 == 7.0)? PASS_COUNT++ : FAIL_COUNT++;
#endif
#if		GOTOLABEL8
	(sCLAtoCPUMsg.y1.f32 == 6.0)? PASS_COUNT++ : FAIL_COUNT++;
#endif
#if		GOTOLABEL9
	(sCLAtoCPUMsg.y1.f32 == 5.0)? PASS_COUNT++ : FAIL_COUNT++;
#endif
#if		GOTOLABEL10
	(sCLAtoCPUMsg.y1.f32 == 4.0)? PASS_COUNT++ : FAIL_COUNT++;
#endif
#if		GOTOLABEL11
	(sCLAtoCPUMsg.y1.f32 == 3.0)? PASS_COUNT++ : FAIL_COUNT++;
#endif
#if		GOTOLABEL12
	(sCLAtoCPUMsg.y1.f32 == 2.0)? PASS_COUNT++ : FAIL_COUNT++;
#endif
#if		GOTOLABEL13
	(sCLAtoCPUMsg.y1.f32 == 1.0)? PASS_COUNT++ : FAIL_COUNT++;
#endif
#if		GOTOLABEL14
	(sCLAtoCPUMsg.y1.f32 == 0.0)? PASS_COUNT++ : FAIL_COUNT++;
#endif
/*-----------------------------------------------------------------------------
 * CLA Task 8: 
 * --------------------------------------------------------------------------*/
   	vInitDataForTask8();
   	Cla1ForceTask8andWait();
   	WAITSTEP;

   asm(" ESTOP0");
}
示例#8
0
void main(void)
{
 //  union F32_I32 temp;
   DisableDog();                // Disable the watchdog

//-------------------------------------------------------------
// CLA module initialization
// 1) Enable the CLA clock
// 2) Init the CLA interrupt vectors
// 3) Allow the IACK instruction to flag a CLA interrupt/start a task
// 4) Assign CLA program memory to the CLA
// 5) Enable CLA interrupts (MIER)
//
// Note: As provided, the linker .cmd file links the CLA assembly
//       code directly to the CLA program memory.
//       This way the debugger will load the CLA assembly code
//       into the program memory.  (No need to copy the CLA code
//       during debug).
//
//-------------------------------------------------------------

   EALLOW;
   SysCtrlRegs.PCLKCR3.bit.CLA1ENCLK = 1;
   Cla1Regs.MVECT1 = (Uint16) (&Cla1Task1 - &Cla1Prog_Start)*sizeof(Uint32);
   Cla1Regs.MVECT2 = (Uint16) (&Cla1Task2 - &Cla1Prog_Start)*sizeof(Uint32);
   Cla1Regs.MVECT3 = (Uint16) (&Cla1Task3 - &Cla1Prog_Start)*sizeof(Uint32);
   Cla1Regs.MVECT4 = (Uint16) (&Cla1Task4 - &Cla1Prog_Start)*sizeof(Uint32);
   Cla1Regs.MVECT5 = (Uint16) (&Cla1Task5 - &Cla1Prog_Start)*sizeof(Uint32);
   Cla1Regs.MVECT6 = (Uint16) (&Cla1Task6 - &Cla1Prog_Start)*sizeof(Uint32);
   Cla1Regs.MVECT7 = (Uint16) (&Cla1Task7 - &Cla1Prog_Start)*sizeof(Uint32);
   Cla1Regs.MVECT8 = (Uint16) (&Cla1Task8 - &Cla1Prog_Start)*sizeof(Uint32);
   Cla1Regs.MCTL.bit.IACKE = 1;
   Cla1Regs.MMEMCFG.bit.PROGE = 1;
   Cla1Regs.MMEMCFG.bit.RAM1E = 1;
   asm("  RPT #3 || NOP");
   Cla1Regs.MIER.bit.INT1 = 1;
   Cla1Regs.MIER.bit.INT2 = 1;
   Cla1Regs.MIER.bit.INT3 = 1;
   Cla1Regs.MIER.bit.INT4 = 1;
   Cla1Regs.MIER.bit.INT5 = 1;
   Cla1Regs.MIER.bit.INT6 = 1;
   Cla1Regs.MIER.bit.INT7 = 1;
   Cla1Regs.MIER.bit.INT8 = 1;
   EDIS;
//-------------------------------------------------------------
// All tests performed with rounding off (RNDF32=0)
//-------------------------------------------------------------

//-------------------------------------------------------------
// Test 1:
//-------------------------------------------------------------
   	CpuToCla1Msg.x1 = 0.0;      

   // Force Task 1 by the IACK instruction
   // Wait for the task to complete
   // This macro is defined in the Cla_Defines.h file

   	Cla1ForceTask1andWait()
	y_x1=Cla1ToCpuMsg.y1.f32;
  

//-------------------------------------------------------------
// Test 2:
//-------------------------------------------------------------
   
   	CpuToCla1Msg.x2 = 5;  
                                

   // Force Task 2 by the IACK instruction
   // Wait for the task to complete
   // This macro is defined in the Cla_Defines.h file

   	Cla1ForceTask2andWait()
	y_x2=Cla1ToCpuMsg.y2.f32;
   
//-------------------------------------------------------------
// Test 3:
//-------------------------------------------------------------
          // Force +0.0
   	CpuToCla1Msg.x3 = 1.1;  
                                

   // Force Task 3 by the IACK instruction
   // Wait for the task to complete
   // This macro is defined in the Cla_Defines.h file

   	Cla1ForceTask3andWait()
	y_x3=Cla1ToCpuMsg.y3.f32;  
//-------------------------------------------------------------
// Test 4:
//-------------------------------------------------------------
 
	CpuToCla1Msg.x4 = -2.9;  
                                

   // Force Task 4 by the IACK instruction
   // Wait for the task to complete
   // This macro is defined in the Cla_Defines.h file

   	Cla1ForceTask4andWait()
	y_x4=Cla1ToCpuMsg.y4.f32;  
//-------------------------------------------------------------
// Test 5:
//-------------------------------------------------------------

	CpuToCla1Msg.x5 = 35.111;  
                                

   // Force Task 5 by the IACK instruction
   // Wait for the task to complete
   // This macro is defined in the Cla_Defines.h file

   	Cla1ForceTask5andWait()
	y_x5=Cla1ToCpuMsg.y5.f32;  
//-------------------------------------------------------------
// start of test
//-------------------------------------------------------------
   chk1=1- y_x1;           
   chk2=(100000 - y_x2)/100000;
   chk3=12.589254118 - y_x3;    
   chk4=0.001258925411-y_x4;
   chk5=1.2912192736 - (y_x5/1e+35);

   if(chk1>=-10e-5 & chk1<=10e-5)
	   PASS_COUNT++;          // If all tests pass, this should equal golden value
    else
       FAIL_COUNT++;
   if(chk2>=-10e-5 & chk2<=10e-5)
	   PASS_COUNT++;          // If all tests pass, this should equal golden value
    else
       FAIL_COUNT++;
   if(chk3>=-10e-5 & chk3<=10e-5)
	   PASS_COUNT++;          // If all tests pass, this should equal golden value
    else
       FAIL_COUNT++;
   if(chk4>=-10e-5 & chk4<=10e-5)
       PASS_COUNT++;          // If all tests pass, this should equal golden value
    else
       FAIL_COUNT++;
   if(chk5>=-10e-5 & chk5<=10e-5)
       PASS_COUNT++;          // If all tests pass, this should equal golden value
    else
       FAIL_COUNT++;

   if(PASS_COUNT == GOLDEN_PASS_COUNT && FAIL_COUNT == 0)
   {
        // If test stopped here, it passed
        ESTOP0;
   }
   else
   {
        // If test stopped here, it failed
        ESTOP0;
   }

}
//
// CLA_runTest - Run task tests with specified vectors
//
void CLA_runTest(void)
{
    //
    //    vector1[5] =  {1.0,-11.3,6.2,10.8,2.5};
    //
    vector1[0] = 1.0;
    vector1[1] = -11.3;
    vector1[2] = 6.2;
    vector1[3] = 10.8;
    vector1[4] = 2.5;

    //
    //    vector2[10] = {-10.1,-9.9,-8.8,1.0,2.2,3.3,0.0,4.4,8.8,9.9}
    //
    vector2[0] = -10.1;
    vector2[1] = -9.9;
    vector2[2] = -8.8;
    vector2[3] = 1.0;
    vector2[4] = 2.2;
    vector2[5] = 3.3;
    vector2[6] = 0.0;
    vector2[7] = 4.4;
    vector2[8] = 8.8;
    vector2[9] = 9.9;

    Cla1ForceTask1andWait();

    Cla1ForceTask2andWait();

    Cla1ForceTask3andWait();

    Uint16 i;
    float vector1_gold[] = {-11.3, 1.0, 2.5, 6.2, 10.8};
    float vector2_gold[] = {9.9, 8.8, 4.4, 3.3, 2.2, 1.0, 0.0,-8.8,-9.9,-10.1};
    int32 vector3_gold[] = {9,8,4,3,2,1,0,-8,-9};

    for(i=0; i < LENGTH1; i++)
    {
        if(vector1_sorted[i] != vector1_gold[i])
        {
            fail++;
        }
        else
        {
            pass++;
        }
    }
    for(i=0; i < LENGTH2; i++)
    {
        if(vector2_sorted[i] != vector2_gold[i])
        {
            fail++;
        }
        else
        {
            pass++;
        }
    }

    //
    // Map the data memory back to the CPU so we can check the
    // results of task 3
    //
    EALLOW;
    MemCfgRegs.LSxMSEL.bit.MSEL_LS0 = 0;
    MemCfgRegs.LSxMSEL.bit.MSEL_LS1 = 0;
    EDIS;
   __asm("   NOP");
   __asm("   NOP");
   __asm("   NOP");
   __asm("   NOP");

    for(i=0; i < LENGTH3; i++)
    {
        if(vector3[i] != vector3_gold[i])
        {
            fail++;
        }
        else
        {
            pass++;
        }
    }
#if 0
    Cla1ForceTask4andWait();

    Cla1ForceTask5andWait();

    Cla1ForceTask6andWait();

    Cla1ForceTask7andWait();

    Cla1ForceTask8andWait();
#endif
}