/**	test_table_npa_56x4.c
 **
 ** Author: Ted Schmitz
 ** Date of original creation December 11, 2008
 **
 **     This file, among other things, contains the test table structure which
 ** in turn contains the addresses and paramaters for every executable subtest 
 ** under the diagnostic monitor's control for the NPA-56x4 AMC platform.
 **
 **/
#include "diag_mon.h"
#include "tests.h"

/****************************************************************************
 **                     Test Execution and Information Table
 **
 **     This table contains all the information required to execute the
 ** test as well as test results data for each test.  Each field is described
 ** below:
 ** TN          Test number of this subtest.
 ** BN          Block number of this test (If used).  This number represents the
 **             block of test groups for which this test is a member.  Blocks 
 **             are related groups of subtests.
 ** GN          Group number of this test.  This number represents the group
 **             of tests for which this subtest is a member.  Groups are a
 **             number of tests that are testing the same device or identical
 **             devices.  For example, all the tests that verify SRAM are in
 **             SRAM group and in the memory test block.
 ** Sel Fl      Select field.  This field determines if the test is selected
 **             for execution.  non-zero = selected, 00 = not selected.
 ** TT		Test type.  This value represents the high -level group in 
 **             which this subtest belongs such as: phase one, phase two, etc.
 ** TM		Test mode.  This value represents the mode of this subtest
 **		such as: non-intrusive, intrusive, loop back, etc.
 ** TP          Total passes.  This value is a count of how many time the
 **             test has been executed, not called.  (Remember some tests may
 **             be executed several times each time they are called).
 ** TF          Total failures.  This values is the number of times this test
 **             has failed.
 ** Test routine pointer
 **             This values contains the location of the test routine.
 ** Sign On message
 **             This field holds the actual sign-on message which identifies
 **             what the test verifies.  This then is the ASCII name of the
 **             subtest.
 **/
#ifdef STANDALONE
struct tests test_table[] =
  {
/*               Sel
  TN,   BN,  GN, Fl, TT,     TM,     TP, TF, Test pointer, Sign On message  
*/
/*  The following line is an exmaple of how to install the diagnostic subtests
    into the test table array.
  {1,   1,   1,  1,  TT_CA,  TM_NI,  0L, 0L, led_reg_test, LED_REG_TEST},*/
  {1,   1,   1,  1,  TT_CA,  TM_NI,  0L, 0L, test1, TEST1_MSG},
  {2,   1,   1,  1,  TT_CA,  TM_NI,  0L, 0L, test2, TEST2_MSG},
  {3,   1,   1,  1,  TT_CA,  TM_NI,  0L, 0L, test3, TEST3_MSG},
  {4,   1,   1,  1,  TT_CA,  TM_NI,  0L, 0L, test4, TEST4_MSG},
  {5,   1,   2,  1,  TT_CA,  TM_NI,  0L, 0L, test5, TEST5_MSG},
  {6,   1,   2,  1,  TT_CA,  TM_NI,  0L, 0L, test6, TEST6_MSG},
  {7,   1,   2,  1,  TT_CA,  TM_IN,  0L, 0L, test7, TEST7_MSG},
  {8,   1,   2,  1,  TT_CA,  TM_IN,  0L, 0L, test8, TEST8_MSG},
  {9,   1,   2,  1,  TT_CA,  TM_IN,  0L, 0L, test9, TEST9_MSG},
  {10,  1,   3,  1,  TT_CA,  TM_PR,  0L, 0L, test10,TEST10_MSG},
  {11,  1,   3,  1,  TT_CA,  TM_PR,  0L, 0L, test11,TEST11_MSG},
  {12,  1,   3,  1,  TT_CA,  TM_PR,  0L, 0L, test12,TEST12_MSG},
  {13,  1,   3,  1,  TT_CA,  TM_PR,  0L, 0L, test13,TEST13_MSG},
  {14,  1,   3,  1,  TT_CA,  TM_PR,  0L, 0L, test14,TEST14_MSG},
  {15,  1,   3,  1,  TT_CA,  TM_IN,  0L, 0L, test15,TEST15_MSG},
  {16,  2,   4,  1,  TT_I2C, TM_NI,  0L, 0L, test16,TEST16_MSG},
  {17,  2,   4,  1,  TT_I2C, TM_NI,  0L, 0L, test17,TEST17_MSG},
  {18,  2,   4,  1,  TT_I2C, TM_NI,  0L, 0L, test18,TEST18_MSG},
  {19,  2,   4,  1,  TT_I2C, TM_NI,  0L, 0L, test19,TEST19_MSG},
  {20,  2,   5,  1,  TT_I2C, TM_NI,  0L, 0L, test20,TEST20_MSG},
  {21,  2,   5,  1,  TT_I2C, TM_IN,  0L, 0L, test21,TEST21_MSG},
  {22,  3,   6,  1,  TT_EN,  TM_NI,  0L, 0L, test22,TEST22_MSG},
  {23,  3,   6,  1,  TT_EN,  TM_NI,  0L, 0L, test23,TEST23_MSG},
  {24,  3,   6,  1,  TT_EN,  TM_NI,  0L, 0L, test24,TEST24_MSG},
  {25,  3,   6,  1,  TT_EN,  TM_NI,  0L, 0L, test25,TEST25_MSG},
  {26,  3,   7,  1,  TT_EN,  TM_NI,  0L, 0L, test26,TEST26_MSG},
  {27,  3,   7,  1,  TT_EN,  TM_IN,  0L, 0L, test27,TEST27_MSG},
  {28,  3,   7,  1,  TT_EN,  TM_IN,  0L, 0L, test28,TEST28_MSG},
  {29,  4,   8,  1,  TT_FA,  TM_NI,  0L, 0L, test29,TEST29_MSG},
  {30,  4,   8,  1,  TT_FA,  TM_NI,  0L, 0L, test30,TEST30_MSG},
  {31,  4,   8,  1,  TT_FA,  TM_NI,  0L, 0L, test31,TEST31_MSG},
  {32,  4,   8,  1,  TT_FA,  TM_NI,  0L, 0L, test32,TEST32_MSG},
  {33,  4,   8,  1,  TT_FA,  TM_NI,  0L, 0L, test33,TEST33_MSG},
  {34,  4,   9,  1,  TT_FA,  TM_NI,  0L, 0L, test34,TEST34_MSG},
  {35,  4,   9,  1,  TT_FA,  TM_IN,  0L, 0L, test35,TEST35_MSG},
  {36,  4,   10, 1,  TT_FA,  TM_IN,  0L, 0L, test36,TEST36_MSG},
  {37,  4,   10, 1,  TT_FA,  TM_LB,  0L, 0L, test37,TEST37_MSG},
  {38,  4,   10, 1,  TT_FA,  TM_LB,  0L, 0L, test38,TEST38_MSG},

  /* The next entry terminates the table. */
  {0L,  0L,  0L, 0L, 0L,     0L,     0L, 0L, 0L,           ""},
  };  /* end of test table */
