Ignore:
Timestamp:
Mar 26, 2014, 6:44:44 PM (11 years ago)
Author:
alain
Message:

Introducing a major release, to suppoort the tsar_generic_leti platform
and the various (external or internal) peripherals configurations.
The map.xml format has been modified, in order to support the new
vci_iopic componentand a new policy for peripherals initialisation.
The IRQs are nom described in the XICU and IOPIC components
(and not anymore in the processors).
To enforce this major change, the map.xml file signature changed:
The signature value must be: 0xDACE2014

This new release has been tested on the tsar_generic_leti platform
for the following mappings:

  • 4c_4p_sort_leti
  • 4c_4p_sort_leti_ext
  • 4c_4p_transpose_leti
  • 4c_4p_transpose_leti_ext
  • 4c_1p_four_leti_ext
File:
1 edited

Legend:

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

    r258 r295  
    1515
    1616///////////////////////////////////////////////////////////////////////////////////
    17 //     barrier_init()
    18 // This function makes a cooperative initialisation of the barrier:
    19 // several tasks try to initialize the barrier, but the initialisation
    20 // is done by only one task, using LL/SC instructions.
     17// This function initializes the barrier: this should be done by a single task.
    2118///////////////////////////////////////////////////////////////////////////////////
    22 void barrier_init( giet_barrier_t * barrier, unsigned int value) {
    23     unsigned int * pinit  = (unsigned int *) &barrier->init;
    24     unsigned int * pcount = (unsigned int *) &barrier->count;
    25 
    26     // parallel initialisation using atomic instructions LL/SC
    27     // inputs : pinit, pcount, value
    28     // no output
    29     asm volatile ("_barrier_init_test:                  \n"
    30             "ll   $2,     0(%0)                   \n" /* read initial value */
    31             "bnez $2,     _barrier_init_done      \n"
    32             "move $3,     %2                      \n"
    33             "sc   $3,     0(%0)                   \n" /* write initial value */
    34             "beqz $3,     _barrier_init_test      \n"
    35             "move $3,     %2                      \n"
    36             "sw   $3,     0(%1)                   \n" /* write count */
    37             "_barrier_init_done:                  \n"
    38             :
    39             : "r"(pinit), "r"(pcount), "r"(value)
    40             : "$2", "$3");
     19void barrier_init( giet_barrier_t* barrier,
     20                   unsigned int    value )
     21{
     22    barrier->init  = value;
     23    barrier->count = value;
    4124}
    4225
    4326
    4427///////////////////////////////////////////////////////////////////////////////////
    45 //    barrier_wait()
    4628// This blocking function uses LL/SC to decrement the barrier's counter.
    4729// Then, it uses a busy_waiting mechanism if it is not the last.
    48 // (because the GIET does not support dynamic task scheduling/descheduling)
    4930///////////////////////////////////////////////////////////////////////////////////
    50 void barrier_wait(giet_barrier_t * barrier) {
     31void barrier_wait( giet_barrier_t* barrier )
     32{
    5133    unsigned int * pcount  = (unsigned int *) &barrier->count;
    5234    unsigned int maxcount = barrier->init;
     
    5638    // - input : pointer on the barrier counter
    5739    // - output : counter value
    58     asm volatile ("_barrier_decrement:          \n"
     40    asm volatile ("_barrier_decrement:    \n"
    5941            "ll   %0, 0(%1)               \n"
    6042            "addi $3, %0,     -1          \n"
     
    6850    // waking up all other waiting tasks
    6951
    70     if (count == 1) {
     52    if (count == 1)
     53    {
    7154        // last task
    7255        *pcount = maxcount;
Note: See TracChangeset for help on using the changeset viewer.