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