Changeset 1013
- Timestamp:
- Sep 12, 2015, 11:41:52 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/modules/vci_local_crossbar/caba/source/src/vci_local_crossbar.cpp
r1001 r1013 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 bool m_barrier; // barrier in the global interface is enabled 82 bool m_barrier_release; // request to release the barrier 81 83 82 84 sc_signal<bool>* r_allocated; // for each output port: allocation state … … 92 94 void* rt, // routing table 93 95 void* lt, // locality table 94 bool is_cmd ) 96 bool is_cmd, 97 bool barrier = false) 95 98 : m_cluster_id( cluster_id ), 96 99 m_in_size( in_size ), … … 99 102 m_lt( lt ), 100 103 m_is_cmd( is_cmd ), 101 m_barrier( false ) 104 m_barrier( barrier ), 105 m_barrier_release( false ) 102 106 { 103 107 r_allocated = new sc_signal<bool>[out_size]; … … 108 112 109 113 ////////////////////////////////// 110 void setBarrier(const bool &value)114 inline void setBarrier(const bool &value) 111 115 { 112 116 m_barrier = value; 117 } 118 119 ////////////////////////////////// 120 inline void releaseBarrier() 121 { 122 m_barrier_release = true; 113 123 } 114 124 … … 288 298 } 289 299 } 300 301 // release the barrier if there is no pending global-to-local 302 // request. This avoid a race condition situation between a 303 // global-to-local request and the release of the barrier. In 304 // such situation, for multi-flit packets, some flits may be 305 // dropped and others not. 306 if (m_barrier && m_barrier_release && !input_port[m_in_size-1]->getVal()) 307 { 308 m_barrier = false; 309 } 290 310 } // end transition 291 311 … … 310 330 // incoming packet (send the acknowledgement to the input port) 311 331 // and resetting the cmdval signal to the upper network level. 332 // When there is a barrier release request, local-to-global 333 // request are allowed. 312 334 bool read = output_port[out]->getAck(); 313 335 if (out == (m_out_size - 1)) { 314 read = read || m_barrier;315 tmp.set_val(tmp.val() && !m_barrier);336 read = read || (m_barrier && !m_barrier_release); 337 tmp.set_val(tmp.val() && (!m_barrier || m_barrier_release)); 316 338 } 317 339 … … 362 384 } 363 385 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); 386 if ( p_barrier_enable != NULL ) 387 { 388 if ( p_barrier_enable->read() == 0xFFFFFFFF ) 389 { 390 m_cmd_crossbar->releaseBarrier(); 391 m_rsp_crossbar->releaseBarrier(); 392 } 369 393 } 370 394 m_cmd_crossbar->transition( m_ports_to_initiator, m_ports_to_target ); … … 432 456 (void*)(&m_cmd_rt), 433 457 (void*)(&m_cmd_lt), 434 true ); 458 true, 459 hardware_barrier ); 435 460 436 461 m_rsp_crossbar = new SimpleCrossbar<VciRspBuffer<vci_param> >( … … 440 465 (void*)(&m_rsp_rt), 441 466 (void*)(&m_rsp_lt), 442 false ); 467 false, 468 hardware_barrier ); 443 469 444 470 m_ports_to_initiator = new VciTarget<vci_param>*[nb_attached_initiators+1];
Note: See TracChangeset
for help on using the changeset viewer.