Ignore:
Timestamp:
Feb 19, 2013, 1:07:47 PM (11 years ago)
Author:
alain
Message:

bug fixing: coherence interrupt must be taken in the MISS_DIR_UPDT states.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/v5/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp

    r296 r299  
    12021202    //    They are handled as interrupts generated by the CC_RECEIVE FSM.
    12031203    //    - There is a coherence request when r_tgt_icache_req is set.
    1204     //    They are taken in IDLE, MISS_WAIT, UNC_WAIT states.
     1204    //    They are taken in IDLE, MISS_WAIT, MISS_DIR_UPDT, UNC_WAIT, states.
    12051205    //    - There is a cleanup ack request when r_cleanup_icache_req is set.
    1206     //    They are taken in IDLE, MISS_WAIT, UNC_WAIT states,
    1207     //    and also in the MISS_SELECT and MISS_DATA_UPDT states.
     1206    //    They are taken in IDLE, MISS_SELECT, MISS_CLEAN, MISS_WAIT,
     1207    //    MISS_DATA_UPDT, MISS_DIR_UPDT and UNC_WAIT states.
    12081208    //    - For both types of requests, actions associated to the pre-empted state
    12091209    //    are not executed. The DCACHE FSM goes to the proper sub-FSM (CC_CHECK
     
    12651265                        // 6/ uncacheable read miss                                 => ICACHE_UNC_REQ
    12661266    {
    1267         // coherence requests
     1267        // coherence interrupt
    12681268        if ( r_tgt_icache_req.read() )
    12691269        {
     
    12731273        }
    12741274
    1275         // cleanup ack requests
     1275        // cleanup ack interrupt
    12761276        if ( r_cleanup_icache_req.read() )
    12771277        {
     
    17171717        if (m_ireq.valid) m_cost_ins_miss_frz++;
    17181718
    1719         // cleanup ack request
     1719        // cleanup ack interrupt
    17201720        if ( r_cleanup_icache_req.read() )     
    17211721        {
     
    17801780        if (m_ireq.valid) m_cost_ins_miss_frz++;
    17811781
     1782        // cleanup ack interrupt
     1783        if ( r_cleanup_icache_req.read() )     
     1784        {
     1785            r_icache_fsm_save = r_icache_fsm.read();
     1786            r_icache_fsm = ICACHE_CC_CLACK;
     1787            break;
     1788        }
     1789
    17821790#ifdef INSTRUMENTATION
    17831791m_cpt_icache_dir_write++;
     
    18051813        if (m_ireq.valid) m_cost_ins_miss_frz++;
    18061814
    1807         // coherence request
     1815        // coherence interrupt
    18081816        if ( r_tgt_icache_req.read() )
    18091817        {
     
    18131821        }
    18141822
    1815         // cleanup ack request
     1823        // cleanup ack interrupt
    18161824        if ( r_cleanup_icache_req.read() )     
    18171825        {
     
    18381846    }
    18391847    ///////////////////////////
    1840     case ICACHE_MISS_DATA_UPDT:   // update the cache (one word per cycle) if no pending
    1841                                   // matching coherence request (r_icache_miss_inval)
     1848    case ICACHE_MISS_DATA_UPDT:   // update the cache (one word per cycle)
    18421849    {
    18431850        if ( m_ireq.valid ) m_cost_ins_miss_frz++;
    18441851
    1845         // cleanup ack request
     1852        // cleanup ack interrupt
    18461853        if ( r_cleanup_icache_req.read() )     
    18471854        {
     
    18531860        if ( r_vci_rsp_fifo_icache.rok() )      // response available
    18541861        {
    1855             if ( r_icache_miss_inval.read() )  // Matching coherence request
    1856                                                // pop the FIFO, without cache update
    1857             {
    1858 #if DEBUG_ICACHE
    1859 if ( m_debug_icache_fsm )
    1860 {
    1861     std::cout << "  <PROC " << name()
    1862               << " ICACHE_MISS_DATA_UPDT> Matching coherence request:"
    1863               << " pop the FIFO without cache update"
    1864               << " WORD = " << r_icache_miss_word.read() << std::endl;
    1865 }
    1866 #endif
    1867             }
    1868             else                                           // No matching coherence request
    1869                                                // pop the FIFO and update the cache
    1870             {
    18711862
    18721863#ifdef INSTRUMENTATION
    18731864m_cpt_icache_data_write++;
    18741865#endif
    1875                 r_icache.write( r_icache_miss_way.read(),
    1876                                 r_icache_miss_set.read(),
    1877                                 r_icache_miss_word.read(),
    1878                                 r_vci_rsp_fifo_icache.read() );
     1866            r_icache.write( r_icache_miss_way.read(),
     1867                            r_icache_miss_set.read(),
     1868                            r_icache_miss_word.read(),
     1869                            r_vci_rsp_fifo_icache.read() );
    18791870#if DEBUG_ICACHE
    18801871if ( m_debug_icache_fsm )
     
    18881879}
    18891880#endif
    1890             }
    1891 
    18921881            vci_rsp_fifo_icache_get = true;
    18931882            r_icache_miss_word = r_icache_miss_word.read() + 1;
     
    19111900        if ( m_ireq.valid ) m_cost_ins_miss_frz++;
    19121901
    1913         // cleanup ack request
     1902        // coherence interrupt
     1903        if ( r_tgt_icache_req.read() )
     1904        {
     1905            r_icache_fsm = ICACHE_CC_CHECK;
     1906            r_icache_fsm_save = r_icache_fsm.read();
     1907            break;
     1908        }
     1909
     1910        // cleanup ack interrupt
    19141911        if ( r_cleanup_icache_req.read() )     
    19151912        {
     
    19191916        }
    19201917                   
    1921         if ( r_icache_miss_clack.read() ) // waiting cleanup acknowledge for victim line
     1918        if ( not r_icache_miss_clack.read() ) // waiting cleanup acknowledge for victim line
    19221919        {
    19231920            if ( r_icache_miss_inval )    // Switch slot to ZOMBI state, and new cleanup
     
    19781975    case ICACHE_UNC_WAIT:       // waiting a response to an uncacheable read from VCI_RSP FSM
    19791976    {
    1980         // coherence request
     1977        // coherence interrupt
    19811978        if ( r_tgt_icache_req.read() )
    19821979        {
     
    19861983        }
    19871984
    1988         // cleanup ack request
     1985        // cleanup ack interrupt
    19891986        if ( r_cleanup_icache_req.read() )     
    19901987        {
     
    22242221    //    They are handled as interrupts generated by the CC_RECEIVE FSM.
    22252222    //    - There is a coherence request when r_tgt_dcache_req is set.
    2226     //    They are taken in IDLE, MISS_WAIT, UNC_WAIT, LL_WAIT and SC_WAIT states.
     2223    //    They are taken in IDLE, MISS_WAIT, MISS_DIR_UPDT, UNC_WAIT, LL_WAIT
     2224    //    and SC_WAIT states.
    22272225    //    - There is a cleanup acknowledge request when r_cleanup_dcache_req is set.
    2228     //    They are taken in IDLE, MISS_WAIT, UNC_WAIT, LL_WAIT, SC_WAIT states,
    2229     //    and also in the MISS_SELECT and MISS_DATA_UPDT.
     2226    //    They are taken in IDLE, MISS_SELECT, MISS_CLEAN, MISS_WAIT, MISS_DATA_UPDT,
     2227    //    MISS_DIR_UPDT, UNC_WAIT, LL_WAIT, SC_WAIT states.
    22302228    //    - For both types of requests, actions associated to the pre-empted state
    22312229    //    are not executed. The DCACHE FSM goes to the proper sub-FSM (CC_CHECK
     
    23252323                      // DTLB, DCACHE.DATA, and DCACHE.DIR, depending on the
    23262324                      // dreq.valid (dreq) and r_dcache_updt_req (updt) signals:
    2327                       //    dreq / updt / DTLB  / DCACHE.DIR / DCACHE.DIR /                   
    2328                       //     0   /  0   / NOP   / NOP        / NOP        /
    2329                       //     0   /  1   / NOP   / NOP        / WRITE      /
    2330                       //     1   /  0   / READ  / READ       / NOP        /
    2331                       //     1   /  1   / READ  / READ       / WRITE      /
    2332                       // Those two registers are set at each cycle rom the 3 signals
     2325                      //    dreq / updt / DTLB  / DCACHE.DIR / DCACHE.DATA /                   
     2326                      //     0   /  0   / NOP   / NOP        / NOP         /
     2327                      //     0   /  1   / NOP   / NOP        / WRITE       /
     2328                      //     1   /  0   / READ  / READ       / NOP         /
     2329                      //     1   /  1   / READ  / READ       / WRITE       /
     2330                      // Those two registers are set at each cycle from the 3 signals
    23332331                      // updt_request, wbuf_request, wbuf_write_miss.
    23342332    {
     
    40194017        if ( m_dreq.valid) m_cost_data_miss_frz++;
    40204018
    4021         // cleanup ack request
     4019        // cleanup ack interrupt
    40224020        if ( r_cleanup_dcache_req.read() )
    40234021        {
     
    40824080        if ( m_dreq.valid) m_cost_data_miss_frz++;
    40834081
     4082        // cleanup ack interrupt
     4083        if ( r_cleanup_dcache_req.read() )
     4084        {
     4085            r_dcache_fsm_cc_save = r_dcache_fsm.read();
     4086            r_dcache_fsm         = DCACHE_CC_CLACK;
     4087            break;
     4088        }
     4089
    40844090        size_t  way   = r_dcache_miss_way.read();
    40854091        size_t  set   = r_dcache_miss_set.read();
     
    41324138        if ( m_dreq.valid) m_cost_data_miss_frz++;
    41334139
    4134         // coherence request
     4140        // coherence interrupt
    41354141        if ( r_tgt_dcache_req )
    41364142        {
     
    41404146        }
    41414147
    4142         // cleanup ack request
     4148        // cleanup ack interrupt
    41434149        if ( r_cleanup_dcache_req.read() )
    41444150        {
     
    42104216    }
    42114217    //////////////////////////
    4212     case DCACHE_MISS_DATA_UPDT: // update the dcache (one word per cycle) if no pending
    4213                                 // matching coherence request (r_dcache_miss_inval)
     4218    case DCACHE_MISS_DATA_UPDT:   // update the dcache (one word per cycle)
    42144219    {
    42154220        if ( m_dreq.valid) m_cost_data_miss_frz++;
    42164221
    4217         // cleanup ack request
     4222        // cleanup ack interrupt
    42184223        if ( r_cleanup_dcache_req.read() )
    42194224        {
     
    42254230        if ( r_vci_rsp_fifo_dcache.rok() )      // one word available
    42264231        {
    4227             if ( r_dcache_miss_inval.read() )   // Matching coherence request
    4228                                                 // pop the FIFO, without cache update
    4229             {
    4230 #if DEBUG_DCACHE
    4231 if ( m_debug_dcache_fsm )
    4232 {
    4233     std::cout << "  <PROC " << name()
    4234               << " DCACHE_MISS_DATA_UPDT> Matching coherence request:"
    4235               << " pop the FIFO without cache update"
    4236               << " WORD = " << std::dec << r_dcache_miss_word.read() << std::endl;
    4237 }
    4238 #endif
    4239             }
    4240             else                                // No matching coherence request
    4241                                                 // pop the FIFO and update the cache
    4242             {
    42434232#ifdef INSTRUMENTATION
    42444233m_cpt_dcache_data_write++;
     
    42594248}
    42604249#endif
    4261             }
    42624250            vci_rsp_fifo_dcache_get = true;
    42634251            r_dcache_miss_word = r_dcache_miss_word.read() + 1;
     
    42814269        if ( m_dreq.valid) m_cost_data_miss_frz++;
    42824270
    4283         // cleanup ack request
     4271        // coherence interrupt
     4272        if ( r_tgt_dcache_req )
     4273        {
     4274            r_dcache_fsm_cc_save = r_dcache_fsm;
     4275            r_dcache_fsm         = DCACHE_CC_CHECK;
     4276            break;
     4277        }
     4278
     4279        // cleanup ack interrupt
    42844280        if ( r_cleanup_dcache_req.read() )
    42854281        {
     
    42894285        }
    42904286
    4291         if ( r_dcache_miss_clack.read() )
     4287        if ( not r_dcache_miss_clack.read() )  // waiting cleanup acknowledge
    42924288        {
    42934289            if ( r_dcache_miss_inval.read() ) // switch slot to ZOMBI state, and new cleanup
     
    43554351    case DCACHE_UNC_WAIT:  // waiting a response to an uncacheable read
    43564352    {
    4357         // coherence request
     4353        // coherence interrupt
    43584354        if ( r_tgt_dcache_req.read() )
    43594355        {
     
    43634359        }
    43644360
    4365         // cleanup ack request
     4361        // cleanup ack interrupt
    43664362        if ( r_cleanup_dcache_req.read() )
    43674363        {
     
    44004396    case DCACHE_LL_WAIT:    // waiting VCI response to a LL transaction
    44014397    {
    4402         // coherence request
     4398        // coherence interrupt
    44034399        if ( r_tgt_dcache_req.read() )
    44044400        {
     
    44084404        }
    44094405
    4410         // cleanup ack request
     4406        // cleanup ack interrupt
    44114407        if ( r_cleanup_dcache_req.read() )
    44124408        {
     
    44544450    case DCACHE_SC_WAIT:        // waiting VCI response to a SC transaction
    44554451    {
    4456         // external coherence request
     4452        // coherence interrupt
    44574453        if ( r_tgt_dcache_req.read() )
    44584454        {
     
    44624458        }
    44634459
    4464         // cleanup ack request
     4460        // cleanup ack interrupt
    44654461        if ( r_cleanup_dcache_req.read() )
    44664462        {
     
    45464542        break;
    45474543    }
    4548     //////////////////////////
     4544    ///////////////////////
    45494545    case DCACHE_DIRTY_WAIT:         // wait completion of CAS for PTE Dirty bit,
    45504546                                    // and return to IDLE state when response is received.
     
    45544550                                    // - if the CAS is a failure, we just retry the write.
    45554551    {
    4556         // external coherence request
     4552        // coherence interrupt
    45574553        if ( r_tgt_dcache_req )
    45584554        {
     
    45624558        }
    45634559
    4564         // cleanup ack request
     4560        // cleanup ack interrupt
    45654561        if ( r_cleanup_dcache_req.read() )
    45664562        {
Note: See TracChangeset for help on using the changeset viewer.