Changeset 604 for branches/RWT/modules


Ignore:
Timestamp:
Dec 17, 2013, 3:21:07 PM (10 years ago)
Author:
devigne
Message:

Merge with the latest trunk (concurrent access to a register CONFIG_FSM)
Modification processing software invalidations to memcache level.

When a software memcache invalidation, it does not write the dirty data in the
XRAM (and therefore does not reserve space in the TRT). This poses a problem
when processing CLEANUP_DATA on a line NCC because CLEANUP_FSM expects to find
a placeholder in the TRT.

To overcome this problem, the flit DSPIN a multi-inval now contains a bit to
indicate that the invalidation from a control configuration (software
invalidation level memcache).

At the reception of this message invalidation in the L1 cache, it retrieves the
value of the field DSPIN IS_CONFIG. When processing invalidation (
DCACHE_CC_INVAL ), the value of this field is checked. Two scenarios are
possible:

  • 1st case : The INVAL concerns a line NCC but not from a software invalidation (IS_CONFIG = 0), the CLEANUP sent then follows the classical treatment of invalidation of a line NCC (sends a CLEANUP_NCC with or without data).
  • 2nd case : The INVAL provides a line NCC from a software invalidation (IS_CONFIG = 1) : same treatment as was CLEANUP line CC.

Thus in the case of interest (software invalidation on a line NCC), the CLEANUP
received by the memcache will be treated as one line CC.

Location:
branches/RWT/modules
Files:
5 edited

