tests 9.03 KB
# Boot code tests are defined here.
#
# To run all tests:
#
#   run_tests.pl -t tests -d <test_out_dir>
#
#   where: 
#     test_out_dir is the output directory for the test
#     data that is generated, and the simulator logs, for
#     each test.
# 
# Format:
#
#   Lines beginning with '#' are comments, and blank lines are ignored.
#   Also, lines not matching the a correct test parameter string 
#   (defined below) are ignored.
#
#   The tests are described by parameters entered on successive lines.
#   Each new set of test parameters that define a test begins with a 
#   line containing the test name parameter, in the format:
#
#      test name: <test name>
#
#   The set of test parameters for a particular test is ended by a 
#   paramater with format:
#
#      expected result: <result>
#
#   where the valid values for <result> are: success, fatal, exception.
#
#   Between these lines, a number of lines may be present which describe
#   the test. The valid lines are described below.
#
#   To indicate ecc errors (single and double bit), block errors and
#   hash errors:
#
#      psk params: <params to psk_tool program>
#
#   where the usage of psk_tool is described by the command
#   .../bbboot/psk/psk_tool -h
#
#   To control the simulator clock speed and div mode settings:
#
#      simulator start params: <params to sim.cpu>
#
#   To control module insertion and removal:
#
#      module state file: <file in mdio.dat format to use>
#
#   To provide an external command to process the log and insure
#   specified patterns are as expected:
#
#      external check: <external command with options>
#
#   where <external command with options is the command to run,
#   with any options it requires. Note that the run_tests.pl script
#   will add the last two arguments to the command: (i) name of log
#   file to parse; (ii) address used for TRACE output.
#         

# default boardid is 0x000: 62.5MHz, div mode x1

# perfect conditions
test name: Perfect Conditions
psk params: 
simulator start params: +boardid=0x000
module state file:  mdio_in.dat
expected result: success

# block zero bad
#  trace check should show 0x009a at least twice
test name: Bad Block zero
psk params: -b 0
simulator start params: +boardid=0x000
module state file: mdio_in.dat
external check: logcheck.pl -p 0x009a0000,2+
expected result: success

# block 1 bad
#  trace check should show 0x009a at least twice
test name: Bad Block one
psk params: -b 1
simulator start params: +boardid=0x000
module state file: mdio_in.dat
external check: logcheck.pl -p 0x009a0000,2+
expected result: success

# half-page 0 double-bit ecc error
#  trace check should show 0x0042
test name: Double bit error, half page 0
psk params: -d 0
simulator start params: +boardid=0x000
module state file: mdio_in.dat
external check: logcheck.pl -p 0x00420000
expected result: fatal

# half-page 17 double-bit ecc error
#  trace check should show 0x0046
test name: Double bit error, half page 17
psk params: -d 17
simulator start params: +boardid=0x000
module state file: mdio_in.dat
external check: logcheck.pl -p 0x00460000
expected result: fatal

# half-page 32 double-bit ecc error
#  trace check should show 0x0046
test name: Double bit error, half page 32
psk params: -d 32
simulator start params: +boardid=0x000
module state file: mdio_in.dat
external check: logcheck.pl -p 0x00460000
expected result: fatal

# half-page 34 double-bit ecc error
#  trace check should show 0x0046
test name: Double bit error, half page 34
psk params: -d 34
simulator start params: +boardid=0x000
module state file: mdio_in.dat
external check: logcheck.pl -p 0x00460000
expected result: fatal

# half-page 127 double-bit ecc error
# THIS INSURES WE ARE LOADING THE FULL NUMBER OF PAGES
#  trace check should show 0x0046
test name: Double bit error, half page 127 (last) 
psk params: -d 127
simulator start params: +boardid=0x000
module state file: mdio_in.dat
external check: logcheck.pl -p 0x00460000
expected result: fatal

# half-page 1 single-bit ecc error
test name: Single bit error, half page 1
psk params: -s 1
simulator start params: +boardid=0x000
module state file: mdio_in.dat
expected result: success

# half-page 4 single-bit ecc error
test name: Single bit error, half page 4
psk params: -s 4
simulator start params: +boardid=0x000
module state file: mdio_in.dat
expected result: success

# code hash  error
#  trace check should see 0x0060 and NOT 0x0064
test name: Code hash error
psk params: -c
simulator start params: +boardid=0x000
module state file: mdio_in.dat
external check: logcheck.pl -p 0x00600000 -n 0x00640000
expected result: fatal

# module not present at first check, inserted later
#  trace check should see 0x0034
test name: Module out/in 1
psk params: 
simulator start params: +boardid=0x000
module state file: mdio_1.dat
external check: logcheck.pl -p 0x00340000
expected result: fatal

