|
|
1.1 ! root 1: ! 2: ! 3: #include "evt_defs.h" ! 4: ! 5: /* ! 6: ********************************************************************* ! 7: * FPP PIPELINED EVENTS TEST #11 ! 8: * ! 9: * This test will execute the following code: "LDF ADDF CVLF" ! 10: * with an overflow fault on the ADDF. We will make sure that: ! 11: * 1. The fault is detected, and ! 12: * 2. the Convert Longword Intger to SGL Floating instruction is not executed. ! 13: ********************************************************************* ! 14: */ ! 15: pipe11() ! 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 = ARITH_CODE; /* expect an arithmetic fault */ ! 21: exp_code = FLT_OVFL_CODE; /* - specificly overflow */ ! 22: exp_event = FALSE; /* ... but not yet */ ! 23: asm("movab _pipe11_ret,_event_return"); /* set event return address */ ! 24: dbl_value_2.m = 24; /* set the CVLF data */ ! 25: max_index = adf_ov_cnt; /* set max operand index */ ! 26: for( index = 0; index < max_index; index++ ) ! 27: { ! 28: dbl_ld_acc = adf_ov_dat[index].op_1; /* get the Acc data */ ! 29: dbl_value_1 = adf_ov_dat[index].op_2; /* get the '0' data */ ! 30: asm(".globl _pipe11_lp1"); ! 31: asm("_pipe11_lp1:"); ! 32: asm("bispsw $0x60"); /* enable ovfl & undfl events*/ ! 33: asm("movl _dbl_value_2,r4"); /* set the dummy load data */ ! 34: asm("ldf _dbl_ld_acc"); /* load the Acc. */ ! 35: exp_event = test_event; /* set the expect event flag */ ! 36: asm("addf _dbl_value_1"); /* trigger the event */ ! 37: asm("cvlf r4"); /* we shouldn't get to here */ ! 38: /* ! 39: * If we got to here then there was no event ! 40: */ ! 41: if( force_loop ) ! 42: asm("brw _pipe11_lp1");; /* loop on the error */ ! 43: exp_event = FALSE; /* reset event expected flag */ ! 44: asm("bicpsw $0x60"); /* disable ovfl & undfl evts */ ! 45: asm("movl _pre_event_fp,fp"); /* restore the frame pointer */ ! 46: asm("movl _pre_event_sp,sp"); /* restore the stack pointer */ ! 47: no_pipe11_evt();; /* report the error */ ! 48: /* ! 49: * Come here after the event ! 50: */ ! 51: asm(".globl _pipe11_ret"); ! 52: asm("_pipe11_ret:"); ! 53: asm("movl _pre_event_fp,fp"); /* restore the frame pointer */ ! 54: asm("movl _pre_event_sp,sp"); /* restore the stack pointer */ ! 55: if( force_loop ) ! 56: asm("brw _pipe11_lp1");; /* loop on the error */ ! 57: asm("bicpsw $0x60"); /* disable ovfl & undfl evts */ ! 58: if( post_evt_acc.m == 0x42c00000 ) /* Acc = CVLF data? ( 24.0 ) */ ! 59: pipe11_queue_er(); /* yes it was -error! error! */ ! 60: else if( post_evt_acc.m ) /* was the Acc cleared? */ ! 61: bad_pipe11_result(); /* incorrect result error */ ! 62: ! 63: } ! 64: } ! 65: ! 66: ! 67: ! 68: /**************************************************************************** ! 69: * Report an "EVENT NOT DETECTED" error ! 70: * ! 71: * Cycle: xx. EVT test xx. subtest xx. No overflow fault seen. index = xx ! 72: * inst = LDF op1, ADDF op2, CVLF op3 (overflow fault on the ADDF) ! 73: * op1 = xxxxxxxx, op2 = xxxxxxxx ! 74: ****************************************************************************/ ! 75: no_pipe11_evt() ! 76: { ! 77: errcnt++; /* bump the error count */ ! 78: if ( prt_error ) ! 79: { ! 80: print_pipe11_er( ". No overflow fault seen" ); ! 81: writes("op1 = "); ! 82: write32h( dbl_ld_acc.m ); ! 83: writes(", op2 = "); ! 84: write32h( dbl_value_1.m ); ! 85: writec('\n'); ! 86: } ! 87: if ( halt_flg ) /* halt on error? */ ! 88: pipe11_halt( 1 ); /* halt with a code of 1 */ ! 89: if ( loop_on_err ) ! 90: { ! 91: force_loop = TRUE; /* set the force loop flag */ ! 92: asm("jmp _pipe11_lp1"); /* and loop */ ! 93: }; ! 94: } ! 95: ! 96: ! 97: ! 98: ! 99: /**************************************************************************** ! 100: * Report an "BAD ACCUMULATOR AFTER THE EVENT" error ! 101: * ! 102: * Cycle: xx. EVT test xx. subtest xx. Bad final Accumulator. index = xx ! 103: * inst = LDF op1, ADDF op2, CVLF op3 (overflow fault on the ADDF) ! 104: * The CVLF should not be executed. ! 105: * op1 = xxxxxxxx, final Acc. = xxxxxxxx, op3 = xxxxxxxx ! 106: * op2 = xxxxxxxx, expected = xxxxxxxx ! 107: ****************************************************************************/ ! 108: bad_pipe11_result() ! 109: { ! 110: errcnt++; /* bump the error count */ ! 111: if ( prt_error ) ! 112: { ! 113: print_pipe11_er( ". Bad final Accumulator" ); ! 114: writes( ! 115: "The CVLF should not be executed\n"); ! 116: writes("op1 = "); ! 117: write32h( dbl_ld_acc.m ); ! 118: writes(", final Acc. = "); ! 119: write32h( post_evt_acc.m ); ! 120: writes(", op3 = "); ! 121: write32h( dbl_value_2.m ); ! 122: writes("\nop2 = "); ! 123: write32h( dbl_value_1.m ); ! 124: writes(", expected = "); ! 125: write32h( 0 ); /* the expected result = 0 */ ! 126: writec('\n'); ! 127: } ! 128: if ( halt_flg ) /* halt on error? */ ! 129: pipe11_halt( 2 ); /* halt with a code of 2 */ ! 130: if ( loop_on_err ) ! 131: { ! 132: force_loop = TRUE; /* set the force loop flag */ ! 133: asm("jmp _pipe11_lp1"); /* and loop */ ! 134: }; ! 135: } ! 136: ! 137: ! 138: ! 139: ! 140: ! 141: /**************************************************************************** ! 142: * Report an "FPP queue not cleared" message ! 143: * ! 144: * Cycle: xx. EVT test xx. subtest xx. Fpp queue not cleared. index = xx ! 145: * inst = LDF op1, ADDF op2, CVLF op3 (overflow fault on the ADDF) ! 146: * The CVLF should not have been executed but apparently was. ! 147: * op1 = xxxxxxxx, final Acc. = xxxxxxxx, op3 = xxxxxxxx ! 148: * op2 = xxxxxxxx, expected = xxxxxxxx ! 149: ****************************************************************************/ ! 150: pipe11_queue_er() ! 151: { ! 152: errcnt++; /* bump the error count */ ! 153: if ( prt_error ) ! 154: { ! 155: print_pipe11_er( ". Fpp queue not cleared" ); ! 156: writes( ! 157: "The CVLF should not have been executed but apparently was.\n"); ! 158: writes("op1 = "); ! 159: write32h( dbl_ld_acc.m ); ! 160: writes(", final Acc. = "); ! 161: write32h( post_evt_acc.m ); ! 162: writes(", op3 = "); ! 163: write32h( dbl_value_2.m ); ! 164: writes("\nop2 = "); ! 165: write32h( dbl_value_1.m ); ! 166: writes(", expected = "); ! 167: write32h( 0 ); /* the expected result = 0 */ ! 168: writec('\n'); ! 169: } ! 170: if ( halt_flg ) /* halt on error? */ ! 171: pipe11_halt( 3 ); /* halt with a code of 3 */ ! 172: if ( loop_on_err ) ! 173: { ! 174: force_loop = TRUE; /* set the force loop flag */ ! 175: asm("jmp _pipe11_lp1"); /* and loop */ ! 176: }; ! 177: } ! 178: ! 179: ! 180: ! 181: ! 182: /**************************************************************************** ! 183: * Report an error message of the form: ! 184: * ! 185: * Cycle: xx. EVT test xx. subtest xx. <your message here> index = xx ! 186: * inst = LDF op1, ADDF op2, CVLF op3 (overflow fault on the ADDF) ! 187: ****************************************************************************/ ! 188: print_pipe11_er( msg ) ! 189: char *msg; /* error message to print */ ! 190: { ! 191: if( errcnt == 1 ) /* 1st error? */ ! 192: writes(" \n"); /* start a new print line */ ! 193: writes("Cycle: "); ! 194: writed( cycle ); ! 195: writes(" EVT test "); ! 196: writed( test_no ); ! 197: writes(". subtest "); ! 198: writed( subtest ); ! 199: writes( msg ); /* print the message */ ! 200: writes(". index = "); ! 201: writed( index ); ! 202: writes( ! 203: "\ninst = LDF op1, ADDF op2, CVLF op3 (overflow fault on the ADDF)\n"); ! 204: } ! 205: ! 206: ! 207: ! 208: /**************************************************************************** ! 209: * halt on error routine ! 210: ****************************************************************************/ ! 211: pipe11_halt( code ) ! 212: int code; /* error code to halt with */ ! 213: { ! 214: err_code = code; ! 215: sgl_value_1 = dbl_ld_acc.m; ! 216: sgl_value_2 = dbl_value_1.m; ! 217: sgl_value_3 = post_evt_acc.m; ! 218: asm("movl _test_no,r0"); /* r0 = test number */ ! 219: asm("movl _subtest,r1"); /* r1 = subtest number */ ! 220: asm("movl _err_code,r2"); /* r2 = error code */ ! 221: asm("movl _cycle,r3"); /* r3 = cycle count */ ! 222: asm("movl _sgl_value_1,r4"); /* r4 = initial accumulator */ ! 223: asm("movl _sgl_value_2,r5"); /* r5 = ADDF operand */ ! 224: asm("movl _sgl_value_3,r6"); /* r6 = final accumulator */ ! 225: asm("clrl r7"); /* r7 = expected accumulator */ ! 226: asm("movl _index,r8"); /* r8 = data index */ ! 227: asm("halt"); /* HALT ... */ ! 228: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.