1 # frv testcase to generate reset interrupts
2 # mach: fr500 fr550 fr400
3 # sim: --memory-region 0xff000000,64
5 .include "testutils.inc"
11 and_spr_immed 0xfffffffb,psr ; turn off PSR.S
12 set_gr_immed 0xfeff0500,gr10 ; address of reset register
13 set_spr_immed 0x7fffffff,lcr
16 ; Can't recover from hardware interrupt with enough state intact to verify it
18 ; set_mem_immed 0x3,gr10 ; cause hardware reset
19 ; dcf @(gr10,gr0) ; Wait for store to happen
22 ;ok1: ; reset should branch to reset address which should then branch here
23 ; test_mem_immed 0x00000200,gr10
25 ; set_mem_immed 0x2,gr10 ; cause hardware reset
26 ; dcf @(gr10,gr0) ; Wait for store to happen
29 ok2: ; reset should branch to reset address which should then branch here
30 ; test_mem_immed 0x00000200,gr10
32 set_mem_immed 0x1,gr10 ; cause software reset
33 dcf @(gr10,gr0) ; Wait for store to happen
36 ok3: ; reset should branch to reset address which should then branch here
37 test_mem_immed 0x00000100,gr10
38 test_spr_bits 0x4,2,1,psr ; psr.s is set
39 test_spr_bits 0x2,1,0,psr ; psr.ps not set
41 set_mem_immed 0x0,gr10 ; no reset
42 test_mem_immed 0x0,gr10
44 ; now retest with HSR0.SA set
46 set_gr_addr 0xff000000,gr11
48 or_spr_immed 0x00001000,hsr0 ; set HSR0.SA
50 ; Can't recover from hardware interrupt with enough state intact to verify it
52 ; dcf @(gr10,gr0) ; Wait for store to happen
53 ; set_mem_immed 0x3,gr10 ; cause hardware reset
56 ;ok4: ; reset should branch to reset address which should then branch here
57 ; test_mem_immed 0x00000200,gr10
59 ; set_mem_immed 0x2,gr10 ; cause hardware reset
60 ; dcf @(gr10,gr0) ; Wait for store to happen
63 ok5: ; reset should branch to reset address which should then branch here
64 ; test_mem_immed 0x00000200,gr10
66 set_mem_immed 0x1,gr10 ; cause software reset
67 dcf @(gr10,gr0) ; Wait for store to happen
70 ok6: ; reset should branch to reset address which should then branch here
71 test_mem_immed 0x00000100,gr10
72 test_spr_bits 0x4,2,1,psr ; psr.s is set
73 test_spr_bits 0x2,1,1,psr ; psr.ps is set
75 set_mem_immed 0x0,gr10 ; no reset
76 test_mem_immed 0x0,gr10
80 bad: ; Should never get here