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

Subversion Repositories xgate

[/] [xgate/] [trunk/] [sw/] [xgate_test_code/] [pc_rollover/] [pc_rollover.s] - Blame information for rev 101

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 101 rehayes
; 345678901234567890123456789012345678901234567890123456789012345678901234567890
2
; PC underflow/overflow test for xgate RISC processor core
3
; Bob Hayes - Jan 21 2012
4
 
5
 
6
        CPU     XGATE
7
 
8
;-------------------------------------------------------------------------------
9
;   Error Code - Program should never get here
10
;-------------------------------------------------------------------------------
11
        ORG     $0000 ;
12
_START_OF_MEM
13
        LDL     R2,#$04    ; Sent Message to Testbench Error Register
14
        LDH     R2,#$80
15
        LDL     R3,#$08
16
        STB     R3,(R2,#0)
17
 
18
        SIF
19
        RTS
20
 
21
        BRA     _START_OF_MEM  ; Final hex code for test will need hack
22
        BRA     _START_OF_MEM  ; Final hex code for test will need hack
23
        BRA     _START_OF_MEM  ; Final hex code for test will need hack
24
        BRA     _START_OF_MEM  ; Final hex code for test will need hack
25
        BRA     _START_OF_MEM  ; Final hex code for test will need hack
26
        BRA     _START_OF_MEM  ; Final hex code for test will need hack
27
        BRA     _START_OF_MEM  ; Final hex code for test will need hack
28
 
29
 
30
 
31
;-------------------------------------------------------------------------------
32
;   Backward branch past #$0000
33
;-------------------------------------------------------------------------------
34
        ORG     $0200 ;
35
_START3
36
        LDL     R2,#$00    ; Sent Message to Testbench Check Point Register
37
        LDH     R2,#$80
38
        LDL     R3,#$01
39
        STB     R3,(R2,#0)
40
        STB     R3,(R2,#2) ; Send Message to clear Testbench interrupt register
41
 
42
        BRA     _START_OF_MEM  ; Final hex code for test will need hack
43
 
44
 
45
;-------------------------------------------------------------------------------
46
; Dummy space to store initial variables for default interrupts
47
        ORG     $2000 ; with comment
48
 
49
V_PTR   DC.W    $0000  ; All Variable Pointers are set to here
50
 
51
        DC.W    $AAAA
52
        DS.W    8
53
        DC.B    $56
54
        DS.B    11
55
 
56
        ALIGN   1
57
 
58
;-------------------------------------------------------------------------------
59
;   Place where undefined interrupts go
60
;-------------------------------------------------------------------------------
61
_ERROR
62
        LDL     R2,#$04    ; Sent Message to Testbench Error Register
63
        LDH     R2,#$80
64
        LDL     R3,#$ff
65
        STB     R3,(R2,#0)
66
 
67
        SIF
68
        RTS
69
 
70
;-------------------------------------------------------------------------------
71
        ORG     $8800   ; $8000 reserved for testbench
72
        DC.W    $5555   ; reserve two words at channel 0
73
        DC.W    $AAAA
74
        ; channel 1
75
        DC.W    _START  ; point to start address
76
        DC.W    V_PTR   ; point to initial variables
77
        ; channel 2
78
        DC.W    _START2 ; point to start address
79
        DC.W    V_PTR   ; point to initial variables
80
        ; channel 3
81
        DC.W    _START3 ; point to start address
82
        DC.W    V_PTR   ; point to initial variables
83
        ; channel 4
84
        DC.W    _ERROR  ; point to start address
85
        DC.W    V_PTR   ; point to initial variables
86
        ; channel 5
87
        DC.W    _ERROR  ; point to start address
88
        DC.W    V_PTR   ; point to initial variables
89
        ; channel 6
90
        DC.W    _ERROR   ; point to start address
91
        DC.W    V_PTR   ; point to initial variables
92
 
93
;-------------------------------------------------------------------------------
94
        ORG     $fe00
95
        DC.W    $3c3c
96
        DC.W    $9696
97
        DC.W    $a5a5
98
        DC.W    $5a5a
99
        DC.W    $7878
100
        DC.W    $8181
101
 
102
;-------------------------------------------------------------------------------
103
;   Foward branch past #$ffff
104
;-------------------------------------------------------------------------------
105
        ORG     $FFC0 ;
106
_START2
107
        LDL     R2,#$00    ; Sent Message to Testbench Check Point Register
108
        LDH     R2,#$80
109
        LDL     R3,#$01
110
        STB     R3,(R2,#0)
111
        STB     R3,(R2,#2) ; Send Message to clear Testbench interrupt register
112
 
113
        BRA     _END_OFCODE  ; Final hex code for test will need hack
114
 
115
 
116
;-------------------------------------------------------------------------------
117
;   Test PC single step past #$ffff
118
;-------------------------------------------------------------------------------
119
        ORG     $FFE8 ;
120
_START
121
        LDL     R2,#$00    ; Sent Message to Testbench Check Point Register
122
        LDH     R2,#$80
123
        LDL     R3,#$01
124
        STB     R3,(R2,#0)
125
        STB     R3,(R2,#2) ; Send Message to clear Testbench interrupt register
126
 
127
        NOP
128
        NOP
129
        NOP
130
        NOP
131
        NOP
132
_END_OFCODE
133
        NOP
134
 
135
 

powered by: WebSVN 2.1.0

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