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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.