Changeset 1037


Ignore:
Timestamp:
Mar 3, 2016, 4:03:06 PM (8 years ago)
Author:
alain
Message:

A new try to remove the live-lock on DIR and TRT:
The owner FSM that release a ressource with ia round robin priority (DIR or TRT)
keep the highest priority if the access is not a success (WAIT state)

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

Legend:

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

    r1036 r1037  
    189189        READ_TRT_LOCK,
    190190        READ_TRT_SET,
    191         READ_TRT_REQ
     191        READ_TRT_REQ,
     192        READ_WAIT
    192193      };
    193194
  • trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp

    r1036 r1037  
    160160        "READ_TRT_LOCK",
    161161        "READ_TRT_SET",
    162         "READ_TRT_REQ"
     162        "READ_TRT_REQ",
     163        "READ_WAIT"
    163164    };
    164165    const char *write_fsm_str[] =
     
    29842985                        if (!wok)                  m_cpt_trt_full++;
    29852986                        if (hit_read or hit_write) m_cpt_trt_rb++;
    2986                         r_read_fsm = READ_IDLE;
     2987                        r_read_fsm = READ_WAIT;
    29872988                    }
    29882989                    else // missing line is requested to the XRAM
     
    30373038
    30383039            //////////////////
    3039             case READ_TRT_REQ:   // consume the read request in FIFO and send it to IXR_CMD_FSM
     3040            case READ_TRT_REQ:   // consume read request in FIFO / send it to IXR_CMD_FSM
    30403041            {
    30413042                if (not r_read_to_ixr_cmd_req)
     
    30573058                break;
    30583059            }
     3060
     3061            ///////////////
     3062            case READ_WAIT:  // release the locks protecting the shared ressources
     3063            {
     3064
     3065#if DEBUG_MEMC_READ
     3066                if (m_debug)
     3067                {
     3068                    std::cout << "  <MEMC " << name()
     3069                              << " READ_WAIT> Releases the locks before retry" << std::endl;
     3070                }
     3071#endif
     3072                r_read_fsm = READ_DIR_REQ;
     3073                break;
     3074            }
     3075
    30593076        } // end switch read_fsm
    30603077
     
    78967913        // compute dir_allocate, that is actually a release condition:
    78977914        // allocation can be done if the owner FSM doest not use the cache
     7915        // The oner FSM get the lowest priority (registerd in dir_last)
     7916        // only if the DIR access is a success.
    78987917        bool dir_allocate = false;
    7899         int  dir_last;
     7918        int  dir_last     = r_alloc_dir_last.read();
    79007919        switch(r_alloc_dir_fsm.read())
    79017920        {
     
    79217940                     (r_alloc_trt_fsm.read() == ALLOC_TRT_READ)))
    79227941                {
    7923                     dir_last     = ALLOC_DIR_READ;
    79247942                    dir_allocate = true;
     7943                    if ( r_read_fsm.read() != READ_WAIT ) dir_last = ALLOC_DIR_READ;
    79257944                }
    79267945                break;
     
    79447963                     (r_alloc_trt_fsm.read()  == ALLOC_TRT_WRITE)))
    79457964                {
    7946                     dir_last     = ALLOC_DIR_WRITE;
    79477965                    dir_allocate = true;
     7966                    if ( r_write_fsm.read() != WRITE_WAIT ) dir_last = ALLOC_DIR_WRITE;
    79487967                }
    79497968                break;
     
    79687987                      (r_alloc_trt_fsm.read() == ALLOC_TRT_CAS)))
    79697988                {
    7970                     dir_last     = ALLOC_DIR_CAS;
    79717989                    dir_allocate = true;
     7990                    if ( r_cas_fsm.read() != CAS_WAIT ) dir_last = ALLOC_DIR_CAS;
    79727991                }
    79737992                break;
     
    79818000                    (r_config_fsm.read() != CONFIG_IVT_LOCK))
    79828001                {
     8002                    dir_allocate = true;
    79838003                    dir_last     = ALLOC_DIR_CONFIG;
    7984                     dir_allocate = true;
    79858004                }
    79868005                break;
     
    79938012                    (r_cleanup_fsm.read() != CLEANUP_HEAP_LOCK))
    79948013                {
     8014                    dir_allocate = true;
    79958015                    dir_last     = ALLOC_DIR_CLEANUP;
    7996                     dir_allocate = true;
    79978016                }
    79988017 
     
    80058024                    (r_xram_rsp_fsm.read() != XRAM_RSP_IVT_LOCK))
    80068025                {
    8007                     dir_last     = r_alloc_dir_last.read();
    80088026                    dir_allocate = true;
    80098027                }
     
    80968114
    80978115        // Compute trt_allocate, that is actually a release condition:
    8098         // allocation can be done if owner FSM does not use the TRT
     8116        // allocation can be done if owner FSM release the TRT
     8117        // The owner FSM get the lowest priority (registered in trt_last)
     8118        // but only if the access to TRT is successful
    80998119        bool trt_allocate = false;
    8100         int  trt_last;
     8120        int  trt_last     = r_alloc_trt_last.read();
    81018121        switch(r_alloc_trt_fsm.read())
    81028122        {
     
    81058125                (r_read_fsm.read() != READ_TRT_SET))
    81068126            {
    8107                 trt_last     = ALLOC_TRT_READ;
    81088127                trt_allocate = true;
     8128                if ( r_read_fsm.read() != READ_WAIT ) trt_last = ALLOC_TRT_READ;
    81098129            }
    81108130            break;
     
    81178137                (r_write_fsm.read() != WRITE_BC_DIR_INVAL))
    81188138            {
    8119                 trt_last     = ALLOC_TRT_WRITE;
    81208139                trt_allocate = true;
     8140                if ( r_write_fsm.read() != WRITE_WAIT ) trt_last = ALLOC_TRT_WRITE;
    81218141            }
    81228142            break;
     
    81288148                (r_cas_fsm.read() != CAS_BC_DIR_INVAL))
    81298149            {
    8130                 trt_last     = ALLOC_TRT_CAS;
    81318150                trt_allocate = true;
     8151                if ( r_cas_fsm.read() != CAS_WAIT ) trt_last = ALLOC_TRT_CAS;
    81328152            }
    81338153            break;
     
    81368156                (r_config_fsm.read() != CONFIG_TRT_SET))
    81378157            {
     8158                trt_allocate = true;
    81388159                trt_last     = ALLOC_TRT_CONFIG;
    8139                 trt_allocate = true;
    81408160            }
    81418161            break;
     
    81478167                (r_ixr_cmd_fsm.read() != IXR_CMD_CONFIG_TRT))
    81488168            {
    8149                 trt_last     = r_alloc_trt_last.read();
    81508169                trt_allocate = true;
    81518170            }
     
    81578176                (r_xram_rsp_fsm.read() != XRAM_RSP_TRT_DIRTY))
    81588177            {
    8159                 trt_last     = r_alloc_trt_last.read();
    81608178                trt_allocate = true;
    81618179            }
     
    81658183                (r_ixr_rsp_fsm.read() != IXR_RSP_TRT_READ))
    81668184            {
    8167                 trt_last     = r_alloc_trt_last.read();
    81688185                trt_allocate = true;
    81698186            }
Note: See TracChangeset for help on using the changeset viewer.