OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [testsuite/] [libsim.tests/] [jtag-select-module.exp] - Rev 98

Compare with Previous | Blame | View Log

# jtag-select-module.exp. Tests of the library JTAG module selection

# Copyright (C) 2010 Embecosm Limited

# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>

# This file is part of OpenRISC 1000 Architectural Simulator.

# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.

# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.

# You should have received a copy of the GNU General Public License along
# with this program.  If not, see <http:#www.gnu.org/licenses/>.  */

# -----------------------------------------------------------------------------
# This code is commented throughout for use with Doxygen.
# -----------------------------------------------------------------------------


# These tests check all the module selection behavior. Behavior consequential
# on subsequent commands (WRITE_COMMAND, READ_COMMAND, GO_COMMAND_READ,
# GO_COMMAND_WRITE, READ_CONTROL and READ_CONTROL) appears in the test file
# for that command.

# NOTE. All these tests return timing information, but we ignore it, since in
#       general it will not be repeatable.

# Just check if we can reset
run_libsim "JTAG SELECT_MODULE reset"                \
    [list "Initalization succeeded."       \
          "Execution step completed OK."   \
          "Resetting JTAG."                \
          "Execution step completed OK."   \
          "Test completed successfully."]  \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET"

# Check instruction selection. Just a partial test. Comprehensive testing of
# this is in jtag-basic.exp
run_libsim "JTAG SELECT_MODULE EXTEST instr"    \
    [list "Initalization succeeded."       \
          "Execution step completed OK."   \
          "Resetting JTAG."                \
          "Execution step completed OK."   \
          "Shifting instruction."          \
          "  shifting in:  0x00"           \
          "Warning: JTAG EXTEST shifted"   \
          "  shifted out:  0x00"           \
          "  time taken: "                 \
          "Execution step completed OK."   \
          "Test completed successfully."]  \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "0"

run_libsim "JTAG SELECT_MODULE invalid instr"                  \
    [list "Initalization succeeded."                      \
          "Execution step completed OK."                  \
          "Resetting JTAG."                               \
          "Execution step completed OK."                  \
          "Shifting instruction."                         \
          "  shifting in:  0x0c"                          \
          "ERROR: Unknown JTAG instruction 0x3 shifted"   \
          "  shifted out:  0x0c"                          \
          "  time taken: "                                \
          "Execution step completed OK."                  \
          "Test completed successfully."]                 \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "3"

run_libsim "JTAG SELECT_MODULE DEBUG instr"    \
    [list "Initalization succeeded."      \
          "Execution step completed OK."  \
          "Resetting JTAG."               \
          "Execution step completed OK."  \
          "Shifting instruction."         \
          "  shifting in:  0x01"          \
          "  shifted out:  0x01"          \
          "  time taken: "                \
          "Execution step completed OK."  \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8"

# Comprehensive test of selecting all possible modules. Only Wishbone (0),
# CPU0 (1) and CPU1 (2) should work silently (although CPU1 will prompt
# warnings if subsequent GO commands are used). All other values will fail by
# setting the status field on response.

# Wishbone module select (0)
run_libsim "JTAG SELECT_MODULE SELECT_MODULE WB (0)"    \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x0000000000174841bc61" \
          "  shifted out:  0x0164841bc60000000000" \
          "  status:       0x0"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "0"

# CPU0 module select (1)
run_libsim "JTAG SELECT_MODULE SELECT_MODULE CPU0 (1)"  \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x00000000000aff51d871" \
          "  shifted out:  0x0164841bc60000000000" \
          "  status:       0x0"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "1"

# CPU1 module select (2)
run_libsim "JTAG SELECT_MODULE SELECT_MODULE CPU1 (2)"  \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x00000000001993c98e69" \
          "  shifted out:  0x0164841bc60000000000" \
          "  status:       0x0"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "2"

# All remaining modules should fail
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 3"         \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x00000000000424d9ea79" \
          "  shifted out:  0x01893c98e68000000000" \
          "  status:       0x2"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "3"

run_libsim "JTAG SELECT_MODULE SELECT_MODULE 4"         \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x0000000000102585a565" \
          "  shifted out:  0x01893c98e68000000000" \
          "  status:       0x2"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "4"

run_libsim "JTAG SELECT_MODULE SELECT_MODULE 5"         \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x00000000000d9295c175" \
          "  shifted out:  0x01893c98e68000000000" \
          "  status:       0x2"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "5"

run_libsim "JTAG SELECT_MODULE SELECT_MODULE 6"         \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x00000000001efe0d976d" \
          "  shifted out:  0x01893c98e68000000000" \
          "  status:       0x2"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "6"

run_libsim "JTAG SELECT_MODULE SELECT_MODULE 7"         \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x000000000003491df37d" \
          "  shifted out:  0x01893c98e68000000000" \
          "  status:       0x2"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "7"

run_libsim "JTAG SELECT_MODULE SELECT_MODULE 8"         \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x000000000014fea3b0e3" \
          "  shifted out:  0x01893c98e68000000000" \
          "  status:       0x2"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "8"

run_libsim "JTAG SELECT_MODULE SELECT_MODULE 9"         \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x00000000000949b3d4f3" \
          "  shifted out:  0x01893c98e68000000000" \
          "  status:       0x2"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "9"

run_libsim "JTAG SELECT_MODULE SELECT_MODULE 10"        \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x00000000001a252b82eb" \
          "  shifted out:  0x01893c98e68000000000" \
          "  status:       0x2"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "a"

run_libsim "JTAG SELECT_MODULE SELECT_MODULE 11"        \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x000000000007923be6fb" \
          "  shifted out:  0x01893c98e68000000000" \
          "  status:       0x2"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "b"

run_libsim "JTAG SELECT_MODULE SELECT_MODULE 12"        \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x0000000000139367a9e7" \
          "  shifted out:  0x01893c98e68000000000" \
          "  status:       0x2"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "c"

run_libsim "JTAG SELECT_MODULE SELECT_MODULE 13"        \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x00000000000e2477cdf7" \
          "  shifted out:  0x01893c98e68000000000" \
          "  status:       0x2"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "d"

run_libsim "JTAG SELECT_MODULE SELECT_MODULE 14"        \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x00000000001d48ef9bef" \
          "  shifted out:  0x01893c98e68000000000" \
          "  status:       0x2"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "e"

run_libsim "JTAG SELECT_MODULE SELECT_MODULE 15"        \
    [list "Initalization succeeded."               \
          "Execution step completed OK."           \
          "Resetting JTAG."                        \
          "Execution step completed OK."           \
          "Shifting instruction."                  \
          "  shifting in:  0x01"                   \
          "  shifted out:  0x01"                   \
          "  time taken: "                         \
          "Execution step completed OK."           \
          "Selecting module."                      \
          "  shifting in:  0x000000000000ffffffff" \
          "  shifted out:  0x01893c98e68000000000" \
          "  status:       0x2"                    \
          "  time taken:"                          \
          "Execution step completed OK."           \
          "Test completed successfully."] \
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
         "SELECT_MODULE" "f"

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.