# module present during first check, removed
#    while searching for good block, inserted 0x800
#    sysclks later.
#  trace check should see 0x0043
test name: Module out/in 4
psk params: 
simulator start params: +boardid=0x000
module state file: mdio_4.dat
external check: logcheck.pl -p 0x00430000
expected result: fatal

# Module comes out during read which is NOT while 
#    searching for good block.
#  trace check should see 0x0047
test name: Module out during regular page read
psk params: 
simulator start params: +boardid=0x000
module state file:  mdio_5.dat
external check: logcheck.pl -p 0x00470000
expected result: fatal

# checksum error
test name: Checksum error, byte 22 
psk params: -k 22
simulator start params: +boardid=0x000
module state file:  mdio_in.dat
expected result: fatal

# checksum error
test name: Checksum error, byte 29 
psk params: -k 29
simulator start params: +boardid=0x000
module state file:  mdio_in.dat
expected result: fatal

# checksum error
test name: Checksum error, byte 100
psk params: -k 100
simulator start params: +boardid=0x000
module state file:  mdio_in.dat
expected result: fatal

# checksum error
test name: Checksum error, byte 200
psk params: -k 200
simulator start params: +boardid=0x000
module state file:  mdio_in.dat
expected result: fatal

# checksum error
test name: Checksum error, byte 252
psk params: -k 252
simulator start params: +boardid=0x000
module state file:  mdio_in.dat
expected result: fatal

# checksum error
test name: Checksum error, byte 253
psk params: -k 253
simulator start params: +boardid=0x000
module state file:  mdio_in.dat
expected result: fatal

# checksum error
test name: Checksum error, byte 254
psk params: -k 254
simulator start params: +boardid=0x000
module state file:  mdio_in.dat
expected result: fatal

# checksum error
test name: Checksum error, byte 255
psk params: -k 255
simulator start params: +boardid=0x0000
module state file:  mdio_in.dat
expected result: fatal


#
# NOTE: (mult * sysclk) must be < 150 MHz for tests to follow
#

# Div mode does not cause reset at 62.5MHz.
#  trace should not see 0x0020
test name: sysclk 62.5MHz, mult 1
psk params: 
simulator start params: +boardid=0x000
module state file:  mdio_in.dat
external check: logcheck.pl -n 0x00200000
expected result: success

# Div mode does cause reset at 62.5MHz.
#  trace should see 0x0020
test name: sysclk 62.5MHz, mult 1.5
psk params: 
simulator start params: +boardid=0x001
module state file:  mdio_in.dat
external check: logcheck.pl -p 0x00200000
expected result: success

# Div mode does cause reset at 62.5MHz.
#  trace should see 0x0020
test name: sysclk 62.5MHz, mult 2
psk params: 
simulator start params: +boardid=0x002
module state file:  mdio_in.dat
external check: logcheck.pl -p 0x00200000
expected result: success

# Div mode does not cause reset at 80.0MHz.
#  trace should not see 0x0020
test name: sysclk 80.0MHz, mult 1
psk params: 
simulator start params: +boardid=0x008
module state file:  mdio_in.dat
external check: logcheck.pl -n 0x00200000
expected result: success

# Div mode does cause reset at 80.0MHz.
#  trace should see 0x0020
test name: sysclk 80.0MHz, mult 1.5
psk params: 
simulator start params: +boardid=0x009
module state file:  mdio_in.dat
external check: logcheck.pl -p 0x00200000
expected result: success

# Div mode does not cause reset at 96MHz.
#  trace should not see 0x0020
test name: sysclk 96MHz, mult 1
psk params: 
simulator start params: +boardid=0x010
module state file:  mdio_in.dat
external check: logcheck.pl -n 0x00200000
expected result: success

# Div mode does cause reset at 96MHz.
#  trace should see 0x0020
test name: sysclk 96MHz, mult 1.5
psk params: 
simulator start params: +boardid=0x011
module state file:  mdio_in.dat
external check: logcheck.pl -p 0x00200000
expected result: success


# Div mode does not cause reset at extUSB 96MHz.
#  trace should not see 0x0020
test name: sysclk 96MHz, mult 1
psk params: 
simulator start params: +boardid=0x018
module state file:  mdio_in.dat
external check: logcheck.pl -n 0x00200000
expected result: success

# Div mode does cause reset at extUSB 96MHz.
#  trace should see 0x0020
test name: sysclk 96MHz, mult 1.5
psk params: 
simulator start params: +boardid=0x019
module state file:  mdio_in.dat
external check: logcheck.pl -p 0x00200000
expected result: success