|
|
1.1 ! root 1: ! 2: #include "evt_defs.h" ! 3: ! 4: /* ! 5: ********************************************************************* ! 6: * FPP PIPELINED EVENTS TEST #3 ! 7: * ! 8: * This test will execute the following code: "LDF LOGF CMPF2 LOGF" ! 9: * with a reserved operand fault on the CMPF2. We will make sure that: ! 10: * 1. The fault is detected, ! 11: * 2. the 1st log operation completes, and ! 12: * 3. the 2nd log instruction is not executed. ! 13: ********************************************************************* ! 14: */ ! 15: pipe3() ! 16: { ! 17: asm("moval (r13),_pre_event_fp"); /* save the frame pointer */ ! 18: asm("moval (r14),_pre_event_sp"); /* save the stack pointer */ ! 19: precision = SGL; ! 20: test_event = RESOP_CODE; /* reserved op.fault expected */ ! 21: exp_event = FALSE; /* ... but not yet */ ! 22: asm("movab _pipe3_ret,_event_return"); /* post event addr */ ! 23: for( index = 0; index < max_pipe3_index; index++ ) { ! 24: dbl_ld_acc = pipe3_data[index].op_1; /* get the data */ ! 25: dbl_expected = pipe3_data[index].exp; ! 26: dbl_value_1 = cmp2_resops[index].op_1; /* get reserved ops. */ ! 27: dbl_value_2 = cmp2_resops[index].op_2; ! 28: asm(".globl _pipe3_lp1"); ! 29: asm("_pipe3_lp1:"); ! 30: asm("bispsw $0x60"); /* enable ovfl,undfl */ ! 31: asm("ldf _dbl_ld_acc"); /* load the Acc. */ ! 32: exp_event = test_event; /* expect event soon */ ! 33: asm("logf"); /* get the log */ ! 34: asm("cmpf2 _dbl_value_1,_dbl_value_2"); /* cause the event */ ! 35: asm("logf"); /* shouldn't get here*/ ! 36: /* ! 37: * If we got to here then there was no event ! 38: */ ! 39: if( force_loop ) ! 40: asm("brw _pipe3_lp1");; /* loop on the error */ ! 41: exp_event = FALSE; /* reset event expected flag */ ! 42: asm("bicpsw $0x60"); /* disable ovfl & undfl evts */ ! 43: asm("movl _pre_event_fp,fp"); /* restore the frame pointer */ ! 44: asm("movl _pre_event_sp,sp"); /* restore the stack pointer */ ! 45: no_pipe3_evt();; /* report the error */ ! 46: /* ! 47: * Come here after the event ! 48: */ ! 49: asm(".globl _pipe3_ret"); ! 50: asm("_pipe3_ret:"); ! 51: asm("movl _pre_event_fp,fp"); /* restore the frame pointer */ ! 52: asm("movl _pre_event_sp,sp"); /* restore the stack pointer */ ! 53: if( force_loop ) ! 54: asm("brw _pipe3_lp1");; /* loop on the error */ ! 55: asm("bicpsw $0x60"); /* disable ovfl & undfl evts */ ! 56: if( post_evt_acc.m != dbl_expected.m ) ! 57: bad_pipe3_result(); /* incorrect result error */ ! 58: ! 59: } ! 60: } ! 61: ! 62: ! 63: ! 64: /**************************************************************************** ! 65: * Report an "EVENT NOT DETECTED" error ! 66: * ! 67: * Cycle: xx. EVT test xx. subtest xx. No reserved operand fault. index = xx ! 68: * inst = LDF op_1, LOGF, CMPF2 op_2,op_3, LOGF (reserved op. fault on CMPF2) ! 69: * op_1 = xxxxxxxx, op_2 = xxxxxxxx, op_3 = xxxxxxxx ! 70: ****************************************************************************/ ! 71: no_pipe3_evt() ! 72: { ! 73: errcnt++; /* bump the error count */ ! 74: if ( prt_error ) { ! 75: print_pipe3_er( ". No reserved operand fault. " ); ! 76: writes("op_1 = "); ! 77: write32h( dbl_ld_acc.m ); ! 78: writes(", op_2 = "); ! 79: write32h( dbl_value_1.m ); ! 80: writes(", op_3 = "); ! 81: write32h( dbl_value_2.m ); ! 82: writec('\n'); ! 83: } ! 84: if ( halt_flg ) /* halt on error? */ ! 85: pipe3_halt( 1 ); /* halt with a code of 1 */ ! 86: if ( loop_on_err ) { ! 87: force_loop = TRUE; /* set the force loop flag */ ! 88: asm("jmp _pipe3_lp1"); /* and loop */ ! 89: }; ! 90: } ! 91: ! 92: ! 93: ! 94: ! 95: /**************************************************************************** ! 96: * Report an "BAD ACCUMULATOR AFTER THE EVENT" error ! 97: * ! 98: * Cycle: xx. EVT test xx. subtest xx. Bad final Accumulator. index = xx ! 99: * inst = LDF op_1, LOGF, CMPF2 op_2,op_3, LOGF (reserved op. fault on CMPF2) ! 100: * The 2nd LOGF should not be executed. ! 101: * op_1 = xxxxxxxx, final Acc. = xxxxxxxx, expected = xxxxxxxx ! 102: ****************************************************************************/ ! 103: bad_pipe3_result() ! 104: { ! 105: errcnt++; /* bump the error count */ ! 106: if ( prt_error ) { ! 107: print_pipe3_er( ". Bad final Accumulator. " ); ! 108: writes("The 2nd LOGF should not be executed\n"); ! 109: writes("op_1 = "); ! 110: write32h( dbl_ld_acc.m ); ! 111: writes(", final Acc. = "); ! 112: write32h( post_evt_acc.m ); ! 113: writes(", expected = "); ! 114: write32h( dbl_expected.m ); ! 115: writec('\n'); ! 116: } ! 117: if ( halt_flg ) /* halt on error? */ ! 118: pipe3_halt( 2 ); /* halt with a code of 2 */ ! 119: if ( loop_on_err ) { ! 120: force_loop = TRUE; /* set the force loop flag */ ! 121: asm("jmp _pipe3_lp1"); /* and loop */ ! 122: }; ! 123: } ! 124: ! 125: ! 126: ! 127: ! 128: ! 129: ! 130: /**************************************************************************** ! 131: * Report an error message of the form: ! 132: * ! 133: * Cycle: xx. EVT test xx. subtest xx. <your message here>. index = xx ! 134: * inst = LDF op_1, LOGF, CMPF2 op_2,op_3, LOGF (reserved op. fault on CMPF2) ! 135: ****************************************************************************/ ! 136: print_pipe3_er( msg ) ! 137: char *msg; /* error message to print */ ! 138: { ! 139: if( errcnt == 1 ) /* 1st error? */ ! 140: writes(" \n"); /* start a new print line */ ! 141: writes("Cycle: "); ! 142: writed( cycle ); ! 143: writes(" EVT test "); ! 144: writed( test_no ); ! 145: writes(". subtest "); ! 146: writed( subtest ); ! 147: writes( msg ); /* print the message */ ! 148: writes(" index = "); ! 149: writed( index ); ! 150: writes("\ninst = LDF op_1, LOGF, CMPF2 op_2,op_3, LOGF"); ! 151: writes(" (reserved op. fault on CMPF2)\n"); ! 152: } ! 153: ! 154: ! 155: ! 156: /**************************************************************************** ! 157: * halt on error routine ! 158: ****************************************************************************/ ! 159: pipe3_halt( code ) ! 160: int code; /* error code to halt with */ ! 161: { ! 162: err_code = code; ! 163: sgl_value_1 = dbl_ld_acc.m; ! 164: asm("movl _test_no,r0"); /* r0 = test number */ ! 165: asm("movl _subtest,r1"); /* r1 = subtest number */ ! 166: asm("movl _err_code,r2"); /* r2 = error code */ ! 167: asm("movl _cycle,r3"); /* r3 = cycle count */ ! 168: asm("movl _sgl_value_1,r4"); /* r4 = initial operand */ ! 169: if( code == 1 ) { ! 170: sgl_value_2 = dbl_value_1.m; ! 171: sgl_value_3 = dbl_value_2.m; ! 172: asm("movl _sgl_value_2,r5"); /* r5 = 1st CMPF2 operand */ ! 173: asm("movl _sgl_value_3,r6"); /* r6 = 2nd CMPF2 operand */ ! 174: } else { ! 175: sgl_value_2 = post_evt_acc.m; ! 176: sgl_value_3 = dbl_expected.m; ! 177: asm("movl _sgl_value_2,r5"); /* r5 = final accumulator */ ! 178: asm("movl _sgl_value_3,r6"); /* r6 = expected accumulator */ ! 179: } ! 180: asm("movl _index,r7"); /* r7 = data index */ ! 181: asm("halt"); /* HALT ... */ ! 182: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.