Changeset 78 for trunk/modules/vci_synthetic_initator/caba/sources/src
- Timestamp:
- Aug 27, 2010, 4:24:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initator.cpp
r77 r78 28 28 */ 29 29 30 #include "../include/vci_ traffic_generator.h"30 #include "../include/vci_synthetic_initiator.h" 31 31 32 32 … … 35 35 36 36 37 #define tmpl(x) template<typename vci_param> x VciTrafficGenerator<vci_param> 38 39 37 #define tmpl(x) template<typename vci_param> x VciSyntheticInitiator<vci_param> 38 39 //using soclib::common::uint32_log2; 40 40 41 //////////////////////////////// 41 42 // Constructor 42 43 //////////////////////////////// 43 44 44 tmpl(/**/)::Vci TrafficGenerator(45 tmpl(/**/)::VciSyntheticInitiator( 45 46 sc_module_name name, 46 const soclib::common::MappingTable &mtp, 47 const soclib::common::MappingTable &mtc, 48 const soclib::common::MappingTable &mtx, 49 const soclib::common::IntTab &vci_ixr_index, 50 const soclib::common::IntTab &vci_ini_index, 51 const soclib::common::IntTab &vci_tgt_index, 52 size_t nways, 53 size_t nsets, 54 size_t nwords) 47 size_t length, // Packet length (flit numbers) 48 float rho, // Packets ratio on the network 49 size_t depth, // Fifo depth 50 size_t x, // 51 size_t y, // 52 size_t xmesh, 53 size_t ymesh, 54 size_t bc_period, // Broadcast period, if no broadcast => 0 55 size_t xmin, 56 size_t xmax, 57 size_t ymin, 58 size_t ymax 59 ) 55 60 56 61 : soclib::caba::BaseModule(name), … … 62 67 m_srcid_ini( mtc.indexForId(vci_ini_index) ), 63 68 // FIFOs 64 m_ cmd_read_addr_fifo("m_cmd_read_addr_fifo", 4),69 m_date_fifo("m_date_fifo", depth), 65 70 66 71 r_tgt_cmd_fsm("r_tgt_cmd_fsm"), 67 72 { 68 assert(IS_POW_OF_2(nsets));69 assert(IS_POW_OF_2(nwords));70 assert(IS_POW_OF_2(nways));71 assert(nsets);72 assert(nwords);73 assert(nways);74 assert(nsets <= 1024);75 assert(nwords <= 32);76 assert(nways <= 32);77 78 // Get the segments associated to the MemCache79 //std::list<soclib::common::Segment> segList(mtp.getSegmentList(vci_tgt_index));80 std::list<soclib::common::Segment>::iterator seg;81 /*82 for(seg = segList.begin(); seg != segList.end() ; seg++) {83 if( seg->size() > 8 ) m_mem_segment = *seg;84 else m_reg_segment = *seg;85 nseg++;86 }87 */88 89 for(seg = m_seglist.begin(); seg != m_seglist.end() ; seg++) {90 if( seg->size() > 8 ) nseg++;91 }92 //assert( (nseg == 2) && (m_reg_segment.size() == 8) );93 94 m_seg = new soclib::common::Segment*[nseg];95 size_t i = 0;96 for ( seg = m_seglist.begin() ; seg != m_seglist.end() ; seg++ ) {97 if ( seg->size() > 8 )98 {99 m_seg[i] = &(*seg);100 i++;101 }102 else103 {104 m_reg_segment = *seg;105 }106 }107 108 assert( (m_reg_segment.size() == 8) );109 73 110 74 // Memory cache allocation & initialisation … … 122 86 } 123 87 124 // Allocation for IXR_RSP FSM125 r_ixr_rsp_to_xram_rsp_rok = new sc_signal<bool>[TRANSACTION_TAB_LINES];126 127 // Allocation for XRAM_RSP FSM128 r_xram_rsp_victim_data = new sc_signal<data_t>[nwords];129 r_xram_rsp_to_tgt_rsp_data = new sc_signal<data_t>[nwords];130 r_xram_rsp_to_tgt_rsp_val = new sc_signal<bool>[nwords];131 r_xram_rsp_to_xram_cmd_data = new sc_signal<data_t>[nwords];132 133 // Allocation for READ FSM134 r_read_data = new sc_signal<data_t>[nwords];135 r_read_to_tgt_rsp_data = new sc_signal<data_t>[nwords];136 r_read_to_tgt_rsp_val = new sc_signal<bool>[nwords];137 138 // Allocation for WRITE FSM139 r_write_data = new sc_signal<data_t>[nwords];140 r_write_be = new sc_signal<be_t>[nwords];141 r_write_to_init_cmd_data = new sc_signal<data_t>[nwords];142 r_write_to_init_cmd_we = new sc_signal<bool>[nwords];143 144 // Simulation145 146 88 SC_METHOD(transition); 147 89 dont_initialize(); … … 154 96 } // end constructor 155 97 156 /////////////////////////////////////////157 // This function prints the statistics158 /////////////////////////////////////////159 160 tmpl(void)::print_stats()161 {162 std::cout << "----------------------------------" << std::dec << std::endl;163 std::cout << "MEM_CACHE " << m_srcid_ini << " / Time = " << m_cpt_cycles << std::endl164 << "- READ RATE = " << (float)m_cpt_read/m_cpt_cycles << std::endl165 << "- READ MISS RATE = " << (float)m_cpt_read_miss/m_cpt_read << std::endl166 << "- WRITE RATE = " << (float)m_cpt_write/m_cpt_cycles << std::endl167 << "- WRITE MISS RATE = " << (float)m_cpt_write_miss/m_cpt_write << std::endl168 << "- WRITE BURST LENGTH = " << (float)m_cpt_write_cells/m_cpt_write << std::endl169 << "- UPDATE RATE = " << (float)m_cpt_update/m_cpt_cycles << std::endl170 << "- UPDATE ARITY = " << (float)m_cpt_update_mult/m_cpt_update << std::endl171 << "- INVAL RATE = " << (float)m_cpt_inval/m_cpt_cycles << std::endl172 << "- INVAL ARITY = " << (float)m_cpt_inval_mult/m_cpt_inval << std::endl173 << "- SAVE DIRTY RATE = " << (float)m_cpt_write_dirty/m_cpt_cycles << std::endl174 << "- CLEANUP RATE = " << (float)m_cpt_cleanup/m_cpt_cycles << std::endl175 << "- LL RATE = " << (float)m_cpt_ll/m_cpt_cycles << std::endl176 << "- SC RATE = " << (float)m_cpt_sc/m_cpt_cycles << std::endl;177 }178 98 179 99 ///////////////////////////////// 180 tmpl(/**/)::~Vci TrafficGenerator()100 tmpl(/**/)::~VciSyntheticInitiator() 181 101 ///////////////////////////////// 182 102 { 183 for(size_t i=0; i<m_ways ; i++){184 for(size_t j=0; j<m_sets ; j++){185 delete [] m_cache_data[i][j];186 }187 }188 for(size_t i=0; i<m_ways ; i++){189 delete [] m_cache_data[i];190 }191 delete [] m_cache_data;192 delete [] m_coherence_table;193 194 delete [] r_ixr_rsp_to_xram_rsp_rok;195 196 delete [] r_xram_rsp_victim_data;197 delete [] r_xram_rsp_to_tgt_rsp_data;198 delete [] r_xram_rsp_to_tgt_rsp_val;199 delete [] r_xram_rsp_to_xram_cmd_data;200 201 delete [] r_read_data;202 delete [] r_read_to_tgt_rsp_data;203 delete [] r_read_to_tgt_rsp_val;204 205 delete [] r_write_data;206 delete [] r_write_be;207 103 delete [] r_write_to_init_cmd_data; 208 104 } … … 212 108 ////////////////////////////////// 213 109 { 214 using soclib::common::uint32_log2;110 //using soclib::common::uint32_log2; 215 111 // RESET 216 112 if ( ! p_resetn.read() ) { … … 218 114 // Initializing FSMs 219 115 r_tgt_cmd_fsm = TGT_CMD_IDLE; 220 r_tgt_rsp_fsm = TGT_RSP_READ_IDLE;221 r_init_cmd_fsm = INIT_CMD_INVAL_IDLE;222 r_init_rsp_fsm = INIT_RSP_IDLE;223 r_read_fsm = READ_IDLE;224 r_write_fsm = WRITE_IDLE;225 r_llsc_fsm = LLSC_IDLE;226 r_cleanup_fsm = CLEANUP_IDLE;227 r_alloc_dir_fsm = ALLOC_DIR_READ;228 r_alloc_trt_fsm = ALLOC_TRT_READ;229 r_alloc_upt_fsm = ALLOC_UPT_WRITE;230 r_ixr_rsp_fsm = IXR_RSP_IDLE;231 r_xram_rsp_fsm = XRAM_RSP_IDLE;232 r_xram_cmd_fsm = XRAM_CMD_READ_IDLE;233 234 // Initializing Tables235 m_cache_directory.init();236 m_atomic_tab.init();237 m_transaction_tab.init();238 116 239 117 // initializing FIFOs and communication Buffers 240 118 241 m_cmd_read_addr_fifo.init(); 242 m_cmd_read_word_fifo.init(); 243 m_cmd_read_srcid_fifo.init(); 244 m_cmd_read_trdid_fifo.init(); 245 m_cmd_read_pktid_fifo.init(); 246 247 m_cmd_write_addr_fifo.init(); 248 m_cmd_write_eop_fifo.init(); 249 m_cmd_write_srcid_fifo.init(); 250 m_cmd_write_trdid_fifo.init(); 251 m_cmd_write_pktid_fifo.init(); 252 m_cmd_write_data_fifo.init(); 253 254 m_cmd_llsc_addr_fifo.init(); 255 m_cmd_llsc_srcid_fifo.init(); 256 m_cmd_llsc_trdid_fifo.init(); 257 m_cmd_llsc_pktid_fifo.init(); 258 m_cmd_llsc_wdata_fifo.init(); 259 m_cmd_llsc_sc_fifo.init(); 260 261 m_cmd_cleanup_srcid_fifo.init(); 262 m_cmd_cleanup_trdid_fifo.init(); 263 m_cmd_cleanup_pktid_fifo.init(); 264 m_cmd_cleanup_nline_fifo.init(); 119 m_date_fifo.init(); 265 120 266 121 r_read_to_tgt_rsp_req = false; … … 271 126 r_write_to_init_cmd_req = false; 272 127 273 r_init_rsp_to_tgt_rsp_req = false;274 275 r_cleanup_to_tgt_rsp_req = false;276 277 r_llsc_to_tgt_rsp_req = false;278 r_llsc_to_xram_cmd_req = false;279 280 for(size_t i=0; i<TRANSACTION_TAB_LINES ; i++){281 r_ixr_rsp_to_xram_rsp_rok[i]= false;282 }283 284 r_xram_rsp_to_tgt_rsp_req = false;285 r_xram_rsp_to_init_cmd_req = false;286 r_xram_rsp_to_xram_cmd_req = false;287 r_xram_rsp_trt_index = 0;288 289 r_xram_cmd_cpt = 0;290 128 291 129 // Activity counters 292 130 m_cpt_cycles = 0; 293 m_cpt_read = 0;294 m_cpt_read_miss = 0;295 m_cpt_write = 0;296 m_cpt_write_miss = 0;297 m_cpt_write_cells = 0;298 m_cpt_write_dirty = 0;299 m_cpt_update = 0;300 m_cpt_update_mult = 0;301 m_cpt_inval = 0;302 m_cpt_inval_mult = 0;303 m_cpt_cleanup = 0;304 m_cpt_ll = 0;305 m_cpt_sc = 0;306 131 307 132 return; … … 311 136 bool cmd_read_fifo_get = false; 312 137 313 bool cmd_write_fifo_put = false; 314 bool cmd_write_fifo_get = false; 315 316 bool cmd_llsc_fifo_put = false; 317 bool cmd_llsc_fifo_get = false; 318 319 bool cmd_cleanup_fifo_put = false; 320 bool cmd_cleanup_fifo_get = false; 321 322 323 324 switch ( r_tgt_cmd_fsm.read() ) { 138 switch ( r_vci_fsm.read() ) { 325 139 326 140 ////////////////// 327 case TGT_CMD_IDLE: 328 { 329 if ( p_vci_tgt.cmdval ) { 330 assert( (p_vci_tgt.srcid.read() < m_initiators) 331 && "error in VCI_MEM_CACHE : The received SRCID is larger than 31"); 332 333 bool reached = false; 334 for ( size_t index = 0 ; index < nseg && !reached ; index++) 335 { 336 if ( m_seg[index]->contains(p_vci_tgt.address.read()) ) { 337 reached = true; 338 r_index = index; 339 } 340 } 341 342 if ( !reached ) 343 { 344 std::cout << "Out of segment access in VCI_MEM_CACHE" << std::endl; 345 std::cout << "Faulty address = " << p_vci_tgt.address.read() << std::endl; 346 std::cout << "Faulty initiator = " << p_vci_tgt.srcid.read() << std::endl; 347 exit(0); 348 } 349 else if ( p_vci_tgt.cmd.read() == vci_param::CMD_READ ) 350 { 351 r_tgt_cmd_fsm = TGT_CMD_READ; 352 } 353 else if (( p_vci_tgt.cmd.read() == vci_param::CMD_WRITE ) && ( p_vci_tgt.trdid.read() == 0x0 ) ) 354 { 355 r_tgt_cmd_fsm = TGT_CMD_WRITE; 356 } 357 else if ((p_vci_tgt.cmd.read() == vci_param::CMD_LOCKED_READ) || 358 (p_vci_tgt.cmd.read() == vci_param::CMD_STORE_COND) ) 359 { 360 r_tgt_cmd_fsm = TGT_CMD_ATOMIC; 361 } 362 else if (( p_vci_tgt.cmd.read() == vci_param::CMD_WRITE ) && ( p_vci_tgt.trdid.read() == 0x1 )) 363 { 364 r_tgt_cmd_fsm = TGT_CMD_CLEANUP; 365 } 366 } 141 case VCI_IDLE: 142 { 367 143 break; 368 144 } 369 145 ////////////////// 370 case TGT_CMD_READ: 371 { 372 assert(((p_vci_tgt.plen.read() == 4) || (p_vci_tgt.plen.read() == m_words*4)) 373 && "All read request to the MemCache must have PLEN = 4 or PLEN = 4*nwords"); 374 375 if ( p_vci_tgt.cmdval && m_cmd_read_addr_fifo.wok() ) { 376 cmd_read_fifo_put = true; 377 if ( p_vci_tgt.eop ) r_tgt_cmd_fsm = TGT_CMD_IDLE; 378 else r_tgt_cmd_fsm = TGT_CMD_READ_EOP; 379 } 146 case VCI_SINGLE_SEND: 147 { 380 148 break; 381 149 } 382 150 ////////////////////// 383 case TGT_CMD_READ_EOP: 384 { 385 if ( p_vci_tgt.cmdval && p_vci_tgt.eop ){ 386 r_tgt_cmd_fsm = TGT_CMD_IDLE; 387 } 151 case VCI_SINGLE_RECEIVE: 152 { 388 153 break; 389 154 } 390 155 /////////////////// 391 case TGT_CMD_WRITE: 392 { 393 if ( p_vci_tgt.cmdval && m_cmd_write_addr_fifo.wok() ) { 394 cmd_write_fifo_put = true; 395 if( p_vci_tgt.eop ) r_tgt_cmd_fsm = TGT_CMD_IDLE; 396 } 156 case VCI_BC_SEND: 157 { 397 158 break; 398 159 } 399 160 //////////////////// 400 case TGT_CMD_ATOMIC: 401 { 402 assert(p_vci_tgt.eop && "Memory Cache Error: LL or SC command with length > 1 "); 403 404 if ( p_vci_tgt.cmdval && m_cmd_llsc_addr_fifo.wok() ) { 405 cmd_llsc_fifo_put = true; 406 r_tgt_cmd_fsm = TGT_CMD_IDLE; 407 } 408 break; 409 } 410 ///////////////////// 411 case TGT_CMD_CLEANUP: 412 { 413 assert(p_vci_tgt.eop && "Memory Cache Error: CLEANUP request with length > 1 "); 414 415 if ( p_vci_tgt.cmdval && m_cmd_cleanup_nline_fifo.wok() ) { 416 cmd_cleanup_fifo_put = true; 417 r_tgt_cmd_fsm = TGT_CMD_IDLE; 418 } 419 break; 420 } 421 } // end switch tgt_cmd_fsm 161 case VCI_BC_RECEIVE: 162 { 163 break; 164 } 165 } // end switch vci_fsm 422 166 423 167 … … 456 200 457 201 458 p_vci_ixr.be = 0xF; 459 p_vci_ixr.pktid = 0; 460 p_vci_ixr.srcid = m_srcid_ixr; 461 p_vci_ixr.cons = false; 462 p_vci_ixr.wrap = false; 463 p_vci_ixr.contig = true; 464 p_vci_ixr.clen = 0; 465 p_vci_ixr.cfixed = false; 466 467 if ( r_xram_cmd_fsm.read() == XRAM_CMD_READ_NLINE ) { 468 p_vci_ixr.cmd = vci_param::CMD_READ; 469 p_vci_ixr.cmdval = true; 470 p_vci_ixr.address = (r_read_to_xram_cmd_nline.read()*m_words*4); 471 p_vci_ixr.plen = m_words*4; 472 p_vci_ixr.wdata = 0x00000000; 473 p_vci_ixr.trdid = r_read_to_xram_cmd_trdid.read(); 474 p_vci_ixr.eop = true; 475 } 476 else if ( r_xram_cmd_fsm.read() == XRAM_CMD_LLSC_NLINE ) { 477 p_vci_ixr.cmd = vci_param::CMD_READ; 478 p_vci_ixr.cmdval = true; 479 p_vci_ixr.address = (r_llsc_to_xram_cmd_nline.read()*m_words*4); 480 p_vci_ixr.plen = m_words*4; 481 p_vci_ixr.wdata = 0x00000000; 482 p_vci_ixr.trdid = r_llsc_to_xram_cmd_trdid.read(); 483 p_vci_ixr.eop = true; 484 } 485 else if ( r_xram_cmd_fsm.read() == XRAM_CMD_WRITE_NLINE ) { 486 p_vci_ixr.cmd = vci_param::CMD_READ; 487 p_vci_ixr.cmdval = true; 488 p_vci_ixr.address = (r_write_to_xram_cmd_nline.read()*m_words*4); 489 p_vci_ixr.plen = m_words*4; 490 p_vci_ixr.wdata = 0x00000000; 491 p_vci_ixr.trdid = r_write_to_xram_cmd_trdid.read(); 492 p_vci_ixr.eop = true; 493 } 494 else if ( r_xram_cmd_fsm.read() == XRAM_CMD_XRAM_DATA ) { 495 p_vci_ixr.cmd = vci_param::CMD_WRITE; 496 p_vci_ixr.cmdval = true; 497 p_vci_ixr.address = ((r_xram_rsp_to_xram_cmd_nline.read()*m_words+r_xram_cmd_cpt.read())*4); 498 p_vci_ixr.plen = m_words*4; 499 p_vci_ixr.wdata = r_xram_rsp_to_xram_cmd_data[r_xram_cmd_cpt.read()].read(); 500 p_vci_ixr.trdid = r_xram_rsp_to_xram_cmd_trdid.read(); 501 p_vci_ixr.eop = (r_xram_cmd_cpt == (m_words-1)); 502 } else { 503 p_vci_ixr.cmdval = false; 504 p_vci_ixr.address = 0; 505 p_vci_ixr.plen = 0; 506 p_vci_ixr.wdata = 0; 507 p_vci_ixr.trdid = 0; 508 p_vci_ixr.eop = false; 509 } 510 511 //////////////////////////////////////////////////// 512 // Response signals on the p_vci_ixr port 513 //////////////////////////////////////////////////// 514 515 if ( ((r_alloc_trt_fsm.read() == ALLOC_TRT_IXR_RSP) && 516 (r_ixr_rsp_fsm.read() == IXR_RSP_TRT_READ)) || 517 (r_ixr_rsp_fsm.read() == IXR_RSP_ACK) ) p_vci_ixr.rspack = true; 518 else p_vci_ixr.rspack = false; 519 520 //////////////////////////////////////////////////// 521 // Command signals on the p_vci_tgt port 522 //////////////////////////////////////////////////// 523 524 switch ((tgt_cmd_fsm_state_e)r_tgt_cmd_fsm.read()) { 525 case TGT_CMD_IDLE: 526 p_vci_tgt.cmdack = false; 527 break; 528 case TGT_CMD_READ: 529 p_vci_tgt.cmdack = m_cmd_read_addr_fifo.wok(); 530 break; 531 case TGT_CMD_READ_EOP: 532 p_vci_tgt.cmdack = true; 533 break; 534 case TGT_CMD_WRITE: 535 p_vci_tgt.cmdack = m_cmd_write_addr_fifo.wok(); 536 break; 537 case TGT_CMD_ATOMIC: 538 p_vci_tgt.cmdack = m_cmd_llsc_addr_fifo.wok(); 539 break; 540 case TGT_CMD_CLEANUP: 541 p_vci_tgt.cmdack = m_cmd_cleanup_nline_fifo.wok(); 542 break; 543 default: 544 p_vci_tgt.cmdack = false; 545 break; 546 } 547 548 //////////////////////////////////////////////////// 549 // Response signals on the p_vci_tgt port 550 //////////////////////////////////////////////////// 551 switch ( r_tgt_rsp_fsm.read() ) { 552 553 case TGT_RSP_READ_IDLE: 554 case TGT_RSP_WRITE_IDLE: 555 case TGT_RSP_LLSC_IDLE: 556 case TGT_RSP_CLEANUP_IDLE: 557 case TGT_RSP_XRAM_IDLE: 558 case TGT_RSP_INIT_IDLE: 559 case TGT_RSP_READ_TEST: 560 case TGT_RSP_XRAM_TEST: 561 562 p_vci_tgt.rspval = false; 563 p_vci_tgt.rsrcid = 0; 564 p_vci_tgt.rdata = 0; 565 p_vci_tgt.rpktid = 0; 566 p_vci_tgt.rtrdid = 0; 567 p_vci_tgt.rerror = 0; 568 p_vci_tgt.reop = false; 569 break; 570 case TGT_RSP_READ_LINE: 571 p_vci_tgt.rspval = true; 572 p_vci_tgt.rdata = r_read_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read(); 573 p_vci_tgt.rsrcid = r_read_to_tgt_rsp_srcid.read(); 574 p_vci_tgt.rtrdid = r_read_to_tgt_rsp_trdid.read(); 575 p_vci_tgt.rpktid = r_read_to_tgt_rsp_pktid.read(); 576 p_vci_tgt.rerror = 0; 577 p_vci_tgt.reop = (r_tgt_rsp_cpt.read()==(m_words-1)); 578 break; 579 case TGT_RSP_READ_WORD: 580 p_vci_tgt.rspval = true; 581 p_vci_tgt.rdata = r_read_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read(); 582 p_vci_tgt.rsrcid = r_read_to_tgt_rsp_srcid.read(); 583 p_vci_tgt.rtrdid = r_read_to_tgt_rsp_trdid.read(); 584 p_vci_tgt.rpktid = r_read_to_tgt_rsp_pktid.read(); 585 p_vci_tgt.rerror = 0; 586 p_vci_tgt.reop = true; 587 break; 588 case TGT_RSP_WRITE: 589 p_vci_tgt.rspval = true; 590 p_vci_tgt.rdata = 0; 591 p_vci_tgt.rsrcid = r_write_to_tgt_rsp_srcid.read(); 592 p_vci_tgt.rtrdid = r_write_to_tgt_rsp_trdid.read(); 593 p_vci_tgt.rpktid = r_write_to_tgt_rsp_pktid.read(); 594 p_vci_tgt.rerror = 0; 595 p_vci_tgt.reop = true; 596 break; 597 case TGT_RSP_CLEANUP: 598 p_vci_tgt.rspval = true; 599 p_vci_tgt.rdata = 0; 600 p_vci_tgt.rsrcid = r_cleanup_to_tgt_rsp_srcid.read(); 601 p_vci_tgt.rtrdid = r_cleanup_to_tgt_rsp_trdid.read(); 602 p_vci_tgt.rpktid = r_cleanup_to_tgt_rsp_pktid.read(); 603 p_vci_tgt.rerror = 0; 604 p_vci_tgt.reop = true; 605 break; 606 case TGT_RSP_LLSC: 607 p_vci_tgt.rspval = true; 608 p_vci_tgt.rdata = r_llsc_to_tgt_rsp_data.read(); 609 p_vci_tgt.rsrcid = r_llsc_to_tgt_rsp_srcid.read(); 610 p_vci_tgt.rtrdid = r_llsc_to_tgt_rsp_trdid.read(); 611 p_vci_tgt.rpktid = r_llsc_to_tgt_rsp_pktid.read(); 612 p_vci_tgt.rerror = 0; 613 p_vci_tgt.reop = true; 614 break; 615 case TGT_RSP_XRAM_LINE: 616 p_vci_tgt.rspval = true; 617 p_vci_tgt.rdata = r_xram_rsp_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read(); 618 p_vci_tgt.rsrcid = r_xram_rsp_to_tgt_rsp_srcid.read(); 619 p_vci_tgt.rtrdid = r_xram_rsp_to_tgt_rsp_trdid.read(); 620 p_vci_tgt.rpktid = r_xram_rsp_to_tgt_rsp_pktid.read(); 621 p_vci_tgt.rerror = 0; 622 p_vci_tgt.reop = (r_tgt_rsp_cpt.read()==(m_words-1)); 623 break; 624 case TGT_RSP_XRAM_WORD: 625 p_vci_tgt.rspval = true; 626 p_vci_tgt.rdata = r_xram_rsp_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read(); 627 p_vci_tgt.rsrcid = r_xram_rsp_to_tgt_rsp_srcid.read(); 628 p_vci_tgt.rtrdid = r_xram_rsp_to_tgt_rsp_trdid.read(); 629 p_vci_tgt.rpktid = r_xram_rsp_to_tgt_rsp_pktid.read(); 630 p_vci_tgt.rerror = 0; 631 p_vci_tgt.reop = true; 632 break; 633 case TGT_RSP_INIT: 634 p_vci_tgt.rspval = true; 635 p_vci_tgt.rdata = 0; 636 p_vci_tgt.rsrcid = r_init_rsp_to_tgt_rsp_srcid.read(); 637 p_vci_tgt.rtrdid = r_init_rsp_to_tgt_rsp_trdid.read(); 638 p_vci_tgt.rpktid = r_init_rsp_to_tgt_rsp_pktid.read(); 639 p_vci_tgt.rerror = 0; 640 p_vci_tgt.reop = true; 641 break; 642 } // end switch r_tgt_rsp_fsm 643 644 /////////////////////////////////////////////////// 645 // Command signals on the p_vci_ini port 646 /////////////////////////////////////////////////// 647 648 p_vci_ini.cmd = vci_param::CMD_WRITE; 649 p_vci_ini.srcid = m_srcid_ini; 650 p_vci_ini.pktid = 0; 651 p_vci_ini.cons = true; 652 p_vci_ini.wrap = false; 653 p_vci_ini.contig = false; 654 p_vci_ini.clen = 0; 655 p_vci_ini.cfixed = false; 656 657 switch ( r_init_cmd_fsm.read() ) { 658 659 case INIT_CMD_UPDT_IDLE: 660 case INIT_CMD_INVAL_IDLE: 661 case INIT_CMD_UPDT_SEL: 662 case INIT_CMD_INVAL_SEL: 663 p_vci_ini.cmdval = false; 664 p_vci_ini.address = 0; 665 p_vci_ini.wdata = 0; 666 p_vci_ini.be = 0; 667 p_vci_ini.plen = 0; 668 p_vci_ini.trdid = 0; 669 p_vci_ini.eop = false; 670 break; 671 case INIT_CMD_INVAL_NLINE: 672 p_vci_ini.cmdval = true; 673 p_vci_ini.address = m_coherence_table[r_init_cmd_target.read()]; 674 p_vci_ini.wdata = r_xram_rsp_to_init_cmd_nline.read(); 675 p_vci_ini.be = 0xF; 676 p_vci_ini.plen = 4; 677 p_vci_ini.trdid = r_xram_rsp_to_init_cmd_trdid.read(); 678 p_vci_ini.eop = true; 679 break; 680 case INIT_CMD_UPDT_NLINE: 681 p_vci_ini.cmdval = true; 682 p_vci_ini.address = m_coherence_table[r_init_cmd_target.read()] + 4; 683 p_vci_ini.wdata = r_write_to_init_cmd_nline.read(); 684 p_vci_ini.be = 0xF; 685 p_vci_ini.plen = 4 * (r_write_to_init_cmd_count.read() + 2); 686 p_vci_ini.trdid = r_write_to_init_cmd_trdid.read(); 687 p_vci_ini.eop = false; 688 break; 689 case INIT_CMD_UPDT_INDEX: 690 p_vci_ini.cmdval = true; 691 p_vci_ini.address = m_coherence_table[r_init_cmd_target.read()] + 4; 692 p_vci_ini.wdata = r_write_to_init_cmd_index.read(); 693 p_vci_ini.be = 0xF; 694 p_vci_ini.plen = 4 * (r_write_to_init_cmd_count.read() + 2); 695 p_vci_ini.trdid = r_write_to_init_cmd_trdid.read(); 696 p_vci_ini.eop = false; 697 break; 698 case INIT_CMD_UPDT_DATA: 699 p_vci_ini.cmdval = true; 700 p_vci_ini.address = m_coherence_table[r_init_cmd_target.read()] + 4; 701 p_vci_ini.wdata = r_write_to_init_cmd_data[r_init_cmd_cpt.read() + 702 r_write_to_init_cmd_index.read()].read(); 703 if(r_write_to_init_cmd_we[r_init_cmd_cpt.read() + 704 r_write_to_init_cmd_index.read()].read()) 705 p_vci_ini.be = 0xF; 706 else p_vci_ini.be = 0x0; 707 p_vci_ini.plen = 4 * (r_write_to_init_cmd_count.read() + 2); 708 p_vci_ini.trdid = r_write_to_init_cmd_trdid.read(); 709 p_vci_ini.eop = ( r_init_cmd_cpt.read() == (r_write_to_init_cmd_count.read()-1) ); 710 break; 711 } // end switch r_init_cmd_fsm 712 713 ////////////////////////////////////////////////////// 714 // Response signals on the p_vci_ini port 715 ////////////////////////////////////////////////////// 716 717 if ( r_init_rsp_fsm.read() == INIT_RSP_IDLE ) p_vci_ini.rspack = true; 718 else p_vci_ini.rspack = false; 202 switch ( r_vci_fsm.read() ) { 203 204 ////////////////// 205 case VCI_IDLE: 206 { 207 break; 208 } 209 ////////////////// 210 case VCI_SINGLE_SEND: 211 { 212 break; 213 } 214 ////////////////////// 215 case VCI_SINGLE_RECEIVE: 216 { 217 break; 218 } 219 /////////////////// 220 case VCI_BC_SEND: 221 { 222 break; 223 } 224 //////////////////// 225 case VCI_BC_RECEIVE: 226 { 227 break; 228 } 229 } // end switch vci_fsm 719 230 720 231 } // end genMoore()
Note: See TracChangeset
for help on using the changeset viewer.