#else
struct tests test_table[] =
  {
/*               Sel
  TN,   BN,  GN, Fl, TT,     TM,     TP, TF, Test pointer, Sign On message  
*/
/*  The following line is an exmaple of how to install the diagnostic subtests
    into the test table array.
  {1,   1,   1,  1,  TT_CA,  TM_NI,  0L, 0L, led_reg_test, LED_REG_TEST},*/
  {1,   1,   1,  1,  TT_P1,  TM_NI,  0L, 0L, test1, TEST1_MSG},
  {2,   1,   2,  1,  TT_P1,  TM_NI,  0L, 0L, test2, TEST2_MSG},
  {3,   1,   3,  1,  TT_P1,  TM_NI,  0L, 0L, test3, TEST3_MSG},
  {4,   1,   4,  1,  TT_P1,  TM_NI,  0L, 0L, data_lines_test, TEST4_MSG},
  {5,   1,   4,  1,  TT_P1,  TM_NI,  0L, 0L, address_lines_test, TEST5_MSG},
  {6,   1,   4,  1,  TT_P1,  TM_NI,  0L, 0L, ram_cells_test, TEST6_MSG},
  {7,   1,   4,  1,  TT_P1,  TM_IN,  0L, 0L, test7, TEST7_MSG},
  {8,   1,   12, 1,  TT_P1,  TM_IN,  0L, 0L, ph1_err_logic_test, TEST8_MSG},
  {9,   1,   4,  1,  TT_P1,  TM_IN,  0L, 0L, test9, TEST9_MSG},
  {10,  1,   5,  1,  TT_P2,  TM_PR,  0L, 0L, test_passed,TEST10_MSG},
  {11,  1,   6,  1,  TT_P2,  TM_PR,  0L, 0L, fpga_ram_test,TEST11_MSG},
  //{12,  1,   7,  1,  TT_P2,  TM_PR,  0L, 0L, test12_spin_wheel,TEST12_MSG},
  {12,  1,   7,  1,  TT_P2,  TM_PR,  0L, 0L, i2c_dev_ack_test,TEST12_MSG},
  {13,  1,   7,  1,  TT_P2,  TM_PR,  0L, 0L, test_passed,TEST13_MSG},
  {14,  1,   12, 1,  TT_P2,  TM_PR,  0L, 0L, ph2_err_logic_test,TEST14_MSG},
  //{14,  1,   12, 1,  TT_P2,  TM_PR,  0L, 0L, test14,TEST14_MSG},
  {15,  1,   7,  1,  TT_P2,  TM_IN,  0L, 0L, test_passed,TEST15_MSG},
  {16,  2,   7,  1,  TT_P2,  TM_NI,  0L, 0L, test_passed,TEST16_MSG},
  {17,  2,   8,  1,  TT_P2,  TM_NI,  0L, 0L, test_passed,TEST17_MSG},
  {18,  2,   8,  1,  TT_P2,  TM_NI,  0L, 0L, test18_spin_wheel,TEST18_MSG},
  {19,  2,   9,  1,  TT_P2,  TM_NI,  0L, 0L, test19_spin_wheel,TEST19_MSG},
  //{20,  2,   9,  1,  TT_P2,  TM_NI,  0L, 0L, ll_eth_controller_test,TEST20_MSG},
  {20,  2,   9,  1,  TT_P2,  TM_NI,  0L, 0L, test_passed,TEST20_MSG},
  //{21,  2,   4,  1,  TT_P2,  TM_IN,  0L, 0L, dma_test,TEST21_MSG},
  {21,  2,   9,  1,  TT_P2,  TM_IN,  0L, 0L, test21_spin_wheel,TEST21_MSG},
  {22,  3,   9,  1,  TT_P2,  TM_NI,  0L, 0L, test22_spin_wheel,TEST22_MSG},
  {23,  3,   4,  1,  TT_P2,  TM_NI,  0L, 0L, test_passed,TEST23_MSG},
  {24,  3,   10, 1,  TT_P2,  TM_NI,  0L, 0L, test_passed,TEST24_MSG},
  {25,  3,   8,  1,  TT_P2,  TM_NI,  0L, 0L, test25_spin_wheel,TEST25_MSG},
  {26,  3,   11, 1,  TT_P2,  TM_NI,  0L, 0L, h8_fpga_dp_ram_test,TEST26_MSG},
  {27,  3,   12, 1,  TT_P2,  TM_NI,  0L, 0L, h8_error_logic_test,TEST27_MSG},
  {28,  3,   12, 1,  TT_P2,  TM_NI,  0L, 0L, pm_data_lines_test,TEST28_MSG},
  {29,  3,   12, 1,  TT_P2,  TM_NI,  0L, 0L, pm_address_lines_test,TEST29_MSG},
  {30,  3,   12, 1,  TT_P2,  TM_NI,  0L, 0L, pm_cells_test,TEST30_MSG},

  /* The next entry terminates the table. */
  {0L,  0L,  0L, 0L, 0L,     0L,     0L, 0L, 0L,           ""},
  };  /* end of test table */

