Annotation of cci/d/dmp4/common.c, revision 1.1.1.1

1.1       root        1: 
                      2: #include "dmp_defs.h"
                      3: 
                      4: /***********************************************************************
                      5: *
                      6: *      COMMON ROUTINES FOR THE DEMAND PAGING TESTS
                      7: *
                      8: ***********************************************************************/
                      9: 
                     10: 
                     11: 
                     12: /************************************************************************
                     13: *              print a demand paging test error message
                     14: *
                     15: * The message will be of the form:
                     16: * cycle: xx. DMP test xx. <inst>. <error message>
                     17: * instruction cache {hit/miss},  data index = xx,  page faults on byte(s) 0, x
                     18: * addressing mode: <addressing mode description>
                     19: * { pipeline test #x. <instruction buffer description> }
                     20: * inst buf = xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx
                     21: ************************************************************************/
                     22: prt_dmp_er_msg( msg )
                     23: char *msg;
                     24: {
                     25: int page_byte;
                     26:        if( !error )  {                         /* 1st err. for this inst? */
                     27:             error++;                           /* set current error flg   */
                     28:             writec('\n');                      /* start a new line        */
                     29:        }
                     30:        writes("\ncycle: ");
                     31:        writed( cycle );                        /* print the cycle #     */
                     32:        writes(". DMP test ");
                     33:        writeh( test_no );                      /* print the test #      */
                     34:        writes(". ");
                     35:        writes( op_name );                      /* print the inst name   */
                     36:        writes( msg );                          /* print the error msg   */
                     37:        writes("\ninstruction cache ");
                     38:        if( i_cache_hit )
                     39:             writes("hit");
                     40:        else
                     41:             writes("miss");
                     42:        writes(",  data index = ");             /* print the data index  */
                     43:        writed( index );
                     44:        writes(",  page faults on inst. byte(s) 0");
                     45:        page_byte = 20 - shift_count;           /* get byte w/ page break */
                     46:        if( page_byte ) {
                     47:            writes(", ");
                     48:            writed( page_byte );
                     49:        }
                     50:        writec('\n');
                     51:        if( no_ops ) {                          /* print the addressing mode */
                     52:            writes("addressing mode: ");
                     53:            writes( addressing_modes[ addr_mode ] );
                     54:            writec('\n');
                     55:        }
                     56:        if( pipe_test ) {
                     57:             writes("pipeline test #");
                     58:             writed( pipe_test );               /* print the pipe test # */
                     59:             writes(".  ");
                     60:             if( pipe_inst1 == LDD_OP_CODE )
                     61:                   writes("LDD (initial acc), ");
                     62:               else if( pipe_inst1 == LDF_OP_CODE )
                     63:                   writes("LDF (initial acc), ");
                     64:               else if( pipe_inst1 == MULD_OP_CODE )
                     65:                   writes("MULD (1.0), ");
                     66:               else if( pipe_inst1 == MULF_OP_CODE )
                     67:                   writes("MULF (1.0), ");
                     68:             writes( op_name );
                     69:             if( !(no_ops) )
                     70:                 writes(",  ");
                     71:             else if( no_ops == 1 )
                     72:                 writes(" (operand),  ");
                     73:             else if( no_ops == 2 )
                     74:                 writes(" (op #1, op #2),  ");
                     75:             if( pipe_inst2 == MULD_OP_CODE )
                     76:                 writes("MULD (1.0)\n");
                     77:             else
                     78:                 writes("MULF (1.0)\n");
                     79:        }
                     80:        print_inst_buf();               /* print the inst buf contents */
                     81: }
                     82: 
                     83: 
                     84: 
                     85: /********************************************************************
                     86: *      print the contents of the instruction buffer
                     87: * inst buf = xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx
                     88: ********************************************************************/
                     89: print_inst_buf()
                     90: {
                     91: int page_byte;
                     92:        writes("inst buf =");
                     93:        write_lw_bytes( inst_buf[0] );    /* print word 0 as bytes */
                     94:        write_lw_bytes( inst_buf[1] );    /* print word 1 as bytes */
                     95:        write_lw_bytes( inst_buf[2] );    /* print word 2 as bytes */
                     96:        write_lw_bytes( inst_buf[3] );    /* print word 3 as bytes */
                     97:        write_lw_bytes( inst_buf[4] );    /* print word 4 as bytes */
                     98:        writec('\n');
                     99: }
                    100: 
                    101: 
                    102: 
                    103: 
                    104: /********************************************************************
                    105: *      print a longword a byte at a time
                    106: ********************************************************************/
                    107: write_lw_bytes( lw )
                    108: int lw;
                    109: {
                    110:        writec(' ');
                    111:        writeh( (lw >> 28) & 0xf );
                    112:        writeh( (lw >> 24) & 0xf );
                    113:        writec(' ');
                    114:        writeh( (lw >> 20) & 0xf );
                    115:        writeh( (lw >> 16) & 0xf );
                    116:        writec(' ');
                    117:        writeh( (lw >> 12) & 0xf );
                    118:        writeh( (lw >> 8) & 0xf );
                    119:        writec(' ');
                    120:        writeh( (lw >> 4) & 0xf );
                    121:        writeh( (lw & 0xf) );
                    122: }
                    123:                 
                    124: 
                    125: 
                    126: /********************************************************************
                    127: *      print the information for a bad register fault
                    128: ********************************************************************/
                    129: prt_reg_data()
                    130: {
                    131:            writes(" register ");
                    132:            writed( reg_no );
                    133:            writes(" = ");
                    134:            write32h( store_regs[ reg_no ] );
                    135:            writes(",  should be = ");
                    136:            write32h( exp_regs[ reg_no ] );
                    137:            writec('\n');
                    138: }
                    139: 
                    140: 
                    141: 
                    142: /*
                    143:  ***********************************************************************
                    144:  *     fill a register buffer with known patterns
                    145:  ***********************************************************************
                    146: */
                    147: fill_reg_buf( buffer )
                    148: int *buffer;
                    149: {
                    150:        buffer[0]  = 0x10101010;        /* register '0' data */
                    151:        buffer[1]  = 0x11111111;
                    152:        buffer[2]  = 0x12121212;
                    153:        buffer[3]  = 0x13131313;
                    154:        buffer[4]  = 0x14141414;
                    155:        buffer[5]  = 0x15151515;
                    156:        buffer[6]  = 0x16161616;
                    157:        buffer[7]  = 0x17171717;
                    158:        buffer[8]  = 0x18181818;
                    159:        buffer[9]  = 0x19191919;
                    160:        buffer[10] = 0x1a1a1a1a;
                    161:        buffer[11] = 0x1b1b1b1b;
                    162:        buffer[12] = 0x1c1c1c1c;
                    163:        buffer[13] = 0x1d1d1d1d;
                    164: }
                    165: 

unix.superglobalmegacorp.com

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