Changeset 439


Ignore:
Timestamp:
Jul 16, 2013, 6:58:00 PM (11 years ago)
Author:
alain
Message:

Improving the Config Interface.

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

Legend:

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

    r434 r439  
    9090      enum tgt_rsp_fsm_state_e
    9191      {
     92        TGT_RSP_CONFIG_IDLE,
    9293        TGT_RSP_TGT_CMD_IDLE,
    9394        TGT_RSP_READ_IDLE,
     
    9798        TGT_RSP_MULTI_ACK_IDLE,
    9899        TGT_RSP_CLEANUP_IDLE,
     100        TGT_RSP_CONFIG,
    99101        TGT_RSP_TGT_CMD,
    100102        TGT_RSP_READ,
     
    118120      enum cc_send_fsm_state_e
    119121      {
     122        CC_SEND_CONFIG_IDLE,
    120123        CC_SEND_XRAM_RSP_IDLE,
    121124        CC_SEND_WRITE_IDLE,
    122125        CC_SEND_CAS_IDLE,
    123126        CC_SEND_CLEANUP_IDLE,
     127        CC_SEND_CONFIG_INVAL_HEADER,
     128        CC_SEND_CONFIG_INVAL_NLINE,
     129        CC_SEND_CONFIG_BRDCAST_HEADER,
     130        CC_SEND_CONFIG_BRDCAST_NLINE,
    124131        CC_SEND_CLEANUP_ACK,
    125132        CC_SEND_XRAM_RSP_BRDCAST_HEADER,
     
    158165        CONFIG_DIR_REQ,
    159166        CONFIG_DIR_ACCESS,
    160         CONFIG_DIR_INVAL,
    161         CONFIG_BC_UPT_LOCK,
     167        CONFIG_DIR_UPT_LOCK,
    162168        CONFIG_BC_SEND,
    163169        CONFIG_BC_WAIT,
    164        
    165         CONFIG_UPT_WAIT,
    166 
    167         CONFIG_UPT_LOCK,
    168 
    169         CONFIG_HEAP_REQ
     170        CONFIG_INV_SEND,
     171        CONFIG_HEAP_REQ,
     172        CONFIG_HEAP_SCAN,
     173        CONFIG_HEAP_LAST,
     174        CONFIG_INV_WAIT
    170175      };
    171176
     
    345350        ALLOC_HEAP_CAS,
    346351        ALLOC_HEAP_CLEANUP,
    347         ALLOC_HEAP_XRAM_RSP
     352        ALLOC_HEAP_XRAM_RSP,
     353        ALLOC_HEAP_CONFIG
    348354      };
    349355
     
    568574      ///////////////////////////////////////////////////////
    569575
    570       sc_signal<int>      r_config_fsm;        // FSM state
    571       sc_signal<bool>     r_config_lock;       // lock protecting exclusive access
    572       sc_signal<int>      r_config_cmd;        // config request status
    573       sc_signal<addr_t>   r_config_address;    // target buffer physical address
    574       sc_signal<size_t>   r_config_srcid;      // config request srcid
    575       sc_signal<size_t>   r_config_trdid;      // config request trdid
    576       sc_signal<size_t>   r_config_pktid;      // config request pktid
    577       sc_signal<size_t>   r_config_nlines;     // number of lines covering the buffer
    578       sc_signal<size_t>   r_config_way;        // selected way
    579       sc_signal<size_t>   r_config_count;      // number of copies
     576      sc_signal<int>      r_config_fsm;            // FSM state
     577      sc_signal<bool>     r_config_lock;           // lock protecting exclusive access
     578      sc_signal<int>      r_config_cmd;            // config request status
     579      sc_signal<addr_t>   r_config_address;        // target buffer physical address
     580      sc_signal<size_t>   r_config_srcid;          // config request srcid
     581      sc_signal<size_t>   r_config_trdid;          // config request trdid
     582      sc_signal<size_t>   r_config_pktid;          // config request pktid
     583      sc_signal<size_t>   r_config_nlines;         // number of lines covering the buffer
     584      sc_signal<size_t>   r_config_dir_way;        // DIR: selected way
     585      sc_signal<size_t>   r_config_dir_count;      // DIR: number of copies
     586      sc_signal<bool>     r_config_dir_is_cnt;     // DIR: counter mode (broadcast required)
     587      sc_signal<size_t>   r_config_dir_copy_srcid; // DIR: first copy SRCID
     588      sc_signal<bool>     r_config_dir_copy_inst;  // DIR: first copy L1 type
     589      sc_signal<size_t>   r_config_dir_next_ptr;   // DIR: index of next copy in HEAP
     590      sc_signal<size_t>   r_config_heap_next;      // current pointer to scan HEAP
     591
    580592      sc_signal<size_t>   r_config_upt_index;  // UPT index
    581       sc_signal<bool>     r_config_is_cnt;     // counter mode (broadcast required)
    582593
    583594      // Buffer between CONFIG fsm and TGT_RSP fsm (send a done response to L1 cache)
     
    591602      sc_signal<bool>     r_config_to_cc_send_multi_req;    // multi-inval request
    592603      sc_signal<bool>     r_config_to_cc_send_brdcast_req;  // broadcast-inval request
    593       sc_signal<size_t>   r_config_to_cc_send_nline;        // line index
     604      sc_signal<addr_t>   r_config_to_cc_send_nline;        // line index
    594605      sc_signal<size_t>   r_config_to_cc_send_trdid;        // UPT index
     606      GenericFifo<bool>   m_config_to_cc_send_inst_fifo;    // fifo for the L1 type
     607      GenericFifo<size_t> m_config_to_cc_send_srcid_fifo;   // fifo for owners srcid
     608
     609#if L1_MULTI_CACHE
     610      GenericFifo<size_t> m_config_to_cc_send_cache_id_fifo; // fifo for cache_id
     611#endif
    595612
    596613      ///////////////////////////////////////////////////////
  • trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp

    r434 r439  
    6969const char *tgt_rsp_fsm_str[] =
    7070{
     71  "TGT_RSP_CONFIG_IDLE",
    7172  "TGT_RSP_TGT_CMD_IDLE",
    7273  "TGT_RSP_READ_IDLE",
     
    7677  "TGT_RSP_MULTI_ACK_IDLE",
    7778  "TGT_RSP_CLEANUP_IDLE",
     79  "TGT_RSP_CONFIG",
    7880  "TGT_RSP_TGT_CMD",
    7981  "TGT_RSP_READ",
     
    9395const char *cc_send_fsm_str[] =
    9496{
     97  "CC_SEND_CONFIG_IDLE",
    9598  "CC_SEND_XRAM_RSP_IDLE",
    9699  "CC_SEND_WRITE_IDLE",
    97100  "CC_SEND_CAS_IDLE",
    98101  "CC_SEND_CLEANUP_IDLE",
     102  "CC_SEND_CONFIG_INVAL_HEADER",
     103  "CC_SEND_CONFIG_INVAL_NLINE",
     104  "CC_SEND_CONFIG_BRDCAST_HEADER",
     105  "CC_SEND_CONFIG_BRDCAST_NLINE",
    99106  "CC_SEND_CLEANUP_ACK",
    100107  "CC_SEND_XRAM_RSP_BRDCAST_HEADER",
     
    121128  "MULTI_ACK_WRITE_RSP",
    122129  "MULTI_ACK_CONFIG_ACK"
     130};
     131const char *config_fsm_str[] =
     132{
     133  "CONFIG_IDLE",
     134  "CONFIG_LOOP",
     135  "CONFIG_RSP",
     136  "CONFIG_DIR_REQ",
     137  "CONFIG_DIR_ACCESS",
     138  "CONFIG_DIR_UPT_LOCK",
     139  "CONFIG_BC_SEND",
     140  "CONFIG_BC_WAIT",
     141  "CONFIG_INV_SEND",
     142  "CONFIG_HEAP_REQ",
     143  "CONFIG_HEAP_SCAN",
     144  "CONFIG_HEAP_LAST",
     145  "CONFIG_INV_WAIT"
    123146};
    124147const char *read_fsm_str[] =
     
    274297  "ALLOC_HEAP_CAS",
    275298  "ALLOC_HEAP_CLEANUP",
    276   "ALLOC_HEAP_XRAM_RSP"
     299  "ALLOC_HEAP_XRAM_RSP",
     300  "ALLOC_HEAP_CONFIG"
    277301};
    278302
     
    375399    m_cc_receive_to_multi_ack_fifo("m_cc_receive_to_multi_ack_fifo", 4),
    376400
    377     r_read_fsm("r_read_fsm"),
    378 
    379     r_write_fsm("r_write_fsm"),
     401    r_config_fsm( "r_config_fsm" ),
     402
     403    m_config_to_cc_send_inst_fifo( "m_config_to_cc_send_inst_fifo", 8 ),
     404    m_config_to_cc_send_srcid_fifo( "m_config_to_cc_send_srcid_fifo", 8 ),
     405
     406    r_read_fsm( "r_read_fsm" ),
     407
     408    r_write_fsm( "r_write_fsm" ),
    380409
    381410    m_write_to_cc_send_inst_fifo("m_write_to_cc_send_inst_fifo",8),
     
    563592            << " | " << write_fsm_str[r_write_fsm.read()]
    564593            << " | " << cas_fsm_str[r_cas_fsm.read()]
     594            << " | " << config_fsm_str[r_config_fsm.read()]
    565595            << " | " << cleanup_fsm_str[r_cleanup_fsm.read()] << std::endl;
    566596  std::cout << "  "  << cc_send_fsm_str[r_cc_send_fsm.read()]
     
    686716    r_config_lock = false;
    687717
     718    m_config_to_cc_send_inst_fifo.init();
     719    m_config_to_cc_send_srcid_fifo.init();
     720#if L1_MULTI_CACHE
     721    m_config_to_cc_send_cache_id_fifo.init();
     722#endif
     723
    688724    r_tgt_cmd_to_tgt_rsp_req = false;
    689725
     
    802838  size_t  xram_rsp_to_cc_send_fifo_cache_id = 0;
    803839#endif
     840
     841  bool    config_to_cc_send_fifo_put   = false;
     842  bool    config_to_cc_send_fifo_get   = false;
     843  bool    config_to_cc_send_fifo_inst  = false;
     844  size_t  config_to_cc_send_fifo_srcid = 0;
    804845
    805846  bool    cas_to_cc_send_fifo_put   = false;
     
    856897  //            acces key, second flit the data to write => WRITE FSM.
    857898  //
    858   // The READ/WRITE commands accepted in the configuration segment are targeting,
     899  // The READ/WRITE commands accepted in the configuration segment are targeting
    859900  // configuration or status registers. They must contain one single flit.
    860901  // - For almost all addressable registers, the response is returned immediately.
     
    873914std::cout << "  <MEMC " << name()
    874915          << " TGT_CMD_IDLE> Receive command from srcid "
    875           << std::dec << p_vci_tgt.srcid.read()
     916          << std::hex << p_vci_tgt.srcid.read()
    876917          << " / address " << std::hex << p_vci_tgt.address.read() << std::endl;
    877918#endif
     
    9911032    case TGT_CMD_CONFIG:    // execute config request and return response
    9921033    {
    993         if ( r_tgt_cmd_to_tgt_rsp_req.read() ) break;
    994 
    9951034        addr_t   seg_base = m_seg[m_seg_config]->baseAddress();
    9961035        addr_t   address  = p_vci_tgt.address.read();
    9971036        size_t   cell     = (address - seg_base)/vci_param_int::B;
    998         bool     need_rsp = true;  // default value
    999         size_t   error    = 0;     // default value
    1000         uint32_t rdata    = 0;     // default value
     1037     
     1038        bool     need_rsp;
     1039        size_t   error; 
     1040        uint32_t rdata = 0;         // default value
    10011041
    10021042        if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_READ)         // get lock
    10031043             and (cell == MEMC_LOCK) )
    10041044        {
    1005             rdata         = (uint32_t)r_config_lock.read();
    1006             r_config_lock = true;
     1045            rdata            = (uint32_t)r_config_lock.read();
     1046            need_rsp         = true;
     1047            error            = 0;
     1048            r_config_lock    = true;
    10071049        }
    10081050        else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)  // release lock
    10091051                   and (cell == MEMC_LOCK) )
    10101052        {
    1011             r_config_lock = false;
     1053            need_rsp         = true;
     1054            error            = 0;
     1055            r_config_lock    = false;
     1056        }
     1057        else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)   // set addr_lo
     1058                   and (cell == MEMC_ADDR_LO) )
     1059        {
     1060            need_rsp         = true;
     1061            error            = 0;
     1062            r_config_address = (r_config_address.read() & 0xFFFFFFFF00000000LL) |
     1063                               (addr_t)p_vci_tgt.wdata.read();
     1064        }
     1065        else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)   // set addr_hi
     1066                   and (cell == MEMC_ADDR_HI) )
     1067        {
     1068            need_rsp         = true;
     1069            error            = 0;
     1070            r_config_address = (r_config_address.read() & 0x00000000FFFFFFFFLL) |
     1071                               ((addr_t)p_vci_tgt.wdata.read())<<32;
     1072        }
     1073        else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)   // set buf_lines
     1074                   and (cell == MEMC_BUF_LENGTH) )
     1075        {
     1076            need_rsp         = true;
     1077            error            = 0;
     1078            size_t lines = (size_t)(p_vci_tgt.wdata.read()/(m_words<<2));
     1079            if ( r_config_address.read()/(m_words*vci_param_int::B) ) lines++;
     1080            r_config_nlines  = lines;
    10121081        }
    10131082        else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)   // set cmd type
    10141083                   and (cell == MEMC_CMD_TYPE) )
    10151084        {
    1016             r_config_cmd = p_vci_tgt.wdata.read();
    1017             need_rsp     = false;
    1018         }
    1019         else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)   // set addr_lo
    1020                    and (cell == MEMC_ADDR_LO) )
    1021         {
    1022             r_config_address = (r_config_address.read() & 0xFFFFFFFF00000000LL) |
    1023                                (addr_t)p_vci_tgt.wdata.read();
    1024         }
    1025         else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)   // set addr_hi
    1026                    and (cell == MEMC_ADDR_HI) )
    1027         {
    1028             r_config_address = (r_config_address.read() & 0x00000000FFFFFFFFLL) |
    1029                                ((addr_t)p_vci_tgt.wdata.read())<<32;
    1030         }
    1031         else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)   // set buf_lines
    1032                    and (cell == MEMC_BUF_LENGTH) )
    1033         {
    1034             size_t lines = (size_t)(p_vci_tgt.wdata.read()/(m_words*vci_param_int::B));
    1035             if ( r_config_address.read()/(m_words*vci_param_int::B) ) lines++;
    1036             r_config_nlines = lines;
     1085            need_rsp         = false;
     1086            error            = 0;
     1087            r_config_cmd     = p_vci_tgt.wdata.read();
     1088            r_config_srcid   = p_vci_tgt.srcid.read();
     1089            r_config_trdid   = p_vci_tgt.trdid.read();
     1090            r_config_pktid   = p_vci_tgt.pktid.read();
    10371091        }
    10381092        else
    10391093        {
    1040             error = 1;
     1094            need_rsp         = true;
     1095            error            = 1;
    10411096        }
    10421097
     
    11681223  // update the UPT.
    11691224  //
    1170   // It can be update or inval requests initiated by the WRITE or CAS FSM,
    1171   // or inval requests initiated by the XRAM_RSP FSM.
     1225  // - The FSM decrements the proper entry in UPT,
     1226  //   and clear the UPT entry when all responses have been received.
     1227  // - If required, it sends a request to the TGT_RSP FSM to complete
     1228  //   a pending  write transaction.
     1229  // - If required, it sends an acknowledge to the CONFIG FSM to signal
     1230  //   completion of a line inval.
    11721231  //
    1173   // The FSM decrements the proper entry in UPT.
    1174   // It sends a request to the TGT_RSP FSM to complete the pending
    1175   // write transaction (acknowledge response to the writer processor),
    1176   // and clear the UPT entry when all responses have been received.
    1177   //
    1178   // All those response packets are one flit packet.
    1179   // The index in the Table is defined in the UPDT_TABLE INDEX field, and
    1180   // the transaction type is defined in the UPT entry.
     1232  // All those multi-ack packets are one flit packet.
     1233  // The index in the UPT is defined in the UPDTID field.
    11811234  ////////////////////////////////////////////////////////////////////////
    11821235
     
    12251278        std::cout << "  <MEMC " << name()
    12261279                  << " MULTI_ACK_IDLE> Response for UPT entry "
    1227                   << updt_index << std::endl;
     1280                  << (size_t)updt_index << std::endl;
    12281281    }
    12291282    else
     
    13701423  //   The config inval response is sent only when the last line has been invalidated.
    13711424  //
    1372   // - SYNC request: Not implemented yet
     1425  // - SYNC request:
     1426  //
     1427  //  ...  Not implemented yet ...
    13731428  //
    13741429  // From the software point of view, a configuration request is a sequence
     
    13901445          {
    13911446              r_config_fsm    = CONFIG_LOOP;
    1392           }
    13931447
    13941448#if DEBUG_MEMC_CONFIG
     
    13991453          << " / type = " << r_config_cmd.read() << std::endl;
    14001454#endif
     1455          }
    14011456          break;
    14021457      }
     
    14161471#if DEBUG_MEMC_CONFIG
    14171472if(m_debug)
    1418 std::cout << "  <MEMC " << name() << " CONFIG_SYNC_LOOP>"
     1473std::cout << "  <MEMC " << name() << " CONFIG_LOOP>"
    14191474          << " address = " << std::hex << r_config_address.read()   
    14201475          << " / nlines = " << std::dec << r_config_nlines.read()
    1421           << " / type = " << r_config_cmd.read() << std::endl;
     1476          << " / command = " << r_config_cmd.read() << std::endl;
    14221477#endif
    14231478          break;
     
    14331488#if DEBUG_MEMC_CONFIG
    14341489if(m_debug)
    1435 std::cout << "  <MEMC " << name() << " CONFIG_INVAL_DIR_REQ>"
     1490std::cout << "  <MEMC " << name() << " CONFIG_DIR_REQ>"
    14361491          << " Request DIR access" << std::endl;
    14371492#endif
     
    14391494      }
    14401495      ///////////////////////
    1441       case CONFIG_DIR_ACCESS:   // Access directory and decode cmd
     1496      case CONFIG_DIR_ACCESS:   // Access directory and decode config command
    14421497      {
    14431498          size_t way = 0;
     
    14471502               (r_config_cmd.read() == MEMC_CMD_INVAL) )
    14481503          {
    1449               r_config_way    = way;
    1450               r_config_is_cnt = entry.is_cnt;
    1451               r_config_count  = entry.count;
    1452               r_config_fsm    = CONFIG_DIR_INVAL;
     1504              r_config_dir_way        = way;
     1505              r_config_dir_copy_inst  = entry.owner.inst;
     1506              r_config_dir_copy_srcid = entry.owner.srcid;
     1507              r_config_dir_is_cnt     = entry.is_cnt;
     1508              r_config_dir_count      = entry.count;
     1509              r_config_dir_next_ptr   = entry.ptr;
     1510
     1511              r_config_fsm    = CONFIG_DIR_UPT_LOCK;
    14531512          }
    14541513          else if ( entry.valid and                       // hit & sync command
     
    14601519              exit(0);
    14611520          }
    1462           else                                            // nothing to do : return to LOOP
     1521          else                                            // return to LOOP
    14631522          {
    14641523              r_config_nlines  = r_config_nlines.read() - 1;
    1465               r_config_address = r_config_address.read() + (m_words*vci_param_int::B);
     1524              r_config_address = r_config_address.read() + (m_words<<2);
    14661525              r_config_fsm     = CONFIG_LOOP;
    14671526          }
     
    14701529if(m_debug)
    14711530std::cout << "  <MEMC " << name() << " CONFIG_DIR_ACCESS> Accessing directory: "
    1472           << " address = " << std::hex << m_cmd_read_addr_fifo.read()
     1531          << " address = " << std::hex << r_config_address.read()
    14731532          << " / hit = " << std::dec << entry.valid
    1474           << " / dirty = " <<std::dec << entry.dirty
    1475           << " / count = " <<std::dec << entry.count
     1533          << " / dirty = " << entry.dirty
     1534          << " / count = " << entry.count
    14761535          << " / is_cnt = " << entry.is_cnt << std::endl;
    14771536#endif
    14781537          break;
    14791538      }
    1480       //////////////////////
    1481       case CONFIG_DIR_INVAL:  // Invalidate the directory entry
    1482       {
    1483           size_t set        = m_y[(addr_t)(r_config_address.read())];
    1484           size_t way        = r_config_way.read();
    1485 
    1486           m_cache_directory.inval( way, set );
    1487 
    1488           if ( r_config_count.read() == 0 )     // return to LOOP
    1489           {
    1490               r_config_nlines  = r_config_nlines.read() - 1;
    1491               r_config_address = r_config_address.read() + (m_words*vci_param_int::B);
    1492               r_config_fsm     = CONFIG_LOOP;
    1493           }
    1494           else if ( r_config_is_cnt.read() )    // broacast required
    1495           {
    1496               r_config_fsm = CONFIG_BC_UPT_LOCK;
    1497           }
    1498           else
    1499           {
    1500               r_config_fsm = CONFIG_UPT_LOCK;
    1501           }
    1502 
    1503 #if DEBUG_MEMC_CONFIG
    1504 if(m_debug)
    1505 std::cout << "  <MEMC " << name() << " CONFIG_DIR_INVAL> Inval directory entry" << std::endl;
    1506 #endif
    1507           break;
    1508       }
    1509       ////////////////////////
    1510       case CONFIG_BC_UPT_LOCK:  // try to register BC transaction in UPT
     1539      /////////////////////////
     1540      case CONFIG_DIR_UPT_LOCK:  // enter this state in case of INVAL command
     1541                                 // Try to get both DIR & UPT locks, and return
     1542                                 // to LOOP state if UPT full.
     1543                                 // Register inval in UPT, and invalidate the
     1544                                 // directory if UPT not full.
    15111545      {
    15121546          if ( r_alloc_upt_fsm.read() == ALLOC_UPT_CONFIG )
    15131547          {
    1514               bool        wok       = false;
    1515               size_t      index     = 0;
    1516               size_t      srcid     = r_config_srcid.read();
    1517               size_t      trdid     = r_config_trdid.read();
    1518               size_t      pktid     = r_config_pktid.read();
    1519               addr_t      nline     = m_nline[(addr_t)(r_config_address.read())];
    1520               size_t      nb_copies = r_config_count.read();
    1521 
    1522               wok = m_upt.set(false,    // it's an inval transaction
    1523                               true,     // it's a broadcast
    1524                               false,    // no response required
    1525                               true,     // acknowledge required
    1526                               srcid,
    1527                               trdid,
    1528                               pktid,
    1529                               nline,
    1530                               nb_copies,
    1531                               index);
    1532               if ( wok )
     1548              size_t set        = m_y[(addr_t)(r_config_address.read())];
     1549              size_t way        = r_config_dir_way.read();
     1550
     1551              if ( r_config_dir_count.read() == 0 )     // inval DIR and return to LOOP
    15331552              {
    1534                   r_config_fsm       = CONFIG_BC_SEND;
    1535                   r_config_upt_index = index;
     1553                  m_cache_directory.inval( way, set );
     1554                  r_config_nlines  = r_config_nlines.read() - 1;
     1555                  r_config_address = r_config_address.read() + (m_words<<2);
     1556                  r_config_fsm     = CONFIG_LOOP;
    15361557
    15371558#if DEBUG_MEMC_CONFIG
    1538 if( m_debug )
    1539 std::cout << "  <MEMC " << name()
    1540           << " CONFIG_BC_UPT_LOCK> Register broadcast inval in UPT" << std::endl;
     1559if(m_debug)
     1560std::cout << "  <MEMC " << name() << " CONFIG_DIR_UPT_LOCK>"
     1561          << " No copies in L1 : inval DIR entry" << std::endl;
    15411562#endif
    15421563              }
    1543               else
     1564              else    // try to register inval in UPT
    15441565              {
    1545                   r_config_fsm       = CONFIG_UPT_WAIT;
    1546          
     1566                  bool        wok       = false;
     1567                  size_t      index     = 0;
     1568                  bool        broadcast = r_config_dir_is_cnt.read();
     1569                  size_t      srcid     = r_config_srcid.read();
     1570                  size_t      trdid     = r_config_trdid.read();
     1571                  size_t      pktid     = r_config_pktid.read();
     1572                  addr_t      nline     = m_nline[(addr_t)(r_config_address.read())];
     1573                  size_t      nb_copies = r_config_dir_count.read();
     1574
     1575                  wok = m_upt.set(false,       // it's an inval transaction
     1576                                  broadcast,   
     1577                                  false,       // no response required
     1578                                  true,        // acknowledge required
     1579                                  srcid,
     1580                                  trdid,
     1581                                  pktid,
     1582                                  nline,
     1583                                  nb_copies,
     1584                                  index);
     1585                  if ( wok )  // UPT success => inval DIR slot
     1586                  {
     1587                      m_cache_directory.inval( way, set );
     1588                      r_config_upt_index = index;
     1589                      if ( broadcast )  r_config_fsm = CONFIG_BC_SEND;
     1590                      else              r_config_fsm = CONFIG_INV_SEND;
     1591
    15471592#if DEBUG_MEMC_CONFIG
    1548 if( m_debug )
    1549 std::cout << "  <MEMC " << name() << " CONFIG_BC_UPT_LOCK>"
    1550           << " UPT full" << std::endl;
    1551 #endif
     1593if(m_debug)
     1594std::cout << "  <MEMC " << name() << " CONFIG_DIR_UPT_LOCK>"
     1595          << " Inval DIR entry and register inval in UPT"
     1596          << " : index = " << std::dec << index
     1597          << " / broadcast = " << broadcast << std::endl;
     1598#endif
     1599                  }
     1600                  else       // UPT full => release both DIR and UPT locks
     1601                  {
     1602                      r_config_fsm = CONFIG_LOOP;
     1603
     1604#if DEBUG_MEMC_CONFIG
     1605if(m_debug)
     1606std::cout << "  <MEMC " << name() << " CONFIG_DIR_UPT_LOCK>"
     1607          << " UPT full : release DIR & UPT locks and retry" << std::endl;
     1608#endif
     1609                  }
    15521610              }
    15531611          }
     
    15641622              r_config_to_cc_send_trdid       = r_config_upt_index.read();
    15651623              r_config_to_cc_send_nline       = m_nline[(addr_t)(r_config_address.read())];
    1566 
    15671624              r_cleanup_to_config_ack         = false;
    1568 
    15691625              r_config_fsm                    = CONFIG_BC_WAIT;
    15701626
     
    15811637      case CONFIG_BC_WAIT:      // wait broadcast completion to return to LOOP
    15821638      {
    1583           if ( r_cleanup_to_config_ack.read() ) r_config_fsm = CONFIG_LOOP;
     1639          if ( r_cleanup_to_config_ack.read() )
     1640          {
     1641              r_config_fsm     = CONFIG_LOOP;
     1642              r_config_nlines  = r_config_nlines.read() - 1;
     1643              r_config_address = r_config_address.read() + (m_words<<2);
     1644          }
    15841645
    15851646#if DEBUG_MEMC_CONFIG
    15861647if(m_debug)
    1587 std::cout << "  <MEMC " << name() << " CONFIG_BC_WAIT>"
    1588           << " Waiting broadcast inval completion" << std::endl;
     1648std::cout << "  <MEMC " << name() << " CONFIG_BC_WAIT> Waiting BC completion "
     1649          << " done = " << r_cleanup_to_config_ack.read()
     1650          << std::endl;
    15891651#endif
    15901652          break;
    15911653      }
    15921654      /////////////////////
    1593       case CONFIG_UPT_LOCK:  // Try to register multi-update in UPT
    1594       {
    1595           if ( r_alloc_upt_fsm.read() == ALLOC_UPT_CONFIG )
     1655      case CONFIG_INV_SEND:    // Post a multi inval request to CC_SEND FSM
     1656      {
     1657          if( not r_config_to_cc_send_multi_req.read() and
     1658              not r_config_to_cc_send_brdcast_req.read() )
    15961659          {
    1597               bool        wok       = false;
    1598               size_t      index     = 0;
    1599               size_t      srcid     = r_config_srcid.read();
    1600               size_t      trdid     = r_config_trdid.read();
    1601               size_t      pktid     = r_config_pktid.read();
    1602               addr_t      nline     = m_nline[(addr_t)(r_config_address.read())];
    1603               size_t      nb_copies = r_config_count.read();
    1604 
    1605               wok = m_upt.set(false,    // it's an inval transaction
    1606                               false,    // not a broadcast
    1607                               false,    // no response required
    1608                               true,     // acknowledge required
    1609                               srcid,
    1610                               trdid,
    1611                               pktid,
    1612                               nline,
    1613                               nb_copies,
    1614                               index);
    1615               if ( wok )
    1616               {
    1617                   r_config_fsm       = CONFIG_BC_SEND;
    1618                   r_config_upt_index = index;
     1660              r_config_to_cc_send_multi_req   = true;
     1661              r_config_to_cc_send_brdcast_req = false;
     1662              r_config_to_cc_send_trdid       = r_config_upt_index.read();
     1663              r_config_to_cc_send_nline       = m_nline[(addr_t)(r_config_address.read())];
     1664              r_multi_ack_to_config_ack       = false;
     1665
     1666              config_to_cc_send_fifo_srcid    = r_config_dir_copy_srcid.read();
     1667              config_to_cc_send_fifo_inst     = r_config_dir_copy_inst.read();
     1668              config_to_cc_send_fifo_put      = true;
     1669
     1670              if ( r_config_dir_count.read() == 1 )  r_config_fsm = CONFIG_INV_WAIT;
     1671              else                                   r_config_fsm = CONFIG_HEAP_REQ;
    16191672
    16201673#if DEBUG_MEMC_CONFIG
    1621 if( m_debug )
    1622 std::cout << "  <MEMC " << name()
    1623           << " CONFIG_BC_UPT_LOCK> Register broadcast inval in UPT" << std::endl;
    1624 #endif
    1625               }
    1626               else
    1627               {
    1628                   r_config_fsm       = CONFIG_UPT_WAIT;
     1674if(m_debug)
     1675std::cout << "  <MEMC " << name() << " CONFIG_INV_SEND>"
     1676          << " Post multi inval request to CC_SEND FSM"
     1677          << " / address = " << std::hex << r_config_address.read()
     1678          << " / copy = " << r_config_dir_copy_srcid.read()
     1679          << " / inst = " << std::dec << r_config_dir_copy_inst.read() << std::endl;
     1680#endif
     1681          }
     1682          break;
     1683      }
     1684      /////////////////////
     1685      case CONFIG_HEAP_REQ:  // Try to get access to Heap
     1686      {
     1687          if ( r_alloc_heap_fsm.read() == ALLOC_HEAP_CONFIG )
     1688          {
     1689              r_config_fsm       = CONFIG_HEAP_SCAN;
     1690              r_config_heap_next = r_config_dir_next_ptr.read();
     1691          }
     1692
     1693#if DEBUG_MEMC_CONFIG
     1694if(m_debug)
     1695std::cout << "  <MEMC " << name() << " CONFIG_HEAP_REQ>"
     1696          << " Requesting HEAP lock" << std::endl;
     1697#endif
     1698          break;
     1699      }
     1700      //////////////////////
     1701      case CONFIG_HEAP_SCAN:      // scan HEAP and send inval to CC_SEND FSM
     1702      {
     1703          HeapEntry entry = m_heap.read( r_config_heap_next.read() );
     1704          bool last_copy  = (entry.next == r_config_heap_next.read());
     1705
     1706          config_to_cc_send_fifo_srcid = entry.owner.srcid;
     1707          config_to_cc_send_fifo_inst  = entry.owner.inst;
     1708          // config_to_cc_send_fifo_last  = last_copy;
     1709          config_to_cc_send_fifo_put   = true;
     1710
     1711          if ( m_config_to_cc_send_inst_fifo.wok() ) // inval request accepted
     1712          {
     1713              r_config_heap_next = entry.next;
     1714              if ( last_copy ) r_config_fsm = CONFIG_HEAP_LAST;
     1715          }
    16291716         
    16301717#if DEBUG_MEMC_CONFIG
    1631 if( m_debug )
    1632 std::cout << "  <MEMC " << name() << " CONFIG_BC_UPT_LOCK>"
    1633           << " UPT full" << std::endl;
    1634 #endif
    1635               }
     1718if(m_debug)
     1719std::cout << "  <MEMC " << name() << " CONFIG_HEAP_SCAN>"
     1720          << " Post multi inval request to CC_SEND FSM"
     1721          << " / address = " << std::hex << r_config_address.read()
     1722          << " / copy = " << entry.owner.srcid
     1723          << " / inst = " << std::dec << entry.owner.inst << std::endl;
     1724#endif
     1725          break;
     1726      }
     1727      //////////////////////
     1728      case CONFIG_HEAP_LAST:      // HEAP housekeeping
     1729      {
     1730          size_t free_pointer = m_heap.next_free_ptr();
     1731          HeapEntry last_entry;
     1732          last_entry.owner.srcid = 0;
     1733          last_entry.owner.inst  = false;
     1734
     1735          if ( m_heap.is_full() )
     1736          {
     1737              last_entry.next = r_config_dir_next_ptr.read();
     1738              m_heap.unset_full();
     1739          }
     1740          else
     1741          {
     1742              last_entry.next = free_pointer;
     1743          }
     1744
     1745          m_heap.write_free_ptr( r_config_dir_next_ptr.read() );
     1746          m_heap.write( r_config_heap_next.read(), last_entry );
     1747          r_config_fsm = CONFIG_INV_WAIT;
    16361748
    16371749#if DEBUG_MEMC_CONFIG
    16381750if(m_debug)
    1639 std::cout << "  <MEMC " << name() << " CONFIG_UPT_LOCK> Request access to UPT" << std::endl;
    1640 #endif
     1751std::cout << "  <MEMC " << name() << " CONFIG_HEAP_LAST>"
     1752          << " Heap housekeeping" << std::endl;
     1753#endif
     1754          break;
     1755      }
     1756      /////////////////////
     1757      case CONFIG_INV_WAIT:      // wait inval completion to return to LOOP
     1758      {
     1759          if ( r_multi_ack_to_config_ack.read() )
     1760          {
     1761              r_config_fsm     = CONFIG_LOOP;
     1762              r_config_nlines  = r_config_nlines.read() - 1;
     1763              r_config_address = r_config_address.read() + (m_words<<2);
    16411764          }
    1642           break;
    1643       }
    1644       /////////////////////
    1645       case CONFIG_HEAP_REQ:  // request access to the heap
    1646       {
    1647           break;
     1765
     1766#if DEBUG_MEMC_CONFIG
     1767if(m_debug)
     1768std::cout << "  <MEMC " << name() << " CONFIG_INV_WAIT> Waiting inval completion "
     1769          << " done = " << r_multi_ack_to_config_ack.read()
     1770          << std::endl;
     1771#endif
     1772          break;
    16481773      }
    16491774
     
    16511776      case CONFIG_RSP:  // request TGT_RSP FSM to return response
    16521777      {
    1653           if ( not r_config_to_tgt_rsp_req )
     1778          if ( not r_config_to_tgt_rsp_req.read() )
    16541779          {
    16551780              r_config_to_tgt_rsp_srcid  = r_config_srcid.read();
     
    16641789std::cout << "  <MEMC " << name() << " CONFIG_RSP> Request TGT_RSP FSM to return response:"
    16651790          << " error = " << r_config_to_tgt_rsp_error.read()
    1666           << " / rsrcid = " << std::hex << m_cmd_read_srcid_fifo.read() << std::endl;
     1791          << " / rsrcid = " << std::hex << r_config_srcid.read() << std::endl;
    16671792#endif
    16681793          }
    16691794          break;
    16701795
    1671       }
    1672       /////////////////////
    1673       case CONFIG_UPT_WAIT:    // release the lock on UPT for one cycle, and retry
    1674       {
    1675           if ( r_config_is_cnt.read() ) r_config_fsm = CONFIG_BC_UPT_LOCK;
    1676           else                          r_config_fsm = CONFIG_UPT_LOCK;
    1677 
    1678 #if DEBUG_MEMC_CONFIG
    1679 if(m_debug)
    1680 std::cout << "  <MEMC " << name() << " CONFIG_UPT_WAIT>"
    1681           << " Release UPT lock" << std::endl;
    1682 #endif
    1683           break;
    16841796      }
    16851797  }  // end switch r_config_fsm
     
    57295841  // the CLEANUP fsm.
    57305842  //
    5731   // It implements a round-robin priority between the four possible client FSMs
    5732   // XRAM_RSP, WRITE, CAS and CLEANUP. Each FSM can request the next services:
     5843  // It implements a round-robin priority between the five possible client FSMs
     5844  //     XRAM_RSP > CAS > CLEANUP > WRITE > CONFIG
     5845  //
     5846  // Each FSM can request the next services:
    57335847  // - r_xram_rsp_to_cc_send_multi_req : multi-inval
    57345848  //   r_xram_rsp_to_cc_send_brdcast_req : broadcast-inval
     
    57375851  // - r_cas_to_cc_send_multi_req : multi-update
    57385852  //   r_cas_to_cc_send_brdcast_req : broadcast-inval
     5853  // - r_config_to_cc_send_multi_req : multi-inval
     5854  //   r_config_to_cc_send_brdcast_req : broadcast-inval
     5855  //   
    57395856  // - r_cleanup_to_cc_send_req : cleanup acknowledgement
    57405857  //
     
    57505867  switch(r_cc_send_fsm.read())
    57515868  {
    5752     case CC_SEND_WRITE_IDLE:
    5753       {
    5754         // XRAM_RSP FSM has highest priority
     5869      /////////////////////////
     5870      case CC_SEND_CONFIG_IDLE:    // XRAM_RSP FSM has highest priority
     5871      {
     5872        // XRAM_RSP
    57555873        if(m_xram_rsp_to_cc_send_inst_fifo.rok() or
    57565874            r_xram_rsp_to_cc_send_multi_req.read())
     
    57605878          break;
    57615879        }
    5762 
    57635880        if(r_xram_rsp_to_cc_send_brdcast_req.read())
    57645881        {
     
    57675884          break;
    57685885        }
    5769 
     5886        // CAS
    57705887        if(m_cas_to_cc_send_inst_fifo.rok() or
    57715888            r_cas_to_cc_send_multi_req.read())
     
    57755892          break;
    57765893        }
    5777 
    57785894        if(r_cas_to_cc_send_brdcast_req.read())
    57795895        {
     
    57825898          break;
    57835899        }
    5784 
     5900        // CLEANUP
    57855901        if (r_cleanup_to_cc_send_req.read())
    57865902        {
     
    57885904          break;
    57895905        }
    5790 
     5906        // WRITE
    57915907        if(m_write_to_cc_send_inst_fifo.rok() or
    57925908            r_write_to_cc_send_multi_req.read())
     
    57965912          break;
    57975913        }
    5798 
    57995914        if(r_write_to_cc_send_brdcast_req.read())
    58005915        {
    58015916          r_cc_send_fsm = CC_SEND_WRITE_BRDCAST_HEADER;
    58025917          m_cpt_inval++;
     5918          break;
     5919        }
     5920        // CONFIG
     5921        if(r_config_to_cc_send_multi_req.read())
     5922        {
     5923          r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER;
     5924          m_cpt_inval++;
     5925          break;
     5926        }
     5927        if(r_config_to_cc_send_brdcast_req.read())
     5928        {
     5929          r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_HEADER;
     5930          m_cpt_inval++;
     5931          break;
    58035932        }
    58045933        break;
    58055934      }
    5806 
    5807     case CC_SEND_XRAM_RSP_IDLE:
    5808       {
    5809         // CAS FSM has highest priority
     5935      ////////////////////////
     5936      case CC_SEND_WRITE_IDLE:     // CONFIG FSM has highest priority
     5937      {
     5938        // CONFIG
     5939        if(r_config_to_cc_send_multi_req.read())
     5940        {
     5941          r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER;
     5942          m_cpt_inval++;
     5943          break;
     5944        }
     5945        if(r_config_to_cc_send_brdcast_req.read())
     5946        {
     5947          r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_HEADER;
     5948          m_cpt_inval++;
     5949          break;
     5950        }
     5951        // XRAM_RSP
     5952        if(m_xram_rsp_to_cc_send_inst_fifo.rok() or
     5953            r_xram_rsp_to_cc_send_multi_req.read())
     5954        {
     5955          r_cc_send_fsm = CC_SEND_XRAM_RSP_INVAL_HEADER;
     5956          m_cpt_inval++;
     5957          break;
     5958        }
     5959        if(r_xram_rsp_to_cc_send_brdcast_req.read())
     5960        {
     5961          r_cc_send_fsm = CC_SEND_XRAM_RSP_BRDCAST_HEADER;
     5962          m_cpt_inval++;
     5963          break;
     5964        }
     5965        // CAS
    58105966        if(m_cas_to_cc_send_inst_fifo.rok() or
    58115967            r_cas_to_cc_send_multi_req.read())
     
    58155971          break;
    58165972        }
    5817 
    58185973        if(r_cas_to_cc_send_brdcast_req.read())
    58195974        {
     
    58225977          break;
    58235978        }
    5824 
    5825         if(r_cleanup_to_cc_send_req.read())
     5979        // CLEANUP
     5980        if (r_cleanup_to_cc_send_req.read())
    58265981        {
    58275982          r_cc_send_fsm = CC_SEND_CLEANUP_ACK;
    58285983          break;
    58295984        }
    5830 
     5985        // WRITE
    58315986        if(m_write_to_cc_send_inst_fifo.rok() or
    58325987            r_write_to_cc_send_multi_req.read())
     
    58365991          break;
    58375992        }
    5838 
    58395993        if(r_write_to_cc_send_brdcast_req.read())
    58405994        {
     
    58435997          break;
    58445998        }
    5845 
     5999        break;
     6000      }
     6001      ///////////////////////////
     6002      case CC_SEND_XRAM_RSP_IDLE:   // CAS FSM has highest priority
     6003      {
     6004        // CAS
     6005        if(m_cas_to_cc_send_inst_fifo.rok() or
     6006            r_cas_to_cc_send_multi_req.read())
     6007        {
     6008          r_cc_send_fsm = CC_SEND_CAS_UPDT_HEADER;
     6009          m_cpt_update++;
     6010          break;
     6011        }
     6012        if(r_cas_to_cc_send_brdcast_req.read())
     6013        {
     6014          r_cc_send_fsm = CC_SEND_CAS_BRDCAST_HEADER;
     6015          m_cpt_inval++;
     6016          break;
     6017        }
     6018        // CLEANUP
     6019        if(r_cleanup_to_cc_send_req.read())
     6020        {
     6021          r_cc_send_fsm = CC_SEND_CLEANUP_ACK;
     6022          break;
     6023        }
     6024        // WRITE
     6025        if(m_write_to_cc_send_inst_fifo.rok() or
     6026            r_write_to_cc_send_multi_req.read())
     6027        {
     6028          r_cc_send_fsm = CC_SEND_WRITE_UPDT_HEADER;
     6029          m_cpt_update++;
     6030          break;
     6031        }
     6032
     6033        if(r_write_to_cc_send_brdcast_req.read())
     6034        {
     6035          r_cc_send_fsm = CC_SEND_WRITE_BRDCAST_HEADER;
     6036          m_cpt_inval++;
     6037          break;
     6038        }
     6039        // CONFIG
     6040        if(r_config_to_cc_send_multi_req.read())
     6041        {
     6042          r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER;
     6043          m_cpt_inval++;
     6044          break;
     6045        }
     6046        if(r_config_to_cc_send_brdcast_req.read())
     6047        {
     6048          r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_HEADER;
     6049          m_cpt_inval++;
     6050          break;
     6051        }
     6052        // XRAM_RSP
    58466053        if(m_xram_rsp_to_cc_send_inst_fifo.rok() or
    58476054            r_xram_rsp_to_cc_send_multi_req.read())
     
    58516058          break;
    58526059        }
    5853 
    58546060        if(r_xram_rsp_to_cc_send_brdcast_req.read())
    58556061        {
    58566062          r_cc_send_fsm = CC_SEND_XRAM_RSP_BRDCAST_HEADER;
    58576063          m_cpt_inval++;
    5858         }
    5859 
     6064          break;
     6065        }
    58606066        break;
    58616067      }
    5862 
    5863     case CC_SEND_CAS_IDLE:
    5864       {
    5865         // CLEANUP FSM has highest priority
     6068      //////////////////////
     6069      case CC_SEND_CAS_IDLE:   // CLEANUP FSM has highest priority
     6070      {
    58666071        if(r_cleanup_to_cc_send_req.read())
    58676072        {
     
    58696074          break;
    58706075        }
    5871 
    58726076        if(m_write_to_cc_send_inst_fifo.rok() or
    58736077            r_write_to_cc_send_multi_req.read())
     
    58776081          break;
    58786082        }
    5879 
    58806083        if(r_write_to_cc_send_brdcast_req.read())
    58816084        {
     
    58846087          break;
    58856088        }
    5886 
     6089        // CONFIG
     6090        if(r_config_to_cc_send_multi_req.read())
     6091        {
     6092          r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER;
     6093          m_cpt_inval++;
     6094          break;
     6095        }
     6096        if(r_config_to_cc_send_brdcast_req.read())
     6097        {
     6098          r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_HEADER;
     6099          m_cpt_inval++;
     6100          break;
     6101        }
    58876102        if(m_xram_rsp_to_cc_send_inst_fifo.rok() or
    58886103            r_xram_rsp_to_cc_send_multi_req.read())
     
    58926107          break;
    58936108        }
    5894 
    58956109        if(r_xram_rsp_to_cc_send_brdcast_req.read())
    58966110        {
     
    58996113          break;
    59006114        }
    5901 
    59026115        if(m_cas_to_cc_send_inst_fifo.rok() or
    59036116            r_cas_to_cc_send_multi_req.read())
     
    59076120          break;
    59086121        }
    5909 
    59106122        if(r_cas_to_cc_send_brdcast_req.read())
    59116123        {
    59126124          r_cc_send_fsm = CC_SEND_CAS_BRDCAST_HEADER;
    59136125          m_cpt_inval++;
     6126          break;
    59146127        }
    59156128        break;
    59166129      }
    5917 
    5918     case CC_SEND_CLEANUP_IDLE:
    5919       {
    5920         // WRITE FSM has highest priority
     6130      //////////////////////////
     6131      case CC_SEND_CLEANUP_IDLE:   // WRITE FSM has highest priority
     6132      {
     6133        // WRITE
    59216134        if(m_write_to_cc_send_inst_fifo.rok() or
    59226135            r_write_to_cc_send_multi_req.read())
     
    59266139          break;
    59276140        }
    5928 
    59296141        if(r_write_to_cc_send_brdcast_req.read())
    59306142        {
     
    59336145          break;
    59346146        }
    5935 
     6147        // CONFIG
     6148        if(r_config_to_cc_send_multi_req.read())
     6149        {
     6150          r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER;
     6151          m_cpt_inval++;
     6152          break;
     6153        }
     6154        if(r_config_to_cc_send_brdcast_req.read())
     6155        {
     6156          r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_HEADER;
     6157          m_cpt_inval++;
     6158          break;
     6159        }
     6160        // XRAM_RSP
    59366161        if(m_xram_rsp_to_cc_send_inst_fifo.rok() or
    59376162            r_xram_rsp_to_cc_send_multi_req.read())
     
    59416166          break;
    59426167        }
    5943 
    59446168        if(r_xram_rsp_to_cc_send_brdcast_req.read())
    59456169        {
     
    59486172          break;
    59496173        }
    5950 
     6174        // CAS
    59516175        if(m_cas_to_cc_send_inst_fifo.rok() or
    59526176            r_cas_to_cc_send_multi_req.read())
     
    59566180          break;
    59576181        }
    5958 
    59596182        if(r_cas_to_cc_send_brdcast_req.read())
    59606183        {
     
    59636186          break;
    59646187        }
    5965 
     6188        // CLEANUP
    59666189        if(r_cleanup_to_cc_send_req.read())
    59676190        {
    59686191          r_cc_send_fsm = CC_SEND_CLEANUP_ACK;
    5969         }
    5970 
     6192          break;
     6193        }
    59716194        break;
    59726195      }
    5973 
    5974     case CC_SEND_CLEANUP_ACK:
    5975       {
    5976         // send only flit for a cleanup acknowledgement (from CLEANUP FSM)
     6196      /////////////////////////////////
     6197      case CC_SEND_CONFIG_INVAL_HEADER:   // send first flit multi-inval (from CONFIG FSM)
     6198      {
     6199        if(m_config_to_cc_send_inst_fifo.rok())
     6200        {
     6201          if(not p_dspin_out.read) break;
     6202          r_cc_send_fsm = CC_SEND_CONFIG_INVAL_NLINE;
     6203          break;
     6204        }
     6205        if(r_config_to_cc_send_multi_req.read()) r_config_to_cc_send_multi_req = false;
     6206        r_cc_send_fsm = CC_SEND_CONFIG_IDLE;
     6207        break;
     6208      }
     6209      ////////////////////////////////
     6210      case CC_SEND_CONFIG_INVAL_NLINE:    // send second flit multi-inval (from CONFIG FSM)
     6211      {
     6212        if(not p_dspin_out.read) break;
     6213        m_cpt_inval_mult++;
     6214        config_to_cc_send_fifo_get = true;
     6215        r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER;
     6216
     6217#if DEBUG_MEMC_CC_SEND
     6218if(m_debug)
     6219std::cout << "  <MEMC " << name()
     6220          << " CC_SEND_CONFIG_INVAL_NLINE> multi-inval for line "
     6221          << std::hex << r_config_to_cc_send_nline.read() << std::endl;
     6222#endif
     6223        break;
     6224      }
     6225      ///////////////////////////////////
     6226      case CC_SEND_CONFIG_BRDCAST_HEADER:   // send first flit BC-inval (from CONFIG FSM)
     6227      {
     6228        if(not p_dspin_out.read) break;
     6229        r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_NLINE;
     6230        break;
     6231      }
     6232      //////////////////////////////////
     6233      case CC_SEND_CONFIG_BRDCAST_NLINE:    // send second flit BC-inval (from CONFIG FSM)
     6234      {
     6235        if(not p_dspin_out.read) break;
     6236        m_cpt_inval_brdcast++;
     6237        r_config_to_cc_send_brdcast_req = false;
     6238        r_cc_send_fsm = CC_SEND_CONFIG_IDLE;
     6239
     6240#if DEBUG_MEMC_CC_SEND
     6241if(m_debug)
     6242std::cout << "  <MEMC " << name()
     6243          << " CC_SEND_CONFIG_BRDCAST_NLINE> BC-Inval for line "
     6244          << std::hex << r_config_to_cc_send_nline.read() << std::endl;
     6245#endif
     6246        break;
     6247      }
     6248      /////////////////////////
     6249      case CC_SEND_CLEANUP_ACK:   // send one flit for a cleanup acknowledgement
     6250      {
    59776251        if(not p_dspin_out.read) break;
    59786252
     
    59886262        break;
    59896263      }
    5990 
    5991     case CC_SEND_XRAM_RSP_INVAL_HEADER:
    5992       {
    5993         // send first flit multi-inval (from XRAM_RSP FSM)
     6264      ///////////////////////////////////
     6265      case CC_SEND_XRAM_RSP_INVAL_HEADER:   // send first flit multi-inval (from XRAM_RSP FSM)
     6266      {
    59946267        if(m_xram_rsp_to_cc_send_inst_fifo.rok())
    59956268        {
    59966269          if(not p_dspin_out.read) break;
    5997 
    59986270          r_cc_send_fsm = CC_SEND_XRAM_RSP_INVAL_NLINE;
    59996271          break;
    60006272        }
    6001 
    6002         if(r_xram_rsp_to_cc_send_multi_req.read())
    6003         {
    6004           r_xram_rsp_to_cc_send_multi_req = false;
    6005         }
    6006 
     6273        if(r_xram_rsp_to_cc_send_multi_req.read()) r_xram_rsp_to_cc_send_multi_req = false;
    60076274        r_cc_send_fsm = CC_SEND_XRAM_RSP_IDLE;
    60086275        break;
    60096276      }
    6010 
    6011     case CC_SEND_XRAM_RSP_INVAL_NLINE:
    6012       {
    6013         // send second flit multi-inval (from XRAM_RSP FSM)
     6277      //////////////////////////////////
     6278      case CC_SEND_XRAM_RSP_INVAL_NLINE:   // send second flit multi-inval (from XRAM_RSP FSM)
     6279      {
    60146280        if(not p_dspin_out.read) break;
    6015 
    60166281        m_cpt_inval_mult++;
    6017 
    60186282        xram_rsp_to_cc_send_fifo_get = true;
    6019         r_cc_send_fsm                = CC_SEND_XRAM_RSP_INVAL_HEADER;
     6283        r_cc_send_fsm = CC_SEND_XRAM_RSP_INVAL_HEADER;
    60206284
    60216285#if DEBUG_MEMC_CC_SEND
     
    60276291        break;
    60286292      }
    6029 
    6030     case CC_SEND_XRAM_RSP_BRDCAST_HEADER:
    6031       {
    6032         // send first flit broadcast-inval (from XRAM_RSP FSM)
     6293      /////////////////////////////////////
     6294      case CC_SEND_XRAM_RSP_BRDCAST_HEADER:  // send first flit broadcast-inval (from XRAM_RSP FSM)
     6295      {
    60336296        if(not p_dspin_out.read) break;
    6034 
    60356297        r_cc_send_fsm = CC_SEND_XRAM_RSP_BRDCAST_NLINE;
    60366298        break;
    60376299      }
    6038 
    6039     case CC_SEND_XRAM_RSP_BRDCAST_NLINE:
    6040       {
    6041         // send second flit broadcast-inval (from XRAM_RSP FSM)
     6300      ////////////////////////////////////
     6301      case CC_SEND_XRAM_RSP_BRDCAST_NLINE:   // send second flit broadcast-inval (from XRAM_RSP FSM)
     6302      {
    60426303        if(not p_dspin_out.read) break;
    6043 
    60446304        m_cpt_inval_brdcast++;
    6045 
    60466305        r_xram_rsp_to_cc_send_brdcast_req = false;
    60476306        r_cc_send_fsm = CC_SEND_XRAM_RSP_IDLE;
     
    60556314        break;
    60566315      }
    6057 
    6058     case CC_SEND_WRITE_BRDCAST_HEADER:
    6059       {
    6060         // send first flit broadcast-inval (from WRITE FSM)
     6316      //////////////////////////////////
     6317      case CC_SEND_WRITE_BRDCAST_HEADER:   // send first flit broadcast-inval (from WRITE FSM)
     6318      {
    60616319        if(not p_dspin_out.read) break;
    6062 
    60636320        r_cc_send_fsm = CC_SEND_WRITE_BRDCAST_NLINE;
    60646321        break;
    60656322      }
    6066 
    6067     case CC_SEND_WRITE_BRDCAST_NLINE:
    6068       {
    6069         // send second flit broadcast-inval (from WRITE FSM)
     6323      /////////////////////////////////
     6324      case CC_SEND_WRITE_BRDCAST_NLINE:   // send second flit broadcast-inval (from WRITE FSM)
     6325      {
    60706326        if(not p_dspin_out.read) break;
    60716327
     
    60836339        break;
    60846340      }
    6085 
    6086     case CC_SEND_WRITE_UPDT_HEADER:
    6087       {
    6088         // send first flit for a multi-update (from WRITE FSM)
     6341      ///////////////////////////////
     6342      case CC_SEND_WRITE_UPDT_HEADER:   // send first flit for a multi-update (from WRITE FSM)
     6343      {
    60896344        if(m_write_to_cc_send_inst_fifo.rok())
    60906345        {
     
    61036358        break;
    61046359      }
    6105 
    6106     case CC_SEND_WRITE_UPDT_NLINE:
    6107       {
    6108         // send second flit for a multi-update (from WRITE FSM)
     6360      //////////////////////////////
     6361      case CC_SEND_WRITE_UPDT_NLINE:   // send second flit for a multi-update (from WRITE FSM)
     6362      {
    61096363        if(not p_dspin_out.read) break;
    6110 
    61116364        m_cpt_update_mult++;
    61126365
     
    61156368
    61166369#if DEBUG_MEMC_CC_SEND
    6117         if(m_debug)
    6118         {
    6119           std::cout
    6120             << "  <MEMC " << name()
    6121             << " CC_SEND_WRITE_UPDT_NLINE> Multicast-Update for line "
    6122             << r_write_to_cc_send_nline.read()
    6123             << std::endl;
    6124         }
     6370if(m_debug)
     6371std::cout << "  <MEMC " << name()
     6372          << " CC_SEND_WRITE_UPDT_NLINE> Multicast-Update for line "
     6373          << r_write_to_cc_send_nline.read() << std::endl;
    61256374#endif
    61266375        break;
    61276376      }
    6128 
    6129     case CC_SEND_WRITE_UPDT_DATA:
    6130       {
    6131         // send N data flits for a multi-update (from WRITE FSM)
     6377      /////////////////////////////
     6378      case CC_SEND_WRITE_UPDT_DATA:   // send N data flits for a multi-update (from WRITE FSM)
     6379      {
    61326380        if(not p_dspin_out.read) break;
    6133 
    61346381        if(r_cc_send_cpt.read() == (r_write_to_cc_send_count.read()-1))
    61356382        {
     
    61426389        break;
    61436390      }
    6144 
    6145     case CC_SEND_CAS_BRDCAST_HEADER:
    6146       {
    6147         // send first flit for a broadcast-inval (from CAS FSM)
     6391      ////////////////////////////////
     6392      case CC_SEND_CAS_BRDCAST_HEADER:   // send first flit  broadcast-inval (from CAS FSM)
     6393      {
    61486394        if(not p_dspin_out.read) break;
    6149 
    61506395        r_cc_send_fsm = CC_SEND_CAS_BRDCAST_NLINE;
    61516396        break;
    61526397      }
    6153 
    6154     case CC_SEND_CAS_BRDCAST_NLINE:
    6155       {
    6156         // send second flit broadcast-inval (from CAS FSM)
     6398      ///////////////////////////////
     6399      case CC_SEND_CAS_BRDCAST_NLINE:   // send second flit broadcast-inval (from CAS FSM)
     6400      {
    61576401        if(not p_dspin_out.read) break;
    6158 
    61596402        m_cpt_inval_brdcast++;
    61606403
     
    61636406
    61646407#if DEBUG_MEMC_CC_SEND
    6165         if(m_debug)
    6166         {
    6167           std::cout
    6168             << "  <MEMC " << name()
    6169             << " CC_SEND_CAS_BRDCAST_NLINE> Broadcast-Inval for line "
    6170             << r_cas_to_cc_send_nline.read()
    6171             << std::endl;
    6172         }
     6408if(m_debug)
     6409std::cout << "  <MEMC " << name()
     6410          << " CC_SEND_CAS_BRDCAST_NLINE> Broadcast-Inval for line "
     6411          << r_cas_to_cc_send_nline.read() << std::endl;
    61736412#endif
    61746413        break;
    61756414      }
    6176 
    6177     case CC_SEND_CAS_UPDT_HEADER:
    6178       {
    6179         // send first flit for a multi-update (from CAS FSM)
     6415      /////////////////////////////
     6416      case CC_SEND_CAS_UPDT_HEADER:   // send first flit for a multi-update (from CAS FSM)
     6417      {
    61806418        if(m_cas_to_cc_send_inst_fifo.rok())
    61816419        {
     
    61956433        break;
    61966434      }
    6197 
    6198     case CC_SEND_CAS_UPDT_NLINE:
    6199       {
    6200         // send second flit for a multi-update (from CAS FSM)
     6435      ////////////////////////////
     6436      case CC_SEND_CAS_UPDT_NLINE:   // send second flit for a multi-update (from CAS FSM)
     6437      {
    62016438        if(not p_dspin_out.read) break;
    62026439
     
    62146451        break;
    62156452      }
    6216 
    6217     case CC_SEND_CAS_UPDT_DATA:
    6218       {
    6219         // send first data for a multi-update (from CAS FSM)
     6453      ///////////////////////////
     6454      case CC_SEND_CAS_UPDT_DATA:   // send first data for a multi-update (from CAS FSM)
     6455      {
    62206456        if(not p_dspin_out.read) break;
    62216457
     
    62306466        break;
    62316467      }
    6232 
    6233     case CC_SEND_CAS_UPDT_DATA_HIGH:
    6234       {
    6235         // send second data for a multi-update (from CAS FSM)
     6468      ////////////////////////////////
     6469      case CC_SEND_CAS_UPDT_DATA_HIGH:   // send second data for a multi-update (from CAS FSM)
     6470      {
    62366471        if(not p_dspin_out.read) break;
    6237 
    62386472        cas_to_cc_send_fifo_get = true;
    62396473        r_cc_send_fsm = CC_SEND_CAS_UPDT_HEADER;
     
    63346568      }
    63356569  }
    6336   /////////////////////////////////////////////////////////////////////
     6570  //////////////////////////////////////////////////////////////////////////
    63376571  //    TGT_RSP FSM
    6338   /////////////////////////////////////////////////////////////////////
     6572  //////////////////////////////////////////////////////////////////////////
    63396573  // The TGT_RSP fsm sends the responses on the VCI target port
    6340   // with a round robin priority between seven requests :
     6574  // with a round robin priority between eigth requests :
     6575  // - r_config_to_tgt_rsp_req
    63416576  // - r_tgt_cmd_to_tgt_rsp_req
    63426577  // - r_read_to_tgt_rsp_req
     
    63486583  //
    63496584  // The ordering is :
    6350   //   tgt_cmd > read > write > cas > xram > multi_ack > cleanup
    6351   /////////////////////////////////////////////////////////////////////
     6585  //   config >tgt_cmd > read > write > cas > xram > multi_ack > cleanup
     6586  //////////////////////////////////////////////////////////////////////////
    63526587
    63536588  switch(r_tgt_rsp_fsm.read())
    63546589  {
    6355     case TGT_RSP_TGT_CMD_IDLE: // read requests have the highest priority
    6356     {
    6357       if(r_read_to_tgt_rsp_req)
     6590    /////////////////////////
     6591    case TGT_RSP_CONFIG_IDLE:  // tgt_cmd requests have the highest priority
     6592    {
     6593      if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
     6594      else if(r_read_to_tgt_rsp_req)
    63586595      {
    63596596        r_tgt_rsp_fsm = TGT_RSP_READ;
    63606597        r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read();
    63616598      }
    6362       else if(r_write_to_tgt_rsp_req)
    6363       {
    6364         r_tgt_rsp_fsm = TGT_RSP_WRITE;
    6365       }
    6366       else if(r_cas_to_tgt_rsp_req)
    6367       {
    6368         r_tgt_rsp_fsm = TGT_RSP_CAS  ;
    6369       }
     6599      else if(r_write_to_tgt_rsp_req)     r_tgt_rsp_fsm = TGT_RSP_WRITE;
     6600      else if(r_cas_to_tgt_rsp_req)       r_tgt_rsp_fsm = TGT_RSP_CAS;
    63706601      else if(r_xram_rsp_to_tgt_rsp_req)
    63716602      {
     
    63736604        r_tgt_rsp_cpt = r_xram_rsp_to_tgt_rsp_word.read();
    63746605      }
    6375       else if(r_multi_ack_to_tgt_rsp_req)
    6376       {
    6377         r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK;
    6378       }
    6379       else if(r_cleanup_to_tgt_rsp_req)
    6380       {
    6381         r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
    6382       }
    6383       else if(r_tgt_cmd_to_tgt_rsp_req)
    6384       {
    6385         r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
    6386       }
     6606      else if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK;
     6607      else if(r_cleanup_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
     6608      else if(r_config_to_tgt_rsp_req)    r_tgt_rsp_fsm = TGT_RSP_CONFIG;
     6609      break;
     6610    }
     6611    //////////////////////////
     6612    case TGT_RSP_TGT_CMD_IDLE: // read requests have the highest priority
     6613    {
     6614      if(r_read_to_tgt_rsp_req)
     6615      {
     6616        r_tgt_rsp_fsm = TGT_RSP_READ;
     6617        r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read();
     6618      }
     6619      else if(r_write_to_tgt_rsp_req)     r_tgt_rsp_fsm = TGT_RSP_WRITE;
     6620      else if(r_cas_to_tgt_rsp_req)       r_tgt_rsp_fsm = TGT_RSP_CAS;
     6621      else if(r_xram_rsp_to_tgt_rsp_req)
     6622      {
     6623        r_tgt_rsp_fsm = TGT_RSP_XRAM;
     6624        r_tgt_rsp_cpt = r_xram_rsp_to_tgt_rsp_word.read();
     6625      }
     6626      else if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK;
     6627      else if(r_cleanup_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
     6628      else if(r_config_to_tgt_rsp_req)    r_tgt_rsp_fsm = TGT_RSP_CONFIG;
     6629      else if(r_tgt_cmd_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
    63876630      break;
    63886631    }
     
    63906633    case TGT_RSP_READ_IDLE: // write requests have the highest priority
    63916634    {
    6392       if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE;
    6393       else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS;
     6635      if(r_write_to_tgt_rsp_req)          r_tgt_rsp_fsm = TGT_RSP_WRITE;
     6636      else if(r_cas_to_tgt_rsp_req)       r_tgt_rsp_fsm = TGT_RSP_CAS;
    63946637      else if(r_xram_rsp_to_tgt_rsp_req)
    63956638      {
     
    63986641      }
    63996642      else if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK;
    6400       else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
    6401       else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
     6643      else if(r_cleanup_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
     6644      else if(r_config_to_tgt_rsp_req)    r_tgt_rsp_fsm = TGT_RSP_CONFIG;
     6645      else if(r_tgt_cmd_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
    64026646      else if(r_read_to_tgt_rsp_req)
    64036647      {
     
    64106654    case TGT_RSP_WRITE_IDLE: // cas requests have the highest priority
    64116655    {
    6412       if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS;
     6656      if(r_cas_to_tgt_rsp_req)            r_tgt_rsp_fsm = TGT_RSP_CAS;
    64136657      else if(r_xram_rsp_to_tgt_rsp_req)
    64146658      {
     
    64176661      }
    64186662      else if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK;
    6419       else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
    6420       else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
     6663      else if(r_cleanup_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
     6664      else if(r_config_to_tgt_rsp_req)    r_tgt_rsp_fsm = TGT_RSP_CONFIG;
     6665      else if(r_tgt_cmd_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
    64216666      else if(r_read_to_tgt_rsp_req)
    64226667      {
     
    64246669        r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read();
    64256670      }
    6426 
    6427       else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE;
     6671      else if(r_write_to_tgt_rsp_req)     r_tgt_rsp_fsm = TGT_RSP_WRITE;
    64286672      break;
    64296673    }
     
    64376681      }
    64386682      else if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK   ;
    6439       else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
    6440       else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
     6683      else if(r_cleanup_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
     6684      else if(r_config_to_tgt_rsp_req)    r_tgt_rsp_fsm = TGT_RSP_CONFIG;
     6685      else if(r_tgt_cmd_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
    64416686      else if(r_read_to_tgt_rsp_req)
    64426687      {
     
    64446689        r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read();
    64456690      }
    6446       else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE;
    6447       else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS  ;
     6691      else if(r_write_to_tgt_rsp_req)     r_tgt_rsp_fsm = TGT_RSP_WRITE;
     6692      else if(r_cas_to_tgt_rsp_req)       r_tgt_rsp_fsm = TGT_RSP_CAS  ;
    64486693      break;
    64496694    }
     
    64526697    {
    64536698
    6454       if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK   ;
    6455       else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
    6456       else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
     6699      if(r_multi_ack_to_tgt_rsp_req)      r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK   ;
     6700      else if(r_cleanup_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
     6701      else if(r_config_to_tgt_rsp_req)    r_tgt_rsp_fsm = TGT_RSP_CONFIG;
     6702      else if(r_tgt_cmd_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
    64576703      else if(r_read_to_tgt_rsp_req)
    64586704      {
     
    64606706        r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read();
    64616707      }
    6462       else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE;
    6463       else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS  ;
     6708      else if(r_write_to_tgt_rsp_req)     r_tgt_rsp_fsm = TGT_RSP_WRITE;
     6709      else if(r_cas_to_tgt_rsp_req)       r_tgt_rsp_fsm = TGT_RSP_CAS  ;
    64646710      else if(r_xram_rsp_to_tgt_rsp_req)
    64656711      {
     
    64696715      break;
    64706716    }
    6471     ///////////////////////
     6717    ////////////////////////////
    64726718    case TGT_RSP_MULTI_ACK_IDLE: // cleanup requests have the highest priority
    64736719    {
    6474       if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
    6475       else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
     6720      if(r_cleanup_to_tgt_rsp_req)        r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
     6721      else if(r_config_to_tgt_rsp_req)    r_tgt_rsp_fsm = TGT_RSP_CONFIG;
     6722      else if(r_tgt_cmd_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
    64766723      else if(r_read_to_tgt_rsp_req)
    64776724      {
     
    64796726        r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read();
    64806727      }
    6481       else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE;
    6482       else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS  ;
     6728      else if(r_write_to_tgt_rsp_req)     r_tgt_rsp_fsm = TGT_RSP_WRITE;
     6729      else if(r_cas_to_tgt_rsp_req)       r_tgt_rsp_fsm = TGT_RSP_CAS  ;
    64836730      else if(r_xram_rsp_to_tgt_rsp_req)
    64846731      {
     
    64896736      break;
    64906737    }
    6491     ///////////////////////
     6738    //////////////////////////
    64926739    case TGT_RSP_CLEANUP_IDLE: // tgt cmd requests have the highest priority
    64936740    {
    6494       if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
     6741      if(r_config_to_tgt_rsp_req)         r_tgt_rsp_fsm = TGT_RSP_CONFIG;
     6742      else if(r_tgt_cmd_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_TGT_CMD;
    64956743      else if(r_read_to_tgt_rsp_req)
    64966744      {
     
    64986746        r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read();
    64996747      }
    6500       else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE;
    6501       else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS  ;
     6748      else if(r_write_to_tgt_rsp_req)     r_tgt_rsp_fsm = TGT_RSP_WRITE;
     6749      else if(r_cas_to_tgt_rsp_req)       r_tgt_rsp_fsm = TGT_RSP_CAS  ;
    65026750      else if(r_xram_rsp_to_tgt_rsp_req)
    65036751      {
     
    65066754      }
    65076755      else if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK   ;
    6508       else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
    6509       break;
    6510     }
    6511     /////////////////////
    6512     case TGT_RSP_TGT_CMD: // send the response after a segmentation violation
    6513                           // or after a config transaction 
     6756      else if(r_cleanup_to_tgt_rsp_req)   r_tgt_rsp_fsm = TGT_RSP_CLEANUP;
     6757      break;
     6758    }
     6759    ////////////////////
     6760    case TGT_RSP_CONFIG:  // send the response for a config transaction
    65146761    {
    65156762      if ( p_vci_tgt.rspack )
    65166763      {
    6517         r_tgt_cmd_to_tgt_rsp_req = false;
    6518         r_tgt_rsp_fsm            = TGT_RSP_TGT_CMD_IDLE;
     6764        r_config_to_tgt_rsp_req = false;
     6765        r_tgt_rsp_fsm           = TGT_RSP_CONFIG_IDLE;
    65196766
    65206767#if DEBUG_MEMC_TGT_RSP
     
    65236770  std::cout
    65246771    << "  <MEMC " << name()
    6525     << " TGT_RSP_TGT_CMD> Segmentation violation ior config access response"
     6772    << " TGT_RSP_CONFIG>  Config transaction completed response"
     6773    << " / rsrcid = " << std::hex << r_config_to_tgt_rsp_srcid.read()
     6774    << " / rtrdid = " << r_config_to_tgt_rsp_trdid.read()
     6775    << " / rpktid = " << r_config_to_tgt_rsp_pktid.read()
     6776    << std::endl;
     6777}
     6778#endif
     6779      }
     6780      break;
     6781    }
     6782    /////////////////////
     6783    case TGT_RSP_TGT_CMD: // send the response for a segmentation violation
     6784    {
     6785      if ( p_vci_tgt.rspack )
     6786      {
     6787        r_tgt_cmd_to_tgt_rsp_req = false;
     6788        r_tgt_rsp_fsm            = TGT_RSP_TGT_CMD_IDLE;
     6789
     6790#if DEBUG_MEMC_TGT_RSP
     6791if( m_debug )
     6792{
     6793  std::cout
     6794    << "  <MEMC " << name()
     6795    << " TGT_RSP_TGT_CMD> Segmentation violation response"
    65266796    << " / rsrcid = " << std::hex << r_tgt_cmd_to_tgt_rsp_srcid.read()
    65276797    << " / rtrdid = " << r_tgt_cmd_to_tgt_rsp_trdid.read()
     
    65316801#endif
    65326802      }
    6533     }
    6534     break;
    6535 
     6803      break;
     6804    }
    65366805    //////////////////
    65376806    case TGT_RSP_READ:    // send the response to a read
     
    66346903      break;
    66356904    }
    6636 
    66376905    //////////////////
    66386906    case TGT_RSP_XRAM:    // send the response after XRAM access
     
    67176985      //////////////////////
    67186986      case ALLOC_UPT_CONFIG:   // allocated to CONFIG FSM
    6719       if ( (r_config_fsm.read() != CONFIG_UPT_LOCK) and
    6720            (r_config_fsm.read() != CONFIG_BC_UPT_LOCK) )
     6987      if (r_config_fsm.read() != CONFIG_DIR_UPT_LOCK)
    67216988      {
    67226989        if(r_multi_ack_fsm.read() == MULTI_ACK_UPT_LOCK)
     
    67587025          r_alloc_upt_fsm = ALLOC_UPT_CAS;
    67597026
    6760         else if((r_config_fsm.read() == CONFIG_UPT_LOCK) or
    6761                 (r_config_fsm.read() == CONFIG_BC_UPT_LOCK))
     7027        else if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK)
    67627028          r_alloc_upt_fsm = ALLOC_UPT_CONFIG;
    67637029      }
     
    67797045          r_alloc_upt_fsm = ALLOC_UPT_CAS;
    67807046
    6781         else if((r_config_fsm.read() == CONFIG_UPT_LOCK) or
    6782                 (r_config_fsm.read() == CONFIG_BC_UPT_LOCK))
     7047        else if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK)
    67837048          r_alloc_upt_fsm = ALLOC_UPT_CONFIG;
    67847049
     
    67997064          r_alloc_upt_fsm = ALLOC_UPT_CAS;
    68007065
    6801         else if((r_config_fsm.read() == CONFIG_UPT_LOCK) or
    6802                 (r_config_fsm.read() == CONFIG_BC_UPT_LOCK))
     7066        else if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK)
    68037067          r_alloc_upt_fsm = ALLOC_UPT_CONFIG;
    68047068
     
    68217085          r_alloc_upt_fsm = ALLOC_UPT_CAS;
    68227086
    6823         else if((r_config_fsm.read() == CONFIG_UPT_LOCK) or
    6824                 (r_config_fsm.read() == CONFIG_BC_UPT_LOCK))
     7087        else if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK)
    68257088          r_alloc_upt_fsm = ALLOC_UPT_CONFIG;
    68267089
     
    68427105          (r_cas_fsm.read() != CAS_BC_UPT_LOCK))
    68437106      {
    6844         if((r_config_fsm.read() == CONFIG_UPT_LOCK) or
    6845                 (r_config_fsm.read() == CONFIG_BC_UPT_LOCK))
     7107        if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK)
    68467108          r_alloc_upt_fsm = ALLOC_UPT_CONFIG;
    68477109
     
    68917153    if ( (r_config_fsm.read()    != CONFIG_DIR_REQ) and
    68927154         (r_config_fsm.read()    != CONFIG_DIR_ACCESS) and
    6893          (r_config_fsm.read()    != CONFIG_DIR_INVAL) )
     7155         (r_config_fsm.read()    != CONFIG_DIR_UPT_LOCK) )
    68947156    {
    68957157        if(r_read_fsm.read() == READ_DIR_REQ)
     
    71897451  ////////////////////////////////////////////////////////////////////////////////////
    71907452  // The ALLOC_HEAP FSM allocates the access to the heap
    7191   // with a round robin priority between 5 user FSMs :
    7192   // The cyclic ordering is READ > WRITE > CAS > CLEANUP > XRAM_RSP
     7453  // with a round robin priority between 6 user FSMs :
     7454  // The cyclic ordering is READ > WRITE > CAS > CLEANUP > XRAM_RSP > CONFIG
    71937455  // The ressource is always allocated.
    71947456  /////////////////////////////////////////////////////////////////////////////////////
     
    71977459  {
    71987460      ////////////////////
    7199     case ALLOC_HEAP_RESET:
     7461      case ALLOC_HEAP_RESET:
    72007462      // Initializes the heap one ENTRY each cycle.
    72017463
     
    72117473
    72127474      ////////////////////
    7213     case ALLOC_HEAP_READ:
     7475      case ALLOC_HEAP_READ:
    72147476      if((r_read_fsm.read() != READ_HEAP_REQ) and
    72157477          (r_read_fsm.read() != READ_HEAP_LOCK) and
     
    72277489        else if(r_xram_rsp_fsm.read() == XRAM_RSP_HEAP_REQ)
    72287490          r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP;
     7491
     7492        else if(r_config_fsm.read() == CONFIG_HEAP_REQ)
     7493          r_alloc_heap_fsm = ALLOC_HEAP_CONFIG;
    72297494      }
    72307495      break;
    72317496
    72327497      /////////////////////
    7233     case ALLOC_HEAP_WRITE:
     7498      case ALLOC_HEAP_WRITE:
    72347499      if((r_write_fsm.read() != WRITE_UPT_HEAP_LOCK) and
    72357500          (r_write_fsm.read() != WRITE_UPT_REQ) and
     
    72457510          r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP;
    72467511
     7512        else if(r_config_fsm.read() == CONFIG_HEAP_REQ)
     7513          r_alloc_heap_fsm = ALLOC_HEAP_CONFIG;
     7514
    72477515        else if(r_read_fsm.read() == READ_HEAP_REQ)
    72487516          r_alloc_heap_fsm = ALLOC_HEAP_READ;
     
    72517519
    72527520      ////////////////////
    7253     case ALLOC_HEAP_CAS:
     7521      case ALLOC_HEAP_CAS:
    72547522      if((r_cas_fsm.read() != CAS_UPT_HEAP_LOCK) and
    72557523          (r_cas_fsm.read() != CAS_UPT_REQ) and
     
    72627530          r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP;
    72637531
     7532        else if(r_config_fsm.read() == CONFIG_HEAP_REQ)
     7533          r_alloc_heap_fsm = ALLOC_HEAP_CONFIG;
     7534
    72647535        else if(r_read_fsm.read() == READ_HEAP_REQ)
    72657536          r_alloc_heap_fsm = ALLOC_HEAP_READ;
     
    72717542
    72727543      ///////////////////////
    7273     case ALLOC_HEAP_CLEANUP:
     7544      case ALLOC_HEAP_CLEANUP:
    72747545      if((r_cleanup_fsm.read() != CLEANUP_HEAP_REQ) and
    72757546          (r_cleanup_fsm.read() != CLEANUP_HEAP_LOCK) and
     
    72807551          r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP;
    72817552
     7553        else if(r_config_fsm.read() == CONFIG_HEAP_REQ)
     7554          r_alloc_heap_fsm = ALLOC_HEAP_CONFIG;
     7555
    72827556        else if(r_read_fsm.read() == READ_HEAP_REQ)
    72837557          r_alloc_heap_fsm = ALLOC_HEAP_READ;
     
    72927566
    72937567      ////////////////////////
    7294     case ALLOC_HEAP_XRAM_RSP:
     7568      case ALLOC_HEAP_XRAM_RSP:
    72957569      if((r_xram_rsp_fsm.read() != XRAM_RSP_HEAP_REQ) and
    72967570          (r_xram_rsp_fsm.read() != XRAM_RSP_HEAP_ERASE))
    72977571      {
     7572        if(r_config_fsm.read() == CONFIG_HEAP_REQ)
     7573          r_alloc_heap_fsm = ALLOC_HEAP_CONFIG;
     7574
     7575        else if(r_read_fsm.read() == READ_HEAP_REQ)
     7576          r_alloc_heap_fsm = ALLOC_HEAP_READ;
     7577
     7578        else if(r_write_fsm.read() == WRITE_UPT_HEAP_LOCK)
     7579          r_alloc_heap_fsm = ALLOC_HEAP_WRITE;
     7580
     7581        else if(r_cas_fsm.read() == CAS_UPT_HEAP_LOCK)
     7582          r_alloc_heap_fsm = ALLOC_HEAP_CAS;
     7583
     7584        else if(r_cleanup_fsm.read() == CLEANUP_HEAP_REQ)
     7585          r_alloc_heap_fsm = ALLOC_HEAP_CLEANUP;
     7586
     7587      }
     7588      break;
     7589
     7590      ///////////////////////
     7591      case ALLOC_HEAP_CONFIG:
     7592      if((r_config_fsm.read() != CONFIG_HEAP_REQ) and
     7593          (r_config_fsm.read() != CONFIG_HEAP_SCAN))
     7594      {
    72987595        if(r_read_fsm.read() == READ_HEAP_REQ)
    72997596          r_alloc_heap_fsm = ALLOC_HEAP_READ;
     
    73087605          r_alloc_heap_fsm = ALLOC_HEAP_CLEANUP;
    73097606
     7607        if(r_xram_rsp_fsm.read() == XRAM_RSP_HEAP_REQ)
     7608          r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP;
    73107609      }
    73117610      break;
     
    73327631  /////////////////////////////////////////////////////////////////////
    73337632
    7334   if(cmd_write_fifo_put)
    7335   {
    7336     if(cmd_write_fifo_get)
    7337     {
    7338       m_cmd_write_addr_fifo.put_and_get((addr_t)(p_vci_tgt.address.read()));
    7339       m_cmd_write_eop_fifo.put_and_get(p_vci_tgt.eop.read());
    7340       m_cmd_write_srcid_fifo.put_and_get(p_vci_tgt.srcid.read());
    7341       m_cmd_write_trdid_fifo.put_and_get(p_vci_tgt.trdid.read());
    7342       m_cmd_write_pktid_fifo.put_and_get(p_vci_tgt.pktid.read());
    7343       m_cmd_write_data_fifo.put_and_get(p_vci_tgt.wdata.read());
    7344       m_cmd_write_be_fifo.put_and_get(p_vci_tgt.be.read());
    7345     }
    7346     else
    7347     {
    7348       m_cmd_write_addr_fifo.simple_put((addr_t)(p_vci_tgt.address.read()));
    7349       m_cmd_write_eop_fifo.simple_put(p_vci_tgt.eop.read());
    7350       m_cmd_write_srcid_fifo.simple_put(p_vci_tgt.srcid.read());
    7351       m_cmd_write_trdid_fifo.simple_put(p_vci_tgt.trdid.read());
    7352       m_cmd_write_pktid_fifo.simple_put(p_vci_tgt.pktid.read());
    7353       m_cmd_write_data_fifo.simple_put(p_vci_tgt.wdata.read());
    7354       m_cmd_write_be_fifo.simple_put(p_vci_tgt.be.read());
    7355     }
    7356   }
    7357   else
    7358   {
    7359     if(cmd_write_fifo_get)
    7360     {
    7361       m_cmd_write_addr_fifo.simple_get();
    7362       m_cmd_write_eop_fifo.simple_get();
    7363       m_cmd_write_srcid_fifo.simple_get();
    7364       m_cmd_write_trdid_fifo.simple_get();
    7365       m_cmd_write_pktid_fifo.simple_get();
    7366       m_cmd_write_data_fifo.simple_get();
    7367       m_cmd_write_be_fifo.simple_get();
    7368     }
    7369   }
     7633  m_cmd_write_addr_fifo.update(  cmd_write_fifo_get, cmd_write_fifo_put,
     7634                                 (addr_t)p_vci_tgt.address.read() );
     7635  m_cmd_write_eop_fifo.update(   cmd_write_fifo_get, cmd_write_fifo_put,
     7636                                 p_vci_tgt.eop.read() );
     7637  m_cmd_write_srcid_fifo.update( cmd_write_fifo_get, cmd_write_fifo_put,
     7638                                 p_vci_tgt.srcid.read() );
     7639  m_cmd_write_trdid_fifo.update( cmd_write_fifo_get, cmd_write_fifo_put,
     7640                                 p_vci_tgt.trdid.read() );
     7641  m_cmd_write_pktid_fifo.update( cmd_write_fifo_get, cmd_write_fifo_put,
     7642                                 p_vci_tgt.pktid.read() );
     7643  m_cmd_write_data_fifo.update(  cmd_write_fifo_get, cmd_write_fifo_put,
     7644                                 p_vci_tgt.wdata.read() );
     7645  m_cmd_write_be_fifo.update(    cmd_write_fifo_get, cmd_write_fifo_put,
     7646                                 p_vci_tgt.be.read() );
     7647
    73707648  ////////////////////////////////////////////////////////////////////////////////////
    73717649  //    TGT_CMD to CAS FIFO
    73727650  ////////////////////////////////////////////////////////////////////////////////////
    73737651
    7374   if(cmd_cas_fifo_put)
    7375   {
    7376     if(cmd_cas_fifo_get)
    7377     {
    7378       m_cmd_cas_addr_fifo.put_and_get((addr_t)(p_vci_tgt.address.read()));
    7379       m_cmd_cas_eop_fifo.put_and_get(p_vci_tgt.eop.read());
    7380       m_cmd_cas_srcid_fifo.put_and_get(p_vci_tgt.srcid.read());
    7381       m_cmd_cas_trdid_fifo.put_and_get(p_vci_tgt.trdid.read());
    7382       m_cmd_cas_pktid_fifo.put_and_get(p_vci_tgt.pktid.read());
    7383       m_cmd_cas_wdata_fifo.put_and_get(p_vci_tgt.wdata.read());
    7384     }
    7385     else
    7386     {
    7387       m_cmd_cas_addr_fifo.simple_put((addr_t)(p_vci_tgt.address.read()));
    7388       m_cmd_cas_eop_fifo.simple_put(p_vci_tgt.eop.read());
    7389       m_cmd_cas_srcid_fifo.simple_put(p_vci_tgt.srcid.read());
    7390       m_cmd_cas_trdid_fifo.simple_put(p_vci_tgt.trdid.read());
    7391       m_cmd_cas_pktid_fifo.simple_put(p_vci_tgt.pktid.read());
    7392       m_cmd_cas_wdata_fifo.simple_put(p_vci_tgt.wdata.read());
    7393     }
    7394   }
    7395   else
    7396   {
    7397     if(cmd_cas_fifo_get)
    7398     {
    7399       m_cmd_cas_addr_fifo.simple_get();
    7400       m_cmd_cas_eop_fifo.simple_get();
    7401       m_cmd_cas_srcid_fifo.simple_get();
    7402       m_cmd_cas_trdid_fifo.simple_get();
    7403       m_cmd_cas_pktid_fifo.simple_get();
    7404       m_cmd_cas_wdata_fifo.simple_get();
    7405     }
    7406   }
     7652  m_cmd_cas_addr_fifo.update(  cmd_cas_fifo_get, cmd_cas_fifo_put,
     7653                               (addr_t)p_vci_tgt.address.read() );
     7654  m_cmd_cas_eop_fifo.update(   cmd_cas_fifo_get, cmd_cas_fifo_put,
     7655                               p_vci_tgt.eop.read() );
     7656  m_cmd_cas_srcid_fifo.update( cmd_cas_fifo_get, cmd_cas_fifo_put,
     7657                               p_vci_tgt.srcid.read() );
     7658  m_cmd_cas_trdid_fifo.update( cmd_cas_fifo_get, cmd_cas_fifo_put,
     7659                               p_vci_tgt.trdid.read() );
     7660  m_cmd_cas_pktid_fifo.update( cmd_cas_fifo_get, cmd_cas_fifo_put,
     7661                               p_vci_tgt.pktid.read() );
     7662  m_cmd_cas_wdata_fifo.update( cmd_cas_fifo_get, cmd_cas_fifo_put,
     7663                               p_vci_tgt.wdata.read() );
     7664
    74077665  ////////////////////////////////////////////////////////////////////////////////////
    74087666  //    CC_RECEIVE to CLEANUP FIFO
    74097667  ////////////////////////////////////////////////////////////////////////////////////
    74107668
    7411   if(cc_receive_to_cleanup_fifo_put)
    7412   {
    7413     if(cc_receive_to_cleanup_fifo_get)
    7414     {
    7415       m_cc_receive_to_cleanup_fifo.put_and_get(p_dspin_in.data.read());
    7416     }
    7417     else
    7418     {
    7419       m_cc_receive_to_cleanup_fifo.simple_put(p_dspin_in.data.read());
    7420     }
    7421   }
    7422   else
    7423   {
    7424     if(cc_receive_to_cleanup_fifo_get)
    7425     {
    7426       m_cc_receive_to_cleanup_fifo.simple_get();
    7427     }
    7428   }
     7669  m_cc_receive_to_cleanup_fifo.update( cc_receive_to_cleanup_fifo_get,
     7670                                       cc_receive_to_cleanup_fifo_put,
     7671                                       p_dspin_in.data.read() );
    74297672
    74307673  ////////////////////////////////////////////////////////////////////////////////////
     
    74327675  ////////////////////////////////////////////////////////////////////////////////////
    74337676
    7434   if(cc_receive_to_multi_ack_fifo_put)
    7435   {
    7436     if(cc_receive_to_multi_ack_fifo_get)
    7437     {
    7438       m_cc_receive_to_multi_ack_fifo.put_and_get(p_dspin_in.data.read());
    7439     }
    7440     else
    7441     {
    7442       m_cc_receive_to_multi_ack_fifo.simple_put(p_dspin_in.data.read());
    7443     }
    7444   }
    7445   else
    7446   {
    7447     if(cc_receive_to_multi_ack_fifo_get)
    7448     {
    7449       m_cc_receive_to_multi_ack_fifo.simple_get();
    7450     }
    7451   }
     7677  m_cc_receive_to_multi_ack_fifo.update( cc_receive_to_multi_ack_fifo_get,
     7678                                         cc_receive_to_multi_ack_fifo_put,
     7679                                         p_dspin_in.data.read() );
    74527680
    74537681  ////////////////////////////////////////////////////////////////////////////////////
     
    74557683  ////////////////////////////////////////////////////////////////////////////////////
    74567684
    7457   if(write_to_cc_send_fifo_put)
    7458   {
    7459     if(write_to_cc_send_fifo_get)
    7460     {
    7461       m_write_to_cc_send_inst_fifo.put_and_get(write_to_cc_send_fifo_inst);
    7462       m_write_to_cc_send_srcid_fifo.put_and_get(write_to_cc_send_fifo_srcid);
     7685  m_write_to_cc_send_inst_fifo.update( write_to_cc_send_fifo_get, write_to_cc_send_fifo_put,
     7686                                       write_to_cc_send_fifo_inst );
     7687  m_write_to_cc_send_srcid_fifo.update( write_to_cc_send_fifo_get, write_to_cc_send_fifo_put,
     7688                                        write_to_cc_send_fifo_srcid );
    74637689#if L1_MULTI_CACHE
    7464       m_write_to_cc_send_cache_id_fifo.put_and_get(write_to_cc_send_fifo_cache_id);
    7465 #endif
    7466     }
    7467     else
    7468     {
    7469       m_write_to_cc_send_inst_fifo.simple_put(write_to_cc_send_fifo_inst);
    7470       m_write_to_cc_send_srcid_fifo.simple_put(write_to_cc_send_fifo_srcid);
     7690  m_write_to_cc_send_cache_id_fifo.update( write_to_cc_send_fifo_get, write_to_cc_send_fifo_put,
     7691                                           write_to_cc_send_fifo_cache_id );
     7692#endif
     7693
     7694  ////////////////////////////////////////////////////////////////////////////////////
     7695  //    CONFIG to CC_SEND FIFO
     7696  ////////////////////////////////////////////////////////////////////////////////////
     7697
     7698  m_config_to_cc_send_inst_fifo.update( config_to_cc_send_fifo_get, config_to_cc_send_fifo_put,
     7699                                        config_to_cc_send_fifo_inst );
     7700  m_config_to_cc_send_srcid_fifo.update( config_to_cc_send_fifo_get, config_to_cc_send_fifo_put,
     7701                                         config_to_cc_send_fifo_srcid );
    74717702#if L1_MULTI_CACHE
    7472       m_write_to_cc_send_cache_id_fifo.simple_put(write_to_cc_send_fifo_cache_id);
    7473 #endif
    7474     }
    7475   }
    7476   else
    7477   {
    7478     if(write_to_cc_send_fifo_get)
    7479     {
    7480       m_write_to_cc_send_inst_fifo.simple_get();
    7481       m_write_to_cc_send_srcid_fifo.simple_get();
    7482 #if L1_MULTI_CACHE
    7483       m_write_to_cc_send_cache_id_fifo.simple_get();
    7484 #endif
    7485     }
    7486   }
     7703  m_config_to_cc_send_cache_id_fifo.update( config_to_cc_send_fifo_get, config_to_cc_send_fifo_put,
     7704                                            config_to_cc_send_fifo_cache_id );
     7705#endif
     7706
    74877707  ////////////////////////////////////////////////////////////////////////////////////
    74887708  //    XRAM_RSP to CC_SEND FIFO
    74897709  ////////////////////////////////////////////////////////////////////////////////////
    74907710
    7491   if(xram_rsp_to_cc_send_fifo_put)
    7492   {
    7493     if(xram_rsp_to_cc_send_fifo_get)
    7494     {
    7495       m_xram_rsp_to_cc_send_inst_fifo.put_and_get(xram_rsp_to_cc_send_fifo_inst);
    7496       m_xram_rsp_to_cc_send_srcid_fifo.put_and_get(xram_rsp_to_cc_send_fifo_srcid);
     7711  m_xram_rsp_to_cc_send_inst_fifo.update( xram_rsp_to_cc_send_fifo_get, xram_rsp_to_cc_send_fifo_put,
     7712                                          xram_rsp_to_cc_send_fifo_inst );
     7713  m_xram_rsp_to_cc_send_srcid_fifo.update( xram_rsp_to_cc_send_fifo_get, xram_rsp_to_cc_send_fifo_put,
     7714                                           xram_rsp_to_cc_send_fifo_srcid );
    74977715#if L1_MULTI_CACHE
    7498       m_xram_rsp_to_cc_send_cache_id_fifo.put_and_get(xram_rsp_to_cc_send_fifo_cache_id);
    7499 #endif
    7500     }
    7501     else
    7502     {
    7503       m_xram_rsp_to_cc_send_inst_fifo.simple_put(xram_rsp_to_cc_send_fifo_inst);
    7504       m_xram_rsp_to_cc_send_srcid_fifo.simple_put(xram_rsp_to_cc_send_fifo_srcid);
    7505 #if L1_MULTI_CACHE
    7506       m_xram_rsp_to_cc_send_cache_id_fifo.simple_put(xram_rsp_to_cc_send_fifo_cache_id);
    7507 #endif
    7508     }
    7509   }
    7510   else
    7511   {
    7512     if(xram_rsp_to_cc_send_fifo_get)
    7513     {
    7514       m_xram_rsp_to_cc_send_inst_fifo.simple_get();
    7515       m_xram_rsp_to_cc_send_srcid_fifo.simple_get();
    7516 #if L1_MULTI_CACHE
    7517       m_xram_rsp_to_cc_send_cache_id_fifo.simple_get();
    7518 #endif
    7519     }
    7520   }
     7716  m_xram_rsp_to_cc_send_cache_id_fifo.update( xram_rsp_to_cc_send_fifo_get, xram_rsp_to_cc_send_fifo_put,
     7717                                              xram_rsp_to_cc_send_fifo_cache_id );
     7718#endif
     7719
    75217720  ////////////////////////////////////////////////////////////////////////////////////
    75227721  //    CAS to CC_SEND FIFO
    75237722  ////////////////////////////////////////////////////////////////////////////////////
    75247723
    7525   if(cas_to_cc_send_fifo_put)
    7526   {
    7527     if(cas_to_cc_send_fifo_get)
    7528     {
    7529       m_cas_to_cc_send_inst_fifo.put_and_get(cas_to_cc_send_fifo_inst);
    7530       m_cas_to_cc_send_srcid_fifo.put_and_get(cas_to_cc_send_fifo_srcid);
     7724  m_cas_to_cc_send_inst_fifo.update( cas_to_cc_send_fifo_get, cas_to_cc_send_fifo_put,
     7725                                     cas_to_cc_send_fifo_inst );
     7726  m_cas_to_cc_send_srcid_fifo.update( cas_to_cc_send_fifo_get, cas_to_cc_send_fifo_put,
     7727                                      cas_to_cc_send_fifo_srcid );
    75317728#if L1_MULTI_CACHE
    7532       m_cas_to_cc_send_cache_id_fifo.put_and_get(cas_to_cc_send_fifo_cache_id);
    7533 #endif
    7534     }
    7535     else
    7536     {
    7537       m_cas_to_cc_send_inst_fifo.simple_put(cas_to_cc_send_fifo_inst);
    7538       m_cas_to_cc_send_srcid_fifo.simple_put(cas_to_cc_send_fifo_srcid);
    7539 #if L1_MULTI_CACHE
    7540       m_cas_to_cc_send_cache_id_fifo.simple_put(cas_to_cc_send_fifo_cache_id);
    7541 #endif
    7542     }
    7543   }
    7544   else
    7545   {
    7546     if(cas_to_cc_send_fifo_get)
    7547     {
    7548       m_cas_to_cc_send_inst_fifo.simple_get();
    7549       m_cas_to_cc_send_srcid_fifo.simple_get();
    7550 #if L1_MULTI_CACHE
    7551       m_cas_to_cc_send_cache_id_fifo.simple_get();
    7552 #endif
    7553     }
    7554   }
     7729  m_cas_to_cc_send_cache_id_fifo.update( cas_to_cc_send_fifo_get, cas_to_cc_send_fifo_put,
     7730                                         cas_to_cc_send_fifo_cache_id );
     7731#endif
    75557732
    75567733  m_cpt_cycles++;
     
    76757852      break;
    76767853
     7854    case TGT_CMD_CONFIG:
    76777855    case TGT_CMD_ERROR:
    76787856      p_vci_tgt.cmdack = not r_tgt_cmd_to_tgt_rsp_req.read();
     
    76897867    case TGT_CMD_CAS:
    76907868      p_vci_tgt.cmdack = m_cmd_cas_addr_fifo.wok();
    7691       break;
    7692 
    7693     default:
    7694       p_vci_tgt.cmdack = false;
    76957869      break;
    76967870  }
     
    77027876  switch(r_tgt_rsp_fsm.read())
    77037877  {
     7878    case TGT_RSP_CONFIG_IDLE:
    77047879    case TGT_RSP_TGT_CMD_IDLE:
    77057880    case TGT_RSP_READ_IDLE:
     
    77097884    case TGT_RSP_MULTI_ACK_IDLE:
    77107885    case TGT_RSP_CLEANUP_IDLE:
     7886    {
    77117887      p_vci_tgt.rspval  = false;
    77127888      p_vci_tgt.rsrcid  = 0;
     
    77177893      p_vci_tgt.reop    = false;
    77187894      break;
     7895    }
     7896    case TGT_RSP_CONFIG:
     7897    {
     7898      p_vci_tgt.rspval  = true;
     7899      p_vci_tgt.rdata   = 0;
     7900      p_vci_tgt.rsrcid  = r_config_to_tgt_rsp_srcid.read();
     7901      p_vci_tgt.rtrdid  = r_config_to_tgt_rsp_trdid.read();
     7902      p_vci_tgt.rpktid  = r_config_to_tgt_rsp_pktid.read();
     7903      p_vci_tgt.rerror  = r_config_to_tgt_rsp_error.read();
     7904      p_vci_tgt.reop    = true;
     7905
     7906      break;
     7907    }
    77197908
    77207909    case TGT_RSP_TGT_CMD:
     
    78408029  {
    78418030    ///////////////////////////
     8031    case CC_SEND_CONFIG_IDLE:
    78428032    case CC_SEND_XRAM_RSP_IDLE:
    78438033    case CC_SEND_WRITE_IDLE:
    78448034    case CC_SEND_CAS_IDLE:
    78458035    case CC_SEND_CLEANUP_IDLE:
     8036    {
    78468037        break;
    7847 
     8038    }
     8039    ////////////////////////////////
     8040    case CC_SEND_CONFIG_INVAL_HEADER:
     8041    {
     8042        uint8_t multi_inval_type;
     8043        if(m_config_to_cc_send_inst_fifo.read())
     8044        {
     8045          multi_inval_type = DspinDhccpParam::TYPE_MULTI_INVAL_INST;
     8046        }
     8047        else
     8048        {
     8049          multi_inval_type = DspinDhccpParam::TYPE_MULTI_INVAL_DATA;
     8050        }
     8051
     8052        uint64_t flit = 0;
     8053        uint64_t dest = m_config_to_cc_send_srcid_fifo.read() <<
     8054                        (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S);
     8055
     8056        DspinDhccpParam::dspin_set( flit,
     8057                                    dest,
     8058                                    DspinDhccpParam::MULTI_INVAL_DEST);
     8059
     8060        DspinDhccpParam::dspin_set( flit,
     8061                                    m_cc_global_id,
     8062                                    DspinDhccpParam::MULTI_INVAL_SRCID);
     8063
     8064        DspinDhccpParam::dspin_set( flit,
     8065                                    r_config_to_cc_send_trdid.read(),
     8066                                    DspinDhccpParam::MULTI_INVAL_UPDT_INDEX);
     8067
     8068        DspinDhccpParam::dspin_set( flit,
     8069                                    multi_inval_type,
     8070                                    DspinDhccpParam::FROM_MC_TYPE);
     8071        p_dspin_out.write = true;
     8072        p_dspin_out.data  = flit;
     8073        break;
     8074    }
     8075    ////////////////////////////////
     8076    case CC_SEND_CONFIG_INVAL_NLINE:
     8077    {
     8078        uint64_t flit = 0;
     8079        DspinDhccpParam::dspin_set( flit,
     8080                                    r_config_to_cc_send_nline.read(),
     8081                                    DspinDhccpParam::MULTI_INVAL_NLINE);
     8082        p_dspin_out.eop   = true;
     8083        p_dspin_out.write = true;
     8084        p_dspin_out.data  = flit;
     8085        break;
     8086    }
    78488087    ////////////////////////
    78498088    case CC_SEND_CLEANUP_ACK:
     
    78898128
    78908129        break;
    7891       }
     8130    }
    78928131
    78938132    ///////////////////////////////////
    78948133    case CC_SEND_XRAM_RSP_INVAL_HEADER:
    7895       {
     8134    {
    78968135        if(not m_xram_rsp_to_cc_send_inst_fifo.rok()) break;
    78978136
     
    79078146
    79088147        uint64_t flit = 0;
    7909         uint64_t dest =
    7910           m_xram_rsp_to_cc_send_srcid_fifo.read() <<
    7911           (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S);
    7912 
    7913         DspinDhccpParam::dspin_set(
    7914             flit,
    7915             dest,
    7916             DspinDhccpParam::MULTI_INVAL_DEST);
    7917 
    7918         DspinDhccpParam::dspin_set(
    7919             flit,
    7920             m_cc_global_id,
    7921             DspinDhccpParam::MULTI_INVAL_SRCID);
    7922 
    7923         DspinDhccpParam::dspin_set(
    7924             flit,
    7925             r_xram_rsp_to_cc_send_trdid.read(),
    7926             DspinDhccpParam::MULTI_INVAL_UPDT_INDEX);
    7927 
    7928         DspinDhccpParam::dspin_set(
    7929             flit,
    7930             multi_inval_type,
    7931             DspinDhccpParam::FROM_MC_TYPE);
    7932 
     8148        uint64_t dest = m_xram_rsp_to_cc_send_srcid_fifo.read() <<
     8149                        (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S);
     8150
     8151        DspinDhccpParam::dspin_set( flit,
     8152                                    dest,
     8153                                    DspinDhccpParam::MULTI_INVAL_DEST);
     8154
     8155        DspinDhccpParam::dspin_set( flit,
     8156                                    m_cc_global_id,
     8157                                    DspinDhccpParam::MULTI_INVAL_SRCID);
     8158
     8159        DspinDhccpParam::dspin_set( flit,
     8160                                    r_xram_rsp_to_cc_send_trdid.read(),
     8161                                    DspinDhccpParam::MULTI_INVAL_UPDT_INDEX);
     8162
     8163        DspinDhccpParam::dspin_set( flit,
     8164                                    multi_inval_type,
     8165                                    DspinDhccpParam::FROM_MC_TYPE);
    79338166        p_dspin_out.write = true;
    79348167        p_dspin_out.data  = flit;
    7935 
    79368168        break;
    7937       }
     8169    }
    79388170
    79398171    //////////////////////////////////
    79408172    case CC_SEND_XRAM_RSP_INVAL_NLINE:
    7941       {
     8173    {
    79428174        uint64_t flit = 0;
    79438175
    7944         DspinDhccpParam::dspin_set(
    7945             flit,
    7946             r_xram_rsp_to_cc_send_nline.read(),
    7947             DspinDhccpParam::MULTI_INVAL_NLINE);
    7948 
    7949 
     8176        DspinDhccpParam::dspin_set( flit,
     8177                                    r_xram_rsp_to_cc_send_nline.read(),
     8178                                    DspinDhccpParam::MULTI_INVAL_NLINE);
    79508179        p_dspin_out.eop   = true;
    79518180        p_dspin_out.write = true;
    79528181        p_dspin_out.data  = flit;
    7953 
    79548182        break;
    7955       }
     8183    }
    79568184
    79578185    /////////////////////////////////////
     8186    case CC_SEND_CONFIG_BRDCAST_HEADER:
    79588187    case CC_SEND_XRAM_RSP_BRDCAST_HEADER:
    79598188    case CC_SEND_WRITE_BRDCAST_HEADER:
    79608189    case CC_SEND_CAS_BRDCAST_HEADER:
    7961       {
     8190    {
    79628191        uint64_t flit = 0;
    79638192
    7964         DspinDhccpParam::dspin_set(
    7965             flit,
    7966             m_broadcast_boundaries,
    7967             DspinDhccpParam::BROADCAST_BOX);
    7968 
    7969         DspinDhccpParam::dspin_set(
    7970             flit,
    7971             m_cc_global_id,
    7972             DspinDhccpParam::BROADCAST_SRCID);
    7973 
    7974         DspinDhccpParam::dspin_set(
    7975             flit,
    7976             1ULL,
    7977             DspinDhccpParam::FROM_MC_BC);
    7978 
     8193        DspinDhccpParam::dspin_set( flit,
     8194                                    m_broadcast_boundaries,
     8195                                    DspinDhccpParam::BROADCAST_BOX);
     8196
     8197        DspinDhccpParam::dspin_set( flit,
     8198                                    m_cc_global_id,
     8199                                    DspinDhccpParam::BROADCAST_SRCID);
     8200
     8201        DspinDhccpParam::dspin_set( flit,
     8202                                    1ULL,
     8203                                    DspinDhccpParam::FROM_MC_BC);
    79798204        p_dspin_out.write = true;
    79808205        p_dspin_out.data  = flit;
    7981 
    79828206        break;
    7983       }
     8207    }
    79848208    ////////////////////////////////////
    79858209    case CC_SEND_XRAM_RSP_BRDCAST_NLINE:
    7986       {
     8210    {
    79878211        uint64_t flit = 0;
    7988 
    7989         DspinDhccpParam::dspin_set(
    7990             flit,
    7991             r_xram_rsp_to_cc_send_nline.read(),
    7992             DspinDhccpParam::BROADCAST_NLINE);
    7993 
     8212        DspinDhccpParam::dspin_set( flit,
     8213                                    r_xram_rsp_to_cc_send_nline.read(),
     8214                                    DspinDhccpParam::BROADCAST_NLINE);
    79948215        p_dspin_out.write = true;
    79958216        p_dspin_out.eop   = true;
    79968217        p_dspin_out.data  = flit;
    7997 
    79988218        break;
    7999       }
    8000     /////////////////////////////////
    8001     case CC_SEND_WRITE_BRDCAST_NLINE:
    8002       {
     8219    }
     8220    //////////////////////////////////
     8221    case CC_SEND_CONFIG_BRDCAST_NLINE:
     8222    {
    80038223        uint64_t flit = 0;
    8004 
    8005         DspinDhccpParam::dspin_set(
    8006             flit,
    8007             r_write_to_cc_send_nline.read(),
    8008             DspinDhccpParam::BROADCAST_NLINE);
    8009 
     8224        DspinDhccpParam::dspin_set( flit,
     8225                                    r_config_to_cc_send_nline.read(),
     8226                                    DspinDhccpParam::BROADCAST_NLINE);
    80108227        p_dspin_out.write = true;
    80118228        p_dspin_out.eop   = true;
    80128229        p_dspin_out.data  = flit;
    8013 
    80148230        break;
    8015       }
    8016     ///////////////////////////////
    8017     case CC_SEND_CAS_BRDCAST_NLINE:
    8018       {
     8231    }
     8232    /////////////////////////////////
     8233    case CC_SEND_WRITE_BRDCAST_NLINE:
     8234    {
    80198235        uint64_t flit = 0;
    8020 
    8021         DspinDhccpParam::dspin_set(
    8022             flit,
    8023             r_cas_to_cc_send_nline.read(),
    8024             DspinDhccpParam::BROADCAST_NLINE);
    8025 
     8236        DspinDhccpParam::dspin_set( flit,
     8237                                    r_write_to_cc_send_nline.read(),
     8238                                    DspinDhccpParam::BROADCAST_NLINE);
    80268239        p_dspin_out.write = true;
    80278240        p_dspin_out.eop   = true;
    80288241        p_dspin_out.data  = flit;
    8029 
    80308242        break;
    8031       }
     8243    }
     8244    ///////////////////////////////
     8245    case CC_SEND_CAS_BRDCAST_NLINE:
     8246    {
     8247        uint64_t flit = 0;
     8248        DspinDhccpParam::dspin_set( flit,
     8249                                    r_cas_to_cc_send_nline.read(),
     8250                                    DspinDhccpParam::BROADCAST_NLINE);
     8251        p_dspin_out.write = true;
     8252        p_dspin_out.eop   = true;
     8253        p_dspin_out.data  = flit;
     8254        break;
     8255    }
    80328256    ///////////////////////////////
    80338257    case CC_SEND_WRITE_UPDT_HEADER:
    8034       {
     8258    {
    80358259        if(not m_write_to_cc_send_inst_fifo.rok()) break;
    80368260
     
    80748298
    80758299        break;
    8076       }
     8300    }
    80778301    //////////////////////////////
    80788302    case CC_SEND_WRITE_UPDT_NLINE:
    8079       {
     8303    {
    80808304        uint64_t flit = 0;
    80818305
     
    80948318
    80958319        break;
    8096       }
     8320    }
    80978321    /////////////////////////////
    80988322    case CC_SEND_WRITE_UPDT_DATA:
    8099       {
     8323    {
    81008324
    81018325        uint8_t multi_updt_cpt  =
     
    81228346
    81238347        break;
    8124       }
     8348    }
    81258349    ////////////////////////////
    81268350    case CC_SEND_CAS_UPDT_HEADER:
    8127       {
     8351    {
    81288352        if (not m_cas_to_cc_send_inst_fifo.rok()) break;
    81298353
     
    81678391
    81688392        break;
    8169       }
     8393    }
    81708394    ////////////////////////////
    81718395    case CC_SEND_CAS_UPDT_NLINE:
    8172       {
     8396    {
    81738397        uint64_t flit = 0;
    81748398
     
    81878411
    81888412        break;
    8189       }
     8413    }
    81908414    ///////////////////////////
    81918415    case CC_SEND_CAS_UPDT_DATA:
    8192       {
     8416    {
    81938417        uint64_t flit = 0;
    81948418
     
    82088432
    82098433        break;
    8210       }
     8434    }
    82118435    ////////////////////////////////
    82128436    case CC_SEND_CAS_UPDT_DATA_HIGH:
    8213       {
     8437    {
    82148438        uint64_t flit = 0;
    82158439
     
    82298453
    82308454        break;
    8231       }
     8455    }
    82328456  }
    82338457
Note: See TracChangeset for help on using the changeset viewer.