Changeset 346 for branches/v5


Ignore:
Timestamp:
Mar 29, 2013, 6:56:36 PM (11 years ago)
Author:
alain
Message:

New contructors for vci_mem_cache & vci_cc_vcache,
as we don't need anymore the mapping table for the coherence network...

Location:
branches/v5/modules
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/v5/modules/vci_cc_vcache_wrapper_dspin_coherence/caba/source/include/vci_cc_vcache_wrapper_dspin_coherence.h

    r331 r346  
    11/* -*- c++ -*-
     2 *
    23 * File : vci_cc_vcache_wrapper.h
    34 * Copyright (c) UPMC, Lip6, SoC
     
    285286    sc_in<bool>                             p_resetn;
    286287    sc_in<bool>                             p_irq[iss_t::n_irq];
    287     soclib::caba::VciInitiator<vci_param>   p_vci_ini_d;
    288     soclib::caba::DspinInput <40> p_dspin_in;
    289     soclib::caba::DspinOutput<33> p_dspin_out;
     288    soclib::caba::VciInitiator<vci_param>   p_vci;
     289    soclib::caba::DspinInput <40>           p_dspin_in;
     290    soclib::caba::DspinOutput<33>           p_dspin_out;
    290291
    291292private:
    292293
    293294    // STRUCTURAL PARAMETERS
    294     soclib::common::AddressDecodingTable<uint32_t, bool>        m_cacheability_table;
    295     const soclib::common::Segment                               m_segment;
    296     const vci_srcid_t                                           m_srcid_d;
    297     const vci_srcid_t                                           m_srcid_c;
    298 
     295    soclib::common::AddressDecodingTable<uint32_t, bool> m_cacheability_table;
     296
     297    const vci_srcid_t                   m_srcid;
     298    const size_t                        m_cc_global_id;
     299    const size_t                        m_nline_width;
    299300    const size_t                                                m_itlb_ways;
    300301    const size_t                                                m_itlb_sets;
    301 
    302302    const size_t                                                m_dtlb_ways;
    303303    const size_t                                                m_dtlb_sets;
    304 
    305304    const size_t                                                m_icache_ways;
    306305    const size_t                                                m_icache_sets;
    307306    const paddr_t                                               m_icache_yzmask;
    308307    const size_t                                                m_icache_words;
    309 
    310308    const size_t                                                m_dcache_ways;
    311309    const size_t                                                m_dcache_sets;
    312310    const paddr_t                                               m_dcache_yzmask;
    313311    const size_t                                                m_dcache_words;
    314 
    315312    const size_t                        m_x_width;
    316313    const size_t                        m_y_width;
    317 
    318     const size_t                        m_memory_cache_local_id;
    319314    const size_t                        m_proc_id;
    320315    const uint32_t                                              m_max_frozen_cycles;
    321316    const size_t                                                m_paddr_nbits;
     317    uint32_t                            m_debug_start_cycle;
     318    bool                                m_debug_ok;
    322319
    323320    ////////////////////////////////////////
     
    332329    // debug variables (for each FSM)
    333330    /////////////////////////////////////////////
    334     uint32_t                            m_debug_start_cycle;
    335     bool                                m_debug_ok;
    336331    bool                                m_debug_previous_hit;
    337332    bool                                m_idebug_previous_hit;
     
    686681public:
    687682    VciCcVCacheWrapper(
    688         sc_module_name insname,
    689         int proc_id,
    690         const soclib::common::MappingTable &mtp,
    691         const soclib::common::MappingTable &mtc,
    692         const soclib::common::IntTab &initiator_index_d,
    693         const soclib::common::IntTab &initiator_index_c,
    694         const soclib::common::IntTab &target_index_d,
    695         size_t   itlb_ways,
    696         size_t   itlb_sets,
    697         size_t   dtlb_ways,
    698         size_t   dtlb_sets,
    699         size_t   icache_ways,
    700         size_t   icache_sets,
    701         size_t   icache_words,
    702         size_t   dcache_ways,
    703         size_t   dcache_sets,
    704         size_t   dcache_words,
    705         size_t   wbuf_nlines,
    706         size_t   wbuf_nwords,
    707         size_t   x_width,
    708         size_t   y_width,
    709         uint32_t memory_cache_local_id,
    710         uint32_t max_frozen_cycles,
    711         uint32_t debug_start_cycle,
    712         bool     debug_ok);
     683        sc_module_name                      name,
     684        const int                           proc_id,
     685        const soclib::common::MappingTable  &mtd,
     686        const soclib::common::IntTab        &srcid,
     687        const size_t                        cc_global_id,
     688        const size_t                        itlb_ways,
     689        const size_t                        itlb_sets,
     690        const size_t                        dtlb_ways,
     691        const size_t                        dtlb_sets,
     692        const size_t                        icache_ways,
     693        const size_t                        icache_sets,
     694        const size_t                        icache_words,
     695        const size_t                        dcache_ways,
     696        const size_t                        dcache_sets,
     697        const size_t                        dcache_words,
     698        const size_t                        wbuf_nlines,
     699        const size_t                        wbuf_nwords,
     700        const size_t                        x_width,
     701        const size_t                        y_width,
     702        const uint32_t                      max_frozen_cycles,
     703        const uint32_t                      debug_start_cycle,
     704        const bool                          debug_ok );
    713705
    714706    ~VciCcVCacheWrapper();
  • branches/v5/modules/vci_cc_vcache_wrapper_dspin_coherence/caba/source/src/vci_cc_vcache_wrapper_dspin_coherence.cpp

    r341 r346  
    162162#define tmpl(...)  template<typename vci_param, typename iss_t> __VA_ARGS__ VciCcVCacheWrapper<vci_param, iss_t>
    163163
    164 using soclib::common::uint32_log2;
     164using namespace soclib::common;
    165165
    166166/////////////////////////////////
    167167tmpl(/**/)::VciCcVCacheWrapper(
    168168    sc_module_name                      name,
    169     int                                 proc_id,
    170     const soclib::common::MappingTable  &mtd,
    171     const soclib::common::MappingTable  &mtc,
    172     const soclib::common::IntTab        &initiator_index_d,
    173     const soclib::common::IntTab        &initiator_index_c,
    174     const soclib::common::IntTab        &target_index_c,
    175     size_t                              itlb_ways,
    176     size_t                              itlb_sets,
    177     size_t                              dtlb_ways,
    178     size_t                              dtlb_sets,
    179     size_t                              icache_ways,
    180     size_t                              icache_sets,
    181     size_t                              icache_words,
    182     size_t                              dcache_ways,
    183     size_t                              dcache_sets,
    184     size_t                              dcache_words,
    185     size_t                              wbuf_nlines,
    186     size_t                              wbuf_nwords,
    187     size_t                              x_width,
    188     size_t                              y_width,
    189     uint32_t                    memory_cache_local_id,
    190     uint32_t                    max_frozen_cycles,
    191     uint32_t                    debug_start_cycle,
    192     bool                                debug_ok)
     169    const int                           proc_id,
     170    const MappingTable      &mtd,
     171    const IntTab                &srcid,
     172    const size_t                cc_global_id,
     173    const size_t                        itlb_ways,
     174    const size_t                        itlb_sets,
     175    const size_t                        dtlb_ways,
     176    const size_t                        dtlb_sets,
     177    const size_t                        icache_ways,
     178    const size_t                        icache_sets,
     179    const size_t                        icache_words,
     180    const size_t                        dcache_ways,
     181    const size_t                        dcache_sets,
     182    const size_t                        dcache_words,
     183    const size_t                        wbuf_nlines,
     184    const size_t                        wbuf_nwords,
     185    const size_t                        x_width,
     186    const size_t                        y_width,
     187    const uint32_t                      max_frozen_cycles,
     188    const uint32_t                      debug_start_cycle,
     189    const bool                          debug_ok )
    193190    : soclib::caba::BaseModule(name),
    194191
    195       p_clk("clk"),
    196       p_resetn("resetn"),
    197       p_vci_ini_d("vci_ini_d"),
    198       p_dspin_in("dspin_in"),
    199       p_dspin_out("dspin_out"),
    200 
    201       m_cacheability_table(mtd.getCacheabilityTable()),
    202       m_segment(mtc.getSegment(target_index_c)),
    203       m_srcid_d(mtd.indexForId(initiator_index_d)),
    204       m_srcid_c(mtc.indexForId(initiator_index_c)),
    205 
    206       m_itlb_ways(itlb_ways),
    207       m_itlb_sets(itlb_sets),
    208 
    209       m_dtlb_ways(dtlb_ways),
    210       m_dtlb_sets(dtlb_sets),
    211 
    212       m_icache_ways(icache_ways),
    213       m_icache_sets(icache_sets),
    214       m_icache_yzmask((~0)<<(uint32_log2(icache_words) + 2)),
    215       m_icache_words(icache_words),
    216 
    217       m_dcache_ways(dcache_ways),
    218       m_dcache_sets(dcache_sets),
    219       m_dcache_yzmask((~0)<<(uint32_log2(dcache_words) + 2)),
    220       m_dcache_words(dcache_words),
    221 
    222       m_x_width(x_width),
    223       m_y_width(y_width),
    224 
    225       m_memory_cache_local_id(memory_cache_local_id),
    226       m_proc_id(proc_id),
    227       m_max_frozen_cycles(max_frozen_cycles),
    228       m_paddr_nbits(vci_param::N),
    229 
    230       m_debug_start_cycle(debug_start_cycle),
    231       m_debug_ok(debug_ok),
     192      p_clk("p_clk"),
     193      p_resetn("p_resetn"),
     194      p_vci("p_vci"),
     195      p_dspin_in("p_dspin_in"),
     196      p_dspin_out("p_dspin_out"),
     197
     198      m_cacheability_table( mtd.getCacheabilityTable() ),
     199      m_srcid( mtd.indexForId(srcid) ),
     200      m_cc_global_id( cc_global_id ),
     201      m_nline_width( vci_param::N - (uint32_log2(dcache_words)) - 2 ),
     202      m_itlb_ways( itlb_ways ),
     203      m_itlb_sets( itlb_sets ),
     204      m_dtlb_ways( dtlb_ways ),
     205      m_dtlb_sets( dtlb_sets ),
     206      m_icache_ways( icache_ways ),
     207      m_icache_sets( icache_sets ),
     208      m_icache_yzmask( (~0)<<(uint32_log2(icache_words) + 2) ),
     209      m_icache_words( icache_words ),
     210      m_dcache_ways( dcache_ways ),
     211      m_dcache_sets( dcache_sets ),
     212      m_dcache_yzmask( (~0)<<(uint32_log2(dcache_words) + 2) ),
     213      m_dcache_words( dcache_words ),
     214      m_x_width( x_width ),
     215      m_y_width( y_width ),
     216      m_proc_id( proc_id ),
     217      m_max_frozen_cycles( max_frozen_cycles ),
     218      m_paddr_nbits( vci_param::N ),
     219      m_debug_start_cycle( debug_start_cycle ),
     220      m_debug_ok( debug_ok ),
    232221
    233222      r_mmu_ptpr("r_mmu_ptpr"),
     
    30503039        // We should compute the access locality:
    30513040        // The PPN MSB bits define the destination cluster index.
    3052         // The m_srcid_d MSB bits define the source cluster index.
     3041        // The m_srcid MSB bits define the source cluster index.
    30533042        // The number of bits to compare depends on the number of clusters,
    30543043        // and can be obtained in the mapping table.
     
    33053294        // We should compute the access locality:
    33063295        // The PPN MSB bits define the destination cluster index.
    3307         // The m_srcid_d MSB bits define the source cluster index.
     3296        // The m_srcid MSB bits define the source cluster index.
    33083297        // The number of bits to compare depends on the number of clusters,
    33093298        // and can be obtained in the mapping table.
     
    50044993        case CMD_DATA_WRITE:
    50054994        {
    5006             if ( p_vci_ini_d.cmdack.read() )
     4995            if ( p_vci.cmdack.read() )
    50074996            {
    50084997                r_vci_cmd_cpt = r_vci_cmd_cpt + 1;
     
    50205009        {
    50215010            // The CAS and SC VCI commands contain two flits
    5022             if ( p_vci_ini_d.cmdack.read() )
     5011            if ( p_vci.cmdack.read() )
    50235012            {
    50245013               r_vci_cmd_cpt = r_vci_cmd_cpt + 1;
     
    50355024        {
    50365025            // all read VCI commands contain one single flit
    5037             if ( p_vci_ini_d.cmdack.read() )  r_vci_cmd_fsm = CMD_IDLE;
     5026            if ( p_vci.cmdack.read() )  r_vci_cmd_fsm = CMD_IDLE;
    50385027            break;
    50395028        }
     
    50735062    case RSP_IDLE:
    50745063    {
    5075         if ( p_vci_ini_d.rspval.read() )
     5064        if ( p_vci.rspval.read() )
    50765065        {
    50775066            r_vci_rsp_cpt = 0;
    50785067
    5079             if      ( (p_vci_ini_d.rpktid.read() & 0x7) ==  TYPE_READ_DATA_UNC  )
     5068            if      ( (p_vci.rpktid.read() & 0x7) ==  TYPE_READ_DATA_UNC  )
    50805069            {
    50815070                r_vci_rsp_fsm = RSP_DATA_UNC;
    50825071            }
    5083             else if ( (p_vci_ini_d.rpktid.read() & 0x7) ==  TYPE_READ_DATA_MISS )
     5072            else if ( (p_vci.rpktid.read() & 0x7) ==  TYPE_READ_DATA_MISS )
    50845073            {
    50855074                r_vci_rsp_fsm = RSP_DATA_MISS;
    50865075            }
    5087             else if ( (p_vci_ini_d.rpktid.read() & 0x7) ==  TYPE_READ_INS_UNC   )
     5076            else if ( (p_vci.rpktid.read() & 0x7) ==  TYPE_READ_INS_UNC   )
    50885077            {
    50895078                r_vci_rsp_fsm = RSP_INS_UNC;
    50905079            }
    5091             else if ( (p_vci_ini_d.rpktid.read() & 0x7) ==  TYPE_READ_INS_MISS  )
     5080            else if ( (p_vci.rpktid.read() & 0x7) ==  TYPE_READ_INS_MISS  )
    50925081            {
    50935082                r_vci_rsp_fsm = RSP_INS_MISS;
    50945083            }
    5095             else if ( (p_vci_ini_d.rpktid.read() & 0x7) ==  TYPE_WRITE          )
     5084            else if ( (p_vci.rpktid.read() & 0x7) ==  TYPE_WRITE          )
    50965085            {
    50975086                r_vci_rsp_fsm = RSP_DATA_WRITE;
    50985087            }
    5099             else if ( (p_vci_ini_d.rpktid.read() & 0x7) ==  TYPE_CAS            )
     5088            else if ( (p_vci.rpktid.read() & 0x7) ==  TYPE_CAS            )
    51005089            {
    51015090                r_vci_rsp_fsm = RSP_DATA_UNC;
    51025091            }
    5103             else if ( (p_vci_ini_d.rpktid.read() & 0x7) ==  TYPE_LL             )
     5092            else if ( (p_vci.rpktid.read() & 0x7) ==  TYPE_LL             )
    51045093            {
    51055094                r_vci_rsp_fsm = RSP_DATA_LL;
    51065095            }
    5107             else if ( (p_vci_ini_d.rpktid.read() & 0x7) == TYPE_SC             )
     5096            else if ( (p_vci.rpktid.read() & 0x7) == TYPE_SC             )
    51085097            {
    51095098                r_vci_rsp_fsm = RSP_DATA_UNC;
     
    51195108        case RSP_INS_MISS:
    51205109        {
    5121             if ( p_vci_ini_d.rspval.read() )
    5122             {
    5123                 if ( (p_vci_ini_d.rerror.read()&0x1) != 0 )  // error reported
     5110            if ( p_vci.rspval.read() )
     5111            {
     5112                if ( (p_vci.rerror.read()&0x1) != 0 )  // error reported
    51245113                {
    51255114                    r_vci_rsp_ins_error = true;
    5126                     if ( p_vci_ini_d.reop.read() ) r_vci_rsp_fsm = RSP_IDLE;
     5115                    if ( p_vci.reop.read() ) r_vci_rsp_fsm = RSP_IDLE;
    51275116                }
    51285117                else                                        // no error reported
     
    51355124                        r_vci_rsp_cpt                 = r_vci_rsp_cpt.read() + 1;
    51365125                        vci_rsp_fifo_icache_put       = true,
    5137                         vci_rsp_fifo_icache_data      = p_vci_ini_d.rdata.read();
    5138                         if ( p_vci_ini_d.reop.read() )
     5126                        vci_rsp_fifo_icache_data      = p_vci.rdata.read();
     5127                        if ( p_vci.reop.read() )
    51395128                        {
    51405129                            assert( (r_vci_rsp_cpt.read() == m_icache_words - 1) and
     
    51515140        case RSP_INS_UNC:
    51525141        {
    5153             if (p_vci_ini_d.rspval.read() )
    5154             {
    5155                 assert( p_vci_ini_d.reop.read() and
     5142            if (p_vci.rspval.read() )
     5143            {
     5144                assert( p_vci.reop.read() and
    51565145                "illegal VCI response packet for uncachable instruction");
    51575146
    5158                 if ( (p_vci_ini_d.rerror.read()&0x1) != 0 )  // error reported
     5147                if ( (p_vci.rerror.read()&0x1) != 0 )  // error reported
    51595148                {
    51605149                    r_vci_rsp_ins_error = true;
     
    51665155                    {
    51675156                        vci_rsp_fifo_icache_put       = true;
    5168                         vci_rsp_fifo_icache_data      = p_vci_ini_d.rdata.read();
     5157                        vci_rsp_fifo_icache_data      = p_vci.rdata.read();
    51695158                        r_vci_rsp_fsm = RSP_IDLE;
    51705159                    }
     
    51765165        case RSP_DATA_MISS:
    51775166        {
    5178             if ( p_vci_ini_d.rspval.read() )
    5179             {
    5180                 if ( (p_vci_ini_d.rerror.read()&0x1) != 0 )  // error reported
     5167            if ( p_vci.rspval.read() )
     5168            {
     5169                if ( (p_vci.rerror.read()&0x1) != 0 )  // error reported
    51815170                {
    51825171                    r_vci_rsp_data_error = true;
    5183                     if ( p_vci_ini_d.reop.read() ) r_vci_rsp_fsm = RSP_IDLE;
     5172                    if ( p_vci.reop.read() ) r_vci_rsp_fsm = RSP_IDLE;
    51845173                }
    51855174                else                                        // no error reported
     
    51925181                        r_vci_rsp_cpt                 = r_vci_rsp_cpt.read() + 1;
    51935182                        vci_rsp_fifo_dcache_put       = true,
    5194                         vci_rsp_fifo_dcache_data      = p_vci_ini_d.rdata.read();
    5195                         if ( p_vci_ini_d.reop.read() )
     5183                        vci_rsp_fifo_dcache_data      = p_vci.rdata.read();
     5184                        if ( p_vci.reop.read() )
    51965185                        {
    51975186                            assert( (r_vci_rsp_cpt.read() == m_dcache_words - 1) and
     
    52085197        case RSP_DATA_UNC:
    52095198        {
    5210             if (p_vci_ini_d.rspval.read() )
    5211             {
    5212                 assert( p_vci_ini_d.reop.read() and
     5199            if (p_vci.rspval.read() )
     5200            {
     5201                assert( p_vci.reop.read() and
    52135202                "illegal VCI response packet for uncachable read data");
    52145203
    5215                 if ( (p_vci_ini_d.rerror.read()&0x1) != 0 )  // error reported
     5204                if ( (p_vci.rerror.read()&0x1) != 0 )  // error reported
    52165205                {
    52175206                    r_vci_rsp_data_error = true;
     
    52235212                    {
    52245213                        vci_rsp_fifo_dcache_put       = true;
    5225                         vci_rsp_fifo_dcache_data      = p_vci_ini_d.rdata.read();
     5214                        vci_rsp_fifo_dcache_data      = p_vci.rdata.read();
    52265215                        r_vci_rsp_fsm = RSP_IDLE;
    52275216                    }
     
    52335222        case RSP_DATA_LL:
    52345223        {
    5235             if ( p_vci_ini_d.rspval.read() )
    5236             {
    5237                 if ( (p_vci_ini_d.rerror.read()&0x1) != 0 )  // error reported
     5224            if ( p_vci.rspval.read() )
     5225            {
     5226                if ( (p_vci.rerror.read()&0x1) != 0 )  // error reported
    52385227                {
    52395228                    r_vci_rsp_data_error = true;
     
    52445233                    if(r_vci_rsp_fifo_dcache.wok())
    52455234                    {
    5246                         assert(!p_vci_ini_d.reop.read() &&
     5235                        assert(!p_vci.reop.read() &&
    52475236                            "illegal VCI response packet for LL");
    52485237                        vci_rsp_fifo_dcache_put  = true;
    5249                         vci_rsp_fifo_dcache_data = p_vci_ini_d.rdata.read();
     5238                        vci_rsp_fifo_dcache_data = p_vci.rdata.read();
    52505239                        r_vci_rsp_cpt            = r_vci_rsp_cpt.read() + 1;
    52515240                    }
     
    52565245                    if(r_vci_rsp_fifo_dcache.wok())
    52575246                    {
    5258                         assert(p_vci_ini_d.reop.read() &&
     5247                        assert(p_vci.reop.read() &&
    52595248                            "illegal VCI response packet for LL");
    52605249                        vci_rsp_fifo_dcache_put  = true;
    5261                         vci_rsp_fifo_dcache_data = p_vci_ini_d.rdata.read();
     5250                        vci_rsp_fifo_dcache_data = p_vci.rdata.read();
    52625251                        r_vci_rsp_fsm            = RSP_IDLE;
    52635252                    }
     
    52705259        case RSP_DATA_WRITE:
    52715260        {
    5272             if (p_vci_ini_d.rspval.read())
    5273             {
    5274                 assert( p_vci_ini_d.reop.read() and
     5261            if (p_vci.rspval.read())
     5262            {
     5263                assert( p_vci.reop.read() and
    52755264                "a VCI response packet must contain one flit for a write transaction");
    52765265
    52775266                r_vci_rsp_fsm = RSP_IDLE;
    5278                 uint32_t   wbuf_index = p_vci_ini_d.rtrdid.read();
     5267                uint32_t   wbuf_index = p_vci.rtrdid.read();
    52795268                bool       cacheable  = r_wbuf.completed(wbuf_index);
    52805269                if ( not cacheable ) r_dcache_pending_unc_write = false;
    5281                 if ( (p_vci_ini_d.rerror.read()&0x1) != 0 ) r_iss.setWriteBerr();
     5270                if ( (p_vci.rerror.read()&0x1) != 0 ) r_iss.setWriteBerr();
    52825271            }
    52835272            break;
     
    55455534        case CC_RECEIVE_INVAL_HEADER:
    55465535        {
    5547             // sample updt tab index in the HEADER, than skip to second flit
     5536            // sample updt tab index in the HEADER, then skip to second flit
    55485537            uint64_t receive_data = p_dspin_in.data.read();
    55495538            // for data INVAL, wait for dcache to take the request
     
    56835672                                 vci_rsp_fifo_dcache_put,
    56845673                                 vci_rsp_fifo_dcache_data);
     5674
    56855675    ///////////////// updt FIFO update  //////////////////////
    56865676    //TODO check this
     
    57085698                         (r_vci_cmd_fsm.read() == CMD_DATA_SC );
    57095699
    5710     p_vci_ini_d.pktid  = 0;
    5711     p_vci_ini_d.srcid  = m_srcid_d;
    5712     p_vci_ini_d.cons   = is_sc_or_cas;
    5713     p_vci_ini_d.contig = not is_sc_or_cas;
    5714     p_vci_ini_d.wrap   = false;
    5715     p_vci_ini_d.clen   = 0;
    5716     p_vci_ini_d.cfixed = false;
     5700    p_vci.pktid  = 0;
     5701    p_vci.srcid  = m_srcid;
     5702    p_vci.cons   = is_sc_or_cas;
     5703    p_vci.contig = not is_sc_or_cas;
     5704    p_vci.wrap   = false;
     5705    p_vci.clen   = 0;
     5706    p_vci.cfixed = false;
    57175707
    57185708    switch ( r_vci_cmd_fsm.read() ) {
    57195709
    57205710    case CMD_IDLE:
    5721         p_vci_ini_d.cmdval  = false;
    5722         p_vci_ini_d.address = 0;
    5723         p_vci_ini_d.wdata   = 0;
    5724         p_vci_ini_d.be      = 0;
    5725         p_vci_ini_d.trdid   = 0;
    5726         p_vci_ini_d.pktid   = 0;
    5727         p_vci_ini_d.plen    = 0;
    5728         p_vci_ini_d.cmd     = vci_param::CMD_NOP;
    5729         p_vci_ini_d.eop     = false;
     5711        p_vci.cmdval  = false;
     5712        p_vci.address = 0;
     5713        p_vci.wdata   = 0;
     5714        p_vci.be      = 0;
     5715        p_vci.trdid   = 0;
     5716        p_vci.pktid   = 0;
     5717        p_vci.plen    = 0;
     5718        p_vci.cmd     = vci_param::CMD_NOP;
     5719        p_vci.eop     = false;
    57305720        break;
    57315721
    57325722    case CMD_INS_MISS:
    5733         p_vci_ini_d.cmdval  = true;
    5734         p_vci_ini_d.address = r_icache_vci_paddr.read() & m_icache_yzmask;
    5735         p_vci_ini_d.wdata   = 0;
    5736         p_vci_ini_d.be      = 0xF;
    5737         p_vci_ini_d.trdid   = 0;
    5738         p_vci_ini_d.pktid   = TYPE_READ_INS_MISS;
    5739         p_vci_ini_d.plen    = m_icache_words<<2;
    5740         p_vci_ini_d.cmd     = vci_param::CMD_READ;
    5741         p_vci_ini_d.eop     = true;
     5723        p_vci.cmdval  = true;
     5724        p_vci.address = r_icache_vci_paddr.read() & m_icache_yzmask;
     5725        p_vci.wdata   = 0;
     5726        p_vci.be      = 0xF;
     5727        p_vci.trdid   = 0;
     5728        p_vci.pktid   = TYPE_READ_INS_MISS;
     5729        p_vci.plen    = m_icache_words<<2;
     5730        p_vci.cmd     = vci_param::CMD_READ;
     5731        p_vci.eop     = true;
    57425732        break;
    57435733
    57445734    case CMD_INS_UNC:
    5745         p_vci_ini_d.cmdval  = true;
    5746         p_vci_ini_d.address = r_icache_vci_paddr.read() & ~0x3;
    5747         p_vci_ini_d.wdata   = 0;
    5748         p_vci_ini_d.be      = 0xF;
    5749         p_vci_ini_d.trdid   = 0;
    5750         p_vci_ini_d.pktid   = TYPE_READ_INS_UNC;
    5751         p_vci_ini_d.plen    = 4;
    5752         p_vci_ini_d.cmd     = vci_param::CMD_READ;
    5753         p_vci_ini_d.eop     = true;
     5735        p_vci.cmdval  = true;
     5736        p_vci.address = r_icache_vci_paddr.read() & ~0x3;
     5737        p_vci.wdata   = 0;
     5738        p_vci.be      = 0xF;
     5739        p_vci.trdid   = 0;
     5740        p_vci.pktid   = TYPE_READ_INS_UNC;
     5741        p_vci.plen    = 4;
     5742        p_vci.cmd     = vci_param::CMD_READ;
     5743        p_vci.eop     = true;
    57545744        break;
    57555745
    57565746    case CMD_DATA_MISS:
    5757         p_vci_ini_d.cmdval  = true;
    5758         p_vci_ini_d.address = r_dcache_vci_paddr.read() & m_dcache_yzmask;
    5759         p_vci_ini_d.wdata   = 0;
    5760         p_vci_ini_d.be      = 0xF;
    5761         p_vci_ini_d.trdid   = 0;
    5762         p_vci_ini_d.pktid   = TYPE_READ_DATA_MISS;
    5763         p_vci_ini_d.plen    = m_dcache_words << 2;
    5764         p_vci_ini_d.cmd     = vci_param::CMD_READ;
    5765         p_vci_ini_d.eop     = true;
     5747        p_vci.cmdval  = true;
     5748        p_vci.address = r_dcache_vci_paddr.read() & m_dcache_yzmask;
     5749        p_vci.wdata   = 0;
     5750        p_vci.be      = 0xF;
     5751        p_vci.trdid   = 0;
     5752        p_vci.pktid   = TYPE_READ_DATA_MISS;
     5753        p_vci.plen    = m_dcache_words << 2;
     5754        p_vci.cmd     = vci_param::CMD_READ;
     5755        p_vci.eop     = true;
    57665756        break;
    57675757
    57685758    case CMD_DATA_UNC:
    5769         p_vci_ini_d.cmdval  = true;
    5770         p_vci_ini_d.address = r_dcache_vci_paddr.read() & ~0x3;
    5771         p_vci_ini_d.wdata   = 0;
    5772         p_vci_ini_d.be      = r_dcache_vci_unc_be.read();
    5773         p_vci_ini_d.trdid   = 0;
    5774         p_vci_ini_d.pktid   = TYPE_READ_DATA_UNC;
    5775         p_vci_ini_d.plen    = 4;
    5776         p_vci_ini_d.cmd     = vci_param::CMD_READ;
    5777         p_vci_ini_d.eop     = true;
     5759        p_vci.cmdval  = true;
     5760        p_vci.address = r_dcache_vci_paddr.read() & ~0x3;
     5761        p_vci.wdata   = 0;
     5762        p_vci.be      = r_dcache_vci_unc_be.read();
     5763        p_vci.trdid   = 0;
     5764        p_vci.pktid   = TYPE_READ_DATA_UNC;
     5765        p_vci.plen    = 4;
     5766        p_vci.cmd     = vci_param::CMD_READ;
     5767        p_vci.eop     = true;
    57785768        break;
    57795769
    57805770    case CMD_DATA_WRITE:
    5781         p_vci_ini_d.cmdval  = true;
    5782         p_vci_ini_d.address = r_wbuf.getAddress(r_vci_cmd_cpt.read()) & ~0x3;
    5783         p_vci_ini_d.wdata   = r_wbuf.getData(r_vci_cmd_cpt.read());
    5784         p_vci_ini_d.be      = r_wbuf.getBe(r_vci_cmd_cpt.read());
    5785         p_vci_ini_d.trdid   = r_wbuf.getIndex();
    5786         p_vci_ini_d.pktid   = TYPE_WRITE;
    5787         p_vci_ini_d.plen    = (r_vci_cmd_max.read() - r_vci_cmd_min.read() + 1) << 2;
    5788         p_vci_ini_d.cmd     = vci_param::CMD_WRITE;
    5789         p_vci_ini_d.eop     = (r_vci_cmd_cpt.read() == r_vci_cmd_max.read());
     5771        p_vci.cmdval  = true;
     5772        p_vci.address = r_wbuf.getAddress(r_vci_cmd_cpt.read()) & ~0x3;
     5773        p_vci.wdata   = r_wbuf.getData(r_vci_cmd_cpt.read());
     5774        p_vci.be      = r_wbuf.getBe(r_vci_cmd_cpt.read());
     5775        p_vci.trdid   = r_wbuf.getIndex();
     5776        p_vci.pktid   = TYPE_WRITE;
     5777        p_vci.plen    = (r_vci_cmd_max.read() - r_vci_cmd_min.read() + 1) << 2;
     5778        p_vci.cmd     = vci_param::CMD_WRITE;
     5779        p_vci.eop     = (r_vci_cmd_cpt.read() == r_vci_cmd_max.read());
    57905780        break;
    57915781
    57925782    case CMD_DATA_LL:
    5793         p_vci_ini_d.cmdval  = true;
    5794         p_vci_ini_d.address = r_dcache_vci_paddr.read() & ~0x3;
    5795         p_vci_ini_d.wdata   = 0;
    5796         p_vci_ini_d.be      = 0xF;
    5797         p_vci_ini_d.trdid   = 0;
    5798         p_vci_ini_d.pktid   = TYPE_LL;
    5799         p_vci_ini_d.plen    = 8;
    5800         p_vci_ini_d.cmd     = vci_param::CMD_LOCKED_READ;
    5801         p_vci_ini_d.eop     = true;
     5783        p_vci.cmdval  = true;
     5784        p_vci.address = r_dcache_vci_paddr.read() & ~0x3;
     5785        p_vci.wdata   = 0;
     5786        p_vci.be      = 0xF;
     5787        p_vci.trdid   = 0;
     5788        p_vci.pktid   = TYPE_LL;
     5789        p_vci.plen    = 8;
     5790        p_vci.cmd     = vci_param::CMD_LOCKED_READ;
     5791        p_vci.eop     = true;
    58025792        break;
    58035793
    58045794    case CMD_DATA_SC:
    5805         p_vci_ini_d.cmdval  = true;
    5806         p_vci_ini_d.address = r_dcache_vci_paddr.read() & ~0x3;
    5807         if ( r_vci_cmd_cpt.read() == 0 ) p_vci_ini_d.wdata = r_dcache_llsc_key.read();
    5808         else                             p_vci_ini_d.wdata = r_dcache_vci_sc_data.read();
    5809         p_vci_ini_d.be      = 0xF;
    5810         p_vci_ini_d.trdid   = 0;
    5811         p_vci_ini_d.pktid   = TYPE_SC;
    5812         p_vci_ini_d.plen    = 8;
    5813         p_vci_ini_d.cmd     = vci_param::CMD_NOP;
    5814         p_vci_ini_d.eop     = (r_vci_cmd_cpt.read() == 1);
     5795        p_vci.cmdval  = true;
     5796        p_vci.address = r_dcache_vci_paddr.read() & ~0x3;
     5797        if ( r_vci_cmd_cpt.read() == 0 ) p_vci.wdata = r_dcache_llsc_key.read();
     5798        else                             p_vci.wdata = r_dcache_vci_sc_data.read();
     5799        p_vci.be      = 0xF;
     5800        p_vci.trdid   = 0;
     5801        p_vci.pktid   = TYPE_SC;
     5802        p_vci.plen    = 8;
     5803        p_vci.cmd     = vci_param::CMD_NOP;
     5804        p_vci.eop     = (r_vci_cmd_cpt.read() == 1);
    58155805        break;
    58165806
    58175807    case CMD_DATA_CAS:
    5818         p_vci_ini_d.cmdval  = true;
    5819         p_vci_ini_d.address = r_dcache_vci_paddr.read() & ~0x3;
    5820         if ( r_vci_cmd_cpt.read() == 0 ) p_vci_ini_d.wdata = r_dcache_vci_cas_old.read();
    5821         else                             p_vci_ini_d.wdata = r_dcache_vci_cas_new.read();
    5822         p_vci_ini_d.be      = 0xF;
    5823         p_vci_ini_d.trdid   = 0;
    5824         p_vci_ini_d.pktid   = TYPE_CAS;
    5825         p_vci_ini_d.plen    = 8;
    5826         p_vci_ini_d.cmd     = vci_param::CMD_NOP;
    5827         p_vci_ini_d.eop     = (r_vci_cmd_cpt.read() == 1);
     5808        p_vci.cmdval  = true;
     5809        p_vci.address = r_dcache_vci_paddr.read() & ~0x3;
     5810        if ( r_vci_cmd_cpt.read() == 0 ) p_vci.wdata = r_dcache_vci_cas_old.read();
     5811        else                             p_vci.wdata = r_dcache_vci_cas_new.read();
     5812        p_vci.be      = 0xF;
     5813        p_vci.trdid   = 0;
     5814        p_vci.pktid   = TYPE_CAS;
     5815        p_vci.plen    = 8;
     5816        p_vci.cmd     = vci_param::CMD_NOP;
     5817        p_vci.eop     = (r_vci_cmd_cpt.read() == 1);
    58285818        break;
    58295819    } // end switch r_vci_cmd_fsm
    58305820
    58315821    // VCI initiator response on the direct network
    5832     // it depends on the VCI RSP state
     5822    // it depends on the VCI_RSP FSM
    58335823
    58345824    switch (r_vci_rsp_fsm.read() )
    58355825    {
    5836         case RSP_DATA_WRITE : p_vci_ini_d.rspack = true; break;
    5837         case RSP_INS_MISS   : p_vci_ini_d.rspack = r_vci_rsp_fifo_icache.wok(); break;
    5838         case RSP_INS_UNC    : p_vci_ini_d.rspack = r_vci_rsp_fifo_icache.wok(); break;
    5839         case RSP_DATA_MISS  : p_vci_ini_d.rspack = r_vci_rsp_fifo_dcache.wok(); break;
    5840         case RSP_DATA_UNC   : p_vci_ini_d.rspack = r_vci_rsp_fifo_dcache.wok(); break;
    5841         case RSP_DATA_LL    : p_vci_ini_d.rspack = r_vci_rsp_fifo_dcache.wok(); break;
    5842         case RSP_IDLE       : p_vci_ini_d.rspack = false; break;
     5826        case RSP_DATA_WRITE : p_vci.rspack = true; break;
     5827        case RSP_INS_MISS   : p_vci.rspack = r_vci_rsp_fifo_icache.wok(); break;
     5828        case RSP_INS_UNC    : p_vci.rspack = r_vci_rsp_fifo_icache.wok(); break;
     5829        case RSP_DATA_MISS  : p_vci.rspack = r_vci_rsp_fifo_dcache.wok(); break;
     5830        case RSP_DATA_UNC   : p_vci.rspack = r_vci_rsp_fifo_dcache.wok(); break;
     5831        case RSP_DATA_LL    : p_vci.rspack = r_vci_rsp_fifo_dcache.wok(); break;
     5832        case RSP_IDLE       : p_vci.rspack = false; break;
    58435833    } // end switch r_vci_rsp_fsm
    58445834
    5845     /////////////////
    5846     // CC_SEND FSM //
    5847     /////////////////
     5835   
     5836    // Send coherence packets on DSPIN L2M
     5837    // it depends on the CC_SEND FSM
     5838
    58485839    uint64_t dspin_send_data = 0;
    58495840    switch ( r_cc_send_fsm.read() )
    58505841    {
    5851         ///////////////////////////
     5842        //////////////////
    58525843        case CC_SEND_IDLE:
    58535844        {
     
    58555846            break;
    58565847        }
    5857         ///////////////////////////
     5848        ///////////////////////
    58585849        case CC_SEND_CLEANUP_1:
    58595850        {
    58605851            // initialize dspin send data
    5861             DspinDhccpParam::dspin_set(dspin_send_data,0,DspinDhccpParam::FROM_L1_EOP);
    5862             DspinDhccpParam::dspin_set(dspin_send_data,m_srcid_c,DspinDhccpParam::CLEANUP_SRCID);
    5863             DspinDhccpParam::dspin_set(dspin_send_data,0,DspinDhccpParam::FROM_L1_BC);
    5864             // dcache active request
    5865             if(r_cc_send_last_client.read() == 0)
    5866             {
    5867                 // compute global id
    5868                 uint32_t nline_size = vci_param::N - (uint32_log2(m_dcache_words)) - (uint32_log2(vci_param::B));
    5869                 uint64_t global_id = (uint64_t) r_dcache_cc_send_nline.read();
    5870                 global_id >>= (nline_size - m_x_width - m_y_width) << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width);
    5871 
     5852            DspinDhccpParam::dspin_set(dspin_send_data,
     5853                                       0,
     5854                                       DspinDhccpParam::FROM_L1_EOP);
     5855            DspinDhccpParam::dspin_set(dspin_send_data,
     5856                                       m_cc_global_id,
     5857                                       DspinDhccpParam::CLEANUP_SRCID);
     5858            DspinDhccpParam::dspin_set(dspin_send_data,
     5859                                       0,
     5860                                       DspinDhccpParam::FROM_L1_BC);
     5861
     5862            if(r_cc_send_last_client.read() == 0) // dcache active request
     5863            {
     5864                uint64_t dest = (uint64_t)r_dcache_cc_send_nline.read()
     5865                                >> (m_nline_width - m_x_width - m_y_width)
     5866                                << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width);
     5867 
    58725868                DspinDhccpParam::dspin_set(dspin_send_data,
    5873                     global_id,
    5874                     DspinDhccpParam::CLEANUP_DEST);
     5869                                           dest,
     5870                                           DspinDhccpParam::CLEANUP_DEST);
    58755871
    58765872                DspinDhccpParam::dspin_set(dspin_send_data,
    5877                     r_dcache_cc_send_nline.read() & 0x300000000ULL,
    5878                     DspinDhccpParam::CLEANUP_NLINE_MSB);
     5873                                           r_dcache_cc_send_nline.read() & 0x300000000ULL,
     5874                                           DspinDhccpParam::CLEANUP_NLINE_MSB);
    58795875
    58805876                DspinDhccpParam::dspin_set(dspin_send_data,
    5881                     r_dcache_cc_send_way.read(),
    5882                     DspinDhccpParam::CLEANUP_WAY_INDEX);
     5877                                           r_dcache_cc_send_way.read(),
     5878                                           DspinDhccpParam::CLEANUP_WAY_INDEX);
    58835879
    58845880                DspinDhccpParam::dspin_set(dspin_send_data,
    5885                     DspinDhccpParam::TYPE_CLEANUP_DATA,
    5886                     DspinDhccpParam::FROM_L1_TYPE);
    5887             }
    5888             // icache active request
    5889             else
    5890             {
    5891                 // compute global id
    5892                 uint32_t nline_size = vci_param::N - (uint32_log2(m_icache_words)) - (uint32_log2(vci_param::B));
    5893                 uint64_t global_id = (uint64_t) r_icache_cc_send_nline.read();
    5894                 global_id >>= (nline_size - m_x_width - m_y_width) << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width);
     5881                                           DspinDhccpParam::TYPE_CLEANUP_DATA,
     5882                                           DspinDhccpParam::FROM_L1_TYPE);
     5883            }
     5884            else                                // icache active request
     5885            {
     5886                uint64_t dest = (uint64_t)r_icache_cc_send_nline.read()
     5887                                >> (m_nline_width - m_x_width - m_y_width)
     5888                                << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width);
    58955889
    58965890                DspinDhccpParam::dspin_set(dspin_send_data,
    5897                     global_id,
    5898                     DspinDhccpParam::CLEANUP_DEST);
     5891                                           dest,
     5892                                           DspinDhccpParam::CLEANUP_DEST);
    58995893
    59005894                DspinDhccpParam::dspin_set(dspin_send_data,
    5901                     r_icache_cc_send_nline.read() & 0x300000000ULL,
    5902                     DspinDhccpParam::CLEANUP_NLINE_MSB);
     5895                                           r_icache_cc_send_nline.read() & 0x300000000ULL,
     5896                                           DspinDhccpParam::CLEANUP_NLINE_MSB);
    59035897
    59045898                DspinDhccpParam::dspin_set(dspin_send_data,
    5905                     r_icache_cc_send_way.read(),
    5906                     DspinDhccpParam::CLEANUP_WAY_INDEX);
     5899                                           r_icache_cc_send_way.read(),
     5900                                           DspinDhccpParam::CLEANUP_WAY_INDEX);
    59075901
    59085902                DspinDhccpParam::dspin_set(dspin_send_data,
    5909                     DspinDhccpParam::TYPE_CLEANUP_INST,
    5910                     DspinDhccpParam::FROM_L1_TYPE);
     5903                                           DspinDhccpParam::TYPE_CLEANUP_INST,
     5904                                           DspinDhccpParam::FROM_L1_TYPE);
    59115905            }
    59125906            // send flit
     
    59155909            break;
    59165910        }
    5917         ///////////////////////////
     5911        ///////////////////////
    59185912        case CC_SEND_CLEANUP_2:
    59195913        {
    59205914            // initialize dspin send data
    5921             DspinDhccpParam::dspin_set(dspin_send_data,1,DspinDhccpParam::FROM_L1_EOP);
    5922             // dcache active request
    5923             if(r_cc_send_last_client.read() == 0)
     5915            DspinDhccpParam::dspin_set(dspin_send_data,
     5916                                       1,
     5917                                       DspinDhccpParam::FROM_L1_EOP);
     5918
     5919            if(r_cc_send_last_client.read() == 0) // dcache active request
    59245920            {
    59255921                DspinDhccpParam::dspin_set(dspin_send_data,
    5926                     r_dcache_cc_send_nline.read() & 0xFFFFFFFFULL,
    5927                     DspinDhccpParam::CLEANUP_NLINE_LSB);
    5928             }
    5929             // icache active request
    5930             else
     5922                                           r_dcache_cc_send_nline.read() & 0xFFFFFFFFULL,
     5923                                           DspinDhccpParam::CLEANUP_NLINE_LSB);
     5924            }
     5925            else                                  // icache active request
    59315926            {
    59325927                DspinDhccpParam::dspin_set(dspin_send_data,
    5933                     r_icache_cc_send_nline.read() & 0xFFFFFFFFULL,
    5934                     DspinDhccpParam::CLEANUP_NLINE_LSB);
     5928                                           r_icache_cc_send_nline.read() & 0xFFFFFFFFULL,
     5929                                           DspinDhccpParam::CLEANUP_NLINE_LSB);
    59355930            }
    59365931            // send flit
     
    59395934            break;
    59405935        }
    5941         ///////////////////////////
     5936        ///////////////////////
    59425937        case CC_SEND_MULTI_ACK:
    59435938        {
    59445939            // initialize dspin send data
    5945             DspinDhccpParam::dspin_set(dspin_send_data,1,DspinDhccpParam::FROM_L1_EOP);
    5946             DspinDhccpParam::dspin_set(dspin_send_data,0,DspinDhccpParam::FROM_L1_BC);
    59475940            DspinDhccpParam::dspin_set(dspin_send_data,
    5948                 DspinDhccpParam::TYPE_MULTI_ACK,
    5949                 DspinDhccpParam::FROM_L1_TYPE);
    5950             // dcache active request
    5951             if(r_cc_send_last_client.read() == 0)
    5952             {
    5953                 // compute global id
    5954                 uint32_t nline_size = vci_param::N - (uint32_log2(m_dcache_words)) - (uint32_log2(vci_param::B));
    5955                 uint64_t global_id = (uint64_t) r_dcache_cc_send_nline.read();
    5956                 global_id >>= (nline_size - m_x_width - m_y_width) << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width);
    5957 
     5941                                       1,
     5942                                       DspinDhccpParam::FROM_L1_EOP);
     5943            DspinDhccpParam::dspin_set(dspin_send_data,
     5944                                       0,
     5945                                       DspinDhccpParam::FROM_L1_BC);
     5946            DspinDhccpParam::dspin_set(dspin_send_data,
     5947                                       DspinDhccpParam::TYPE_MULTI_ACK,
     5948                                       DspinDhccpParam::FROM_L1_TYPE);
     5949
     5950            if(r_cc_send_last_client.read() == 0) // dcache active request
     5951            {
     5952                uint64_t dest = (uint64_t)r_dcache_cc_send_nline.read()
     5953                                >> (m_nline_width - m_x_width - m_y_width)
     5954                                << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width);
     5955 
    59585956                DspinDhccpParam::dspin_set(dspin_send_data,
    5959                     global_id,
    5960                     DspinDhccpParam::MULTI_ACK_DEST);
     5957                                           dest,
     5958                                           DspinDhccpParam::MULTI_ACK_DEST);
    59615959
    59625960                DspinDhccpParam::dspin_set(dspin_send_data,
    5963                     r_dcache_cc_send_updt_tab_idx.read(),
    5964                     DspinDhccpParam::MULTI_ACK_UPDT_INDEX);
    5965             }
    5966             // icache active request
    5967             else
    5968             {
    5969                 // compute global id
    5970                 uint32_t nline_size = vci_param::N - (uint32_log2(m_icache_words)) - (uint32_log2(vci_param::B));
    5971                 uint64_t global_id = (uint64_t) r_icache_cc_send_nline.read();
    5972                 global_id >>= (nline_size - m_x_width - m_y_width) << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width);
     5961                                           r_dcache_cc_send_updt_tab_idx.read(),
     5962                                           DspinDhccpParam::MULTI_ACK_UPDT_INDEX);
     5963            }
     5964            else                                    // icache active request
     5965            {
     5966                uint64_t dest = (uint64_t)r_icache_cc_send_nline.read()
     5967                                >> (m_nline_width - m_x_width - m_y_width)
     5968                                << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width);
     5969 
    59735970
    59745971                DspinDhccpParam::dspin_set(dspin_send_data,
    5975                     global_id,
    5976                     DspinDhccpParam::MULTI_ACK_DEST);
     5972                                           dest,
     5973                                           DspinDhccpParam::MULTI_ACK_DEST);
    59775974
    59785975                DspinDhccpParam::dspin_set(dspin_send_data,
    5979                     r_icache_cc_send_updt_tab_idx.read(),
    5980                     DspinDhccpParam::MULTI_ACK_UPDT_INDEX);
     5976                                           r_icache_cc_send_updt_tab_idx.read(),
     5977                                           DspinDhccpParam::MULTI_ACK_UPDT_INDEX);
    59815978            }
    59825979            // send flit
     
    59875984    } // end switch CC_SEND FSM
    59885985
    5989     ////////////////////
    5990     // CC_RECEIVE FSM //
    5991     ////////////////////
     5986    // Receive coherence packets
     5987    // It depends on the CC_RECEIVE FSM
     5988
    59925989    switch( r_cc_receive_fsm.read() )
    59935990    {
  • branches/v5/modules/vci_mem_cache_dspin_coherence/caba/source/include/vci_mem_cache_dspin_coherence.h

    r336 r346  
    326326
    327327      // debug variables (for each FSM)
    328       size_t       m_debug_start_cycle;
    329       bool         m_debug_ok;
    330328      bool         m_debug_global;
    331329      bool         m_debug_tgt_cmd_fsm;
     
    379377      soclib::caba::VciTarget<vci_param>    p_vci_tgt;
    380378      soclib::caba::VciInitiator<vci_param> p_vci_ixr;
    381 
    382379      soclib::caba::DspinInput<33>          p_dspin_in;
    383380      soclib::caba::DspinOutput<40>         p_dspin_out;
     
    385382      VciMemCache(
    386383          sc_module_name name,                                // Instance Name
    387           const soclib::common::MappingTable &mtp,            // Mapping table for primary requets
    388           const soclib::common::MappingTable &mtc,            // Mapping table for coherence requets
    389           const soclib::common::MappingTable &mtx,            // Mapping table for XRAM
    390           const soclib::common::IntTab &vci_ixr_index,        // VCI port to XRAM (initiator)
    391           const soclib::common::IntTab &vci_ini_index,        // VCI port to PROC (initiator)
    392           const soclib::common::IntTab &vci_tgt_index,        // VCI port to PROC (target)
    393           const soclib::common::IntTab &vci_tgt_index_cleanup,// VCI port to PROC (target) for cleanup
    394           size_t nways,                                       // Number of ways per set
    395           size_t nsets,                                       // Number of sets
    396           size_t nwords,                                      // Number of words per line
    397           size_t heap_size=1024,                              // Size of the heap
    398           size_t transaction_tab_lines=TRANSACTION_TAB_LINES, // Size of the TRT
    399           size_t update_tab_lines=UPDATE_TAB_LINES,           // Size of the UPT
    400           size_t debug_start_cycle=0,
    401           bool   debug_ok=false);
     384          const soclib::common::MappingTable &mtp,            // Mapping table for direct network
     385          const soclib::common::MappingTable &mtx,            // Mapping table for external network
     386          const soclib::common::IntTab       &srcid_x,        // global index on external network
     387          const soclib::common::IntTab       &tgtid_d,        // global index on direct network
     388          const size_t                       cc_global_id,    // global index on cc network
     389          const size_t                       nways,           // Number of ways per set
     390          const size_t                       nsets,           // Number of sets
     391          const size_t                       nwords,          // Number of words per line
     392          const size_t                       max_copies,      // max number of copies in heap
     393          const size_t                       heap_size=1024,  // number of heap entries
     394          const size_t                       trt_lines=TRANSACTION_TAB_LINES,
     395          const size_t                       upt_lines=UPDATE_TAB_LINES,       
     396          const size_t                       debug_start_cycle=0,
     397          const bool                         debug_ok=false );
    402398
    403399      ~VciMemCache();
     
    417413
    418414      // Component attributes
    419       std::list<soclib::common::Segment> m_seglist;  // memory cached into the cache
    420       std::list<soclib::common::Segment> m_cseglist; // coherence segment for the cache
    421 
    422       const size_t    m_initiators; // Number of initiators
    423       const size_t    m_heap_size;  // Size of the heap
    424       const size_t    m_ways;       // Number of ways in a set
    425       const size_t    m_sets;       // Number of cache sets
    426       const size_t    m_words;      // Number of words in a line
    427       const size_t    m_srcid_ixr;  // Srcid for requests to XRAM
    428       const size_t    m_srcid_ini;  // Srcid for requests to processors
    429 
    430       uint32_t        m_transaction_tab_lines;
    431       TransactionTab  m_transaction_tab;  // xram transaction table
    432       uint32_t        m_update_tab_lines;
    433       UpdateTab       m_update_tab;       // pending update & invalidate
    434       CacheDirectory  m_cache_directory;  // data cache directory
    435       CacheData       m_cache_data;       // data array[set][way][word]
    436       HeapDirectory   m_heap;             // heap for copies
     415      std::list<soclib::common::Segment> m_seglist;          // segments allocated to memcache
     416      size_t                             m_nseg;             // number of segments
     417      soclib::common::Segment            **m_seg;            // array of segments pointers
     418      const size_t                       m_srcid_x;          // global index on external network
     419      const size_t                       m_initiators;       // Number of initiators
     420      const size_t                       m_heap_size;        // Size of the heap
     421      const size_t                       m_ways;             // Number of ways in a set
     422      const size_t                       m_sets;             // Number of cache sets
     423      const size_t                       m_words;            // Number of words in a line
     424      const size_t                       m_cc_global_id;     // global_index on cc network
     425      size_t                             m_debug_start_cycle;
     426      bool                               m_debug_ok;
     427      uint32_t                           m_trt_lines;
     428      TransactionTab                     m_trt;              // xram transaction table
     429      uint32_t                           m_upt_lines;
     430      UpdateTab                          m_upt;              // pending update & invalidate
     431      CacheDirectory                     m_cache_directory;  // data cache directory
     432      CacheData                          m_cache_data;       // data array[set][way][word]
     433      HeapDirectory                      m_heap;             // heap for copies
     434      size_t                             m_max_copies;       // max number of copies in heap
    437435      GenericLLSCGlobalTable
    438       <
    439         32  ,   // desired number of slots
    440         4096,   // number of processors in the system
    441         8000,   // registratioçn life span (in # of LL operations)
    442         typename vci_param::fast_addr_t // address type
    443       >
    444       m_llsc_table;       // ll/sc global registration table
     436      < 32  ,                              // number of slots
     437        4096,                              // number of processors in the system
     438        8000,                              // registratioçn life span (in # of LL operations)
     439        typename vci_param::fast_addr_t >  // address type
     440                                         m_llsc_table;       // ll/sc global registration table
    445441
    446442      // adress masks
    447       const soclib::common::AddressMaskingTable<vci_addr_t> m_x;
    448       const soclib::common::AddressMaskingTable<vci_addr_t> m_y;
    449       const soclib::common::AddressMaskingTable<vci_addr_t> m_z;
    450       const soclib::common::AddressMaskingTable<vci_addr_t> m_nline;
     443      const soclib::common::AddressMaskingTable<vci_addr_t>   m_x;
     444      const soclib::common::AddressMaskingTable<vci_addr_t>   m_y;
     445      const soclib::common::AddressMaskingTable<vci_addr_t>   m_z;
     446      const soclib::common::AddressMaskingTable<vci_addr_t>   m_nline;
    451447
    452448      // broadcast address
    453       uint32_t m_broadcast_address;
    454 
    455       //////////////////////////////////////////////////
    456       // Others registers
    457       //////////////////////////////////////////////////
    458       sc_signal<size_t> r_copies_limit; // Limit of the number of copies for one line
    459       sc_signal<size_t> xxx_count;
     449      uint32_t                                                m_broadcast_address;
    460450
    461451      //////////////////////////////////////////////////
     
    495485      sc_signal<int>         r_tgt_cmd_fsm;
    496486
    497       size_t                   m_nseg;
    498       size_t                   m_ncseg;
    499       soclib::common::Segment  **m_seg;
    500       soclib::common::Segment  **m_cseg;
    501487      ///////////////////////////////////////////////////////
    502488      // Registers controlled by the READ fsm
  • branches/v5/modules/vci_mem_cache_dspin_coherence/caba/source/src/vci_mem_cache_dspin_coherence.cpp

    r339 r346  
    11/* -*- c++ -*-
     2*
    23* File       : vci_mem_cache.cpp
    34* Date       : 30/10/2008
     
    275276  VciMemCache<vci_param>
    276277
    277 using soclib::common::uint32_log2;
     278using namespace soclib::common;
    278279
    279280////////////////////////////////
     
    282283
    283284tmpl(/**/) ::VciMemCache(
    284   sc_module_name name,
    285   const soclib::common::MappingTable &mtp,
    286   const soclib::common::MappingTable &mtc,
    287   const soclib::common::MappingTable &mtx,
    288   const soclib::common::IntTab &vci_ixr_index,
    289   const soclib::common::IntTab &vci_ini_index,
    290   const soclib::common::IntTab &vci_tgt_index,
    291   const soclib::common::IntTab &vci_tgt_index_cleanup,
    292   size_t nways,                 // number of ways per set
    293   size_t nsets,                 // number of cache sets
    294   size_t nwords,                // number of words in cache line
    295   size_t heap_size,             // number of heap entries
    296   size_t transaction_tab_lines, // number of TRT entries
    297   size_t update_tab_lines,      // number of UPT entries
    298   size_t debug_start_cycle,
    299   bool   debug_ok)
     285  sc_module_name      name,
     286  const MappingTable  &mtp,              // mapping table for direct network
     287  const MappingTable  &mtx,              // mapping table for external network
     288  const IntTab        &srcid_x,          // global index on external network
     289  const IntTab        &tgtid_d,          // global index on direct network
     290  const size_t        cc_global_id,      // global index on cc network
     291  const size_t        nways,             // number of ways per set
     292  const size_t        nsets,             // number of associative sets
     293  const size_t        nwords,            // number of words in cache line
     294  const size_t        max_copies,        // max number of copies in heap
     295  const size_t        heap_size,         // number of heap entries
     296  const size_t        trt_lines,         // number of TRT entries
     297  const size_t        upt_lines,         // number of UPT entries
     298  const size_t        debug_start_cycle,
     299  const bool          debug_ok)
    300300
    301301  : soclib::caba::BaseModule(name),
    302302
    303     m_debug_start_cycle(debug_start_cycle),
    304     m_debug_ok(debug_ok),
    305 
    306     p_clk("clk"),
    307     p_resetn("resetn"),
    308     p_vci_tgt("vci_tgt"),
    309     p_vci_ixr("vci_ixr"),
    310     p_dspin_in("dspin_tgt"),
    311     p_dspin_out("cc_send"),
    312 
    313     m_seglist(mtp.getSegmentList(vci_tgt_index)),
    314     m_cseglist(mtc.getSegmentList(vci_tgt_index_cleanup)),
    315 
    316     m_initiators(1 << vci_param::S),
    317     m_heap_size(heap_size),
    318     m_ways(nways),
    319     m_sets(nsets),
    320     m_words(nwords),
    321     m_srcid_ixr(mtx.indexForId(vci_ixr_index)),
    322     m_srcid_ini(mtc.indexForId(vci_ini_index)),
    323     m_transaction_tab_lines(transaction_tab_lines),
    324     m_transaction_tab(transaction_tab_lines, nwords),
    325     m_update_tab_lines(update_tab_lines),
    326     m_update_tab(update_tab_lines),
     303    p_clk( "p_clk" ),
     304    p_resetn( "p_resetn" ),
     305    p_vci_tgt( "p_vci_tgt" ),
     306    p_vci_ixr( "p_vci_ixr" ),
     307    p_dspin_in( "p_dspin_in" ),
     308    p_dspin_out( "p_dspin_out" ),
     309
     310    m_seglist( mtp.getSegmentList(tgtid_d) ),
     311    m_nseg( 0 ),
     312    m_srcid_x( mtx.indexForId(srcid_x) ),
     313    m_initiators( 1 << vci_param::S ),
     314    m_heap_size( heap_size ),
     315    m_ways( nways ),
     316    m_sets( nsets ),
     317    m_words( nwords ),
     318    m_cc_global_id( cc_global_id ),
     319    m_debug_start_cycle( debug_start_cycle ),
     320    m_debug_ok( debug_ok ),
     321    m_trt_lines(trt_lines),
     322    m_trt(trt_lines, nwords),
     323    m_upt_lines(upt_lines),
     324    m_upt(upt_lines),
    327325    m_cache_directory(nways, nsets, nwords, vci_param::N),
    328326    m_cache_data(nways, nsets, nwords),
    329327    m_heap(m_heap_size),
     328    m_max_copies( max_copies ),
    330329    m_llsc_table(),
    331330
     
    368367    r_tgt_cmd_fsm("r_tgt_cmd_fsm"),
    369368
    370     m_nseg(0),
    371     m_ncseg(0),
    372 
    373369    r_read_fsm("r_read_fsm"),
    374370
     
    416412    r_alloc_heap_reset_cpt("r_alloc_heap_reset_cpt")
    417413{
    418   assert(IS_POW_OF_2(nsets));
    419   assert(IS_POW_OF_2(nwords));
    420   assert(IS_POW_OF_2(nways));
    421   assert(nsets);
    422   assert(nwords);
    423   assert(nways);
    424 
    425   // check Transaction table size
    426   assert((uint32_log2(transaction_tab_lines) <= vci_param::T) and
     414    assert(IS_POW_OF_2(nsets));
     415    assert(IS_POW_OF_2(nwords));
     416    assert(IS_POW_OF_2(nways));
     417    assert(nsets);
     418    assert(nwords);
     419    assert(nways);
     420
     421    // check Transaction table size
     422    assert((uint32_log2(trt_lines) <= vci_param::T) and
    427423         "Need more bits for VCI TRDID field");
    428424
    429   // Get the segments associated to the MemCache
    430   std::list<soclib::common::Segment>::iterator seg;
    431   size_t i;
    432 
    433   for(seg = m_seglist.begin(); seg != m_seglist.end() ; seg++)
    434   {
    435     m_nseg++;
    436   }
    437   for(seg = m_cseglist.begin(); seg != m_cseglist.end() ; seg++)
    438   {
    439     m_ncseg++;
    440   }
    441 
    442   m_seg = new soclib::common::Segment*[m_nseg];
    443 
    444   i = 0;
    445   for(seg = m_seglist.begin() ; seg != m_seglist.end() ; seg++)
    446   {
    447     m_seg[i] = & (*seg);
    448     i++;
    449   }
    450 
    451   m_cseg = new soclib::common::Segment*[m_ncseg];
    452 
    453   i = 0;
    454   for(seg = m_cseglist.begin() ; seg != m_cseglist.end() ; seg++)
    455   {
    456     m_cseg[i] = & (*seg);
    457     i++;
    458   }
    459 
    460   // Allocation for IXR_RSP FSM
    461   r_ixr_rsp_to_xram_rsp_rok  = new sc_signal<bool>[m_transaction_tab_lines];
    462 
    463   // Allocation for XRAM_RSP FSM
    464   r_xram_rsp_victim_data     = new sc_signal<data_t>[nwords];
    465   r_xram_rsp_to_tgt_rsp_data = new sc_signal<data_t>[nwords];
    466   r_xram_rsp_to_ixr_cmd_data = new sc_signal<data_t>[nwords];
    467 
    468   // Allocation for READ FSM
    469   r_read_data                = new sc_signal<data_t>[nwords];
    470   r_read_to_tgt_rsp_data     = new sc_signal<data_t>[nwords];
    471 
    472   // Allocation for WRITE FSM
    473   r_write_data               = new sc_signal<data_t>[nwords];
    474   r_write_be                 = new sc_signal<be_t>[nwords];
    475   r_write_to_cc_send_data    = new sc_signal<data_t>[nwords];
    476   r_write_to_cc_send_be      = new sc_signal<be_t>[nwords];
    477   r_write_to_ixr_cmd_data    = new sc_signal<data_t>[nwords];
    478 
    479   // Allocation for CAS FSM
    480   r_cas_to_ixr_cmd_data      = new sc_signal<data_t>[nwords];
    481   r_cas_data                 = new sc_signal<data_t>[nwords];
    482   r_cas_rdata                = new sc_signal<data_t>[2];
    483 
    484 
    485   // Simulation
    486 
    487   SC_METHOD(transition);
    488   dont_initialize();
    489   sensitive << p_clk.pos();
    490 
    491   SC_METHOD(genMoore);
    492   dont_initialize();
    493   sensitive << p_clk.neg();
     425    // Get the segments associated to the MemCache
     426    std::list<soclib::common::Segment>::iterator seg;
     427    size_t i = 0;
     428
     429    for(seg = m_seglist.begin(); seg != m_seglist.end() ; seg++)
     430    {
     431        m_nseg++;
     432    }
     433
     434    m_seg = new soclib::common::Segment*[m_nseg];
     435
     436    for(seg = m_seglist.begin() ; seg != m_seglist.end() ; seg++)
     437    {
     438        m_seg[i] = & (*seg);
     439        i++;
     440    }
     441
     442    // Allocation for IXR_RSP FSM
     443    r_ixr_rsp_to_xram_rsp_rok  = new sc_signal<bool>[m_trt_lines];
     444
     445    // Allocation for XRAM_RSP FSM
     446    r_xram_rsp_victim_data     = new sc_signal<data_t>[nwords];
     447    r_xram_rsp_to_tgt_rsp_data = new sc_signal<data_t>[nwords];
     448    r_xram_rsp_to_ixr_cmd_data = new sc_signal<data_t>[nwords];
     449
     450    // Allocation for READ FSM
     451    r_read_data                = new sc_signal<data_t>[nwords];
     452    r_read_to_tgt_rsp_data     = new sc_signal<data_t>[nwords];
     453
     454    // Allocation for WRITE FSM
     455    r_write_data               = new sc_signal<data_t>[nwords];
     456    r_write_be                 = new sc_signal<be_t>[nwords];
     457    r_write_to_cc_send_data    = new sc_signal<data_t>[nwords];
     458    r_write_to_cc_send_be      = new sc_signal<be_t>[nwords];
     459    r_write_to_ixr_cmd_data    = new sc_signal<data_t>[nwords];
     460
     461    // Allocation for CAS FSM
     462    r_cas_to_ixr_cmd_data      = new sc_signal<data_t>[nwords];
     463    r_cas_data                 = new sc_signal<data_t>[nwords];
     464    r_cas_rdata                = new sc_signal<data_t>[2];
     465
     466
     467    SC_METHOD(transition);
     468    dont_initialize();
     469    sensitive << p_clk.pos();
     470
     471    SC_METHOD(genMoore);
     472    dont_initialize();
     473    sensitive << p_clk.neg();
    494474} // end constructor
    495475
     
    580560  std::cout << "----------------------------------" << std::dec << std::endl;
    581561  std::cout
    582       << "MEM_CACHE " << m_srcid_ini << " / Time = " << m_cpt_cycles << std::endl
     562      << "MEM_CACHE " << name() << " / Time = " << m_cpt_cycles << std::endl
    583563      << "- READ RATE            = " << (double) m_cpt_read/m_cpt_cycles << std::endl
    584564      << "- READ TOTAL           = " << m_cpt_read << std::endl
     
    666646
    667647    //  Initializing Tables
    668     m_transaction_tab.init();
    669     m_update_tab.init();
     648    m_trt.init();
     649    m_upt.init();
    670650    m_llsc_table.init();
    671651
     
    728708#endif
    729709
    730     for(size_t i=0; i<m_transaction_tab_lines ; i++)
     710    for(size_t i=0; i<m_trt_lines ; i++)
    731711    {
    732712      r_ixr_rsp_to_xram_rsp_rok[i] = false;
     
    748728    r_alloc_dir_reset_cpt  = 0;
    749729    r_alloc_heap_reset_cpt = 0;
    750 
    751     r_copies_limit         = 3;
    752730
    753731    // Activity counters
     
    835813    std::cout
    836814        << "---------------------------------------------"           << std::dec << std::endl
    837         << "MEM_CACHE "            << m_srcid_ini
     815        << "MEM_CACHE "            << name()
    838816        << " ; Time = "            << m_cpt_cycles                                << std::endl
    839817        << " - TGT_CMD FSM    = "  << tgt_cmd_fsm_str[r_tgt_cmd_fsm.read()]       << std::endl
     
    11391117          (DspinDhccpParam::dspin_get(flit, DspinDhccpParam::FROM_L1_EOP) == 0x1);
    11401118
    1141         if(updt_index >= m_update_tab.size())
     1119        if(updt_index >= m_upt.size())
    11421120        {
    11431121          std::cout
     
    11471125            << std::dec
    11481126            << " / UPT index = " << updt_index
    1149             << " / UPT size = "  << m_update_tab.size()
     1127            << " / UPT size = "  << m_upt.size()
    11501128            << std::endl;
    11511129
     
    11881166        // decrement the number of expected responses
    11891167        size_t count = 0;
    1190         bool valid   = m_update_tab.decrement(r_multi_ack_upt_index.read(), count);
     1168        bool valid   = m_upt.decrement(r_multi_ack_upt_index.read(), count);
    11911169
    11921170        if(not valid)
     
    12371215        }
    12381216
    1239         r_multi_ack_srcid = m_update_tab.srcid(r_multi_ack_upt_index.read());
    1240         r_multi_ack_trdid = m_update_tab.trdid(r_multi_ack_upt_index.read());
    1241         r_multi_ack_pktid = m_update_tab.pktid(r_multi_ack_upt_index.read());
    1242         r_multi_ack_nline = m_update_tab.nline(r_multi_ack_upt_index.read());
    1243         bool need_rsp     = m_update_tab.need_rsp(r_multi_ack_upt_index.read());
     1217        r_multi_ack_srcid = m_upt.srcid(r_multi_ack_upt_index.read());
     1218        r_multi_ack_trdid = m_upt.trdid(r_multi_ack_upt_index.read());
     1219        r_multi_ack_pktid = m_upt.pktid(r_multi_ack_upt_index.read());
     1220        r_multi_ack_nline = m_upt.nline(r_multi_ack_upt_index.read());
     1221        bool need_rsp     = m_upt.need_rsp(r_multi_ack_upt_index.read());
    12441222
    12451223        // clear the UPT entry
    1246         m_update_tab.clear(r_multi_ack_upt_index.read());
     1224        m_upt.clear(r_multi_ack_upt_index.read());
    12471225
    12481226        if(need_rsp)
     
    15701548      {
    15711549        // enter counter mode when we reach the limit of copies or the heap is full
    1572         bool go_cnt = (r_read_count.read() >= r_copies_limit.read()) || m_heap.is_full();
     1550        bool go_cnt = (r_read_count.read() >= m_max_copies) || m_heap.is_full();
    15731551
    15741552        // read data in the cache
     
    18131791        size_t      index     = 0;
    18141792        vci_addr_t  addr      = (vci_addr_t) m_cmd_read_addr_fifo.read();
    1815         bool        hit_read  = m_transaction_tab.hit_read(m_nline[addr], index);
    1816         bool        hit_write = m_transaction_tab.hit_write(m_nline[addr]);
    1817         bool        wok       = !m_transaction_tab.full(index);
     1793        bool        hit_read  = m_trt.hit_read(m_nline[addr], index);
     1794        bool        hit_write = m_trt.hit_write(m_nline[addr]);
     1795        bool        wok       = !m_trt.full(index);
    18181796
    18191797        if(hit_read || !wok || hit_write)    // missing line already requested or no space
     
    18481826      if(r_alloc_trt_fsm.read() == ALLOC_TRT_READ)
    18491827      {
    1850         m_transaction_tab.set(r_read_trt_index.read(),
     1828        m_trt.set(r_read_trt_index.read(),
    18511829                              true,
    18521830                              m_nline[(vci_addr_t)(m_cmd_read_addr_fifo.read())],
     
    23012279        size_t      way        = r_write_way.read();
    23022280
    2303         wok = m_update_tab.set(true,  // it's an update transaction
     2281        wok = m_upt.set(true,  // it's an update transaction
    23042282                               false,    // it's not a broadcast
    23052283                               true,     // it needs a response
     
    26202598        size_t  wok_index = 0;
    26212599        vci_addr_t  addr  = (vci_addr_t) r_write_address.read();
    2622         bool    hit_read  = m_transaction_tab.hit_read(m_nline[addr], hit_index);
    2623         bool    hit_write = m_transaction_tab.hit_write(m_nline[addr]);
    2624         bool    wok       = !m_transaction_tab.full(wok_index);
     2600        bool    hit_read  = m_trt.hit_read(m_nline[addr], hit_index);
     2601        bool    hit_write = m_trt.hit_write(m_nline[addr]);
     2602        bool    wok       = !m_trt.full(wok_index);
    26252603
    26262604        if(hit_read)      // register the modified data in TRT
     
    26722650          data_vector.push_back(r_write_data[i]);
    26732651        }
    2674         m_transaction_tab.set(r_write_trt_index.read(),
     2652        m_trt.set(r_write_trt_index.read(),
    26752653                              true,     // read request to XRAM
    26762654                              m_nline[(vci_addr_t)(r_write_address.read())],
     
    27092687          data_vector.push_back(r_write_data[i]);
    27102688        }
    2711         m_transaction_tab.write_data_mask(r_write_trt_index.read(),
     2689        m_trt.write_data_mask(r_write_trt_index.read(),
    27122690                                          be_vector,
    27132691                                          data_vector);
     
    27182696        {
    27192697          std::cout << "  <MEMC " << name() << ".WRITE_MISS_TRT_DATA> Modify an existing entry in TRT" << std::endl;
    2720           m_transaction_tab.print(r_write_trt_index.read());
     2698          m_trt.print(r_write_trt_index.read());
    27212699        }
    27222700#endif
     
    27522730      {
    27532731        size_t wok_index = 0;
    2754         bool wok = !m_transaction_tab.full(wok_index);
     2732        bool wok = !m_trt.full(wok_index);
    27552733        if(wok)       // set a new entry in TRT
    27562734        {
     
    27872765        size_t      nb_copies = r_write_count.read();
    27882766
    2789         wok =m_update_tab.set(false,  // it's an inval transaction
     2767        wok =m_upt.set(false,  // it's an inval transaction
    27902768                              true,     // it's a broadcast
    27912769                              true,     // it needs a response
     
    28302808
    28312809      // register a write request to XRAM in TRT
    2832       m_transaction_tab.set(r_write_trt_index.read(),
     2810      m_trt.set(r_write_trt_index.read(),
    28332811                            false,    // write request to XRAM
    28342812                            m_nline[(vci_addr_t)(r_write_address.read())],
     
    31603138      if(r_alloc_trt_fsm.read() == ALLOC_TRT_IXR_RSP)
    31613139      {
    3162         m_transaction_tab.erase(r_ixr_rsp_trt_index.read());
     3140        m_trt.erase(r_ixr_rsp_trt_index.read());
    31633141        r_ixr_rsp_fsm = IXR_RSP_IDLE;
    31643142
     
    31843162        assert(((eop == (r_ixr_rsp_cpt.read() == (m_words-1))) || p_vci_ixr.rerror.read())
    31853163               and "Error in VCI_MEM_CACHE : invalid length for a response from XRAM");
    3186         m_transaction_tab.write_rsp(index,
     3164        m_trt.write_rsp(index,
    31873165                                    r_ixr_rsp_cpt.read(),
    31883166                                    data,
     
    32383216    {
    32393217      size_t ptr   = r_xram_rsp_trt_index.read();
    3240       size_t lines = m_transaction_tab_lines;
     3218      size_t lines = m_trt_lines;
    32413219      for(size_t i=0 ; i<lines ; i++)
    32423220      {
     
    32723250        size_t  index = r_xram_rsp_trt_index.read();
    32733251
    3274         TransactionTabEntry trt_entry(m_transaction_tab.read(index));
     3252        TransactionTabEntry trt_entry(m_trt.read(index));
    32753253        r_xram_rsp_trt_buf.copy(trt_entry);  // TRT entry local buffer
    32763254
     
    33523330      {
    33533331        size_t index;
    3354         if(m_update_tab.search_inval(r_xram_rsp_trt_buf.nline, index))
     3332        if(m_upt.search_inval(r_xram_rsp_trt_buf.nline, index))
    33553333        {
    33563334          r_xram_rsp_fsm = XRAM_RSP_INVAL_WAIT;
     
    33613339            std::cout << "  <MEMC " << name() << ".XRAM_RSP_INVAL_LOCK> Get acces to UPT,"
    33623340                      << " but an invalidation is already registered at this address" << std::endl;
    3363             m_update_tab.print();
     3341            m_upt.print();
    33643342          }
    33653343#endif
    33663344
    33673345        }
    3368         else if(m_update_tab.is_full() && r_xram_rsp_victim_inval.read())
     3346        else if(m_upt.is_full() && r_xram_rsp_victim_inval.read())
    33693347        {
    33703348          r_xram_rsp_fsm = XRAM_RSP_INVAL_WAIT;
     
    33753353            std::cout << "  <MEMC " << name() << ".XRAM_RSP_INVAL_LOCK> Get acces to UPT,"
    33763354                      << " but the table is full" << std::endl;
    3377             m_update_tab.print();
     3355            m_upt.print();
    33783356          }
    33793357#endif
     
    34633441        size_t count_copies   = r_xram_rsp_victim_count.read();
    34643442
    3465         bool   wok = m_update_tab.set(false,      // it's an inval transaction
     3443        bool   wok = m_upt.set(false,      // it's an inval transaction
    34663444                                      brdcast,  // set brdcast bit
    34673445                                      false,    // it does not need a response
     
    35013479      // If the victim is not dirty, we don't need another XRAM  put transaction,
    35023480      // and we canwe erase the TRT entry
    3503       if(!r_xram_rsp_victim_dirty.read())  m_transaction_tab.erase(r_xram_rsp_trt_index.read());
     3481      if(!r_xram_rsp_victim_dirty.read())  m_trt.erase(r_xram_rsp_trt_index.read());
    35043482
    35053483      // Next state
     
    35153493      if(r_alloc_trt_fsm.read() == ALLOC_TRT_XRAM_RSP)
    35163494      {
    3517         m_transaction_tab.set(r_xram_rsp_trt_index.read(),
     3495        m_trt.set(r_xram_rsp_trt_index.read(),
    35183496                              false,       // write to XRAM
    35193497                              r_xram_rsp_victim_nline.read(),  // line index
     
    37403718    case XRAM_RSP_ERROR_ERASE:  // erase TRT entry in case of error
    37413719    {
    3742       m_transaction_tab.erase(r_xram_rsp_trt_index.read());
     3720      m_trt.erase(r_xram_rsp_trt_index.read());
    37433721
    37443722      // Next state
     
    44354413      bool   match_inval;
    44364414
    4437       match_inval = m_update_tab.search_inval(r_cleanup_nline.read(), index);
     4415      match_inval = m_upt.search_inval(r_cleanup_nline.read(), index);
    44384416
    44394417      // no pending inval
     
    44584436
    44594437      // pending inval
    4460       r_cleanup_write_srcid    = m_update_tab.srcid(index);
    4461       r_cleanup_write_trdid    = m_update_tab.trdid(index);
    4462       r_cleanup_write_pktid    = m_update_tab.pktid(index);
    4463       r_cleanup_write_need_rsp = m_update_tab.need_rsp(index);
     4438      r_cleanup_write_srcid    = m_upt.srcid(index);
     4439      r_cleanup_write_trdid    = m_upt.trdid(index);
     4440      r_cleanup_write_pktid    = m_upt.pktid(index);
     4441      r_cleanup_write_need_rsp = m_upt.need_rsp(index);
    44644442      r_cleanup_index          = index;
    44654443
     
    44974475
    44984476      size_t count = 0;
    4499       m_update_tab.decrement(r_cleanup_index.read(), count);
     4477      m_upt.decrement(r_cleanup_index.read(), count);
    45004478
    45014479      // invalidation transaction finished
     
    45394517      }
    45404518
    4541       m_update_tab.clear(r_cleanup_index.read());
     4519      m_upt.clear(r_cleanup_index.read());
    45424520
    45434521      if(r_cleanup_write_need_rsp.read())
     
    49194897        size_t      nb_copies  = r_cas_count.read();
    49204898
    4921         wok = m_update_tab.set(true,  // it's an update transaction
     4899        wok = m_upt.set(true,  // it's an update transaction
    49224900                               false,   // it's not a broadcast
    49234901                               true,    // it needs a response
     
    51255103          }
    51265104          size_t wok_index = 0;
    5127           bool   wok       = !m_transaction_tab.full(wok_index);
     5105          bool   wok       = !m_trt.full(wok_index);
    51285106          if(wok)
    51295107          {
     
    51585136
    51595137        // register a broadcast inval transaction in UPT
    5160         wok = m_update_tab.set(false,  // it's an inval transaction
     5138        wok = m_upt.set(false,  // it's an inval transaction
    51615139                               true,    // it's a broadcast
    51625140                               true,    // it needs a response
     
    52165194      {
    52175195        // set TRT
    5218         m_transaction_tab.set(r_cas_trt_index.read(),
     5196        m_trt.set(r_cas_trt_index.read(),
    52195197                              false,    // PUT request to XRAM
    52205198                              m_nline[(vci_addr_t)(m_cmd_cas_addr_fifo.read())],
     
    53615339      {
    53625340        size_t   index = 0;
    5363         bool hit_read = m_transaction_tab.hit_read(
     5341        bool hit_read = m_trt.hit_read(
    53645342                          m_nline[(vci_addr_t) m_cmd_cas_addr_fifo.read()],index);
    5365         bool hit_write = m_transaction_tab.hit_write(
     5343        bool hit_write = m_trt.hit_write(
    53665344                           m_nline[(vci_addr_t) m_cmd_cas_addr_fifo.read()]);
    5367         bool wok = !m_transaction_tab.full(index);
     5345        bool wok = !m_trt.full(index);
    53685346
    53695347#if DEBUG_MEMC_CAS
     
    54055383        }
    54065384
    5407         m_transaction_tab.set(r_cas_trt_index.read(),
     5385        m_trt.set(r_cas_trt_index.read(),
    54085386                              true,   // read request
    54095387                              m_nline[(vci_addr_t) m_cmd_cas_addr_fifo.read()],
     
    71627140  p_vci_ixr.be      = 0xF;
    71637141  p_vci_ixr.pktid   = 0;
    7164   p_vci_ixr.srcid   = m_srcid_ixr;
     7142  p_vci_ixr.srcid   = m_srcid_x;
    71657143  p_vci_ixr.cons    = false;
    71667144  p_vci_ixr.wrap    = false;
     
    72887266  // Response signals on the p_vci_tgt port
    72897267  ////////////////////////////////////////////////////
     7268
    72907269  switch(r_tgt_rsp_fsm.read())
    72917270  {
     
    73847363  // Initiator command signals on the p_dspin_out port (CC_SEND FSM)
    73857364  ////////////////////////////////////////////////////////////////////
     7365
    73867366  p_dspin_out.write = false;
    73877367  p_dspin_out.data  = 0;
     
    73897369  switch(r_cc_send_fsm.read())
    73907370  {
     7371 
    73917372    case CC_SEND_XRAM_RSP_IDLE:
    73927373    case CC_SEND_WRITE_IDLE:
     
    74637444        DspinDhccpParam::dspin_set(
    74647445            flit,
    7465             m_srcid_ini,
     7446            m_cc_global_id,
    74667447            DspinDhccpParam::MULTI_INVAL_SRCID);
    74677448
     
    75167497        DspinDhccpParam::dspin_set(
    75177498            flit,
    7518             m_srcid_ini,
     7499            m_cc_global_id,
    75197500            DspinDhccpParam::BROADCAST_SRCID);
    75207501
     
    76137594        DspinDhccpParam::dspin_set(
    76147595            flit,
    7615             m_srcid_ini,
     7596            m_cc_global_id,
    76167597            DspinDhccpParam::MULTI_UPDT_SRCID);
    76177598
     
    77177698        DspinDhccpParam::dspin_set(
    77187699            flit,
    7719             m_srcid_ini,
     7700            m_cc_global_id,
    77207701            DspinDhccpParam::MULTI_UPDT_SRCID);
    77217702
Note: See TracChangeset for help on using the changeset viewer.