| 1 |
93 |
jeremybenn |
# upcalls.exp. Test of the library upcall functions
|
| 2 |
|
|
|
| 3 |
|
|
# Copyright (C) 2010 Embecosm Limited
|
| 4 |
|
|
|
| 5 |
|
|
# Contributor Jeremy Bennett
|
| 6 |
|
|
|
| 7 |
|
|
# This file is part of OpenRISC 1000 Architectural Simulator.
|
| 8 |
|
|
|
| 9 |
|
|
# This program is free software; you can redistribute it and/or modify it
|
| 10 |
|
|
# under the terms of the GNU General Public License as published by the Free
|
| 11 |
|
|
# Software Foundation; either version 3 of the License, or (at your option)
|
| 12 |
|
|
# any later version.
|
| 13 |
|
|
|
| 14 |
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
| 15 |
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
| 16 |
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
| 17 |
|
|
# more details.
|
| 18 |
|
|
|
| 19 |
|
|
# You should have received a copy of the GNU General Public License along
|
| 20 |
|
|
# with this program. If not, see . */
|
| 21 |
|
|
|
| 22 |
|
|
# -----------------------------------------------------------------------------
|
| 23 |
|
|
# This code is commented throughout for use with Doxygen.
|
| 24 |
|
|
# -----------------------------------------------------------------------------
|
| 25 |
|
|
|
| 26 |
|
|
|
| 27 |
|
|
# Run the basic upcall test
|
| 28 |
|
|
run_libsim "upcalls - basic" \
|
| 29 |
|
|
[list "Initalization succeeded." \
|
| 30 |
|
|
"Setting alignment exception handler." \
|
| 31 |
|
|
"Writing registers." \
|
| 32 |
|
|
"Wrote byte at 0x98000000 = 0xde." \
|
| 33 |
|
|
"Wrote byte at 0x98000001 = 0xad." \
|
| 34 |
|
|
"Wrote byte at 0x98000002 = 0xbe." \
|
| 35 |
|
|
"Wrote byte at 0x98000003 = 0xef." \
|
| 36 |
|
|
"Wrote half word at 0x98000004 = 0xbaad." \
|
| 37 |
|
|
"Wrote half word at 0x98000006 = 0xf00d." \
|
| 38 |
|
|
"Wrote full word at 0x98000008 = 0xcafebabe." \
|
| 39 |
|
|
"Reading registers." \
|
| 40 |
|
|
"Read full word at 0x98000000 = 0xdeadbeef." \
|
| 41 |
|
|
"Read byte at 0x98000004 = 0xba." \
|
| 42 |
|
|
"Read byte at 0x98000005 = 0xad." \
|
| 43 |
|
|
"Read byte at 0x98000006 = 0xf0." \
|
| 44 |
|
|
"Read byte at 0x98000007 = 0x0d." \
|
| 45 |
|
|
"Read half word at 0x98000008 = 0xcafe." \
|
| 46 |
|
|
"Read half word at 0x9800000a = 0xbabe." \
|
| 47 |
|
|
"All done." \
|
| 48 |
|
|
"report(0xdeaddead);" \
|
| 49 |
|
|
"exit(0)"] \
|
| 50 |
|
|
"lib-upcalls/lib-upcalls" "upcalls.cfg" "upcalls/upcall-basic" \
|
| 51 |
|
|
"14" "32"
|
| 52 |
|
|
|
| 53 |
|
|
# Run the misalignment upcall test
|
| 54 |
|
|
run_libsim "upcalls - misaligned" \
|
| 55 |
|
|
[list "Initalization succeeded." \
|
| 56 |
|
|
"Setting alignment exception handler." \
|
| 57 |
|
|
"Writing registers." \
|
| 58 |
|
|
"Wrote byte at 0x98000000 = 0xde." \
|
| 59 |
|
|
"Wrote half word at 0x98000002 = 0xdead." \
|
| 60 |
|
|
"Writing half word at 0x98000005: misalignment exception." \
|
| 61 |
|
|
"Wrote full word at 0x98000008 = 0xdeadbeef." \
|
| 62 |
|
|
"Writing full word at 0x9800000d: misalignment exception." \
|
| 63 |
|
|
"Writing full word at 0x98000012: misalignment exception." \
|
| 64 |
|
|
"Writing full word at 0x98000017: misalignment exception." \
|
| 65 |
|
|
"Wrote full word at 0x9800001c = 0xbaadbabe." \
|
| 66 |
|
|
"Reading registers." \
|
| 67 |
|
|
"Read byte at 0x98000000 = 0xde." \
|
| 68 |
|
|
"Read half word at 0x98000002 = 0xdead." \
|
| 69 |
|
|
"Reading half word at 0x98000005: misalignment exception." \
|
| 70 |
|
|
"Read full word at 0x98000008 = 0xdeadbeef." \
|
| 71 |
|
|
"Reading full word at 0x9800000d: misalignment exception." \
|
| 72 |
|
|
"Reading full word at 0x98000012: misalignment exception." \
|
| 73 |
|
|
"Reading full word at 0x98000017: misalignment exception." \
|
| 74 |
|
|
"Read full word at 0x9800001c = 0xbaadbabe." \
|
| 75 |
|
|
"report(0xdeaddead);" \
|
| 76 |
|
|
"exit(0)"] \
|
| 77 |
|
|
"lib-upcalls/lib-upcalls" "upcalls.cfg" "upcalls/upcall-misaligned" \
|
| 78 |
|
|
"8" "32"
|