Changeset 468


Ignore:
Timestamp:
Dec 12, 2014, 5:06:18 PM (10 years ago)
Author:
alain
Message:

Cosmetic: Improving debug.

Location:
soft/giet_vm/giet_libs
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_libs/barrier.c

    r431 r468  
    1212
    1313///////////////////////////////////////////////////////////////////////////////////
    14 ///////////////////////////////////////////////////////////////////////////////////
    1514//      Simple barrier access functions
    16 ///////////////////////////////////////////////////////////////////////////////////
    1715///////////////////////////////////////////////////////////////////////////////////
    1816
     
    3230{
    3331
    34 #if GIET_DEBUG_BARRIER
     32#if GIET_DEBUG_USER_BARRIER
    3533unsigned int x;
    3634unsigned int y;
     
    8583    asm volatile ("sync" ::: "memory");
    8684
    87 #if GIET_DEBUG_BARRIER
     85#if GIET_DEBUG_USER_BARRIER
    8886giet_shr_printf("[DEBUG BARRIER] proc[%d,%d,%d] exit barrier_wait()\n", x, y, p );
    8987#endif
     
    176174    barrier->ntasks = ntasks;
    177175   
    178 #if GIET_DEBUG_BARRIER
     176#if GIET_DEBUG_USER_BARRIER
    179177giet_shr_printf("\n[DEBUG BARRIER] sbt_nodes allocation / ntasks = %d\n", ntasks );
    180178#endif
     
    200198                     ( (l == 8) && ((x&0x0F) == 0) && ((y&0x0F) == 0) ) )
    201199                 {
    202                      barrier->node[x][y][l] = remote_malloc( SBT_NODE_SIZE, x, y );
    203 
    204 #if GIET_DEBUG_BARRIER
     200                     barrier->node[x][y][l] = remote_malloc( sizeof(sbt_node_t), x, y );
     201
     202#if GIET_DEBUG_USER_BARRIER
    205203giet_shr_printf("[DEBUG SBT] node[%d][%d][%d] : vaddr = %x\n",
    206204                x, y, l, (unsigned int)barrier->node[x][y][l] );
     
    211209    }
    212210           
    213 #if GIET_DEBUG_BARRIER
     211#if GIET_DEBUG_USER_BARRIER
    214212giet_shr_printf("\n[DEBUG SBT] SBT nodes initialisation\n");
    215213#endif
     
    261259        node->child1   = NULL;
    262260
    263 #if GIET_DEBUG_BARRIER
     261#if GIET_DEBUG_USER_BARRIER
    264262giet_shr_printf("[DEBUG BARRIER] initialize sbt_node[%d][%d][%d] :"
    265263                " arity = %d / child0 = %x / child1 = %x\n",
     
    302300        node->child1   = barrier->node[x1][y1][level-1];
    303301
    304 #if GIET_DEBUG_BARRIER
     302#if GIET_DEBUG_USER_BARRIER
    305303giet_shr_printf("[DEBUG BARRIER] initialize sbt_node[%d][%d][%d] :"
    306304                " arity = %d / child0 = %x / child1 = %x\n",
  • soft/giet_vm/giet_libs/barrier.h

    r368 r468  
    6969    struct sbt_node_s* child0;          // pointer on children node
    7070    struct sbt_node_s* child1;          // pointer on children node
     71    unsigned int       padding;         // for 32 bytes alignment
    7172} sbt_node_t;
    72 
    73 #define SBT_NODE_SIZE  32
    7473
    7574typedef struct giet_sbt_barrier_s
  • soft/giet_vm/giet_libs/malloc.c

    r431 r468  
    88#include "malloc.h"
    99#include "stdio.h"
     10#include "giet_config.h"
    1011
    1112// Global variables defining the heap descriptors array (one heap per cluster)
     
    5152{
    5253    giet_shr_printf(
    53                 " - coordinates = [%d][%d]\n"
    5454                " - heap_base   = %x\n"
    5555                " - heap_size   = %x\n"
     
    8080                " - free[22]    = %x\n"
    8181                " - free[23]    = %x\n",
    82                 heap[x][y].x, heap[x][y].y,
    8382                heap[x][y].heap_base, heap[x][y].heap_size,
    8483                heap[x][y].alloc_base, heap[x][y].alloc_size,
     
    115114    heap_index = GET_SIZE_INDEX( heap_size );
    116115
     116#if GIET_DEBUG_USER_MALLOC
     117giet_shr_printf("\n[DEBUG USER_MALLOC] Starting Heap[%d][%d] initialisation /"
     118                " base = %x / size = %x\n", x, y, heap_base, heap_size );
     119#endif
     120
    117121    // checking heap segment constraints
    118122    if ( heap_size == 0 )                                    // heap segment exist
     
    166170    heap[x][y].alloc_base = alloc_base;
    167171
    168     lock_release( &heap[x][y].lock );
    169 
    170 #if GIET_DEBUG_MALLOC
    171 giet_shr_printf("\n[MALLOC DEBUG] Completing Heap[%d][%d] initialisation\n", x, y );
     172    lock_init( &heap[x][y].lock );
     173
     174#if GIET_DEBUG_USER_MALLOC
     175giet_shr_printf("\n[DEBUG USER_MALLOC] Completing Heap[%d][%d] initialisation\n", x, y );
    172176display_free_array(x,y);
    173177#endif
     
    238242{
    239243
    240 #if GIET_DEBUG_MALLOC
    241 giet_shr_printf("\n[MALLOC DEBUG] Malloc request for Heap[%d][%d] / size = %x\n",
     244#if GIET_DEBUG_USER_MALLOC
     245giet_shr_printf("\n[DEBUG USER_MALLOC] Malloc request for Heap[%d][%d] / size = %x\n",
    242246                 x, y, size );
    243247#endif
     
    260264    if ( heap[x][y].init != HEAP_INITIALIZED )
    261265    {
    262         heap_init( x, y );
     266        heap_init( x , y );
    263267    }
    264268
     
    288292    lock_release( &heap[x][y].lock );
    289293 
    290 #if GIET_DEBUG_MALLOC
    291 giet_shr_printf("\n[MALLOC DEBUG] Malloc vaddr from Heap[%d][%d] = %x\n",
     294#if GIET_DEBUG_USER_MALLOC
     295giet_shr_printf("\n[DEBUG USER_MALLOC] Malloc vaddr from Heap[%d][%d] = %x\n",
    292296                x, y, base );
    293297display_free_array(x,y);
     
    383387    giet_get_xy( ptr, &x, &y );
    384388
    385 #if GIET_DEBUG_MALLOC
    386 giet_shr_printf("\n[MALLOC DEBUG] Free for vaddr = %x / x = %d / y = %d\n",
     389#if GIET_DEBUG_USER_MALLOC
     390giet_shr_printf("\n[DEBUG USER_MALLOC] Free for vaddr = %x / x = %d / y = %d\n",
    387391                 (unsigned int)ptr, x, y );
    388392#endif
     
    418422    lock_release( &heap[x][y].lock );
    419423
    420 #if GIET_DEBUG_MALLOC
     424#if GIET_DEBUG_USER_MALLOC
    421425display_free_array(x,y);
    422426#endif
  • soft/giet_vm/giet_libs/mwmr_channel.c

    r461 r468  
    1818{
    1919
    20 #if GIET_DEBUG_MWMR
     20#if GIET_DEBUG_USER_MWMR
    2121unsigned int    x;
    2222unsigned int    y;
     
    4545{
    4646
    47 #if GIET_DEBUG_MWMR
     47#if GIET_DEBUG_USER_MWMR
    4848unsigned int    x;
    4949unsigned int    y;
     
    8484        mwmr->ptw = ptw;
    8585
    86 #if GIET_DEBUG_MWMR
     86#if GIET_DEBUG_USER_MWMR
    8787giet_shr_printf("\n[MWMR DEBUG] Proc[%d,%d,%d] writes %d words in fifo %x : sts = %d\n",
    8888                x, y, lpid, nwords, (unsigned int)mwmr, mwmr->sts );
     
    109109        mwmr->ptw = ptw;
    110110
    111 #if GIET_DEBUG_MWMR
     111#if GIET_DEBUG_USER_MWMR
    112112giet_shr_printf("\n[MWMR DEBUG] Proc[%d,%d,%d] writes %d words in fifo %x : sts = %d\n",
    113113                x, y, lpid, nwords, (unsigned int)mwmr, mwmr->sts );
     
    127127{
    128128
    129 #if GIET_DEBUG_MWMR
     129#if GIET_DEBUG_USER_MWMR
    130130unsigned int    x;
    131131unsigned int    y;
     
    164164        mwmr->ptr = ptr;
    165165
    166 #if GIET_DEBUG_MWMR
     166#if GIET_DEBUG_USER_MWMR
    167167giet_shr_printf("\n[MWMR DEBUG] Proc[%d,%d,%d] read %d words in fifo %x : sts = %d\n",
    168168                x, y, lpid, nwords, (unsigned int)mwmr, mwmr->sts );
     
    175175    {
    176176
    177 #if GIET_DEBUG_MWMR
     177#if GIET_DEBUG_USER_MWMR
    178178giet_shr_printf("\n[MWMR DEBUG] Proc[%d,%d,%d] read nothing in fifo %x : sts = %d\n",
    179179                x, y, lpid, (unsigned int)mwmr, mwmr->sts );
     
    195195        mwmr->ptr = ptr;
    196196
    197 #if GIET_DEBUG_MWMR
     197#if GIET_DEBUG_USER_MWMR
    198198giet_shr_printf("\n[MWMR DEBUG] Proc[%d,%d,%d] read %d words in fifo %x : sts = %d\n",
    199199                x, y, lpid, nwords, (unsigned int)mwmr, mwmr->sts );
     
    213213{
    214214
    215 #if GIET_DEBUG_MWMR
     215#if GIET_DEBUG_USER_MWMR
    216216unsigned int    x;
    217217unsigned int    y;
     
    254254            mwmr->sts = sts + nwords;
    255255
    256 #if GIET_DEBUG_MWMR
     256#if GIET_DEBUG_USER_MWMR
    257257giet_shr_printf("\n[MWMR DEBUG] Proc[%d,%d,%d] writes %d words in fifo %x : sts = %d\n",
    258258                x, y, lpid, nwords, (unsigned int)mwmr, mwmr->sts );
     
    280280            items = items - (nwords/width);
    281281
    282 #if GIET_DEBUG_MWMR
     282#if GIET_DEBUG_USER_MWMR
    283283giet_shr_printf("\n[MWMR DEBUG] Proc[%d,%d,%d] writes %d words in fifo %x : sts = %d\n",
    284284                x, y, lpid, nwords, (unsigned int)mwmr, mwmr->sts );
     
    300300{
    301301
    302 #if GIET_DEBUG_MWMR
     302#if GIET_DEBUG_USER_MWMR
    303303unsigned int    x;
    304304unsigned int    y;
     
    339339            mwmr->ptr = ptr;
    340340
    341 #if GIET_DEBUG_MWMR
     341#if GIET_DEBUG_USER_MWMR
    342342giet_shr_printf("\n[MWMR DEBUG] Proc[%d,%d,%d] read %d words in fifo %x : sts = %d\n",
    343343                x, y, lpid, nwords, (unsigned int)mwmr, mwmr->sts );
     
    365365            items = items - (nwords/width);
    366366
    367 #if GIET_DEBUG_MWMR
     367#if GIET_DEBUG_USER_MWMR
    368368giet_shr_printf("\n[MWMR DEBUG] Proc[%d,%d,%d] read %d words in fifo %x : sts = %d\n",
    369369                x, y, lpid, nwords, (unsigned int)mwmr, mwmr->sts );
  • soft/giet_vm/giet_libs/stdio.h

    r461 r468  
    232232extern void giet_nic_tx_stats();
    233233
     234extern void giet_nic_rx_clear();
     235
     236extern void giet_nic_tx_clear();
     237
    234238//////////////////////////////////////////////////////////////////////////
    235239//               FAT related system calls
Note: See TracChangeset for help on using the changeset viewer.