Changeset 877
- Timestamp:
- Nov 12, 2014, 3:14:47 PM (10 years ago)
- Location:
- branches/reconfiguration/modules/dspin_router/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/modules/dspin_router/caba/source/include/dspin_router.h
r873 r877 109 109 DspinOutput<flit_width> *p_out; 110 110 111 sc_in<int> *p_blackhole_pos; 112 111 113 // constructor / destructor 112 114 DspinRouter( sc_module_name name, … … 117 119 const size_t in_fifo_depth, 118 120 const size_t out_fifo_depth, 119 const bool broadcast_supported = false ); // default value 121 const bool broadcast_supported = false, 122 const bool reconfigurable = false ); 123 124 ~DspinRouter(); 120 125 121 126 private: … … 151 156 bool m_broadcast_supported; 152 157 int m_disable_mask; 153 int m_blackhole_pos;154 158 155 159 // methods … … 169 173 } 170 174 171 void set_blackhole_pos( int pos )172 {173 m_blackhole_pos = pos;174 }175 176 175 void print_trace(); 177 176 }; -
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.