Annotation of cci/d/macro4/pipe9.c, revision 1.1

1.1     ! root        1: #include "fpp_defs.h"
        !             2: 
        !             3: /*****************************************************************************
        !             4: *
        !             5: *              PIPELINE TEST #9 
        !             6: *
        !             7: *      LDF(op1), MULF(op2), CVFL r0, SUBF operand[r0], STF
        !             8: *
        !             9: *  -where the operands are the fmacro1 MULF data patterns. The SUBF operand's
        !            10: *   address is based on the result of the CVFL.
        !            11: *  -The load, multiply, and convert will be done twice. The first time will
        !            12: *   be to get the index and the data to subtract. The data to subtract will 
        !            13: *   be the same as the accumulator so we'll expect a reasult of zero. The 
        !            14: *   data will be stored based on the 1st CVFL result.
        !            15: *  -If the 2nd CVFL doesn't get done before the SUBF operand is fetched then
        !            16: *   we won't get a final accumulator of zero.
        !            17: *  -For size reasons, only the MULF data with a result between -100 and +100
        !            18: *   will be used for this test.
        !            19: *****************************************************************************/
        !            20: pipe_9()
        !            21: {
        !            22:        asm(".globl _pipeline_9_t");
        !            23:        asm("_pipeline_9_t:");
        !            24:        if( (cycle == 1) && (prt_hdrs) )        /* print headers on 1st cycle */
        !            25:           writes(" PIPE_9 ");
        !            26:        force_loop = FALSE;                     /* clear force_loop flag */
        !            27:        for( index = 0; index <= max_mulf_1_index; index++ ) {
        !            28:              sgl_value_1  = mulf_1_data[index].op_1;   /* get the data  */
        !            29:              sgl_value_2  = mulf_1_data[index].op_2;   /*   operands    */
        !            30:              sgl_expected = mulf_1_data[index].exp; 
        !            31:              asm("ldf _sgl_value_1");
        !            32:              asm("mulf _sgl_value_2");
        !            33:              asm("cvfl _index2");
        !            34:              asm("nop");
        !            35:              if( (index2 >= -99) && (index2 <= 99) ) { 
        !            36:                   if( index2 ) {
        !            37:                        sgl_value_5 = 0;        /* set a dummy index */
        !            38:                        adr_pipe_ops[sgl_value_5] = 0;
        !            39:                   } else {
        !            40:                        sgl_value_5 = 6;        /* set a dummy index */
        !            41:                        adr_pipe_ops[sgl_value_5] = 0xabadbabe;
        !            42:                   }
        !            43:                   asm("movl _index2,r0");      /* save the index */
        !            44:                   asm("stf _pipe_ops[r0]");    /* save the Acc's value */
        !            45:                   asm("stf _sgl_value_4");     /* save this value */
        !            46: /*
        !            47:  *  This is the start of the LOOP ON ERROR section
        !            48: */
        !            49:                   asm("_pipe9_1_lp:");
        !            50:                   asm("movl _sgl_value_5,r0"); /* save the bum index */
        !            51:                   asm("ldf _sgl_value_1");     
        !            52:                   asm("mulf _sgl_value_2");
        !            53:                   asm("cvfl r0");              /* set up the index to use */
        !            54:                   asm("subf _pipe_ops[r0]");   /* subtract saved value */
        !            55:                   asm("stf _sgl_st_acc");
        !            56:                   asm("movl r0,_sgl_value_6"); /* save the index used */
        !            57:                   if( force_loop ) 
        !            58:                        asm("brb _pipe9_1_lp");;        /* loop on the error */
        !            59: /*
        !            60:  *   Verify the results
        !            61: */
        !            62:                   if( sgl_st_acc ) {           /* the Acc s/b cleared */
        !            63:                         errcnt++;              /* bump the error count    */
        !            64:                         if ( prt_error ) 
        !            65:                             pipe9_print();     /* print the error mesage  */
        !            66:                         if ( halt_flg )
        !            67:                             pipe9_halt( 1 );   /* halt on the error       */
        !            68:                         if ( loop_on_err )  {
        !            69:                             force_loop = 1;
        !            70:                             asm("jmp _pipe9_1_lp");;   
        !            71:                         }
        !            72:                   }
        !            73:              }
        !            74:        };
        !            75:        asm("jmp *return");             /* return to the test monitor       */
        !            76: }
        !            77: 
        !            78: 
        !            79: 
        !            80: 
        !            81: /***************************************************************************
        !            82:  *
        !            83:  *             print an error message of the form
        !            84:  *
        !            85:  * cycle: xx  Test xx, (Pipe 9), error
        !            86:  * test sequence = LDF(op1), MULF(op2), CVFL r0, SUBF operand[r0], STF
        !            87:  * op #1 = xxxxxxxx,     final Acc = xxxxxxxx,   data index = xxxxxxxx
        !            88:  * op #2 = xxxxxxxx,  expected Acc = xxxxxxxx
        !            89:  * op #3 = xxxxxxxx,   CVFL result = xxxxxxxx
        !            90:  *                    int expected = xxxxxxxx
        !            91:  ***************************************************************************/
        !            92: pipe9_print()
        !            93: {
        !            94:         writes("\n");          /* start a new print line   */
        !            95:         writes("cycle: ");
        !            96:         writed( cycle );
        !            97:         writes("  Test ");
        !            98:         writed( test_no );
        !            99:         writes("   (Pipe 9), error\n");
        !           100:         writes(" LDF(op1), MULF(op2), CVFL(r0), SUBF(op3), STF\n");
        !           101:         writes("operand 1 = ");
        !           102:         write32h( sgl_value_1 );
        !           103:         writes(",     final Acc = ");
        !           104:         write32h( sgl_st_acc );
        !           105:         writes(",   data index = ");
        !           106:         writed( index );
        !           107:         writec('\n');
        !           108:         writes("operand 2 = ");
        !           109:         write32h( sgl_value_2 );
        !           110:         writes(",  expected Acc = ");
        !           111:         write32h( sgl_expected );
        !           112:         writec('\n');
        !           113:         writes("operand 3 = ");
        !           114:         write32h( sgl_value_4 );
        !           115:         writes(",   CVFL result = ");
        !           116:         write32h( sgl_value_6 );
        !           117:         writec('\n');
        !           118:         writes("                       int expected = ");
        !           119:         write32h( index2 );
        !           120:         writec('\n');
        !           121: 
        !           122: 
        !           123: }
        !           124: 
        !           125: 
        !           126: 
        !           127: /*
        !           128:  **************************************************************************
        !           129:  *
        !           130:  *             HALT ON AN ERROR
        !           131:  *
        !           132:  **************************************************************************
        !           133: */
        !           134: pipe9_halt()
        !           135: {
        !           136:         asm("movl _test_no,r0");       /* r0  = test number        */
        !           137:         asm("movl $1,r1");             /* r1  = subtest number     */
        !           138:         asm("movl $1,r2");             /* r2  = error code         */
        !           139:         asm("movl _cycle,r3");         /* r3  = cycle count        */
        !           140:         asm("movl _sgl_value_1,r4");   /* r4  = sgl operand #1     */
        !           141:         asm("movl _sgl_value_2,r5");   /* r5  = sgl operand #2     */
        !           142:         asm("movl _sgl_st_acc,r6");    /* r6  = sgl stored         */
        !           143:         asm("movl _sgl_expected,r7");  /* r7  = sgl expected       */
        !           144:         asm("movl _sgl_value_6,r8");   /* r8  = CVFL int actual    */
        !           145:         asm("movl _index2,r9");        /* r9  = CVFL int expected  */
        !           146:         asm("movl _index,r10");        /* r10 = data index         */
        !           147:         asm("halt");                   /* HALT ...                 */
        !           148: }  

unix.superglobalmegacorp.com

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