Ignore:
Timestamp:
Nov 12, 2014, 3:14:47 PM (8 years ago)
Author:
cfuguet
Message:

reconf: replace internal BH variable by an input port in the dspin_router

  • This port is conditionnaly instantiated in the router if the newly introduced constructor parameter 'reconfigurable' is true.
  • When this port is used, it can be bound to a CONFIG component which can reconfigure the router.
File:
1 edited

Legend:

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

    r873 r877  
    5959                             const size_t   in_fifo_depth,
    6060                             const size_t   out_fifo_depth,
    61                              const bool     broadcast_supported )
     61                             const bool     broadcast_supported,
     62                             const bool     reconfigurable )
    6263    : soclib::caba::BaseModule(name),
    6364
     
    114115                GenericFifo<internal_flit_t >(stro.str(), out_fifo_depth);
    115116        }
     117
     118        if ( reconfigurable ) p_blackhole_pos = new sc_core::sc_in<int>;
     119        else                  p_blackhole_pos = NULL;
    116120    } //  end constructor
     121
     122    ///////////////////////////////////////////////////
     123    tmpl(/**/)::~DspinRouter()
     124    {
     125        if ( p_blackhole_pos != NULL ) delete p_blackhole_pos;
     126    }
    117127
    118128    ///////////////////////////////////////////////////
     
    128138    tmpl(int)::recovery_route( size_t xdest, size_t ydest )
    129139    {
    130         int bhpos = m_blackhole_pos;
     140        int bhpos = p_blackhole_pos->read();
    131141        if ( xdest > m_local_x ) {
    132142            if ( (bhpos == BH_NE) || (bhpos == BH_E) || (bhpos == BH_SE) ||
     
    238248        size_t xdest = (size_t)(data >> m_x_shift) & m_x_mask;
    239249        size_t ydest = (size_t)(data >> m_y_shift) & m_y_mask;
    240         if ( m_blackhole_pos == BH_NONE ) {
    241             return xfirst_route(xdest, ydest);
    242         }
    243         else {
    244             return recovery_route(xdest, ydest);
    245         }
     250        if ( p_blackhole_pos != NULL )
     251        {
     252            if (p_blackhole_pos->read() != BH_NONE)
     253            {
     254                return recovery_route(xdest, ydest);
     255            }
     256        }
     257        return xfirst_route(xdest, ydest);
    246258    }
    247259
     
    378390                r_fifo_out[i].init();
    379391            }
    380 
    381             set_blackhole_pos(BH_NONE);
    382392            return;
    383393        }
Note: See TracChangeset for help on using the changeset viewer.