Ignore:
Timestamp:
Sep 24, 2014, 3:48:50 PM (10 years ago)
Author:
devigne
Message:

RWT commit : Cosmetic (Remove trailing whitespace)

Location:
branches/RWT/modules/vci_mem_cache
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/RWT/modules/vci_mem_cache

  • branches/RWT/modules/vci_mem_cache/caba/source/include

  • branches/RWT/modules/vci_mem_cache/caba/source/include/xram_transaction.h

    r767 r814  
    1010
    1111////////////////////////////////////////////////////////////////////////
    12 //                  A transaction tab entry         
     12//                  A transaction tab entry
    1313////////////////////////////////////////////////////////////////////////
    1414
    15 class TransactionTabEntry 
     15class TransactionTabEntry
    1616{
    1717    typedef sc_dt::sc_uint<64>    wide_data_t;
     
    2121
    2222    public:
    23     bool                        valid;              // entry valid
    24     bool                        xram_read;          // read request to XRAM
    25     addr_t              nline;              // index (zy) of the requested line
    26     size_t                  srcid;          // processor requesting the transaction
    27     size_t                  trdid;          // processor requesting the transaction
    28     size_t                  pktid;          // processor requesting the transaction
    29     bool                        proc_read;          // read request from processor
    30     size_t                  read_length;    // length of the read (for the response)
    31     size_t                  word_index;         // index of the first read word (for the response)
    32     std::vector<data_t> wdata;          // write buffer (one cache line)
    33     std::vector<be_t>   wdata_be;       // be for each data in the write buffer
    34     bool                rerror;         // error returned by xram
    35     data_t              ll_key;         // LL key returned by the llsc_global_table
    36     bool                config;         // transaction required by CONFIG FSM
    37 
    38     /////////////////////////////////////////////////////////////////////
    39     // The init() function initializes the entry 
     23    bool                valid;       // entry valid
     24    bool                xram_read;   // read request to XRAM
     25    addr_t              nline;       // index (zy) of the requested line
     26    size_t              srcid;       // processor requesting the transaction
     27    size_t              trdid;       // processor requesting the transaction
     28    size_t              pktid;       // processor requesting the transaction
     29    bool                proc_read;   // read request from processor
     30    size_t              read_length; // length of the read (for the response)
     31    size_t              word_index;  // index of the first read word (for the response)
     32    std::vector<data_t> wdata;       // write buffer (one cache line)
     33    std::vector<be_t>   wdata_be;    // be for each data in the write buffer
     34    bool                rerror;      // error returned by xram
     35    data_t              ll_key;      // LL key returned by the llsc_global_table
     36    bool                config;      // transaction required by CONFIG FSM
     37
     38    /////////////////////////////////////////////////////////////////////
     39    // The init() function initializes the entry
    4040    /////////////////////////////////////////////////////////////////////
    4141    void init()
    4242    {
    43         valid           = false;
    44         rerror      = false;
    45         config      = false;
     43        valid  = false;
     44        rerror = false;
     45        config = false;
    4646    }
    4747
     
    6969    void copy(const TransactionTabEntry &source)
    7070    {
    71         valid       = source.valid;
    72         xram_read       = source.xram_read;
    73         nline       = source.nline;
    74         srcid       = source.srcid;
    75         trdid       = source.trdid;
    76         pktid       = source.pktid;
    77         proc_read       = source.proc_read;
     71        valid       = source.valid;
     72        xram_read   = source.xram_read;
     73        nline       = source.nline;
     74        srcid       = source.srcid;
     75        trdid       = source.trdid;
     76        pktid       = source.pktid;
     77        proc_read   = source.proc_read;
    7878        read_length = source.read_length;
    79         word_index      = source.word_index;
     79        word_index  = source.word_index;
    8080        wdata_be.assign(source.wdata_be.begin(),source.wdata_be.end());
    8181        wdata.assign(source.wdata.begin(),source.wdata.end());
     
    8686
    8787    ////////////////////////////////////////////////////////////////////
    88     // The print() function prints the entry 
     88    // The print() function prints the entry
    8989    ////////////////////////////////////////////////////////////////////
    9090    void print()
     
    9999        std::cout << "proc_read   = " << proc_read    << std::endl;
    100100        std::cout << "read_length = " << read_length  << std::endl;
    101         std::cout << "word_index  = " << word_index   << std::endl; 
     101        std::cout << "word_index  = " << word_index   << std::endl;
    102102        for(size_t i=0; i<wdata_be.size() ; i++)
    103103        {
    104             std::cout << "wdata_be[" << std::dec << i << "] = " 
     104            std::cout << "wdata_be[" << std::dec << i << "] = "
    105105                      << std::hex << wdata_be[i] << std::endl;
    106106        }
    107107        for(size_t i=0; i<wdata.size() ; i++)
    108108        {
    109             std::cout << "wdata[" << std::dec << i << "] = " 
     109            std::cout << "wdata[" << std::dec << i << "] = "
    110110                      << std::hex << wdata[i] << std::endl;
    111111        }
     
    117117
    118118    /////////////////////////////////////////////////////////////////////
    119     //          Constructors
     119    // Constructors
    120120    /////////////////////////////////////////////////////////////////////
    121121
     
    131131    TransactionTabEntry(const TransactionTabEntry &source)
    132132    {
    133         valid       = source.valid;
    134         xram_read       = source.xram_read;
    135         nline       = source.nline;
    136         srcid       = source.srcid;
    137         trdid       = source.trdid;
    138         pktid       = source.pktid;
    139         proc_read       = source.proc_read;
     133        valid       = source.valid;
     134        xram_read   = source.xram_read;
     135        nline       = source.nline;
     136        srcid       = source.srcid;
     137        trdid       = source.trdid;
     138        pktid       = source.pktid;
     139        proc_read   = source.proc_read;
    140140        read_length = source.read_length;
    141         word_index      = source.word_index;
     141        word_index  = source.word_index;
    142142        wdata_be.assign(source.wdata_be.begin(),source.wdata_be.end());
    143         wdata.assign(source.wdata.begin(),source.wdata.end()); 
     143        wdata.assign(source.wdata.begin(),source.wdata.end());
    144144        rerror      = source.rerror;
    145145        ll_key      = source.ll_key;
     
    150150
    151151////////////////////////////////////////////////////////////////////////
    152 //                  The transaction tab                             
     152//                  The transaction tab
    153153////////////////////////////////////////////////////////////////////////
    154154class TransactionTab
     
    185185
    186186    ////////////////////////////////////////////////////////////////////
    187     //          Constructors
     187    //  Constructors
    188188    ////////////////////////////////////////////////////////////////////
    189189    TransactionTab()
     
    194194
    195195    TransactionTab(const std::string &name,
    196                    size_t            n_entries, 
     196                   size_t            n_entries,
    197197                   size_t            n_words )
    198198    : tab_name( name ),
    199       size_tab( n_entries ) 
     199      size_tab( n_entries )
    200200    {
    201201        tab = new TransactionTabEntry[size_tab];
    202         for ( size_t i=0; i<size_tab; i++) 
     202        for ( size_t i=0; i<size_tab; i++)
    203203        {
    204204            tab[i].alloc(n_words);
     
    222222    void init()
    223223    {
    224         for ( size_t i=0; i<size_tab; i++) 
     224        for ( size_t i=0; i<size_tab; i++)
    225225        {
    226226            tab[i].init();
     
    247247    TransactionTabEntry read(const size_t index)
    248248    {
    249         assert( (index < size_tab) and 
     249        assert( (index < size_tab) and
    250250        "MEMC ERROR: Invalid Transaction Tab Entry");
    251251
     
    255255    // The full() function returns the state of the transaction tab
    256256    // Arguments :
    257     // - index : (return argument) the index of an empty entry 
     257    // - index : (return argument) the index of an empty entry
    258258    // The function returns true if the transaction tab is full
    259259    /////////////////////////////////////////////////////////////////////
     
    265265            {
    266266                index=i;
    267                 return false;   
     267                return false;
    268268            }
    269269        }
     
    271271    }
    272272    /////////////////////////////////////////////////////////////////////
    273     // The hit_read() function checks if an XRAM read transaction exists 
     273    // The hit_read() function checks if an XRAM read transaction exists
    274274    // for a given cache line.
    275275    // Arguments :
    276     // - index : (return argument) the index of the hit entry, if there is 
     276    // - index : (return argument) the index of the hit entry, if there is
    277277    // - nline : the index (zy) of the requested line
    278278    // The function returns true if a read request has already been sent
     
    282282        for(size_t i=0; i<size_tab; i++)
    283283        {
    284             if((tab[i].valid && (nline==tab[i].nline)) && (tab[i].xram_read)) 
     284            if((tab[i].valid && (nline==tab[i].nline)) && (tab[i].xram_read))
    285285            {
    286286                index=i;
    287                 return true;   
     287                return true;
    288288            }
    289289        }
     
    291291    }
    292292    ///////////////////////////////////////////////////////////////////////
    293     // The hit_write() function looks if an XRAM write transaction exists 
     293    // The hit_write() function looks if an XRAM write transaction exists
    294294    // for a given line.
    295295    // Arguments :
     
    301301        for(size_t i=0; i<size_tab; i++)
    302302        {
    303             if(tab[i].valid && (nline==tab[i].nline) && !(tab[i].xram_read)) 
     303            if(tab[i].valid && (nline==tab[i].nline) && !(tab[i].xram_read))
    304304            {
    305                 return true;   
     305                return true;
    306306            }
    307307        }
     
    310310
    311311    ///////////////////////////////////////////////////////////////////////
    312     // The hit_write() function looks if an XRAM write transaction exists 
     312    // The hit_write() function looks if an XRAM write transaction exists
    313313    // for a given line.
    314314    // Arguments :
     
    322322            if(tab[i].valid && (nline==tab[i].nline) && !(tab[i].xram_read)) {
    323323                *index = i;
    324                 return true;   
     324                return true;
    325325            }
    326326        }
     
    330330    // The write_data_mask() function writes a vector of data (a line).
    331331    // The data is written only if the corresponding bits are set
    332     // in the be vector. 
     332    // in the be vector.
    333333    // Arguments :
    334334    // - index : the index of the request in the transaction tab
    335     // - be   : vector of be 
     335    // - be   : vector of be
    336336    // - data : vector of data
    337337    /////////////////////////////////////////////////////////////////////
    338     void write_data_mask(const size_t index, 
    339             const std::vector<be_t> &be, 
    340             const std::vector<data_t> &data) 
     338    void write_data_mask(const size_t index,
     339            const std::vector<be_t> &be,
     340            const std::vector<data_t> &data)
    341341    {
    342342        assert( (index < size_tab) and
     
    349349        "MEMC ERROR: Bad data size in TRT write_data_mask()");
    350350
    351         for(size_t i=0; i<tab[index].wdata_be.size() ; i++) 
     351        for(size_t i=0; i<tab[index].wdata_be.size() ; i++)
    352352        {
    353353            tab[index].wdata_be[i] = tab[index].wdata_be[i] | be[i];
     
    384384            const size_t word_index,
    385385            const std::vector<be_t> &data_be,
    386             const std::vector<data_t> &data, 
     386            const std::vector<data_t> &data,
    387387            const data_t ll_key = 0,
    388             const bool config = false) 
     388            const bool config = false)
    389389    {
    390390        assert( (index < size_tab) and
    391391        "MEMC ERROR: The selected entry is out of range in TRT set()");
    392392
    393         assert( (data_be.size()==tab[index].wdata_be.size()) and 
     393        assert( (data_be.size()==tab[index].wdata_be.size()) and
    394394        "MEMC ERROR: Bad data_be argument in TRT set()");
    395395
    396         assert( (data.size()==tab[index].wdata.size()) and 
     396        assert( (data.size()==tab[index].wdata.size()) and
    397397        "MEMC ERROR: Bad data argument in TRT set()");
    398398
    399         tab[index].valid                = true;
    400         tab[index].xram_read        = xram_read;
    401         tab[index].nline                = nline;
    402         tab[index].srcid                = srcid;
    403         tab[index].trdid                = trdid;
    404         tab[index].pktid                = pktid;
    405         tab[index].proc_read        = proc_read;
    406         tab[index].read_length      = read_length;
    407         tab[index].word_index       = word_index;
    408         tab[index].ll_key           = ll_key;
    409         tab[index].config           = config;
    410         for(size_t i=0; i<tab[index].wdata.size(); i++) 
     399        tab[index].valid       = true;
     400        tab[index].xram_read   = xram_read;
     401        tab[index].nline       = nline;
     402        tab[index].srcid       = srcid;
     403        tab[index].trdid       = trdid;
     404        tab[index].pktid       = pktid;
     405        tab[index].proc_read   = proc_read;
     406        tab[index].read_length = read_length;
     407        tab[index].word_index  = word_index;
     408        tab[index].ll_key      = ll_key;
     409        tab[index].config      = config;
     410        for(size_t i=0; i<tab[index].wdata.size(); i++)
    411411        {
    412412            tab[index].wdata_be[i]    = data_be[i];
     
    416416
    417417    /////////////////////////////////////////////////////////////////////
    418     // The write_rsp() function writes two 32 bits words of the response 
     418    // The write_rsp() function writes two 32 bits words of the response
    419419    // to a XRAM read transaction.
    420420    // The BE field in TRT is taken into account.
     
    435435        "MEMC ERROR: The selected entry is out of range in TRT write_rsp()");
    436436
    437         assert( (word < tab[index].wdata_be.size()) and 
     437        assert( (word < tab[index].wdata_be.size()) and
    438438        "MEMC ERROR: Bad word index in TRT write_rsp()");
    439439
     
    467467    void erase(const size_t index)
    468468    {
    469         assert( (index < size_tab) and 
     469        assert( (index < size_tab) and
    470470        "MEMC ERROR: The selected entry is out of range in TRT erase()");
    471471
    472         tab[index].valid        = false;
    473         tab[index].rerror   = false;
     472        tab[index].valid  = false;
     473        tab[index].rerror = false;
    474474    }
    475475    /////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.