Changeset 245 for trunk/modules
- Timestamp:
- Aug 3, 2012, 7:59:32 PM (12 years ago)
- Location:
- trunk/modules/vci_mem_cache_v4/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_mem_cache_v4/caba/source/include/vci_mem_cache_v4.h
r222 r245 430 430 sc_signal<int> r_tgt_cmd_fsm; 431 431 432 size_t nseg;433 size_t ncseg;432 size_t m_nseg; 433 size_t m_ncseg; 434 434 soclib::common::Segment **m_seg; 435 435 soclib::common::Segment **m_cseg; 436 436 437 /////////////////////////////////////////////////////// 437 438 // Registers controlled by the READ fsm -
trunk/modules/vci_mem_cache_v4/caba/source/src/vci_mem_cache_v4.cpp
r224 r245 313 313 r_tgt_cmd_fsm("r_tgt_cmd_fsm"), 314 314 315 nseg(0),316 ncseg(0),315 m_nseg(0), 316 m_ncseg(0), 317 317 318 318 r_read_fsm("r_read_fsm"), … … 373 373 // Get the segments associated to the MemCache 374 374 std::list<soclib::common::Segment>::iterator seg; 375 size_t i; 375 376 376 377 for(seg = m_seglist.begin(); seg != m_seglist.end() ; seg++) { 377 nseg++;378 m_nseg++; 378 379 } 379 380 for(seg = m_cseglist.begin(); seg != m_cseglist.end() ; seg++) { 380 ncseg++;381 m_ncseg++; 381 382 } 382 383 383 m_seg = new soclib::common::Segment*[nseg]; 384 size_t i = 0; 384 m_seg = new soclib::common::Segment*[m_nseg]; 385 386 i = 0; 385 387 for ( seg = m_seglist.begin() ; seg != m_seglist.end() ; seg++ ) { 386 388 m_seg[i] = &(*seg); 387 389 i++; 388 390 } 389 m_cseg = new soclib::common::Segment*[ncseg]; 391 392 m_cseg = new soclib::common::Segment*[m_ncseg]; 393 390 394 i = 0; 391 395 for ( seg = m_cseglist.begin() ; seg != m_cseglist.end() ; seg++ ) { … … 803 807 } 804 808 #endif 809 // checking segmentation violation 810 vci_addr_t address = p_vci_tgt.address.read(); 811 uint32_t plen = p_vci_tgt.plen.read(); 812 bool found = false; 813 for ( size_t seg_id = 0 ; seg_id < m_nseg ; seg_id++ ) 814 { 815 if ( m_seg[seg_id]->contains(address) && 816 m_seg[seg_id]->contains(address + plen - vci_param::B) ) 817 { 818 found = true; 819 } 820 } 821 if ( not found ) 822 { 823 std::cout << "VCI_MEM_CACHE ERROR " << name() << std::endl; 824 std::cout << "Out of segment VCI address in TGT_CMD_IDLE state" << std::endl; 825 exit(0); 826 } 827 805 828 if ( p_vci_tgt.cmd.read() == vci_param::CMD_READ ) 806 829 { … … 3266 3289 3267 3290 bool reached = false; 3268 for ( size_t index = 0 ; index < ncseg && !reached ; index++ )3291 for ( size_t index = 0 ; index < m_ncseg && !reached ; index++ ) 3269 3292 { 3270 3293 if ( m_cseg[index]->contains((addr_t)(p_vci_tgt_cleanup.address.read())) )
Note: See TracChangeset
for help on using the changeset viewer.