Legend:

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

    r577 r604  
    604604
    605605    // communication between CC_RECEIVE FSM and DCACHE FSM
    606     sc_signal<bool>         r_cc_receive_dcache_req;        // cc_receive to dcache request
    607     sc_signal<int>          r_cc_receive_dcache_type;       // cc_receive type of request
    608     sc_signal<size_t>       r_cc_receive_dcache_way;        // cc_receive to dcache way
    609     sc_signal<size_t>       r_cc_receive_dcache_set;        // cc_receive to dcache set
    610     sc_signal<size_t>       r_cc_receive_dcache_updt_tab_idx;  // cc_receive update table index
    611     sc_signal<paddr_t>      r_cc_receive_dcache_nline;      // cache line physical address
     606    sc_signal<bool>         r_cc_receive_dcache_req;              // cc_receive to dcache request
     607    sc_signal<int>          r_cc_receive_dcache_type;             // cc_receive type of request
     608    sc_signal<size_t>       r_cc_receive_dcache_way;              // cc_receive to dcache way
     609    sc_signal<size_t>       r_cc_receive_dcache_set;              // cc_receive to dcache set
     610    sc_signal<size_t>       r_cc_receive_dcache_updt_tab_idx;     // cc_receive update table index
     611    sc_signal<paddr_t>      r_cc_receive_dcache_nline;            // cache line physical address
     612    sc_signal<bool>         r_cc_receive_dcache_inval_is_config;  // inval from memcache is config
    612613
    613614    ///////////////////////////////////
  • branches/RWT/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp

    r577 r604  
    22972297        {
    22982298
     2299
    22992300            if ( r_mmu_mode.read() & DATA_TLB_MASK )  // DTLB activated
    23002301            {
     
    53665367#endif
    53675368                }
    5368 
    5369                 if (cache_state == CACHE_SLOT_STATE_VALID_CC)
     5369                // If the line is coherente we send a classic CLEANUP
     5370                // If the type of inval request from Memcache is configuration
     5371                // (software), we send a classic CLEANUP
     5372                if (cache_state == CACHE_SLOT_STATE_VALID_CC or r_cc_receive_dcache_inval_is_config.read())
    53705373                {
    53715374                    r_dcache.write_dir( way,
     
    53885391                r_dcache_cc_send_type = CC_TYPE_CLEANUP;
    53895392                // MODIFIER POUR DIRTY BIT //
    5390                 if (cache_state == CACHE_SLOT_STATE_VALID_NCC)
     5393                if (cache_state == CACHE_SLOT_STATE_VALID_NCC and not r_cc_receive_dcache_inval_is_config.read())
    53915394                {
    53925395                    r_dcache_cc_cleanup_line_ncc = true;
    53935396                    if ((r_dcache_content_state[way*m_dcache_sets+set] != LINE_CACHE_DATA_NOT_DIRTY) or r_dcache_dirty_save.read() or dirty_save) //must send data
    5394                     //if (true) //must send data
    53955397                    {
    53965398                        r_dcache_cc_cleanup_updt_data = true;
     
    63096311        case CC_RECEIVE_DATA_INVAL_HEADER:
    63106312        {
     6313            // initialize dspin received data
     6314            uint64_t receive_data = p_dspin_m2p.data.read();
    63116315            // sample updt tab index in the HEADER, then skip to second flit
    63126316            r_cc_receive_fsm = CC_RECEIVE_DATA_INVAL_NLINE;
     6317            r_cc_receive_dcache_inval_is_config = DspinDhccpParam::dspin_get(receive_data,
     6318                                                  DspinDhccpParam::MULTI_INVAL_IS_CONFIG);
    63136319            break;
    63146320        }
  • branches/RWT/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h

    r545 r604  
    633633
    634634      void print_stats(bool activity_counters, bool stats);
    635       void print_trace();
     635      void print_trace( size_t detailled = 0 );
    636636      void cache_monitor(addr_t addr);
    637637      void start_monitor(addr_t addr, addr_t length);
  • branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp

    r545 r604  
    134134        "CONFIG_IDLE",
    135135        "CONFIG_LOOP",
    136         "CONFIG_WAIT"
     136        "CONFIG_WAIT",
    137137        "CONFIG_RSP",
    138138        "CONFIG_DIR_REQ",
     
    140140        "CONFIG_IVT_LOCK",
    141141        "CONFIG_BC_SEND",
    142         "CONFIG_INVAL_SEND"
     142        "CONFIG_INVAL_SEND",
    143143        "CONFIG_HEAP_REQ",
    144144        "CONFIG_HEAP_SCAN",
     
    412412        m_broadcast_boundaries(0x7C1F),
    413413
    414         r_tgt_cmd_fsm("r_tgt_cmd_fsm"),
    415 
    416414        //  FIFOs
    417415        m_cmd_read_addr_fifo("m_cmd_read_addr_fifo", 4),
     
    438436        m_cc_receive_to_cleanup_fifo("m_cc_receive_to_cleanup_fifo", 4),
    439437        m_cc_receive_to_multi_ack_fifo("m_cc_receive_to_multi_ack_fifo", 4),
     438
     439        r_tgt_cmd_fsm("r_tgt_cmd_fsm"),
    440440
    441441        r_config_fsm( "r_config_fsm" ),
     
    574574            r_ixr_cmd_wdata            = new sc_signal<data_t>[nwords];
    575575
    576             // Allocation for ODCCP
     576            // Allocation for RWT
    577577            r_cleanup_data             = new sc_signal<data_t>[nwords];
    578578            r_cleanup_to_ixr_cmd_data  = new sc_signal<data_t>[nwords];
     
    679679
    680680    //////////////////////////////////////////////////
    681     tmpl(void) ::print_trace()
    682         //////////////////////////////////////////////////
     681    tmpl(void)::print_trace( size_t detailed )
     682    //////////////////////////////////////////////////
    683683    {
    684684        std::cout << "MEMC " << name() << std::endl;
     
    701701            << " | " << alloc_ivt_fsm_str[r_alloc_ivt_fsm.read()]
    702702            << " | " << alloc_heap_fsm_str[r_alloc_heap_fsm.read()] << std::endl;
     703
     704        if ( detailed ) m_trt.print(0);
    703705    }
    704706
     
    764766                << "[037] GET (UNIMPLEMENTED)       = " << m_cpt_get << std::endl
    765767                << "[038] WRITE BROADCAST           = " << m_cpt_write_broadcast << std::endl
     768                << std::endl
     769                << "[039] CLEANUP DATA (FLITS)      = " << m_cpt_cleanup_data * 16 << std::endl
     770                << "[040] NCC TO CC (READ)          = " << m_cpt_ncc_to_cc_read << std::endl
     771                << "[041] NCC TO CC (WRITE)         = " << m_cpt_ncc_to_cc_write << std::endl
     772                << "[042] NCC TO CC (TOTAL)         = " << m_cpt_ncc_to_cc << std::endl
    766773                << std::endl;
    767774        }
     
    976983            r_tgt_rsp_key_sent  = false;
    977984
    978             // ODCCP
     985            // RWT
    979986            r_cleanup_data_index       = 0;
    980987            r_cleanup_trdid            = 0;
     
    11101117        size_t  xram_rsp_to_cc_send_fifo_srcid = 0;
    11111118
     1119        bool   config_rsp_lines_incr          = false;
     1120        bool   config_rsp_lines_cleanup_decr  = false;
     1121        bool   config_rsp_lines_ixr_rsp_decr  = false;
     1122
    11121123        bool    config_to_cc_send_fifo_put   = false;
    11131124        bool    config_to_cc_send_fifo_get   = false;
     
    13481359                        if (wdata % (m_words << 2)) lines++;
    13491360                        r_config_cmd_lines  = lines;
    1350                         r_config_rsp_lines  = lines;
     1361                        r_config_rsp_lines  = 0;
    13511362                    }
    13521363                    else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)   // set cmd type
     
    16141625                    bool valid   = m_upt.decrement(r_multi_ack_upt_index.read(), count);
    16151626
    1616                     /*ODCCP*/ //m_upt.print();
    16171627
    16181628                    if(not valid)
     
    17181728        // the command for line (n+1). It decrements the r_config_cmd_lines counter until
    17191729        // the last request has been registered in TRT (for a SYNC), or in IVT (for an INVAL).
     1730        // The r_config_rsp_lines counter contains the number of expected responses from
     1731        // CLEANUP FSM (inval) or from IXR_RSP FSM (sync). This register is incremented by
     1732        // the CONFIG FSM (each time a transaction is requested), and decremented by the
     1733        // CLEANUP or IXR_RSP FSMs(each time a response is received. As this register can
     1734        // be concurently accessed by those three FSMs, it is implemented as an [incr/decr]
     1735        // counter.
    17201736        //
    17211737        // - INVAL request:
     
    18791895                    {
    18801896                        r_config_cmd_lines = r_config_cmd_lines.read() - 1;
    1881                         r_config_rsp_lines = r_config_rsp_lines.read() - 1;
    18821897                        r_config_address   = r_config_address.read() + (m_words<<2);
    18831898                        r_config_fsm       = CONFIG_LOOP;
     
    19811996                            0,                                   // ll_key:          unused
    19821997                            true );                              // requested by config FSM
     1998                    config_rsp_lines_incr = true;
    19831999                    r_config_fsm = CONFIG_PUT_REQ;
    19842000
     
    20312047                            m_cache_directory.inval( way, set );
    20322048                            r_config_cmd_lines  = r_config_cmd_lines.read() - 1;
    2033                             r_config_rsp_lines  = r_config_rsp_lines.read() - 1;
    20342049                            r_config_address    = r_config_address.read() + (m_words<<2);
    20352050                            r_config_fsm        = CONFIG_LOOP;
     
    20672082                                m_cache_directory.inval( way, set );
    20682083                                r_config_ivt_index = index;
     2084                                config_rsp_lines_incr = true;
    20692085                                if ( broadcast )  r_config_fsm = CONFIG_BC_SEND;
    20702086                                else              r_config_fsm = CONFIG_INVAL_SEND;
     
    38853901                                nb_copies,
    38863902                                index);
    3887                         /*ODCCP*/ //m_upt.print();
    38883903#if DEBUG_MEMC_WRITE
    38893904                        if( m_debug and wok )
     
    40714086                ////////////////////////
    40724087            case IXR_CMD_CLEANUP_IDLE:
    4073                 /*ODCCP*///std::cout << "IXR_CMD_CLEANUP_IDLE" << std::endl;
    40744088                if     (r_read_to_ixr_cmd_req.read())       r_ixr_cmd_fsm = IXR_CMD_READ_TRT;
    40754089                else if(r_write_to_ixr_cmd_req.read())      r_ixr_cmd_fsm = IXR_CMD_WRITE_TRT;
     
    43524366                    if(p_vci_ixr.cmdack.read())
    43534367                    {
    4354                         /*ODCCP*/ //std::cout << "IXR_CMD_CLEANUP_DATA_SEND STATE at cycle : " << std::dec << m_cpt_cycles << std::endl;
    43554368                        if(r_ixr_cmd_word.read() == (m_words - 2))
    43564369                        {
    4357                             /*ODCCP*/ //std::cout << "IXR_CMD_CLEANUP_DATA_SEND GO TO IXR_CMD_CLEANUP_IDLE" << std::endl;
    43584370                            r_ixr_cmd_fsm = IXR_CMD_CLEANUP_IDLE;
    43594371                            r_cleanup_to_ixr_cmd_req = false;
     
    44674479                    {
    44684480                        size_t  index = r_ixr_rsp_trt_index.read();
    4469                         if (m_trt.is_config(index) ) r_config_rsp_lines = r_config_rsp_lines.read() - 1;
    4470                         m_trt.erase(index);
    4471                         r_ixr_rsp_fsm = IXR_RSP_IDLE;
    4472 
    4473                         //            std::cout << "remove a valid slot in trt index = " << r_ixr_rsp_trt_index.read()<< std::endl;
     4481                        if (m_trt.is_config(index))     // it's a config transaction
     4482                        {
     4483                            config_rsp_lines_ixr_rsp_decr = true;
     4484                            m_trt.erase(index);
     4485                            r_ixr_rsp_fsm = IXR_RSP_IDLE;
     4486                        }
     4487                        else                            // not a config transaction
     4488                        {
     4489                            m_trt.erase(index);
     4490                            r_ixr_rsp_fsm = IXR_RSP_IDLE;
     4491                        }
     4492
    44744493#if DEBUG_MEMC_IXR_RSP
    44754494                        if(m_debug)
     
    53555374            case CLEANUP_DIR_WRITE:
    53565375                {
    5357                     /*ODCCP*///std::cout << "CLEANUP_DIR_WRITE" << std::endl;
    53585376                    // Update the directory entry without heap access
    53595377                    if(r_alloc_dir_fsm.read() != ALLOC_DIR_CLEANUP)
     
    59195937                                "MEMC ERROR in CLEANUP_IVT_CLEAR state");
    59205938
    5921                         r_config_rsp_lines = r_config_rsp_lines.read() - 1;
     5939                        config_rsp_lines_cleanup_decr = true;
    59225940                    }
    59235941
    59245942                    if      ( r_cleanup_need_rsp.read() ) r_cleanup_fsm = CLEANUP_WRITE_RSP;
    5925                     else if ( r_cleanup_ncc.read()      ) r_cleanup_fsm = CLEANUP_IXR_REQ;
     5943                    else if ( r_cleanup_ncc.read() ) r_cleanup_fsm = CLEANUP_IXR_REQ;
    59265944                    else                                  r_cleanup_fsm = CLEANUP_SEND_CLACK;
    59275945
     
    59475965                    r_cleanup_to_tgt_rsp_type    = true;
    59485966
    5949                     if (r_cleanup_ncc.read())
     5967                    if (r_cleanup_ncc.read() )
    59505968                    {
    59515969                        r_cleanup_fsm = CLEANUP_IXR_REQ;//need to put data to the XRAM
     
    89458963                ////////////////////////
    89468964            case ALLOC_TRT_CLEANUP:
    8947                 /*ODCCP*///std::cout << "TRT ALLOCATED TO CLEANUP" << std::endl;
    89488965                if(r_cleanup_fsm.read() != CLEANUP_IXR_REQ)
    89498966                {
     
    92949311                cas_to_cc_send_fifo_srcid );
    92959312        m_cpt_cycles++;
     9313
     9314        ////////////////////////////////////////////////////////////////////////////////////
     9315        //            Update r_config_rsp_lines counter.
     9316        // The three sources of (increment / decrement) are CONFIG / CLEANUP / IXR_RSP FSMs
     9317        ////////////////////////////////////////////////////////////////////////////////////
     9318        if ( config_rsp_lines_incr and not
     9319             (config_rsp_lines_cleanup_decr or config_rsp_lines_ixr_rsp_decr) )
     9320        {
     9321            r_config_rsp_lines = r_config_rsp_lines.read() + 1;
     9322        }
     9323        if ( not config_rsp_lines_incr and 
     9324             (config_rsp_lines_cleanup_decr or config_rsp_lines_ixr_rsp_decr) )
     9325        {
     9326            r_config_rsp_lines = r_config_rsp_lines.read() - 1;
     9327        }
    92969328
    92979329    } // end transition()
     
    96459677                            DspinDhccpParam::MULTI_INVAL_SRCID);
    96469678
     9679                    // MODIFIED FOR CONFIG INVAL (solution 1 bit in flit multi_inval)
     9680                    DspinDhccpParam::dspin_set( flit,
     9681                            1,
     9682                            DspinDhccpParam::MULTI_INVAL_IS_CONFIG);
     9683
    96479684                    DspinDhccpParam::dspin_set( flit,
    96489685                            r_config_to_cc_send_trdid.read(),
     
    97239760                /////////////////////////////////////
    97249761            case CC_SEND_CONFIG_BRDCAST_HEADER:
     9762                {
     9763                    uint64_t flit = 0;
     9764
     9765                    DspinDhccpParam::dspin_set( flit,
     9766                            m_broadcast_boundaries,
     9767                            DspinDhccpParam::BROADCAST_BOX);
     9768                    // MODIFIED FOR CONFIG INVAL (solution 1 bit in flit multi_inval)
     9769                    DspinDhccpParam::dspin_set( flit,
     9770                            1,
     9771                            DspinDhccpParam::MULTI_INVAL_IS_CONFIG);
     9772
     9773                    DspinDhccpParam::dspin_set( flit,
     9774                            m_cc_global_id,
     9775                            DspinDhccpParam::BROADCAST_SRCID);
     9776
     9777                    DspinDhccpParam::dspin_set( flit,
     9778                            1ULL,
     9779                            DspinDhccpParam::M2P_BC);
     9780                    p_dspin_m2p.write = true;
     9781                    p_dspin_m2p.data  = flit;
     9782                    break;
     9783                }
     9784                /////////////////////////////////////
    97259785            case CC_SEND_XRAM_RSP_BRDCAST_HEADER:
    97269786            case CC_SEND_WRITE_BRDCAST_HEADER:
  • branches/RWT/modules/vci_mem_cache/include/soclib/mem_cache.h

    r434 r604  
    3131{
    3232    MEMC_LOCK,
    33     MEMC_CMD_TYPE,
    3433    MEMC_ADDR_LO,
    3534    MEMC_ADDR_HI,
    36     MEMC_BUF_LENGTH
     35    MEMC_BUF_LENGTH,
     36    MEMC_CMD_TYPE
    3737};
    3838
Note: See TracChangeset for help on using the changeset viewer.