Changeset 646 for branches


Ignore:
Timestamp:
Feb 28, 2014, 4:45:35 PM (10 years ago)
Author:
haoliu
Message:

(RWT) merging the lastest modification in trunk:

Modification in vci_cc_vcache_wrapper:
a) Non cacheable write request will not any more be sent by multi_write_buffer.

A write non cacheable access is retreated with a synchronous way, like the
read non cacheable access. When Cache L1 receives a write non cacheable request,
it will block the processor until the response of this request arrives.
The advantage of this method is that the cache L1 can supply the virtual address
to OS when it receives a bus error response.

b) In VCI_CMD_STATE, the unc_read request will not check the multi_write_buffer for

an matching address. But the CAS and SC request must be check this point
before sent to the target.

Modifcation in vci_mem_cache:
Change an assert in memcache for the modification in cache L1(UNC WRITE)

Location:
branches/RWT/modules
Files:
3 edited

Legend:

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

    r645 r646  
    152152        CMD_INS_UNC,
    153153        CMD_DATA_MISS,
    154         CMD_DATA_UNC,
     154        CMD_DATA_UNC_READ,
     155        CMD_DATA_UNC_WRITE,
    155156        CMD_DATA_WRITE,
    156157        CMD_DATA_LL,
     
    207208        //  b1 accÚs table llsc type SW / other
    208209        //  b2 WRITE/CAS/LL/SC
    209         TYPE_READ_DATA_UNC          = 0x0,
     210        TYPE_DATA_UNC               = 0x0,
    210211        TYPE_READ_DATA_MISS         = 0x1,
    211212        TYPE_READ_INS_UNC           = 0x2,
     
    279280    };
    280281
    281     enum transaction_type_d_e
    282     {
    283         // b0 : 1 if cached
    284         // b1 : 1 if instruction
    285         TYPE_DATA_UNC     = 0x0,
    286         TYPE_DATA_MISS    = 0x1,
    287         TYPE_INS_UNC      = 0x2,
    288         TYPE_INS_MISS     = 0x3,
    289     };
     282//    enum transaction_type_d_e
     283//    {
     284//        // b0 : 1 if cached
     285//        // b1 : 1 if instruction
     286//        TYPE_DATA_UNC     = 0x0,
     287//        TYPE_DATA_MISS    = 0x1,
     288//        TYPE_INS_UNC      = 0x2,
     289//        TYPE_INS_MISS     = 0x3,
     290//    };
    290291
    291292    //////////////////MODIFIED////////////////
     
    428429    sc_signal<uint32_t>     r_dcache_save_be;           // byte enable (from proc)
    429430    sc_signal<paddr_t>      r_dcache_save_paddr;        // physical address
    430     sc_signal<bool>         r_dcache_save_cacheable;    // address cacheable
    431431    sc_signal<size_t>       r_dcache_save_cache_way;    // selected way (from dcache)
    432432    sc_signal<size_t>       r_dcache_save_cache_set;    // selected set (from dcache)
     
    439439    // communication between DCACHE FSM and VCI_CMD FSM
    440440    sc_signal<paddr_t>      r_dcache_vci_paddr;             // physical address for VCI command
     441    sc_signal<uint32_t>     r_dcache_vci_wdata;             // write unc data for VCI command
    441442    sc_signal<bool>         r_dcache_vci_miss_req;      // read miss request
    442     sc_signal<bool>         r_dcache_vci_unc_req;       // uncacheable read request
    443     sc_signal<uint32_t>     r_dcache_vci_unc_be;        // uncacheable read byte enable
     443    sc_signal<bool>         r_dcache_vci_unc_req;       // uncacheable request (read/write)
     444    sc_signal<uint32_t>     r_dcache_vci_unc_be;        // uncacheable byte enable
     445    sc_signal<uint32_t>     r_dcache_vci_unc_write;     // uncacheable data write request
    444446    sc_signal<bool>         r_dcache_vci_cas_req;       // atomic write request CAS
    445447    sc_signal<uint32_t>     r_dcache_vci_cas_old;       // previous data value for a CAS
     
    458460    sc_signal<size_t>       r_dcache_xtn_way;               // selected way (from dcache)
    459461    sc_signal<size_t>       r_dcache_xtn_set;               // selected set (from dcache)
    460 
    461     // write buffer state extension
    462     sc_signal<bool>         r_dcache_pending_unc_write; // pending uncacheable write in WBUF
    463462
    464463    // handling dcache miss
  • branches/RWT/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp

    r645 r646  
    124124        "CMD_INS_UNC",
    125125        "CMD_DATA_MISS",
    126         "CMD_DATA_UNC",
     126        "CMD_DATA_UNC_READ",
     127        "CMD_DATA_UNC_WRITE",
    127128        "CMD_DATA_WRITE",
    128129        "CMD_DATA_LL",
     
    132133
    133134const char *vci_pktid_type_str[] = {
    134         "TYPE_READ_DATA_UNC",
     135        "TYPE_DATA_UNC",
    135136        "TYPE_READ_DATA_MISS",           
    136137        "TYPE_READ_INS_UNC",         
     
    302303      r_dcache_save_be("r_dcache_save_be"),
    303304      r_dcache_save_paddr("r_dcache_save_paddr"),
    304       r_dcache_save_cacheable("r_dcache_save_cacheable"),
    305305      r_dcache_save_cache_way("r_dcache_save_cache_way"),
    306306      r_dcache_save_cache_set("r_dcache_save_cache_set"),
     
    312312
    313313      r_dcache_vci_paddr("r_dcache_vci_paddr"),
     314      r_dcache_vci_wdata("r_dcache_vci_wdata"),
    314315      r_dcache_vci_miss_req("r_dcache_vci_miss_req"),
    315316      r_dcache_vci_unc_req("r_dcache_vci_unc_req"),
    316317      r_dcache_vci_unc_be("r_dcache_vci_unc_be"),
     318      r_dcache_vci_unc_write("r_dcache_vci_unc_write"),
    317319      r_dcache_vci_cas_req("r_dcache_vci_cas_req"),
    318320      r_dcache_vci_cas_old("r_dcache_vci_cas_old"),
     
    324326      r_dcache_xtn_way("r_dcache_xtn_way"),
    325327      r_dcache_xtn_set("r_dcache_xtn_set"),
    326 
    327       r_dcache_pending_unc_write("r_dcache_pending_unc_write"),
    328328
    329329      r_dcache_miss_type("r_dcache_miss_type"),
     
    822822        r_dcache_vci_ll_req        = false;
    823823        r_dcache_vci_sc_req        = false;
    824 
    825         // No uncacheable write pending
    826         r_dcache_pending_unc_write = false;
    827824
    828825        // No processor XTN request pending
     
    24262423        if ( r_dcache_wbuf_req.read() )
    24272424        {
    2428             // miss if write not cacheable, and previous non cacheable write registered
    2429             if ( not r_dcache_save_cacheable.read() and r_dcache_pending_unc_write.read() )
    2430             {
    2431                 wbuf_write_miss = true;
    2432             }
    2433             else                // try a registration into write buffer
    2434             {
    2435                 bool wok = r_wbuf.write( r_dcache_save_paddr.read(),
    2436                                          r_dcache_save_be.read(),
    2437                                          r_dcache_save_wdata.read(),
    2438                                          r_dcache_save_cacheable.read() );
     2425            bool wok = r_wbuf.write( r_dcache_save_paddr.read(),
     2426                                     r_dcache_save_be.read(),
     2427                                     r_dcache_save_wdata.read(),
     2428                                     true );
    24392429/*#ifdef INSTRUMENTATION
    24402430m_cpt_wbuf_write++;
    24412431#endif*/
    2442                 if ( not wok ) // miss if write buffer full
    2443                 {
    2444                     wbuf_write_miss = true;
    2445                 }
    2446                 else          // update the write_buffer state extension
    2447                 {
    2448                     if(not r_dcache_pending_unc_write.read())
    2449                         r_dcache_pending_unc_write = not r_dcache_save_cacheable.read();
    2450                 }
    2451             }
     2432
     2433            if ( not wok ) // miss if write buffer full
     2434            {
     2435                wbuf_write_miss = true;
     2436             }
    24522437        } // end WBUF update
    24532438
     
    28032788                if ( valid_req )        // processor request is valid (after MMU check)
    28042789                {
    2805                     r_dcache_save_cacheable  = cacheable;
    2806 
    28072790                    // READ request
    28082791                    // The read requests are taken only if there is no cache update.
     
    28712854                        else                                    // uncacheable read
    28722855                        {
    2873                             r_dcache_vci_paddr    = paddr;
    2874                             r_dcache_vci_unc_be   = m_dreq.be;
    2875                             r_dcache_vci_unc_req  = true;
    2876                             r_dcache_fsm          = DCACHE_UNC_WAIT;
     2856                            r_dcache_vci_paddr      = paddr;
     2857                            r_dcache_vci_unc_be     = m_dreq.be;
     2858                            r_dcache_vci_unc_write  = false;
     2859                            r_dcache_vci_unc_req    = true;
     2860                            r_dcache_fsm            = DCACHE_UNC_WAIT;
    28772861#if DEBUG_DCACHE
    28782862if ( m_debug_activated )
     
    29402924                                r_dcache_llsc_valid = false;
    29412925
    2942                             // response to processor
    2943                             m_drsp.valid        = true;
    2944 
    2945 
     2926                            if (not cacheable)
     2927                            {                           
     2928                                r_dcache_vci_paddr      = paddr;
     2929                                r_dcache_vci_wdata      = m_dreq.wdata;
     2930                                r_dcache_vci_unc_write  = true;
     2931                                r_dcache_vci_unc_be     = m_dreq.be;
     2932                                r_dcache_vci_unc_req    = true;
     2933                                r_dcache_fsm            = DCACHE_UNC_WAIT;
     2934                            }
    29462935                            // activating P1 stage
    2947                             if( (cache_state != CACHE_SLOT_STATE_ZOMBI) && (cache_state != CACHE_SLOT_STATE_EMPTY) && (cacheable) )
     2936                            else if( (cache_state != CACHE_SLOT_STATE_ZOMBI) && (cache_state != CACHE_SLOT_STATE_EMPTY) )
    29482937                            {
    29492938                                wbuf_request = (cache_state == CACHE_SLOT_STATE_VALID_CC); //write to L2 only if CC
    29502939                                updt_request = true;
     2940                                m_drsp.valid = true;
    29512941                                if ( cache_state == CACHE_SLOT_STATE_VALID_NCC )
    29522942                                {
     
    29852975                            else
    29862976                            {
    2987                                if ( cacheable ) m_cpt_data_write_miss++;
     2977                               m_cpt_data_write_miss++;
    29882978                               
     2979                               m_drsp.valid = true;
    29892980                               wbuf_request = true;
    29902981                               updt_request = false;
     
    49204911        if ( r_vci_rsp_data_error.read() )      // bus error
    49214912        {
    4922             r_mmu_detr           = MMU_READ_DATA_ILLEGAL_ACCESS;
     4913            if(r_dcache_vci_unc_write.read())
     4914                r_mmu_detr           = MMU_WRITE_DATA_ILLEGAL_ACCESS;
     4915            else
     4916                r_mmu_detr           = MMU_READ_DATA_ILLEGAL_ACCESS;
    49234917            r_mmu_dbvar          = m_dreq.addr;
    49244918            r_vci_rsp_data_error = false;
     
    57465740            size_t      wbuf_max;
    57475741
    5748             bool dcache_unc_req = r_dcache_vci_unc_req.read() and
    5749                  ( not r_icache_miss_req.read() or not r_vci_cmd_imiss_prio.read() );
    5750 
    57515742            bool dcache_miss_req = r_dcache_vci_miss_req.read() and
    57525743                 ( not r_icache_miss_req.read() or not r_vci_cmd_imiss_prio.read() );
     
    57555746                 ( not r_icache_miss_req.read() or not r_vci_cmd_imiss_prio.read() );
    57565747
     5748            bool dcache_sc_req   = r_dcache_vci_sc_req.read() and
     5749                 ( not r_icache_miss_req.read() or not r_vci_cmd_imiss_prio.read() );
     5750
     5751            bool dcache_cas_req   = r_dcache_vci_cas_req.read() and
     5752                 ( not r_icache_miss_req.read() or not r_vci_cmd_imiss_prio.read() );
     5753
    57575754            bool icache_miss_req = r_icache_miss_req.read() and
    57585755                 ( not (r_dcache_vci_miss_req.read() or
    5759                         r_dcache_vci_ll_req.read() or
    5760                         r_dcache_vci_unc_req.read())
     5756                        r_dcache_vci_ll_req.read()   or
     5757                        r_dcache_vci_cas_req.read()  or
     5758                        r_dcache_vci_sc_req.read())
    57615759                     or r_vci_cmd_imiss_prio.read() );
    5762             // 1 - Data Read Miss
    5763             if ( dcache_miss_req and r_wbuf.miss(r_dcache_vci_paddr.read()) )
     5760
     5761            // 1 - Data unc write
     5762            if ( r_dcache_vci_unc_req.read() and r_dcache_vci_unc_write.read())
     5763            {
     5764                r_vci_cmd_fsm        = CMD_DATA_UNC_WRITE;
     5765                r_dcache_vci_unc_req = false;
     5766//                m_cpt_dunc_transaction++;
     5767            }
     5768            // 2 data read miss
     5769            else if ( dcache_miss_req and r_wbuf.miss(r_dcache_vci_paddr.read()) )
    57645770            {
    57655771                r_vci_cmd_fsm         = CMD_DATA_MISS;
     
    57685774                m_cpt_dmiss_transaction++;
    57695775            }
    5770             // 2 - Data Read Uncachable
    5771             else if ( dcache_unc_req and r_wbuf.miss(r_dcache_vci_paddr.read()))
    5772             {
    5773                 r_vci_cmd_fsm        = CMD_DATA_UNC;
     5776            // 3 - Data Read Uncachable
     5777            else if ( r_dcache_vci_unc_req.read() and not r_dcache_vci_unc_write.read() )
     5778            {
     5779                r_vci_cmd_fsm        = CMD_DATA_UNC_READ;
    57745780                r_dcache_vci_unc_req = false;
    57755781                m_cpt_dunc_transaction++;
    57765782            }
    5777             // 3 - Data Linked Load
     5783            // 4 - Data Linked Load
    57785784            else if ( dcache_ll_req and r_wbuf.miss(r_dcache_vci_paddr.read()))
    57795785            {
    5780                 r_dcache_vci_ll_req = false;
    5781                 r_vci_cmd_fsm       = CMD_DATA_LL;
     5786                r_vci_cmd_fsm         = CMD_DATA_LL;
     5787                r_dcache_vci_ll_req   = false;
     5788                r_vci_cmd_imiss_prio  = true;
    57825789                m_cpt_ll_transaction++;
    57835790            }
    5784             // 4 - Instruction Miss
     5791            // 5 - Instruction Miss
    57855792            else if ( icache_miss_req and r_wbuf.miss(r_icache_vci_paddr.read()) )
    57865793            {
     
    57905797                m_cpt_imiss_transaction++;
    57915798            }
    5792             // 5 - Instruction Uncachable
     5799            // 6 - Instruction Uncachable
    57935800            else if ( r_icache_unc_req.read() )
    57945801            {
     
    57975804                //m_cpt_iunc_transaction++;
    57985805            }
    5799             // 6 - Data Write
     5806            // 7 - Data Write
    58005807            else if ( r_wbuf.rok(&wbuf_min, &wbuf_max) )
    58015808            {
     
    58075814                m_length_write_transaction += (wbuf_max-wbuf_min+1);
    58085815            }
    5809             // 7 - Data Store Conditionnal
    5810             else if ( r_dcache_vci_sc_req.read() )
    5811             {
    5812                 r_dcache_vci_sc_req = false;
    5813                 r_vci_cmd_cpt  = 0;
    5814                 r_vci_cmd_fsm  = CMD_DATA_SC;
     5816            // 8 - Data Store Conditionnal
     5817            else if ( dcache_sc_req and r_wbuf.miss(r_dcache_vci_paddr.read()) )
     5818            {
     5819                r_vci_cmd_fsm           = CMD_DATA_SC;
     5820                r_dcache_vci_sc_req     = false;
     5821                r_vci_cmd_imiss_prio    = true;
     5822                r_vci_cmd_cpt           = 0;
    58155823                //m_cpt_sc_transaction++;
    58165824            }
    5817             // 8 - Compare And Swap
    5818             else if ( r_dcache_vci_cas_req.read() )
    5819             {
    5820                 r_vci_cmd_fsm        = CMD_DATA_CAS;
    5821                 r_dcache_vci_cas_req = false;
    5822                 r_vci_cmd_cpt        = 0;
     5825            // 9 - Compare And Swap
     5826            else if ( dcache_cas_req and r_wbuf.miss(r_dcache_vci_paddr.read()) )
     5827            {
     5828                r_vci_cmd_fsm           = CMD_DATA_CAS;
     5829                r_dcache_vci_cas_req    = false;
     5830                r_vci_cmd_imiss_prio    = true;
     5831                r_vci_cmd_cpt           = 0;
    58235832                //m_cpt_cas_transaction++;
    58245833            }
     
    58655874        case CMD_INS_UNC:
    58665875        case CMD_DATA_MISS:
    5867         case CMD_DATA_UNC:
     5876        case CMD_DATA_UNC_READ:
     5877        case CMD_DATA_UNC_WRITE:
    58685878        case CMD_DATA_LL:
    58695879        {
     
    59135923            r_vci_rsp_cpt = 0;
    59145924            if (r_dcache_vci_paddr.read() == 0x1f624) std::cout << "Tansaction on barrier, pktid = " <<  p_vci.rpktid.read() << std::endl;
    5915             if      ( (p_vci.rpktid.read() & 0x7) ==  TYPE_READ_DATA_UNC  )
     5925            if      ( (p_vci.rpktid.read() & 0x7) ==  TYPE_DATA_UNC  )
    59165926            {
    59175927                r_vci_rsp_fsm = RSP_DATA_UNC;
     
    61356145                r_vci_rsp_fsm = RSP_IDLE;
    61366146                uint32_t   wbuf_index = p_vci.rtrdid.read();
    6137                 bool       cacheable  = r_wbuf.completed(wbuf_index);
    6138                 if ( not cacheable ) r_dcache_pending_unc_write = false;
     6147                r_wbuf.completed(wbuf_index);
    61396148                if ( (p_vci.rerror.read()&0x1) != 0 ) r_iss.setWriteBerr();
    61406149            }
     
    66836692        break;
    66846693
    6685     case CMD_DATA_UNC:
     6694    case CMD_DATA_UNC_READ:
    66866695        p_vci.cmdval  = true;
    66876696        p_vci.address = r_dcache_vci_paddr.read() & ~0x3;
     
    66896698        p_vci.be      = r_dcache_vci_unc_be.read();
    66906699        p_vci.trdid   = 0;
    6691         p_vci.pktid   = TYPE_READ_DATA_UNC;
     6700        p_vci.pktid   = TYPE_DATA_UNC;
    66926701        p_vci.plen    = 4;
    66936702        p_vci.cmd     = vci_param::CMD_READ;
     6703        p_vci.eop     = true;
     6704        break;
     6705
     6706    case CMD_DATA_UNC_WRITE:
     6707        p_vci.cmdval  = true;
     6708        p_vci.address = r_dcache_vci_paddr.read() & ~0x3;
     6709        p_vci.wdata   = r_dcache_vci_wdata.read();
     6710        p_vci.be      = r_dcache_vci_unc_be.read();
     6711        p_vci.trdid   = 0;
     6712        p_vci.pktid   = TYPE_DATA_UNC;
     6713        p_vci.plen    = 4;
     6714        p_vci.cmd     = vci_param::CMD_WRITE;
    66946715        p_vci.eop     = true;
    66956716        break;
  • branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp

    r644 r646  
    14041404                            // ==> TYPE_WRITE = X100 with the TSAR encoding
    14051405                            // ==> mask = 0b0111 = 0x7
    1406                             assert(((p_vci_tgt.pktid.read() & 0x7) == 0x4) and
     1406                            assert(((p_vci_tgt.pktid.read() & 0x7) == 0x4 or (p_vci_tgt.pktid.read() == 0x0)) and
    14071407                                    "The type specified in the pktid field is incompatible with the WRITE CMD");
    14081408                            r_tgt_cmd_fsm = TGT_CMD_WRITE;
Note: See TracChangeset for help on using the changeset viewer.