Changeset 247 for trunk/modules
- Timestamp:
- Aug 8, 2012, 12:03:25 PM (12 years ago)
- Location:
- trunk/modules
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_cc_vcache_wrapper_v4/caba/source/include/vci_cc_vcache_wrapper_v4.h
r217 r247 254 254 const size_t m_dcache_words; 255 255 256 const size_t m_x_width; 257 const size_t m_y_width; 258 259 const size_t m_memory_cache_local_id; 260 256 261 const size_t m_proc_id; 257 262 … … 625 630 size_t wbuf_nlines, 626 631 size_t wbuf_nwords, 632 size_t x_width, 633 size_t y_width, 634 uint32_t memory_cache_local_id, 627 635 uint32_t max_frozen_cycles, 628 636 uint32_t debug_start_cycle, -
trunk/modules/vci_cc_vcache_wrapper_v4/caba/source/src/vci_cc_vcache_wrapper_v4.cpp
r239 r247 166 166 size_t wbuf_nlines, 167 167 size_t wbuf_nwords, 168 uint32_t max_frozen_cycles, 169 uint32_t debug_start_cycle, 168 size_t x_width, 169 size_t y_width, 170 uint32_t memory_cache_local_id, 171 uint32_t max_frozen_cycles, 172 uint32_t debug_start_cycle, 170 173 bool debug_ok) 171 174 : soclib::caba::BaseModule(name), … … 197 200 m_dcache_yzmask((~0)<<(uint32_log2(dcache_words) + 2)), 198 201 m_dcache_words(dcache_words), 202 203 m_x_width(x_width), 204 m_y_width(y_width), 205 206 m_memory_cache_local_id(memory_cache_local_id), 199 207 200 208 m_proc_id(proc_id), … … 4812 4820 // it depends on the CLEANUP FSM state 4813 4821 4822 paddr_t cleanup_nline; 4814 4823 paddr_t address; 4815 4824 4816 4825 if ( r_cleanup_fsm.read() == CLEANUP_DATA_GO ) 4817 address = r_dcache_cleanup_line.read()*m_dcache_words*4; 4826 { 4827 cleanup_nline = r_dcache_cleanup_line.read(); 4828 address = (m_x_width + m_y_width) ? (cleanup_nline * m_dcache_words * 4 ) >> 4829 (vci_param::N - m_x_width - m_y_width ) : 0; 4830 } 4818 4831 else if ( r_cleanup_fsm.read() == CLEANUP_INS_GO ) 4819 address = r_icache_cleanup_line.read()*m_icache_words*4; 4832 { 4833 cleanup_nline = r_icache_cleanup_line.read(); 4834 address = (m_x_width + m_y_width) ? (cleanup_nline * m_icache_words * 4 ) >> 4835 (vci_param::N - m_x_width - m_y_width ) : 0; 4836 } 4820 4837 else 4821 address = 0; 4838 { 4839 cleanup_nline = 0; 4840 address = 0; 4841 } 4842 4843 address <<= vci_param::S - m_x_width - m_y_width; 4844 address |= m_memory_cache_local_id; 4845 address <<= vci_param::N - vci_param::S; 4822 4846 4823 4847 p_vci_ini_c.cmdval = ((r_cleanup_fsm.read() == CLEANUP_DATA_GO) or 4824 4848 (r_cleanup_fsm.read() == CLEANUP_INS_GO) ); 4825 4849 p_vci_ini_c.address = address; 4826 p_vci_ini_c.wdata = 0;4827 p_vci_ini_c.be = 0xF;4850 p_vci_ini_c.wdata = (uint32_t) cleanup_nline; 4851 p_vci_ini_c.be = (cleanup_nline >> 32) & 0x3; 4828 4852 p_vci_ini_c.plen = 4; 4829 4853 p_vci_ini_c.cmd = vci_param::CMD_WRITE; -
trunk/modules/vci_mem_cache_v4/caba/source/src/vci_mem_cache_v4.cpp
r246 r247 273 273 m_seglist(mtp.getSegmentList(vci_tgt_index)), 274 274 m_cseglist(mtc.getSegmentList(vci_tgt_index_cleanup)), 275 m_coherence_table( mtc.getCoherenceTable<vci_addr_t>() ),276 275 m_transaction_tab_lines(transaction_tab_lines), 277 276 m_transaction_tab( transaction_tab_lines, nwords ), … … 354 353 r_alloc_dir_fsm("r_alloc_dir_fsm"), 355 354 r_alloc_trt_fsm("r_alloc_trt_fsm"), 356 r_alloc_upt_fsm("r_alloc_upt_fsm") 357 355 r_alloc_upt_fsm("r_alloc_upt_fsm"), 356 r_alloc_heap_fsm("r_alloc_heap_fsm") 358 357 { 359 358 assert(IS_POW_OF_2(nsets)); … … 552 551 } 553 552 delete [] m_cache_data; 554 delete [] m_coherence_table;555 553 556 554 delete [] r_ixr_rsp_to_xram_rsp_rok; … … 587 585 r_cleanup_fsm = CLEANUP_IDLE; 588 586 r_alloc_dir_fsm = ALLOC_DIR_READ; 587 r_alloc_heap_fsm = ALLOC_HEAP_READ; 589 588 r_alloc_trt_fsm = ALLOC_TRT_READ; 590 589 r_alloc_upt_fsm = ALLOC_UPT_WRITE; … … 3298 3297 ((p_vci_tgt_cleanup.address.read() & 0x3) == 0) && reached) 3299 3298 { 3300 addr_t line = (addr_t)(m_nline[(vci_addr_t)(p_vci_tgt_cleanup.address.read())]); 3299 addr_t line =(((addr_t) p_vci_tgt_cleanup.be.read() << (vci_param::B*8))) | 3300 (((addr_t) p_vci_tgt_cleanup.wdata.read())); 3301 3301 3302 3302 r_cleanup_nline = line; … … 5253 5253 switch ( r_alloc_dir_fsm.read() ) 5254 5254 { 5255 5256 5255 //////////////////// 5257 5256 case ALLOC_DIR_READ: … … 5881 5880 p_vci_ini.cfixed = false; 5882 5881 5882 vci_addr_t vci_ini_address = 0; 5883 5883 switch ( r_init_cmd_fsm.read() ) { 5884 5884 … … 5897 5897 case INIT_CMD_INVAL_NLINE: 5898 5898 { 5899 vci_ini_address = (vci_addr_t) 5900 m_xram_rsp_to_init_cmd_srcid_fifo.read() << (vci_param::N - vci_param::S); 5901 5899 5902 p_vci_ini.cmdval = m_xram_rsp_to_init_cmd_inst_fifo.rok(); 5900 5903 if(m_xram_rsp_to_init_cmd_inst_fifo.rok()){ 5901 5904 if(m_xram_rsp_to_init_cmd_inst_fifo.read()) { 5902 p_vci_ini.address = (addr_t)(m_coherence_table[m_xram_rsp_to_init_cmd_srcid_fifo.read()]+4);5905 p_vci_ini.address = (addr_t) (vci_ini_address+4); 5903 5906 } else { 5904 p_vci_ini.address = (addr_t)(m_coherence_table[m_xram_rsp_to_init_cmd_srcid_fifo.read()]);5907 p_vci_ini.address = (addr_t) (vci_ini_address); 5905 5908 } 5906 5909 } else p_vci_ini.address = 0; // prevent segmentation faults by reading an empty fifo … … 5935 5938 break; 5936 5939 case INIT_CMD_UPDT_NLINE: 5940 vci_ini_address = (vci_addr_t) 5941 m_write_to_init_cmd_srcid_fifo.read() << (vci_param::N - vci_param::S); 5942 5937 5943 p_vci_ini.cmdval = m_write_to_init_cmd_inst_fifo.rok(); 5938 5944 if(m_write_to_init_cmd_inst_fifo.rok()){ 5939 5945 if(m_write_to_init_cmd_inst_fifo.read()) { 5940 p_vci_ini.address = (addr_t)( m_coherence_table[m_write_to_init_cmd_srcid_fifo.read()]+ 12);5946 p_vci_ini.address = (addr_t)(vci_ini_address + 12); 5941 5947 } else { 5942 p_vci_ini.address = (addr_t)( m_coherence_table[m_write_to_init_cmd_srcid_fifo.read()]+ 8);5948 p_vci_ini.address = (addr_t)(vci_ini_address + 8); 5943 5949 } 5944 5950 } else { … … 5953 5959 break; 5954 5960 case INIT_CMD_UPDT_INDEX: 5961 vci_ini_address = (vci_addr_t) 5962 m_write_to_init_cmd_srcid_fifo.read() << (vci_param::N - vci_param::S); 5963 5955 5964 p_vci_ini.cmdval = true; 5956 5965 if(m_write_to_init_cmd_inst_fifo.read()) { 5957 p_vci_ini.address = (addr_t)( m_coherence_table[m_write_to_init_cmd_srcid_fifo.read()]+ 12);5966 p_vci_ini.address = (addr_t)(vci_ini_address + 12); 5958 5967 } else { 5959 p_vci_ini.address = (addr_t)( m_coherence_table[m_write_to_init_cmd_srcid_fifo.read()]+ 8);5968 p_vci_ini.address = (addr_t)(vci_ini_address + 8); 5960 5969 } 5961 5970 p_vci_ini.wdata = r_write_to_init_cmd_index.read(); … … 5967 5976 break; 5968 5977 case INIT_CMD_UPDT_DATA: 5978 vci_ini_address = (vci_addr_t) 5979 m_write_to_init_cmd_srcid_fifo.read() << (vci_param::N - vci_param::S); 5980 5969 5981 p_vci_ini.cmdval = true; 5970 5982 if(m_write_to_init_cmd_inst_fifo.read()) { 5971 p_vci_ini.address = (addr_t)( m_coherence_table[m_write_to_init_cmd_srcid_fifo.read()]+ 12);5983 p_vci_ini.address = (addr_t)(vci_ini_address + 12); 5972 5984 } else { 5973 p_vci_ini.address = (addr_t)( m_coherence_table[m_write_to_init_cmd_srcid_fifo.read()]+ 8);5985 p_vci_ini.address = (addr_t)(vci_ini_address + 8); 5974 5986 } 5975 5987 p_vci_ini.wdata = r_write_to_init_cmd_data[r_init_cmd_cpt.read() + … … 5994 6006 break; 5995 6007 case INIT_CMD_SC_UPDT_NLINE: 6008 vci_ini_address = (vci_addr_t) 6009 m_sc_to_init_cmd_srcid_fifo.read() << (vci_param::N - vci_param::S); 6010 5996 6011 p_vci_ini.cmdval = m_sc_to_init_cmd_inst_fifo.rok(); 5997 6012 if(m_sc_to_init_cmd_inst_fifo.rok()){ 5998 6013 if( m_sc_to_init_cmd_inst_fifo.read() ) { 5999 p_vci_ini.address = (addr_t)( m_coherence_table[m_sc_to_init_cmd_srcid_fifo.read()]+ 12);6014 p_vci_ini.address = (addr_t)(vci_ini_address + 12); 6000 6015 } else { 6001 p_vci_ini.address = (addr_t)( m_coherence_table[m_sc_to_init_cmd_srcid_fifo.read()]+ 8);6016 p_vci_ini.address = (addr_t)(vci_ini_address + 8); 6002 6017 } 6003 6018 } else { … … 6016 6031 break; 6017 6032 case INIT_CMD_SC_UPDT_INDEX: 6033 vci_ini_address = (vci_addr_t) 6034 m_sc_to_init_cmd_srcid_fifo.read() << (vci_param::N - vci_param::S); 6035 6018 6036 p_vci_ini.cmdval = true; 6019 6037 if( m_sc_to_init_cmd_inst_fifo.read() ) { 6020 p_vci_ini.address = (addr_t)( m_coherence_table[m_sc_to_init_cmd_srcid_fifo.read()]+ 12);6038 p_vci_ini.address = (addr_t)(vci_ini_address + 12); 6021 6039 } else { 6022 p_vci_ini.address = (addr_t)( m_coherence_table[m_sc_to_init_cmd_srcid_fifo.read()]+ 8);6040 p_vci_ini.address = (addr_t)(vci_ini_address + 8); 6023 6041 } 6024 6042 p_vci_ini.wdata = r_sc_to_init_cmd_index.read(); … … 6034 6052 break; 6035 6053 case INIT_CMD_SC_UPDT_DATA: 6054 vci_ini_address = (vci_addr_t) 6055 m_sc_to_init_cmd_srcid_fifo.read() << (vci_param::N - vci_param::S); 6056 6036 6057 p_vci_ini.cmdval = true; 6037 6058 if( m_sc_to_init_cmd_inst_fifo.read() ) { 6038 p_vci_ini.address = (addr_t)( m_coherence_table[m_sc_to_init_cmd_srcid_fifo.read()]+ 12);6059 p_vci_ini.address = (addr_t)(vci_ini_address + 12); 6039 6060 } else { 6040 p_vci_ini.address = (addr_t)( m_coherence_table[m_sc_to_init_cmd_srcid_fifo.read()]+ 8);6061 p_vci_ini.address = (addr_t)(vci_ini_address + 8); 6041 6062 } 6042 6063 p_vci_ini.wdata = r_sc_to_init_cmd_wdata.read(); … … 6053 6074 break; 6054 6075 case INIT_CMD_SC_UPDT_DATA_HIGH: 6076 vci_ini_address = (vci_addr_t) 6077 m_sc_to_init_cmd_srcid_fifo.read() << (vci_param::N - vci_param::S); 6078 6055 6079 p_vci_ini.cmdval = true; 6056 6080 if( m_sc_to_init_cmd_inst_fifo.read() ) { 6057 p_vci_ini.address = (addr_t)( m_coherence_table[m_sc_to_init_cmd_srcid_fifo.read()]+ 12);6081 p_vci_ini.address = (addr_t)(vci_ini_address + 12); 6058 6082 } else { 6059 p_vci_ini.address = (addr_t)( m_coherence_table[m_sc_to_init_cmd_srcid_fifo.read()]+ 8);6083 p_vci_ini.address = (addr_t)(vci_ini_address + 8); 6060 6084 } 6061 6085 p_vci_ini.wdata = r_sc_to_init_cmd_wdata_high.read();
Note: See TracChangeset
for help on using the changeset viewer.