Line 7... |
Line 7... |
# project (http://opencores.org/project,plasma).
|
# project (http://opencores.org/project,plasma).
|
# COPYRIGHT: Software placed into the public domain by the original author.
|
# COPYRIGHT: Software placed into the public domain by the original author.
|
# Software 'as is' without warranty. Author liable for nothing.
|
# Software 'as is' without warranty. Author liable for nothing.
|
#
|
#
|
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
#
|
|
# This assembly file tests all of the opcodes supported by the Ion core.
|
# This assembly file tests all of the opcodes supported by the Ion core.
|
# This test assumes that address 0x20000000 is the UART write register.
|
# This test assumes that address 0x20000000 is the UART write register.
|
# Successful tests will print out "A" or "AB" or "ABC" or ....
|
# Successful tests will print out "A" or "AB" or "ABC" or ....
|
# Missing letters or letters out of order indicate a failure.
|
# Missing letters or letters out of order indicate a failure.
|
|
#
|
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
# NOTE: This test bench relies on the simulation logs to catch errors. That is,
|
# NOTE: This test bench relies on the simulation logs to catch errors. That is,
|
# unlike the original Plasma code, this one does not test the test success
|
# unlike the original Plasma code, this one does not test the test success
|
# conditions. instead, it performs the operations to be tested and relies on you
|
# conditions. instead, it performs the operations to be tested and relies on you
|
# to compare the logs from the logic simulation and the software simulation.
|
# to compare the logs from the logic simulation and the software simulation.
|
Line 30... |
Line 30... |
|
|
.set TEST_UNALIGNED_LOADS, 0 # unaligned loads
|
.set TEST_UNALIGNED_LOADS, 0 # unaligned loads
|
.set TEST_UNALIGNED_STORES, 0 # unaligned stores
|
.set TEST_UNALIGNED_STORES, 0 # unaligned stores
|
.set TEST_BREAK, 1 # BREAK instruction
|
.set TEST_BREAK, 1 # BREAK instruction
|
# WARNING: the assembler expands div instructions, see 'as' manual
|
# WARNING: the assembler expands div instructions, see 'as' manual
|
.set TEST_DIV, 0 # DIV* instructions
|
.set TEST_DIV, 1 # DIV* instructions
|
.set TEST_MUL, 0 # MUL* instructions
|
.set TEST_MUL, 1 # MUL* instructions
|
|
|
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
|
|
.text
|
.text
|
.align 2
|
.align 2
|
Line 731... |
Line 731... |
sb $23,0($20)
|
sb $23,0($20)
|
sb $21,0($20)
|
sb $21,0($20)
|
.endif
|
.endif
|
|
|
#q: SYSCALL
|
#q: SYSCALL
|
ori $2,$0,'q'
|
ori $2,$0,'q' # check if it jumpts to trap vector and comes back
|
sb $2,0($20)
|
sb $2,0($20)
|
ori $4,$0,61
|
ori $4,$0,61
|
syscall 0
|
syscall 0
|
addi $4,$4,-1
|
addi $4,$4,-1
|
sb $4,0($20)
|
sb $4,0($20)
|
|
|
|
syscall 0 # check if load instruction is aborted (@log)
|
|
lb $2,16($2)
|
|
|
|
syscall 0 # check if jump instruction is aborted (@log)
|
|
j syscall_jump_test1
|
|
add $4,$4,5
|
|
|
|
syscall_jump_test1:
|
|
add $4,$4,1 # make sure the jump shows in the log (@log)
|
|
|
|
# TODO traps in delay slots not supported yet
|
|
#j syscall_jump_test2 # check if syscall works in delay slot of jump
|
|
#break 0
|
|
nop
|
|
j syscall_continue
|
|
nop
|
|
|
|
syscall_jump_test2:
|
|
add $4,$4,1
|
|
|
|
syscall_continue:
|
sb $23,0($20)
|
sb $23,0($20)
|
sb $21,0($20)
|
sb $21,0($20)
|
|
|
|
|
######################################
|
######################################
|