|
|
1.1 ! root 1: #include "fpp_defs.h" ! 2: ! 3: ! 4: /***************************************************************************** ! 5: * ! 6: * PIPELINE TEST #18 ! 7: * ! 8: * LDD(op1), MULD(op2), CVDL r0, SUBD operand[r0], STD ! 9: * ! 10: * -where the operands are the fmacro1 MULD data patterns. The SUBD operand's ! 11: * address is based on the result of the CVDL. ! 12: * -The load, multiply, and convert will be done twice. The first time will ! 13: * be to get the index and the data to subtract. The data to subtract will ! 14: * be the same as the accumulator so we'll expect a reasult of zero. The ! 15: * data will be stored based on the 1st CVDL result. ! 16: * -If the 2nd CVDL doesn't get done before the SUBD operand is fetched then ! 17: * we won't get a final accumulator of zero. ! 18: * -For size reasons, only the MULD data with a result between -100 and +100 ! 19: * will be used for this test. ! 20: *****************************************************************************/ ! 21: pipe_18() ! 22: { ! 23: asm(".globl _pipeline_18_t"); ! 24: asm("_pipeline_18_t:"); ! 25: if( (cycle == 1) && (prt_hdrs) ) /* print headers on 1st cycle */ ! 26: writes(" PIPE_18"); ! 27: force_loop = FALSE; /* clear force_loop flag */ ! 28: for( index = 0; index <= max_muld_1_index; index++ ) { ! 29: dbl_value_1 = muld_1_data[index].op_1; /* get the data */ ! 30: dbl_value_2 = muld_1_data[index].op_2; /* operands */ ! 31: dbl_expected.m = dbl_expected.l = 0; /* result s/b 0 */ ! 32: asm("ldd _dbl_value_1"); ! 33: asm("muld _dbl_value_2"); ! 34: asm("cvdl _index2"); ! 35: asm("nop"); ! 36: if( (index2 >= -99) && (index2 <= 99) ) { ! 37: if( index2 ) { ! 38: sgl_value_5 = 0; /* set a dummy index */ ! 39: adr_dpipe_ops[sgl_value_5].m = 0; ! 40: adr_dpipe_ops[sgl_value_5].l = 0xabadface; ! 41: } else { ! 42: sgl_value_5 = 6; /* set a dummy index */ ! 43: adr_dpipe_ops[sgl_value_5].m = 0xabadbabe; ! 44: adr_dpipe_ops[sgl_value_5].l = 0xabadface; ! 45: } ! 46: asm("movl _index2,r0"); /* save the index */ ! 47: asm("std _dpipe_ops[r0]"); /* save the Acc's value */ ! 48: asm("std _dbl_value_3"); /* save this value */ ! 49: /* ! 50: * This is the start of the LOOP ON ERROR section ! 51: */ ! 52: asm("_pipe18_1_lp:"); ! 53: asm("movl _sgl_value_5,r0"); /* save the bum index */ ! 54: asm("ldd _dbl_value_1"); ! 55: asm("muld _dbl_value_2"); ! 56: asm("cvdl r0"); /* set up the index to use */ ! 57: asm("subd _dpipe_ops[r0]"); /* subtract saved value */ ! 58: asm("std _dbl_st_acc"); ! 59: asm("movl r0,_sgl_value_6"); /* save the index used */ ! 60: if( force_loop ) ! 61: asm("brb _pipe18_1_lp");; /* loop on the error */ ! 62: /* ! 63: * Verify the results (the accumulator should be = 0) ! 64: */ ! 65: if( (dbl_st_acc.m) || (dbl_st_acc.l) ) { ! 66: errcnt++; /* bump the error count */ ! 67: if ( prt_error ) ! 68: pipe18_print(); /* print the error mesage */ ! 69: if ( halt_flg ) ! 70: pipe18_halt( 1 ); /* halt on the error */ ! 71: if ( loop_on_err ) { ! 72: force_loop = TRUE; ! 73: asm("jmp _pipe18_1_lp");; ! 74: } ! 75: } ! 76: } ! 77: } ! 78: asm("jmp *return"); /* return to the test monitor */ ! 79: } ! 80: ! 81: ! 82: ! 83: ! 84: /* ! 85: ************************************************************************** ! 86: * ! 87: * print an error message of the form ! 88: * ! 89: * cycle: xx Test xx, Error with subtract data based on CVDL value, index = xx ! 90: * test sequence = LDD(op1), MULD(op2), CVDL r0, SUBD operand[r0], STD ! 91: *operand 1 = xxxxxxx xxxxxxx, final Acc = xxxxxxx xxxxxxx, index = xxxxxxx ! 92: *operand 2 = xxxxxxx xxxxxxx, expected Acc = xxxxxxx xxxxxxx ! 93: *operand 3 = xxxxxxx xxxxxxx, CVDL result = xxxxxxx ! 94: * int expected = xxxxxxx ! 95: ************************************************************************** ! 96: */ ! 97: pipe18_print() ! 98: { ! 99: writes(" \n"); /* start a new print line */ ! 100: writes("cycle: "); ! 101: writed( cycle ); ! 102: writes(" Test "); ! 103: writed( test_no ); ! 104: writes(" (Pipe 18), error\n"); ! 105: writes(" LDD(op1), MULD(op2), CVDL(r0), SUBD(op3), STD\n"); ! 106: writes("operand 1 = "); ! 107: write32h( dbl_value_1.m ); ! 108: writec(' '); ! 109: write32h( dbl_value_1.l ); ! 110: writes(", final Acc = "); ! 111: write32h( dbl_st_acc.m ); ! 112: writec(' '); ! 113: write32h( dbl_st_acc.l ); ! 114: writes(", index = "); ! 115: writed( index ); ! 116: writes("\noperand 2 = "); ! 117: write32h( dbl_value_2.m ); ! 118: writec(' '); ! 119: write32h( dbl_value_2.l ); ! 120: writes(", expected Acc = "); ! 121: write32h( dbl_expected.m ); ! 122: writec(' '); ! 123: write32h( dbl_expected.l ); ! 124: writes("\noperand 3 = "); ! 125: write32h( dbl_value_3.m ); ! 126: writec(' '); ! 127: write32h( dbl_value_3.l ); ! 128: writes(", CVDL result = "); ! 129: write32h( sgl_value_6 ); ! 130: writec('\n'); ! 131: writes(" int expected = "); ! 132: write32h( index2 ); ! 133: writec('\n'); ! 134: } ! 135: ! 136: ! 137: ! 138: /* ! 139: ************************************************************************** ! 140: * ! 141: * HALT ON AN ERROR ! 142: * ! 143: ************************************************************************** ! 144: */ ! 145: pipe18_halt() ! 146: { ! 147: sgl_value_1 = dbl_value_1.m; ! 148: sgl_value_2 = dbl_value_1.l; ! 149: sgl_value_3 = dbl_value_2.m; ! 150: sgl_value_4 = dbl_value_2.l; ! 151: asm("movl _test_no,r0"); /* r0 = test number */ ! 152: asm("movl $1,r1"); /* r1 = subtest number */ ! 153: asm("movl $1,r2"); /* r2 = error code */ ! 154: asm("movl _cycle,r3"); /* r3 = cycle count */ ! 155: asm("movl _sgl_value_1,r4"); /* r4 = MS of dbl operand #1 */ ! 156: asm("movl _sgl_value_2,r5"); /* r5 = LS of dbl operand #1 */ ! 157: asm("movl _sgl_value_3,r6"); /* r6 = MS of dbl operand #2 */ ! 158: asm("movl _sgl_value_4,r7"); /* r7 = LS of dbl operand #2 */ ! 159: sgl_value_1 = dbl_st_acc.m; ! 160: sgl_value_2 = dbl_st_acc.l; ! 161: sgl_value_3 = dbl_expected.m; ! 162: sgl_value_4 = dbl_expected.l; ! 163: sgl_value_5 = dbl_value_3.m; ! 164: sgl_value_6 = dbl_value_3.l; ! 165: asm("movl _sgl_value_5,r8"); /* r8 = MS of dbl operand #3 */ ! 166: asm("movl _sgl_value_6,r9"); /* r9 = LS of dbl operand #3 */ ! 167: asm("movl _sgl_value_1,r10"); /* r10 = MS of final result */ ! 168: asm("movl _sgl_value_2,r11"); /* r11 = LS of final result */ ! 169: asm("movl _sgl_value_3,r12"); /* r12 = MS of expected result */ ! 170: asm("movl _sgl_value_4,r13"); /* r13 = LS of expected result */ ! 171: asm("movl _index,r14"); /* r14 = data index */ ! 172: asm("halt"); /* HALT ... */ ! 173: } ! 174:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.