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

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

Location:
trunk/modules/vci_mem_cache/caba/source
Files:
5 edited

Legend:

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

    r307 r385  
    4040  ////////////////////////////////////////////////////////////////////////
    4141  class Owner{
    42     typedef uint32_t size_t;
    4342   
    4443    public:
     
    9291
    9392    typedef uint32_t tag_t;
    94     typedef uint32_t size_t;
    9593
    9694    public:
     
    165163    void print()
    166164    {
    167       std::cout << "Valid = " << valid << " ; IS COUNT = " << is_cnt << " ; Dirty = " << dirty << " ; Lock = "
    168                 << lock
     165      std::cout << "Valid = " << valid
     166                << " ; IS COUNT = " << is_cnt
     167                << " ; Dirty = " << dirty
     168                << " ; Lock = " << lock
    169169                << " ; Tag = " << std::hex << tag << std::dec
    170170                << " ; Count = " << count
     
    187187    typedef uint32_t data_t;
    188188    typedef uint32_t tag_t;
    189     typedef uint32_t size_t;
    190189
    191190    private:
     
    408407  ///////////////////////////////////////////////////////////////////////
    409408  class HeapEntry{
    410     typedef uint32_t size_t;
    411409
    412410    public:
     
    472470  ////////////////////////////////////////////////////////////////////////
    473471  class HeapDirectory{
    474     typedef uint32_t size_t;
    475472   
    476473    private:
  • trunk/modules/vci_mem_cache/caba/source/include/update_tab.h

    r307 r385  
    126126class UpdateTab{
    127127
    128   typedef uint32_t size_t;
    129128  typedef sc_dt::sc_uint<40> addr_t;
    130129
  • trunk/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h

    r362 r385  
    5858  using namespace sc_core;
    5959
    60   template<typename vci_param>
     60  template<typename vci_param_int,
     61           typename vci_param_ext,
     62           size_t   dspin_in_width,
     63           size_t   dspin_out_width>
    6164    class VciMemCache
    6265    : public soclib::caba::BaseModule
    6366    {
    64       typedef sc_dt::sc_uint<40> addr_t;
    65       typedef typename vci_param::fast_addr_t vci_addr_t;
     67      typedef typename vci_param_int::fast_addr_t  addr_t;
     68
     69      typedef typename sc_dt::sc_uint<64>          wide_data_t;
     70
    6671      typedef uint32_t data_t;
    6772      typedef uint32_t tag_t;
    68       typedef uint32_t size_t;
    6973      typedef uint32_t be_t;
    7074      typedef uint32_t copy_t;
     
    343347
    344348      bool         m_monitor_ok;
    345       vci_addr_t   m_monitor_base;
    346       vci_addr_t   m_monitor_length;
     349      addr_t       m_monitor_base;
     350      addr_t       m_monitor_length;
    347351
    348352      // instrumentation counters
     
    373377
    374378      public:
    375       sc_in<bool>                           p_clk;
    376       sc_in<bool>                           p_resetn;
    377       soclib::caba::VciTarget<vci_param>    p_vci_tgt;
    378       soclib::caba::VciInitiator<vci_param> p_vci_ixr;
    379       soclib::caba::DspinInput<33>          p_dspin_in;
    380       soclib::caba::DspinOutput<40>         p_dspin_out;
     379      sc_in<bool>                                 p_clk;
     380      sc_in<bool>                                 p_resetn;
     381      soclib::caba::VciTarget<vci_param_int>      p_vci_tgt;
     382      soclib::caba::VciInitiator<vci_param_ext>  p_vci_ixr;
     383      soclib::caba::DspinInput<dspin_in_width>    p_dspin_in;
     384      soclib::caba::DspinOutput<dspin_out_width>  p_dspin_out;
    381385
    382386      VciMemCache(
     
    401405      void print_stats();
    402406      void print_trace();
    403       void copies_monitor(vci_addr_t addr);
    404       void start_monitor(vci_addr_t addr, vci_addr_t length);
     407      void copies_monitor(addr_t addr);
     408      void start_monitor(addr_t addr, addr_t length);
    405409      void stop_monitor();
    406410
     
    409413      void transition();
    410414      void genMoore();
    411       void check_monitor( const char *buf, vci_addr_t addr, data_t data);
    412       void check_monitor_read( const char *buf, vci_addr_t addr);
     415      void check_monitor( const char *buf, addr_t addr, data_t data, bool read);
    413416
    414417      // Component attributes
     
    436439      < 32  ,                              // number of slots
    437440        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
     441        8000,                              // registration life (# of LL operations)
     442        addr_t >  m_llsc_table;            // ll/sc global registration table
    441443
    442444      // adress masks
    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;
     445      const soclib::common::AddressMaskingTable<addr_t>   m_x;
     446      const soclib::common::AddressMaskingTable<addr_t>   m_y;
     447      const soclib::common::AddressMaskingTable<addr_t>   m_z;
     448      const soclib::common::AddressMaskingTable<addr_t>   m_nline;
    447449
    448450      // broadcast address
     
    454456
    455457      // Fifo between TGT_CMD fsm and READ fsm
    456       GenericFifo<uint64_t>  m_cmd_read_addr_fifo;
     458      GenericFifo<addr_t>    m_cmd_read_addr_fifo;
    457459      GenericFifo<size_t>    m_cmd_read_length_fifo;
    458460      GenericFifo<size_t>    m_cmd_read_srcid_fifo;
     
    461463
    462464      // Fifo between TGT_CMD fsm and WRITE fsm
    463       GenericFifo<uint64_t>  m_cmd_write_addr_fifo;
     465      GenericFifo<addr_t>    m_cmd_write_addr_fifo;
    464466      GenericFifo<bool>      m_cmd_write_eop_fifo;
    465467      GenericFifo<size_t>    m_cmd_write_srcid_fifo;
     
    470472
    471473      // Fifo between TGT_CMD fsm and CAS fsm
    472       GenericFifo<uint64_t>  m_cmd_cas_addr_fifo;
     474      GenericFifo<addr_t>    m_cmd_cas_addr_fifo;
    473475      GenericFifo<bool>      m_cmd_cas_eop_fifo;
    474476      GenericFifo<size_t>    m_cmd_cas_srcid_fifo;
     
    504506      sc_signal<size_t>   r_read_next_ptr;   // Next entry to point to
    505507      sc_signal<bool>     r_read_last_free;  // Last free entry
    506       sc_signal<typename vci_param::fast_addr_t>
    507                           r_read_ll_key;     // LL key returned by the llsc_global_table
     508      sc_signal<addr_t>   r_read_ll_key;     // LL key from the llsc_global_table
    508509
    509510      // Buffer between READ fsm and IXR_CMD fsm (ask a missing cache line to XRAM)
     
    520521      sc_signal<size_t>   r_read_to_tgt_rsp_word;   // first word of the response
    521522      sc_signal<size_t>   r_read_to_tgt_rsp_length; // length of the response
    522       sc_signal<typename vci_param::fast_addr_t>
    523                           r_read_to_tgt_rsp_ll_key; // LL key returned by the llsc_global_table
     523      sc_signal<addr_t>   r_read_to_tgt_rsp_ll_key; // LL key from the llsc_global_table
    524524
    525525      ///////////////////////////////////////////////////////////////
     
    578578      GenericFifo<bool>   m_write_to_cc_send_inst_fifo;     // fifo for the L1 type
    579579      GenericFifo<size_t> m_write_to_cc_send_srcid_fifo;    // fifo for srcids
     580
    580581#if L1_MULTI_CACHE
    581582      GenericFifo<size_t> m_write_to_cc_send_cache_id_fifo; // fifo for srcids
     
    703704      GenericFifo<bool>   m_cas_to_cc_send_inst_fifo;     // fifo for the L1 type
    704705      GenericFifo<size_t> m_cas_to_cc_send_srcid_fifo;    // fifo for srcids
     706
    705707#if L1_MULTI_CACHE
    706708      GenericFifo<size_t> m_cas_to_cc_send_cache_id_fifo; // fifo for srcids
     
    749751      sc_signal<size_t>   r_xram_rsp_to_tgt_rsp_length; // length of the response
    750752      sc_signal<bool>     r_xram_rsp_to_tgt_rsp_rerror; // send error to requester
    751       sc_signal<typename vci_param::fast_addr_t>
    752                           r_xram_rsp_to_tgt_rsp_ll_key; // LL key returned by the llsc_global_table
     753      sc_signal<addr_t>   r_xram_rsp_to_tgt_rsp_ll_key; // LL key from llsc_global_table
    753754
    754755      // Buffer between XRAM_RSP fsm and CC_SEND fsm (Inval L1 Caches)
     
    759760      GenericFifo<bool>   m_xram_rsp_to_cc_send_inst_fifo;     // fifo for the L1 type
    760761      GenericFifo<size_t> m_xram_rsp_to_cc_send_srcid_fifo;    // fifo for srcids
     762
    761763#if L1_MULTI_CACHE
    762764      GenericFifo<size_t> m_xram_rsp_to_cc_send_cache_id_fifo; // fifo for srcids
  • trunk/modules/vci_mem_cache/caba/source/include/xram_transaction.h

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

    r367 r385  
    4040/////////////////////////////////////////////////////////////////////////////////
    4141
    42 #define DEBUG_MEMC_GLOBAL   0 // synthetic trace of all FSMs
    43 #define DEBUG_MEMC_READ     1 // detailed trace of READ FSM
    44 #define DEBUG_MEMC_WRITE    1 // detailed trace of WRITE FSM
    45 #define DEBUG_MEMC_CAS      1 // detailed trace of CAS FSM
    46 #define DEBUG_MEMC_IXR_CMD  1 // detailed trace of IXR_RSP FSM
    47 #define DEBUG_MEMC_IXR_RSP  1 // detailed trace of IXR_RSP FSM
    48 #define DEBUG_MEMC_XRAM_RSP 1 // detailed trace of XRAM_RSP FSM
    49 #define DEBUG_MEMC_CC_SEND 1 // detailed trace of CC_SEND FSM
     42#define DEBUG_MEMC_GLOBAL    0 // synthetic trace of all FSMs
     43#define DEBUG_MEMC_READ      1 // detailed trace of READ FSM
     44#define DEBUG_MEMC_WRITE     1 // detailed trace of WRITE FSM
     45#define DEBUG_MEMC_CAS       1 // detailed trace of CAS FSM
     46#define DEBUG_MEMC_IXR_CMD   1 // detailed trace of IXR_RSP FSM
     47#define DEBUG_MEMC_IXR_RSP   1 // detailed trace of IXR_RSP FSM
     48#define DEBUG_MEMC_XRAM_RSP  1 // detailed trace of XRAM_RSP FSM
     49#define DEBUG_MEMC_CC_SEND   1 // detailed trace of CC_SEND FSM
    5050#define DEBUG_MEMC_MULTI_ACK 1 // detailed trace of MULTI_ACK FSM
    51 #define DEBUG_MEMC_TGT_CMD  1 // detailed trace of TGT_CMD FSM
    52 #define DEBUG_MEMC_TGT_RSP  1 // detailed trace of TGT_RSP FSM
    53 #define DEBUG_MEMC_CLEANUP  1 // detailed trace of CLEANUP FSM
    54 
    55 #define RANDOMIZE_CAS       1
     51#define DEBUG_MEMC_TGT_CMD   1 // detailed trace of TGT_CMD FSM
     52#define DEBUG_MEMC_TGT_RSP   1 // detailed trace of TGT_RSP FSM
     53#define DEBUG_MEMC_CLEANUP   1 // detailed trace of CLEANUP FSM
     54
     55#define RANDOMIZE_CAS        1
    5656
    5757namespace soclib
     
    273273
    274274#define tmpl(x) \
    275   template<typename vci_param> x \
    276   VciMemCache<vci_param>
     275  template<typename vci_param_int, \
     276           typename vci_param_ext, \
     277           size_t dspin_in_width,  \
     278           size_t dspin_out_width> x \
     279  VciMemCache<vci_param_int, vci_param_ext, dspin_in_width, dspin_out_width>
    277280
    278281using namespace soclib::common;
     
    311314    m_nseg( 0 ),
    312315    m_srcid_x( mtx.indexForId(srcid_x) ),
    313     m_initiators( 1 << vci_param::S ),
     316    m_initiators( 1 << vci_param_int::S ),
    314317    m_heap_size( heap_size ),
    315318    m_ways( nways ),
     
    323326    m_upt_lines(upt_lines),
    324327    m_upt(upt_lines),
    325     m_cache_directory(nways, nsets, nwords, vci_param::N),
     328    m_cache_directory(nways, nsets, nwords, vci_param_int::N),
    326329    m_cache_data(nways, nsets, nwords),
    327330    m_heap(m_heap_size),
     
    332335    m_x(L2(m_words), 2),
    333336    m_y(L2(m_sets), L2(m_words) + 2),
    334     m_z(vci_param::N - L2(m_sets) - L2(m_words) - 2, L2(m_sets) + L2(m_words) + 2),
    335     m_nline(vci_param::N - L2(m_words) - 2, L2(m_words) + 2),
     337    m_z(vci_param_int::N - L2(m_sets) - L2(m_words) - 2, L2(m_sets) + L2(m_words) + 2),
     338    m_nline(vci_param_int::N - L2(m_words) - 2, L2(m_words) + 2),
    336339#undef L2
    337340
     
    420423
    421424    // check Transaction table size
    422     assert((uint32_log2(trt_lines) <= vci_param::T) and
    423          "Need more bits for VCI TRDID field");
    424 
     425    assert((uint32_log2(trt_lines) <= vci_param_ext::T) and
     426         "MEMC ERROR : Need more bits for VCI TRDID field");
     427
     428    // check internal and external data width
     429    assert( (vci_param_int::B == 4 ) and
     430         "MEMC ERROR : VCI internal data width must be 32 bits");
     431         
     432    assert( (vci_param_ext::B == 8 ) and
     433         "MEMC ERROR : VCI external data width must be 32 or 64 bits");
     434
     435    // Check coherence between internal & external addresses
     436    assert( (vci_param_int::N == vci_param_ext::N) and
     437         "MEMC ERROR : VCI internal & external addresses must have the same width");
     438         
    425439    // Get the segments associated to the MemCache
    426440    std::list<soclib::common::Segment>::iterator seg;
     
    475489
    476490///////////////////////////////////////////////////////////////////////
    477 tmpl(void) ::start_monitor(vci_addr_t addr, vci_addr_t length)
     491tmpl(void) ::start_monitor(addr_t addr, addr_t length)
    478492///////////////////////////////////////////////////////////////////////
    479493{
     
    490504}
    491505
    492 ///////////////////////////////////////////////////////////////////////
    493 tmpl(void) ::check_monitor(const char *buf, vci_addr_t addr, data_t data)
    494 ///////////////////////////////////////////////////////////////////////
     506////////////////////////////////////////////////
     507tmpl(void) ::check_monitor( const char  *buf,
     508                            addr_t      addr,
     509                            data_t      data,
     510                            bool        read )
     511////////////////////////////////////////////////
    495512{
    496513  if((addr >= m_monitor_base) and
    497514      (addr < m_monitor_base + m_monitor_length))
    498515  {
    499     std::cout << " MEMC Write Monitor : " << buf << " Address = " << std::hex << addr
    500               << " / Data = " << data << " at cycle " << std::dec << m_cpt_cycles << std::endl;
     516    if ( read ) std::cout << " MEMC Read Monitor ";
     517    else        std::cout << " MEMC Write Monitor ";
     518    std::cout << buf
     519              << " Address = " << std::hex << addr
     520              << " / Data = " << data
     521              << " at cycle " << std::dec << m_cpt_cycles << std::endl;
    501522  }
    502523}
    503524
    504 ///////////////////////////////////////////////////////////////////////
    505 tmpl(void) ::check_monitor_read(const char *buf, vci_addr_t addr)
    506 ///////////////////////////////////////////////////////////////////////
    507 {
    508   if((addr >= m_monitor_base) and
    509       (addr < m_monitor_base + m_monitor_length))
    510   {
    511     std::cout << " MEMC Read Monitor : " << buf << " Address = " << std::hex << addr
    512               << std::endl;
    513   }
    514 }
    515 
    516525/////////////////////////////////////////////////////
    517 tmpl(void) ::copies_monitor(vci_addr_t addr)
     526tmpl(void) ::copies_monitor(addr_t addr)
    518527/////////////////////////////////////////////////////
    519528{
     
    632641    m_debug_tgt_cmd_fsm    = false;
    633642    m_debug_tgt_rsp_fsm    = false;
    634     m_debug_cc_send_fsm  = false;
    635     m_debug_cc_receive_fsm  = false;
     643    m_debug_cc_send_fsm    = false;
     644    m_debug_cc_receive_fsm = false;
    636645    m_debug_multi_ack_fsm  = false;
    637646    m_debug_read_fsm       = false;
     
    864873          std::cout
    865874              << "  <MEMC " << name()
    866               << ".TGT_CMD_IDLE> Receive command from srcid "
     875              << " TGT_CMD_IDLE> Receive command from srcid "
    867876              << std::dec << p_vci_tgt.srcid.read()
    868877              << " / for address "
     
    872881#endif
    873882        // checking segmentation violation
    874         vci_addr_t  address = p_vci_tgt.address.read();
     883        addr_t  address = p_vci_tgt.address.read();
    875884        uint32_t    plen    = p_vci_tgt.plen.read();
    876885        bool found = false;
     
    878887        {
    879888          if(m_seg[seg_id]->contains(address) &&
    880               m_seg[seg_id]->contains(address + plen - vci_param::B))
     889              m_seg[seg_id]->contains(address + plen - vci_param_int::B))
    881890          {
    882891            found = true;
     
    893902        }
    894903
    895         if(p_vci_tgt.cmd.read() == vci_param::CMD_READ)
     904        if(p_vci_tgt.cmd.read() == vci_param_int::CMD_READ)
    896905        {
    897906          // check that the pktid is either :
     
    906915          r_tgt_cmd_fsm = TGT_CMD_READ;
    907916        }
    908         else if(p_vci_tgt.cmd.read() == vci_param::CMD_WRITE)
     917        else if(p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)
    909918        {
    910919          // check that the pktid is TYPE_WRITE
     
    915924          r_tgt_cmd_fsm = TGT_CMD_WRITE;
    916925        }
    917         else if(p_vci_tgt.cmd.read() == vci_param::CMD_LOCKED_READ)
     926        else if(p_vci_tgt.cmd.read() == vci_param_int::CMD_LOCKED_READ)
    918927        {
    919928          // check that the pktid is TYPE_LL
     
    924933          r_tgt_cmd_fsm = TGT_CMD_READ;
    925934        }
    926         else if(p_vci_tgt.cmd.read() == vci_param::CMD_NOP)
     935        else if(p_vci_tgt.cmd.read() == vci_param_int::CMD_NOP)
    927936        {
    928937          // check that the pktid is either :
     
    954963      // This test checks that the read does not cross a cache line limit.
    955964      // It must not be taken into account when dealing with an LL CMD.
    956       if(((m_x[(vci_addr_t) p_vci_tgt.address.read()]+ (p_vci_tgt.plen.read() >>2)) > 16) && (p_vci_tgt.cmd.read() != vci_param::CMD_LOCKED_READ))
     965      if(((m_x[(addr_t) p_vci_tgt.address.read()]+ (p_vci_tgt.plen.read() >>2)) > 16) &&
     966          (p_vci_tgt.cmd.read() != vci_param_int::CMD_LOCKED_READ))
    957967      {
    958968        std::cout
     
    973983        exit(0);
    974984      }
    975       if((p_vci_tgt.cmd.read() == vci_param::CMD_LOCKED_READ) && (p_vci_tgt.plen.read() != 8))
     985      if((p_vci_tgt.cmd.read() == vci_param_int::CMD_LOCKED_READ) && (p_vci_tgt.plen.read() != 8))
    976986      {
    977987        std::cout
     
    9901000        if(m_debug_tgt_cmd_fsm)
    9911001        {
    992           std::cout << "  <MEMC " << name() << ".TGT_CMD_READ> Push into read_fifo:"
     1002          std::cout << "  <MEMC " << name() << " TGT_CMD_READ> Push into read_fifo:"
    9931003                    << " address = " << std::hex << p_vci_tgt.address.read()
    9941004                    << " srcid = " << std::dec << p_vci_tgt.srcid.read()
     
    9991009#endif
    10001010        cmd_read_fifo_put = true;
    1001         if(p_vci_tgt.cmd.read() == vci_param::CMD_LOCKED_READ)
     1011        if(p_vci_tgt.cmd.read() == vci_param_int::CMD_LOCKED_READ)
    10021012          m_cpt_ll++;
    10031013        else
     
    10151025        if(m_debug_tgt_cmd_fsm)
    10161026        {
    1017           std::cout << "  <MEMC " << name() << ".TGT_CMD_WRITE> Push into write_fifo:"
     1027          std::cout << "  <MEMC " << name() << " TGT_CMD_WRITE> Push into write_fifo:"
    10181028                    << " address = " << std::hex << p_vci_tgt.address.read()
    10191029                    << " srcid = " << std::dec << p_vci_tgt.srcid.read()
     
    10481058        if(m_debug_tgt_cmd_fsm)
    10491059        {
    1050           std::cout << "  <MEMC " << name() << ".TGT_CMD_CAS> Pushing command into cmd_cas_fifo:"
     1060          std::cout << "  <MEMC " << name() << " TGT_CMD_CAS> Pushing command into cmd_cas_fifo:"
    10511061                    << " address = " << std::hex << p_vci_tgt.address.read()
    10521062                    << " srcid = " << std::dec << p_vci_tgt.srcid.read()
     
    11531163          std::cout
    11541164            <<  "  <MEMC " << name()
    1155             << ".MULTI_ACK_IDLE> Response for UPT entry "
     1165            << " MULTI_ACK_IDLE> Response for UPT entry "
    11561166            << updt_index
    11571167            << std::endl;
     
    11951205          std::cout
    11961206            << "  <MEMC " << name()
    1197             << ".MULTI_ACK_UPT_LOCK> Decrement the responses counter for UPT:"
     1207            << " MULTI_ACK_UPT_LOCK> Decrement the responses counter for UPT:"
    11981208            << " entry = "       << r_multi_ack_upt_index.read()
    11991209            << " / rsp_count = " << std::dec << count
     
    12401250          std::cout
    12411251            <<  "  <MEMC " << name()
    1242             << ".MULTI_ACK_UPT_CLEAR> Clear UPT entry "
     1252            << " MULTI_ACK_UPT_CLEAR> Clear UPT entry "
    12431253            << r_multi_ack_upt_index.read()
    12441254            << std::endl;
     
    12651275          std::cout
    12661276            << "  <MEMC " << name()
    1267             << ".MULTI_ACK_WRITE_RSP> Request TGT_RSP FSM to send a response to srcid "
     1277            << " MULTI_ACK_WRITE_RSP> Request TGT_RSP FSM to send a response to srcid "
    12681278            << r_multi_ack_srcid.read()
    12691279            << std::endl;
     
    13091319        if(m_debug_read_fsm)
    13101320        {
    1311           std::cout << "  <MEMC " << name() << ".READ_IDLE> Read request:"
     1321          std::cout << "  <MEMC " << name() << " READ_IDLE> Read request:"
    13121322                    << " srcid = " << std::dec << m_cmd_read_srcid_fifo.read()
    13131323                    << " / address = " << std::hex << m_cmd_read_addr_fifo.read()
     
    13341344      {
    13351345        std::cout
    1336             << "  <MEMC " << name() << ".READ_DIR_REQ> Requesting DIR lock "
     1346            << "  <MEMC " << name() << " READ_DIR_REQ> Requesting DIR lock "
    13371347            << std::endl;
    13381348      }
     
    13931403        {
    13941404          std::cout
    1395               << "  <MEMC " << name() << ".READ_DIR_LOCK> Accessing directory: "
     1405              << "  <MEMC " << name() << " READ_DIR_LOCK> Accessing directory: "
    13961406              << " address = " << std::hex << m_cmd_read_addr_fifo.read()
    13971407              << " / hit = " << std::dec << entry.valid
     
    14011411          {
    14021412            std::cout
    1403                 << "  <MEMC " << name() << ".READ_DIR_LOCK> global_llsc_table LL access" << std::endl;
     1413                << "  <MEMC " << name() << " READ_DIR_LOCK> global_llsc_table LL access" << std::endl;
    14041414          }
    14051415        }
     
    14411451
    14421452        // read data in the cache
    1443         size_t set        = m_y[(vci_addr_t)(m_cmd_read_addr_fifo.read())];
     1453        size_t set        = m_y[(addr_t)(m_cmd_read_addr_fifo.read())];
    14441454        size_t way        = r_read_way.read();
    14451455
     
    14511461        entry.is_cnt  = is_cnt;
    14521462        entry.dirty   = r_read_dirty.read();
    1453         entry.tag   = r_read_tag.read();
     1463        entry.tag     = r_read_tag.read();
    14541464        entry.lock    = r_read_lock.read();
    14551465        entry.ptr     = r_read_ptr.read();
     
    14891499        {
    14901500          std::cout
    1491               << "  <MEMC " << name() << ".READ_DIR_HIT> Update directory entry:"
     1501              << "  <MEMC " << name() << " READ_DIR_HIT> Update directory entry:"
    14921502              << " addr = " << std::hex << m_cmd_read_addr_fifo.read()
    14931503              << " / set = " << std::dec << set
     
    14991509        }
    15001510#endif
    1501 /**/
     1511
    15021512          if(m_monitor_ok)
    15031513          {
    15041514            char buf[80];
    1505             snprintf(buf, 80, "READ_DIR_HIT srcid %d, ins %d", m_cmd_read_srcid_fifo.read(), ((m_cmd_read_pktid_fifo.read()&0x2)!=0));
    1506             check_monitor_read(buf, m_cmd_read_addr_fifo.read());
     1515            snprintf(buf, 80, "READ_DIR_HIT srcid %d, ins %d",
     1516                     (int)m_cmd_read_srcid_fifo.read(),
     1517                     (int)((m_cmd_read_pktid_fifo.read()&0x2)!=0));
     1518            check_monitor(buf, m_cmd_read_addr_fifo.read(), r_read_data[0], true);
    15071519          }
    1508 /**/
     1520
    15091521
    15101522        m_cache_directory.write(set, way, entry);
     
    15181530      // Get the lock to the HEAP directory
    15191531    {
    1520 /**/
    1521           if(m_monitor_ok)
    1522           {
    1523             char buf[80];
    1524             snprintf(buf, 80, "READ_HEAP_REQ srcid %d, ins %d", m_cmd_read_srcid_fifo.read(), ((m_cmd_read_pktid_fifo.read()&0x2)!=0));
    1525             check_monitor_read(buf, m_cmd_read_addr_fifo.read());
    1526           }
    1527 /**/
    15281532      if(r_alloc_heap_fsm.read() == ALLOC_HEAP_READ)
    15291533      {
     
    15351539      {
    15361540        std::cout
    1537             << "  <MEMC " << name() << ".READ_HEAP_REQ> Requesting HEAP lock "
     1541            << "  <MEMC " << name() << " READ_HEAP_REQ> Requesting HEAP lock "
    15381542            << std::endl;
    15391543      }
     
    15531557
    15541558        // read data in the cache
    1555         size_t set = m_y[(vci_addr_t)(m_cmd_read_addr_fifo.read())];
     1559        size_t set = m_y[(addr_t)(m_cmd_read_addr_fifo.read())];
    15561560        size_t way = r_read_way.read();
    15571561
     
    16251629        if(m_debug_read_fsm)
    16261630        {
    1627           std::cout << "  <MEMC " << name() << ".READ_HEAP_LOCK> Update directory:"
     1631          std::cout << "  <MEMC " << name() << " READ_HEAP_LOCK> Update directory:"
    16281632                    << " tag = " << std::hex << entry.tag
    16291633                    << " set = " << std::dec << set
     
    16771681        {
    16781682          std::cout
    1679               << "  <MEMC " << name() << ".READ_HEAP_WRITE> Add an entry in the heap:"
     1683              << "  <MEMC " << name() << " READ_HEAP_WRITE> Add an entry in the heap:"
    16801684              << " owner_id = " << heap_entry.owner.srcid
    16811685              << " owner_ins = " << heap_entry.owner.inst << std::endl;
     
    17631767      {
    17641768        for(size_t i=0 ; i<m_words ; i++)  r_read_to_tgt_rsp_data[i] = r_read_data[i];
    1765         r_read_to_tgt_rsp_word   = m_x[(vci_addr_t) m_cmd_read_addr_fifo.read()];
     1769        r_read_to_tgt_rsp_word   = m_x[(addr_t) m_cmd_read_addr_fifo.read()];
    17661770        r_read_to_tgt_rsp_length = m_cmd_read_length_fifo.read();
    17671771        r_read_to_tgt_rsp_srcid  = m_cmd_read_srcid_fifo.read();
     
    17761780        if(m_debug_read_fsm)
    17771781        {
    1778           std::cout << "  <MEMC " << name() << ".READ_RSP> Request the TGT_RSP FSM to return data:"
     1782          std::cout << "  <MEMC " << name() << " READ_RSP> Request the TGT_RSP FSM to return data:"
    17791783                    << " rsrcid = " << std::dec << m_cmd_read_srcid_fifo.read()
    17801784                    << " / address = " << std::hex << m_cmd_read_addr_fifo.read()
     
    17921796      {
    17931797        size_t      index     = 0;
    1794         vci_addr_t  addr      = (vci_addr_t) m_cmd_read_addr_fifo.read();
     1798        addr_t      addr      = (addr_t) m_cmd_read_addr_fifo.read();
    17951799        bool        hit_read  = m_trt.hit_read(m_nline[addr], index);
    17961800        bool        hit_write = m_trt.hit_write(m_nline[addr]);
     
    18131817        if(m_debug_read_fsm)
    18141818        {
    1815           std::cout << "  <MEMC " << name() << ".READ_TRT_LOCK> Check TRT:"
     1819          std::cout << "  <MEMC " << name() << " READ_TRT_LOCK> Check TRT:"
    18161820                    << " hit_read = " << hit_read
    18171821                    << " / hit_write = " << hit_write
     
    18301834        m_trt.set(r_read_trt_index.read(),
    18311835                              true,
    1832                               m_nline[(vci_addr_t)(m_cmd_read_addr_fifo.read())],
     1836                              m_nline[(addr_t)(m_cmd_read_addr_fifo.read())],
    18331837                              m_cmd_read_srcid_fifo.read(),
    18341838                              m_cmd_read_trdid_fifo.read(),
     
    18361840                              true,
    18371841                              m_cmd_read_length_fifo.read(),
    1838                               m_x[(vci_addr_t)(m_cmd_read_addr_fifo.read())],
     1842                              m_x[(addr_t)(m_cmd_read_addr_fifo.read())],
    18391843                              std::vector<be_t> (m_words,0),
    18401844                              std::vector<data_t> (m_words,0),
     
    18431847        if(m_debug_read_fsm)
    18441848        {
    1845           std::cout << "  <MEMC " << name() << ".READ_TRT_SET> Write in Transaction Table: " << std::hex
     1849          std::cout << "  <MEMC " << name() << " READ_TRT_SET> Write in Transaction Table: " << std::hex
    18461850                    << " address = " << std::hex << m_cmd_read_addr_fifo.read()
    18471851                    << " / srcid = " << std::dec << m_cmd_read_srcid_fifo.read()
     
    18641868        cmd_read_fifo_get       = true;
    18651869        r_read_to_ixr_cmd_req   = true;
    1866         r_read_to_ixr_cmd_nline = m_nline[(vci_addr_t)(m_cmd_read_addr_fifo.read())];
     1870        r_read_to_ixr_cmd_nline = m_nline[(addr_t)(m_cmd_read_addr_fifo.read())];
    18671871        r_read_to_ixr_cmd_trdid = r_read_trt_index.read();
    18681872        r_read_fsm              = READ_IDLE;
     
    18721876        {
    18731877          std::cout
    1874               << "  <MEMC " << name() << ".READ_TRT_REQ> Request GET transaction for address "
     1878              << "  <MEMC " << name() << " READ_TRT_REQ> Request GET transaction for address "
    18751879              << std::hex << m_cmd_read_addr_fifo.read() << std::endl;
    18761880        }
     
    19291933        // consume a word in the FIFO & write it in the local buffer
    19301934        cmd_write_fifo_get  = true;
    1931         size_t index        = m_x[(vci_addr_t)(m_cmd_write_addr_fifo.read())];
     1935        size_t index        = m_x[(addr_t)(m_cmd_write_addr_fifo.read())];
    19321936
    19331937        r_write_address     = (addr_t)(m_cmd_write_addr_fifo.read());
     
    19591963        if(m_debug_write_fsm)
    19601964        {
    1961           std::cout << "  <MEMC " << name() << ".WRITE_IDLE> Write request "
     1965          std::cout << "  <MEMC " << name() << " WRITE_IDLE> Write request "
    19621966                    << " srcid = " << std::dec << m_cmd_write_srcid_fifo.read()
    19631967                    << " / address = " << std::hex << m_cmd_write_addr_fifo.read()
     
    19791983        {
    19801984          std::cout << "  <MEMC " << name()
    1981                     << ".WRITE_NEXT> Write another word in local buffer"
     1985                    << " WRITE_NEXT> Write another word in local buffer"
    19821986                    << std::endl;
    19831987        }
     
    19861990
    19871991        // check that the next word is in the same cache line
    1988         if((m_nline[(vci_addr_t)(r_write_address.read())]       !=
    1989             m_nline[(vci_addr_t)(m_cmd_write_addr_fifo.read())]))
     1992        if((m_nline[(addr_t)(r_write_address.read())]       !=
     1993            m_nline[(addr_t)(m_cmd_write_addr_fifo.read())]))
    19901994        {
    19911995          std::cout << "VCI_MEM_CACHE ERROR " << name() << " WRITE_NEXT state" << std::endl
     
    20632067      {
    20642068        std::cout
    2065             << "  <MEMC " << name() << ".WRITE_DIR_REQ> Requesting DIR lock "
     2069            << "  <MEMC " << name() << " WRITE_DIR_REQ> Requesting DIR lock "
    20662070            << std::endl;
    20672071      }
     
    21122116        if(m_debug_write_fsm)
    21132117        {
    2114           std::cout << "  <MEMC " << name() << ".WRITE_DIR_LOCK> Check the directory: "
     2118          std::cout << "  <MEMC " << name() << " WRITE_DIR_LOCK> Check the directory: "
    21152119                    << " address = " << std::hex << r_write_address.read()
    21162120                    << " hit = " << std::dec << entry.valid
     
    21182122                    << " is_cnt = " << entry.is_cnt << std::endl;
    21192123          if((r_write_pktid.read() & 0x7) == TYPE_SC)
    2120             std::cout << "  <MEMC " << name() << ".WRITE_DIR_LOCK> global_llsc_table SC access" << std::endl;
     2124            std::cout << "  <MEMC " << name() << " WRITE_DIR_LOCK> global_llsc_table SC access" << std::endl;
    21212125          else
    2122             std::cout << "  <MEMC " << name() << ".WRITE_DIR_LOCK> global_llsc_table SW access" << std::endl;
     2126            std::cout << "  <MEMC " << name() << " WRITE_DIR_LOCK> global_llsc_table SW access" << std::endl;
    21232127        }
    21242128#endif
     
    21402144    {
    21412145      // update local buffer
    2142       size_t set  = m_y[(vci_addr_t)(r_write_address.read())];
     2146      size_t set  = m_y[(addr_t)(r_write_address.read())];
    21432147      size_t way  = r_write_way.read();
    21442148      for(size_t word=0 ; word<m_words ; word++)
     
    21622166      if(m_debug_write_fsm)
    21632167      {
    2164         std::cout << "  <MEMC " << name() << ".WRITE_DIR_READ> Read the cache to complete local buffer" << std::endl;
     2168        std::cout << "  <MEMC " << name() << " WRITE_DIR_READ> Read the cache to complete local buffer" << std::endl;
    21652169      }
    21662170#endif
     
    21872191      entry.ptr            = r_write_ptr.read();
    21882192
    2189       size_t set           = m_y[(vci_addr_t)(r_write_address.read())];
     2193      size_t set           = m_y[(addr_t)(r_write_address.read())];
    21902194      size_t way           = r_write_way.read();
    21912195
     
    22132217          if(m_monitor_ok)
    22142218          {
    2215             vci_addr_t address = (r_write_address.read() & ~(vci_addr_t) 0x3F) | word<<2;
     2219            addr_t address = (r_write_address.read() & ~(addr_t) 0x3F) | word<<2;
    22162220            char buf[80];
    2217             snprintf(buf, 80, "WRITE_DIR_HIT srcid %d", r_write_srcid.read());
    2218             check_monitor(buf, address, r_write_data[word].read());
     2221            snprintf(buf, 80, "WRITE_DIR_HIT srcid %d",
     2222                     (int)r_write_srcid.read());
     2223            check_monitor(buf, address, r_write_data[word].read(), false);
    22192224          }
    22202225        }
     
    22502255        if(no_update)
    22512256        {
    2252           std::cout << "  <MEMC " << name() << ".WRITE_DIR_HIT> Write into cache / No coherence transaction"
     2257          std::cout << "  <MEMC " << name() << " WRITE_DIR_HIT> Write into cache / No coherence transaction"
    22532258                    << std::endl;
    22542259        }
    22552260        else
    22562261        {
    2257           std::cout << "  <MEMC " << name() << ".WRITE_DIR_HIT> Coherence update required:"
     2262          std::cout << "  <MEMC " << name() << " WRITE_DIR_HIT> Coherence update required:"
    22582263                    << " is_cnt = " << r_write_is_cnt.read()
    22592264                    << " nb_copies = " << std::dec << r_write_count.read() << std::endl;
     
    22762281        size_t      trdid      = r_write_trdid.read();
    22772282        size_t      pktid      = r_write_pktid.read();
    2278         addr_t      nline      = m_nline[(vci_addr_t)(r_write_address.read())];
     2283        addr_t      nline      = m_nline[(addr_t)(r_write_address.read())];
    22792284        size_t      nb_copies  = r_write_count.read();
    2280         size_t      set        = m_y[(vci_addr_t)(r_write_address.read())];
     2285        size_t      set        = m_y[(addr_t)(r_write_address.read())];
    22812286        size_t      way        = r_write_way.read();
    22822287
     
    22942299          for(size_t word=0 ; word<m_words ; word++)
    22952300          {
    2296             m_cache_data.write(way, set, word, r_write_data[word].read(), r_write_be[word].read());
     2301            m_cache_data.write(way,
     2302                               set,
     2303                               word,
     2304                               r_write_data[word].read(),
     2305                               r_write_be[word].read());
    22972306
    22982307            if(m_monitor_ok)
    22992308            {
    2300               vci_addr_t address = (r_write_address.read() & ~(vci_addr_t) 0x3F) | word<<2;
     2309              addr_t address = (r_write_address.read() & ~(addr_t) 0x3F) | word<<2;
    23012310              char buf[80];
    2302               snprintf(buf, 80, "WRITE_UPT_LOCK srcid %d", srcid);
    2303               check_monitor(buf, address, r_write_data[word].read());
     2311              snprintf(buf, 80, "WRITE_UPT_LOCK srcid %d", (int)srcid);
     2312              check_monitor(buf, address, r_write_data[word].read(), false);
    23042313            }
    23052314          }
     
    23112320          if(wok)
    23122321          {
    2313             std::cout << "  <MEMC " << name() << ".WRITE_UPT_LOCK> Register the multicast update in UPT / "
     2322            std::cout << "  <MEMC " << name() << " WRITE_UPT_LOCK> Register the multicast update in UPT / "
    23142323                      << " nb_copies = " << r_write_count.read() << std::endl;
    23152324          }
     
    23332342        if(m_debug_write_fsm)
    23342343        {
    2335           std::cout << "  <MEMC " << name() << ".WRITE_UPT_HEAP_LOCK> Get acces to the HEAP" << std::endl;
     2344          std::cout << "  <MEMC " << name() << " WRITE_UPT_HEAP_LOCK> Get acces to the HEAP" << std::endl;
    23362345        }
    23372346#endif
     
    23532362        r_write_to_cc_send_brdcast_req  = false;
    23542363        r_write_to_cc_send_trdid        = r_write_upt_index.read();
    2355         r_write_to_cc_send_nline        = m_nline[(vci_addr_t)(r_write_address.read())];
     2364        r_write_to_cc_send_nline        = m_nline[(addr_t)(r_write_address.read())];
    23562365        r_write_to_cc_send_index        = r_write_word_index.read();
    23572366        r_write_to_cc_send_count        = r_write_word_count.read();
     
    23972406        if(m_debug_write_fsm)
    23982407        {
    2399           std::cout << "  <MEMC " << name() << ".WRITE_UPT_REQ> Post first request to CC_SEND FSM"
     2408          std::cout << "  <MEMC " << name() << " WRITE_UPT_REQ> Post first request to CC_SEND FSM"
    24002409                    << " / srcid = " << std::dec << r_write_copy.read()
    24012410                    << " / inst = "  << std::dec << r_write_copy_inst.read() << std::endl;
     
    24412450        if(m_debug_write_fsm)
    24422451        {
    2443           std::cout << "  <MEMC " << name() << ".WRITE_UPT_NEXT> Post another request to CC_SEND FSM"
     2452          std::cout << "  <MEMC " << name() << " WRITE_UPT_NEXT> Post another request to CC_SEND FSM"
    24442453                    << " / heap_index = " << std::dec << r_write_ptr.read()
    24452454                    << " / srcid = " << std::dec << r_write_copy.read()
     
    24572466        if(m_debug_write_fsm)
    24582467        {
    2459           std::cout << "  <MEMC " << name() << ".WRITE_UPT_NEXT> Skip one entry in heap matching the writer"
     2468          std::cout << "  <MEMC " << name() << " WRITE_UPT_NEXT> Skip one entry in heap matching the writer"
    24602469                    << " / heap_index = " << std::dec << r_write_ptr.read()
    24612470                    << " / srcid = " << std::dec << r_write_copy.read()
     
    25352544          // consume a word in the FIFO & write it in the local buffer
    25362545          cmd_write_fifo_get  = true;
    2537           size_t index        = m_x[(vci_addr_t)(m_cmd_write_addr_fifo.read())];
     2546          size_t index        = m_x[(addr_t)(m_cmd_write_addr_fifo.read())];
    25382547
    25392548          r_write_address     = (addr_t)(m_cmd_write_addr_fifo.read());
     
    25702579        if(m_debug_write_fsm)
    25712580        {
    2572           std::cout << "  <MEMC " << name() << ".WRITE_RSP> Post a request to TGT_RSP FSM: rsrcid = "
     2581          std::cout << "  <MEMC " << name() << " WRITE_RSP> Post a request to TGT_RSP FSM: rsrcid = "
    25732582                    << std::dec << r_write_srcid.read() << std::endl;
    25742583          if(m_cmd_write_addr_fifo.rok())
     
    25942603        if(m_debug_write_fsm)
    25952604        {
    2596           std::cout << "  <MEMC " << name() << ".WRITE_MISS_TRT_LOCK> Check the TRT" << std::endl;
     2605          std::cout << "  <MEMC " << name() << " WRITE_MISS_TRT_LOCK> Check the TRT" << std::endl;
    25972606        }
    25982607#endif
    25992608        size_t  hit_index = 0;
    26002609        size_t  wok_index = 0;
    2601         vci_addr_t  addr  = (vci_addr_t) r_write_address.read();
     2610        addr_t  addr  = (addr_t) r_write_address.read();
    26022611        bool    hit_read  = m_trt.hit_read(m_nline[addr], hit_index);
    26032612        bool    hit_write = m_trt.hit_write(m_nline[addr]);
     
    26312640      if(m_debug_write_fsm)
    26322641      {
    2633         std::cout << "  <MEMC " << name() << ".WRITE_WAIT> Releases the locks before retry" << std::endl;
     2642        std::cout << "  <MEMC " << name() << " WRITE_WAIT> Releases the locks before retry" << std::endl;
    26342643      }
    26352644#endif
     
    26542663        m_trt.set(r_write_trt_index.read(),
    26552664                              true,     // read request to XRAM
    2656                               m_nline[(vci_addr_t)(r_write_address.read())],
     2665                              m_nline[(addr_t)(r_write_address.read())],
    26572666                              r_write_srcid.read(),
    26582667                              r_write_trdid.read(),
     
    26682677        if(m_debug_write_fsm)
    26692678        {
    2670           std::cout << "  <MEMC " << name() << ".WRITE_MISS_TRT_SET> Set a new entry in TRT" << std::endl;
     2679          std::cout << "  <MEMC " << name() << " WRITE_MISS_TRT_SET> Set a new entry in TRT" << std::endl;
    26712680        }
    26722681#endif
     
    26972706        if(m_debug_write_fsm)
    26982707        {
    2699           std::cout << "  <MEMC " << name() << ".WRITE_MISS_TRT_DATA> Modify an existing entry in TRT" << std::endl;
     2708          std::cout << "  <MEMC " << name() << " WRITE_MISS_TRT_DATA> Modify an existing entry in TRT" << std::endl;
    27002709          m_trt.print(r_write_trt_index.read());
    27012710        }
     
    27122721        r_write_to_ixr_cmd_req   = true;
    27132722        r_write_to_ixr_cmd_write = false;
    2714         r_write_to_ixr_cmd_nline = m_nline[(vci_addr_t)(r_write_address.read())];
     2723        r_write_to_ixr_cmd_nline = m_nline[(addr_t)(r_write_address.read())];
    27152724        r_write_to_ixr_cmd_trdid = r_write_trt_index.read();
    27162725        r_write_fsm              = WRITE_RSP;
     
    27192728        if(m_debug_write_fsm)
    27202729        {
    2721           std::cout << "  <MEMC " << name() << ".WRITE_MISS_XRAM_REQ> Post a GET request to the IXR_CMD FSM" << std::endl;
     2730          std::cout << "  <MEMC " << name() << " WRITE_MISS_XRAM_REQ> Post a GET request to the IXR_CMD FSM" << std::endl;
    27222731        }
    27232732#endif
     
    27462755        if(m_debug_write_fsm)
    27472756        {
    2748           std::cout << "  <MEMC " << name() << ".WRITE_BC_TRT_LOCK> Check TRT : wok = "
     2757          std::cout << "  <MEMC " << name() << " WRITE_BC_TRT_LOCK> Check TRT : wok = "
    27492758                    << wok << " / index = " << wok_index << std::endl;
    27502759        }
     
    27642773        size_t      trdid     = r_write_trdid.read();
    27652774        size_t      pktid     = r_write_pktid.read();
    2766         addr_t      nline     = m_nline[(vci_addr_t)(r_write_address.read())];
     2775        addr_t      nline     = m_nline[(addr_t)(r_write_address.read())];
    27672776        size_t      nb_copies = r_write_count.read();
    27682777
     
    27822791          if(wok)
    27832792          {
    2784             std::cout << "  <MEMC " << name() << ".WRITE_BC_UPT_LOCK> Register the broadcast inval in UPT / "
     2793            std::cout << "  <MEMC " << name() << " WRITE_BC_UPT_LOCK> Register the broadcast inval in UPT / "
    27852794                      << " nb_copies = " << r_write_count.read() << std::endl;
    27862795          }
     
    28122821      m_trt.set(r_write_trt_index.read(),
    28132822                            false,    // write request to XRAM
    2814                             m_nline[(vci_addr_t)(r_write_address.read())],
     2823                            m_nline[(addr_t)(r_write_address.read())],
    28152824                            0,
    28162825                            0,
     
    28362845      entry.ptr           = 0;
    28372846      entry.count         = 0;
    2838       size_t set          = m_y[(vci_addr_t)(r_write_address.read())];
     2847      size_t set          = m_y[(addr_t)(r_write_address.read())];
    28392848      size_t way          = r_write_way.read();
    28402849
     
    28442853      if(m_debug_write_fsm)
    28452854      {
    2846         std::cout << "  <MEMC " << name() << ".WRITE_BC_DIR_INVAL> Invalidate the directory entry: @ = "
     2855        std::cout << "  <MEMC " << name() << " WRITE_BC_DIR_INVAL> Invalidate the directory entry: @ = "
    28472856                  << r_write_address.read() << " / register the put transaction in TRT:" << std::endl;
    28482857      }
     
    28602869        r_write_to_cc_send_brdcast_req = true;
    28612870        r_write_to_cc_send_trdid       = r_write_upt_index.read();
    2862         r_write_to_cc_send_nline       = m_nline[(vci_addr_t)(r_write_address.read())];
     2871        r_write_to_cc_send_nline       = m_nline[(addr_t)(r_write_address.read())];
    28632872        r_write_to_cc_send_index       = 0;
    28642873        r_write_to_cc_send_count       = 0;
     
    28722881
    28732882#if DEBUG_MEMC_WRITE
    2874         if(m_debug_write_fsm)
    2875         {
    2876           std::cout << "  <MEMC " << name() << ".WRITE_BC_CC_SEND> Post a broadcast request to CC_SEND FSM" << std::endl;
    2877         }
     2883if(m_debug_write_fsm)
     2884{
     2885    std::cout << "  <MEMC " << name()
     2886              << " WRITE_BC_CC_SEND> Post a broadcast request to CC_SEND FSM" << std::endl;
     2887}
    28782888#endif
    28792889      }
     
    28882898        r_write_to_ixr_cmd_req     = true;
    28892899        r_write_to_ixr_cmd_write   = true;
    2890         r_write_to_ixr_cmd_nline   = m_nline[(vci_addr_t)(r_write_address.read())];
     2900        r_write_to_ixr_cmd_nline   = m_nline[(addr_t)(r_write_address.read())];
    28912901        r_write_to_ixr_cmd_trdid   = r_write_trt_index.read();
    28922902
     
    28962906
    28972907#if DEBUG_MEMC_WRITE
    2898         if(m_debug_write_fsm)
    2899         {
    2900           std::cout << "  <MEMC " << name() << ".WRITE_BC_XRAM_REQ> Post a put request to IXR_CMD FSM" << std::endl;
    2901         }
     2908if(m_debug_write_fsm)
     2909{
     2910     std::cout << "  <MEMC " << name()
     2911               << " WRITE_BC_XRAM_REQ> Post a put request to IXR_CMD FSM" << std::endl;
     2912}
    29022913#endif
    29032914      }
     
    29102921  ///////////////////////////////////////////////////////////////////////
    29112922  // The IXR_CMD fsm controls the command packets to the XRAM :
     2923  // It handles requests from the READ, WRITE, CAS & XRAM_RSP FSMs
     2924  // with a round-robin priority.
     2925  //
    29122926  // - It sends a single cell VCI read request to the XRAM in case of MISS
    29132927  // posted by the READ, WRITE or CAS FSMs : the TRDID field contains
     
    29152929  // The VCI response is a multi-cell packet : the N cells contain
    29162930  // the N data words.
     2931  //
    29172932  // - It sends a multi-cell VCI write when the XRAM_RSP FSM, WRITE FSM
    29182933  // or CAS FSM request to save a dirty line to the XRAM.
    29192934  // The VCI response is a single cell packet.
    2920   // This FSM handles requests from the READ, WRITE, CAS & XRAM_RSP FSMs
    2921   // with a round-robin priority.
    29222935  ////////////////////////////////////////////////////////////////////////
    29232936
     
    29262939      ////////////////////////
    29272940    case IXR_CMD_READ_IDLE:
    2928       if(r_write_to_ixr_cmd_req)     r_ixr_cmd_fsm = IXR_CMD_WRITE_NLINE;
     2941      if     (r_write_to_ixr_cmd_req)    r_ixr_cmd_fsm = IXR_CMD_WRITE_NLINE;
    29292942      else if(r_cas_to_ixr_cmd_req)      r_ixr_cmd_fsm = IXR_CMD_CAS_NLINE;
    29302943      else if(r_xram_rsp_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_XRAM_DATA;
     
    29332946      ////////////////////////
    29342947    case IXR_CMD_WRITE_IDLE:
    2935       if(r_cas_to_ixr_cmd_req)      r_ixr_cmd_fsm = IXR_CMD_CAS_NLINE;
     2948      if(r_cas_to_ixr_cmd_req)           r_ixr_cmd_fsm = IXR_CMD_CAS_NLINE;
    29362949      else if(r_xram_rsp_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_XRAM_DATA;
    29372950      else if(r_read_to_ixr_cmd_req)     r_ixr_cmd_fsm = IXR_CMD_READ_NLINE;
    2938       else if(r_write_to_ixr_cmd_req)     r_ixr_cmd_fsm = IXR_CMD_WRITE_NLINE;
     2951      else if(r_write_to_ixr_cmd_req)    r_ixr_cmd_fsm = IXR_CMD_WRITE_NLINE;
    29392952      break;
    29402953      ////////////////////////
    29412954    case IXR_CMD_CAS_IDLE:
    2942       if(r_xram_rsp_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_XRAM_DATA;
     2955      if(r_xram_rsp_to_ixr_cmd_req)      r_ixr_cmd_fsm = IXR_CMD_XRAM_DATA;
    29432956      else if(r_read_to_ixr_cmd_req)     r_ixr_cmd_fsm = IXR_CMD_READ_NLINE;
    2944       else if(r_write_to_ixr_cmd_req)     r_ixr_cmd_fsm = IXR_CMD_WRITE_NLINE;
     2957      else if(r_write_to_ixr_cmd_req)    r_ixr_cmd_fsm = IXR_CMD_WRITE_NLINE;
    29452958      else if(r_cas_to_ixr_cmd_req)      r_ixr_cmd_fsm = IXR_CMD_CAS_NLINE;
    29462959      break;
    29472960      ////////////////////////
    29482961    case IXR_CMD_XRAM_IDLE:
    2949       if(r_read_to_ixr_cmd_req)     r_ixr_cmd_fsm = IXR_CMD_READ_NLINE;
    2950       else if(r_write_to_ixr_cmd_req)     r_ixr_cmd_fsm = IXR_CMD_WRITE_NLINE;
     2962      if(r_read_to_ixr_cmd_req)          r_ixr_cmd_fsm = IXR_CMD_READ_NLINE;
     2963      else if(r_write_to_ixr_cmd_req)    r_ixr_cmd_fsm = IXR_CMD_WRITE_NLINE;
    29512964      else if(r_cas_to_ixr_cmd_req)      r_ixr_cmd_fsm = IXR_CMD_CAS_NLINE;
    29522965      else if(r_xram_rsp_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_XRAM_DATA;
     
    29602973
    29612974#if DEBUG_MEMC_IXR_CMD
    2962         if(m_debug_ixr_cmd_fsm)
    2963         {
    2964           std::cout << "  <MEMC " << name() << ".IXR_CMD_READ_NLINE> Send a get request to xram" << std::endl;
    2965         }
     2975if(m_debug_ixr_cmd_fsm)
     2976{
     2977    std::cout << "  <MEMC " << name()
     2978              << " IXR_CMD_READ_NLINE> Send a get request to xram" << std::endl;
     2979}
    29662980#endif
    29672981      }
     
    29712985      if(p_vci_ixr.cmdack)
    29722986      {
    2973         if(r_write_to_ixr_cmd_write.read())
    2974         {
    2975           if(r_ixr_cmd_cpt.read() == (m_words - 1))
     2987        if(r_write_to_ixr_cmd_write.read())   // PUT
     2988        {
     2989          if(r_ixr_cmd_cpt.read() == (m_words - 2))
    29762990          {
    29772991            r_ixr_cmd_cpt = 0;
     
    29812995          else
    29822996          {
    2983             r_ixr_cmd_cpt = r_ixr_cmd_cpt + 1;
     2997            r_ixr_cmd_cpt = r_ixr_cmd_cpt + 2;
    29842998          }
    29852999
    29863000#if DEBUG_MEMC_IXR_CMD
    2987           if(m_debug_ixr_cmd_fsm)
    2988           {
    2989             std::cout << "  <MEMC " << name() << ".IXR_CMD_WRITE_NLINE> Send a put request to xram" << std::endl;
    2990           }
    2991 #endif
    2992         }
    2993         else
     3001if(m_debug_ixr_cmd_fsm)
     3002{
     3003    std::cout << "  <MEMC " << name()
     3004              << " IXR_CMD_WRITE_NLINE> Send a put request to xram" << std::endl;
     3005}
     3006#endif
     3007        }
     3008        else                                  // GET
    29943009        {
    29953010          r_ixr_cmd_fsm = IXR_CMD_WRITE_IDLE;
     
    29973012
    29983013#if DEBUG_MEMC_IXR_CMD
    2999           if(m_debug_ixr_cmd_fsm)
    3000           {
    3001             std::cout << "  <MEMC " << name() << ".IXR_CMD_WRITE_NLINE> Send a get request to xram" << std::endl;
    3002           }
     3014if(m_debug_ixr_cmd_fsm)
     3015{
     3016    std::cout << "  <MEMC " << name()
     3017              << " IXR_CMD_WRITE_NLINE> Send a get request to xram" << std::endl;
     3018}
    30033019#endif
    30043020        }
     
    30093025      if(p_vci_ixr.cmdack)
    30103026      {
    3011         if(r_cas_to_ixr_cmd_write.read())
    3012         {
    3013           if(r_ixr_cmd_cpt.read() == (m_words - 1))
     3027        if(r_cas_to_ixr_cmd_write.read()) // PUT
     3028        {
     3029          if(r_ixr_cmd_cpt.read() == (m_words - 2))
    30143030          {
    30153031            r_ixr_cmd_cpt = 0;
     
    30193035          else
    30203036          {
    3021             r_ixr_cmd_cpt = r_ixr_cmd_cpt + 1;
     3037            r_ixr_cmd_cpt = r_ixr_cmd_cpt + 2;
    30223038          }
    30233039
    30243040#if DEBUG_MEMC_IXR_CMD
    3025           if(m_debug_ixr_cmd_fsm)
    3026           {
    3027             std::cout << "  <MEMC " << name() << ".IXR_CMD_CAS_NLINE> Send a put request to xram" << std::endl;
    3028           }
    3029 #endif
    3030         }
    3031         else
     3041if(m_debug_ixr_cmd_fsm)
     3042{
     3043    std::cout << "  <MEMC " << name()
     3044              << " IXR_CMD_CAS_NLINE> Send a put request to xram" << std::endl;
     3045}
     3046#endif
     3047        }
     3048        else                            // GET
    30323049        {
    30333050          r_ixr_cmd_fsm = IXR_CMD_CAS_IDLE;
     
    30353052
    30363053#if DEBUG_MEMC_IXR_CMD
    3037           if(m_debug_ixr_cmd_fsm)
    3038           {
    3039             std::cout << "  <MEMC " << name() << ".IXR_CMD_CAS_NLINE> Send a get request to xram" << std::endl;
    3040           }
     3054if(m_debug_ixr_cmd_fsm)
     3055{
     3056    std::cout << "  <MEMC " << name()
     3057              << " IXR_CMD_CAS_NLINE> Send a get request to xram" << std::endl;
     3058}
    30413059#endif
    30423060        }
     
    30473065      if(p_vci_ixr.cmdack)
    30483066      {
    3049         if(r_ixr_cmd_cpt.read() == (m_words - 1))
     3067        if(r_ixr_cmd_cpt.read() == (m_words - 2))
    30503068        {
    30513069          r_ixr_cmd_cpt = 0;
     
    30553073        else
    30563074        {
    3057           r_ixr_cmd_cpt = r_ixr_cmd_cpt + 1;
     3075          r_ixr_cmd_cpt = r_ixr_cmd_cpt + 2;
    30583076        }
    30593077
    30603078#if DEBUG_MEMC_IXR_CMD
    3061         if(m_debug_ixr_cmd_fsm)
    3062         {
    3063           std::cout << "  <MEMC " << name() << ".IXR_CMD_XRAM_DATA> Send a put request to xram" << std::endl;
    3064         }
     3079if(m_debug_ixr_cmd_fsm)
     3080{
     3081    std::cout << "  <MEMC " << name()
     3082              << " IXR_CMD_XRAM_DATA> Send a put request to xram" << std::endl;
     3083}
    30653084#endif
    30663085      }
     
    30903109  switch(r_ixr_rsp_fsm.read())
    30913110  {
    3092       //////////////////
    3093     case IXR_RSP_IDLE:  // test if it's a get or a put transaction
     3111    //////////////////
     3112    case IXR_RSP_IDLE:  // test transaction type: PUT/GET
    30943113    {
    30953114      if(p_vci_ixr.rspval.read())
     
    30973116        r_ixr_rsp_cpt   = 0;
    30983117        r_ixr_rsp_trt_index = p_vci_ixr.rtrdid.read();
    3099         if(p_vci_ixr.reop.read() && !(p_vci_ixr.rerror.read() &0x1))   // put transaction
     3118        if(p_vci_ixr.reop.read() && !(p_vci_ixr.rerror.read() &0x1))   // PUT transaction
    31003119        {
    31013120          r_ixr_rsp_fsm = IXR_RSP_ACK;
    31023121
    31033122#if DEBUG_MEMC_IXR_RSP
    3104           if(m_debug_ixr_rsp_fsm)
    3105           {
    3106             std::cout << "  <MEMC " << name() << ".IXR_RSP_IDLE> Response from XRAM to a put transaction" << std::endl;
    3107           }
    3108 #endif
    3109         }
    3110         else                     // get transaction
     3123if(m_debug_ixr_rsp_fsm)
     3124{
     3125    std::cout << "  <MEMC " << name()
     3126              << " IXR_RSP_IDLE> Response from XRAM to a put transaction" << std::endl;
     3127}
     3128#endif
     3129        }
     3130        else                                                         // GET transaction
    31113131        {
    31123132          r_ixr_rsp_fsm = IXR_RSP_TRT_READ;
    31133133
    31143134#if DEBUG_MEMC_IXR_RSP
    3115           if(m_debug_ixr_rsp_fsm)
    3116           {
    3117             std::cout << "  <MEMC " << name() << ".IXR_RSP_IDLE> Response from XRAM to a get transaction" << std::endl;
    3118           }
    3119 #endif
    3120         }
    3121       }
    3122       break;
    3123     }
    3124     ////////////////////////
    3125     case IXR_RSP_ACK:        // Aknowledge the VCI response
     3135if(m_debug_ixr_rsp_fsm)
     3136{
     3137    std::cout << "  <MEMC " << name()
     3138              << " IXR_RSP_IDLE> Response from XRAM to a get transaction" << std::endl;
     3139}
     3140#endif
     3141        }
     3142      }
     3143      break;
     3144    }
     3145    /////////////////
     3146    case IXR_RSP_ACK:        // Aknowledge the VCI response for a PUT
    31263147    {
    31273148      if(p_vci_ixr.rspval.read()) r_ixr_rsp_fsm = IXR_RSP_TRT_ERASE;
    31283149
    31293150#if DEBUG_MEMC_IXR_RSP
    3130       if(m_debug_ixr_rsp_fsm)
    3131       {
    3132         std::cout << "  <MEMC " << name() << ".IXR_RSP_ACK>" << std::endl;
    3133       }
     3151if(m_debug_ixr_rsp_fsm)
     3152{
     3153    std::cout << "  <MEMC " << name() << " IXR_RSP_ACK>" << std::endl;
     3154}
    31343155#endif
    31353156      break;
     
    31443165
    31453166#if DEBUG_MEMC_IXR_RSP
    3146         if(m_debug_ixr_rsp_fsm)
    3147         {
    3148           std::cout << "  <MEMC " << name() << ".IXR_RSP_TRT_ERASE> Erase TRT entry "
     3167if(m_debug_ixr_rsp_fsm)
     3168{
     3169          std::cout << "  <MEMC " << name() << " IXR_RSP_TRT_ERASE> Erase TRT entry "
    31493170                    << r_ixr_rsp_trt_index.read() << std::endl;
    31503171        }
     
    31533174      break;
    31543175    }
    3155     ///////////////////////
    3156     case IXR_RSP_TRT_READ:    // write data in the TRT
     3176    //////////////////////
     3177    case IXR_RSP_TRT_READ:    // write a 64 bits data in the TRT
    31573178    {
    31583179      if((r_alloc_trt_fsm.read() == ALLOC_TRT_IXR_RSP) &&  p_vci_ixr.rspval)
    31593180      {
    3160         size_t index    = r_ixr_rsp_trt_index.read();
    3161         bool   eop    = p_vci_ixr.reop.read();
    3162         data_t data   = p_vci_ixr.rdata.read();
    3163         bool   error    = ((p_vci_ixr.rerror.read() & 0x1) == 1);
    3164         assert(((eop == (r_ixr_rsp_cpt.read() == (m_words-1))) || p_vci_ixr.rerror.read())
     3181        size_t      index    = r_ixr_rsp_trt_index.read();
     3182        bool        eop      = p_vci_ixr.reop.read();
     3183        wide_data_t data     = p_vci_ixr.rdata.read();
     3184        bool        error    = ((p_vci_ixr.rerror.read() & 0x1) == 1);
     3185
     3186        assert(((eop == (r_ixr_rsp_cpt.read() == (m_words-2))) || p_vci_ixr.rerror.read())
    31653187               and "Error in VCI_MEM_CACHE : invalid length for a response from XRAM");
    3166         m_trt.write_rsp(index,
    3167                                     r_ixr_rsp_cpt.read(),
    3168                                     data,
    3169                                     error);
    3170         r_ixr_rsp_cpt = r_ixr_rsp_cpt.read() + 1;
     3188
     3189        m_trt.write_rsp( index,
     3190                         r_ixr_rsp_cpt.read(),
     3191                         data,
     3192                         error);
     3193
     3194        r_ixr_rsp_cpt = r_ixr_rsp_cpt.read() + 2;
     3195
    31713196        if(eop)
    31723197        {
     
    31763201
    31773202#if DEBUG_MEMC_IXR_RSP
    3178         if(m_debug_ixr_rsp_fsm)
    3179         {
    3180           std::cout << "  <MEMC " << name() << ".IXR_RSP_TRT_READ> Writing a word in TRT : "
    3181                     << " index = " << std::dec << index
    3182                     << " / word = " << r_ixr_rsp_cpt.read()
    3183                     << " / data = " << std::hex << data << std::endl;
    3184         }
     3203if(m_debug_ixr_rsp_fsm)
     3204{
     3205    std::cout << "  <MEMC " << name() << " IXR_RSP_TRT_READ> Writing a word in TRT : "
     3206              << " index = " << std::dec << index
     3207              << " / word = " << r_ixr_rsp_cpt.read()
     3208              << " / data = " << std::hex << data << std::endl;
     3209}
    31853210#endif
    31863211      }
     
    32313256          if(m_debug_xram_rsp_fsm)
    32323257          {
    3233             std::cout << "  <MEMC " << name() << ".XRAM_RSP_IDLE> Available cache line in TRT:"
     3258            std::cout << "  <MEMC " << name() << " XRAM_RSP_IDLE> Available cache line in TRT:"
    32343259                      << " index = " << std::dec << index << std::endl;
    32353260          }
     
    32583283
    32593284#if DEBUG_MEMC_XRAM_RSP
    3260         if(m_debug_xram_rsp_fsm)
    3261         {
    3262           std::cout << "  <MEMC " << name() << ".XRAM_RSP_DIR_LOCK> Get access to directory" << std::endl;
    3263         }
     3285if(m_debug_xram_rsp_fsm)
     3286{
     3287    std::cout << "  <MEMC " << name()
     3288              << " XRAM_RSP_DIR_LOCK> Get access to directory" << std::endl;
     3289}
    32643290#endif
    32653291      }
     
    32743300        // selects & extracts a victim line from cache
    32753301        size_t way = 0;
    3276         size_t set = m_y[(vci_addr_t)(r_xram_rsp_trt_buf.nline * m_words * 4)];
     3302        size_t set = m_y[(addr_t)(r_xram_rsp_trt_buf.nline * m_words * 4)];
    32773303
    32783304        DirectoryEntry victim(m_cache_directory.select(set, way));
     
    33093335        if(m_debug_xram_rsp_fsm)
    33103336        {
    3311           std::cout << "  <MEMC " << name() << ".XRAM_RSP_TRT_COPY> Select a slot: "
     3337          std::cout << "  <MEMC " << name() << " XRAM_RSP_TRT_COPY> Select a slot: "
    33123338                    << " way = " << std::dec << way
    33133339                    << " / set = " << set
     
    33393365          if(m_debug_xram_rsp_fsm)
    33403366          {
    3341             std::cout << "  <MEMC " << name() << ".XRAM_RSP_INVAL_LOCK> Get acces to UPT,"
     3367            std::cout << "  <MEMC " << name() << " XRAM_RSP_INVAL_LOCK> Get acces to UPT,"
    33423368                      << " but an invalidation is already registered at this address" << std::endl;
    33433369            m_upt.print();
     
    33533379          if(m_debug_xram_rsp_fsm)
    33543380          {
    3355             std::cout << "  <MEMC " << name() << ".XRAM_RSP_INVAL_LOCK> Get acces to UPT,"
     3381            std::cout << "  <MEMC " << name() << " XRAM_RSP_INVAL_LOCK> Get acces to UPT,"
    33563382                      << " but the table is full" << std::endl;
    33573383            m_upt.print();
     
    33663392          if(m_debug_xram_rsp_fsm)
    33673393          {
    3368             std::cout << "  <MEMC " << name() << ".XRAM_RSP_INVAL_LOCK> Get acces to UPT" << std::endl;
     3394            std::cout << "  <MEMC " << name() << " XRAM_RSP_INVAL_LOCK> Get acces to UPT" << std::endl;
    33693395          }
    33703396#endif
     
    34023428        if(m_monitor_ok)
    34033429        {
    3404           vci_addr_t address = r_xram_rsp_trt_buf.nline<<6 | word<<2;
    3405           check_monitor("XRAM_RSP_DIR_UPDT", address, r_xram_rsp_trt_buf.wdata[word]);
     3430          addr_t address = r_xram_rsp_trt_buf.nline<<6 | word<<2;
     3431          check_monitor("XRAM_RSP_DIR_UPDT", address, r_xram_rsp_trt_buf.wdata[word], false);
    34063432        }
    34073433      }
     
    34653491      if(m_debug_xram_rsp_fsm)
    34663492      {
    3467         std::cout << "  <MEMC " << name() << ".XRAM_RSP_DIR_UPDT> Directory update: "
     3493        std::cout << "  <MEMC " << name() << " XRAM_RSP_DIR_UPDT> Directory update: "
    34683494                  << " way = " << std::dec << way
    34693495                  << " / set = " << set
     
    35103536        if(m_debug_xram_rsp_fsm)
    35113537        {
    3512           std::cout << "  <MEMC " << name() << ".XRAM_RSP_TRT_DIRTY> Set TRT entry for the put transaction:"
     3538          std::cout << "  <MEMC " << name() << " XRAM_RSP_TRT_DIRTY> Set TRT entry for the put transaction:"
    35133539                    << " dirty victim line = " << r_xram_rsp_victim_nline.read() << std::endl;
    35143540        }
     
    35433569        if(m_debug_xram_rsp_fsm)
    35443570        {
    3545           std::cout << "  <MEMC " << name() << ".XRAM_RSP_DIR_RSP> Request the TGT_RSP FSM to return data:"
     3571          std::cout << "  <MEMC " << name() << " XRAM_RSP_DIR_RSP> Request the TGT_RSP FSM to return data:"
    35463572                    << " rsrcid = " << std::dec << r_xram_rsp_trt_buf.srcid
    35473573                    << " / address = " << std::hex << r_xram_rsp_trt_buf.nline*m_words*4
     
    35813607        if(m_debug_xram_rsp_fsm)
    35823608        {
    3583           std::cout << "  <MEMC " << name() << ".XRAM_RSP_INVAL> Send an inval request to CC_SEND FSM:"
     3609          std::cout << "  <MEMC " << name() << " XRAM_RSP_INVAL> Send an inval request to CC_SEND FSM:"
    35843610                    << " victim line = " << r_xram_rsp_victim_nline.read() << std::endl;
    35853611        }
     
    36073633        if(m_debug_xram_rsp_fsm)
    36083634        {
    3609           std::cout << "  <MEMC " << name() << ".XRAM_RSP_WRITE_DIRTY> Send the put request to IXR_CMD FSM:"
     3635          std::cout << "  <MEMC " << name() << " XRAM_RSP_WRITE_DIRTY> Send the put request to IXR_CMD FSM:"
    36103636                    << " victim line = " << r_xram_rsp_victim_nline.read() << std::endl;
    36113637        }
     
    36283654      {
    36293655        std::cout
    3630             << "  <MEMC " << name() << ".XRAM_RSP_HEAP_REQ> Requesting HEAP lock "
     3656            << "  <MEMC " << name() << " XRAM_RSP_HEAP_REQ> Requesting HEAP lock "
    36313657            << std::endl;
    36323658      }
     
    36693695        if(m_debug_xram_rsp_fsm)
    36703696        {
    3671           std::cout << "  <MEMC " << name() << ".XRAM_RSP_HEAP_ERASE> Erase the list of copies:"
     3697          std::cout << "  <MEMC " << name() << " XRAM_RSP_HEAP_ERASE> Erase the list of copies:"
    36723698                    << " srcid = " << std::dec << entry.owner.srcid
    36733699                    << " / inst = " << std::dec << entry.owner.inst << std::endl;
     
    37123738      if(m_debug_xram_rsp_fsm)
    37133739      {
    3714         std::cout << "  <MEMC " << name() << ".XRAM_RSP_HEAP_LAST> Heap housekeeping" << std::endl;
     3740        std::cout << "  <MEMC " << name() << " XRAM_RSP_HEAP_LAST> Heap housekeeping" << std::endl;
    37153741      }
    37163742#endif
     
    37293755      if(m_debug_xram_rsp_fsm)
    37303756      {
    3731         std::cout << "  <MEMC " << name() << ".XRAM_RSP_ERROR_ERASE> Error reported by XRAM / erase the TRT entry" << std::endl;
     3757        std::cout << "  <MEMC " << name() << " XRAM_RSP_ERROR_ERASE> Error reported by XRAM / erase the TRT entry" << std::endl;
    37323758      }
    37333759#endif
     
    37533779        if(m_debug_xram_rsp_fsm)
    37543780        {
    3755           std::cout << "  <MEMC " << name() << ".XRAM_RSP_ERROR_RSP> Request a response error to TGT_RSP FSM:"
     3781          std::cout << "  <MEMC " << name() << " XRAM_RSP_ERROR_RSP> Request a response error to TGT_RSP FSM:"
    37563782                    << " srcid = " << std::dec << r_xram_rsp_trt_buf.srcid << std::endl;
    37573783        }
     
    38213847        std::cout
    38223848            << "  <MEMC "         << name()
    3823             << ".CLEANUP_IDLE> Cleanup request:" << std::hex
     3849            << " CLEANUP_IDLE> Cleanup request:" << std::hex
    38243850            << " / owner_id = "   << srcid
    38253851            << " / owner_ins = "  << (type == DspinDhccpParam::TYPE_CLEANUP_INST)
     
    38583884        std::cout
    38593885            << "  <MEMC "         << name()
    3860             << ".CLEANUP_GET_NLINE> Cleanup request:"
     3886            << " CLEANUP_GET_NLINE> Cleanup request:"
    38613887            << std::hex
    38623888            << " / address = "    << nline * m_words * 4
     
    38783904      {
    38793905        std::cout
    3880             << "  <MEMC " << name() << ".CLEANUP_DIR_REQ> Requesting DIR lock "
     3906            << "  <MEMC " << name() << " CLEANUP_DIR_REQ> Requesting DIR lock "
    38813907            << std::endl;
    38823908      }
     
    39503976        std::cout
    39513977            << "  <MEMC " << name()
    3952             << ".CLEANUP_DIR_LOCK> Test directory status: "
     3978            << " CLEANUP_DIR_LOCK> Test directory status: "
    39533979            << std::hex
    39543980            << " line = "         << cleanup_address
     
    39804006
    39814007      size_t way         = r_cleanup_way.read();
    3982       size_t set         = m_y[(vci_addr_t)(r_cleanup_nline.read()*m_words*4)];
     4008      size_t set         = m_y[(addr_t)(r_cleanup_nline.read()*m_words*4)];
    39834009      bool   match_srcid = (r_cleanup_copy.read() == r_cleanup_srcid.read());
    39844010
     
    40264052        std::cout
    40274053            << "  <MEMC " << name()
    4028             << ".CLEANUP_DIR_WRITE> Update directory:"
     4054            << " CLEANUP_DIR_WRITE> Update directory:"
    40294055            << std::hex
    40304056            << " address = "   << r_cleanup_nline.read() * m_words * 4
     
    40524078        std::cout
    40534079            << "  <MEMC " << name()
    4054             << ".CLEANUP_HEAP_REQ> HEAP lock acquired "
     4080            << " CLEANUP_HEAP_REQ> HEAP lock acquired "
    40554081            << std::endl;
    40564082      }
     
    40754101
    40764102      size_t way            = r_cleanup_way.read();
    4077       size_t set            = m_y[(vci_addr_t)(r_cleanup_nline.read() *m_words*4)];
     4103      size_t set            = m_y[(addr_t)(r_cleanup_nline.read() *m_words*4)];
    40784104
    40794105      HeapEntry heap_entry  = m_heap.read(r_cleanup_ptr.read());
     
    42044230        std::cout
    42054231            << "  <MEMC " << name()
    4206             << ".CLEANUP_HEAP_LOCK> Checks matching:"
     4232            << " CLEANUP_HEAP_LOCK> Checks matching:"
    42074233            << " address = "      << r_cleanup_nline.read() * m_words * 4
    42084234            << " / dir_id = "     << r_cleanup_copy.read()
     
    42834309          std::cout
    42844310              << "  <MEMC " << name()
    4285               << ".CLEANUP_HEAP_SEARCH> Matching copy not found, search next:"
     4311              << " CLEANUP_HEAP_SEARCH> Matching copy not found, search next:"
    42864312              << std::endl;
    42874313        }
     
    42904316          std::cout
    42914317              << "  <MEMC " << name()
    4292               << ".CLEANUP_HEAP_SEARCH> Matching copy found:"
     4318              << " CLEANUP_HEAP_SEARCH> Matching copy found:"
    42934319              << std::endl;
    42944320        }
     
    43504376        std::cout
    43514377            << "  <MEMC " << name()
    4352             << ".CLEANUP_HEAP_SEARCH> Remove the copy in the linked list"
     4378            << " CLEANUP_HEAP_SEARCH> Remove the copy in the linked list"
    43534379            << std::endl;
    43544380      }
     
    43994425        std::cout
    44004426            << "  <MEMC " << name()
    4401             << ".CLEANUP_HEAP_SEARCH> Update the list of free entries"
     4427            << " CLEANUP_HEAP_SEARCH> Update the list of free entries"
    44024428            << std::endl;
    44034429      }
     
    44274453          std::cout
    44284454              << "  <MEMC " << name()
    4429               << ".CLEANUP_UPT_LOCK> Unexpected cleanup"
     4455              << " CLEANUP_UPT_LOCK> Unexpected cleanup"
    44304456              << " with no corresponding UPT entry:"
    44314457              << " address = " << std::hex
     
    44514477        std::cout
    44524478            << "  <MEMC " << name()
    4453             << ".CLEANUP_UPT_LOCK> Cleanup matching pending"
     4479            << " CLEANUP_UPT_LOCK> Cleanup matching pending"
    44544480            << " invalidate transaction on UPT:"
    44554481            << std::hex
     
    44964522        std::cout
    44974523            << "  <MEMC "      << name()
    4498             << ".CLEANUP_UPT_DECREMENT> Decrement response counter in UPT:"
     4524            << " CLEANUP_UPT_DECREMENT> Decrement response counter in UPT:"
    44994525            << " UPT_index = " << r_cleanup_index.read()
    45004526            << " rsp_count = " << count
     
    45354561        std::cout
    45364562            << "  <MEMC "      << name()
    4537             << ".CLEANUP_UPT_CLEAR> Clear entry in UPT:"
     4563            << " CLEANUP_UPT_CLEAR> Clear entry in UPT:"
    45384564            << " UPT_index = " << r_cleanup_index.read()
    45394565            << std::endl;
     
    45624588        std::cout
    45634589            << "  <MEMC " << name()
    4564             << ".CLEANUP_WRITE_RSP> Send a response to a previous"
     4590            << " CLEANUP_WRITE_RSP> Send a response to a previous"
    45654591            << " write request waiting for coherence transaction completion: "
    45664592            << " rsrcid = "   << std::dec << r_cleanup_write_srcid.read()
     
    45924618        std::cout
    45934619            << "  <MEMC " << name()
    4594             << ".CLEANUP_SEND_ACK> Send the response to a cleanup request:"
     4620            << " CLEANUP_SEND_ACK> Send the response to a cleanup request:"
    45954621            << " srcid = " << std::dec << r_cleanup_srcid.read()
    45964622            << std::endl;
     
    46374663        if(m_debug_cas_fsm)
    46384664        {
    4639           std::cout << "  <MEMC " << name() << ".CAS_IDLE> CAS command: " << std::hex
     4665          std::cout << "  <MEMC " << name() << " CAS_IDLE> CAS command: " << std::hex
    46404666                    << " srcid = " <<  std::dec << m_cmd_cas_srcid_fifo.read()
    46414667                    << " addr = " << std::hex << m_cmd_cas_addr_fifo.read()
     
    46884714      {
    46894715        std::cout
    4690             << "  <MEMC " << name() << ".CAS_DIR_REQ> Requesting DIR lock "
     4716            << "  <MEMC " << name() << " CAS_DIR_REQ> Requesting DIR lock "
    46914717            << std::endl;
    46924718      }
     
    47214747        if(m_debug_cas_fsm)
    47224748        {
    4723           std::cout << "  <MEMC " << name() << ".CAS_DIR_LOCK> Directory acces"
     4749          std::cout << "  <MEMC " << name() << " CAS_DIR_LOCK> Directory acces"
    47244750                    << " / address = " << std::hex << m_cmd_cas_addr_fifo.read()
    47254751                    << " / hit = " << std::dec << entry.valid
     
    47464772    {
    47474773      size_t way  = r_cas_way.read();
    4748       size_t set  = m_y[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
     4774      size_t set  = m_y[(addr_t)(m_cmd_cas_addr_fifo.read())];
    47494775
    47504776      // update directory (lock & dirty bits)
     
    47744800      {
    47754801        std::cout
    4776           << "  <MEMC " << name() << ".CAS_DIR_HIT_READ> Read data from "
     4802          << "  <MEMC " << name() << " CAS_DIR_HIT_READ> Read data from "
    47774803          << " cache and store it in buffer"
    47784804          << std::endl;
     
    47844810    case CAS_DIR_HIT_COMPARE:
    47854811    {
    4786       size_t word = m_x[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
     4812      size_t word = m_x[(addr_t)(m_cmd_cas_addr_fifo.read())];
    47874813
    47884814      // Read data in buffer & check data change
     
    48104836      if(m_debug_cas_fsm)
    48114837      {
    4812         std::cout << "  <MEMC " << name() << ".CAS_DIR_HIT_COMPARE> Compare the old"
     4838        std::cout << "  <MEMC " << name() << " CAS_DIR_HIT_COMPARE> Compare the old"
    48134839                  << " and the new data"
    48144840                  << " / expected value = " << r_cas_rdata[0].read()
     
    48464872      {
    48474873        size_t way  = r_cas_way.read();
    4848         size_t set  = m_y[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
    4849         size_t word = m_x[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
     4874        size_t set  = m_y[(addr_t)(m_cmd_cas_addr_fifo.read())];
     4875        size_t word = m_x[(addr_t)(m_cmd_cas_addr_fifo.read())];
    48504876
    48514877        // cache update
     
    48594885        if(m_monitor_ok)
    48604886        {
    4861           vci_addr_t address = m_cmd_cas_addr_fifo.read();
     4887          addr_t address = m_cmd_cas_addr_fifo.read();
    48624888          char buf[80];
    4863           snprintf(buf, 80, "CAS_DIR_HIT_WRITE srcid %d", m_cmd_cas_srcid_fifo.read());
    4864           check_monitor(buf, address, r_cas_wdata.read());
     4889          snprintf(buf, 80, "CAS_DIR_HIT_WRITE srcid %d",
     4890                   (int)m_cmd_cas_srcid_fifo.read());
     4891          check_monitor(buf, address, r_cas_wdata.read(), false);
    48654892
    48664893          if(r_cas_cpt.read() == 4)
    4867             check_monitor(buf, address+4, m_cmd_cas_wdata_fifo.read());
     4894            check_monitor(buf, address+4, m_cmd_cas_wdata_fifo.read(), false);
    48684895        }
    48694896
     
    48714898        if(m_debug_cas_fsm)
    48724899        {
    4873           std::cout << "  <MEMC " << name() << ".CAS_DIR_HIT_WRITE> Update cache:"
     4900          std::cout << "  <MEMC " << name() << " CAS_DIR_HIT_WRITE> Update cache:"
    48744901                    << " way = " << std::dec << way
    48754902                    << " / set = " << set
     
    48784905                    << " / count = " << r_cas_count.read() << std::endl;
    48794906          std::cout << "  <MEMC "
    4880                     << name() << ".CAS_DIR_HIT_WRITE> global_llsc_table SW access" << std::endl;
     4907                    << name() << " CAS_DIR_HIT_WRITE> global_llsc_table SW access" << std::endl;
    48814908        }
    48824909#endif
     
    48964923        size_t      trdid      = m_cmd_cas_trdid_fifo.read();
    48974924        size_t      pktid      = m_cmd_cas_pktid_fifo.read();
    4898         addr_t      nline      = m_nline[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
     4925        addr_t      nline      = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())];
    48994926        size_t      nb_copies  = r_cas_count.read();
    49004927
     
    49124939          // cache update
    49134940          size_t way  = r_cas_way.read();
    4914           size_t set  = m_y[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
    4915           size_t word = m_x[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
     4941          size_t set  = m_y[(addr_t)(m_cmd_cas_addr_fifo.read())];
     4942          size_t word = m_x[(addr_t)(m_cmd_cas_addr_fifo.read())];
    49164943
    49174944          m_cache_data.write(way, set, word, r_cas_wdata.read());
     
    49254952          if(m_monitor_ok)
    49264953          {
    4927             vci_addr_t address = m_cmd_cas_addr_fifo.read();
     4954            addr_t address = m_cmd_cas_addr_fifo.read();
    49284955            char buf[80];
    4929             snprintf(buf, 80, "CAS_DIR_HIT_WRITE srcid %d", m_cmd_cas_srcid_fifo.read());
    4930             check_monitor(buf, address, r_cas_wdata.read());
     4956            snprintf(buf, 80, "CAS_DIR_HIT_WRITE srcid %d",
     4957                     (int)m_cmd_cas_srcid_fifo.read());
     4958            check_monitor(buf, address, r_cas_wdata.read(), false);
    49314959
    49324960            if(r_cas_cpt.read() ==4)
    4933               check_monitor(buf, address+4, m_cmd_cas_wdata_fifo.read());
     4961              check_monitor(buf, address+4, m_cmd_cas_wdata_fifo.read(), false);
    49344962          }
    49354963        }
     
    49434971        {
    49444972          std::cout << "  <MEMC " << name()
    4945                     << ".CAS_UPT_LOCK> Register multi-update transaction in UPT"
     4973                    << " CAS_UPT_LOCK> Register multi-update transaction in UPT"
    49464974                    << " / wok = " << wok
    49474975                    << " / nline  = " << std::hex << nline
     
    49604988      {
    49614989        std::cout << "  <MEMC " << name()
    4962                   << ".CAS_WAIT> Release all locks" << std::endl;
     4990                  << " CAS_WAIT> Release all locks" << std::endl;
    49634991      }
    49644992#endif
     
    49765004        {
    49775005          std::cout << "  <MEMC " << name()
    4978                     << ".CAS_UPT_HEAP_LOCK> Get access to the heap" << std::endl;
     5006                    << " CAS_UPT_HEAP_LOCK> Get access to the heap" << std::endl;
    49795007        }
    49805008#endif
     
    49935021        r_cas_to_cc_send_brdcast_req  = false;
    49945022        r_cas_to_cc_send_trdid        = r_cas_upt_index.read();
    4995         r_cas_to_cc_send_nline        = m_nline[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
    4996         r_cas_to_cc_send_index        = m_x[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
     5023        r_cas_to_cc_send_nline        = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())];
     5024        r_cas_to_cc_send_index        = m_x[(addr_t)(m_cmd_cas_addr_fifo.read())];
    49975025        r_cas_to_cc_send_wdata        = r_cas_wdata.read();
    49985026
     
    50315059        if(m_debug_cas_fsm)
    50325060        {
    5033           std::cout << "  <MEMC " << name() << ".CAS_UPT_REQ> Send the first update request to CC_SEND FSM "
     5061          std::cout << "  <MEMC " << name() << " CAS_UPT_REQ> Send the first update request to CC_SEND FSM "
    50345062                    << " / address = " << std::hex << m_cmd_cas_addr_fifo.read()
    50355063                    << " / wdata = " << std::hex << r_cas_wdata.read()
     
    50715099      if(m_debug_cas_fsm)
    50725100      {
    5073         std::cout << "  <MEMC " << name() << ".CAS_UPT_NEXT> Send the next update request to CC_SEND FSM "
     5101        std::cout << "  <MEMC " << name() << " CAS_UPT_NEXT> Send the next update request to CC_SEND FSM "
    50745102                  << " / address = " << std::hex << m_cmd_cas_addr_fifo.read()
    50755103                  << " / wdata = " << std::hex << r_cas_wdata.read()
     
    50885116        {
    50895117          // fill the data buffer
    5090           size_t word = m_x[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
     5118          size_t word = m_x[(addr_t)(m_cmd_cas_addr_fifo.read())];
    50915119          for(size_t i = 0; i<m_words; i++)
    50925120          {
     
    51345162        size_t      trdid     = m_cmd_cas_trdid_fifo.read();
    51355163        size_t      pktid     = m_cmd_cas_pktid_fifo.read();
    5136         addr_t      nline     = m_nline[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
     5164        addr_t      nline     = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())];
    51375165        size_t      nb_copies = r_cas_count.read();
    51385166
     
    51525180          // cache update
    51535181          size_t way  = r_cas_way.read();
    5154           size_t set  = m_y[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
    5155           size_t word = m_x[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
     5182          size_t set  = m_y[(addr_t)(m_cmd_cas_addr_fifo.read())];
     5183          size_t word = m_x[(addr_t)(m_cmd_cas_addr_fifo.read())];
    51565184
    51575185          m_cache_data.write(way, set, word, r_cas_wdata.read());
     
    51625190          if(m_monitor_ok)
    51635191          {
    5164             vci_addr_t address = m_cmd_cas_addr_fifo.read();
     5192            addr_t address = m_cmd_cas_addr_fifo.read();
    51655193            char buf[80];
    5166             snprintf(buf, 80, "CAS_DIR_HIT_WRITE srcid %d", m_cmd_cas_srcid_fifo.read());
    5167             check_monitor(buf, address, r_cas_wdata.read());
     5194            snprintf(buf, 80, "CAS_DIR_HIT_WRITE srcid %d",
     5195                     (int)m_cmd_cas_srcid_fifo.read());
     5196            check_monitor(buf, address, r_cas_wdata.read(), false);
    51685197            if(r_cas_cpt.read() ==4)
    5169               check_monitor(buf, address+4, m_cmd_cas_wdata_fifo.read());
     5198              check_monitor(buf, address+4, m_cmd_cas_wdata_fifo.read(), false);
    51705199          }
    51715200          r_cas_upt_index = index;
     
    51745203          if(m_debug_cas_fsm)
    51755204          {
    5176             std::cout << "  <MEMC " << name() << ".CAS_BC_UPT_LOCK> Register a broadcast inval transaction in UPT"
     5205            std::cout << "  <MEMC " << name() << " CAS_BC_UPT_LOCK> Register a broadcast inval transaction in UPT"
    51775206                      << " / nline = " << nline
    51785207                      << " / count = " << nb_copies
     
    51985227        m_trt.set(r_cas_trt_index.read(),
    51995228                              false,    // PUT request to XRAM
    5200                               m_nline[(vci_addr_t)(m_cmd_cas_addr_fifo.read())],
     5229                              m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())],
    52015230                              0,
    52025231                              0,
     
    52225251        entry.owner.inst    = false;
    52235252        entry.ptr           = 0;
    5224         size_t set          = m_y[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
     5253        size_t set          = m_y[(addr_t)(m_cmd_cas_addr_fifo.read())];
    52255254        size_t way          = r_cas_way.read();
    52265255        m_cache_directory.write(set, way, entry);
     
    52315260        if(m_debug_cas_fsm)
    52325261        {
    5233           std::cout << "  <MEMC " << name() << ".CAS_BC_DIR_INVAL> Register the PUT in TRT and invalidate DIR entry"
    5234                     << " / nline = " << std::hex << m_nline[(vci_addr_t)(m_cmd_cas_addr_fifo.read())]
     5262          std::cout << "  <MEMC " << name() << " CAS_BC_DIR_INVAL> Register the PUT in TRT and invalidate DIR entry"
     5263                    << " / nline = " << std::hex << m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())]
    52355264                    << " / set = " << std::dec << set << " / way = " << way << std::endl;
    52365265        }
     
    52525281        r_cas_to_cc_send_brdcast_req  = true;
    52535282        r_cas_to_cc_send_trdid        = r_cas_upt_index.read();
    5254         r_cas_to_cc_send_nline        = m_nline[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
     5283        r_cas_to_cc_send_nline        = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())];
    52555284        r_cas_to_cc_send_index        = 0;
    52565285        r_cas_to_cc_send_wdata        = 0;
     
    52675296        r_cas_to_ixr_cmd_req     = true;
    52685297        r_cas_to_ixr_cmd_write   = true;
    5269         r_cas_to_ixr_cmd_nline   = m_nline[(vci_addr_t)(m_cmd_cas_addr_fifo.read())];
     5298        r_cas_to_ixr_cmd_nline   = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())];
    52705299        r_cas_to_ixr_cmd_trdid   = r_cas_trt_index.read();
    52715300        r_cas_fsm                = CAS_IDLE;
     
    52765305        if(m_debug_cas_fsm)
    52775306        {
    5278           std::cout << "  <MEMC " << name() << ".CAS_BC_XRAM_REQ> Request a PUT transaction to IXR_CMD FSM" << std::hex
    5279                     << " / nline = " << m_nline[(vci_addr_t) m_cmd_cas_addr_fifo.read()]
     5307          std::cout << "  <MEMC " << name() << " CAS_BC_XRAM_REQ> Request a PUT transaction to IXR_CMD FSM" << std::hex
     5308                    << " / nline = " << m_nline[(addr_t) m_cmd_cas_addr_fifo.read()]
    52805309                    << " / trt_index = " << r_cas_trt_index.read() << std::endl;
    52815310        }
     
    53065335        if(m_debug_cas_fsm)
    53075336        {
    5308           std::cout << "  <MEMC " << name() << ".CAS_RSP_FAIL> Request TGT_RSP to send a failure response" << std::endl;
     5337          std::cout << "  <MEMC " << name() << " CAS_RSP_FAIL> Request TGT_RSP to send a failure response" << std::endl;
    53095338        }
    53105339#endif
     
    53295358        if(m_debug_cas_fsm)
    53305359        {
    5331           std::cout << "  <MEMC " << name() << ".CAS_RSP_SUCCESS> Request TGT_RSP to send a success response" << std::endl;
     5360          std::cout << "  <MEMC " << name() << " CAS_RSP_SUCCESS> Request TGT_RSP to send a success response" << std::endl;
    53325361        }
    53335362#endif
     
    53425371        size_t   index = 0;
    53435372        bool hit_read = m_trt.hit_read(
    5344                           m_nline[(vci_addr_t) m_cmd_cas_addr_fifo.read()],index);
     5373                          m_nline[(addr_t) m_cmd_cas_addr_fifo.read()],index);
    53455374        bool hit_write = m_trt.hit_write(
    5346                            m_nline[(vci_addr_t) m_cmd_cas_addr_fifo.read()]);
     5375                           m_nline[(addr_t) m_cmd_cas_addr_fifo.read()]);
    53475376        bool wok = !m_trt.full(index);
    53485377
     
    53505379        if(m_debug_cas_fsm)
    53515380        {
    5352           std::cout << "  <MEMC " << name() << ".CAS_MISS_TRT_LOCK> Check TRT state"
     5381          std::cout << "  <MEMC " << name() << " CAS_MISS_TRT_LOCK> Check TRT state"
    53535382                    << " / hit_read = "  << hit_read
    53545383                    << " / hit_write = " << hit_write
     
    53875416        m_trt.set(r_cas_trt_index.read(),
    53885417                              true,   // read request
    5389                               m_nline[(vci_addr_t) m_cmd_cas_addr_fifo.read()],
     5418                              m_nline[(addr_t) m_cmd_cas_addr_fifo.read()],
    53905419                              m_cmd_cas_srcid_fifo.read(),
    53915420                              m_cmd_cas_trdid_fifo.read(),
     
    54015430        if(m_debug_cas_fsm)
    54025431        {
    5403           std::cout << "  <MEMC " << name() << ".CAS_MISS_TRT_SET> Register a GET transaction in TRT" << std::hex
    5404                     << " / nline = " << m_nline[(vci_addr_t) m_cmd_cas_addr_fifo.read()]
     5432          std::cout << "  <MEMC " << name() << " CAS_MISS_TRT_SET> Register a GET transaction in TRT" << std::hex
     5433                    << " / nline = " << m_nline[(addr_t) m_cmd_cas_addr_fifo.read()]
    54055434                    << " / trt_index = " << r_cas_trt_index.read() << std::endl;
    54065435        }
     
    54175446        r_cas_to_ixr_cmd_write      = false;
    54185447        r_cas_to_ixr_cmd_trdid      = r_cas_trt_index.read();
    5419         r_cas_to_ixr_cmd_nline      = m_nline[(vci_addr_t) m_cmd_cas_addr_fifo.read()];
     5448        r_cas_to_ixr_cmd_nline      = m_nline[(addr_t) m_cmd_cas_addr_fifo.read()];
    54205449        r_cas_fsm                   = CAS_WAIT;
    54215450
     
    54235452        if(m_debug_cas_fsm)
    54245453        {
    5425           std::cout << "  <MEMC " << name() << ".CAS_MISS_XRAM_REQ> Request a GET transaction to IXR_CMD FSM" << std::hex
    5426                     << " / nline = " << m_nline[(vci_addr_t) m_cmd_cas_addr_fifo.read()]
     5454          std::cout << "  <MEMC " << name() << " CAS_MISS_XRAM_REQ> Request a GET transaction to IXR_CMD FSM" << std::hex
     5455                    << " / nline = " << m_nline[(addr_t) m_cmd_cas_addr_fifo.read()]
    54275456                    << " / trt_index = " << r_cas_trt_index.read() << std::endl;
    54285457        }
     
    56995728          std::cout
    57005729            << "  <MEMC " << name()
    5701             << ".CC_SEND_CLEANUP_ACK> Cleanup Acknowledgement for srcid "
     5730            << " CC_SEND_CLEANUP_ACK> Cleanup Acknowledgement for srcid "
    57025731            << r_cleanup_to_cc_send_srcid.read()
    57035732            << std::endl;
     
    57425771          std::cout
    57435772            << "  <MEMC " << name()
    5744             << ".CC_SEND_XRAM_RSP_INVAL_NLINE> Broadcast-Inval for line "
     5773            << " CC_SEND_XRAM_RSP_INVAL_NLINE> Broadcast-Inval for line "
    57455774            << r_xram_rsp_to_cc_send_nline.read()
    57465775            << std::endl;
     
    57745803          std::cout
    57755804            << "  <MEMC " << name()
    5776             << ".CC_SEND_XRAM_RSP_BRDCAST_NLINE> Broadcast-Inval for line "
     5805            << " CC_SEND_XRAM_RSP_BRDCAST_NLINE> Broadcast-Inval for line "
    57775806            << r_xram_rsp_to_cc_send_nline.read()
    57785807            << std::endl;
     
    58065835          std::cout
    58075836            << "  <MEMC " << name()
    5808             << ".CC_SEND_WRITE_BRDCAST_NLINE> Broadcast-Inval for line "
     5837            << " CC_SEND_WRITE_BRDCAST_NLINE> Broadcast-Inval for line "
    58095838            << r_write_to_cc_send_nline.read()
    58105839            << std::endl;
     
    58495878          std::cout
    58505879            << "  <MEMC " << name()
    5851             << ".CC_SEND_WRITE_UPDT_NLINE> Multicast-Update for line "
     5880            << " CC_SEND_WRITE_UPDT_NLINE> Multicast-Update for line "
    58525881            << r_write_to_cc_send_nline.read()
    58535882            << std::endl;
     
    58975926          std::cout
    58985927            << "  <MEMC " << name()
    5899             << ".CC_SEND_CAS_BRDCAST_NLINE> Broadcast-Inval for line "
     5928            << " CC_SEND_CAS_BRDCAST_NLINE> Broadcast-Inval for line "
    59005929            << r_cas_to_cc_send_nline.read()
    59015930            << std::endl;
     
    59415970          std::cout
    59425971            << "  <MEMC " << name()
    5943             << ".CC_SEND_CAS_UPDT_NLINE> Multicast-Update for line "
     5972            << " CC_SEND_CAS_UPDT_NLINE> Multicast-Update for line "
    59445973            << r_cas_to_cc_send_nline.read()
    59455974            << std::endl;
     
    62046233{
    62056234  std::cout
    6206     << "  <MEMC " << name() << ".TGT_RSP_READ> Read response"
     6235    << "  <MEMC " << name() << " TGT_RSP_READ> Read response"
    62076236    << " / rsrcid = " << std::dec << r_read_to_tgt_rsp_srcid.read()
    62086237    << " / rtrdid = " << r_read_to_tgt_rsp_trdid.read()
     
    62476276        if(m_debug_tgt_rsp_fsm)
    62486277        {
    6249           std::cout << "  <MEMC " << name() << ".TGT_RSP_WRITE> Write response"
     6278          std::cout << "  <MEMC " << name() << " TGT_RSP_WRITE> Write response"
    62506279                    << " / rsrcid = " << std::dec << r_write_to_tgt_rsp_srcid.read()
    62516280                    << " / rtrdid = " << r_write_to_tgt_rsp_trdid.read()
     
    62676296        if(m_debug_tgt_rsp_fsm)
    62686297        {
    6269           std::cout << "  <MEMC " << name() << ".TGT_RSP_CLEANUP> Cleanup response"
     6298          std::cout << "  <MEMC " << name() << " TGT_RSP_CLEANUP> Cleanup response"
    62706299                    << " / rsrcid = " << std::dec << r_cleanup_to_tgt_rsp_srcid.read()
    62716300                    << " / rtrdid = " << r_cleanup_to_tgt_rsp_trdid.read()
     
    62876316        if(m_debug_tgt_rsp_fsm)
    62886317        {
    6289           std::cout << "  <MEMC " << name() << ".TGT_RSP_CAS> CAS response"
     6318          std::cout << "  <MEMC " << name() << " TGT_RSP_CAS> CAS response"
    62906319                    << " / rsrcid = " << std::dec << r_cas_to_tgt_rsp_srcid.read()
    62916320                    << " / rtrdid = " << r_cas_to_tgt_rsp_trdid.read()
     
    63096338{
    63106339  std::cout
    6311     << "  <MEMC " << name() << ".TGT_RSP_XRAM> Response following XRAM access"
     6340    << "  <MEMC " << name() << " TGT_RSP_XRAM> Response following XRAM access"
    63126341    << " / rsrcid = " << std::dec << r_xram_rsp_to_tgt_rsp_srcid.read()
    63136342    << " / rtrdid = " << r_xram_rsp_to_tgt_rsp_trdid.read()
     
    63536382        if(m_debug_tgt_rsp_fsm)
    63546383        {
    6355           std::cout << "  <MEMC " << name() << ".TGT_RSP_INIT> Write response after coherence transaction"
     6384          std::cout << "  <MEMC " << name() << " TGT_RSP_INIT> Write response after coherence transaction"
    63566385                    << " / rsrcid = " << std::dec << r_multi_ack_to_tgt_rsp_srcid.read()
    63576386                    << " / rtrdid = " << r_multi_ack_to_tgt_rsp_trdid.read()
     
    71717200  ////////////////////////////////////////////////////////////
    71727201
    7173   p_vci_ixr.be      = 0xF;
     7202  p_vci_ixr.be      = 0xFF;   // nor transmited to external ram
    71747203  p_vci_ixr.pktid   = 0;
    71757204  p_vci_ixr.srcid   = m_srcid_x;
     
    71797208  p_vci_ixr.clen    = 0;
    71807209  p_vci_ixr.cfixed  = false;
     7210  p_vci_ixr.plen    = 64;
    71817211
    71827212  if(r_ixr_cmd_fsm.read() == IXR_CMD_READ_NLINE)
    71837213  {
    7184     p_vci_ixr.cmd     = vci_param::CMD_READ;
    7185     p_vci_ixr.cmdval  = true;
    7186     p_vci_ixr.address = (addr_t)(r_read_to_ixr_cmd_nline.read() *m_words*4);
    7187     p_vci_ixr.plen    = m_words*4;
    7188     p_vci_ixr.wdata   = 0x00000000;
    7189     p_vci_ixr.trdid   = r_read_to_ixr_cmd_trdid.read();
    7190     p_vci_ixr.eop     = true;
     7214    p_vci_ixr.cmd       = vci_param_ext::CMD_READ;
     7215    p_vci_ixr.cmdval    = true;
     7216    p_vci_ixr.address   = (addr_t)(r_read_to_ixr_cmd_nline.read() * m_words * 4);
     7217    p_vci_ixr.wdata     = 0;
     7218    p_vci_ixr.trdid     = r_read_to_ixr_cmd_trdid.read();
     7219    p_vci_ixr.eop       = true;
    71917220  }
    71927221  else if(r_ixr_cmd_fsm.read() == IXR_CMD_CAS_NLINE)
     
    71947223    if(r_cas_to_ixr_cmd_write.read())
    71957224    {
    7196       p_vci_ixr.cmd     = vci_param::CMD_WRITE;
     7225      size_t word       = r_ixr_cmd_cpt.read();
     7226      p_vci_ixr.cmd     = vci_param_ext::CMD_WRITE;
    71977227      p_vci_ixr.cmdval  = true;
    7198       p_vci_ixr.address = (addr_t)((r_cas_to_ixr_cmd_nline.read() *m_words+r_ixr_cmd_cpt.read()) *4);
    7199       p_vci_ixr.plen    = m_words*4;
    7200       p_vci_ixr.wdata   = r_cas_to_ixr_cmd_data[r_ixr_cmd_cpt.read()].read();
     7228      p_vci_ixr.address = (addr_t)( (r_cas_to_ixr_cmd_nline.read() * m_words + word) * 4 );
     7229      p_vci_ixr.wdata   = ((wide_data_t)(r_cas_to_ixr_cmd_data[word].read()))  |
     7230                          ((wide_data_t)(r_cas_to_ixr_cmd_data[word+1].read()) << 32);
    72017231      p_vci_ixr.trdid   = r_cas_to_ixr_cmd_trdid.read();
    7202       p_vci_ixr.eop     = (r_ixr_cmd_cpt == (m_words-1));
     7232      p_vci_ixr.eop     = (r_ixr_cmd_cpt == (m_words-2));
    72037233    }
    72047234    else
    72057235    {
    7206       p_vci_ixr.cmd     = vci_param::CMD_READ;
     7236      p_vci_ixr.cmd     = vci_param_ext::CMD_READ;
    72077237      p_vci_ixr.cmdval  = true;
    72087238      p_vci_ixr.address = (addr_t)(r_cas_to_ixr_cmd_nline.read() *m_words*4);
    7209       p_vci_ixr.plen    = m_words*4;
    7210       p_vci_ixr.wdata   = 0x00000000;
     7239      p_vci_ixr.wdata   = 0;
    72117240      p_vci_ixr.trdid   = r_cas_to_ixr_cmd_trdid.read();
    72127241      p_vci_ixr.eop     = true;
     
    72177246    if(r_write_to_ixr_cmd_write.read())
    72187247    {
    7219       p_vci_ixr.cmd     = vci_param::CMD_WRITE;
     7248      p_vci_ixr.cmd     = vci_param_ext::CMD_WRITE;
    72207249      p_vci_ixr.cmdval  = true;
    7221       p_vci_ixr.address = (addr_t)((r_write_to_ixr_cmd_nline.read() *m_words+r_ixr_cmd_cpt.read()) *4);
    7222       p_vci_ixr.plen    = m_words*4;
    7223       p_vci_ixr.wdata   = r_write_to_ixr_cmd_data[r_ixr_cmd_cpt.read()].read();
     7250      p_vci_ixr.address = (addr_t)( (r_write_to_ixr_cmd_nline.read() * m_words +
     7251                                     r_ixr_cmd_cpt.read()) * 4 );
     7252      p_vci_ixr.wdata   = (wide_data_t)(r_write_to_ixr_cmd_data[r_ixr_cmd_cpt.read()].read() |
     7253                                        r_write_to_ixr_cmd_data[r_ixr_cmd_cpt.read()+1].read());
    72247254      p_vci_ixr.trdid   = r_write_to_ixr_cmd_trdid.read();
    7225       p_vci_ixr.eop     = (r_ixr_cmd_cpt == (m_words-1));
     7255      p_vci_ixr.eop     = (r_ixr_cmd_cpt == (m_words-2));
    72267256    }
    72277257    else
    72287258    {
    7229       p_vci_ixr.cmd     = vci_param::CMD_READ;
     7259      p_vci_ixr.cmd     = vci_param_ext::CMD_READ;
    72307260      p_vci_ixr.cmdval  = true;
    72317261      p_vci_ixr.address = (addr_t)(r_write_to_ixr_cmd_nline.read() *m_words*4);
    7232       p_vci_ixr.plen    = m_words*4;
    7233       p_vci_ixr.wdata   = 0x00000000;
     7262      p_vci_ixr.wdata   = 0;
    72347263      p_vci_ixr.trdid   = r_write_to_ixr_cmd_trdid.read();
    72357264      p_vci_ixr.eop     = true;
     
    72387267  else if(r_ixr_cmd_fsm.read() == IXR_CMD_XRAM_DATA)
    72397268  {
    7240     p_vci_ixr.cmd     = vci_param::CMD_WRITE;
    7241     p_vci_ixr.cmdval  = true;
    7242     p_vci_ixr.address = (addr_t)((r_xram_rsp_to_ixr_cmd_nline.read() *m_words+r_ixr_cmd_cpt.read()) *4);
    7243     p_vci_ixr.plen    = m_words*4;
    7244     p_vci_ixr.wdata   = r_xram_rsp_to_ixr_cmd_data[r_ixr_cmd_cpt.read()].read();
    7245     p_vci_ixr.trdid   = r_xram_rsp_to_ixr_cmd_trdid.read();
    7246     p_vci_ixr.eop     = (r_ixr_cmd_cpt == (m_words-1));
     7269    p_vci_ixr.cmd       = vci_param_ext::CMD_WRITE;
     7270    p_vci_ixr.cmdval    = true;
     7271    p_vci_ixr.address   = (addr_t)( (r_xram_rsp_to_ixr_cmd_nline.read() * m_words +
     7272                                   r_ixr_cmd_cpt.read()) * 4 );
     7273    p_vci_ixr.wdata     = (wide_data_t)(r_xram_rsp_to_ixr_cmd_data[r_ixr_cmd_cpt.read()].read() |
     7274                                        r_xram_rsp_to_ixr_cmd_data[r_ixr_cmd_cpt.read()+1].read());
     7275    p_vci_ixr.trdid     = r_xram_rsp_to_ixr_cmd_trdid.read();
     7276    p_vci_ixr.eop       = (r_ixr_cmd_cpt == (m_words-2));
    72477277  }
    72487278  else
    72497279  {
    7250     p_vci_ixr.cmdval  = false;
    7251     p_vci_ixr.address = 0;
    7252     p_vci_ixr.plen    = 0;
    7253     p_vci_ixr.wdata   = 0;
    7254     p_vci_ixr.trdid   = 0;
    7255     p_vci_ixr.eop = false;
     7280    p_vci_ixr.cmdval    = false;
     7281    p_vci_ixr.cmd       = vci_param_ext::CMD_READ;
     7282    p_vci_ixr.address   = 0;
     7283    p_vci_ixr.wdata     = 0;
     7284    p_vci_ixr.trdid     = 0;
     7285    p_vci_ixr.eop       = false;
    72567286  }
    72577287
     
    74467476        uint64_t dest =
    74477477          r_cleanup_to_cc_send_srcid.read() <<
    7448           (DspinDhccpParam::SRCID_WIDTH - vci_param::S);
     7478          (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S);
    74497479
    74507480        DspinDhccpParam::dspin_set(
     
    74967526        uint64_t dest =
    74977527          m_xram_rsp_to_cc_send_srcid_fifo.read() <<
    7498           (DspinDhccpParam::SRCID_WIDTH - vci_param::S);
     7528          (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S);
    74997529
    75007530        DspinDhccpParam::dspin_set(
     
    76497679        uint64_t dest =
    76507680          m_write_to_cc_send_srcid_fifo.read() <<
    7651           (DspinDhccpParam::SRCID_WIDTH - vci_param::S);
     7681          (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S);
    76527682
    76537683        DspinDhccpParam::dspin_set(
     
    77567786        uint64_t dest =
    77577787          m_cas_to_cc_send_srcid_fifo.read() <<
    7758           (DspinDhccpParam::SRCID_WIDTH - vci_param::S);
     7788          (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S);
    77597789
    77607790        DspinDhccpParam::dspin_set(
Note: See TracChangeset for help on using the changeset viewer.