Ignore:
Timestamp:
Dec 16, 2015, 1:03:16 PM (9 years ago)
Author:
alain
Message:

Modify instrumentation to save results on virtual disk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/mjpeg/vld.c

    r736 r748  
    2323
    2424// macro to use a shared TTY
    25 #define PRINTF(...)    lock_acquire( &tty_lock ); \
    26                        giet_tty_printf(__VA_ARGS__);  \
    27                        lock_release( &tty_lock );
     25#define PRINTF(...)  do { lock_acquire( &tty_lock ); \
     26                          giet_tty_printf(__VA_ARGS__);  \
     27                          lock_release( &tty_lock ); } while(0);
    2828
    2929////////////////////////////////////////////////////////////////////////////////////////
     
    166166    uint32_t type = ( is_ac ) ? 1 : 0;
    167167
    168     if ( is_ac ) { PRINTF("\n AC Huffman Table\n\n") }
    169     else         { PRINTF("\n DC Huffman Table\n\n") }
     168    if ( is_ac )
     169    {
     170        PRINTF("\n AC Huffman Table\n\n");
     171    }
     172    else
     173    {
     174        PRINTF("\n DC Huffman Table\n\n");
     175    }
    170176
    171177    for ( j = 0; j < 16; j++ ) // j = code_length - 1
    172178    {
    173179        PRINTF(" length = %d / mincode = %x / maxcode = %x / valptr = %d\n",
    174         j+1 , huff->MinCode[type][j] , huff->MaxCode[type][j] , huff->ValPtr[type][j] )
    175     }
    176 
    177     PRINTF("\n")
     180        j+1 , huff->MinCode[type][j] , huff->MaxCode[type][j] , huff->ValPtr[type][j]);
     181    }
     182
     183    PRINTF("\n");
    178184
    179185    for ( j = 0 ; j < 16 ; j++ )  // j == code_length - 1
     
    186192
    187193            PRINTF(" Symbol[%d] = %x / code[%d] = %x\n",
    188             index , huff->HT[type][index] , index , code )
     194            index , huff->HT[type][index] , index , code );
    189195        }
    190196    }
    191197 
    192     PRINTF("\n")
     198    PRINTF("\n");
    193199}
    194200
     
    342348#if (DEBUG_VLD > 2)
    343349if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
    344 { PRINTF("\nVLD[%d] : DC[0] = %d / reformat( %x , %d ) = %d\n",
    345          index , buf[0], temp , symbol , value ) }
     350PRINTF("\nVLD[%d] : DC[0] = %d / reformat( %x , %d ) = %d\n",
     351         index , buf[0], temp , symbol , value );
    346352#endif
    347353
     
    357363#if (DEBUG_VLD > 2)
    358364if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
    359 { PRINTF("\nVLD[%d] : EOB found at i = %d\n", index , i ) }
     365PRINTF("\nVLD[%d] : EOB found at i = %d\n", index , i );
    360366#endif
    361367            break;
     
    379385#if (DEBUG_VLD > 2)
    380386if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
    381 { PRINTF("\nVLD[%d] : AC[%d] = %d / reformat( %x , %d ) = %d\n",
    382          index , i , buf[i] , temp , cat , value ) }
     387PRINTF("\nVLD[%d] : AC[%d] = %d / reformat( %x , %d ) = %d\n",
     388         index , i , buf[i] , temp , cat , value );
    383389#endif
    384390
     
    390396#if (DEBUG_VLD > 1 )
    391397if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
    392 { PRINTF("\nVLD[%d] completes block %d/%d in image %d\n"
     398PRINTF("\nVLD[%d] completes block %d/%d in image %d\n"
    393399         "  %d  %d  %d  %d  %d  %d  %d  %d\n"
    394400         "  %d  %d  %d  %d  %d  %d  %d  %d\n"
     
    407413         buf[40], buf[41], buf[42], buf[43], buf[44], buf[45], buf[46], buf[47],
    408414         buf[48], buf[49], buf[50], buf[51], buf[52], buf[53], buf[54], buf[55],
    409          buf[56], buf[57], buf[58], buf[59], buf[60], buf[61], buf[62], buf[63]) }
     415         buf[56], buf[57], buf[58], buf[59], buf[60], buf[61], buf[62], buf[63]);
    410416#endif
    411417
     
    442448
    443449    PRINTF("\n[MJPEG] thread VLD[%d] starts on P[%d,%d,%d] / trdid = %x\n",
    444            index , x , y , p, (uint32_t)trdid_vld[index] )
     450           index , x , y , p, (uint32_t)trdid_vld[index] );
    445451
    446452
     
    452458#if (DEBUG_VLD > 1)
    453459if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
    454 { PRINTF("\nVLD[%d] <in_data> : &mwmr = %x / &bufio = %x\n",
    455          index , mwmr_in_data , &bufio_in_data ) }
     460PRINTF("\nVLD[%d] <in_data> : &mwmr = %x / &bufio = %x\n",
     461         index , mwmr_in_data , &bufio_in_data );
    456462#endif
    457463
     
    463469#if (DEBUG_VLD > 1)
    464470if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
    465 { PRINTF("\nVLD[%d] <in_huff> : &mwmr = %x / &bufio = %x\n",
     471PRINTF("\nVLD[%d] <in_huff> : &mwmr = %x / &bufio = %x\n",
    466472         index , mwmr_in_huff , &bufio_in_huff ) }
    467473#endif
     
    483489#if (DEBUG_VLD > 1)
    484490if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
    485 { PRINTF("\nVLD[%d] load Huffman tables for image %d\n", index , image ) }
     491PRINTF("\nVLD[%d] load Huffman tables for image %d\n", index , image );
    486492#endif
    487493
     
    501507#if (DEBUG_VLD > 1)
    502508if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
    503 { PRINTF("\nVLD[%d] uncompress block %d/%d in image %d\n", index, block, nblocks, image ) }
     509PRINTF("\nVLD[%d] uncompress block %d/%d in image %d\n", index, block, nblocks, image );
    504510#endif
    505511            prev_dc = vld_unpack_block( index,
     
    514520#if DEBUG_VLD
    515521if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
    516 { PRINTF("\nVLD[%d] completes image %d at cycle %d\n", index , image , giet_proctime() ) }
     522PRINTF("\nVLD[%d] completes image %d at cycle %d\n", index , image , giet_proctime() );
    517523#endif
    518524        image = image + x_size*y_size;
Note: See TracChangeset for help on using the changeset viewer.