Annotation of cci/d/macro4/pipe19.c, revision 1.1.1.1

1.1       root        1: 
                      2: #include "fpp_defs.h"
                      3: 
                      4: 
                      5: /*****************************************************************************
                      6: *
                      7: *              PIPELINE TEST #19 
                      8: *
                      9: *      LDD(op1), MULD(op2), STD op3, SUBD op3, STD
                     10: *
                     11: *  -where the operands are the fmacro1 MULD data patterns. The SUBD operand
                     12: *   is the stored result of the MULD.
                     13: *  -If the 1st STD isn't completed before the SUBD data is fetched then we
                     14: *   won't get a final accumulator of zero.
                     15: *****************************************************************************/
                     16: pipe_19()
                     17: {
                     18:        asm(".globl _pipeline_19_t");
                     19:        asm("_pipeline_19_t:");
                     20:        if( (cycle == 1) && (prt_hdrs) )        /* print headers on 1st cycle */
                     21:           writes(" PIPE_19");
                     22:        force_loop = FALSE;                     /* clear force_loop flag */
                     23:        for( index = 0; index <= max_muld_1_index; index++ ) {
                     24:              dbl_value_1  = muld_1_data[index].op_1;   /* get the data    */
                     25:              dbl_value_2  = muld_1_data[index].op_2;   /*   operands      */
                     26:              dbl_expected = muld_1_data[index].exp; 
                     27: /*
                     28:  *  This is the start of the LOOP ON ERROR section
                     29: */
                     30:              asm("_pipe19_1_lp:");
                     31:              asm("ldd _dbl_value_1");          /* get the 1st operand     */
                     32:              asm("muld _dbl_value_2");         /* multiply by the 2nd op. */
                     33:              asm("std _dbl_value_3");          /* save the MULD result    */
                     34:              asm("subd _dbl_value_3");         /* and subtract it again   */
                     35:              asm("std _dbl_st_acc");           /* save the final result   */
                     36:              if( force_loop ) 
                     37:                    asm("brb _pipe19_1_lp");;   /* loop on the error */
                     38: /*
                     39:  *   Verify the results
                     40: */
                     41:              if( (dbl_st_acc.m) || (dbl_st_acc.l) ) {  /* the Acc s/b = 0 */
                     42:                    errcnt++;                   /* bump the error count    */
                     43:                    if ( prt_error ) 
                     44:                          pipe19_print();       /* print the error mesage  */
                     45:                    if ( halt_flg )
                     46:                          pipe19_halt( 1 );     /* halt on the error       */
                     47:                    if ( loop_on_err )  {
                     48:                          force_loop = TRUE;
                     49:                          asm("jmp _pipe19_1_lp");;   
                     50:                    }
                     51:              }
                     52:        } 
                     53:        asm("jmp *return");             /* return to the test monitor       */
                     54: }
                     55: 
                     56: 
                     57: 
                     58: 
                     59: /*
                     60:  **************************************************************************
                     61:  *
                     62:  *             print an error message of the form
                     63:  *
                     64:  * cycle: xx  Test xx (Pipe 19), error
                     65:  * test sequence = LDD(op1), MULD(op2), STD(op3), SUBD(op3), STD
                     66:  * operand 1 = xxxxxxxx xxxxxxxx,    final Acc = xxxxxxxx xxxxxxxx,  index = xx
                     67:  * operand 2 = xxxxxxxx xxxxxxxx, expected Acc = xxxxxxxx xxxxxxxx
                     68:  * operand 3 = xxxxxxxx xxxxxxxx, expected op3 = xxxxxxxx xxxxxxxx
                     69:  **************************************************************************
                     70: */
                     71: pipe19_print()
                     72: {
                     73:        writes(" \n");          /* start a new print line   */
                     74:        writes("cycle: ");
                     75:        writed( cycle );
                     76:        writes("  Test ");
                     77:        writed( test_no );
                     78:        writes("  (Pipe 19), error\n");
                     79:        writes("LDD(op1), MULD(op2), STD(op3), SUBD(op3), STD\n");
                     80:        writes("operand 1 = ");
                     81:        write32h( dbl_value_1.m );
                     82:        writec(' ');
                     83:        write32h( dbl_value_1.l );
                     84:        writes(",    final Acc = ");
                     85:        write32h( dbl_st_acc.m );
                     86:        writec(' ');
                     87:        write32h( dbl_st_acc.l );
                     88:        writes(",  index = ");
                     89:        writed( index );
                     90:        writes("\noperand 2 = ");
                     91:        write32h( dbl_value_2.m );
                     92:        writec(' ');
                     93:        write32h( dbl_value_2.l );
                     94:        writes(", expected Acc = ");
                     95:        write32h( 0 );
                     96:        writec(' ');
                     97:        write32h( 0 );
                     98:        writes("\noperand 3 = ");
                     99:        write32h( dbl_value_3.m );
                    100:        writec(' ');
                    101:        write32h( dbl_value_3.l );
                    102:        writes(", expected op3 = ");
                    103:        write32h( dbl_expected.m );
                    104:        writec(' ');
                    105:        write32h( dbl_expected.l );
                    106:        writec('\n');
                    107: }
                    108: 
                    109: 
                    110: 
                    111: /*
                    112:  **************************************************************************
                    113:  *
                    114:  *             HALT ON AN ERROR
                    115:  *
                    116:  **************************************************************************
                    117: */
                    118: pipe19_halt()
                    119: {
                    120:         sgl_value_1 = dbl_value_1.m;
                    121:         sgl_value_2 = dbl_value_1.l;
                    122:         sgl_value_3 = dbl_value_2.m;
                    123:         sgl_value_4 = dbl_value_2.l;
                    124:         sgl_value_5 = dbl_value_3.m;
                    125:         sgl_value_6 = dbl_value_3.l;
                    126:         asm("movl _test_no,r0");       /* r0  = test number        */
                    127:         asm("movl $1,r1");             /* r1  = subtest number     */
                    128:         asm("movl $1,r2");             /* r2  = error code         */
                    129:         asm("movl _cycle,r3");         /* r3  = cycle count        */
                    130:         asm("movl _sgl_value_1,r4");   /* r4  = MS of operand #1   */
                    131:         asm("movl _sgl_value_2,r5");   /* r5  = LS of operand #1   */
                    132:         asm("movl _sgl_value_3,r6");   /* r6  = MS of operand #2   */
                    133:         asm("movl _sgl_value_4,r7");   /* r7  = LS of operand #2   */
                    134:         asm("movl _sgl_value_5,r8");   /* r8  = MS of operand #3   */
                    135:         asm("movl _sgl_value_6,r9");   /* r9  = LS of operand #3   */
                    136:         sgl_value_1 = dbl_st_acc.m;
                    137:         sgl_value_2 = dbl_st_acc.l;
                    138:         asm("movl _sgl_value_1,r10");  /* r10 = MS of final value  */
                    139:         asm("movl _sgl_value_2,r11");  /* r11 = LS of final value  */
                    140:         asm("clrl r12");               /* r12 = MS exp value (0)   */
                    141:         asm("clrl r13");               /* r13 = LS exp value (0)   */
                    142:         asm("movl _index,r14");        /* r14 = data index         */
                    143:         asm("halt");                   /* HALT ...                 */
                    144: }  
                    145: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.