1 //Original:/proj/frio/dv/testcases/core/c_mmr_ppopm_illegal_adr/c_mmr_ppopm_illegal_adr.dsp
2 // Spec Reference: mmr ppopm illegal address
4 # sim: --environment operating
7 .include "testutils.inc"
11 include(selfcheck.inc)
16 #define STACKSIZE 0x10
19 #define ITABLE 0xF0000000
22 GEN_INT_INIT(ITABLE) // set location for interrupt table
25 // Reset/Bootstrap Code
26 // (Here we set the processor operating modes, initialize registers
34 INIT_I_REGS(0); // initialize the dsp address regs
38 //CHECK_INIT(p5, 0xe0000000);
42 CLI R1; // inhibit events during MMR writes
44 LD32_LABEL(sp, USTACK); // setup the user stack pointer
45 USP = SP; // and frame pointer
47 LD32_LABEL(sp, KSTACK); // setup the stack pointer
48 FP = SP; // and frame pointer
50 LD32(p0, EVT0); // Setup Event Vectors and Handlers
51 LD32_LABEL(r0, EHANDLE); // Emulation Handler (Int0)
54 LD32_LABEL(r0, RHANDLE); // Reset Handler (Int1)
57 LD32_LABEL(r0, NHANDLE); // NMI Handler (Int2)
60 LD32_LABEL(r0, XHANDLE); // Exception Handler (Int3)
63 [ P0 ++ ] = R0; // EVT4 not used global Interr Enable (INT4)
65 LD32_LABEL(r0, HWHANDLE); // HW Error Handler (Int5)
68 LD32_LABEL(r0, THANDLE); // Timer Handler (Int6)
71 LD32_LABEL(r0, I7HANDLE); // IVG7 Handler
74 LD32_LABEL(r0, I8HANDLE); // IVG8 Handler
77 LD32_LABEL(r0, I9HANDLE); // IVG9 Handler
80 LD32_LABEL(r0, I10HANDLE);// IVG10 Handler
83 LD32_LABEL(r0, I11HANDLE);// IVG11 Handler
86 LD32_LABEL(r0, I12HANDLE);// IVG12 Handler
89 LD32_LABEL(r0, I13HANDLE);// IVG13 Handler
92 LD32_LABEL(r0, I14HANDLE);// IVG14 Handler
95 LD32_LABEL(r0, I15HANDLE);// IVG15 Handler
98 LD32(p0, EVT_OVERRIDE);
102 R1 = -1; // Change this to mask interrupts (*)
103 CSYNC; // wait for MMR writes to finish
104 STI R1; // sync and reenable events (implicit write to IMASK)
110 LT0 = r0; // set loop counters to something deterministic
117 ASTAT = r0; // reset other internal regs
119 RETS = r0; // prevent X's breaking LINK instruction
121 // The following code sets up the test for running in USER mode
123 LD32_LABEL(r0, STARTUSER);// One gets to user mode by doing a
124 // ReturnFromInterrupt (RTI)
125 RETI = r0; // We need to load the return address
127 // Comment the following line for a USER Mode test
129 JUMP STARTSUP; // jump to code start for SUPERVISOR mode
134 LD32_LABEL(p1, BEGIN);
138 CLI R1; // inhibit events during write to MMR
139 [ P0 ] = P1; // IVG15 (General) handler (Int 15) load with start
140 CSYNC; // wait for it
141 STI R1; // reenable events with proper imask
143 RAISE 15; // after we RTI, INT 15 should be taken
151 LINK 0; // change for how much stack frame space you need.
157 //*********************************************************************
161 // COMMENT the following line for USER MODE tests
162 [ -- SP ] = RETI; // enable interrupts in supervisor mode
164 // **** YOUR CODE GOES HERE ****
166 LD32(r0, 0206037020);
167 LD32(r1, 0x10070030);
168 LD32(r2, 0xe2000043);
169 LD32(r3, 0x30305050);
170 LD32(r4, 0x0f040860);
171 LD32(r5, 0x0a0050d0);
172 LD32(r6, 0x00000000);
173 LD32(r7, 0x0f060071);
174 [ -- SP ] = ( R7:7 );
175 LD32(r7, 0x123456af);
176 [ -- SP ] = ( R7:6 );
182 CHECKREG(r1, 0x10070034);
183 CHECKREG(r2, 0xE2000046);
184 CHECKREG(r3, 0x30305054);
185 CHECKREG(r4, 0x0f040865);
186 CHECKREG(r5, 0x0a0050d6);
187 CHECKREG(r6, 0x00000007);
188 CHECKREG(r7, 0x123456b7);
190 CHECKREG(r7, 0x123456af);
192 dbg_pass; // End the test
194 //*********************************************************************
197 // Handlers for Events
200 EHANDLE: // Emulation Handler 0
203 RHANDLE: // Reset Handler 1
206 NHANDLE: // NMI Handler 2
210 XHANDLE: // Exception Handler 3
211 R0 = RETX; // error handler:RETX has the address of the same Illegal instr
219 R0 += 2; // we have to add 2 to point to next instr after return (16-bit illegal instr)
226 HWHANDLE: // HW Error Handler 5
230 THANDLE: // Timer Handler 6
234 I7HANDLE: // IVG 7 Handler
238 I8HANDLE: // IVG 8 Handler
242 I9HANDLE: // IVG 9 Handler
246 I10HANDLE: // IVG 10 Handler
250 I11HANDLE: // IVG 11 Handler
254 I12HANDLE: // IVG 12 Handler
258 I13HANDLE: // IVG 13 Handler
262 I14HANDLE: // IVG 14 Handler
266 I15HANDLE: // IVG 15 Handler
270 NOP;NOP;NOP;NOP;NOP;NOP;NOP; // needed for icache bug
276 .section MEM_DATA_ADDR_1,"aw"
302 // Stack Segments (Both Kernel and User)