|
|
1.1 root 1: #include "fpp_defs.h"
2:
3:
4: /*****************************************************************************
5: *
6: * PIPELINE TEST #11 MONITOR
7: *
8: * This test will do a series of 2, 3, 4, 5, and 6 NEGFs.
9: *
10: *****************************************************************************/
11: pipe_11()
12: {
13: asm(".globl _pipeline_11_t");
14: asm("_pipeline_11_t:"); /* entry address */
15: if( (cycle == 1) && (prt_hdrs) ) /* print headers on 1st cycle */
16: {
17: writes(" PIPE_11");
18: }
19: pipe11_1(); /* do 2 NEGFs */
20: pipe11_2(); /* do 3 NEGFs */
21: pipe11_3(); /* do 4 NEGFs */
22: pipe11_4(); /* do 5 NEGFs */
23: pipe11_5(); /* do 6 NEGFs */
24: asm("jmp *return"); /* return to the test monitor */
25: }
26:
27:
28:
29:
30:
31:
32: /************************************************************************
33: *
34: * SUBTEST 1 : 2 NEGFs
35: *
36: ************************************************************************/
37: pipe11_1()
38: {
39: subtest = 1;
40: force_loop = FALSE;
41: for( index = 0; index < max_ldf_1_index; index++ )
42: {
43: sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
44: sgl_expected = ldf_1_data[index].exp; /* get expected results */
45: /*
46: * If LOOP ON ERROR is set, this is the loop for this subtest.
47: * The force loop flag is set after the first error.
48: */
49: asm("_pipe11_1_lp1:");
50: asm("ldf _sgl_value_1"); /* load the operand */
51: asm("negf"); /* negate it ( twice ) */
52: asm("negf");
53: asm("stf _sgl_st_acc"); /* store the result */
54: if( force_loop )
55: asm("brb _pipe11_1_lp1"); /* loop on an error */
56: /*
57: * verify the results
58: */
59: if( sgl_st_acc != sgl_expected ) { /* COMPARE the values */
60: errcnt++; /* bump the error count */
61: if( prt_error )
62: pipe11_print( 2 ); /* print error msg -2 NEGFS*/
63: if( halt_flg ) /* halt on error? */
64: pipe11_halt( 2 ); /* error halt -2 NEGFS */
65: if( loop_on_err ) {
66: force_loop = TRUE; /* set the force loop flag */
67: asm("jmp _pipe11_1_lp1"); /* and loop */
68: }
69: }
70: } /* end of FOR loop */
71: } /* end of subtest 1 */
72:
73:
74:
75:
76:
77: /************************************************************************
78: *
79: * SUBTEST 2 : 3 NEGFs
80: *
81: ************************************************************************/
82: pipe11_2()
83: {
84: subtest = 2;
85: force_loop = FALSE;
86: for( index = 0; index < max_ldf_1_index; index++ )
87: {
88: sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
89: sgl_expected = ldf_1_data[index].exp; /* get expected results */
90: if( sgl_expected )
91: sgl_expected ^= 0x80000000; /* negate exptd results */
92: /*
93: * If LOOP ON ERROR is set, this is the loop for this subtest.
94: * The force loop flag is set after the first error.
95: */
96: asm("_pipe11_2_lp1:");
97: asm("ldf _sgl_value_1"); /* load the operand */
98: asm("negf"); /* negate it ( 3 times ) */
99: asm("negf");
100: asm("negf");
101: asm("stf _sgl_st_acc"); /* store the result */
102: if( force_loop )
103: asm("brb _pipe11_2_lp1"); /* loop on an error */
104: /*
105: * verify the results
106: */
107: if( sgl_st_acc != sgl_expected ) { /* COMPARE the values */
108: errcnt++; /* bump the error count */
109: if( prt_error )
110: pipe11_print( 3 ); /* print error msg -3 NEGFS*/
111: if( halt_flg ) /* halt on error? */
112: pipe11_halt( 3 ); /* error halt -3 NEGFS */
113: if( loop_on_err ) {
114: force_loop = TRUE; /* set the force loop flag */
115: asm("jmp _pipe11_2_lp1"); /* and loop */
116: }
117: }
118: } /* end of FOR loop */
119: } /* end of subtest 2 */
120:
121:
122:
123:
124:
125: /************************************************************************
126: *
127: * SUBTEST 3 : 4 NEGFs
128: *
129: ************************************************************************/
130: pipe11_3()
131: {
132: subtest = 3;
133: force_loop = FALSE;
134: for( index = 0; index < max_ldf_1_index; index++ )
135: {
136: sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
137: sgl_expected = ldf_1_data[index].exp; /* get expected results */
138: /*
139: * If LOOP ON ERROR is set, this is the loop for this subtest.
140: * The force loop flag is set after the first error.
141: */
142: asm("_pipe11_3_lp1:");
143: asm("ldf _sgl_value_1"); /* load the operand */
144: asm("negf"); /* negate it ( 4 times ) */
145: asm("negf");
146: asm("negf");
147: asm("negf");
148: asm("stf _sgl_st_acc"); /* store the result */
149: if( force_loop )
150: asm("brb _pipe11_3_lp1"); /* loop on an error */
151: /*
152: * verify the results
153: */
154: if( sgl_st_acc != sgl_expected ) { /* COMPARE the values */
155: errcnt++; /* bump the error count */
156: if( prt_error )
157: pipe11_print( 4 ); /* print error msg -4 NEGFS*/
158: if( halt_flg ) /* halt on error? */
159: pipe11_halt( 4 ); /* error halt -4 NEGFS */
160: if( loop_on_err ) {
161: force_loop = TRUE; /* set the force loop flag */
162: asm("jmp _pipe11_3_lp1"); /* and loop */
163: }
164: }
165: } /* end of FOR loop */
166: } /* end of subtest 3 */
167:
168:
169:
170:
171:
172:
173: /************************************************************************
174: *
175: * SUBTEST 4 : 5 NEGFs
176: *
177: ************************************************************************/
178: pipe11_4()
179: {
180: subtest = 4;
181: force_loop = FALSE;
182: for( index = 0; index < max_ldf_1_index; index++ )
183: {
184: sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
185: sgl_expected = ldf_1_data[index].exp; /* get expected results */
186: if( sgl_expected )
187: sgl_expected ^= 0x80000000; /* negate exptd results */
188: /*
189: * If LOOP ON ERROR is set, this is the loop for this subtest.
190: * The force loop flag is set after the first error.
191: */
192: asm("_pipe11_4_lp1:");
193: asm("ldf _sgl_value_1"); /* load the operand */
194: asm("negf"); /* negate it ( 5 times ) */
195: asm("negf");
196: asm("negf");
197: asm("negf");
198: asm("negf");
199: asm("stf _sgl_st_acc"); /* store the result */
200: if( force_loop )
201: asm("brb _pipe11_4_lp1"); /* loop on an error */
202: /*
203: * verify the results
204: */
205: if( sgl_st_acc != sgl_expected ) { /* COMPARE the values */
206: errcnt++; /* bump the error count */
207: if( prt_error )
208: pipe11_print( 5 ); /* print error msg -5 NEGFS*/
209: if( halt_flg ) /* halt on error? */
210: pipe11_halt( 5 ); /* error halt -5 NEGFS */
211: if( loop_on_err ) {
212: force_loop = TRUE; /* set the force loop flag */
213: asm("jmp _pipe11_4_lp1"); /* and loop */
214: }
215: }
216: } /* end of FOR loop */
217: } /* end of subtest 4 */
218:
219:
220:
221:
222:
223: /************************************************************************
224: *
225: * SUBTEST 5 : 6 NEGFs
226: *
227: ************************************************************************/
228: pipe11_5()
229: {
230: subtest = 5;
231: force_loop = FALSE;
232: for( index = 0; index < max_ldf_1_index; index++ )
233: {
234: sgl_value_1 = ldf_1_data[index].ld; /* get operand 1 */
235: sgl_expected = ldf_1_data[index].exp; /* get expected results */
236: /*
237: * If LOOP ON ERROR is set, this is the loop for this subtest.
238: * The force loop flag is set after the first error.
239: */
240: asm("_pipe11_5_lp1:");
241: asm("ldf _sgl_value_1"); /* load the operand */
242: asm("negf"); /* negate it ( 6 times ) */
243: asm("negf");
244: asm("negf");
245: asm("negf");
246: asm("negf");
247: asm("negf");
248: asm("stf _sgl_st_acc"); /* store the result */
249: if( force_loop )
250: asm("brb _pipe11_5_lp1"); /* loop on an error */
251: /*
252: * verify the results
253: */
254: if( sgl_st_acc != sgl_expected ) { /* COMPARE the values */
255: errcnt++; /* bump the error count */
256: if( prt_error )
257: pipe11_print( 6 ); /* print error msg -6 NEGFS*/
258: if( halt_flg ) /* halt on error? */
259: pipe11_halt( 6 ); /* error halt -6 NEGFS */
260: if( loop_on_err ) {
261: force_loop = TRUE; /* set the force loop flag */
262: asm("jmp _pipe11_5_lp1"); /* and loop */
263: }
264: }
265: } /* end of FOR loop */
266: } /* end of subtest 5 */
267:
268:
269:
270:
271: /****************************************************************************
272: *
273: * PRINT AN ERROR MESSAGE
274: *
275: * cycle dd PIPELINE 11, subtest dd error
276: * LDF op, {NEGF}, STF
277: * operand = xxxxxxxx, final Acc = xxxxxxxx, data index = xxxxxxxx
278: * expected Acc = xxxxxxxx
279: ****************************************************************************/
280: pipe11_print( nop_count )
281: int nop_count; /* # of NEGF instructions */
282: {
283: writes(" \n"); /* start a new print line */
284: writes("cycle: ");
285: writed( cycle );
286: writes(" (Pipe 11), subtest ");
287: writed( subtest );
288: writes(" error\n");
289: writes(" LDF(op), NEGF");
290: while( --nop_count )
291: writes(", NEGF");
292: writes(", STF\n");
293: writec('\n');
294: writes("operand = ");
295: write32h( sgl_value_1 );
296: writes(", final Acc = ");
297: write32h( sgl_st_acc );
298: writes(", data index = ");
299: writed( index );
300: writec('\n');
301: writes(" expected Acc = ");
302: write32h( sgl_expected );
303: writec('\n');
304: }
305:
306:
307:
308: /****************************************************************************
309: *
310: * SET UP THE REGISTERS AND HALT
311: *
312: ****************************************************************************/
313: pipe11_halt( nop_count )
314: int nop_count; /* # of NEGF instructions */
315: {
316: sgl_dummy1 = nop_count;
317: asm("movl _test_no,r0"); /* r0 = test number */
318: asm("movl _subtest,r1"); /* r1 = subtest number */
319: asm("movl $1,r2"); /* r2 = error code */
320: asm("movl _cycle,r3"); /* r3 = cycle count */
321: asm("movl _sgl_dummy1,r4"); /* r4 = # of NEGFS */
322: asm("movl _sgl_value_1,r5"); /* r5 = sgl operand */
323: asm("movl _sgl_st_acc,r6"); /* r6 = sgl stored */
324: asm("movl _sgl_expected,r7"); /* r7 = sgl expected */
325: asm("movl _index,r8"); /* r8 = data index */
326: asm("halt"); /* HALT ... */
327: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.