⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 led_endsimu.h

📁 OMAP1030 处理器的ARM 侧硬件测试代码 OMAP1030 是TI的双核处理器
💻 H
字号:
//-------------------------------------------------------------------------------
//            TEXAS INSTRUMENTS INCORPORATED PROPRIETARY INFORMATION
//
//   Property of Texas Instruments, For Unrestricted Internal Use Only
//   Unauthorized reproduction and/or distribution is strictly prohibited.
//   This product is protected under copyright law and trade secret law as an
//   unpublished work.
//   Created 2002, (C) Copyright 2002 Texas Instruments.  All rights reserved.
//
//   Created	   : 19th of August, 2002, 10.00pm
//
//   Filename        : hel2_endsimu_led.h
//
//   Description     : Header file for the ARM OMAP1610 Simulation End functions
//
//   Project         : HELEN2, OMAP1610, ARM926EJ-S
//
//   Author          : Dayo Adeyeye for Helen2 DFT LED production test
//
//   FUNCTIONS PROVIDED:
//
//   void EndSimulation_LED(UWORD32 gpio_base_addr)
//   void RES_Stop_Vhdl_LED(void)     => Stop VHDL simulator
//   void RES_Set_LED(const UWORD16 status)
//   void RES_SetLocation_LED(void)   => Set location address of the result area
//   void RES_GetFinal_LED(void)      => Evaluate Final Result
//   void RES_StopDPLL_VHDL(void)     => Stop DPLL & VHDL sims, wait 4 Dump LED
//   void RES_Exception_LED(void)     => combined test exception handler
//
//-------------------------------------------------------------------------------

#include <stdio.h>
#include <assert.h>

#ifndef _LED_ENDSIMU__HH
#define _LED_ENDSIMU__HH

#define RESULT_SIZE        128      //size of result
#define LAST_ITEM_POS     (RESULT_SIZE - 1)

#define DATA_STORE               0xF000
// The words which follows are data until we meet the END_ARRAY_DATA
#define START_ARRAY_DATA         0xF001 //findspy|print|$==$Start array of data&@|startarray|
#define END_ARRAY_DATA           0xF002 //findspy|print|End array of data&@$==$|endarray|
#define START_ARRAY_DATA_RESET   0xF003 //findspy|print|$==$Start array of data&@|startarray|
#define START_ARRAY_DATA_ACCESS  0xF004 //findspy|print|$==$Start array of data&@|startarray|
// An easy way to see that a test part succeed
#define TEST_OK                  0x8000 //findspy|print|Test OK&@|
// So, you look at the test part status. If the test part is OK it has the value TEST_OK (8000)

#define TEST_RESET_VALUE_SEPARATOR 0xAAA0 //findspy|print|$==$End of test reset value&@$==$
#define TEST_MODULE_SEPARATOR      0xAAA1 //findspy|print|$==$End of test module&@$==$
#define DATAEXPECTED_DATAREAD      0xAAA2 //findspy|2data|Data expected&@:|Data read&@:|
// An easy way to see that we change of section in a big test
#define RESULT_SEPARATOR           0xAAAA //findspy|print|$==$Result Separator&@$==$|
#define GLOBAL_TEST_SEPARATOR      0xAAAF //findspy|print|$==$End of Global test&@$==$

// Add a new range of test OK(The values Min and Max are outside of the bounds).
// These 2 values should not be used as they create some conflicts with findspy.
#define MIN_ARRAY_OK               0x77FF
#define MAX_ARRAY_OK               0x7FFF  // 0x7FFF - 0x77FF == 800 -> 2KBytes

#define RES_NOT_TRIED       0x0
#define RES_OK              0x1       //findspy|print|Test OK&@|
#define RES_BAD             0x2       //findspy|print|ERROR !
// Atleast one problem noticed by spy&@|
#define CURRENT_RES_NOT_OK  0x3       //findspy|print|Sorry !
// current test did not pass&@|
#define RES_THE_END         0xFFFF
#define RES_INIT_VAL        0xBABE
#define RES_ABORT_DATA 	    0xAB0D
#define ABORT_ERROR         0x7FFF

// #define GENERAL_FIQ_UNEXPECTED   0x04FD  //findspy|morecodefollows|Culprit IT&@:|
// #define GENERAL_IRQ_UNEXPECTED   0x04FE  //findspy|morecodefollows|Culprit IT&@:|
// #define GENERAL_ABORT_UNEXPECTED 0x04FF  //findspy|morecodefollows|Culprit IT&@:|
  
