|
|
1.1 ! root 1: ! 2: #include "evt_defs.h" ! 3: ! 4: /* ! 5: ******************************************************************** ! 6: * ! 7: * MONITOR FOR THE FPP OVERFLOW EVENT TEST ! 8: * ! 9: * 25-Mar-85 JJM: written ! 10: * ! 11: ******************************************************************** ! 12: */ ! 13: ovfl_test() ! 14: { ! 15: event_msg = "Overflow"; ! 16: test_event = ARITH_CODE; /* expect an arithmetic fault */ ! 17: exp_code = FLT_OVFL_CODE; /* -specificly floating overflow */ ! 18: disable_mask = 0; /* don't disable any events */ ! 19: evt_disabled = FALSE; ! 20: if( evt_inst ) /* was the op-code specified? */ ! 21: { ! 22: inst_index = get_ovfl_index( evt_inst ); ! 23: if( inst_index < 0 ) /* valid instruction for OVFL? */ ! 24: { ! 25: if( (prt_hdrs) && (cycle == 1) ) /* not a valid instr */ ! 26: { ! 27: writes( ! 28: "There are no floating OVERFLOW faults with op-code "); ! 29: writeh( evt_inst ); ! 30: writec('\n'); ! 31: error = TRUE; /* needed for line feed control */ ! 32: } ! 33: } else ! 34: test_ovfl_inst(); /* test the instruction */ ! 35: } else /* the op-code wasn't specfied */ ! 36: for(inst_index=0; inst_index < size_ovfl_tbl; inst_index++) ! 37: test_ovfl_inst(); /* test each ovfl instruction */ ! 38: } ! 39: ! 40: ! 41: /* ! 42: ******************************************************************** ! 43: * ! 44: * test the floating overflow event on an instruction ! 45: * ! 46: ******************************************************************** ! 47: */ ! 48: test_ovfl_inst() ! 49: { ! 50: valid_test = TRUE; /* a test is being run */ ! 51: op_code = ovfl_tbl[ inst_index ].inst_code; ! 52: op_name = ovfl_tbl[ inst_index ].name; ! 53: no_ops = ovfl_tbl[ inst_index ].no_operands; ! 54: precision = ovfl_tbl[ inst_index ].precision; ! 55: data_ptr = ovfl_tbl[ inst_index ].ovfl_data; ! 56: max_index = *ovfl_tbl[ inst_index ].ovfl_cnt; ! 57: if( precision == SGL ) { ! 58: sgl_op = TRUE; ! 59: acc_ld_size = SGL; /* use a sgl precision Acc. */ ! 60: } else { ! 61: sgl_op = FALSE; ! 62: acc_ld_size = DBL; /* use a dbl precision Acc. */ ! 63: } ! 64: if( (prt_hdrs) && (cycle == 1) ) ! 65: writes( op_name ); ! 66: test_inst(); ! 67: } ! 68: ! 69: ! 70: ! 71: ! 72: /* ! 73: *************************************************************************** ! 74: * ! 75: * GET THE OVERFLOW / UNDERFLOW INSTRUCTION TABLE INDEX FOR AN OP-CODE ! 76: * ! 77: * Given the op_code of an instruction, return the instruction's index in ! 78: * the overflow / underflow instruction table. Return a negative number ! 79: * if the op-code isn't in the table. ! 80: * ! 81: ************************************************************************** ! 82: */ ! 83: get_ovfl_index( op_code ) ! 84: { ! 85: int x; ! 86: x = 0; ! 87: while( (ovfl_tbl[x].inst_code != op_code) && (x < size_ovfl_tbl) ) ! 88: x++; ! 89: if( x == size_ovfl_tbl ) ! 90: x = -1; ! 91: return( x ); ! 92: } ! 93: ! 94:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.