Ignore:
Timestamp:
Dec 19, 2013, 9:36:48 AM (11 years ago)
Author:
alain
Message:

Introducing support for TSAR fixed format cluster index (cluster_xy)
We have now 4 parameters defined in map.xml:

  • X_WIDTH, Y_WIDTH define the fixed format (typically X_WIDTH = 4 / Y_WIDTH = 4)
  • X_SIZE, Y_SIZE define the actual TSAR 2D mesh variable size (from 1 to 16)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/mwr_driver.c

    r258 r263  
    1212// The (virtual) base address of the associated segment is:
    1313//
    14 //       seg_mwr_base + cluster_id * vseg_cluster_increment
     14//       seg_mwr_base + cluster_xy * vseg_cluster_increment
    1515//
    1616// The seg_mwr_base and vseg_cluster_increment values must be defined
     
    2222#include <utils.h>
    2323
    24 #if !defined(NB_CLUSTERS)
    25 # error: You must define NB_CLUSTERS in the hard_config.h file
     24#if !defined(X_SIZE)
     25# error: You must define X_SIZE in the hard_config.h file
    2626#endif
    2727
    28 #if (NB_CLUSTERS > 256)
    29 # error: NB_CLUSTERS cannot be larger than 256!
     28#if !defined(Y_SIZE)
     29# error: You must define X_SIZE in the hard_config.h file
     30#endif
     31
     32#if !defined(X_WIDTH)
     33# error: You must define X_WIDTH in the hard_config.h file
     34#endif
     35
     36#if !defined(Y_WIDTH)
     37# error: You must define X_WIDTH in the hard_config.h file
    3038#endif
    3139
    3240//////////////////////////////////////////////////////////////////////////////////
    33 //    _mwmr_hw_init()
     41//    _mwr_hw_init()
    3442// This function initializes one MWMR controller channel (i.e. one coprocessor
    3543// port) in a given cluster.
    36 // - cluster_id    : cluster index
     44// - cluster_xy    : cluster index
    3745// _ port_id       : port index
    3846// - way           : direction (to_coproc/from_coproc)
     
    4048// TODO : The MWMR controler should be modified to support 40 bits addresses...
    4149//        Introduce a MWMR_CONFIG_PADDR_EXT register in the MWMR coprocessor
    42 //        To support addresses > 32 bits and remove this limitation...
    4350//////////////////////////////////////////////////////////////////////////////////
    4451// Returns 0 if success, returns > 0 if error.
    4552//////////////////////////////////////////////////////////////////////////////////
    46 unsigned int _mwmr_hw_init( unsigned int           cluster_id,
    47                             unsigned int           port_id,
    48                             unsigned int           from_coproc,
    49                             paddr_t                channel_pbase )
     53unsigned int _mwr_hw_init( unsigned int           cluster_xy,
     54                           unsigned int           port_id,
     55                           unsigned int           from_coproc,
     56                           paddr_t                channel_pbase )
    5057{
    51     _puts(" [GIET_ERROR] _mwmr_hw_init() function not implemented yet\n");
     58    _puts(" [GIET_ERROR] _mwr_hw_init() function not supported yet\n");
    5259    _exit();
    5360
    5461/*
    5562    // parameters checking
    56     if (cluster_id >= NB_CLUSTERS)      return 1;
     63    unsigned int x = cluster_xy >> Y_WIDTH;
     64    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     65    if (x >= X_SIZE)                    return 1;
     66    if (y >= Y_SIZE)                    return 1;
    5767
    58     // compute MWMR base address
    59     unsigned int* mwmr_address = (unsigned int*) ((unsigned int)&seg_mwmr_base +
    60                                  (cluster_id * (unsigned int)&vseg_cluster_increment));
     68    // compute base address
     69    unsigned int* mwr_address = (unsigned int*) ((unsigned int)&seg_mwr_base +
     70                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
    6171
    6272    unsigned int lsb = (unsigned int)channel_pbase;
     
    6878
    6979    // initializes and launches mwmr controler
    70     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_FIFO_WAY]  = from_coproc;
    71     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_FIFO_NO]   = port_id;
    72     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_WIDTH]     = width;
    73     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_DEPTH]     = depth;
    74     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_STATUS]    = lsb;
    75     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_DATA]      = lsb + 24;
    76     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_EXT]       = msb;
    77     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_RUNNING]   = 1;
     80    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_FIFO_WAY]  = from_coproc;
     81    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_FIFO_NO]   = port_id;
     82    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_WIDTH]     = width;
     83    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_DEPTH]     = depth;
     84    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_STATUS]    = lsb;
     85    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_DATA]      = lsb + 24;
     86    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_EXT]       = msb;
     87    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_RUNNING]   = 1;
    7888*/
    7989    return 0;
Note: See TracChangeset for help on using the changeset viewer.