Changeset 601 for trunk


Ignore:
Timestamp:
Dec 17, 2013, 11:11:20 AM (10 years ago)
Author:
cfuguet
Message:

Modifications in vci_mem_cache:

  • The out of segment read or write does not activate any more an assert on the memory cache. Instead, the request is sent to the XRAM and the error from the XRAM will be propagated to the processor doing the access.

The propagation of the error is done in two different ways:

  • When is a READ MISS: The error is propagated through the VCI rerror to the processor doing the read.
  • When is a WRITE MISS: The error is propagated through an IRQ which normally is connected to the local XICU.
Location:
trunk/modules/vci_mem_cache
Files:
4 edited

Legend:

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

    r599 r601  
    466466      sc_in<bool>                                 p_clk;
    467467      sc_in<bool>                                 p_resetn;
     468      sc_out<bool>                                p_irq;
    468469      soclib::caba::VciTarget<vci_param_int>      p_vci_tgt;
    469470      soclib::caba::VciInitiator<vci_param_ext>   p_vci_ixr;
     
    904905      sc_signal<size_t>   r_xram_rsp_ivt_index;         // IVT entry index
    905906      sc_signal<size_t>   r_xram_rsp_next_ptr;          // Next pointer to the heap
     907      sc_signal<bool>     r_xram_rsp_rerror_irq;        // WRITE MISS rerror irq
     908      sc_signal<bool>     r_xram_rsp_rerror_irq_enable; // WRITE MISS rerror irq enable
     909      sc_signal<addr_t>   r_xram_rsp_rerror_address;    // WRITE MISS rerror address
     910      sc_signal<size_t>   r_xram_rsp_rerror_rsrcid;     // WRITE MISS rerror srcid
    906911
    907912      // Buffer between XRAM_RSP fsm and TGT_RSP fsm  (response to L1 cache)
  • trunk/modules/vci_mem_cache/caba/source/include/xram_transaction.h

    r549 r601  
    401401    void write_rsp(const size_t      index,
    402402                   const size_t      word,
    403                    const wide_data_t data)
     403                   const wide_data_t data,
     404                   const bool        rerror)
    404405    {
    405406        data_t  value;
     
    417418        assert( (tab[index].xram_read ) and
    418419        "MEMC ERROR: TRT entry is not a GET in TRT write_rsp()");
     420
     421        if ( rerror )
     422        {
     423            tab[index].rerror = true;
     424            return;
     425        }
    419426
    420427        // first 32 bits word
  • trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp

    r599 r601  
    10541054            r_xram_rsp_to_ixr_cmd_req          = false;
    10551055            r_xram_rsp_trt_index               = 0;
     1056            r_xram_rsp_rerror_irq              = false;
     1057            r_xram_rsp_rerror_irq_enable       = false;
    10561058
    10571059            m_xram_rsp_to_cc_send_inst_fifo.init();
     
    12141216                    addr_t   address = p_vci_tgt.address.read();
    12151217                    uint32_t plen    = p_vci_tgt.plen.read();
    1216                     bool     found   = false;
    12171218                    bool     config  = false;
    12181219
    1219                     for (size_t seg_id = 0; (seg_id < m_nseg) && !found; seg_id++)
     1220                    for (size_t seg_id = 0; (seg_id < m_nseg) ; seg_id++)
    12201221                    {
    12211222                        if (m_seg[seg_id]->contains(address) &&
    12221223                                m_seg[seg_id]->contains(address + plen - vci_param_int::B))
    12231224                        {
    1224                             found = true;
    12251225                            if (m_seg[seg_id]->special()) config = true;
    12261226                        }
    12271227                    }
    12281228
    1229                     if (!found)                /////////// out of segment error
    1230                     {
    1231                         r_tgt_cmd_fsm = TGT_CMD_ERROR;
    1232                     }
    1233                     else if (config)              /////////// configuration command
     1229                    if (config)                     /////////// configuration command
    12341230                    {
    12351231                        if (!p_vci_tgt.eop.read()) r_tgt_cmd_fsm = TGT_CMD_ERROR;
     
    13561352                    //  X : REGISTER INDEX                                   //
    13571353                    //                                                       //
     1354                    //  For WRITE MISS error signaling: FUNC = 0x010         //
     1355                    //                                                       //
     1356                    //  REGS_IDX                                             //
     1357                    //  ============================================         //
     1358                    //             RESERVED             |    X     |         //
     1359                    //             (4 bits)             | (3 bits) |         //
     1360                    //  ============================================         //
     1361                    //                                                       //
     1362                    //  X : REGISTER INDEX                                   //
     1363                    //                                                       //
    13581364                    ///////////////////////////////////////////////////////////
    13591365
     
    14531459                            {
    14541460                                error = read_instrumentation(regr, rdata);
     1461                            }
     1462                            else
     1463                            {
     1464                                error = 1;
     1465                            }
     1466
     1467                            break;
     1468                        }
     1469
     1470                        // xram GET bus error registers
     1471                        case MEMC_RERROR:
     1472                        {
     1473                            need_rsp = true;
     1474                            error    = 0;
     1475
     1476                            if (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)
     1477                            {
     1478                                switch (regr)
     1479                                {
     1480                                    case MEMC_RERROR_IRQ_ENABLE:
     1481                                        r_xram_rsp_rerror_irq_enable =
     1482                                            (p_vci_tgt.wdata.read() != 0);
     1483
     1484                                        break;
     1485                                       
     1486                                    default:
     1487                                        error = 1;
     1488                                        break;
     1489                                }
     1490                            }
     1491                            else if (p_vci_tgt.cmd.read() == vci_param_int::CMD_READ)
     1492                            {
     1493                                switch (regr)
     1494                                {
     1495                                    case MEMC_RERROR_SRCID:
     1496                                        rdata = (uint32_t)
     1497                                            r_xram_rsp_rerror_rsrcid.read();
     1498
     1499                                        break;
     1500
     1501                                    case MEMC_RERROR_ADDR_LO:
     1502                                        rdata = (uint32_t)
     1503                                            (r_xram_rsp_rerror_address.read()) &
     1504                                            ((1ULL<<32)-1);
     1505
     1506                                        break;
     1507
     1508                                    case MEMC_RERROR_ADDR_HI:
     1509                                        rdata = (uint32_t)
     1510                                            (r_xram_rsp_rerror_address.read() >> 32) &
     1511                                            ((1ULL<<32)-1);
     1512
     1513                                        break;
     1514
     1515                                    case MEMC_RERROR_IRQ_RESET:
     1516                                        if (not r_xram_rsp_rerror_irq.read()) break;
     1517
     1518                                        r_xram_rsp_rerror_irq = false;
     1519
     1520                                        break;
     1521
     1522                                    default:
     1523                                        error = 1;
     1524                                        break;
     1525                                }
    14551526                            }
    14561527                            else
     
    42174288                        r_ixr_rsp_trt_index = p_vci_ixr.rtrdid.read();
    42184289
    4219                         assert( ((p_vci_ixr.rerror.read() & 0x1) == 0) and
    4220                         "MEMC ERROR in IXR_RSP state: XRAM response error !");
    4221 
    4222                         if (p_vci_ixr.reop.read())   // PUT
     4290                        if (p_vci_ixr.reop.read() and not
     4291                            p_vci_ixr.rerror.read())   // PUT
    42234292                        {
    42244293                            r_ixr_rsp_fsm = IXR_RSP_TRT_ERASE;
     
    42494318                if (r_alloc_trt_fsm.read() == ALLOC_TRT_IXR_RSP)
    42504319                {
    4251                     size_t  index = r_ixr_rsp_trt_index.read();
     4320                    size_t index = r_ixr_rsp_trt_index.read();
     4321
    42524322                    if (m_trt.is_config(index))     // it's a config transaction
    42534323                    {
    42544324                        config_rsp_lines_ixr_rsp_decr = true;
    4255                         m_trt.erase(index);
    4256                         r_ixr_rsp_fsm = IXR_RSP_IDLE;
    4257                     }
    4258                     else                            // not a config transaction
    4259                     {
    4260                         m_trt.erase(index);
    4261                         r_ixr_rsp_fsm = IXR_RSP_IDLE;
    4262                     }
     4325                    }
     4326
     4327                    m_trt.erase(index);
     4328                    r_ixr_rsp_fsm = IXR_RSP_IDLE;
    42634329
    42644330#if DEBUG_MEMC_IXR_RSP
     
    42794345                    bool        eop      = p_vci_ixr.reop.read();
    42804346                    wide_data_t data     = p_vci_ixr.rdata.read();
    4281                     bool        error    = ((p_vci_ixr.rerror.read() & 0x1) == 1);
    4282 
    4283                     assert(((eop == (word == (m_words-2))) or error) and
     4347                    bool        rerror   = ((p_vci_ixr.rerror.read() & 0x1) == 1);
     4348
     4349                    assert(((eop == (word == (m_words-2))) or rerror) and
    42844350                    "MEMC ERROR in IXR_RSP_TRT_READ state : invalid response from XRAM");
    42854351
    4286                     m_trt.write_rsp( index, word, data );
     4352                    m_trt.write_rsp( index, word, data, rerror );
    42874353
    42884354                    r_ixr_rsp_cpt = word + 2;
     
    48194885
    48204886                    // Next state
    4821                     if (r_xram_rsp_trt_buf.proc_read) r_xram_rsp_fsm = XRAM_RSP_ERROR_RSP;
    4822                     else                             r_xram_rsp_fsm = XRAM_RSP_IDLE;
     4887                    if (r_xram_rsp_trt_buf.proc_read)
     4888                    {
     4889                        r_xram_rsp_fsm = XRAM_RSP_ERROR_RSP;
     4890                    }
     4891                    else
     4892                    {
     4893                        // Trigger an interruption to signal a bus error from
     4894                        // the XRAM because a processor WRITE MISS (XRAM GET
     4895                        // transaction and not processor read).
     4896                        //
     4897                        // To avoid deadlocks we do not wait an error to be
     4898                        // acknowledged before signaling another one.
     4899                        // Therefore, when there is an active error, and other
     4900                        // errors arrive, these are not considered
     4901
     4902                        if (!r_xram_rsp_rerror_irq.read() && r_xram_rsp_rerror_irq_enable.read()
     4903                                && r_xram_rsp_trt_buf.xram_read )
     4904                        {
     4905                            r_xram_rsp_rerror_irq     = true;
     4906                            r_xram_rsp_rerror_address = r_xram_rsp_trt_buf.nline * m_words * 4;
     4907                            r_xram_rsp_rerror_rsrcid  = r_xram_rsp_trt_buf.srcid;
     4908
     4909#if DEBUG_MEMC_XRAM_RSP
     4910                            if (m_debug)
     4911                                std::cout
     4912                                    << "  <MEMC " << name() << " XRAM_RSP_ERROR_ERASE>"
     4913                                    << " Triggering interrupt to signal WRITE MISS bus error"
     4914                                    << " / irq_enable = " << r_xram_rsp_rerror_irq_enable.read()
     4915                                    << " / nline = "      << r_xram_rsp_trt_buf.nline
     4916                                    << " / rsrcid = "     << r_xram_rsp_trt_buf.srcid
     4917                                    << std::endl;
     4918#endif
     4919                        }
     4920
     4921                        r_xram_rsp_fsm = XRAM_RSP_IDLE;
     4922                    }
    48234923
    48244924#if DEBUG_MEMC_XRAM_RSP
     
    84258525
    84268526        ////////////////////////////////////////////////////////////////////
     8527        //  p_irq port
     8528        //
     8529        //  WRITE MISS response error signaling
     8530        ////////////////////////////////////////////////////////////////////
     8531
     8532        p_irq =
     8533            r_xram_rsp_rerror_irq.read() &&
     8534            r_xram_rsp_rerror_irq_enable.read();
     8535
     8536        ////////////////////////////////////////////////////////////////////
    84278537        //  p_dspin_m2p port (CC_SEND FSM)
    84288538        ////////////////////////////////////////////////////////////////////
  • trunk/modules/vci_mem_cache/include/soclib/mem_cache.h

    r596 r601  
    3232    MEMC_CONFIG = 0,
    3333    MEMC_INSTRM = 1,
     34    MEMC_RERROR = 2,
    3435
    3536    MEMC_FUNC_SPAN = 0x200
     
    7071//                                                       //
    7172//  For configuration: FUNC_IDX = 0b000                  //
     73//                                                       //
     74//  REGS_IDX                                             //
     75//  ============================================         //
     76//             RESERVED             |    X     |         //
     77//             (4 bits)             | (3 bits) |         //
     78//  ============================================         //
     79//                                                       //
     80//  X : REGISTER INDEX                                   //
     81//                                                       //
     82//  For WRITE MISS error signaling: FUNC = 0x010         //
    7283//                                                       //
    7384//  REGS_IDX                                             //
     
    166177};
    167178
     179enum SoclibMemCacheRerrorRegs
     180{
     181    MEMC_RERROR_ADDR_LO = 0,
     182    MEMC_RERROR_ADDR_HI,
     183    MEMC_RERROR_SRCID,
     184    MEMC_RERROR_IRQ_RESET,
     185    MEMC_RERROR_IRQ_ENABLE
     186};
     187
    168188#define MEMC_REG(func,idx) ((func<<7)|idx)
    169189
Note: See TracChangeset for help on using the changeset viewer.