Changeset 191 for trunk/modules


Ignore:
Timestamp:
Feb 10, 2012, 9:47:48 AM (12 years ago)
Author:
cfuguet
Message:

Cleanup transaction modification

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  
    144144    const size_t        m_icache_yzmask;
    145145
     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
    146151    // REGISTERS
    147152    sc_signal<int>          r_dcache_fsm;
     
    264269                       size_t dcache_ways,
    265270                       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 );
    267275
    268276    ~VciCcXCacheWrapperV1();
  • trunk/modules/vci_cc_xcache_wrapper_v1/caba/source/src/vci_cc_xcache_wrapper_v1.cpp

    r85 r191  
    2828 *              nipo
    2929 *              malek <abdelmalek.si-merabet@lip6.fr>
     30 *              cfuguet <c.sarfuguet@gmail.com>
    3031 */
    3132
     
    6566
    6667//#define DEBUG_CC_XCACHE_WRAPPER 1
     68//#define DEBUG_CLEANUP
    6769
    6870namespace soclib {
     
    150152            size_t dcache_ways,
    151153            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 )
    153159        :
    154160            soclib::caba::BaseModule(name),
     
    172178            m_icache_words(icache_words),
    173179            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)),
    174187
    175188            r_dcache_fsm("r_dcache_fsm"),
     
    15711584        // VCI initiator command
    15721585
     1586        addr_40 memc_addr = 0;
    15731587        switch (r_vci_cmd_fsm.read() ) {
    15741588
     
    17981812
    17991813            case CMD_INS_CLEANUP:
     1814            {
    18001815                p_vci_ini_rw.cmdval = false;
    18011816                p_vci_ini_rw.address = 0;
     
    18141829                p_vci_ini_rw.eop    = false;
    18151830
     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
    18161837                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;
    18341861
    18351862            case CMD_DATA_CLEANUP:
     1863            {
    18361864                p_vci_ini_rw.cmdval = false;
    18371865                p_vci_ini_rw.address = 0;
     
    18501878                p_vci_ini_rw.eop    = false;
    18511879
     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
    18521886                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                    }
    18681909                break;
    18691910
Note: See TracChangeset for help on using the changeset viewer.