// =============================================================================
// Macro Name : ABORT_UNEXPECTED
// Description : In the test that do not use the abort, this macro can check
// an unexpected abort returning an error.
#define ABORT_UNEXPECTED()  RES_Set_LED(GENERAL_ABORT_UNEXPECTED);\
                            RES_GetFinal_LED();  \
                            RES_Stop_Vhdl_LED();
           
// ==============================================================================
// Macro Name : IRQ_UNEXPECTED
// Description : In the test that do not use the irq, this macro can check
// an unexpected irq returning an error and the irq number.
#define IRQ_UNEXPECTED()    RES_Set_LED(GENERAL_IRQ_UNEXPECTED);     \
                            RES_Set_LED(DATA_STORE);                  \
                            RES_Set_LED(INTH_GetCurrentInt(INTH_IRQ)); \
                            INTH_ValidNextInt(INTH_IRQ);
           
// =============================================================================
// Macro Name : FIQ_UNEXPECTED
// Description : In the test that do not use the fiq, this macro can check
// an unexpected fiq returning an error and the fiq number.
#define FIQ_UNEXPECTED()    RES_Set_LED(GENERAL_FIQ_UNEXPECTED);     \
                            RES_Set_LED(DATA_STORE);                  \
                            RES_Set_LED(INTH_GetCurrentInt(INTH_FIQ)); \
                            INTH_ValidNextInt(INTH_FIQ);

//------------------------------------------------------------------------------
// NAME        : EndSimulation_LED(UWORD32 gpio_base_addr)
// DESCRIPTION :
// PARAMETERS  : Input : UWORD32 gpio_base_addr
//               Output: None
// RETURN VALUE: None
// LIMITATIONS : None
//------------------------------------------------------------------------------
void EndSimulation_LED(UWORD32 gpio_base_addr);

/*------------------------------------------------------------------------------
 NAME        : RES_Set_LED
 DESCRIPTION : Set the value of a status to one the values below:
               RES_OK or RES_BAD or RES_THE_END or RES_NOT_TRIED
 PARAMETERS  : INPUT => Status to set
 RETURN VALUE: None
 LIMITATIONS : None
------------------------------------------------------------------------------*/
void RES_Set_LED(const UWORD16 status);

/*------------------------------------------------------------------------------
 NAME        : RES_Stop_Vhdl_LED
 DESCRIPTION : Call Boot_EndSimulation() function, then set THE_END into the
               last item of result area to stop VHDL simulator
 PARAMETERS  : None
 RETURN VALUE: None
 LIMITATIONS : None
------------------------------------------------------------------------------*/
void RES_Stop_Vhdl_LED(void);

/*------------------------------------------------------------------------------
 NAME        : RES_GetFinal_LED
 DESCRIPTION : Evaluate Final Result, also allow to have some more code as
               good ones. This function is especially done for the test of
	      reset values or the test register access
               This function allow to have the codes from MIN_ARRAY_OK to
               MAX_ARRAY_OK not to be error codes. These 2 constants are
               defined above. Scan the result array and set the first word to
               RES_NOT_TRIED, RES_BAD or RES_OK. LED signatures function
 PARAMETERS  : None
 RETURN VALUE: Return the final status value and global status of the test
 LIMITATIONS : Must be used at the end of test
------------------------------------------------------------------------------*/
UWORD16 RES_GetFinalLED(void);

/* -----------------------------------------------------------------------------
 NAME        : RES_SetLocation_LED
 DESCRIPTION : Set the location address of the result area values
 PARAMETERS  : INPUT => Start_address=Start Address of the Result area
 RETURN VALUE: None
 LIMITATIONS : None
------------------------------------------------------------------------------*/
void RES_SetLocationLED(const UWORD32 start_address);

//------------------------------------------------------------------------------
// NAME	      : RES_INIT_Result_LED
// DESCRIPTION : Initilize all the spy result memory (write 0xBABE).
// PARAMETERS  : None
// RETURN VALUE: None
// LIMITATIONS : Must be used before to start a test
// -----------------------------------------------------------------------------
void RES_INIT_Result_LED(void);

//------------------------------------------------------------------------------
// NAME        : RES_StopDPLL_VHDL(void)
// DESCRIPTION : Stop DPLL and VHDL sims and wait for Dump LED routine
// PARAMETERS  : Input : None
//               Output: None
// RETURN VALUE: None
// LIMITATIONS : None
//------------------------------------------------------------------------------
void RES_StopDPLL_VHDL(void);

//------------------------------------------------------------------------------
// NAME        : RES_Exception_LED(void)
// DESCRIPTION : CPU Exception occured,  combined test exception handler
// PARAMETERS  : Input : None
//               Output: None
// RETURN VALUE: None
// LIMITATIONS : None
//------------------------------------------------------------------------------
void RES_Exception_LED(void);


#endif /* _LED_ENDSIMU__HH */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -