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