-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISA V1.2 complete, unit tests completed, toolchain update
- Loading branch information
Showing
9 changed files
with
162 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
; unit test to provoke some BRAM borderline cases | ||
; done by sy2002 on August, 22nd 2015 | ||
; | ||
; the unit test executes correctly, if the TIL display is showing the | ||
; following sequence of numbers having about 1 sec delay in between | ||
; ABAB, CDCD, EFEF, ACDC, CCCC, ACDC, EFEF, CDCD, FFFF, .... (repeat) | ||
|
||
.ORG 0x0000 | ||
|
||
#include "../monitor/sysdef.asm" | ||
|
||
RAMEXE .EQU 0x8000 | ||
VARIABLE1 .EQU 0x80E0 | ||
STACK .EQU 0x80FF | ||
|
||
MOVE STACK, SP | ||
MOVE IO$TIL_BASE, R12 | ||
|
||
; copy part of the logic to RAM | ||
MOVE TORAM_END, R8 | ||
SUB TORAM_START, R8 | ||
MOVE TORAM_START, R9 | ||
MOVE RAMEXE, R10 | ||
ASUB COPY_CODE, 1 | ||
|
||
; create the first two numbers of the seq: ABAB and CDCD | ||
MOVE VARIABLE1, R0 | ||
MOVE 0xABAB, @R0 | ||
MOVE @R0++, R1 | ||
MOVE 0xCDCD, @R0 | ||
MOVE @R0++, R2 | ||
|
||
; create EFEF, ACDC, ACDC, EFEF, CDCD, FFFF | ||
; note that the "CCCC" is inserted in the display routine | ||
ASUB RAMEXE, 1 | ||
|
||
CONT_IN_ROM MOVE R1, @R12 | ||
ASUB WAIT_A_SEC, 1 | ||
MOVE R2, @R12 | ||
ASUB WAIT_A_SEC, 1 | ||
MOVE R3, @R12 | ||
ASUB WAIT_A_SEC, 1 | ||
MOVE R4, @R12 | ||
ASUB WAIT_A_SEC, 1 | ||
MOVE 0xCCCC, @R12 | ||
ASUB WAIT_A_SEC, 1 | ||
MOVE R5, @R12 | ||
ASUB WAIT_A_SEC, 1 | ||
MOVE R6, @R12 | ||
ASUB WAIT_A_SEC, 1 | ||
MOVE R7, @R12 | ||
ASUB WAIT_A_SEC, 1 | ||
MOVE R11, @R12 | ||
ASUB WAIT_A_SEC, 1 | ||
ABRA CONT_IN_ROM, 1 | ||
|
||
TORAM_START MOVE 0xEFEF, @R0 | ||
MOVE @R0++, R3 | ||
MOVE 0xACDC, @R0 | ||
MOVE @R0, R4 | ||
|
||
MOVE R4, R5 | ||
MOVE @--R0, R6 | ||
MOVE @--R0, R7 | ||
|
||
; intentionally strange to trigger some bram async reset | ||
MOVE @--R0, R11 | ||
MOVE R0, R10 | ||
MOVE R11, @R0++ | ||
MOVE 0x5454, @R0 | ||
MOVE @R0, @R0 | ||
ADD @R10, @R0 | ||
MOVE @R0, R11 | ||
RET | ||
TORAM_END .BLOCK 1 | ||
|
||
#include "debug_tools.asm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
; utility routines for debugging | ||
; sysdef.asm needs to be included before this | ||
; done by sy2002 in August 2015 | ||
|
||
; copy code from one memory destination (e.g. ROM) to another (e.g. RAM) | ||
; R8: amount of instruction words to copy | ||
; R9: src, R10: dst | ||
; | ||
; CAUTION FOR R8: if the last opcode consists of two words, then better | ||
; place the label one line later, e.g. to a .BLOCK 1 statement, otherwise | ||
; the second word of the last opcode will not be copied | ||
|
||
COPY_CODE MOVE @R9++, @R10++ ; copy from src to dst | ||
SUB 1, R8 ; one less item to go | ||
RBRA COPY_CODE, !N ; R0 is decremented one time too | ||
; much, so check for !N instead of | ||
; checking for !Z | ||
RET ; return from sub routine | ||
|
||
; sub routine to wait for about 1 second (assuming a ~10 MIPS operation) | ||
|
||
WAIT_A_SEC MOVE 0x1388, R8 ; inner wait cycles: 5.000 decimal | ||
MOVE 0x09C4, R9 ; outer wait cycles: 2.500 decimal | ||
RSUB WAIT_A_WHILE, 1 ; wait | ||
RET ; return from sub routine | ||
|
||
; sub routine to wait for R8 x R9 cycles | ||
|
||
WAIT_A_WHILE INCRB ; next register bank | ||
MOVE R9, R1 ; outer wait cycles | ||
WAS_WAIT_LOOP2 MOVE R8, R0 ; inner wait cycles | ||
WAS_WAIT_LOOP1 SUB 1, R0 ; dec inner wait cycles and ... | ||
RBRA WAS_WAIT_LOOP1, !Z ; ... repeat if not zero | ||
SUB 1, R1 ; dec outer wait cycles and ... | ||
RBRA WAS_WAIT_LOOP2, !Z ; ... repeat if not zero | ||
DECRB ; restore previous register bank | ||
RET ; return from sub routine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters