Changeset 644 for branches/RWT/modules


Ignore:
Timestamp:
Feb 27, 2014, 12:09:51 PM (10 years ago)
Author:
devigne
Message:

Problem of concurrency in MEMC on r_write_to_cc_send_nline register.
There was a case where the MEMC created a CC_INVAL request (due to a transition
to NCC -> CC) while sending a request CC_UPDATE what caused the crash of
r_write_to_cc_send_nline register required to send the request CC_UPDATE.

Location:
branches/RWT/modules/vci_mem_cache/caba/source
Files:
2 edited

Legend:

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

    r611 r644  
    427427
    428428      // Counters accessible in software (not yet but eventually)
     429      uint32_t     m_cpt_reset_count;    // Last cycle at which counters have been reset
    429430      uint32_t     m_cpt_read_local;     // Number of local READ transactions
    430       uint32_t     m_cpt_read_remote;   // number of remote READ transactions
    431       uint32_t     m_cpt_read_cost;     // Number of (flits * distance) for READs
     431      uint32_t     m_cpt_read_remote;    // number of remote READ transactions
     432      uint32_t     m_cpt_read_cost;      // Number of (flits * distance) for READs
    432433
    433434      uint32_t     m_cpt_write_local;    // Number of local WRITE transactions
    434       uint32_t     m_cpt_write_remote;  // number of remote WRITE transactions
     435      uint32_t     m_cpt_write_remote;   // number of remote WRITE transactions
    435436      uint32_t     m_cpt_write_flits_local;  // number of flits for local WRITEs
    436437      uint32_t     m_cpt_write_flits_remote; // number of flits for remote WRITEs
    437       uint32_t     m_cpt_write_cost;    // Number of (flits * distance) for WRITEs
     438      uint32_t     m_cpt_write_cost;     // Number of (flits * distance) for WRITEs
    438439
    439440      uint32_t     m_cpt_ll_local;       // Number of local LL transactions
     
    633634      ~VciMemCache();
    634635
     636      void reset_counters();
    635637      void print_stats(bool activity_counters, bool stats);
    636638      void print_trace( size_t detailled = 0 );
  • branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp

    r612 r644  
    371371        p_clk( "p_clk" ),
    372372        p_resetn( "p_resetn" ),
     373        p_irq( "p_irq" ),
    373374        p_vci_tgt( "p_vci_tgt" ),
    374375        p_vci_ixr( "p_vci_ixr" ),
     
    819820    }
    820821
     822   
     823    /////////////////////////////////////////
     824    tmpl(void)::reset_counters()
     825    /////////////////////////////////////////
     826    {
     827        m_cpt_reset_count        = m_cpt_cycles;
     828        m_cpt_read_local         = 0;
     829        m_cpt_read_remote        = 0;
     830        m_cpt_read_cost          = 0;
     831        m_cpt_write_local        = 0;
     832        m_cpt_write_remote       = 0;
     833        m_cpt_write_flits_local  = 0;
     834        m_cpt_write_flits_remote = 0;
     835        m_cpt_write_cost         = 0;
     836        m_cpt_ll_local           = 0;
     837        m_cpt_ll_remote          = 0;
     838        m_cpt_ll_cost            = 0;
     839        m_cpt_sc_local           = 0;
     840        m_cpt_sc_remote          = 0;
     841        m_cpt_sc_cost            = 0;
     842        m_cpt_cas_local          = 0;
     843        m_cpt_cas_remote         = 0;
     844        m_cpt_cas_cost           = 0;
     845        m_cpt_update             = 0;
     846        m_cpt_update_local       = 0;
     847        m_cpt_update_remote      = 0;
     848        m_cpt_update_cost        = 0;
     849        m_cpt_minval             = 0;
     850        m_cpt_minval_local       = 0;
     851        m_cpt_minval_remote      = 0;
     852        m_cpt_minval_cost        = 0;
     853        m_cpt_binval             = 0;
     854        m_cpt_cleanup_local      = 0;
     855        m_cpt_cleanup_remote     = 0;
     856        m_cpt_cleanup_cost       = 0;
     857        m_cpt_read_miss          = 0;
     858        m_cpt_write_miss         = 0;
     859        m_cpt_write_dirty        = 0;
     860        m_cpt_trt_rb             = 0;
     861        m_cpt_trt_full           = 0;
     862        m_cpt_get                = 0;
     863        m_cpt_put                = 0;
     864        m_cpt_ncc_to_cc_read     = 0;
     865        m_cpt_ncc_to_cc_write    = 0;
     866        m_cpt_ncc_to_cc          = 0;
     867    }
     868
    821869
    822870    /////////////////////////////////////////
     
    831879            std::cout << "----------------------------------" << std::dec << std::endl;
    832880            std::cout
     881                << "[000] COUNTERS RESET AT CYCLE   = " << m_cpt_reset_count << std::endl
    833882                << "[001] NUMBER OF CYCLES          = " << m_cpt_cycles << std::endl
    834883                << std::endl
     
    11171166
    11181167            // Activity counters
    1119             m_cpt_cycles                  = 0;
     1168            m_cpt_reset_count        = 0;
     1169            m_cpt_cycles             = 0;
    11201170            m_cpt_read_local         = 0;
    11211171            m_cpt_read_remote        = 0;
     
    11511201            m_cpt_write_miss              = 0;
    11521202            m_cpt_write_dirty             = 0;
    1153             m_cpt_write_broadcast = 0;
    1154             m_cpt_trt_rb          = 0;
     1203            m_cpt_write_broadcast         = 0;
     1204            m_cpt_trt_rb                  = 0;
    11551205            m_cpt_trt_full                = 0;
    1156             m_cpt_get             = 0;
    1157             m_cpt_put             = 0;
     1206            m_cpt_get                     = 0;
     1207            m_cpt_put                     = 0;
    11581208            m_cpt_dir_unused              = 0;
    11591209            m_cpt_upt_unused              = 0;
     
    34563506
    34573507                        assert ((r_write_count.read() == 1) and "NCC to CC req without copy");
    3458                         if(!match_inval and !r_write_to_cc_send_req.read())
    3459                         {
    3460                             r_write_to_cc_send_req = true;
    3461                             r_write_to_cc_send_dest = r_write_copy;
     3508
     3509                        if( not match_inval                          and
     3510                            not r_write_to_cc_send_req.read()        and
     3511                            not r_write_to_cc_send_multi_req.read()  and
     3512                            not r_write_to_cc_send_brdcast_req.read()   )
     3513                        {
     3514                            r_write_to_cc_send_req   = true;
     3515                            r_write_to_cc_send_dest  = r_write_copy;
    34623516                            r_write_to_cc_send_nline = nline;
    3463                             r_write_to_cleanup_req = true;
     3517                            r_write_to_cleanup_req   = true;
    34643518                            r_write_to_cleanup_nline = nline;
    34653519
     
    34803534                        {
    34813535                            std::cout << "  <MEMC " << name() << " WRITE_IVT_LOCK_HIT_WB> get access to the UPT: "
    3482                                 << " Inval requested =  " << (!match_inval and !r_write_to_cc_send_req.read())
     3536                                << " Inval requested =  " << (not match_inval and not r_write_to_cc_send_req.read())
    34833537                                << std::endl;
    34843538                        }
    34853539#endif
     3540                        break;
    34863541                    }
    34873542#if DEBUG_MEMC_WRITE
    34883543                    if(m_debug)
    34893544                    {
    3490                         std::cout << "  <MEMC " << name() << " WRITE_IVT_LOCK_HIT_WB> failed to access to the UPT: "
     3545                        std::cout << "  <MEMC " << name() << " WRITE_IVT_LOCK_HIT_WB> failed to access to the IVT: "
    34913546                            << std::endl;
    34923547                    }
     
    35603615                        // coherence update required
    35613616                    {
    3562                         if(!r_write_to_cc_send_multi_req.read() and
    3563                                 !r_write_to_cc_send_brdcast_req.read())
     3617                        if( not r_write_to_cc_send_multi_req.read()   and
     3618                            not r_write_to_cc_send_brdcast_req.read() and
     3619                            not r_write_to_cc_send_req.read()            )
    35643620                        {
    35653621                            r_write_fsm = WRITE_UPT_LOCK;
     
    36853741                // send the request if only one copy
    36863742                {
    3687                     assert(not r_write_to_cc_send_multi_req.read()   and
     3743                    assert( not r_write_to_cc_send_multi_req.read()   and
    36883744                            not r_write_to_cc_send_brdcast_req.read() and
     3745                            not r_write_to_cc_send_req.read()         and
    36893746                            "Error in VCI_MEM_CACHE : pending multicast or broadcast\n"
    36903747                            "transaction in WRITE_UPT_REQ state"
     
    42864343            case WRITE_BC_CC_SEND:    // Post a coherence broadcast request to CC_SEND FSM
    42874344                {
    4288                     if(!r_write_to_cc_send_multi_req.read() and !r_write_to_cc_send_brdcast_req.read())
     4345                    if( not r_write_to_cc_send_multi_req.read()   and
     4346                        not r_write_to_cc_send_brdcast_req.read() and
     4347                        not r_write_to_cc_send_req.read()            )
    42894348                    {
    42904349                        r_write_to_cc_send_multi_req   = false;
     
    72347293                    }
    72357294
     7295                    // READ
    72367296                    if(r_read_to_cc_send_req.read())
    72377297                    {
     
    72407300                    }
    72417301
     7302                    // WRITE
    72427303                    if(r_write_to_cc_send_req.read())
    72437304                    {
     
    72467307                    }
    72477308
    7248 
    7249                     // WRITE
    7250                     if(r_read_to_cc_send_req.read())
    7251                     {
    7252                         r_cc_send_fsm = CC_SEND_READ_NCC_INVAL_HEADER;
    7253                         break;
    7254                     }
    7255 
    7256                     if(r_write_to_cc_send_req.read())
    7257                     {
    7258                         r_cc_send_fsm = CC_SEND_WRITE_NCC_INVAL_HEADER;
    7259                         break;
    7260                     }
    72617309                    if(m_write_to_cc_send_inst_fifo.rok() or
    72627310                            r_write_to_cc_send_multi_req.read())
Note: See TracChangeset for help on using the changeset viewer.