|
|
1.1 root 1:
2: #include "evt_defs.h"
3:
4: /*
5: ********************************************************************
6: *
7: * MONITOR FOR THE FPP DIVIDE BY ZERO EVENT TEST
8: *
9: * 26-Mar-85 JJM: written
10: *
11: ********************************************************************
12: */
13: div_by_0_test()
14: {
15: event_msg = "Divide By ZERO";
16: test_event = ARITH_CODE; /* expect an arithmetic fault */
17: exp_code = FLT_0_DIV_CODE; /* -specificly divide by 0 */
18: disable_mask = 0; /* don't disable any events */
19: evt_disabled = FALSE; /* expected event is enabled */
20: if( evt_inst ) /* was the op-code specified? */
21: {
22: if( evt_inst == DIVF_OP_CODE )
23: run_divf(); /* test the DIVF instruction */
24: else if( evt_inst == DIVD_OP_CODE )
25: run_divd(); /* test the DIVD instruction */
26: else if( (prt_hdrs) && (cycle == 1) )
27: {
28: writes("There are no DIVIDE BY ZERO faults with op-code ");
29: writeh( evt_inst ); /* print the ersatz op-code */
30: writec('\n');
31: error = TRUE; /* needed for line feed control */
32: }
33: }
34: else /* test both DIVF and DIVD */
35: {
36: run_divf(); /* test the DIVF instruction */
37: run_divd(); /* test the DIVD instruction */
38: }
39: }
40:
41:
42:
43:
44: /*
45: **********************************************************************
46: *
47: * SET UP TO TEST DIVIDE BY ZERO WITH THE DIVF INSTRUCTION
48: *
49: **********************************************************************
50: */
51: run_divf()
52: {
53: op_code = DIVF_OP_CODE; /* set the inst's op_code */
54: op_name = "DIVF "; /* set the inst's name */
55: precision = SGL;
56: acc_ld_size = SGL; /* load a single precision Acc. */
57: sgl_op = TRUE;
58: valid_test = TRUE; /* we're running a test */
59: data_ptr = zero_divide_data; /* set the data ptr */
60: max_index = zero_divide_cnt; /* set the max index */
61: if( (prt_hdrs) && (cycle == 1) )
62: writes( op_name );
63: test_inst();
64: }
65:
66:
67:
68: /*
69: **********************************************************************
70: *
71: * SET UP TO TEST DIVIDE BY ZERO WITH THE DIVD INSTRUCTION
72: *
73: **********************************************************************
74: */
75: run_divd()
76: {
77: op_code = DIVD_OP_CODE; /* set the inst's op_code */
78: op_name = "DIVD "; /* set the inst's name */
79: precision = DBL;
80: acc_ld_size = DBL; /* load a double precision Acc. */
81: sgl_op = FALSE;
82: valid_test = TRUE; /* we're running a test */
83: data_ptr = zero_divide_data; /* set the data ptr */
84: max_index = zero_divide_cnt; /* set the max index */
85: if( (prt_hdrs) && (cycle == 1) )
86: writes( op_name );
87: test_inst();
88: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.