|
|
1.1 root 1: #include "fpp_defs.h"
2:
3:
4: /*****************************************************************************
5: *
6: * DBL PIPELINE TEST #20 MONITOR
7: *
8: * This test will do a series of 2, 3, 4, 5, and 6 NEGDs.
9: * The data used will be the LDD data patterns.
10: *
11: *****************************************************************************/
12: pipe_20()
13: {
14: asm(".globl _pipeline_20_t");
15: asm("_pipeline_20_t:"); /* entry address */
16: if( (cycle == 1) && (prt_hdrs) ) /* print headers on 1st cycle */
17: writes(" PIPE_20");
18: pipe20_1(); /* 2 NOPs */
19: pipe20_2(); /* 3 NOPs */
20: pipe20_3(); /* 4 NOPs */
21: pipe20_4(); /* 5 NOPs */
22: pipe20_5(); /* 6 NOPs */
23: asm("jmp *return"); /* return to the test monitor */
24: }
25:
26:
27:
28:
29:
30: /************************************************************************
31: *
32: * SUBTEST 1 : 2 NEGDs
33: *
34: ************************************************************************/
35: pipe20_1()
36: {
37: subtest = 1;
38: force_loop = FALSE;
39: for( index = 0; index < max_ldd_1_index; index++ )
40: {
41: dbl_value_1 = ldd_1_data[index].ld; /* get operand 1 */
42: dbl_expected = ldd_1_data[index].exp; /* get expected results */
43: /*
44: * If LOOP ON ERROR is set, this is the loop for this subtest.
45: * The force loop flag is set after the first error.
46: */
47: asm("_pipe20_1_lp1:");
48: asm("ldd _dbl_value_1"); /* load the operand */
49: asm("negd"); /* negate it ( twice ) */
50: asm("negd");
51: asm("std _dbl_st_acc"); /* store the result */
52: if( force_loop )
53: asm("brb _pipe20_1_lp1"); /* loop on an error */
54: /*
55: * verify the results
56: */
57: if( (dbl_st_acc.m != dbl_expected.m) || /* COMPARE the stored */
58: (dbl_st_acc.l != dbl_expected.l) ) { /* to the expected */
59: errcnt++; /* bump the error count */
60: if( prt_error )
61: pipe20_print( 2 ); /* print error msg -2 NOPs */
62: if( halt_flg ) /* halt on error? */
63: pipe20_halt( 2 ); /* error halt -2 NOPs */
64: if( loop_on_err ) {
65: force_loop = TRUE; /* set the force loop flag */
66: asm("jmp _pipe20_1_lp1"); /* and loop */
67: }
68: }
69: } /* end of FOR loop */
70: } /* end of subtest 1 */
71:
72:
73:
74:
75:
76: /************************************************************************
77: *
78: * SUBTEST 2 : 3 NEGDs
79: *
80: ************************************************************************/
81: pipe20_2()
82: {
83: subtest = 2;
84: force_loop = FALSE;
85: for( index = 0; index < max_ldd_1_index; index++ )
86: {
87: dbl_value_1 = ldd_1_data[index].ld; /* get operand 1 */
88: dbl_expected = ldd_1_data[index].exp; /* get expected results */
89: if( dbl_expected.m )
90: dbl_expected.m ^= 0x80000000; /* negate exptd results */
91: /*
92: * If LOOP ON ERROR is set, this is the loop for this subtest.
93: * The force loop flag is set after the first error.
94: */
95: asm("_pipe20_2_lp1:");
96: asm("ldd _dbl_value_1"); /* load the operand */
97: asm("negd"); /* negate it ( 3 times ) */
98: asm("negd");
99: asm("negd");
100: asm("std _dbl_st_acc"); /* store the result */
101: if( force_loop )
102: asm("brb _pipe20_2_lp1"); /* loop on an error */
103: /*
104: * verify the results
105: */
106: if( (dbl_st_acc.m != dbl_expected.m) || /* COMPARE the stored */
107: (dbl_st_acc.l != dbl_expected.l) ) { /* to the expected */
108: errcnt++; /* bump the error count */
109: if( prt_error )
110: pipe20_print( 3 ); /* print error msg -3 NOPs */
111: if( halt_flg ) /* halt on error? */
112: pipe20_halt( 3 ); /* error halt -3 NOPs */
113: if( loop_on_err ) {
114: force_loop = TRUE; /* set the force loop flag */
115: asm("jmp _pipe20_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 NEGDs
128: *
129: ************************************************************************/
130: pipe20_3()
131: {
132: subtest = 3;
133: force_loop = FALSE;
134: for( index = 0; index < max_ldd_1_index; index++ )
135: {
136: dbl_value_1 = ldd_1_data[index].ld; /* get operand 1 */
137: dbl_expected = ldd_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("_pipe20_3_lp1:");
143: asm("ldd _dbl_value_1"); /* load the operand */
144: asm("negd"); /* negate it ( 4 times ) */
145: asm("negd");
146: asm("negd");
147: asm("negd");
148: asm("std _dbl_st_acc"); /* store the result */
149: if( force_loop )
150: asm("brb _pipe20_3_lp1"); /* loop on an error */
151: /*
152: * verify the results
153: */
154: if( (dbl_st_acc.m != dbl_expected.m) || /* COMPARE the stored */
155: (dbl_st_acc.l != dbl_expected.l) ) { /* to the expected */
156: errcnt++; /* bump the error count */
157: if( prt_error )
158: pipe20_print( 4 ); /* print error msg -4 NOPs */
159: if( halt_flg ) /* halt on error? */
160: pipe20_halt( 4 ); /* error halt -4 NOPs */
161: if( loop_on_err ) {
162: force_loop = TRUE; /* set the force loop flag */
163: asm("jmp _pipe20_3_lp1"); /* and loop */
164: }
165: }
166: } /* end of FOR loop */
167: } /* end of subtest 3 */
168:
169:
170:
171:
172:
173:
174: /************************************************************************
175: *
176: * SUBTEST 4 : 5 NEGDs
177: *
178: ************************************************************************/
179: pipe20_4()
180: {
181: subtest = 4;
182: force_loop = FALSE;
183: for( index = 0; index < max_ldd_1_index; index++ )
184: {
185: dbl_value_1 = ldd_1_data[index].ld; /* get operand 1 */
186: dbl_expected = ldd_1_data[index].exp; /* get expected results */
187: if( dbl_expected.m )
188: dbl_expected.m ^= 0x80000000; /* negate exptd results */
189: /*
190: * If LOOP ON ERROR is set, this is the loop for this subtest.
191: * The force loop flag is set after the first error.
192: */
193: asm("_pipe20_4_lp1:");
194: asm("ldd _dbl_value_1"); /* load the operand */
195: asm("negd"); /* negate it ( 5 times ) */
196: asm("negd");
197: asm("negd");
198: asm("negd");
199: asm("negd");
200: asm("std _dbl_st_acc"); /* store the result */
201: if( force_loop )
202: asm("brb _pipe20_4_lp1"); /* loop on an error */
203: /*
204: * verify the results
205: */
206: if( (dbl_st_acc.m != dbl_expected.m) || /* COMPARE the stored */
207: (dbl_st_acc.l != dbl_expected.l) ) { /* to the expected */
208: errcnt++; /* bump the error count */
209: if( prt_error )
210: pipe20_print( 5 ); /* print error msg -5 NOPs */
211: if( halt_flg ) /* halt on error? */
212: pipe20_halt( 5 ); /* error halt -5 NOPs */
213: if( loop_on_err ) {
214: force_loop = TRUE; /* set the force loop flag */
215: asm("jmp _pipe20_4_lp1"); /* and loop */
216: }
217: }
218: } /* end of FOR loop */
219: } /* end of subtest 4 */
220:
221:
222:
223:
224:
225: /************************************************************************
226: *
227: * SUBTEST 5 : 6 NEGDs
228: *
229: ************************************************************************/
230: pipe20_5()
231: {
232: subtest = 5;
233: force_loop = FALSE;
234: for( index = 0; index < max_ldd_1_index; index++ )
235: {
236: dbl_value_1 = ldd_1_data[index].ld; /* get operand 1 */
237: dbl_expected = ldd_1_data[index].exp; /* get expected results */
238: /*
239: * If LOOP ON ERROR is set, this is the loop for this subtest.
240: * The force loop flag is set after the first error.
241: */
242: asm("_pipe20_5_lp1:");
243: asm("ldd _dbl_value_1"); /* load the operand */
244: asm("negd"); /* negate it ( 6 times ) */
245: asm("negd");
246: asm("negd");
247: asm("negd");
248: asm("negd");
249: asm("negd");
250: asm("std _dbl_st_acc"); /* store the result */
251: if( force_loop )
252: asm("brb _pipe20_5_lp1"); /* loop on an error */
253: /*
254: * verify the results
255: */
256: if( (dbl_st_acc.m != dbl_expected.m) || /* COMPARE the stored */
257: (dbl_st_acc.l != dbl_expected.l) ) { /* to the expected */
258: errcnt++; /* bump the error count */
259: if( prt_error )
260: pipe20_print( 6 ); /* print error msg -6 NOPs */
261: if( halt_flg ) /* halt on error? */
262: pipe20_halt( 6 ); /* error halt -6 NOPs */
263: if( loop_on_err ) {
264: force_loop = TRUE; /* set the force loop flag */
265: asm("jmp _pipe20_5_lp1"); /* and loop */
266: }
267: }
268: } /* end of FOR loop */
269: } /* end of subtest 5 */
270:
271:
272:
273:
274: /****************************************************************************
275: *
276: * PRINT AN ERROR MESSAGE
277: *
278: * cycle dd PIPELINE 20, subtest dd error
279: * LDD op, {NEGD}, STD
280: * operand = xxxxxxxx xxxxxxxx, final Acc = xxxxxxxx xxxxxxxx, index = dd
281: * expected Acc = xxxxxxxx xxxxxxxx
282: *
283: ****************************************************************************/
284: pipe20_print( nop_count )
285: int nop_count; /* # of NOP instructions */
286: {
287: writes(" \n"); /* start a new print line */
288: writes("cycle: ");
289: writed( cycle );
290: writes(" PIPELINE 20, subtest ");
291: writed( subtest );
292: writes(" error\n");
293: writes(" LDD(op), NEGD");
294: while( --nop_count )
295: writes(", NEGD");
296: writes(", STD\n");
297: writes("operand = ");
298: write32h( dbl_value_1.m );
299: writec(' ');
300: write32h( dbl_value_1.l );
301: writes(", final Acc = ");
302: write32h( dbl_st_acc.m );
303: writec(' ');
304: write32h( dbl_st_acc.l );
305: writes(", index = ");
306: writed( index );
307: writes("\n expected Acc = ");
308: write32h( dbl_expected.m );
309: writec(' ');
310: write32h( dbl_expected.l );
311: writec('\n');
312: }
313:
314:
315:
316: /****************************************************************************
317: *
318: * SET UP THE REGISTERS AND HALT
319: *
320: ****************************************************************************/
321: pipe20_halt( nop_count )
322: int nop_count; /* # of NOP instructions */
323: {
324: sgl_dummy1 = nop_count;
325: sgl_value_1 = dbl_value_1.m;
326: sgl_value_2 = dbl_value_1.l;
327: sgl_value_3 = dbl_st_acc.m;
328: sgl_value_4 = dbl_st_acc.l;
329: sgl_value_5 = dbl_expected.m;
330: sgl_value_6 = dbl_expected.l;
331: asm("movl _test_no,r0"); /* r0 = test number */
332: asm("movl _subtest,r1"); /* r1 = subtest number */
333: asm("movl $1,r2"); /* r2 = error code */
334: asm("movl _cycle,r3"); /* r3 = cycle count */
335: asm("movl _sgl_dummy1,r4"); /* r4 = # of NEGDS */
336: asm("movl _sgl_value_1,r5"); /* r5 = MS operand */
337: asm("movl _sgl_value_2,r6"); /* r6 = LS operand */
338: asm("movl _sgl_value_3,r7"); /* r7 = MS stored */
339: asm("movl _sgl_value_4,r8"); /* r8 = LS stored */
340: asm("movl _sgl_value_5,r9"); /* r9 = MS expected */
341: asm("movl _sgl_value_6,r10"); /* r10 = LS expected */
342: asm("movl _index,r11"); /* r11 = data index */
343: asm("halt"); /* HALT ... */
344: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.