1 //Original:/proj/frio/dv/testcases/lmu/lmu_excpt_align/lmu_excpt_align.dsp
2 // Description: LMU data alignment exceptions
4 # sim: --environment operating
7 .include "testutils.inc"
10 include(selfcheck.inc)
14 CHECK_INIT(p5, 0xE0000000);
16 // test address for DAG0
17 // test address for DAG1
19 // setup interrupt controller with exception handler address
20 WR_MMR_LABEL(EVT3, handler, p0, r1);
22 // Write fault addr MMR to known state
23 WR_MMR(DCPLB_FAULT_ADDR, 0, p0, r6);
25 //nop;nop;nop;nop;nop; // in lieu of CSYNC
30 // go to user mode. and enable exceptions
35 // Nops to work around ICache bug
43 //-------------------------------------------------------
45 //-------------------------------------------------------
46 // 16-bit alignment, DAG0
50 LD32(i1, ((0x1000 + 1)));
51 LD32(p2, ((0x1000 + 1) & 0xFFFFFFFE)); // Aligned version
53 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
55 X01: W [ I1 ] = R1.L; // Exception should occur here
57 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
58 CHECKREG(r6, (0x1000 + 1)); // FAULT_ADDR should contain fail address
59 CHECKREG_SYM(r7, X01, r0); // RETX should be value of X01 (HARDCODED ADDR!!)
62 //-------------------------------------------------------
63 // 32-bit alignment, DAG0
67 LD32(i1, ((0x1000 + 1)));
68 LD32(p2, ((0x1000 + 1) & 0xFFFFFFFC)); // Aligned version
70 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
72 X02: [ I1 ] = R1; // Exception should occur here
74 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
75 CHECKREG(r6, (0x1000 + 1)); // FAULT_ADDR should contain fail address
76 CHECKREG_SYM(r7, X02, r0); // RETX should be value of X02 (HARDCODED ADDR!!)
79 //-------------------------------------------------------
80 // 32-bit alignment, DAG0
84 LD32(i1, ((0x1000 + 2)));
85 LD32(p2, ((0x1000 + 2) & 0xFFFFFFFC)); // Aligned version
87 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
89 X03: [ I1 ] = R1; // Exception should occur here
91 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
92 CHECKREG(r6, (0x1000 + 2)); // FAULT_ADDR should contain fail address
93 CHECKREG_SYM(r7, X03, r0); // RETX should be value of X03 (HARDCODED ADDR!!)
96 //-------------------------------------------------------
97 // 32-bit alignment, DAG0
101 LD32(i1, ((0x1000 + 3)));
102 LD32(p2, ((0x1000 + 3) & 0xFFFFFFFC)); // Aligned version
103 LD32(r1, 0xDEADBEEF);
104 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
106 X04: [ I1 ] = R1; // Exception should occur here
108 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
109 CHECKREG(r6, (0x1000 + 3)); // FAULT_ADDR should contain fail address
110 CHECKREG_SYM(r7, X04, r0); // RETX should be value of X04 (HARDCODED ADDR!!)
113 //-------------------------------------------------------
114 // 16-bit alignment, DAG1
118 LD32(i1, ((0x1000 + 1)));
119 LD32(p2, ((0x1000 + 1) & 0xFFFFFFFE)); // Aligned version
120 LD32(r1, 0xDEADBEEF);
121 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
123 X05: A0 = 0 || NOP || W [ I1 ] = R1.L; // Exception should occur here
125 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
126 CHECKREG(r6, (0x1000 + 1)); // FAULT_ADDR should contain fail address
127 CHECKREG_SYM(r7, X05, r0); // RETX should be value of X05 (HARDCODED ADDR!!)
130 //-------------------------------------------------------
131 // 32-bit alignment, DAG1
135 LD32(i1, ((0x1000 + 1)));
136 LD32(p2, ((0x1000 + 1) & 0xFFFFFFFC)); // Aligned version
137 LD32(r1, 0xDEADBEEF);
138 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
140 X06: A0 = 0 || NOP || [ I1 ] = R1; // Exception should occur here
142 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
143 CHECKREG(r6, (0x1000 + 1)); // FAULT_ADDR should contain fail address
144 CHECKREG_SYM(r7, X06, r0); // RETX should be value of X06 (HARDCODED ADDR!!)
147 //-------------------------------------------------------
148 // 32-bit alignment, DAG1
152 LD32(i1, ((0x1000 + 2)));
153 LD32(p2, ((0x1000 + 2) & 0xFFFFFFFC)); // Aligned version
154 LD32(r1, 0xDEADBEEF);
155 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
157 X07: A0 = 0 || NOP || [ I1 ] = R1; // Exception should occur here
159 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
160 CHECKREG(r6, (0x1000 + 2)); // FAULT_ADDR should contain fail address
161 CHECKREG_SYM(r7, X07, r0); // RETX should be value of X07 (HARDCODED ADDR!!)
164 //-------------------------------------------------------
165 // 32-bit alignment, DAG1
169 LD32(i1, ((0x1000 + 3)));
170 LD32(p2, ((0x1000 + 3) & 0xFFFFFFFC)); // Aligned version
171 LD32(r1, 0xDEADBEEF);
172 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
174 X08: A0 = 0 || NOP || [ I1 ] = R1; // Exception should occur here
176 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
177 CHECKREG(r6, (0x1000 + 3)); // FAULT_ADDR should contain fail address
178 CHECKREG_SYM(r7, X08, r0); // RETX should be value of X08 (HARDCODED ADDR!!)
181 //-------------------------------------------------------
182 // Now repeat for Loads
183 //-------------------------------------------------------
184 // 16-bit alignment, DAG0
188 LD32(i1, ((0x1000 + 1)));
189 LD32(p2, ((0x1000 + 1) & 0xFFFFFFFE)); // Aligned version
190 LD32(r1, 0xDEADBEEF);
191 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
193 X11: R1.L = W [ I1 ]; // Exception should occur here
195 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
196 CHECKREG(r6, (0x1000 + 1)); // FAULT_ADDR should contain fail address
197 CHECKREG_SYM(r7, X11, r0); // RETX should be value of X11 (HARDCODED ADDR!!)
200 //-------------------------------------------------------
201 // 32-bit alignment, DAG0
205 LD32(i1, ((0x1000 + 1)));
206 LD32(p2, ((0x1000 + 1) & 0xFFFFFFFC)); // Aligned version
207 LD32(r1, 0xDEADBEEF);
208 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
210 X12: R1 = [ I1 ]; // Exception should occur here
212 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
213 CHECKREG(r6, (0x1000 + 1)); // FAULT_ADDR should contain fail address
214 CHECKREG_SYM(r7, X12, r0); // RETX should be value of X12 (HARDCODED ADDR!!)
217 //-------------------------------------------------------
218 // 32-bit alignment, DAG0
222 LD32(i1, ((0x1000 + 2)));
223 LD32(p2, ((0x1000 + 2) & 0xFFFFFFFC)); // Aligned version
224 LD32(r1, 0xDEADBEEF);
225 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
227 X13: R1 = [ I1 ]; // Exception should occur here
229 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
230 CHECKREG(r6, (0x1000 + 2)); // FAULT_ADDR should contain fail address
231 CHECKREG_SYM(r7, X13, r0); // RETX should be value of X13 (HARDCODED ADDR!!)
234 //-------------------------------------------------------
235 // 32-bit alignment, DAG0
239 LD32(i1, ((0x1000 + 3)));
240 LD32(p2, ((0x1000 + 3) & 0xFFFFFFFC)); // Aligned version
241 LD32(r1, 0xDEADBEEF);
242 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
244 X14: R1 = [ I1 ]; // Exception should occur here
246 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
247 CHECKREG(r6, (0x1000 + 3)); // FAULT_ADDR should contain fail address
248 CHECKREG_SYM(r7, X14, r0); // RETX should be value of X14 (HARDCODED ADDR!!)
251 //-------------------------------------------------------
252 // 16-bit alignment, DAG1
256 LD32(i1, ((0x1000 + 1)));
257 LD32(p2, ((0x1000 + 1) & 0xFFFFFFFE)); // Aligned version
258 LD32(r1, 0xDEADBEEF);
259 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
261 X15: A0 = 0 || NOP || R1.L = W [ I1 ]; // Exception should occur here
263 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
264 CHECKREG(r6, (0x1000 + 1)); // FAULT_ADDR should contain fail address
265 CHECKREG_SYM(r7, X15, r0); // RETX should be value of X15 (HARDCODED ADDR!!)
268 //-------------------------------------------------------
269 // 32-bit alignment, DAG1
273 LD32(i1, ((0x1000 + 1)));
274 LD32(p2, ((0x1000 + 1) & 0xFFFFFFFC)); // Aligned version
275 LD32(r1, 0xDEADBEEF);
276 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
278 X16: A0 = 0 || NOP || R1 = [ I1 ]; // Exception should occur here
280 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
281 CHECKREG(r6, (0x1000 + 1)); // FAULT_ADDR should contain fail address
282 CHECKREG_SYM(r7, X16, r0); // RETX should be value of X16 (HARDCODED ADDR!!)
285 //-------------------------------------------------------
286 // 32-bit alignment, DAG1
290 LD32(i1, ((0x1000 + 2)));
291 LD32(p2, ((0x1000 + 2) & 0xFFFFFFFC)); // Aligned version
292 LD32(r1, 0xDEADBEEF);
293 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
295 X17: A0 = 0 || NOP || R1 = [ I1 ]; // Exception should occur here
297 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
298 CHECKREG(r6, (0x1000 + 2)); // FAULT_ADDR should contain fail address
299 CHECKREG_SYM(r7, X17, r0); // RETX should be value of X17 (HARDCODED ADDR!!)
302 //-------------------------------------------------------
303 // 32-bit alignment, DAG1
307 LD32(i1, ((0x1000 + 3)));
308 LD32(p2, ((0x1000 + 3) & 0xFFFFFFFC)); // Aligned version
309 LD32(r1, 0xDEADBEEF);
310 R5 = 0;R6 = 0;R7 = 0; // Exception handler will set these, reset them first
312 X18: A0 = 0 || NOP || R1 = [ I1 ]; // Exception should occur here
314 CHECKREG(r5,0x24); // supv and EXCPT_ALIGN
315 CHECKREG(r6, (0x1000 + 3)); // FAULT_ADDR should contain fail address
316 CHECKREG_SYM(r7, X18, r0); // RETX should be value of X18 (HARDCODED ADDR!!)
319 //-------------------------------------------------------
324 R5 = SEQSTAT; // Get exception cause
326 // read and check fail addr (addr_which_causes_exception)
327 // should not be set for alignment exception
328 RD_MMR(DCPLB_FAULT_ADDR, p0, r6);
330 R7 = RETX; // get address of excepting instruction
332 // align the offending address
336 // Nops to work around ICache bug
341 .section MEM_0x1000,"aw"