Ignore:
Timestamp:
Jul 8, 2015, 3:57:15 PM (9 years ago)
Author:
alain
Message:

Modify all applications to support two new rules:
1) introduce a local Makefile for each application.
2) change "application.elf" name to "application/appli.elf" name in the application.py" file.
Introduce the shell application.

Location:
soft/giet_vm/applications/convol
Files:
1 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/convol/convol.py

    r502 r589  
    44
    55######################################################################################
    6 #   file   : convol.py  (for the convol application)
     6#   file   : convol.py
    77#   date   : may 2014
    88#   author : Alain Greiner
     
    2727
    2828######################
    29 def convol( mapping ):
     29def extend( mapping ):
    3030
    3131    x_size    = mapping.x_size
     
    5454    mapping.addVseg( vspace, 'conv_data', data_base , data_size,
    5555                     'C_WU', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM',
    56                      binpath = 'build/convol/convol.elf',
     56                     binpath = 'build/convol/appli.elf',
    5757                     local = False )
    5858
     
    6767                mapping.addVseg( vspace, 'conv_code_%d_%d' % (x,y), base, size,
    6868                                 'CXWU', vtype = 'ELF', x = x , y = y , pseg = 'RAM',
    69                                  binpath = 'build/convol/convol.elf',
     69                                 binpath = 'build/convol/appli.elf',
    7070                                 local = True )
    7171
     
    119119if __name__ == '__main__':
    120120
    121     vspace = convol( Mapping( 'test', 2, 2, 4 ) )
     121    vspace = extend( Mapping( 'test', 2, 2, 4 ) )
    122122    print vspace.xml()
    123123
  • soft/giet_vm/applications/convol/main.c

    r502 r589  
    3939#define FRAME_SIZE                 (NB_PIXELS * PIXEL_SIZE)
    4040
     41#define SEEK_SET                   0
     42
    4143#define TA(c,l,p)  (A[c][((NP) * (l)) + (p)])
    4244#define TB(c,p,l)  (B[c][((NL) * (p)) + (l)])
     
    125127    unsigned int ntasks     = nclusters * nprocs;           // number of tasks
    126128    unsigned int frame_size = FRAME_SIZE;                   // total size (bytes)
    127     unsigned int nblocks    = frame_size / 512;             // number of blocks/frame
    128129
    129130    unsigned int lines_per_task     = NL / ntasks;          // lines per task
     
    166167    {
    167168        giet_shr_printf("\n[CONVOL] task[0,0,0] starts barrier init at cycle %d\n"
    168                         "- CLUSTERS  = %d\n"
    169                         "- PROCS     = %d\n"
    170                         "- TASKS     = %d\n"
    171                         "- BLOCKS    = %d\n",
    172                         giet_proctime(), nclusters, nprocs, ntasks, nblocks );
     169                        "- CLUSTERS   = %d\n"
     170                        "- PROCS      = %d\n"
     171                        "- TASKS      = %d\n"
     172                        "- LINES/TASK = %d\n",
     173                        giet_proctime(), nclusters, nprocs, ntasks, lines_per_task );
    173174#if USE_SQT_BARRIER
    174175        sqt_barrier_init( &barrier, x_size , y_size , nprocs );
     
    182183        barrier_init_ok = 1;
    183184    }
    184     else 
     185    else
    185186    {
    186187        while ( barrier_init_ok == 0 );
     
    250251    ///////////////////////////////////////////////////////////////////////////
    251252    // task[0,0,0] open the file containing image, and load it from disk
    252     // to all A[c] buffers (nblocks / nclusters loaded in each cluster).
     253    // to all A[c] buffers (frame_size / nclusters loaded in each cluster).
    253254    // Other tasks are waiting on the init_ok condition.
    254255    //////////////////////////////////////////////////////////////////////////
     
    256257    {
    257258        // open file
    258         file = giet_fat_open("misc/philips_image.raw", 0 );
     259        file = giet_fat_open( "misc/philips_image.raw" , 0 );
    259260        if ( file < 0 ) giet_exit( "[CONVOL ERROR] task[0,0,0] cannot open"
    260261                                   " file misc/philips_image.raw" );
     
    268269                             "for cluster %d at cycle %d\n", c, giet_proctime() );
    269270
     271            giet_fat_lseek( file,
     272                            (frame_size/nclusters)*c,
     273                            SEEK_SET );
     274
    270275            giet_fat_read( file,
    271276                           A[c],
    272                            nblocks/nclusters,
    273                            (nblocks/nclusters)*c );
     277                           frame_size/nclusters );
    274278
    275279            giet_shr_printf( "\n[CONVOL] task[0,0,0] completes load "
Note: See TracChangeset for help on using the changeset viewer.