Ignore:
Timestamp:
Aug 5, 2014, 4:57:46 PM (10 years ago)
Author:
alain
Message:

1/ reducing boot and kernel segments sizes (mainly data) in arch.py
2/introducing the simul_period variable in top.cpp to support OPENMP.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/tsar_generic_iob/top.cpp

    r757 r762  
    148148//               Parallelisation
    149149///////////////////////////////////////////////////
    150 #define USE_OPENMP               0
    151 
    152 #if USE_OPENMP
     150
     151#define USING_OPENMP           0
     152
     153#if USING_OPENMP
    153154#include <omp.h>
    154155#endif
     
    185186//////////////////////i/////////////////////////////////////
    186187
    187 #include "hard_config.h"
     188#include "../../../giet_vm/hard_config.h"
    188189
    189190////////////////////////////////////////////////////////////
     
    321322
    322323   char     soft_name[256]   = BOOT_SOFT_NAME;             // pathname: binary code
    323    size_t   ncycles          = 1000000000;                 // simulated cycles
     324   size_t   ncycles          = 4000000000;                 // simulated cycles
    324325   char     disk_name[256]   = BDEV_IMAGE_NAME;            // pathname: disk image
    325326   char     nic_rx_name[256] = NIC_RX_NAME;                // pathname: rx packets file
     
    338339   size_t   x_width          = 4;                          // at most 256 clusters
    339340   size_t   y_width          = 4;                          // at most 256 clusters
     341
     342#if USING_OPENMP
     343   size_t   simul_period     = 1000000;
     344#else
     345   size_t   simul_period     = 1;
     346#endif
    340347
    341348   assert( (X_WIDTH == 4) and (Y_WIDTH == 4) and
     
    472479   std::cout << std::endl;
    473480
    474 #if USE_OPENMP
     481#if USING_OPENMP
    475482   omp_set_dynamic(false);
    476483   omp_set_num_threads(threads_nr);
     
    984991                  dspin_ram_rsp_width>* clusters[XMAX][YMAX];
    985992
    986 #if USE_OPENMP
     993#if USING_OPENMP
    987994#pragma omp parallel
    988995    {
     
    9941001            size_t y = i % YMAX;
    9951002
    996 #if USE_OPENMP
     1003#if USING_OPENMP
    9971004#pragma omp critical
    9981005            {
     
    10741081            );
    10751082
    1076 #if USE_OPENMP
     1083#if USING_OPENMP
    10771084            } // end critical
    10781085#endif
    10791086        } // end for
    1080 #if USE_OPENMP
     1087#if USING_OPENMP
    10811088    }
    10821089#endif
     
    14001407    gettimeofday(&t1, NULL);
    14011408
    1402     for (size_t n = 1; n < ncycles; n++)
     1409
     1410    for ( size_t n = 0; n < ncycles ; n += simul_period )
    14031411    {
    14041412        // stats display
     
    15591567        }
    15601568
    1561         sc_start(sc_core::sc_time(1, SC_NS));
     1569        sc_start(sc_core::sc_time(simul_period, SC_NS));
    15621570    }
    15631571    return EXIT_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.