Ignore:
Timestamp:
Jun 28, 2013, 6:16:48 PM (11 years ago)
Author:
lambert
Message:

In Vci_cc_vcache_wrapper :

  • Adding monitor to help debugging. behaviour is similar to the mem_cache monitor.
  • Fixing initialisation problems in several variables to compile with -Werror
  • Fixing parantheses problems to compile with -Werror
Location:
trunk/modules/vci_cc_vcache_wrapper/caba/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_cc_vcache_wrapper/caba/source/include/vci_cc_vcache_wrapper.h

    r421 r423  
    677677
    678678    uint32_t m_cpt_stop_simulation;             // used to stop simulation if frozen
     679    bool     m_monitor_ok;              // used to stop simulation if frozen
     680    uint32_t m_monitor_base;            // used to stop simulation if frozen
     681    uint32_t m_monitor_length;          // used to stop simulation if frozen
    679682
    680683protected:
     
    713716    void print_trace(size_t mode = 0);
    714717    void cache_monitor(paddr_t addr);
     718    void start_monitor(paddr_t,paddr_t);
     719    void stop_monitor();
    715720    inline void iss_set_debug_mask(uint v)
    716721    {
  • trunk/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp

    r421 r423  
    128128        "CMD_DATA_SC",
    129129        "CMD_DATA_CAS",
     130    };
     131
     132const char *vci_pktid_type_str[] = {
     133        "TYPE_READ_DATA_UNC",
     134        "TYPE_READ_DATA_MISS",           
     135        "TYPE_READ_INS_UNC",         
     136        "TYPE_READ_INS_MISS",
     137        "TYPE_WRITE",
     138        "TYPE_CAS",
     139        "TYPE_LL",
     140        "TYPE_SC",
     141    };
     142
     143const char *vci_cmd_type_str[] = {
     144        "NOP or STORE_COND",
     145        "READ",
     146        "WRITE",
     147        "LOCKED_READ"
    130148    };
    131149
     
    888906        // init the llsc reservation buffer
    889907        r_dcache_llsc_valid = false;
     908        m_monitor_ok = false;
    890909
    891910        return;
     
    18041823        else                                                                                        // no match
    18051824        {
    1806             int         state;
    1807             size_t          way;
    1808             size_t          set;
    1809             size_t          word;
     1825            int         state = 0;
     1826            size_t          way = 0;
     1827            size_t          set = 0;
     1828            size_t          word = 0;
    18101829
    18111830#ifdef INSTRUMENTATION
     
    38853904        if ( not r_dcache_cc_send_req.read() ) // blocked until previous cc_send request is sent
    38863905        {
    3887             bool     found;
    3888             bool     cleanup;
    3889             size_t   way;
    3890             size_t   set;
    3891             paddr_t  victim;
     3906            bool     found = false;
     3907            bool     cleanup = false;
     3908            size_t   way = 0;
     3909            size_t   set = 0;
     3910            paddr_t  victim = 0;
    38923911
    38933912#ifdef INSTRUMENTATION
     
    44814500        else                                                    // no match
    44824501            {
    4483             int        state;
    4484             size_t         way;
    4485             size_t         set;
    4486             size_t         word;
     4502            int        state = 0;
     4503            size_t         way = 0;
     4504            size_t         set = 0;
     4505            size_t         word = 0;
    44874506
    44884507#ifdef INSTRUMENTATION
     
    49204939    ////////////////////////////////////////////////////////////////////////////////////
    49214940
     4941
    49224942    switch ( r_vci_cmd_fsm.read() )
    49234943    {
     
    50595079        {
    50605080            // all read VCI commands contain one single flit
    5061             if ( p_vci.cmdack.read() )  r_vci_cmd_fsm = CMD_IDLE;
     5081            if ( p_vci.cmdack.read() ) {
     5082                r_vci_cmd_fsm = CMD_IDLE;
     5083            }
    50625084            break;
    50635085        }
     
    57205742    p_vci.cfixed = false;
    57215743
     5744    if ( m_monitor_ok ) {
     5745        if ( p_vci.cmdack.read() == true and p_vci.cmdval == true) {
     5746            if (((p_vci.address.read()) >= m_monitor_base) and
     5747                ((p_vci.address.read()) < m_monitor_base + m_monitor_length) ) {
     5748                std::cout << "CC_VCACHE Monitor " << name() << std::hex
     5749                          << " Access type = " << vci_cmd_type_str[p_vci.cmd.read()]
     5750                          << " Pktid type = " << vci_pktid_type_str[p_vci.pktid.read()]
     5751                          << " : address = " << p_vci.address.read()
     5752                          << " / be = " << p_vci.be.read();
     5753                if ( p_vci.cmd.read() == vci_param::CMD_WRITE ) {
     5754                    std::cout << " / data = " << p_vci.wdata.read();
     5755                }
     5756                std::cout << std::dec << std::endl;
     5757            }
     5758        }
     5759    }
     5760
    57225761    switch ( r_vci_cmd_fsm.read() ) {
    57235762
     
    60646103                r_cc_receive_updt_fifo_be.empty())
    60656104                or
    6066                 ((r_cc_receive_data_ins.read() == 1) and
     6105                (((r_cc_receive_data_ins.read() == 1) and
    60676106                not r_cc_receive_icache_req.read()) and
    6068                 r_cc_receive_updt_fifo_be.empty())
     6107                r_cc_receive_updt_fifo_be.empty()))
    60696108                p_dspin_in.read = true;
    60706109            else
     
    61006139} // end genMoore
    61016140
     6141tmpl(void)::start_monitor(paddr_t base, paddr_t length)
     6142// This version of monitor print both Read and Write request
     6143{
     6144    m_monitor_ok        = true;
     6145    m_monitor_base      = base;
     6146    m_monitor_length    = length;
     6147}
     6148
     6149tmpl(void)::stop_monitor()
     6150{
     6151    m_monitor_ok        = false;
     6152}
     6153
    61026154}}
    61036155
Note: See TracChangeset for help on using the changeset viewer.