Changeset 204


Ignore:
Timestamp:
Mar 8, 2012, 8:48:53 AM (12 years ago)
Author:
alain
Message:

bugs fix

Location:
trunk/modules/vci_cc_vcache_wrapper_v4/caba/source
Files:
2 edited

Legend:

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

    r203 r204  
    3535#include "generic_fifo.h"
    3636#include "generic_tlb.h"
     37#include "generic_cache.h"
    3738#include "generic_cam.h"
    38 #include "generic_cache.h"
    3939#include "vci_initiator.h"
    4040#include "vci_target.h"
     
    113113        DCACHE_XTN_DC_INVAL_VA,       
    114114        DCACHE_XTN_DC_INVAL_PA,     
    115         DCACHE_XTN_DC_INVAL_WAIT,
     115        DCACHE_XTN_DC_INVAL_END,
    116116        DCACHE_XTN_DC_INVAL_GO,         
    117117        DCACHE_XTN_DT_INVAL,         
     
    121121        DCACHE_WRITE_SC_WAIT,           
    122122        DCACHE_WRITE_UNC_WAIT,
    123         // handling processor miss requests
     123            // handling processor miss requests
    124124        DCACHE_MISS_VICTIM,
    125125        DCACHE_MISS_INVAL,
     
    133133        DCACHE_CC_INVAL,           
    134134        DCACHE_CC_UPDT,             
    135         DCACHE_CC_WAIT,             
     135        // handling TLB inval (after a coherence or XTN request)
     136        DCACHE_INVAL_TLB_SCAN,             
    136137    };
    137138
     
    173174        TGT_RSP_ICACHE,
    174175        TGT_RSP_DCACHE,
    175     };
    176 
    177     enum inval_itlb_fsm_state_e {
    178         INVAL_ITLB_IDLE,
    179         INVAL_ITLB_SCAN,
    180     };
    181 
    182     enum inval_dtlb_fsm_state_e {
    183         INVAL_DTLB_IDLE,
    184         INVAL_DTLB_SCAN,
    185176    };
    186177
     
    386377    sc_signal<size_t>       r_dcache_p1_tlb_set;            // selected set (from dtlb)
    387378    sc_signal<paddr_t>      r_dcache_p1_tlb_nline;          // nline value (from dtlb)
    388     // registers written in P2 stage (used in P3 stage)
     379    sc_signal<bool>         r_dcache_p1_tlb_big;        // big page bit (from dtlb)
     380    // registers written in P2 stage (used in long write)
    389381    sc_signal<uint32_t>     r_dcache_p2_vaddr;          // virtual address (from proc)
    390382    sc_signal<size_t>       r_dcache_p2_tlb_way;            // selected way in dtlb
     
    395387    sc_signal<size_t>       r_dcache_p2_pte_set;            // selected set in dcache
    396388    sc_signal<size_t>       r_dcache_p2_pte_word;           // selected word in dcache
    397     sc_signal<size_t>       r_dcache_p2_pte_flags;          // pte value read in dcache
     389    sc_signal<size_t>       r_dcache_p2_pte;            // pte value read in dcache
    398390   
    399391    // communication between DCACHE FSM and VCI_CMD FSM
     
    445437    sc_signal<paddr_t>      r_dcache_ll_vaddr;              // LL reserved address
    446438                           
    447     // communication between DCACHE FSM and INVAL_ITLB/INVAL_DTLB FSMs
    448     sc_signal<bool>         r_dcache_itlb_inval_req;    // inval request of one or several TLB entries
    449     sc_signal<bool>         r_dcache_dtlb_inval_req;    // inval request of one or several TLB entries;
     439    // ITLB and DTLB invalidation
     440    sc_signal<bool>         r_dcache_itlb_inval_req;    // inval request for itlb
     441    sc_signal<bool>         r_dcache_dtlb_inval_req;    // inval request for dtlb
    450442    sc_signal<paddr_t>      r_dcache_tlb_inval_line;    // line index
     443    sc_signal<size_t>       r_dcache_tlb_inval_count;   // tlb entry counter
    451444
    452445    // communication between DCACHE FSM and ICACHE FSM
     
    510503    uint32_t                *r_tgt_buf;                         // cache line word buffer
    511504    vci_be_t                *r_tgt_be;                          // cache line be buffer
    512 
    513     ///////////////////////////////////
    514     // INVAL_ITLB FSM REGISTERS
    515     ///////////////////////////////////
    516     sc_signal<int>          r_inval_itlb_fsm;               // state register
    517     sc_signal<size_t>       r_inval_itlb_count;             // counter to scan all itlb entries
    518 
    519     ///////////////////////////////////
    520     // INVAL_DTLB FSM REGISTERS
    521     ///////////////////////////////////
    522     sc_signal<int>          r_inval_dtlb_fsm;               //state register
    523     sc_signal<size_t>       r_inval_dtlb_count;             // counter to scan all dtlb entries
    524505
    525506    //////////////////////////////////////////////////////////////////
  • trunk/modules/vci_cc_vcache_wrapper_v4/caba/source/src/vci_cc_vcache_wrapper_v4.cpp

    r203 r204  
    3232#define DEBUG_ICACHE            1
    3333#define DEBUG_CLEANUP           0
    34 #define DEBUG_INVAL_ITLB        1
    35 #define DEBUG_INVAL_DTLB        1
    3634
    3735namespace soclib {
     
    8684        "DCACHE_XTN_DC_INVAL_VA",
    8785        "DCACHE_XTN_DC_INVAL_PA",
    88         "DCACHE_XTN_DC_INVAL_WAIT",
     86        "DCACHE_XTN_DC_INVAL_END",
    8987        "DCACHE_XTN_DC_INVAL_GO",
    9088        "DCACHE_XTN_DT_INVAL",
     
    106104        "DCACHE_CC_INVAL",
    107105        "DCACHE_CC_UPDT",
    108         "DCACHE_CC_WAIT",
     106
     107        "DCACHE_INVAL_TLB_SCAN",
    109108    };
    110109const char *cmd_fsm_state_str[] = {
     
    142141        "TGT_RSP_DCACHE",
    143142    }; 
    144 const char *inval_itlb_fsm_state_str[] = {
    145         "INVAL_ITLB_IDLE",       
    146         "INVAL_ITLB_SCAN",
    147     };
    148 const char *inval_dtlb_fsm_state_str[] = {
    149         "INVAL_DTLB_IDLE",       
    150         "INVAL_DTLB_SCAN",
    151     };
    152143}
    153144
     
    280271      r_dcache_p1_tlb_set("r_dcache_p1_tlb_set"),
    281272      r_dcache_p1_tlb_nline("r_dcache_p1_tlb_nline"),
     273      r_dcache_p1_tlb_big("r_dcache_p1_tlb_big"),
    282274
    283275      r_dcache_p2_vaddr("r_dcache_p2_vaddr"),
     
    289281      r_dcache_p2_pte_set("r_dcache_p2_pte_set"),
    290282      r_dcache_p2_pte_word("r_dcache_p2_pte_word"),
    291       r_dcache_p2_pte_flags("r_dcache_p2_pte_flags"),
     283      r_dcache_p2_pte("r_dcache_p2_pte"),
    292284
    293285      r_dcache_vci_paddr("r_dcache_vci_paddr"),
     
    333325      r_dcache_dtlb_inval_req("r_dcache_dtlb_inval_req"),
    334326      r_dcache_tlb_inval_line("r_dcache_tlb_inval_line"),
     327      r_dcache_tlb_inval_count("r_dcache_tlb_inval_count"),
    335328
    336329      r_dcache_xtn_req("r_dcache_xtn_req"),
     
    373366      r_tgt_dcache_rsp("r_tgt_dcache_rsp"),
    374367
    375       r_inval_itlb_fsm("r_inval_itlb_fsm"),         
    376       r_inval_itlb_count("r_inval_itlb_count"),         
    377 
    378       r_inval_dtlb_fsm("r_inval_dtlb_fsm"),         
    379       r_inval_dtlb_count("r_inval_dtlb_count"),         
    380 
    381368      r_iss(this->name(), proc_id),
    382369      r_wbuf("wbuf", wbuf_nwords, wbuf_nlines, dcache_words ),
     
    394381    assert( (icache_words == dcache_words) and
    395382             "icache_words and dcache_words parameters must be equal");
     383
     384    assert( (itlb_sets == dtlb_sets) and
     385             "itlb_sets and dtlb_sets parameters must be etqual");
     386
     387    assert( (itlb_ways == dtlb_ways) and
     388             "itlb_ways and dtlb_ways parameters must be etqual");
    396389
    397390    r_mmu_params = (uint32_log2(m_dtlb_ways)   << 29)   | (uint32_log2(m_dtlb_sets)   << 25) |
     
    489482              << " | " << cmd_fsm_state_str[r_vci_cmd_fsm.read()]
    490483              << " | " << rsp_fsm_state_str[r_vci_rsp_fsm.read()]
    491               << " | " << tgt_fsm_state_str[r_tgt_fsm.read()] << std::endl;
    492     std::cout << "  " << cleanup_fsm_state_str[r_cleanup_fsm.read()]
    493               << " | " << inval_itlb_fsm_state_str[r_inval_itlb_fsm]
    494               << " | " << inval_dtlb_fsm_state_str[r_inval_dtlb_fsm];
     484              << " | " << tgt_fsm_state_str[r_tgt_fsm.read()]
     485              << " | " << cleanup_fsm_state_str[r_cleanup_fsm.read()];
    495486    if (r_dcache_p0_valid.read() ) std::cout << " | P1_WRITE";
    496487    if (r_dcache_p1_valid.read() ) std::cout << " | P2_WRITE";
     
    702693        r_vci_rsp_fsm     = RSP_IDLE;
    703694        r_tgt_fsm         = TGT_IDLE;
    704         r_inval_itlb_fsm  = INVAL_ITLB_IDLE;         
    705         r_inval_dtlb_fsm  = INVAL_DTLB_IDLE;         
    706695        r_cleanup_fsm     = CLEANUP_DATA_IDLE;
    707696
     
    743732        r_dcache_ll_valid          = false;
    744733
    745         // No request from DCACHE FSM to INVAL TLB FSMs
     734        // No TLB inval requestis
    746735        r_dcache_itlb_inval_req    = false;
    747736        r_dcache_dtlb_inval_req    = false;
     
    770759        m_debug_icache_fsm        = false;
    771760        m_debug_cleanup_fsm       = false;
    772         m_debug_inval_itlb_fsm    = false;
    773         m_debug_inval_dtlb_fsm    = false;
    774761
    775762/*
     
    906893    m_debug_icache_fsm     = (m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok;
    907894    m_debug_dcache_fsm     = (m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok;
    908     m_debug_inval_itlb_fsm = (m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok;
    909     m_debug_inval_dtlb_fsm = (m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok;
    910895
    911896    /////////////////////////////////////////////////////////////////////
     
    19111896    m_irsp_instruction  = irsp.instruction;
    19121897    m_irsp_error        = irsp.error;
    1913 
    1914     ////////////////////////////////////////////////////////////////////////////////////
    1915     //      INVAL ITLB FSM
    1916     // This FSM works in parallel with the ICACHE FSM.
    1917     // When the r_dcache_itlb_inval_req flip-flop is activated by the DCACHE FSM
    1918     // it scans sequencially all entries in the ITLB, and invalidates the
    1919     // entries matching the evicted line.
    1920     // It signals the completion of invalidation by reseting r_dcache_itlb_inval_req.
    1921     ////////////////////////////////////////////////////////////////////////////////////
    1922 
    1923     switch(r_inval_itlb_fsm)
    1924     {
    1925     /////////////////////
    1926     case INVAL_ITLB_IDLE:
    1927     {
    1928         if ( r_dcache_itlb_inval_req.read() )
    1929         {
    1930             r_itlb.reset_bypass(r_dcache_tlb_inval_line.read());
    1931             r_inval_itlb_count = 0;
    1932             r_inval_itlb_fsm   = INVAL_ITLB_SCAN;   
    1933 
    1934 #if DEBUG_INVAL_ITLB
    1935 if ( m_debug_inval_itlb_fsm )
    1936 {
    1937     std::cout << "  <PROC.INVAL_ITLB_IDLE> Invalidate request for line "
    1938               << std::hex << r_dcache_tlb_inval_line.read() << std::endl;
    1939     r_itlb.print();
    1940 }
    1941 #endif
    1942         }   
    1943         break;
    1944     }
    1945     /////////////////////
    1946     case INVAL_ITLB_SCAN:
    1947     {
    1948         paddr_t line = r_dcache_tlb_inval_line.read();          // nline
    1949         size_t  way  = r_inval_itlb_count.read()/m_itlb_sets;   // way
    1950         size_t  set  = r_inval_itlb_count.read()%m_itlb_sets;   // set
    1951 
    1952         bool ok = r_itlb.inval( line,
    1953                                 way,
    1954                                 set );
    1955 
    1956 #if DEBUG_INVAL_ITLB
    1957 if ( m_debug_inval_itlb_fsm )
    1958 {
    1959     std::cout << "  <PROC.INVAL_ITLB_SCAN>" << std::hex
    1960               << " line = " << line << std::dec
    1961               << " / set = " << set
    1962               << " / way = " << way;
    1963     if ( ok ) std::cout << " / HIT" << std::endl;
    1964     else      std::cout << " / MISS" << std::endl;
    1965 }
    1966 #endif
    1967 
    1968         r_inval_itlb_count = r_inval_itlb_count.read() + 1;
    1969         if ( r_inval_itlb_count.read() == (m_itlb_sets*m_itlb_ways - 1) )
    1970         {
    1971             r_inval_itlb_fsm        = INVAL_ITLB_IDLE;
    1972             r_dcache_itlb_inval_req = false;
    1973         }
    1974         break;
    1975     }       
    1976     } // end switch r_inval_itlb_fsm
    19771898
    19781899    ////////////////////////////////////////////////////////////////////////////////////
     
    20671988        // Three actions are executed in this P2 stage:
    20681989        // - If r_dcache_p1_updt_cache is true, we update the local copy in dcache.
    2069         // - If the modified cache line has copies in itlb (resp. dtlb), and if the
    2070         //   INVAL_ITLB (resp. INVAL_DTLB) FSM is idle, we launch the TLB invalidate
    2071         //   operation. This operation is NOT blocking for the processor: the DCACHE FSM
    2072         //   doesn't wait the TLB invalidate completion to handle processor requests.
    2073         //   If the INVAL_ITLB (resp INVAL_DTLB) FSM is already processintg a previous
    2074         //   invalidation request, the DCACHE FSM is frosen until completion of the
    2075         //   previous  TLB invalidate operation.
     1990        // - If the modified cache line has copies in TLBs, we launch a TLB invalidate
     1991        //   operation, that is blocking for the processor, because we switch to
     1992        //   DCACHE_INVAL_TLB
    20761993        // - If the PTE dirty bit must be updated, we start a "long write", that is
    20771994        //   blocking for the processor, because we switch to the DCACHE_WRITE_SET_DIRTY
    2078         //   state, and the number of cycles can be large...
    20791995
    20801996        bool long_write_set_dirty = false;
    2081         bool tlb_inval_frozen     = false;
     1997        bool tlb_inval_required   = false;
    20821998
    20831999        if ( r_dcache_p1_valid.read() )         // P2 stage activated
    20842000        {
    20852001            bool     cache_updt = r_dcache_p1_updt_cache.read();
    2086             size_t   cache_way  = r_dcache_p1_cache_way.read();
    2087             size_t   cache_set  = r_dcache_p1_cache_set.read();
    2088             size_t   cache_word = r_dcache_p1_cache_word.read();
     2002            size_t   way        = r_dcache_p1_cache_way.read();
     2003            size_t   set        = r_dcache_p1_cache_set.read();
     2004            size_t   word      = r_dcache_p1_cache_word.read();
    20892005            uint32_t wdata      = r_dcache_p1_wdata.read();
    20902006            vci_be_t be         = r_dcache_p1_be.read();
    20912007
    2092             // The PTE address is used when the PTE dirty bit must be set.
    2093             // It is the concatenation of the nline value (from dtlb)
    2094             // and the word index (from virtual address)
    2095             paddr_t  pte_paddr = (paddr_t)(r_dcache_p1_tlb_nline.read()*(m_dcache_words<<2))
    2096                                  | (paddr_t)(r_dcache_p1_vaddr.read()%(m_dcache_words<<2));
    2097            
    2098             // The line index is used when a TLB inval is required
    2099             paddr_t  inval_line = r_dcache_p1_paddr.read()>>(uint32_log2(m_dcache_words<<2));
    2100 
    2101             // checking dcache update
     2008            // update dcache if required
    21022009            if ( cache_updt )   
    21032010            {
    2104                 r_dcache.write( cache_way,
    2105                                 cache_set,
    2106                                 cache_word,
     2011                r_dcache.write( way,
     2012                                set,
     2013                                word,
    21072014                                wdata,
    21082015                                be );
     
    21102017m_cpt_dcache_data_write++;
    21112018#endif
    2112 
    2113                 // Checking copies in TLBs
    2114                 bool itlb_inval = ( (r_mmu_mode.read() & INS_TLB_MASK) and
    2115                                     r_dcache_in_itlb[cache_way*m_dcache_sets+cache_set] );
    2116                 bool dtlb_inval = ( (r_mmu_mode.read() & DATA_TLB_MASK) and
    2117                                     r_dcache_in_dtlb[cache_way*m_dcache_sets+cache_set] );
    2118 
    2119                 if ( (dtlb_inval and r_dcache_dtlb_inval_req.read() ) or
    2120                      (itlb_inval and r_dcache_itlb_inval_req.read() ) ) // at least one FSM not idle
     2019                // cache update can require itlb & dtlb inval
     2020                bool    inval_itlb = false;
     2021                bool    inval_dtlb = false;
     2022   
     2023                if ( (r_mmu_mode.read() & DATA_TLB_MASK) and r_dcache_in_dtlb[way*m_dcache_sets+set] )
    21212024                {
    2122                     tlb_inval_frozen = true;
     2025                    r_dcache_in_dtlb[way*m_dcache_sets+set] = false;
     2026                    inval_dtlb = true;
    21232027                }
    2124                 else                                                    // requested FSM idle
     2028                if ( (r_mmu_mode.read() & INS_TLB_MASK) and r_dcache_in_itlb[m_dcache_sets*way+set] )
     2029                {       
     2030                    r_dcache_in_itlb[way*m_dcache_sets+set] = false;
     2031                    inval_itlb = true;
     2032                }
     2033                if ( inval_itlb or inval_dtlb )
    21252034                {
    2126                     r_dcache_tlb_inval_line = inval_line;
    2127                     r_dcache_itlb_inval_req = itlb_inval;
    2128                     r_dcache_dtlb_inval_req = dtlb_inval;
    2129                     r_dcache_in_itlb[cache_way*m_dcache_sets+cache_set] = false;
    2130                     r_dcache_in_dtlb[cache_way*m_dcache_sets+cache_set] = false;
     2035                    tlb_inval_required       = true;
     2036                    r_dcache_itlb_inval_req  = inval_itlb;
     2037                    r_dcache_dtlb_inval_req  = inval_dtlb;
     2038                    r_dcache_tlb_inval_count = 0;
     2039                    r_dcache_tlb_inval_line  = r_dcache_p1_paddr.read()>>(uint32_log2(m_dcache_words<<2));
    21312040                }
    21322041            } // end dcache update
    21332042
    2134             // checking dirty bit update
     2043            // checking if dirty bit update is required
    21352044            if ( r_dcache_p1_set_dirty.read() ) 
    21362045            {
    2137                 long_write_set_dirty = true;
     2046                long_write_set_dirty  = true;
    21382047                r_dcache_p2_vaddr     = r_dcache_p1_vaddr.read();
    21392048                r_dcache_p2_set_dirty = r_dcache_p1_set_dirty.read();
    21402049                r_dcache_p2_tlb_way   = r_dcache_p1_tlb_way.read();     
    21412050                r_dcache_p2_tlb_set   = r_dcache_p1_tlb_set.read();     
    2142                 r_dcache_p2_pte_paddr = pte_paddr;
     2051                // The PTE physical address is the concatenation of the nline value (from dtlb),
     2052                // with the word index (obtained from the proper bits of the virtual address)
     2053                if ( r_dcache_p1_tlb_big.read() )       // PTE1
     2054                {
     2055                    r_dcache_p2_pte_paddr = (paddr_t)(r_dcache_p1_tlb_nline.read()*(m_dcache_words<<2)) |
     2056                                            (paddr_t)((r_dcache_p1_vaddr.read()>>19) & 0x3c);
     2057                }
     2058                else                                    // PTE2
     2059                {
     2060                    r_dcache_p2_pte_paddr = (paddr_t)(r_dcache_p1_tlb_nline.read()*(m_dcache_words<<2)) |
     2061                                            (paddr_t)((r_dcache_p1_vaddr.read()>>10) & 0x3c);
     2062                }
    21432063            }
    21442064
     
    21482068    if ( cache_updt )
    21492069        std::cout << "  <PROC.DCACHE_IDLE> P2 stage: cache update" << std::dec
    2150                   << " / way = " << cache_way
    2151                   << " / set = " << cache_set
    2152                   << " / word = " << cache_word << std::hex
     2070                  << " / way = " << way
     2071                  << " / set = " << set
     2072                  << " / word = " << word << std::hex
    21532073                  << " / wdata = " << wdata
    21542074                  << " / be = " << be << std::endl;
    21552075    if ( long_write_set_dirty )
    21562076        std::cout << "  <PROC.DCACHE_IDLE> P2 stage: dirty bit update required"
    2157                   << " / pte_paddr = " << std::hex << pte_paddr << std::endl;
     2077                  << " / pte_paddr = " << std::hex << r_dcache_p2_pte_paddr.read() << std::endl;
    21582078}
    21592079#endif
     
    21722092        // if there is local copy in dcache, or if the PTE dirty bit must be set.
    21732093
    2174         if ( r_dcache_p0_valid.read() and not tlb_inval_frozen )  // P1 stage activated
     2094        if ( r_dcache_p0_valid.read() and not tlb_inval_required )  // P1 stage activated
    21752095        {
    21762096            // write not cacheable, and previous non cacheable write registered
     
    22342154                r_dcache_p1_tlb_set     = r_dcache_p0_tlb_set;
    22352155                r_dcache_p1_tlb_nline   = r_dcache_p0_tlb_nline;
     2156                r_dcache_p1_tlb_big     = r_dcache_p0_tlb_big;
    22362157                r_dcache_p1_cache_way   = cache_way;
    22372158                r_dcache_p1_cache_set   = cache_set;
     
    22492170
    22502171        /////////////////////////////////////////////////////////////////////////////
    2251         // handling P0 write pipe-line stage
     2172        // handling P0 pipe-line stage
    22522173        // This stage is controlling the DCACHE FSM state register:
    2253         // - the FSM is frozen if a TLB invalidate operation must be delayed,
    2254         // - the long write requests have the highest priority,
     2174        // - the TLB invalidate requests have the highest priority,
     2175        // - then the long write requests,
    22552176        // - then the external coherence requests,
    22562177        // - then the itlb miss requests,
     
    22632184        bool p0_valid = false;  // default value
    22642185
    2265         // TLB inval delayed
    2266         if ( tlb_inval_frozen )
    2267         {
    2268             break;
     2186        // TLB inval required
     2187        if ( tlb_inval_required )
     2188        {
     2189            r_dcache_fsm_save = DCACHE_IDLE;
     2190            r_dcache_fsm      = DCACHE_INVAL_TLB_SCAN;
    22692191        }
    22702192
     
    22782200        else if ( r_tgt_dcache_req.read() )   
    22792201        {
    2280             r_dcache_fsm = DCACHE_CC_CHECK;
    22812202            r_dcache_fsm_save = DCACHE_IDLE;
     2203            r_dcache_fsm      = DCACHE_CC_CHECK;
    22822204        }       
    22832205
     
    27472669    }
    27482670    /////////////////////
    2749     case DCACHE_TLB_MISS: // This is the entry point for the sub-fsm handling tlb miss.
     2671    case DCACHE_TLB_MISS: // This is the entry point for the sub-fsm handling all tlb miss.
    27502672                          // - Input arguments are r_dcache_tlb_vaddr & r_dcache_tlb_ins
    2751                           // - It try to find the missing TLB entry in dcache,
     2673                          // - The sub-fsm access the dcache to find the missing TLB entry,
    27522674                          //   and activates the cache miss procedure in case of miss.
    27532675                          // - It bypass the first level page table access if possible.
     
    27782700            r_dcache_fsm       = DCACHE_TLB_PTE1_GET;
    27792701        }
    2780         else                  // Try to read directly the PTE2 in dcache
     2702        else                  // Try to read the PTE2 in dcache
    27812703        {
    27822704            paddr = (paddr_t)ptba << PAGE_K_NBITS |
     
    28182740m_cpt_dcache_dir_read++;
    28192741#endif
    2820         if ( hit )      // request hit in dcache
     2742        if ( hit )      // hit in dcache
    28212743        {
    28222744            if ( not (entry & PTE_V_MASK) )     // unmapped
     
    28412763if ( m_debug_dcache_fsm )
    28422764{
    2843     std::cout << "  <PROC.DCACHE_TLB_PTE1_GET> HIT in dcache, but unmapped:"
    2844               << std::dec << " way = " << way
     2765    std::cout << "  <PROC.DCACHE_TLB_PTE1_GET> HIT in dcache, but unmapped"
     2766              << std::hex << " / paddr = " << r_dcache_tlb_paddr.read()
     2767              << std::dec << " / way = " << way
    28452768              << std::dec << " / set = " << set
    28462769              << std::dec << " / word = " << word
     
    28722795if ( m_debug_dcache_fsm )
    28732796{
    2874     std::cout << "  <PROC.DCACHE_TLB_PTE1_GET> HIT in dcache "
    2875               << std::dec << " way = " << way
     2797    std::cout << "  <PROC.DCACHE_TLB_PTE1_GET> HIT in dcache"
     2798              << std::hex << " / paddr = " << r_dcache_tlb_paddr.read()
     2799              << std::dec << " / way = " << way
    28762800              << std::dec << " / set = " << set
    28772801              << std::dec << " / word = " << word
     
    28822806            else                        //  PTE1 :  update the TLB
    28832807            {
    2884                 if ( r_dcache_tlb_ins.read() )
    2885                     r_dcache_in_itlb[m_icache_sets*way+set] = true;
    2886                 else                           
    2887                     r_dcache_in_dtlb[m_dcache_sets*way+set] = true;
     2808                if ( r_dcache_tlb_ins.read() ) r_dcache_in_itlb[m_icache_sets*way+set] = true;
     2809                else                           r_dcache_in_dtlb[m_dcache_sets*way+set] = true;
    28882810                r_dcache_tlb_pte_flags  = entry;
    28892811                r_dcache_tlb_cache_way  = way;
     
    28952817if ( m_debug_dcache_fsm )
    28962818{
    2897     std::cout << "  <PROC.DCACHE_TLB_PTE1_GET> HIT in dcache:"
    2898               << std::dec << " way = " << way
     2819    std::cout << "  <PROC.DCACHE_TLB_PTE1_GET> HIT in dcache"
     2820              << std::hex << " / paddr = " << r_dcache_tlb_paddr.read()
     2821              << std::dec << " / way = " << way
    28992822              << std::dec << " / set = " << set
    29002823              << std::dec << " / word = " << word
     
    32633186                                        // request a SC transaction to CMD FSM
    32643187    {
     3188#if DEBUG_DCACHE
     3189if ( m_debug_dcache_fsm )
     3190{
     3191    std::cout << "  <PROC.DCACHE_TLB_SC_UPDT> Update dcache: (L/R) bit" << std::endl;
     3192}
     3193#endif
    32653194        r_dcache.write(r_dcache_tlb_cache_way.read(),
    32663195                       r_dcache_tlb_cache_set.read(),
     
    32763205    }
    32773206    ////////////////////////
    3278     case DCACHE_TLB_SC_WAIT:                // wait response to SC transaction from RSP FSM
    3279                                         // we consume the response, and exit the sub-fsm.
    3280                                         // we don't analyse the response, because
    3281                                         // we don't care if the L/R bit update is not done
    3282                                         // we must take the coherence requests because
     3207    case DCACHE_TLB_SC_WAIT:            // Waiting a response to SC transaction.
     3208                                        // We consume the response in rsp FIFO,
     3209                                        // and exit the sub-fsm, but we don't
     3210                                        // analyse the response, because we don't
     3211                                        // care if the L/R bit update is not done.
     3212                                        // We must take the coherence requests because
    32833213                                        // there is a risk of dead-lock
    32843214
     
    32923222        }
    32933223
    3294         if ( not r_dcache_vci_sc_req.read() )   // response available
    3295         {
    3296             if ( r_vci_rsp_data_error.read() )          r_vci_rsp_data_error = false;
    3297             else if ( r_vci_rsp_fifo_dcache.rok() )     vci_rsp_fifo_dcache_get = true;
    3298             else
    3299             {
    3300                 assert( false and "rsp_fifo should not be empty in DCACHE_TLB_SC_WAIT state" );
    3301             }
    3302             r_dcache_fsm     = DCACHE_TLB_RETURN;
     3224        if ( r_vci_rsp_data_error.read() )      // bus error
     3225        {
     3226            std::cout << "BUS ERROR in DCACHE_TLB_SC_WAIT state" << std::endl;
     3227            std::cout << "This should not happen in this state" << std::endl;
     3228            exit(0);
     3229        }
     3230        else if ( r_vci_rsp_fifo_dcache.rok() ) // response available
     3231        {
     3232#if DEBUG_DCACHE
     3233if ( m_debug_dcache_fsm )
     3234{
     3235    std::cout << "  <PROC.DCACHE_TLB_SC_WAIT> SC response received" << std::endl;
     3236}
     3237#endif
     3238            vci_rsp_fifo_dcache_get = true;     
     3239            r_dcache_fsm            = DCACHE_TLB_RETURN;
    33033240        }
    33043241        break;
    33053242    }
    33063243    ///////////////////////
    3307     case DCACHE_TLB_RETURN:             // return to caller state depending on the tlb miss type
    3308     {
     3244    case DCACHE_TLB_RETURN:             // return to caller depending on tlb miss type
     3245    {
     3246#if DEBUG_DCACHE
     3247if ( m_debug_dcache_fsm )
     3248{
     3249    std::cout << "  <PROC.DCACHE_TLB_RETURN> TLB MISS completed" << std::endl;
     3250}
     3251#endif
    33093252        if ( r_dcache_tlb_ins.read() ) r_icache_tlb_miss_req = false;
    33103253        r_dcache_fsm = DCACHE_IDLE;
     
    34933436    case DCACHE_XTN_DC_INVAL_GO:  // In this state, we invalidate the cache line & cleanup
    34943437                                  // Blocked if previous cleanup not completed
    3495              
     3438                                  // Test if itlb or dtlb inval is required   
    34963439    {
    34973440        if ( not r_dcache_cleanup_req.read() )
    34983441        {
    34993442            paddr_t     nline;
    3500             size_t      way       = r_dcache_xtn_way.read();
    3501             size_t      set       = r_dcache_xtn_set.read();
    3502             bool        inval_tlb = false;
     3443            size_t      way        = r_dcache_xtn_way.read();
     3444            size_t      set        = r_dcache_xtn_set.read();
     3445            bool        inval_itlb = false;
     3446            bool        inval_dtlb = false;
    35033447   
    35043448            r_icache.inval( way,
     
    35113455           
    35123456            // possible itlb & dtlb invalidate requests
    3513             r_dcache_tlb_inval_line = nline;
    3514 
    3515             if ( (r_mmu_mode.read() & DATA_TLB_MASK) and
    3516                  r_dcache_in_dtlb[way*m_dcache_sets+set] )
    3517             {
    3518                 r_dcache_dtlb_inval_req = true;
     3457
     3458            if ( (r_mmu_mode.read() & DATA_TLB_MASK) and r_dcache_in_dtlb[way*m_dcache_sets+set] )
     3459            {
    35193460                r_dcache_in_dtlb[way*m_dcache_sets+set] = false;
    3520                 inval_tlb = true;
    3521             }
    3522             if ( (r_mmu_mode.read() & INS_TLB_MASK) and
    3523                  r_dcache_in_itlb[m_dcache_sets*way+set] )
     3461                inval_dtlb = true;
     3462            }
     3463            if ( (r_mmu_mode.read() & INS_TLB_MASK) and r_dcache_in_itlb[m_dcache_sets*way+set] )
    35243464            {   
    3525                 r_dcache_itlb_inval_req = true;
    35263465                r_dcache_in_itlb[way*m_dcache_sets+set] = false;
    3527                 inval_tlb = true;
     3466                inval_itlb = true;
    35283467            }
    35293468
    35303469            // no valid response until itlb & dtlb invalidated
    3531             if (inval_tlb )
    3532             {
    3533                 r_dcache_fsm = DCACHE_XTN_DC_INVAL_WAIT;
     3470            if ( inval_itlb or inval_dtlb )
     3471            {
     3472                r_dcache_itlb_inval_req  = inval_itlb;
     3473                r_dcache_dtlb_inval_req  = inval_dtlb;
     3474                r_dcache_tlb_inval_line  = nline;
     3475                r_dcache_tlb_inval_count = 0;
     3476                r_dcache_fsm_save        = DCACHE_XTN_DC_INVAL_END;
     3477                r_dcache_fsm             = DCACHE_INVAL_TLB_SCAN;
    35343478            }
    35353479            else
     
    35423486    }
    35433487    //////////////////////////////
    3544     case DCACHE_XTN_DC_INVAL_WAIT:      // waiting completion of itlb and dtlb invalidate
    3545     {
    3546         if ( not (r_dcache_itlb_inval_req.read() or r_dcache_dtlb_inval_req.read()) )
    3547         {
    3548             r_dcache_fsm = DCACHE_IDLE;
    3549             drsp.valid = true;
    3550         }
     3488    case DCACHE_XTN_DC_INVAL_END:       // waiting completion of itlb and dtlb invalidate
     3489    {
     3490        r_dcache_fsm = DCACHE_IDLE;
     3491        drsp.valid = true;
    35513492        break;
    35523493    }
     
    38363777    ////////////////////////////
    38373778    case DCACHE_WRITE_TLB_DIRTY:        // set PTE dirty bit in dtlb
     3779                                        // and get PTE in dcache
    38383780    {
    38393781        // set dirty bit in dtlb
     
    38423784
    38433785        // get PTE in dcache
    3844         uint32_t pte_flags = 0;
     3786        uint32_t pte = 0;
    38453787        size_t   way;
    38463788        size_t   set;
    38473789        size_t   word;
    38483790        bool     hit = r_dcache.read( r_dcache_p2_pte_paddr.read(),
    3849                                       &pte_flags,
     3791                                      &pte,
    38503792                                      &way,
    38513793                                      &set,
     
    38593801if ( m_debug_dcache_fsm )
    38603802{
    3861     std::cout << "  <PROC.DCACHE_WRITE_TLB_DIRTY> Set PTE dirty bit in dtlb:"
    3862               << " paddr = " << r_dcache_p2_pte_paddr.read()
     3803    std::cout << "  <PROC.DCACHE_WRITE_TLB_DIRTY> Set dirty bit in dtlb:" << std::dec
    38633804              << " / tlb_way = " << r_dcache_p2_tlb_way.read()
    38643805              << " / tlb_set = " << r_dcache_p2_tlb_set.read() << std::endl;
     3806    r_dtlb.print();
     3807    std::cout << "                                Get PTE in dcache:" << std::hex
     3808              << " paddr = " << r_dcache_p2_pte_paddr.read()
     3809              << " / PTE = " << pte << std::dec
     3810              << " / dcache_way = " << way
     3811              << " / dcache_set = " << set << std::endl;
    38653812}
    38663813#endif
     
    38703817        r_dcache_p2_pte_set   = set;                    // register pte set in dcache;
    38713818        r_dcache_p2_pte_word  = word;                   // register pte word in dcache;
    3872         r_dcache_p2_pte_flags = pte_flags;              // register pte value
     3819        r_dcache_p2_pte       = pte;                    // register pte value
    38733820        r_dcache_fsm          = DCACHE_WRITE_CACHE_DIRTY;
    38743821        break;
     
    38823829                        r_dcache_p2_pte_set.read(),
    38833830                        r_dcache_p2_pte_word.read(),
    3884                         r_dcache_p2_pte_flags.read() | PTE_D_MASK,
     3831                        r_dcache_p2_pte.read() | PTE_D_MASK,
    38853832                        0xF );
    38863833
     
    38923839if ( m_debug_dcache_fsm )
    38933840{
    3894     std::cout << "  <PROC.DCACHE_WRITE_CACHE_DIRTY> Set PTE dirty bit in dcache:"
     3841    std::cout << "  <PROC.DCACHE_WRITE_CACHE_DIRTY> Set PTE dirty bit in dcache"
    38953842              << " / way = " << r_dcache_p2_pte_way.read()
    38963843              << " / set = " << r_dcache_p2_pte_set.read()
    38973844              << " / word = " << r_dcache_p2_pte_word.read() << std::endl;
     3845    std::cout << "                                  Request SC transaction"
     3846              << " / address = " << "bloup"
     3847              << " / old = " << r_dcache_p2_pte.read()
     3848              << " / new = " << (r_dcache_p2_pte.read() | PTE_D_MASK) << std::endl;
    38983849}
    38993850#endif
    39003851        // request sc transaction to CMD_FSM
    39013852        r_dcache_vci_sc_req = true;
    3902         r_dcache_vci_sc_old = r_dcache_p2_pte_flags.read();
    3903         r_dcache_vci_sc_new = r_dcache_p2_pte_flags.read() | PTE_D_MASK;
     3853        r_dcache_vci_sc_old = r_dcache_p2_pte.read();
     3854        r_dcache_vci_sc_new = r_dcache_p2_pte.read() | PTE_D_MASK;
    39043855        r_dcache_fsm        = DCACHE_WRITE_SC_WAIT;   
    39053856        break;
     
    40654016    {
    40664017        paddr_t nline;
    4067         size_t  way       = r_dcache_cc_way.read();
    4068         size_t  set       = r_dcache_cc_set.read();
    4069         bool    inval_tlb = false;
     4018        size_t  way        = r_dcache_cc_way.read();
     4019        size_t  set        = r_dcache_cc_set.read();
     4020        bool    inval_itlb = false;
     4021        bool    inval_dtlb = false;
    40704022
    40714023        r_dcache.inval( way,
     
    40744026           
    40754027        // possible itlb & dtlb invalidate requests
    4076         r_dcache_tlb_inval_line = nline;
    4077 
    4078         if ( (r_mmu_mode.read() & DATA_TLB_MASK) and
    4079              r_dcache_in_dtlb[way*m_dcache_sets+set] )
    4080         {
    4081             r_dcache_dtlb_inval_req = true;
     4028
     4029        if ( (r_mmu_mode.read() & DATA_TLB_MASK) and r_dcache_in_dtlb[way*m_dcache_sets+set] )
     4030        {
     4031            r_dtlb.reset_bypass(nline);
    40824032            r_dcache_in_dtlb[way*m_dcache_sets+set] = false;
    4083             inval_tlb = true;
    4084         }
    4085         if ( (r_mmu_mode.read() & INS_TLB_MASK) and
    4086             r_dcache_in_itlb[m_dcache_sets*way+set] )
     4033            inval_dtlb = true;
     4034        }
     4035        if ( (r_mmu_mode.read() & INS_TLB_MASK) and r_dcache_in_itlb[m_dcache_sets*way+set] )
    40874036        {       
    4088             r_dcache_itlb_inval_req = true;
     4037            r_itlb.reset_bypass(nline);
    40894038            r_dcache_in_itlb[way*m_dcache_sets+set] = false;
    4090             inval_tlb = true;
    4091         }
    4092 
    4093         // no valid response until itlb & dtlb invalidated
    4094         if (inval_tlb )
    4095         {
    4096             r_dcache_fsm = DCACHE_CC_WAIT;
     4039            inval_itlb = true;
     4040        }
     4041
     4042        if ( inval_itlb or inval_dtlb ) // no valid response until itlb / dtlb invalidated
     4043        {
     4044            r_dcache_itlb_inval_req  = inval_itlb;
     4045            r_dcache_dtlb_inval_req  = inval_dtlb;
     4046            r_dcache_tlb_inval_line  = nline;
     4047            r_dcache_tlb_inval_count = 0;
     4048            r_dcache_fsm             = DCACHE_INVAL_TLB_SCAN;
    40974049        }
    40984050        else
     
    41084060    std::cout << "  <PROC.DCACHE_CC_INVAL> Invalidate cache line :" << std::dec
    41094061              << " way = " << way
    4110               << " / set = " << set << std::endl;
     4062              << " / set = " << set;
     4063    if ( inval_itlb ) std::cout << " / itlb inval required";
     4064    if ( inval_dtlb ) std::cout << " / dtlb inval required";
     4065    std::cout << std::endl;
    41114066}
    41124067#endif
     
    41184073                                // and test possible copies in TLBs
    41194074    {
    4120         size_t  word  = r_dcache_cc_word.read();
    4121         size_t  way   = r_dcache_cc_way.read();
    4122         size_t  set   = r_dcache_cc_set.read();
     4075        size_t   word       = r_dcache_cc_word.read();
     4076        size_t   way        = r_dcache_cc_way.read();
     4077        size_t   set        = r_dcache_cc_set.read();
     4078        bool     inval_itlb = false;
     4079        bool     inval_dtlb = false;
     4080        paddr_t  nline      = r_tgt_paddr.read() >> (uint32_log2(m_dcache_words)+2);
    41234081
    41244082        r_dcache.write( way,
     
    41344092        if ( word == r_tgt_word_max.read() )    // last word
    41354093        {
    4136             // invalidate copies in TLBs
    4137             if ( (r_mmu_mode.read() & DATA_TLB_MASK) and
    4138                  ( r_dcache_in_itlb[way*m_dcache_sets+set] or
    4139                    r_dcache_in_dtlb[m_dcache_sets*way+set] ) )
    4140             {
    4141                 r_dcache_tlb_inval_line = r_tgt_paddr.read() >> (uint32_log2(m_dcache_words)+2);
    4142                 r_dcache_itlb_inval_req = r_dcache_in_itlb[m_dcache_sets*way+set];
     4094            // possible itlb & dtlb invalidate requests
     4095
     4096            if ( (r_mmu_mode.read() & DATA_TLB_MASK) and r_dcache_in_dtlb[way*m_dcache_sets+set] )
     4097            {
     4098                r_dtlb.reset_bypass(nline);
     4099                r_dcache_in_dtlb[way*m_dcache_sets+set] = false;
     4100                inval_dtlb = true;
     4101            }
     4102            if ( (r_mmu_mode.read() & INS_TLB_MASK) and r_dcache_in_itlb[way*m_dcache_sets+set] )
     4103            {
     4104                r_itlb.reset_bypass(nline);
    41434105                r_dcache_in_itlb[way*m_dcache_sets+set] = false;
    4144                 r_dcache_dtlb_inval_req = r_dcache_in_dtlb[m_dcache_sets*way+set];
    4145                 r_dcache_in_dtlb[way*m_dcache_sets+set] = false;
    4146                 r_dcache_fsm     = DCACHE_CC_WAIT;
     4106                inval_itlb = true;
     4107            }
     4108
     4109            if ( inval_itlb or inval_dtlb ) // no valid response until itlb / dtlb invalidated
     4110            {
     4111                r_dcache_itlb_inval_req  = inval_itlb;
     4112                r_dcache_dtlb_inval_req  = inval_dtlb;
     4113                r_dcache_tlb_inval_line  = nline;
     4114                r_dcache_tlb_inval_count = 0;
     4115                r_dcache_fsm             = DCACHE_INVAL_TLB_SCAN;
    41474116            }
    41484117            else
     
    41614130              << " / set = " << set
    41624131              << " / word = " << word
    4163               << " / value = " << std::hex << r_tgt_buf[word] << std::endl;
     4132              << " / value = " << std::hex << r_tgt_buf[word];
     4133    if ( inval_itlb ) std::cout << " / itlb inval required";
     4134    if ( inval_dtlb ) std::cout << " / dtlb inval required";
     4135    std::cout << std::endl;
    41644136}
    41654137#endif
     
    41674139        break;
    41684140    }
    4169     ////////////////////
    4170     case DCACHE_CC_WAIT:        // wait completion of TLB invalidate
    4171     {
    4172         if ( not r_dcache_itlb_inval_req.read() and not r_dcache_dtlb_inval_req.read() )
    4173         {
    4174             r_tgt_dcache_rsp = true;
    4175             r_tgt_dcache_req = false;
    4176             r_dcache_fsm     = r_dcache_fsm_save.read();
    4177         }
     4141    ///////////////////////////
     4142    case DCACHE_INVAL_TLB_SCAN:         // scan sequencially all TLB entries for both ITLB & DTLB
     4143                                        // It makes the assumption that (m_itlb_sets == m_dtlb_sets)
     4144                                        // and (m_itlb_ways == m_dtlb_ways)
     4145                                        // Caution : we enter this state when a DCACHE line is modified,
     4146                                        // and there is a copy in itlb or dtlb.
     4147                                        // It can be caused by a coherence transaction, a XTN inval
     4148                                        // or a WRITE hit.  Input arguments are:
     4149                                        // - r_dcache_tlb_inval_line
     4150                                        // - r_dcache_tlb_inval_count
     4151                                        // - r_dcache_itlb_inval_req
     4152                                        // - r_dcache_dtlb_inval_req
     4153                                        // - r_dcache_fsm_save
     4154    {
     4155        paddr_t line = r_dcache_tlb_inval_line.read();                  // nline
     4156        size_t  way  = r_dcache_tlb_inval_count.read()/m_itlb_sets;     // way
     4157        size_t  set  = r_dcache_tlb_inval_count.read()%m_itlb_sets;     // set
     4158
     4159        if ( r_dcache_itlb_inval_req.read() )
     4160        {
     4161            bool ok = r_itlb.inval( line,
     4162                                    way,
     4163                                    set );
     4164#if DEBUG_DCACHE
     4165if ( m_debug_dcache_fsm and ok )
     4166{
     4167    std::cout << "  <PROC.DCACHE_INVAL_TLB_SCAN> Invalidate ITLB entry:" << std::hex
     4168              << " line = " << line << std::dec
     4169              << " / set = " << set
     4170              << " / way = " << way << std::endl;
     4171    r_itlb.print();
     4172}
     4173#endif
     4174        }
     4175
     4176        if ( r_dcache_dtlb_inval_req.read() )
     4177        {
     4178            bool ok = r_dtlb.inval( line,
     4179                                    way,
     4180                                    set );
     4181#if DEBUG_DCACHE
     4182if ( m_debug_dcache_fsm and ok )
     4183{
     4184    std::cout << "  <PROC.DCACHE_INVAL_TLB_SCAN> Invalidate DTLB entry:" << std::hex
     4185              << " line = " << line << std::dec
     4186              << " / set = " << set
     4187              << " / way = " << way << std::endl;
     4188    r_dtlb.print();
     4189}
     4190#endif
     4191        }
     4192
     4193        // return to the calling state when TLB inval completed
     4194        if ( r_dcache_tlb_inval_count.read() == (m_dtlb_sets*m_dtlb_ways-1) )
     4195        {
     4196            if ( r_dcache_fsm_save.read() != DCACHE_XTN_DC_INVAL_END ) // not an XTN inval
     4197            {
     4198                r_tgt_dcache_rsp    = true;
     4199                r_tgt_dcache_req    = false;
     4200            }
     4201            r_dcache_dtlb_inval_req = false;
     4202            r_dcache_itlb_inval_req = false;
     4203            r_dcache_fsm            = r_dcache_fsm_save.read();
     4204        }
     4205        r_dcache_tlb_inval_count = r_dcache_tlb_inval_count.read() + 1;
    41784206    }   
    41794207    } // end switch r_dcache_fsm
     
    41944222    ///////////////// wbuf update //////////////////////////////////////////////////////
    41954223    r_wbuf.update();
    4196 
    4197     ////////////////////////////////////////////////////////////////////////////////////
    4198     //      INVAL DTLB FSM
    4199     // This FSM works in parallel with the DCACHE FSM.
    4200     // When the r_dcache_dtlb_inval_req flip-flop is activated by the DCACHE FSM
    4201     // it scans sequencially all entries in the DTLB, and invalidates the
    4202     // entries matching the evicted line.
    4203     // It signals the completion of invalidation by reseting r_dcache_itlb_inval_req.
    4204     ////////////////////////////////////////////////////////////////////////////////////
    4205 
    4206     switch(r_inval_dtlb_fsm)
    4207     {
    4208     /////////////////////
    4209     case INVAL_DTLB_IDLE:
    4210     {
    4211         if ( r_dcache_dtlb_inval_req.read() )
    4212         {
    4213             r_dtlb.reset_bypass(r_dcache_tlb_inval_line.read());
    4214             r_inval_dtlb_count = 0;
    4215             r_inval_dtlb_fsm   = INVAL_DTLB_SCAN;   
    4216 
    4217 #if DEBUG_INVAL_DTLB
    4218 if ( m_debug_inval_dtlb_fsm )
    4219 {
    4220     std::cout << "  <PROC.INVAL_DTLB_IDLE> Invalidate request for line "
    4221               << std::hex << r_dcache_tlb_inval_line.read() << std::endl;
    4222     r_dtlb.print();
    4223 }
    4224 #endif
    4225         }   
    4226         break;
    4227     }
    4228     /////////////////////
    4229     case INVAL_DTLB_SCAN:
    4230     {
    4231         paddr_t line = r_dcache_tlb_inval_line.read();          // nline
    4232         size_t  way  = r_inval_dtlb_count.read()/m_itlb_sets;   // way
    4233         size_t  set  = r_inval_dtlb_count.read()%m_itlb_sets;   // set
    4234 
    4235         bool ok = r_dtlb.inval( line,
    4236                                 way,
    4237                                 set );
    4238 
    4239 #if DEBUG_INVAL_DTLB
    4240 if ( m_debug_inval_dtlb_fsm )
    4241 {
    4242     std::cout << "  <PROC.INVAL_DTLB_SCAN>" << std::hex
    4243               << " line = " << line << std::dec
    4244               << " / set = " << set
    4245               << " / way = " << way;
    4246     if ( ok ) std::cout << " / HIT" << std::endl;
    4247     else      std::cout << " / MISS" << std::endl;
    4248 }
    4249 #endif
    4250                    
    4251         r_inval_dtlb_count = r_inval_dtlb_count.read() + 1;
    4252         if ( r_inval_dtlb_count.read() == (m_dtlb_sets*m_dtlb_ways - 1) )
    4253         {
    4254             r_inval_dtlb_fsm        = INVAL_DTLB_IDLE;
    4255             r_dcache_dtlb_inval_req = false;
    4256         }
    4257         break;
    4258     }
    4259     } // end switch r_inval_dtlb_fsm
    42604224
    42614225    /////////// test processor frozen /////////////////////////////////////////////
     
    43854349            {
    43864350                r_vci_cmd_fsm       = CMD_DATA_SC;
    4387                 r_dcache_vci_sc_req     = false;
     4351                r_dcache_vci_sc_req = false;
    43884352                r_vci_cmd_cpt       = 0;
    43894353//                m_cpt_sc_transaction++;
Note: See TracChangeset for help on using the changeset viewer.