Changeset 522 for trunk/modules/vci_block_device_tsar/caba
- Timestamp:
- Sep 10, 2013, 6:16:32 PM (11 years ago)
- Location:
- trunk/modules/vci_block_device_tsar/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_block_device_tsar/caba/source/include/vci_block_device_tsar.h
r514 r522 117 117 sc_signal<bool> r_go; // command from T_FSM to M_FSM 118 118 119 sc_signal<sc_dt::sc_uint<vci_param::S> > r_srcid; // save srcid 120 sc_signal<sc_dt::sc_uint<vci_param::T> > r_trdid; // save trdid 121 sc_signal<sc_dt::sc_uint<vci_param::P> > r_pktid; // save pktid 119 sc_signal<typename vci_param::srcid_t > r_srcid; // save srcid 120 sc_signal<typename vci_param::trdid_t > r_trdid; // save trdid 121 sc_signal<typename vci_param::pktid_t > r_pktid; // save pktid 122 sc_signal<typename vci_param::data_t > r_tdata; // save wdata 122 123 123 124 uint32_t* r_local_buffer; // capacity is one block -
trunk/modules/vci_block_device_tsar/caba/source/src/vci_block_device_tsar.cpp
r514 r522 65 65 r_trdid = p_vci_target.trdid.read(); 66 66 r_pktid = p_vci_target.pktid.read(); 67 r_tdata = p_vci_target.wdata.read(); 67 68 sc_dt::sc_uint<vci_param::N> address = p_vci_target.address.read(); 68 69 … … 101 102 case T_WRITE_BUFFER: 102 103 { 103 if ( (r_initiator_fsm.read() == M_IDLE) and p_vci_target.rspack.read() ) 104 { 105 r_buf_address = (uint64_t)p_vci_target.wdata.read(); 106 r_target_fsm = T_IDLE; 104 if (p_vci_target.rspack.read() ) { 105 #ifdef SOCLIB_MODULE_DEBUG 106 std::cout << "vci_bd WRITE_BUFFER " << r_tdata.read() 107 << " status " << r_initiator_fsm.read() << std::endl; 108 #endif 109 if (r_initiator_fsm.read() == M_IDLE) 110 { 111 r_buf_address = (uint64_t)r_tdata.read(); 112 r_target_fsm = T_IDLE; 113 } 107 114 } 108 115 break; … … 111 118 case T_WRITE_BUFFER_EXT: 112 119 { 113 if ( (r_initiator_fsm.read() == M_IDLE) and p_vci_target.rspack.read() ) 114 { 115 r_buf_address = r_buf_address.read() + 116 (((uint64_t)p_vci_target.wdata.read())<<32); 117 r_target_fsm = T_IDLE; 120 if (p_vci_target.rspack.read() ) { 121 #ifdef SOCLIB_MODULE_DEBUG 122 std::cout << "vci_bd WRITE_BUFFER_EXT " << r_tdata.read() 123 << " status " << r_initiator_fsm.read() << std::endl; 124 #endif 125 if (r_initiator_fsm.read() == M_IDLE) 126 { 127 r_buf_address = r_buf_address.read() + 128 (((uint64_t)r_tdata.read())<<32); 129 r_target_fsm = T_IDLE; 130 } 118 131 } 119 132 break; … … 122 135 case T_WRITE_COUNT: 123 136 { 124 if ( (r_initiator_fsm.read() == M_IDLE) and p_vci_target.rspack.read() ) 125 { 126 r_nblocks = (uint32_t)p_vci_target.wdata.read(); 127 r_target_fsm = T_IDLE; 128 } 137 if (p_vci_target.rspack.read() ) { 138 #ifdef SOCLIB_MODULE_DEBUG 139 std::cout << "vci_bd WRITE_COUNT " << r_tdata.read() << 140 " status " << r_initiator_fsm.read() << std::endl; 141 #endif 142 if (r_initiator_fsm.read() == M_IDLE) 143 { 144 r_nblocks = (uint32_t)r_tdata.read(); 145 r_target_fsm = T_IDLE; 146 } 147 } 129 148 break; 130 149 } … … 132 151 case T_WRITE_LBA: 133 152 { 134 if ( (r_initiator_fsm.read() == M_IDLE) and p_vci_target.rspack.read() ) 135 { 136 r_lba = (uint32_t)p_vci_target.wdata.read(); 137 r_target_fsm = T_IDLE; 138 } 153 if (p_vci_target.rspack.read() ) { 154 #ifdef SOCLIB_MODULE_DEBUG 155 std::cout << "vci_bd WRITE_LBA " << r_tdata.read() << 156 " status " << r_initiator_fsm.read() << std::endl; 157 #endif 158 if (r_initiator_fsm.read() == M_IDLE) { 159 r_lba = (uint32_t)r_tdata.read(); 160 r_target_fsm = T_IDLE; 161 } 162 } 139 163 break; 140 164 } … … 144 168 if ( p_vci_target.rspack.read() ) 145 169 { 146 if ( ((uint32_t)p_vci_target.wdata.read() == BLOCK_DEVICE_READ) and 170 #ifdef SOCLIB_MODULE_DEBUG 171 std::cout << "vci_bd WRITE_OP " << r_tdata.read() << 172 " status " << r_initiator_fsm.read(); 173 #endif 174 if ( ((uint32_t)r_tdata.read() == BLOCK_DEVICE_READ) and 147 175 (r_initiator_fsm.read() == M_IDLE) ) 148 176 { 149 177 r_read = true; 150 178 r_go = true; 151 } 152 else if ( ((uint32_t)p_vci_target.wdata.read() == BLOCK_DEVICE_WRITE) and 179 #ifdef SOCLIB_MODULE_DEBUG 180 std::cout << " READ"; 181 #endif 182 } 183 else if ( ((uint32_t)r_tdata.read() == BLOCK_DEVICE_WRITE) and 153 184 (r_initiator_fsm.read() == M_IDLE) ) 154 185 { 155 186 r_read = false; 156 187 r_go = true; 188 #ifdef SOCLIB_MODULE_DEBUG 189 std::cout << " WRITE"; 190 #endif 157 191 } 158 192 else … … 161 195 } 162 196 r_target_fsm = T_IDLE; 197 #ifdef SOCLIB_MODULE_DEBUG 198 std::cout << std::endl; 199 #endif 163 200 } 164 201 break; … … 169 206 if ( p_vci_target.rspack.read() ) 170 207 { 208 #ifdef SOCLIB_MODULE_DEBUG 209 std::cout << "vci_bd WRITE_IRQEN " << r_tdata.read() 210 << " status " << r_initiator_fsm.read() << std::endl; 211 #endif 171 212 r_target_fsm = T_IDLE; 172 r_irq_enable = ( p_vci_target.wdata.read() != 0);213 r_irq_enable = (r_tdata.read() != 0); 173 214 } 174 215 break; … … 248 289 { 249 290 r_initiator_fsm = M_READ_ERROR; 291 #ifdef SOCLIB_MODULE_DEBUG 292 std::cout << "vci_bd M_READ_ERROR" << std::endl; 293 #endif 250 294 } 251 295 else … … 345 389 { 346 390 r_initiator_fsm = M_READ_ERROR; 391 #ifdef SOCLIB_MODULE_DEBUG 392 std::cout << "vci_bd M_READ_ERROR" << std::endl; 393 #endif 347 394 } 348 395 else if ( (not aligned and (r_burst_count.read() == m_bursts_per_block)) or … … 352 399 { 353 400 r_initiator_fsm = M_READ_SUCCESS; 401 #ifdef SOCLIB_MODULE_DEBUG 402 std::cout << "vci_bd M_READ_SUCCESS" << std::endl; 403 #endif 354 404 } 355 405 else // last burst not last block … … 430 480 { 431 481 r_initiator_fsm = M_WRITE_ERROR; 482 #ifdef SOCLIB_MODULE_DEBUG 483 std::cout << "vci_bd M_WRITE_ERROR" << std::endl; 484 #endif 432 485 } 433 486 else if ( (not aligned and (r_burst_count.read() == m_bursts_per_block)) or … … 459 512 { 460 513 r_initiator_fsm = M_WRITE_ERROR; 514 #ifdef SOCLIB_MODULE_DEBUG 515 std::cout << "vci_bd M_WRITE_ERROR" << std::endl; 516 #endif 461 517 } 462 518 else if ( r_block_count.read() == r_nblocks.read() - 1 ) 463 519 { 464 520 r_initiator_fsm = M_WRITE_SUCCESS; 521 #ifdef SOCLIB_MODULE_DEBUG 522 std::cout << "vci_bd M_WRITE_SUCCESS" << std::endl; 523 #endif 465 524 } 466 525 else … … 634 693 (r_initiator_fsm == M_READ_ERROR) || 635 694 (r_initiator_fsm == M_WRITE_ERROR) ) && 636 r_irq_enable.read() ) p_irq = true; 637 else p_irq = false; 695 r_irq_enable.read() ) { 696 #ifdef SOCLIB_MODULE_DEBUG 697 std::cout << "vci_bd send IRQ" << std::endl; 698 #endif 699 p_irq = true; 700 } else p_irq = false; 638 701 } // end GenMoore() 639 702
Note: See TracChangeset
for help on using the changeset viewer.