Changeset 931 for branches


Ignore:
Timestamp:
Jan 27, 2015, 5:58:07 PM (9 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.
Location:
branches/reconfiguration
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/reconfiguration/modules/dspin_router/caba/source/include/dspin_router.h

    r886 r931  
    9494    DspinInput<flit_width>      *p_in;
    9595    DspinOutput<flit_width>     *p_out;
    96     sc_in<uint32_t>             *p_blackhole_pos;
     96
     97    // reconfiguration port
     98    sc_in<uint32_t>             *p_recovery_cfg;
    9799
    98100    // constructor / destructor
     
    104106                 const size_t    in_fifo_depth,
    105107                 const size_t    out_fifo_depth,
    106                  const bool      broadcast_supported = false,
    107                  const bool      reconfigurable = false );
     108                 const bool      broadcast_supported = false );
    108109
    109110    ~DspinRouter();
     
    146147    void    genMoore();
    147148    int     xfirst_route( size_t xdest, size_t ydest );
    148     int     recovery_route( size_t xdest, size_t ydest );
    149149    int     route( sc_uint<flit_width> data );
    150150    int     broadcast_route( int iter, int source, sc_uint<flit_width> data );
    151151    bool    is_broadcast( sc_uint<flit_width> data );
    152152
     153    // fault-recovery methods
     154    bool    need_reroute( size_t xdest, size_t ydest, int bhpos );
     155    int     recovery_route( size_t xdest, size_t ydest );
     156
    153157    public:
    154158
    155     void set_disable_mask( int mask )
     159    inline void set_disable_mask( int mask )
    156160    {
    157161        m_disable_mask = mask;
    158162    }
     163
     164    void bind_recovery_port( sc_core::sc_signal<uint32_t> &s );
    159165
    160166    void print_trace();
  • 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);
  • branches/reconfiguration/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/src/tsar_iob_cluster.cpp

    r926 r931  
    306306                x_width, y_width,
    307307                4, 4,
    308                 (k == 1),
    309                 true);                 // use config interface
     308                (k == 1));
    310309    }
    311310
     
    320319                x_width, y_width,
    321320                4, 4,
    322                 false,
    323                 true);                 // use config interface
     321                false);
    324322    }
    325323
     
    431429        int_router_cmd[k]->p_clk                 (this->p_clk);
    432430        int_router_cmd[k]->p_resetn              (this->p_resetn);
    433         (*int_router_cmd[k]->p_blackhole_pos)    (signal_cfg_router_cmd[k]);
     431        int_router_cmd[k]->bind_recovery_port    (signal_cfg_router_cmd[k]);
    434432        for (int i = 0; i < 4; i++)
    435433        {
     
    443441        int_router_rsp[k]->p_clk                 (this->p_clk);
    444442        int_router_rsp[k]->p_resetn              (this->p_resetn);
    445         (*int_router_rsp[k]->p_blackhole_pos)    (signal_cfg_router_rsp[k]);
     443        int_router_rsp[k]->bind_recovery_port    (signal_cfg_router_rsp[k]);
    446444        for (int i = 0; i < 4; i++)
    447445        {
Note: See TracChangeset for help on using the changeset viewer.