Changeset 191 for trunk/modules
- Timestamp:
- Feb 10, 2012, 9:47:48 AM (13 years ago)
- Location:
- trunk/modules/vci_cc_xcache_wrapper_v1/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_cc_xcache_wrapper_v1/caba/source/include/vci_cc_xcache_wrapper_v1.h
r2 r191 144 144 const size_t m_icache_yzmask; 145 145 146 const size_t m_x_width; 147 const size_t m_y_width; 148 const size_t m_memc_id; 149 addr_40 m_srcid_mask; 150 146 151 // REGISTERS 147 152 sc_signal<int> r_dcache_fsm; … … 264 269 size_t dcache_ways, 265 270 size_t dcache_sets, 266 size_t dcache_words ); 271 size_t dcache_words, 272 size_t x_width, 273 size_t y_width, 274 size_t memc_id ); 267 275 268 276 ~VciCcXCacheWrapperV1(); -
trunk/modules/vci_cc_xcache_wrapper_v1/caba/source/src/vci_cc_xcache_wrapper_v1.cpp
r85 r191 28 28 * nipo 29 29 * malek <abdelmalek.si-merabet@lip6.fr> 30 * cfuguet <c.sarfuguet@gmail.com> 30 31 */ 31 32 … … 65 66 66 67 //#define DEBUG_CC_XCACHE_WRAPPER 1 68 //#define DEBUG_CLEANUP 67 69 68 70 namespace soclib { … … 150 152 size_t dcache_ways, 151 153 size_t dcache_sets, 152 size_t dcache_words ) 154 size_t dcache_words, 155 // Parameters for the CLEANUP transaction 156 size_t x_width, 157 size_t y_width, 158 size_t memc_id ) 153 159 : 154 160 soclib::caba::BaseModule(name), … … 172 178 m_icache_words(icache_words), 173 179 m_icache_yzmask((~0)<<(uint32_log2(icache_words) + 2)), 180 181 m_x_width(x_width), 182 m_y_width(y_width), 183 184 m_memc_id(memc_id), 185 186 m_srcid_mask(~((0x1 << (vci_param::N - vci_param::S)) - 1)), 174 187 175 188 r_dcache_fsm("r_dcache_fsm"), … … 1571 1584 // VCI initiator command 1572 1585 1586 addr_40 memc_addr = 0; 1573 1587 switch (r_vci_cmd_fsm.read() ) { 1574 1588 … … 1798 1812 1799 1813 case CMD_INS_CLEANUP: 1814 { 1800 1815 p_vci_ini_rw.cmdval = false; 1801 1816 p_vci_ini_rw.address = 0; … … 1814 1829 p_vci_ini_rw.eop = false; 1815 1830 1831 memc_addr = r_icache_cleanup_line.read() * (m_icache_words<<2); 1832 memc_addr.range(vci_param::N-1 - m_x_width - m_y_width, vci_param::N - vci_param::S) 1833 = m_memc_id; 1834 1835 memc_addr &= m_srcid_mask; 1836 1816 1837 p_vci_ini_c.cmdval = true; 1817 p_vci_ini_c.address = r_icache_cleanup_line.read() * (m_icache_words<<2); 1818 p_vci_ini_c.wdata = 0; 1819 p_vci_ini_c.be = 0; 1820 p_vci_ini_c.plen = 4; 1821 p_vci_ini_c.cmd = vci_param::CMD_WRITE; 1822 p_vci_ini_c.trdid = 1; // cleanup instruction 1823 p_vci_ini_c.pktid = 0; 1824 p_vci_ini_c.srcid = m_srcid_c; 1825 p_vci_ini_c.cons = false; 1826 p_vci_ini_c.wrap = false; 1827 p_vci_ini_c.contig = false; 1828 p_vci_ini_c.clen = 0; 1829 p_vci_ini_c.cfixed = false; 1830 p_vci_ini_c.eop = true; 1831 1832 break; 1833 1838 p_vci_ini_c.address = memc_addr; 1839 p_vci_ini_c.wdata = r_icache_cleanup_line.read().range(31, 0); 1840 p_vci_ini_c.be = r_icache_cleanup_line.read().range(33, 32); 1841 p_vci_ini_c.plen = 4; 1842 p_vci_ini_c.cmd = vci_param::CMD_WRITE; 1843 p_vci_ini_c.trdid = 1; // cleanup instruction 1844 p_vci_ini_c.pktid = 0; 1845 p_vci_ini_c.srcid = m_srcid_c; 1846 p_vci_ini_c.cons = false; 1847 p_vci_ini_c.wrap = false; 1848 p_vci_ini_c.contig = false; 1849 p_vci_ini_c.clen = 0; 1850 p_vci_ini_c.cfixed = false; 1851 p_vci_ini_c.eop = true; 1852 1853 #ifdef DEBUG_CLEANUP 1854 std::cout << "Initiating Instruction Cleanup Transaction..." << std::endl; 1855 std::cout << "MemoryCache Address: " << std::hex << memc_addr << std::endl; 1856 std::cout << "Cache Line Address to cleanup: " << std::hex << r_icache_cleanup_line.read() 1857 << std::endl; 1858 #endif 1859 } 1860 break; 1834 1861 1835 1862 case CMD_DATA_CLEANUP: 1863 { 1836 1864 p_vci_ini_rw.cmdval = false; 1837 1865 p_vci_ini_rw.address = 0; … … 1850 1878 p_vci_ini_rw.eop = false; 1851 1879 1880 memc_addr = r_dcache_cleanup_line.read() * (m_dcache_words<<2); 1881 memc_addr.range(vci_param::N-1 - m_x_width - m_y_width, vci_param::N - vci_param::S) 1882 = m_memc_id; 1883 1884 memc_addr &= m_srcid_mask; 1885 1852 1886 p_vci_ini_c.cmdval = true; 1853 p_vci_ini_c.address = r_dcache_cleanup_line.read() * (m_dcache_words<<2); 1854 p_vci_ini_c.wdata = 0; 1855 p_vci_ini_c.be = 0; 1856 p_vci_ini_c.plen = 4; 1857 p_vci_ini_c.cmd = vci_param::CMD_WRITE; 1858 p_vci_ini_c.trdid = 0; // cleanup data 1859 p_vci_ini_c.pktid = 0; 1860 p_vci_ini_c.srcid = m_srcid_c; 1861 p_vci_ini_c.cons = false; 1862 p_vci_ini_c.wrap = false; 1863 p_vci_ini_c.contig = false; 1864 p_vci_ini_c.clen = 0; 1865 p_vci_ini_c.cfixed = false; 1866 p_vci_ini_c.eop = true; 1867 1887 p_vci_ini_c.address = memc_addr; 1888 p_vci_ini_c.wdata = r_dcache_cleanup_line.read().range(31, 0); 1889 p_vci_ini_c.be = r_dcache_cleanup_line.read().range(33, 32); 1890 p_vci_ini_c.plen = 4; 1891 p_vci_ini_c.cmd = vci_param::CMD_WRITE; 1892 p_vci_ini_c.trdid = 0; // cleanup data 1893 p_vci_ini_c.pktid = 0; 1894 p_vci_ini_c.srcid = m_srcid_c; 1895 p_vci_ini_c.cons = false; 1896 p_vci_ini_c.wrap = false; 1897 p_vci_ini_c.contig = false; 1898 p_vci_ini_c.clen = 0; 1899 p_vci_ini_c.cfixed = false; 1900 p_vci_ini_c.eop = true; 1901 1902 #ifdef DEBUG_CLEANUP 1903 std::cout << "Initiating Data Cleanup Transaction..." << std::endl; 1904 std::cout << "MemoryCache Address: " << std::hex << memc_addr << std::endl; 1905 std::cout << "Cache Line Address to cleanup: " << std::hex << r_dcache_cleanup_line.read() 1906 << std::endl; 1907 #endif 1908 } 1868 1909 break; 1869 1910
Note: See TracChangeset
for help on using the changeset viewer.