- Timestamp:
- Feb 15, 2015, 8:44:35 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/modules/dspin_router/caba/source/src/dspin_router.cpp
r934 r947 138 138 { 139 139 if (p_recovery_cfg == NULL) { 140 p_recovery_cfg = new sc_core::sc_in<uint32_t> ;140 p_recovery_cfg = new sc_core::sc_in<uint32_t> ("p_recovery_cfg"); 141 141 } 142 142 (*p_recovery_cfg)(s); … … 144 144 145 145 /////////////////////////////////////////////////// 146 tmpl(bool):: need_reroute( size_t xdest, size_t ydest, int bhpos )146 tmpl(bool)::is_destination_blackhole( size_t xdest, size_t ydest, int bhpos ) 147 147 { 148 148 size_t xhole, yhole; … … 189 189 tmpl(int)::recovery_route( size_t xdest, size_t ydest ) 190 190 { 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 198 #if SOCLIB_MODULE_DEBUG 199 std::cout << "<" << name() << "> reroute request to DIR = " 200 << recovery_direction << std::endl; 201 #endif 202 203 return recovery_direction; 204 } 191 int bhpos = blackhole_position(); 205 192 206 193 if ( xdest > m_local_x ) { … … 315 302 if ( p_recovery_cfg != NULL ) 316 303 { 317 if ( (p_recovery_cfg->read() & 0xF) != BH_NONE ) 318 { 319 return recovery_route(xdest, ydest); 304 if (blackhole_position() != BH_NONE ) 305 { 306 // reroute the request if its destination is the blackhole (this 307 // is to implement the segment recovery mechanism) 308 if (is_destination_blackhole(xdest, ydest, blackhole_position())) 309 { 310 int dir = migration_route(); 311 312 #if SOCLIB_MODULE_DEBUG 313 std::cout << "<" << name() << "> migration: " 314 << "route request to DIR = " << dir << std::endl; 315 #endif 316 return dir; 317 } 318 319 if (is_network_recovery_enable()) 320 { 321 int dir = recovery_route(xdest, ydest); 322 323 #if SOCLIB_MODULE_DEBUG 324 std::cout << "<" << name() << "> network recovery: " 325 << "route request to DIR = " << dir << std::endl; 326 #endif 327 return dir; 328 } 320 329 } 321 330 }
Note: See TracChangeset
for help on using the changeset viewer.