Ignore:
Timestamp:
May 1, 2013, 4:13:23 PM (11 years ago)
Author:
alain
Message:

VCI port to XRAM switched to DATA == 64 bits
=> two template parameters vci_param_int & vci_param_ext
This has been validated in tsar_generic_xbar platform...

File:
1 edited

Legend:

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

    r362 r385  
    1414
    1515class TransactionTabEntry {
    16     typedef uint32_t              size_t;
     16    typedef sc_dt::sc_uint<64>    wide_data_t;
     17    typedef sc_dt::sc_uint<40>    addr_t;
    1718    typedef uint32_t              data_t;
    18     typedef sc_dt::sc_uint<40>    addr_t;
    1919    typedef uint32_t              be_t;
    2020
     
    138138////////////////////////////////////////////////////////////////////////
    139139class TransactionTab{
    140     typedef uint32_t size_t;
    141     typedef uint32_t data_t;
    142     typedef sc_dt::sc_uint<40> addr_t;
    143     typedef uint32_t be_t;
     140    typedef sc_dt::sc_uint<64>    wide_data_t;
     141    typedef sc_dt::sc_uint<40>    addr_t;
     142    typedef uint32_t              data_t;
     143    typedef uint32_t              be_t;
    144144
    145145    private:
     
    368368
    369369    /////////////////////////////////////////////////////////////////////
    370     // The write_rsp() function writes a word of the response to an
    371     // XRAM read transaction.
     370    // The write_rsp() function writes two 32 bits words of the response
     371    // to a XRAM read transaction.
    372372    // The BE field in TRT is taken into account.
    373373    // Arguments :
    374374    // - index : the index of the transaction in the transaction tab
    375375    // - word_index : the index of the data in the line
    376     // - data : the data to write
     376    // - data : a 64 bits value
    377377    // - error : invalid data
    378378    /////////////////////////////////////////////////////////////////////
    379     void write_rsp(const size_t index,
    380             const size_t word,
    381             const data_t data,
    382             const bool   rerror)
    383     {
     379    void write_rsp(const size_t      index,
     380                   const size_t      word,
     381                   const wide_data_t data,
     382                   const bool        rerror)
     383    {
     384        data_t  value;
     385        data_t  mask;
     386
    384387        assert( (index < size_tab)
    385388                && "Selected entry  out of range in write_rsp() Transaction Tab");
     
    391394                && "Selected entry is not an XRAM read transaction in write_rsp()");
    392395
    393         data_t mask = be_to_mask(tab[index].wdata_be[word]);
    394         tab[index].wdata[word] = (tab[index].wdata[word] & mask) | (data & ~mask);
     396        // first 32 bits word
     397        value = (data_t)data;
     398        mask  = be_to_mask(tab[index].wdata_be[word]);
     399        tab[index].wdata[word] = (tab[index].wdata[word] & mask) | (value & ~mask);
     400
     401        // second 32 bits word
     402        value = (data_t)(data>>32);
     403        mask  = be_to_mask(tab[index].wdata_be[word+1]);
     404        tab[index].wdata[word+1] = (tab[index].wdata[word+1] & mask) | (value & ~mask);
     405
     406        // error update
    395407        tab[index].rerror |= rerror;
    396408    }
Note: See TracChangeset for help on using the changeset viewer.