Ignore:
Timestamp:
Dec 3, 2014, 5:59:57 PM (9 years ago)
Author:
devigne
Message:

RWT: merge from trunk (CONFIG_FSM bugfix)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp

    r837 r901  
    13001300        // The TGT_CMD_FSM controls the incoming VCI command pakets from the processors,
    13011301        // and dispatch these commands to the proper FSM through dedicated FIFOs.
     1302        // These READ/WRITE commands can be for the XRAM segment, or for the
     1303        // CONFIG segment:
    13021304        //
    1303         // There are 5 types of commands accepted in the XRAM segment:
     1305        // There are 5 types of commands accepted for the XRAM segment:
    13041306        // - READ   : A READ request has a length of 1 VCI flit. It can be a single word
    13051307        //            or an entire cache line, depending on the PLEN value => READ FSM
     
    13111313        //            acces key, second flit the data to write => WRITE FSM.
    13121314        //
    1313         // The READ/WRITE commands accepted in the configuration segment are targeting
     1315        // The READ/WRITE commands accepted for the CONFIG segment are targeting
    13141316        // configuration or status registers. They must contain one single flit.
    13151317        // - For almost all addressable registers, the response is returned immediately.
     
    13701372                            // ==> TYPE_WRITE = X100 with the TSAR encoding
    13711373                            // ==> mask = 0b0111 = 0x7
    1372                             assert((((p_vci_tgt.pktid.read() & 0x7) == 0x4)  or ((p_vci_tgt.pktid.read() & 0x7) == 0x0)) and
    1373                                     "The type specified in the pktid field is incompatible with the WRITE CMD");
     1374                            assert((((p_vci_tgt.pktid.read() & 0x7) == 0x4) or
     1375                                  ((p_vci_tgt.pktid.read() & 0x7) == 0x0)) and
     1376                                  "The type specified in the pktid field is incompatible with the WRITE CMD");
    13741377                            r_tgt_cmd_fsm = TGT_CMD_WRITE;
    13751378                        }
     
    14111414                break;
    14121415
    1413                 ///////////////////
     1416            ///////////////////
    14141417            case TGT_CMD_ERROR:  // response error must be sent
    14151418
     
    14421445                break;
    14431446
    1444                 ////////////////////
     1447            ////////////////////
    14451448            case TGT_CMD_CONFIG:    // execute config request and return response
    14461449            {
     
    14901493
    14911494                addr_t addr_lsb = p_vci_tgt.address.read() & m_config_addr_mask;
    1492 
    14931495                addr_t cell = (addr_lsb / vci_param_int::B);
    1494 
    14951496                size_t regr = cell & m_config_regr_idx_mask;
    1496 
    14971497                size_t func = (cell >> m_config_regr_width) & m_config_func_idx_mask;
    14981498
     
    23112311            }
    23122312            ////////////////////
    2313             case CONFIG_TRT_SET:       // read data in cache
    2314             // and post a PUT request in TRT
     2313            case CONFIG_TRT_SET:  // read data in cache
     2314                                  // and post a PUT request in TRT
    23152315            {
    23162316                assert((r_alloc_dir_fsm.read() == ALLOC_DIR_CONFIG) and
     
    24802480                {
    24812481                    // post bc inval request
    2482                     r_config_to_cc_send_multi_req   = false;
     2482                    r_config_to_cc_send_multi_req = false;
    24832483                    r_config_to_cc_send_brdcast_req = true;
    2484                     r_config_to_cc_send_trdid       = r_config_ivt_index.read();
    2485                     r_config_to_cc_send_nline       = m_nline[(addr_t)(r_config_address.read())];
     2484                    r_config_to_cc_send_trdid = r_config_ivt_index.read();
     2485                    r_config_to_cc_send_nline = m_nline[(addr_t)(r_config_address.read())];
    24862486
    24872487                    // prepare next iteration
     
    25072507                    not r_config_to_cc_send_brdcast_req.read())
    25082508                {
    2509                     // post multi inval request
    2510                     r_config_to_cc_send_multi_req   = true;
    2511                     r_config_to_cc_send_brdcast_req = false;
    2512                     r_config_to_cc_send_trdid       = r_config_ivt_index.read();
    2513                     r_config_to_cc_send_nline       = m_nline[(addr_t)(r_config_address.read())];
    2514 
    2515                     // post data into FIFO
     2509                    // post first copy into FIFO
    25162510                    config_to_cc_send_fifo_srcid = r_config_dir_copy_srcid.read();
    25172511                    config_to_cc_send_fifo_inst  = r_config_dir_copy_inst.read();
    25182512                    config_to_cc_send_fifo_put   = true;
    25192513
    2520                     if (r_config_dir_count.read() == 1)  // one copy
    2521                     {
    2522                         // prepare next iteration
     2514                    if (r_config_dir_count.read() == 1)  // only one copy
     2515                    {
     2516                        // post multi inval request
     2517                        r_config_to_cc_send_multi_req = true;
     2518                        r_config_to_cc_send_brdcast_req = false;
     2519                        r_config_to_cc_send_trdid = r_config_ivt_index.read();
     2520                        r_config_to_cc_send_nline = m_nline[(addr_t)(r_config_address.read())];
     2521
     2522                        // prepare next iteration (next line to be invalidated)
    25232523                        r_config_cmd_lines = r_config_cmd_lines.read() - 1;
    2524                         r_config_address   = r_config_address.read() + (m_words << 2);
    2525                         r_config_fsm       = CONFIG_LOOP;
    2526                     }
    2527                     else                                   // several copies
     2524                        r_config_address = r_config_address.read() + (m_words << 2);
     2525                        r_config_fsm = CONFIG_LOOP;
     2526                    }
     2527                    else                                   // several copies : must use heap
    25282528                    {
    25292529                        r_config_fsm = CONFIG_HEAP_REQ;
     
    25672567                bool last_copy = (entry.next == r_config_heap_next.read());
    25682568
     2569                // post one more copy into fifo
    25692570                config_to_cc_send_fifo_srcid = entry.owner.srcid;
    2570                 config_to_cc_send_fifo_inst  = entry.owner.inst;
    2571                 config_to_cc_send_fifo_put   = true;
    2572 
    2573                 if (m_config_to_cc_send_inst_fifo.wok()) // inval request accepted
    2574                 {
    2575                     r_config_heap_next = entry.next;
    2576                     if (last_copy) r_config_fsm = CONFIG_HEAP_LAST;
    2577 
    2578                     // <Activity counters>
    2579                     m_cpt_heap_slot_available++;
    2580                     // </Activity counters>
    2581                 }
    2582 
     2571                config_to_cc_send_fifo_inst = entry.owner.inst;
     2572                config_to_cc_send_fifo_put = true;
     2573
     2574                assert ( (m_config_to_cc_send_inst_fifo.wok()) and
     2575                "MEMC ERROR in CONFIG_HEAP_SCAN: The m_config_to_cc_send fifo should never overflow");
     2576
     2577                r_config_heap_next = entry.next;
     2578                if (last_copy)
     2579                {
     2580                    // post multi inval request
     2581                    r_config_to_cc_send_multi_req = true;
     2582                    r_config_to_cc_send_brdcast_req = false;
     2583                    r_config_to_cc_send_trdid = r_config_ivt_index.read();
     2584                    r_config_to_cc_send_nline = m_nline[(addr_t)(r_config_address.read())];
     2585
     2586                    // prepare next iteration (next line to be invalidated)
     2587                    r_config_cmd_lines = r_config_cmd_lines.read() - 1;
     2588                    r_config_address = r_config_address.read() + (m_words << 2);
     2589                    r_config_fsm = CONFIG_HEAP_LAST;
     2590                }
     2591                // <Activity counters>
     2592                m_cpt_heap_slot_available++;
     2593                // </Activity counters>
    25832594#if DEBUG_MEMC_CONFIG
    25842595                if (m_debug)
     
    26142625                m_heap.write(r_config_heap_next.read(), last_entry);
    26152626
    2616                 // prepare next iteration
    2617                 r_config_cmd_lines = r_config_cmd_lines.read() - 1;
    2618                 r_config_address   = r_config_address.read() + (m_words << 2);
    26192627                r_config_fsm       = CONFIG_LOOP;
    26202628
Note: See TracChangeset for help on using the changeset viewer.