1 //Original:/proj/frio/dv/testcases/seq/se_cc2stat_haz/se_cc2stat_haz.dsp
3 // Verify CC hazards under the following condition:
5 // (1a) cc2stat (that modifies CC) followed by that uses CC
6 // (1b) same as (1a) but kill cc2stat instruction in WB
8 // (2a) cc2stat (that modifies CC) followed by conditional branch (predicted)
9 // (2b) same as (2a) but kill cc2stat instruction in WB
11 // (3a) cc2stat (that modifies CC) followed by conditional branch (mispredicted)
12 // (3b) same as (3a) but kill cc2stat instruction in WB
14 // (4a) cc2stat (that modifies CC) followed by testset
15 // (4b) same as (4a) but kill cc2stat instruction in WB
17 // (5a) cc2stat (that modifies CC) followed by dag instruction that modifies CC
18 // (5b) same as (5a) but kill cc2stat instruction in WB
20 # sim: --environment operating
23 .include "testutils.inc"
26 // ----------------------------------------------------------------
28 // ----------------------------------------------------------------
31 include(selfcheck.inc)
35 // ----------------------------------------------------------------
37 // ----------------------------------------------------------------
40 #define STACKSIZE 0x00000010
43 #define ITABLE CODE_ADDR_1 //
46 // ----------------------------------------------------------------
48 // - set the processor operating modes
49 // - initialize registers
51 // ----------------------------------------------------------------
55 // Initialize data registers
66 // Initialize pointer registers
69 // Initialize address registers
75 // Initialize the address of the checkreg data segment
76 // **** THIS IS NEEDED WHENEVER CHECKREG IS USED ****
77 CHECK_INIT_DEF(p5); //CHECK_INIT(p5, 0x00BFFFFC);
79 // Inhibit events during MMR writes
83 LD32_LABEL(sp, USTACK);
87 LD32_LABEL(sp, KSTACK);
89 // Setup frame pointer
92 // Setup event vector table
95 LD32_LABEL(r0, EMU_ISR); // Emulation Handler (EVT0)
97 LD32_LABEL(r0, RST_ISR); // Reset Handler (EVT1)
99 LD32_LABEL(r0, NMI_ISR); // NMI Handler (EVT2)
101 LD32_LABEL(r0, EXC_ISR); // Exception Handler (EVT3)
103 [ P0 ++ ] = R0; // EVT4 not used
104 LD32_LABEL(r0, HWE_ISR); // HW Error Handler (EVT5)
106 LD32_LABEL(r0, TMR_ISR); // Timer Handler (EVT6)
108 LD32_LABEL(r0, IGV7_ISR); // IVG7 Handler
110 LD32_LABEL(r0, IGV8_ISR); // IVG8 Handler
112 LD32_LABEL(r0, IGV9_ISR); // IVG9 Handler
114 LD32_LABEL(r0, IGV10_ISR); // IVG10 Handler
116 LD32_LABEL(r0, IGV11_ISR); // IVG11 Handler
118 LD32_LABEL(r0, IGV12_ISR); // IVG12 Handler
120 LD32_LABEL(r0, IGV13_ISR); // IVG13 Handler
122 LD32_LABEL(r0, IGV14_ISR); // IVG14 Handler
124 LD32_LABEL(r0, IGV15_ISR); // IVG15 Handler
127 // Set the EVT_OVERRIDE MMR
128 LD32(p0, EVT_OVERRIDE);
132 // Disable L1 data cache
133 WR_MMR(DMEM_CONTROL, 0x00000000, p0, r0);
135 // Mask interrupts (*)
138 // Wait for MMR writes to finish
144 // Reset accumulator registers
148 // Reset loop counters to deterministic values
158 // Reset other internal regs
163 // Setup the test to run in USER mode
164 LD32_LABEL(r0, USER_CODE);
167 // Setup the test to run in SUPERVISOR mode
168 // Comment the following line for a USER mode test
169 JUMP.S SUPERVISOR_CODE;
173 // Load IVG15 general handler (Int15) with MAIN_CODE
174 LD32_LABEL(p1, MAIN_CODE);
183 // Take Int15 which branch to MAIN_CODE after RTI
188 // Setup the stack pointer and the frame pointer
189 LD32_LABEL(sp, USTACK);
201 // ----------------------------------------------------------------
203 // ----------------------------------------------------------------
206 // ----------------------------------------------------------------
208 // ----------------------------------------------------------------
222 // ----------------------------------------------------------------
224 // ----------------------------------------------------------------
238 // ----------------------------------------------------------------
240 // ----------------------------------------------------------------
254 // ----------------------------------------------------------------
256 // ----------------------------------------------------------------
270 // ----------------------------------------------------------------
272 // ----------------------------------------------------------------
286 // ----------------------------------------------------------------
288 // ----------------------------------------------------------------
302 // ----------------------------------------------------------------
304 // ----------------------------------------------------------------
318 // ----------------------------------------------------------------
320 // ----------------------------------------------------------------
334 // ----------------------------------------------------------------
336 // ----------------------------------------------------------------
350 // ----------------------------------------------------------------
352 // ----------------------------------------------------------------
366 // ----------------------------------------------------------------
368 // ----------------------------------------------------------------
382 // ----------------------------------------------------------------
384 // ----------------------------------------------------------------
398 // ----------------------------------------------------------------
400 // ----------------------------------------------------------------
414 // ----------------------------------------------------------------
416 // ----------------------------------------------------------------
430 // ----------------------------------------------------------------
432 // ----------------------------------------------------------------
436 // Enable interrupts in SUPERVISOR mode
437 // Comment the following line for a USER mode test
440 // Start of the program code
445 // Verify CC hazards under the following condition:
447 // (1a) cc2stat (that modifies CC) followed by that uses CC
452 A0 = BXORSHIFT( A0 , A1, CC );
453 R7 = CC; CHECKREG(R7, 0);
454 R6 = A0; CHECKREG(R6, 0);
455 R6 = A0.X; CHECKREG(R6, 0);
456 R7 = A1; CHECKREG(R7, 1);
457 R7 = A1.X; CHECKREG(R7, 0);
459 // (1b) same as (1a) but kill cc2stat instruction in WB
465 A0 = BXORSHIFT( A0 , A1, CC );
466 R7 = CC; CHECKREG(R7, 0);
467 R6 = A0; CHECKREG(R6, 3);
468 R6 = A0.X; CHECKREG(R6, 0);
469 R7 = A1; CHECKREG(R7, 1);
470 R7 = A1.X; CHECKREG(R7, 0);
472 // (2a) cc2stat (that modifies CC) followed by conditional branch (predicted)
478 IF !CC JUMP INC_R3_TO_10 (BP);
501 // (2b) same as (2a) but kill cc2stat instruction in WB
507 IF !CC JUMP INC_R3_TO_20 (BP);
530 // (3a) cc2stat (that modifies CC) followed by conditional branch (mispredicted)
535 IF CC JUMP INC_R3_TO_20 (BP);
547 // (3b) same as (3a) but kill cc2stat instruction in WB
553 IF CC JUMP INC_R3_TO_20 (BP);
569 // (4a) cc2stat (that modifies CC) followed by testset
570 LD32(p0, DATA_ADDR_3); //LD32(p0, 0xff000000);
571 LD32(p1, DATA_ADDR_2); //LD32(p1, 0xffe00000);
582 CHECKMEM32(DATA_ADDR_3, 1); //CHECKMEM32(0xff000000, 1);
584 CHECKMEM32(DATA_ADDR_3, 0); //CHECKMEM32(0xff000000, 0);
586 // (4b) same as (4a) but kill cc2stat instruction in WB
596 CHECKMEM32(DATA_ADDR_3, 2); //CHECKMEM32(0xff000000, 2);
598 CHECKMEM32(DATA_ADDR_3, 0); //CHECKMEM32(0xff000000, 0);
600 // (5a) cc2stat (that modifies CC) followed by dag instruction that modifies CC
607 // (5b) same as (5a) but kill cc2stat instruction in WB
619 // ----------------------------------------------------------------
621 // - define kernel and user stacks
622 // ----------------------------------------------------------------