- Timestamp:
- Nov 12, 2014, 3:14:47 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/modules/dspin_router/caba/source/src/dspin_router.cpp
r873 r877 59 59 const size_t in_fifo_depth, 60 60 const size_t out_fifo_depth, 61 const bool broadcast_supported ) 61 const bool broadcast_supported, 62 const bool reconfigurable ) 62 63 : soclib::caba::BaseModule(name), 63 64 … … 114 115 GenericFifo<internal_flit_t >(stro.str(), out_fifo_depth); 115 116 } 117 118 if ( reconfigurable ) p_blackhole_pos = new sc_core::sc_in<int>; 119 else p_blackhole_pos = NULL; 116 120 } // end constructor 121 122 /////////////////////////////////////////////////// 123 tmpl(/**/)::~DspinRouter() 124 { 125 if ( p_blackhole_pos != NULL ) delete p_blackhole_pos; 126 } 117 127 118 128 /////////////////////////////////////////////////// … … 128 138 tmpl(int)::recovery_route( size_t xdest, size_t ydest ) 129 139 { 130 int bhpos = m_blackhole_pos;140 int bhpos = p_blackhole_pos->read(); 131 141 if ( xdest > m_local_x ) { 132 142 if ( (bhpos == BH_NE) || (bhpos == BH_E) || (bhpos == BH_SE) || … … 238 248 size_t xdest = (size_t)(data >> m_x_shift) & m_x_mask; 239 249 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); 246 258 } 247 259 … … 378 390 r_fifo_out[i].init(); 379 391 } 380 381 set_blackhole_pos(BH_NONE);382 392 return; 383 393 }
Note: See TracChangeset
for help on using the changeset viewer.