Changeset 1001 for branches/reconfiguration/modules/dspin_local_crossbar
- Timestamp:
- Jun 16, 2015, 9:24:36 PM (10 years ago)
- Location:
- branches/reconfiguration/modules/dspin_local_crossbar/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/modules/dspin_local_crossbar/caba/source/include/dspin_local_crossbar.h
r977 r1001 70 70 DspinOutput<flit_width>* p_local_out; 71 71 72 sc_in<uint32_t> *p_barrier_enable; 73 72 74 void print_trace(); 73 75 … … 86 88 const bool is_cmd, 87 89 const bool use_routing_table, 88 const bool broadcast_supported ); 90 const bool broadcast_supported, 91 const bool hardware_barrier = false ); 89 92 90 93 ~DspinLocalCrossbar(); -
branches/reconfiguration/modules/dspin_local_crossbar/caba/source/src/dspin_local_crossbar.cpp
r977 r1001 52 52 const bool is_cmd, 53 53 const bool use_routing_table, 54 const bool broadcast_supported) 54 const bool broadcast_supported, 55 const bool hardware_barrier ) 55 56 : BaseModule(name), 56 57 … … 141 142 } 142 143 144 if ( hardware_barrier ) 145 { 146 p_barrier_enable = new sc_in<uint32_t>("p_barrier_enable"); 147 } 148 else 149 { 150 p_barrier_enable = NULL; 151 } 152 143 153 assert( (flit_width >= x_width + y_width + l_width) and 144 154 "ERROR in DSPIN_LOCAL_CROSSBAR: flit_width < x_width + y_width + l_width"); … … 281 291 internal_flit_t fifo_out_wdata[m_local_outputs+1]; 282 292 293 // local-to-global and global-to-local hardware barrier enable signal 294 const bool barrier_enable = (p_barrier_enable != NULL) and 295 (p_barrier_enable->read() != 0xFFFFFFFF); 296 283 297 // reset 284 298 if ( p_resetn.read() == false ) … … 326 340 for ( size_t j = 0 ; j <= m_local_outputs ; j++ ) 327 341 { 328 if( r_alloc_out[j].read() and (r_fifo_out[j].wok()) ) 342 bool read = r_fifo_out[j].wok(); 343 if ( j == m_local_outputs ) 344 { 345 read = read or barrier_enable; 346 } 347 if( r_alloc_out[j].read() and read ) 329 348 { 330 349 get_out[j] = r_index_out[j].read(); … … 349 368 { 350 369 put_in[i] = false; 351 if ( r_fifo_in[i].rok() ) // packet available in input fifo 370 371 bool write = r_fifo_in[i].rok(); 372 if ( i == m_local_inputs ) 373 { 374 write = write and not barrier_enable; 375 } 376 if ( write ) // packet available in input fifo 352 377 { 353 378 if ( is_broadcast(r_fifo_in[i].read().data ) and … … 491 516 } 492 517 } // end loop on input ports 518 fifo_in_read[m_local_inputs] = fifo_in_read[m_local_inputs] or barrier_enable; 493 519 494 520 // loop on the output ports : … … 499 525 if( r_alloc_out[j] ) // output port allocated 500 526 { 501 fifo_out_write[j] = put_in[r_index_out[j]]; 527 bool write = put_in[r_index_out[j]]; 528 if (j == m_local_outputs) 529 { 530 write = write and not barrier_enable; 531 } 532 fifo_out_write[j] = write; 502 533 fifo_out_wdata[j] = data_in[r_index_out[j]]; 534 503 535 } 504 536 } // end loop on the output ports
Note: See TracChangeset
for help on using the changeset viewer.