Changeset 1001 for branches/reconfiguration/modules
- Timestamp:
- Jun 16, 2015, 9:24:36 PM (10 years ago)
- Location:
- branches/reconfiguration/modules
- Files:
-
- 5 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 -
branches/reconfiguration/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp
r988 r1001 6147 6147 uint64_t header = p_dspin_m2p.data.read(); 6148 6148 uint64_t dest = DDP::dspin_get(header, DDP::TEST_M2P_DEST); 6149 assert((size_t)dest == m_cc_global_id); 6149 6150 if ((size_t)dest != m_cc_global_id) { 6151 std::cout << this->name() << ": ERROR in CC_RECEIVE_TEST_HEADER" 6152 << " / cycle: " << std::dec << m_cpt_total_cycles 6153 << " / TEST_M2P packet received but its destination (" << dest << ")" 6154 << "is not the current processor (" << m_cc_global_id << ")" 6155 << std::endl; 6156 exit(1); 6157 } 6150 6158 6151 6159 r_cc_receive_fsm = CC_RECEIVE_TEST_SIGNATURE; -
branches/reconfiguration/modules/vci_local_crossbar/caba/source/include/vci_local_crossbar.h
r932 r1001 56 56 sc_in<bool> p_resetn; 57 57 58 sc_in<uint32_t> *p_barrier_enable; 59 58 60 VciInitiator<vci_param> *p_to_target; 59 61 VciTarget<vci_param> *p_to_initiator; … … 92 94 const size_t nb_attached_initiators, 93 95 const size_t nb_attached_targets, 94 const size_t default_target_id ); 96 const size_t default_target_id, 97 const bool hardware_barrier = false ); 95 98 ~VciLocalCrossbar(); 96 99 }; -
branches/reconfiguration/modules/vci_local_crossbar/caba/source/src/vci_local_crossbar.cpp
r933 r1001 78 78 const void* m_lt; // locality table if cmd / id_locality table if rsp 79 79 const bool m_is_cmd; // cmd crossbar when true 80 bool m_barrier; // barrier in the global interface is enabled 80 81 81 82 sc_signal<bool>* r_allocated; // for each output port: allocation state … … 97 98 m_rt( rt ), 98 99 m_lt( lt ), 99 m_is_cmd( is_cmd ) 100 m_is_cmd( is_cmd ), 101 m_barrier( false ) 100 102 { 101 103 r_allocated = new sc_signal<bool>[out_size]; … … 104 106 r_bc_count = new sc_signal<size_t>[in_size]; 105 107 } // end constructor 108 109 ////////////////////////////////// 110 void setBarrier(const bool &value) 111 { 112 m_barrier = value; 113 } 106 114 107 115 //////////// … … 147 155 } 148 156 } 157 std::cout << " / barrier enable = " << m_barrier; 149 158 } // end print_trace() 150 159 … … 190 199 for( size_t in = 0 ; in < m_in_size ; in++ ) 191 200 { 192 if ( input_port[in]->getVal() ) 201 /* drop global-to-local packets when the barrier is enabled */ 202 bool write = input_port[in]->getVal(); 203 if ( in == (m_in_size - 1) ) 204 write = write && !m_barrier; 205 206 if ( write ) 193 207 { 194 208 if ( r_bc_state[in].read() ) // pending broadcast … … 237 251 { 238 252 size_t in = (_in + r_origin[out] + 1) % m_in_size; 239 if ( input_port[in]->getVal() ) 253 254 /* drop global-to-local packets when the barrier is enabled */ 255 bool write = input_port[in]->getVal(); 256 if ( in == (m_in_size - 1) ) 257 write = write && !m_barrier; 258 259 if ( write ) 240 260 { 241 261 pkt_t tmp; … … 285 305 pkt_t tmp; 286 306 tmp.readFrom(*input_port[in]); 307 308 // if the hardware barrier is activated, drop all 309 // local-to-global packets. This is done by consuming every 310 // incoming packet (send the acknowledgement to the input port) 311 // and resetting the cmdval signal to the upper network level. 312 bool read = output_port[out]->getAck(); 313 if (out == (m_out_size - 1)) { 314 read = read || m_barrier; 315 tmp.set_val(tmp.val() && !m_barrier); 316 } 317 318 ack[in] = read; 287 319 tmp.writeTo(*output_port[out]); 288 ack[in] = output_port[out]->getAck(); 320 289 321 if ( r_bc_state[in].read() ) // its a broacast 290 322 { … … 299 331 } 300 332 } 333 // Drop all global-to-local packets when the hardware barrier is enabled 334 ack[m_in_size - 1] = ack[m_in_size - 1] || m_barrier; 301 335 302 336 // Send acknowledges on input ports … … 313 347 std::cout << "LOCAL_CROSSBAR " << name() << " / "; 314 348 m_cmd_crossbar->print_trace(); 315 m_rsp_crossbar->print_trace(); 349 std::cout << " / "; 350 m_rsp_crossbar->print_trace(); 316 351 std::cout << std::endl; 317 352 } … … 327 362 } 328 363 364 if (p_barrier_enable != NULL) 365 { 366 const bool enable = (p_barrier_enable->read() != 0xFFFFFFFF); 367 m_cmd_crossbar->setBarrier(enable); 368 m_rsp_crossbar->setBarrier(enable); 369 } 329 370 m_cmd_crossbar->transition( m_ports_to_initiator, m_ports_to_target ); 330 371 m_rsp_crossbar->transition( m_ports_to_target, m_ports_to_initiator ); … … 344 385 const size_t nb_attached_initiators, 345 386 const size_t nb_attached_targets, 346 const size_t default_target_id ) 387 const size_t default_target_id, 388 const bool hardware_barrier ) 347 389 : BaseModule(name), 348 390 p_clk("clk"), … … 409 451 m_ports_to_target[i] = &p_to_target[i]; 410 452 m_ports_to_target[nb_attached_targets] = &p_initiator_to_up; 453 454 if (hardware_barrier) 455 p_barrier_enable = new sc_in<uint32_t>("p_barrier_enable"); 456 else 457 p_barrier_enable = NULL; 411 458 } 412 459
Note: See TracChangeset
for help on using the changeset viewer.