#endif
/****************************************************************************
 **            
 ** 	Place the address of the tests that are to be disabled when the 
 ** "SDefaults" command is issued in following array.
 **
 ** NOTE:  Test function addresses are used instead of test numbers because
 **        if tests are re-arranged in the test table this array is no
 **        longer valid.  Tests *are* normally re-arranged from time-to-time.
 **
 **/
void * disabled_tests[] =
  {
  test1,
  test2,
  test8,
  test10,
  test11,
  test14,
  test16,
  test17,
  test18,
  test19,
  test22,
  test23,
  test24,
  test25,
  //test26,
  test33,
  test35,
  ph2_err_logic_test,
/* shared_sram_dlines_test,   <<<--- Example */
  0L,                   /* list terminator must be last value in array */
  };

/****************************************************************************
 **             User's Initialize Before Diagnostic Monitor Routine
 **
 **	This routine is used to call all code necessary before the diagnostic
 ** test monitor is invoked.  By default, this routine is supplied as an empty
 ** routine.  All of the diagnostic monitor default parameters have been set up
 ** by the time this function is called.
 **
 **	To use this feature, the user may enter code directly in the body of
 ** the function below or call any user supplied routine(s) necessary from the
 ** function below to set up hardware and or software before the diagnostic 
 ** monitor is invoked.
 **
 **/
void init_for_diag_mon(void)
{

}

/****************************************************************************
 **             User's Exit From Diagnostic Monitor Routine
 **
 **	This routine is used to call all code necessary just before the 
 ** diagnostic test monitor is terminated.  By default, this routine is
 ** supplied as an empty routine.
 **
 **	To use this feature, the user may enter code directly in the body of
 ** the function below or call any user supplied routine(s) necessary from the
 ** function below to reset the hardware and or clean up any software issues
 ** before the diagnostic monitor is terminated.
 **
 **/
void leaving_diag_mon(void)
{

}

