1 //Original:/proj/frio/dv/testcases/debug/dbg_tr_simplejp/dbg_tr_simplejp.dsp
2 // Description: This test performs simple jumps and verifies the trace buffer
3 // recording for simple jumps.
5 # sim: --environment operating
8 .include "testutils.inc"
13 include(selfcheck.inc)
17 #define ITABLE CODE_ADDR_1 //
20 // This test embeds .text offsets, so pad our test so it lines up.
26 INIT_R_REGS(0); // Initialize Dregs
27 INIT_P_REGS(0); // Initialize Pregs
29 CHECK_INIT_DEF(p5); // CHECK_INIT(p5, 0x00BFFFFC);
31 LD32(p0, EVT0); // Setup Event Vectors and Handlers
33 LD32_LABEL(r0, EHANDLE); // Emulation Handler (Int0)
36 LD32_LABEL(r0, RHANDLE); // Reset Handler (Int1)
39 LD32_LABEL(r0, NHANDLE); // NMI Handler (Int2)
42 LD32_LABEL(r0, XHANDLE); // Exception Handler (Int3)
45 [ P0 ++ ] = R0; // IVT4 not used
47 LD32_LABEL(r0, HWHANDLE); // HW Error Handler (Int5)
50 LD32_LABEL(r0, THANDLE); // Timer Handler (Int6)
53 LD32_LABEL(r0, I7HANDLE); // IVG7 Handler
56 LD32_LABEL(r0, I8HANDLE); // IVG8 Handler
59 LD32_LABEL(r0, I9HANDLE); // IVG9 Handler
62 LD32_LABEL(r0, I10HANDLE); // IVG10 Handler
65 LD32_LABEL(r0, I11HANDLE); // IVG11 Handler
68 LD32_LABEL(r0, I12HANDLE); // IVG12 Handler
71 LD32_LABEL(r0, I13HANDLE); // IVG13 Handler
74 LD32_LABEL(r0, I14HANDLE); // IVG14 Handler
77 LD32_LABEL(r0, I15HANDLE); // IVG15 Handler
80 LD32(p0, EVT_OVERRIDE);
83 R0 = -1; // Change this to mask interrupts (*)
86 LD32_LABEL(p1, START);
89 [ P0 ] = P1; // IVG15 (General) handler (Int 15) load with start
91 LD32_LABEL(r7, DUMMY);
93 RAISE 15; // after we RTI, INT 15 should be taken
95 NOP; // Workaround for Bug 217
109 WR_MMR(TBUFCTL, 0x00000003, p0, r0); // Turn ON trace Buffer
123 JUMP.S label1; // 0x0224
124 R4.L = 0x1111; // Will be killed
125 R4.H = 0x1111; // Will be killed
129 label2: R5.H = 0x7777; // 0x0234
131 JUMP.S label3; //0x023c
132 R6.L = 0x1111; // Will be killed
133 R6.H = 0x1111; // Will be killed
139 label1: R4.H = 0x5555; // 0x0250
142 JUMP.S label2; // 0x0258
143 R5.L = 0x1111; // Will be killed
144 R5.H = 0x1111; // Will be killed
149 label3: R6.H = 0x7999; //0x026c
156 WR_MMR(TBUFCTL, 0x00000001, p0, r0); // Turn OFF trace Buffer
163 // Read the contents of the Trace Buffer
165 RD_MMR(TBUFSTAT, p0, r2);
166 CHECKREG(r2, 0x00000003);
168 // Read 3rd Entry of the Trace Buffer
169 RD_MMR(TBUF, p0, r0);
170 CHECKREG(r0, 0x0000026c);
172 RD_MMR(TBUFSTAT, p0, r2);
173 CHECKREG(r2, 0x00000003);
175 RD_MMR(TBUF, p0, r1);
176 CHECKREG(r1, 0x0000023c);
178 RD_MMR(TBUFSTAT, p0, r2);
179 CHECKREG(r2, 0x00000002);
181 // Read 2nd Entry of the Trace Buffer
182 RD_MMR(TBUF, p0, r0);
183 CHECKREG(r0, 0x00000234);
185 RD_MMR(TBUFSTAT, p0, r2);
186 CHECKREG(r2, 0x00000002);
188 RD_MMR(TBUF, p0, r1);
189 CHECKREG(r1, 0x0000025a);
191 RD_MMR(TBUFSTAT, p0, r2);
192 CHECKREG(r2, 0x00000001);
194 // Read ist Entry of the Trace Buffer
195 RD_MMR(TBUF, p0, r0);
196 CHECKREG(r0, 0x00000250);
198 RD_MMR(TBUFSTAT, p0, r2);
199 CHECKREG(r2, 0x00000001);
201 RD_MMR(TBUF, p0, r1);
202 CHECKREG(r1, 0x00000224);
204 RD_MMR(TBUFSTAT, p0, r2);
205 CHECKREG(r2, 0x00000000);
207 WR_MMR(TBUFCTL, 0x00000000, p0, r0); // Turn OFF trace Buffer Power
215 dbg_pass; // Call Endtest Macro
219 //*********************************************************************
221 // Handlers for Events
224 EHANDLE: // Emulation Handler 0
227 RHANDLE: // Reset Handler 1
230 NHANDLE: // NMI Handler 2
233 XHANDLE: // Exception Handler 3
236 HWHANDLE: // HW Error Handler 5
239 THANDLE: // Timer Handler 6
242 I7HANDLE: // IVG 7 Handler
245 I8HANDLE: // IVG 8 Handler
248 I9HANDLE: // IVG 9 Handler
251 I10HANDLE: // IVG 10 Handler
254 I11HANDLE: // IVG 11 Handler
257 I12HANDLE: // IVG 12 Handler
260 I13HANDLE: // IVG 13 Handler
263 I14HANDLE: // IVG 14 Handler
266 I15HANDLE: // IVG 15 Handler