2 * set up pointers to valid data (32Meg), to reduce address violations
6 l0
= 0; l1
= 0; l2
= 0; l3
= 0;
7 p0
= r0
; p1
= r0
; p2
= r0
; p3
= r0
; p4
= r0
; p5
= r0
;
9 i0
= r0
; i1
= r0
; i2
= r0
; i3
= r0
;
10 b0
= r0
; b1
= r0
; b2
= r0
; b3
= r0
;
15 #elif SE_ALL_BITS == 16
18 # error "Please define SE_ALL_BITS"
22 * execute a test of an opcode space. host test
23 * has to fill out a number of callbacks.
26 * the first insn to start executing
28 * the table of insn ranges and expected seqstat
34 * load current user insn via register P5 into R0.
35 * register R2 is available for caching with se_all_next_insn.
40 * load insn range/seqstat entry from table via register P1
49 * advance current insn to next one for testing. register R2
50 * is retained from se_all_load_insn. write out new insn to
51 * the location via register P5.
53 * se_all_new_insn_stub
55 * for handling of new insns ... generally not needed once done
60 /* Set up exception handler */
65 /* set up the _location */
70 /* Enable single stepping */
74 /* Lower to the code we want to single step through */
78 /* set up pointers to valid data (32Meg), to reduce address violations */
89 /* Make sure exception reason is as we expect */
96 loadsym P4
, _location
;
104 /* is this the end of the table? */
106 IF CC jump _new_instruction
;
108 /* is the opcode (R0) greater than the 2nd entry in the table (R6) */
109 /* if so look at the next line in the table */
113 /* is the opcode (R0) smaller than the first entry in the table (R7) */
114 /* this means it's somewhere between the two lines, and should be legal */
116 if !CC jump _legal_instruction
;
118 /* is the current EXCAUSE (R3), the same as the table (R5) */
121 if !CC jump fail_lvl
;
124 /* back up, and store the location to search next */
127 /* it matches, so fall through */
128 jump _next_instruction
;
131 /* The table is generated in memory and can be extracted:
132 (gdb) dump binary memory bin &table next_location
135 $ od -j6 -x --width=4 bin | \
136 awk '{ s=last; e=strtonum("0x"$2); \
137 printf "\t.dw 0x%04x,\t0x%04x,\t\t0x%02x\n", \
138 s, e-1, strtonum("0x"seq); \
142 $ od -j12 -x --width=8 bin | \
143 awk '{ s=last; e=strtonum("0x"$3$2); \
144 printf "\t.dw 0x%04x, 0x%04x,\t0x%04x, 0x%04x,\t\t0x%02x, 0\n", \
145 and(s,0xffff), rshift(s,16), and(e-1,0xffff), rshift(e-1,16), \
149 This should be much faster than dumping over serial/jtag. */
152 /* output the insn (R0) and excause (R3) if diff from last */
153 loadsym P0
, _last_excause
;
156 IF CC jump _next_instruction
;
164 IF
!CC JUMP fail_lvl
;
165 /* it wasn't in the list, and was a single step, so fall through */
171 /* Make sure the opcode isn't in a write buffer */
178 /* set up pointers to valid data (32Meg), to reduce address violations */
188 loadsym P0
, fail_lvl
;
204 .macro se_all_load_table
210 #ifndef SE_ALL_NEW_INSN_STUB
211 .macro se_all_new_insn_stub
216 .macro se_all_new_insn_log
217 .ifdef BFIN_JTAG_xxxxx
219 #if SE_ALL_BITS == 32
233 loadsym P0
, _next_location
;