Ignore:
Timestamp:
Jan 27, 2015, 5:58:07 PM (10 years ago)
Author:
cfuguet
Message:

reconf: introducing the segment recovery mechanism in the dspin_router

  • The p_recovery_cfg port, connected through a signal to a config register in the XICU, is formatted in two fields: the 4 LSb contain the blackhole relative position and the 4 bits after contain the recovery direction.
  • A request with the blackhole cluster as destination is rerouted through the defined recovery direction.
  • Remove the reconfiguration parameter of the constructor. The p_recovery_cfg port is instantiated when the bind_recovery_port is called. This port is also connected during this function to the signal that is passed as an argument.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/reconfiguration/modules/dspin_router/caba/source/src/dspin_router.cpp

    r886 r931  
    6060                             const size_t   in_fifo_depth,
    6161                             const size_t   out_fifo_depth,
    62                              const bool     broadcast_supported,
    63                              const bool     reconfigurable )
     62                             const bool     broadcast_supported)
    6463    : soclib::caba::BaseModule(name),
    6564
     
    117116        }
    118117
    119         if ( reconfigurable ) p_blackhole_pos = new sc_core::sc_in<uint32_t>;
    120         else                  p_blackhole_pos = NULL;
     118        p_recovery_cfg = NULL;
    121119    } //  end constructor
    122120
     
    124122    tmpl(/**/)::~DspinRouter()
    125123    {
    126         if ( p_blackhole_pos != NULL ) delete p_blackhole_pos;
     124        if ( p_recovery_cfg != NULL ) delete p_recovery_cfg;
    127125    }
    128126
     
    137135
    138136    ///////////////////////////////////////////////////
     137    tmpl(void)::bind_recovery_port( sc_core::sc_signal<uint32_t> &s )
     138    {
     139        if (p_recovery_cfg == NULL) {
     140            p_recovery_cfg = new sc_core::sc_in<uint32_t>;
     141        }
     142        (*p_recovery_cfg)(s);
     143    }
     144
     145    ///////////////////////////////////////////////////
     146    tmpl(bool)::need_reroute( size_t xdest, size_t ydest, int bhpos )
     147    {
     148        size_t xhole, yhole;
     149        if (bhpos == BH_N) {
     150            xhole = m_local_x;
     151            yhole = m_local_y - 1;
     152        }
     153        else if (bhpos == BH_NW) {
     154            xhole = m_local_x + 1;
     155            yhole = m_local_y - 1;
     156        }
     157        else if (bhpos == BH_W) {
     158            xhole = m_local_x + 1;
     159            yhole = m_local_y;
     160        }
     161        else if (bhpos == BH_SW) {
     162            xhole = m_local_x + 1;
     163            yhole = m_local_y + 1;
     164        }
     165        else if (bhpos == BH_S) {
     166            xhole = m_local_x;
     167            yhole = m_local_y + 1;
     168        }
     169        else if (bhpos == BH_SE) {
     170            xhole = m_local_x - 1;
     171            yhole = m_local_y + 1;
     172        }
     173        else if (bhpos == BH_E) {
     174            xhole = m_local_x - 1;
     175            yhole = m_local_y;
     176        }
     177        else if (bhpos == BH_NE) {
     178            xhole = m_local_x - 1;
     179            yhole = m_local_y - 1;
     180        }
     181        else {
     182            return false;
     183        }
     184
     185        return ((xdest == xhole) && (ydest == yhole));
     186    }
     187
     188    ///////////////////////////////////////////////////
    139189    tmpl(int)::recovery_route( size_t xdest, size_t ydest )
    140190    {
    141         int bhpos = p_blackhole_pos->read();
     191        int bhpos = p_recovery_cfg->read() & 0xF;
     192
     193        // reroute the request if its destination is the blackhole (this is to
     194        // implement the segment recovery mechanism)
     195        if (need_reroute(xdest, ydest, bhpos)) {
     196            int recovery_direction = (p_recovery_cfg->read() >> 4) & 0xF;
     197            return recovery_direction;
     198        }
     199
    142200        if ( xdest > m_local_x ) {
    143201            if ( (bhpos == BH_NE) || (bhpos == BH_E) || (bhpos == BH_SE) ||
     
    249307        size_t xdest = (size_t)(data >> m_x_shift) & m_x_mask;
    250308        size_t ydest = (size_t)(data >> m_y_shift) & m_y_mask;
    251         if ( p_blackhole_pos != NULL )
    252         {
    253             if ( p_blackhole_pos->read() != BH_NONE )
     309        if ( p_recovery_cfg != NULL )
     310        {
     311            if ( (p_recovery_cfg->read() & 0xF) != BH_NONE )
    254312            {
    255313                return recovery_route(xdest, ydest);
Note: See TracChangeset for help on using the changeset viewer.