Ignore:
Timestamp:
Jul 17, 2013, 2:42:13 PM (11 years ago)
Author:
cfuguet
Message:

Merging branch/v5/vci_cc_vcache_wrapper with trunk modifications
to start the development of new coherence protocol modifications
in this component

Location:
branches/v5/modules/vci_cc_vcache_wrapper
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/v5/modules/vci_cc_vcache_wrapper

  • branches/v5/modules/vci_cc_vcache_wrapper/caba/metadata/vci_cc_vcache_wrapper.sd

    r351 r443  
    77            tmpl_parameters = [
    88            parameter.Module('vci_param', default = 'caba:vci_param'),
     9            parameter.Int('dspin_in_width'),
     10            parameter.Int('dspin_out_width'),
    911                parameter.Module('iss_t')
    1012        ],
     
    2022                Uses('caba:multi_write_buffer'),
    2123                Uses('caba:generic_fifo'),
    22                 Uses(
    23                 'caba:generic_cache_tsar',
     24                Uses('caba:generic_cache_tsar',
    2425                addr_t = parameter.StringExt('sc_dt::sc_uint<%d> ',
    25                 parameter.Reference('addr_size'))
    26             ),
    27             Uses(
    28                 'caba:generic_tlb',
     26                parameter.Reference('addr_size'))),
     27            Uses('caba:generic_tlb',
    2928                addr_t = parameter.StringExt('sc_dt::sc_uint<%d> ',
    30                 parameter.Reference('addr_size'))
    31             ),
    32             Uses(
    33                 'common:address_masking_table',
     29                parameter.Reference('addr_size'))),
     30            Uses('common:address_masking_table',
    3431                data_t = parameter.StringExt('sc_dt::sc_uint<%d> ',
    3532                parameter.Reference('addr_size'))
    3633            ),
    37                         Uses(
    38                 'caba:dspin_dhccp_param'
    39                           ),
     34                        Uses('caba:dspin_dhccp_param'),
    4035        ],
    4136
    4237            ports = [
    43             Port('caba:vci_initiator', 'p_vci_ini_d'),
    44             Port('caba:dspin_input', 'p_dspin_in', dspin_data_size = 40),
    45             Port('caba:dspin_output', 'p_dspin_out', dspin_data_size = 33),
     38            Port('caba:vci_initiator', 'p_vci'),
     39            Port('caba:dspin_input', 'p_dspin_in',
     40                  dspin_data_size = parameter.Reference('dspin_in_width')),
     41            Port('caba:dspin_output', 'p_dspin_out',
     42                  dspin_data_size = parameter.Reference('dspin_out_width')),
    4643                Port('caba:bit_in','p_irq', parameter.Constant('n_irq')),
    4744                Port('caba:bit_in', 'p_resetn', auto = 'resetn'),
  • branches/v5/modules/vci_cc_vcache_wrapper/caba/source/include/vci_cc_vcache_wrapper.h

    r351 r443  
    5555
    5656////////////////////////////////////////////
    57 template<typename vci_param, typename iss_t>
     57template<typename vci_param,
     58         size_t   dspin_in_width,
     59         size_t   dspin_out_width,
     60         typename iss_t>
    5861class VciCcVCacheWrapper
    5962////////////////////////////////////////////
    6063    : public soclib::caba::BaseModule
    6164{
    62     typedef uint32_t vaddr_t;
    63     typedef uint32_t tag_t;
    64     typedef uint32_t type_t;
    65     typedef typename iss_t::DataOperationType data_op_t;
    66 
    67     typedef typename vci_param::addr_t  paddr_t;
    68     typedef typename vci_param::data_t  vci_data_t;
    69     typedef typename vci_param::be_t    vci_be_t;
    70     typedef typename vci_param::srcid_t vci_srcid_t;
    71     typedef typename vci_param::trdid_t vci_trdid_t;
    72     typedef typename vci_param::pktid_t vci_pktid_t;
    73     typedef typename vci_param::plen_t  vci_plen_t;
    74 
    75     enum icache_fsm_state_e {
     65
     66    typedef typename vci_param::fast_addr_t  paddr_t;
     67
     68    enum icache_fsm_state_e
     69    {
    7670        ICACHE_IDLE,
    7771        // handling XTN processor requests
     
    10195    };
    10296
    103     enum dcache_fsm_state_e {
     97    enum dcache_fsm_state_e
     98    {
    10499        DCACHE_IDLE,
    105100        // handling itlb & dtlb miss
     
    151146    };
    152147
    153     enum cmd_fsm_state_e {
     148    enum cmd_fsm_state_e
     149    {
    154150        CMD_IDLE,
    155151        CMD_INS_MISS,
     
    163159    };
    164160
    165     enum rsp_fsm_state_e {
     161    enum rsp_fsm_state_e
     162    {
    166163        RSP_IDLE,
    167164        RSP_INS_MISS,
     
    173170    };
    174171
    175     enum cc_receive_fsm_state_e {
     172    enum cc_receive_fsm_state_e
     173    {
    176174        CC_RECEIVE_IDLE,
    177175        CC_RECEIVE_CLACK,
     
    185183    };
    186184
    187     enum cc_send_fsm_state_e {
     185    enum cc_send_fsm_state_e
     186    {
    188187        CC_SEND_IDLE,
    189188        CC_SEND_CLEANUP_1,
     
    221220
    222221    // cc_send_type
    223     typedef enum {
     222    typedef enum
     223    {
    224224        CC_TYPE_CLEANUP,
    225225        CC_TYPE_MULTI_ACK,
     
    227227
    228228    // cc_receive_type
    229     typedef enum {
     229    typedef enum
     230    {
    230231        CC_TYPE_CLACK,
    231232        CC_TYPE_BRDCAST,
     
    235236
    236237    // TLB Mode : ITLB / DTLB / ICACHE / DCACHE
    237     enum {
     238    enum
     239    {
    238240        INS_TLB_MASK    = 0x8,
    239241        DATA_TLB_MASK   = 0x4,
     
    283285
    284286public:
    285     sc_in<bool>                             p_clk;
    286     sc_in<bool>                             p_resetn;
    287     sc_in<bool>                             p_irq[iss_t::n_irq];
    288     soclib::caba::VciInitiator<vci_param>   p_vci;
    289     soclib::caba::DspinInput <40>           p_dspin_in;
    290     soclib::caba::DspinOutput<33>           p_dspin_out;
     287    sc_in<bool>                                 p_clk;
     288    sc_in<bool>                                 p_resetn;
     289    sc_in<bool>                                 p_irq[iss_t::n_irq];
     290    soclib::caba::VciInitiator<vci_param>       p_vci;
     291    soclib::caba::DspinInput <dspin_in_width>   p_dspin_in;
     292    soclib::caba::DspinOutput<dspin_out_width>  p_dspin_out;
    291293
    292294private:
     
    295297    soclib::common::AddressDecodingTable<uint32_t, bool> m_cacheability_table;
    296298
    297     const vci_srcid_t                   m_srcid;
     299    const size_t                        m_srcid;
    298300    const size_t                        m_cc_global_id;
    299301    const size_t                        m_nline_width;
     
    327329
    328330    /////////////////////////////////////////////
    329     // debug variables (for each FSM)
     331    // debug variables
    330332    /////////////////////////////////////////////
    331     bool                                m_debug_previous_hit;
    332     bool                                m_idebug_previous_hit;
    333     bool                                m_debug_dcache_fsm;
    334     bool                                m_debug_icache_fsm;
    335     bool                                m_debug_inval_itlb_fsm;
    336     bool                                m_debug_inval_dtlb_fsm;
     333    bool                                m_debug_previous_i_hit;
     334    bool                                m_debug_previous_d_hit;
     335    bool                                m_debug_activated;
    337336
    338337    ///////////////////////////////
     
    401400    sc_signal<uint32_t>     r_dcache_save_vaddr;        // virtual address (from proc)
    402401    sc_signal<uint32_t>     r_dcache_save_wdata;        // write data (from proc)
    403     sc_signal<vci_be_t>     r_dcache_save_be;           // byte enable (from proc)
     402    sc_signal<uint32_t>     r_dcache_save_be;           // byte enable (from proc)
    404403    sc_signal<paddr_t>      r_dcache_save_paddr;        // physical address
    405404    sc_signal<bool>         r_dcache_save_cacheable;    // address cacheable
     
    416415    sc_signal<bool>         r_dcache_vci_miss_req;      // read miss request
    417416    sc_signal<bool>         r_dcache_vci_unc_req;       // uncacheable read request
    418     sc_signal<bool>         r_dcache_vci_unc_be;        // uncacheable read byte enable
     417    sc_signal<uint32_t>     r_dcache_vci_unc_be;        // uncacheable read byte enable
    419418    sc_signal<bool>         r_dcache_vci_cas_req;       // atomic write request CAS
    420419    sc_signal<uint32_t>     r_dcache_vci_cas_old;       // previous data value for a CAS
     
    422421    sc_signal<bool>         r_dcache_vci_ll_req;        // atomic read request LL
    423422    sc_signal<bool>         r_dcache_vci_sc_req;        // atomic write request SC
    424     sc_signal<vci_data_t>   r_dcache_vci_sc_data;       // SC data (command)
     423    sc_signal<uint32_t>     r_dcache_vci_sc_data;       // SC data (command)
    425424
    426425    // register used for XTN inval
     
    479478
    480479    // dcache directory extension
    481     bool                    *r_dcache_in_tlb;           // copy exist in dtlb or itlb
    482     bool                    *r_dcache_contains_ptd;     // cache line contains a PTD
     480    bool                    *r_dcache_in_tlb;               // copy exist in dtlb or itlb
     481    bool                    *r_dcache_contains_ptd;         // cache line contains a PTD
     482
     483    // Physical address extension for data access
     484    sc_signal<uint32_t>     r_dcache_paddr_ext;             // CP2 register (if vci_address > 32)
    483485
    484486    ///////////////////////////////////
     
    486488    ///////////////////////////////////
    487489    sc_signal<int>          r_vci_cmd_fsm;
    488     sc_signal<size_t>       r_vci_cmd_min;                  // used for write bursts
    489     sc_signal<size_t>       r_vci_cmd_max;                  // used for write bursts
    490     sc_signal<size_t>       r_vci_cmd_cpt;                  // used for write bursts
    491     sc_signal<bool>         r_vci_cmd_imiss_prio;           // round-robin between imiss & dmiss
     490    sc_signal<size_t>       r_vci_cmd_min;                      // used for write bursts
     491    sc_signal<size_t>       r_vci_cmd_max;                      // used for write bursts
     492    sc_signal<size_t>       r_vci_cmd_cpt;                      // used for write bursts
     493    sc_signal<bool>         r_vci_cmd_imiss_prio;               // round-robin between imiss & dmiss
    492494
    493495    ///////////////////////////////////
     
    498500    sc_signal<bool>         r_vci_rsp_ins_error;
    499501    sc_signal<bool>         r_vci_rsp_data_error;
    500     GenericFifo<uint32_t>   r_vci_rsp_fifo_icache;          // response FIFO to ICACHE FSM
    501     GenericFifo<uint32_t>   r_vci_rsp_fifo_dcache;          // response FIFO to DCACHE FSM
     502    GenericFifo<uint32_t>   r_vci_rsp_fifo_icache;              // response FIFO to ICACHE FSM
     503    GenericFifo<uint32_t>   r_vci_rsp_fifo_dcache;              // response FIFO to DCACHE FSM
    502504
    503505    ///////////////////////////////////
    504506    //  CC_SEND FSM REGISTER
    505507    ///////////////////////////////////
    506     sc_signal<int>          r_cc_send_fsm;          // state register
    507     sc_signal<bool>         r_cc_send_last_client;  // round robin flip-flop : 0 dcache / 1 icache
     508    sc_signal<int>          r_cc_send_fsm;                  // state register
     509    sc_signal<bool>         r_cc_send_last_client;          // 0 dcache / 1 icache
    508510
    509511    ///////////////////////////////////
    510512    //  CC_RECEIVE FSM REGISTER
    511513    ///////////////////////////////////
    512     sc_signal<int>          r_cc_receive_fsm;          // state register
    513     sc_signal<bool>         r_cc_receive_data_ins;     // request concerning : 0 dcache / 1 icache
    514 
    515     // communication cc updt FIFO between CC_RECEIVE FSM and ICACHE/DCACHE FSM
    516     sc_signal<size_t>       r_cc_receive_word_idx;  // word index
     514    sc_signal<int>          r_cc_receive_fsm;               // state register
     515    sc_signal<bool>         r_cc_receive_data_ins;          // request to : 0 dcache / 1 icache
     516
     517    // communication between CC_RECEIVE FSM and ICACHE/DCACHE FSM
     518    sc_signal<size_t>       r_cc_receive_word_idx;          // word index
    517519    GenericFifo<uint32_t>   r_cc_receive_updt_fifo_be;
    518520    GenericFifo<uint32_t>   r_cc_receive_updt_fifo_data;
     
    520522
    521523    // communication between CC_RECEIVE FSM and ICACHE FSM
    522     sc_signal<bool>         r_cc_receive_icache_req;       // cc_receive to icache request
    523     sc_signal<cc_receive_t> r_cc_receive_icache_type;      // cc_receive type of coherence request
    524     sc_signal<size_t>       r_cc_receive_icache_way;       // cc_receive to icache way
    525     sc_signal<size_t>       r_cc_receive_icache_set;       // cc_receive to icache set
     524    sc_signal<bool>         r_cc_receive_icache_req;        // cc_receive to icache request
     525    sc_signal<cc_receive_t> r_cc_receive_icache_type;       // cc_receive type of request
     526    sc_signal<size_t>       r_cc_receive_icache_way;        // cc_receive to icache way
     527    sc_signal<size_t>       r_cc_receive_icache_set;        // cc_receive to icache set
    526528    sc_signal<size_t>       r_cc_receive_icache_updt_tab_idx;  // cc_receive update table index
    527     sc_signal<paddr_t>      r_cc_receive_icache_nline;     // cache line physical address
     529    sc_signal<paddr_t>      r_cc_receive_icache_nline;      // cache line physical address
    528530
    529531    // communication between CC_RECEIVE FSM and DCACHE FSM
    530     sc_signal<bool>         r_cc_receive_dcache_req;       // cc_receive to dcache request
    531     sc_signal<cc_receive_t> r_cc_receive_dcache_type;      // cc_receive type of coherence request
    532     sc_signal<size_t>       r_cc_receive_dcache_way;       // cc_receive to dcache way
    533     sc_signal<size_t>       r_cc_receive_dcache_set;       // cc_receive to dcache set
     532    sc_signal<bool>         r_cc_receive_dcache_req;        // cc_receive to dcache request
     533    sc_signal<cc_receive_t> r_cc_receive_dcache_type;       // cc_receive type of request
     534    sc_signal<size_t>       r_cc_receive_dcache_way;        // cc_receive to dcache way
     535    sc_signal<size_t>       r_cc_receive_dcache_set;        // cc_receive to dcache set
    534536    sc_signal<size_t>       r_cc_receive_dcache_updt_tab_idx;  // cc_receive update table index
    535     sc_signal<paddr_t>      r_cc_receive_dcache_nline;     // cache line physical address
     537    sc_signal<paddr_t>      r_cc_receive_dcache_nline;      // cache line physical address
    536538
    537539    //////////////////////////////////////////////////////////////////
     
    675677
    676678    uint32_t m_cpt_stop_simulation;             // used to stop simulation if frozen
     679    bool     m_monitor_ok;                      // used to debug cache output 
     680    uint32_t m_monitor_base;               
     681    uint32_t m_monitor_length;             
    677682
    678683protected:
     
    711716    void print_trace(size_t mode = 0);
    712717    void cache_monitor(paddr_t addr);
    713     inline void iss_set_debug_mask(uint v) {
    714         r_iss.set_debug_mask(v);
     718    void start_monitor(paddr_t,paddr_t);
     719    void stop_monitor();
     720    inline void iss_set_debug_mask(uint v)
     721    {
     722            r_iss.set_debug_mask(v);
    715723    }
    716724
  • branches/v5/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp

    r369 r443  
    3434#define DEBUG_DCACHE            1
    3535#define DEBUG_ICACHE            1
    36 #define DEBUG_CLEANUP           1
     36#define DEBUG_CMD               0
    3737
    3838namespace soclib {
     
    9696        "DCACHE_XTN_DT_INVAL",
    9797
    98         "DCACHE_DIRTY_PTE_GET",
     98        "DCACHE_DIRTY_GET_PTE",
    9999        "DCACHE_DIRTY_WAIT",
    100100
     
    130130    };
    131131
     132const char *vci_pktid_type_str[] = {
     133        "TYPE_READ_DATA_UNC",
     134        "TYPE_READ_DATA_MISS",           
     135        "TYPE_READ_INS_UNC",         
     136        "TYPE_READ_INS_MISS",
     137        "TYPE_WRITE",
     138        "TYPE_CAS",
     139        "TYPE_LL",
     140        "TYPE_SC",
     141    };
     142
     143const char *vci_cmd_type_str[] = {
     144        "NOP or STORE_COND",
     145        "READ",
     146        "WRITE",
     147        "LOCKED_READ"
     148    };
     149
    132150const char *rsp_fsm_state_str[] = {
    133151        "RSP_IDLE",
     
    160178}
    161179
    162 #define tmpl(...)  template<typename vci_param, typename iss_t> __VA_ARGS__ VciCcVCacheWrapper<vci_param, iss_t>
     180#define tmpl(...) \
     181   template<typename vci_param, \
     182            size_t   dspin_in_width, \
     183            size_t   dspin_out_width, \
     184            typename iss_t> __VA_ARGS__ \
     185   VciCcVCacheWrapper<vci_param, dspin_in_width, dspin_out_width, iss_t>
    163186
    164187using namespace soclib::common;
     
    375398      r_dtlb("dtlb", proc_id, dtlb_ways,dtlb_sets,vci_param::N)
    376399{
     400    std::cout << "  - Building VciCcVcacheWrapper : " << name << std::endl;
     401
    377402    assert( ((icache_words*vci_param::B) < (1<<vci_param::K)) and
    378403             "Need more PLEN bits.");
     
    459484              << " | " << rsp_fsm_state_str[r_vci_rsp_fsm.read()]
    460485              << " | " << cc_receive_fsm_state_str[r_cc_receive_fsm.read()]
    461               << " | " << cc_send_fsm_state_str[r_cc_send_fsm.read()];
     486              << " | " << cc_send_fsm_state_str[r_cc_send_fsm.read()]
     487              << " | MMU = " << r_mmu_mode.read();
    462488    if (r_dcache_updt_req.read() ) std::cout << " | P1_UPDT";
    463489    if (r_dcache_wbuf_req.read() ) std::cout << " | P1_WBUF";
     
    494520//////////////////////////////////////////
    495521{
    496     size_t      cache_way;
    497     size_t      cache_set;
    498     size_t      cache_word;
    499     uint32_t    cache_rdata;
    500     bool        cache_hit = r_dcache.read_neutral( addr,
    501                                            &cache_rdata,
    502                                            &cache_way,
    503                                            &cache_set,
    504                                            &cache_word );
    505     bool        icache_hit = r_icache.read_neutral( addr,
    506                                            &cache_rdata,
    507                                            &cache_way,
    508                                            &cache_set,
    509                                            &cache_word );
    510     if ( cache_hit != m_debug_previous_hit )
    511     {
    512         std::cout << "PROC " << name()
    513                   << " dcache change at cycle " << std::dec << m_cpt_total_cycles
    514                   << " for adresse " << std::hex << addr
    515                   << " / HIT = " << std::dec << cache_hit << std::endl;
    516         m_debug_previous_hit = cache_hit;
    517     }
    518     if ( icache_hit != m_idebug_previous_hit )
    519     {
    520         std::cout << "PROC " << name()
    521                   << " icache change at cycle " << std::dec << m_cpt_total_cycles
    522                   << " for adresse " << std::hex << addr
    523                   << " / HIT = " << icache_hit << std::endl;
    524         m_idebug_previous_hit = icache_hit;
     522    bool        cache_hit;
     523    size_t          cache_way = 0;
     524    size_t          cache_set = 0;
     525    size_t          cache_word = 0;
     526    uint32_t    cache_rdata = 0;
     527
     528    cache_hit = r_dcache.read_neutral( addr,
     529                                       &cache_rdata,
     530                                       &cache_way,
     531                                       &cache_set,
     532                                       &cache_word );
     533
     534    if ( cache_hit != m_debug_previous_d_hit )
     535    {
     536        std::cout << "Monitor PROC " << name()
     537                  << " DCACHE at cycle " << std::dec << m_cpt_total_cycles
     538                  << " / HIT = " << cache_hit
     539                  << " / PADDR = " << std::hex << addr
     540                  << " / DATA = " << cache_rdata
     541                  << " / WAY = " << cache_way << std::endl;
     542            m_debug_previous_d_hit = cache_hit;
     543    }
     544
     545    cache_hit = r_icache.read_neutral( addr,
     546                                       &cache_rdata,
     547                                       &cache_way,
     548                                       &cache_set,
     549                                       &cache_word );
     550
     551    if ( cache_hit != m_debug_previous_i_hit )
     552    {
     553        std::cout << "Monitor PROC " << name()
     554                  << " ICACHE at cycle " << std::dec << m_cpt_total_cycles
     555                  << " / HIT = " << cache_hit
     556                  << " / PADDR = " << std::hex << addr
     557                  << " / DATA = " << cache_rdata
     558                  << " / WAY = " << cache_way << std::endl;
     559            m_debug_previous_i_hit = cache_hit;
    525560    }
    526561}
     
    676711/////////////////////////
    677712{
    678     #define LLSCLocalTable GenericLLSCLocalTable<8000, 1, paddr_t, vci_trdid_t, vci_data_t>
    679713    if ( not p_resetn.read() )
    680714    {
     
    693727        r_cc_send_fsm     = CC_SEND_IDLE;
    694728
     729        // reset data physical address extension
     730        r_dcache_paddr_ext = 0;
     731
    695732        // reset dcache directory extension
    696733        for (size_t i=0 ; i< m_dcache_ways*m_dcache_sets ; i++)
     
    705742
    706743        // ICACHE & DCACHE activated
     744        // ITLB & DTLB desactivated
    707745        r_mmu_mode = 0x3;
    708746
     
    757795
    758796        // Debug variables
    759         m_debug_previous_hit       = false;
    760         m_idebug_previous_hit      = false;
    761         m_debug_dcache_fsm             = false;
    762         m_debug_icache_fsm             = false;
     797        m_debug_previous_i_hit     = false;
     798        m_debug_previous_d_hit     = false;
     799        m_debug_activated              = false;
    763800
    764801        // activity counters
     
    869906        // init the llsc reservation buffer
    870907        r_dcache_llsc_valid = false;
     908        m_monitor_ok = false;
    871909
    872910        return;
     
    900938    m_cpt_total_cycles++;
    901939
    902     m_debug_icache_fsm     = (m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok;
    903     m_debug_dcache_fsm     = (m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok;
     940    m_debug_activated = (m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok;
    904941
    905942    /////////////////////////////////////////////////////////////////////
     
    11511188                    // we request a VCI transaction
    11521189                    r_icache_fsm      = ICACHE_MISS_SELECT;
    1153                     r_icache_miss_req = true;
     1190#if DEBUG_ICACHE
     1191if ( m_debug_activated )
     1192std::cout << "  <PROC " << name() << " ICACHE_IDLE> READ MISS in icache"
     1193          << " : PADDR = " << std::hex << paddr << std::endl;
     1194#endif
     1195                   r_icache_miss_req = true;
    11541196                }
    11551197                else if (cache_state == CACHE_SLOT_STATE_ZOMBI )        // pending cleanup
     
    11681210                    m_irsp.instruction = cache_inst;
    11691211                    r_icache_fsm       = ICACHE_IDLE;
     1212#if DEBUG_ICACHE
     1213if ( m_debug_activated )
     1214std::cout << "  <PROC " << name() << " ICACHE_IDLE> READ HIT in icache"
     1215          << " : PADDR = " << std::hex << paddr << std::endl;
     1216#endif
    11701217                }
    11711218            }
     
    11741221                r_icache_unc_req  = true;
    11751222                r_icache_fsm      = ICACHE_UNC_WAIT;
     1223
     1224#if DEBUG_ICACHE
     1225if ( m_debug_activated )
     1226{
     1227    std::cout << "  <PROC " << name()
     1228              << " ICACHE_IDLE> READ UNCACHEABLE in icache"
     1229              << " : PADDR = " << std::hex << paddr << std::endl;
     1230}
     1231#endif
    11761232            }
    11771233        }    // end if m_ireq.valid
     
    12301286                                        // A cleanup request is generated for each valid line
    12311287    {
     1288        // coherence request (from CC_RECEIVE FSM)
     1289        if ( r_cc_receive_icache_req.read() )
     1290        {
     1291            r_icache_fsm = ICACHE_CC_CHECK;
     1292            r_icache_fsm_save = r_icache_fsm.read();
     1293            break;
     1294        }
     1295
    12321296        if ( not r_icache_cc_send_req.read() ) // blocked until previous cc_send request is sent
    12331297        {
    12341298            int       state;
    1235             uint32_t  tag;
     1299            paddr_t   tag;
    12361300            size_t        way = r_icache_flush_count.read()/m_icache_sets;
    12371301            size_t        set = r_icache_flush_count.read()%m_icache_sets;
     
    12491313                // request cleanup
    12501314                r_icache_cc_send_req   = true;
    1251                 r_icache_cc_send_nline = tag * m_icache_sets;
     1315                r_icache_cc_send_nline = tag * m_icache_sets + set;
    12521316                r_icache_cc_send_way   = way;
    12531317                r_icache_cc_send_type  = CC_TYPE_CLEANUP;
     
    14671531
    14681532#if DEBUG_ICACHE
    1469 if ( m_debug_dcache_fsm )
     1533if ( m_debug_activated )
    14701534{
    14711535    std::cout << "  <PROC " << name()
     
    14931557                            CACHE_SLOT_STATE_ZOMBI);
    14941558#if DEBUG_ICACHE
    1495 if ( m_debug_dcache_fsm )
     1559if ( m_debug_activated )
    14961560{
    14971561    std::cout << "  <PROC " << name()
     
    15501614                            r_vci_rsp_fifo_icache.read() );
    15511615#if DEBUG_ICACHE
    1552 if ( m_debug_icache_fsm )
     1616if ( m_debug_activated )
    15531617{
    15541618    std::cout << "  <PROC " << name()
     
    16101674                                        CACHE_SLOT_STATE_ZOMBI );
    16111675#if DEBUG_ICACHE
    1612 if ( m_debug_icache_fsm )
     1676if ( m_debug_activated )
    16131677{
    16141678    std::cout << "  <PROC " << name()
     
    16341698                                    CACHE_SLOT_STATE_VALID );
    16351699#if DEBUG_ICACHE
    1636 if ( m_debug_icache_fsm )
     1700if ( m_debug_activated )
    16371701{
    16381702    std::cout << "  <PROC " << name()
     
    17161780
    17171781#if DEBUG_ICACHE
    1718 if ( m_debug_icache_fsm )
     1782if ( m_debug_activated )
    17191783{
    17201784    std::cout << "  <PROC " << name()
     
    17491813            }
    17501814#if DEBUG_ICACHE
    1751 if ( m_debug_icache_fsm )
     1815if ( m_debug_activated )
    17521816{
    17531817    std::cout << "  <PROC " << name()
     
    17591823        else                                                                                        // no match
    17601824        {
    1761             int         state;
    1762             size_t          way;
    1763             size_t          set;
    1764             size_t          word;
     1825            int         state = 0;
     1826            size_t          way = 0;
     1827            size_t          set = 0;
     1828            size_t          word = 0;
    17651829
    17661830#ifdef INSTRUMENTATION
     
    18181882
    18191883#if DEBUG_ICACHE
    1820 if ( m_debug_icache_fsm )
     1884if ( m_debug_activated )
    18211885{
    18221886    std::cout << "  <PROC " << name()
     
    18621926
    18631927#if DEBUG_ICACHE
    1864 if ( m_debug_icache_fsm )
     1928if ( m_debug_activated )
    18651929{
    18661930    std::cout << "  <PROC " << name()
     
    19251989
    19261990#if DEBUG_ICACHE
    1927 if ( m_debug_icache_fsm )
     1991if ( m_debug_activated )
    19281992{
    19291993    std::cout << "  <PROC " << name()
     
    20852149        size_t          tlb_way;
    20862150        size_t          tlb_set;
    2087         paddr_t         tlb_nline;
     2151        paddr_t         tlb_nline = 0;
    20882152        size_t          cache_way;
    20892153        size_t          cache_set;
     
    21152179            else                                    // identity mapping
    21162180            {
    2117                 paddr       = (paddr_t)m_dreq.addr;
     2181                paddr = (paddr_t)m_dreq.addr;
     2182                // we take into account the paddr extension
     2183                if (vci_param::N > 32)
     2184                    paddr = paddr | ((paddr_t)(r_dcache_paddr_ext.read()) << 32);
    21182185            }
    21192186        } // end physical address computation
     
    21892256
    21902257#if DEBUG_DCACHE
    2191 if ( m_debug_dcache_fsm )
    2192 {
    2193     std::cout << "  <PROC " << name()
    2194               << " DCACHE_IDLE> Cache update in P1 stage" << std::dec
    2195               << " / WAY = " << r_dcache_save_cache_way.read()
    2196               << " / SET = " << r_dcache_save_cache_set.read()
    2197               << " / WORD = " << r_dcache_save_cache_word.read() << std::hex
    2198               << " / DATA = " << r_dcache_save_wdata.read()
    2199               << " / BE = " << r_dcache_save_be.read() << std::endl;
    2200 }
     2258if ( m_debug_activated )
     2259std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
     2260          << " Cache update in P1 stage" << std::dec
     2261          << " / WAY = " << r_dcache_save_cache_way.read()
     2262          << " / SET = " << r_dcache_save_cache_set.read()
     2263          << " / WORD = " << r_dcache_save_cache_word.read() << std::hex
     2264          << " / WDATA = " << r_dcache_save_wdata.read()
     2265          << " / BE = " << r_dcache_save_be.read() << std::endl;
    22012266#endif
    22022267        } // end test TLB inval
     
    23412406                    case iss_t::XTN_MMU_WORD_HI:
    23422407                        m_drsp.rdata = r_mmu_word_hi.read();
     2408                        m_drsp.valid = true;
     2409                        m_drsp.error = false;
     2410                        break;
     2411
     2412                    case iss_t::XTN_DATA_PADDR_EXT:
     2413                        m_drsp.rdata = r_dcache_paddr_ext.read();
    23432414                        m_drsp.valid = true;
    23442415                        m_drsp.error = false;
     
    24652536                        m_drsp.valid     = true;
    24662537                        r_dcache_fsm     = DCACHE_IDLE;
     2538                    break;
     2539
     2540                    case iss_t::XTN_DATA_PADDR_EXT:     // no cache or tlb access
     2541                        r_dcache_paddr_ext = m_dreq.wdata;
     2542                        m_drsp.valid       = true;
     2543                        r_dcache_fsm       = DCACHE_IDLE;
    24672544                    break;
    24682545
     
    25302607                            m_drsp.rdata = 0;
    25312608#if DEBUG_DCACHE
    2532 if ( m_debug_dcache_fsm )
    2533 {
    2534     std::cout << "  <PROC " << name()
    2535               << ".DCACHE_IDLE> HIT in dtlb, but privilege violation" << std::endl;
    2536 }
     2609if ( m_debug_activated )
     2610std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
     2611          << " HIT in dtlb, but privilege violation" << std::endl;
    25372612#endif
    25382613                        }
     
    25482623                            m_drsp.rdata = 0;
    25492624#if DEBUG_DCACHE
    2550 if ( m_debug_dcache_fsm )
    2551 {
    2552     std::cout << "  <PROC " << name()
    2553               << ".DCACHE_IDLE> HIT in dtlb, but writable violation" << std::endl;
    2554 }
     2625if ( m_debug_activated )
     2626std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
     2627          << " HIT in dtlb, but writable violation" << std::endl;
    25552628#endif
    25562629                        }
     
    25692642                }    // end DTLB activated
    25702643
    2571                 if ( valid_req )        // processor request is valid after TLB check
     2644                if ( valid_req )        // processor request is valid (after MMU check)
    25722645                {
    25732646                    r_dcache_save_cacheable  = cacheable;
     
    25932666                                r_dcache_fsm          = DCACHE_MISS_SELECT;
    25942667#if DEBUG_DCACHE
    2595 if ( m_debug_dcache_fsm )
    2596 {
    2597     std::cout << "  <PROC " << name()
    2598               << ".DCACHE_IDLE> READ MISS in dcache" << std::endl;
    2599 }
     2668if ( m_debug_activated )
     2669std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
     2670          << " READ MISS in dcache"
     2671          << " / PADDR = " << std::hex << paddr << std::endl;
    26002672#endif
    26012673                            }
     
    26042676                                // stalled until cleanup is acknowledged
    26052677                                r_dcache_fsm   = DCACHE_IDLE;
     2678#if DEBUG_DCACHE
     2679if ( m_debug_activated )
     2680std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
     2681          << " Pending cleanup, stalled until cleanup acknowledge"
     2682          << " / PADDR = " << std::hex << paddr << std::endl;
     2683#endif
    26062684                            }
    26072685                            else                                      // cache hit
     
    26152693                                m_drsp.rdata   = cache_rdata;
    26162694#if DEBUG_DCACHE
    2617 if ( m_debug_dcache_fsm )
    2618 {
    2619     std::cout << "  <PROC " << name()
    2620               << ".DCACHE_IDLE> READ HIT in dcache" << std::endl;
    2621 }
     2695if ( m_debug_activated )
     2696std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
     2697          << " READ HIT in dcache"
     2698          << " / PADDR = " << std::hex << paddr << std::endl;
    26222699#endif
    26232700                            }
     
    26302707                            r_dcache_fsm          = DCACHE_UNC_WAIT;
    26312708#if DEBUG_DCACHE
    2632 if ( m_debug_dcache_fsm )
    2633 {
    2634     std::cout << "  <PROC " << name()
    2635               << ".DCACHE_IDLE> READ UNCACHEABLE in dcache" << std::endl;
    2636 }
     2709if ( m_debug_activated )
     2710std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
     2711          << " READ UNCACHEABLE in dcache"
     2712          << " / PADDR = " << std::hex << paddr << std::endl;
    26372713#endif
    26382714                        }
     
    28042880        if ( not bypass )     // Try to read PTE1/PTD1 in dcache
    28052881        {
    2806             pte_paddr = (paddr_t)r_mmu_ptpr.read() << (INDEX1_NBITS+2) |
    2807                         (paddr_t)((r_dcache_tlb_vaddr.read() >> PAGE_M_NBITS) << 2);
     2882            pte_paddr = (((paddr_t)r_mmu_ptpr.read()) << (INDEX1_NBITS+2)) |
     2883                        ((((paddr_t)r_dcache_tlb_vaddr.read()) >> PAGE_M_NBITS) << 2);
    28082884            r_dcache_tlb_paddr = pte_paddr;
    28092885            r_dcache_fsm       = DCACHE_TLB_PTE1_GET;
     
    28182894
    28192895#if DEBUG_DCACHE
    2820 if ( m_debug_dcache_fsm )
     2896if ( m_debug_activated )
    28212897{
    28222898    if ( r_dcache_tlb_ins.read() )
    2823     {
    2824         std::cout << "  <PROC " << name() << ".DCACHE_TLB_MISS> ITLB miss";
    2825     }
     2899        std::cout << "  <PROC " << name() << " DCACHE_TLB_MISS> ITLB miss";
    28262900    else
    2827     {
    2828         std::cout << "  <PROC " << name() << ".DCACHE_TLB_MISS> DTLB miss";
    2829     }
     2901        std::cout << "  <PROC " << name() << " DCACHE_TLB_MISS> DTLB miss";
    28302902    std::cout << " / VADDR = " << std::hex << r_dcache_tlb_vaddr.read()
     2903              << " / ptpr  = " << (((paddr_t)r_mmu_ptpr.read()) << (INDEX1_NBITS+2))
    28312904              << " / BYPASS = " << bypass
    28322905              << " / PTE_ADR = " << pte_paddr << std::endl;
     
    28832956
    28842957#if DEBUG_DCACHE
    2885 if ( m_debug_dcache_fsm )
     2958if ( m_debug_activated )
    28862959{
    2887     std::cout << "  <PROC " << name() << ".DCACHE_TLB_PTE1_GET> HIT in dcache, but unmapped"
     2960    std::cout << "  <PROC " << name()
     2961              << " DCACHE_TLB_PTE1_GET> HIT in dcache, but unmapped"
    28882962              << std::hex << " / paddr = " << r_dcache_tlb_paddr.read()
    28892963              << std::dec << " / way = " << way
     
    29192993
    29202994#if DEBUG_DCACHE
    2921 if ( m_debug_dcache_fsm )
     2995if ( m_debug_activated )
    29222996{
    2923     std::cout << "  <PROC " << name() << ".DCACHE_TLB_PTE1_GET> HIT in dcache"
     2997    std::cout << "  <PROC " << name()
     2998              << " DCACHE_TLB_PTE1_GET> HIT in dcache"
    29242999              << std::hex << " / paddr = " << r_dcache_tlb_paddr.read()
    29253000              << std::dec << " / way = " << way
     
    29403015
    29413016#if DEBUG_DCACHE
    2942 if ( m_debug_dcache_fsm )
     3017if ( m_debug_activated )
    29433018{
    2944     std::cout << "  <PROC " << name() << ".DCACHE_TLB_PTE1_GET> HIT in dcache"
     3019    std::cout << "  <PROC " << name()
     3020              << " DCACHE_TLB_PTE1_GET> HIT in dcache"
    29453021              << std::hex << " / paddr = " << r_dcache_tlb_paddr.read()
    29463022              << std::dec << " / way = " << way
     
    29663042
    29673043#if DEBUG_DCACHE
    2968 if ( m_debug_dcache_fsm )
     3044if ( m_debug_activated )
    29693045{
    2970     std::cout << "  <PROC " << name() << ".DCACHE_TLB_PTE1_GET> MISS in dcache:"
     3046    std::cout << "  <PROC " << name()
     3047              << " DCACHE_TLB_PTE1_GET> MISS in dcache:"
    29713048              << " PTE1 address = " << std::hex << r_dcache_tlb_paddr.read() << std::endl;
    29723049}
     
    30063083
    30073084#if DEBUG_DCACHE
    3008 if ( m_debug_dcache_fsm )
     3085if ( m_debug_activated )
    30093086{
    30103087    if ( r_dcache_tlb_ins.read() )
    3011         std::cout << "  <PROC " << name() << ".DCACHE_TLB_PTE1_SELECT> Select a slot in ITLB:";
     3088        std::cout << "  <PROC " << name()
     3089                  << " DCACHE_TLB_PTE1_SELECT> Select a slot in ITLB:";
    30123090    else
    3013         std::cout << "  <PROC " << name() << ".DCACHE_TLB_PTE1_SELECT> Select a slot in DTLB:";
     3091        std::cout << "  <PROC " << name()
     3092                  << ".DCACHE_TLB_PTE1_SELECT> Select a slot in DTLB:";
    30143093        std::cout << " way = " << std::dec << way
    30153094                  << " / set = " << set << std::endl;
     
    30763155
    30773156#if DEBUG_DCACHE
    3078 if ( m_debug_dcache_fsm )
     3157if ( m_debug_activated )
    30793158{
    3080     std::cout << "  <PROC " << name() << ".DCACHE_TLB_PTE1_UPDT> write PTE1 in ITLB";
    3081     std::cout << " / set = " << std::dec << r_dcache_tlb_set.read()
     3159    std::cout << "  <PROC " << name()
     3160              << " DCACHE_TLB_PTE1_UPDT> write PTE1 in ITLB"
     3161              << " / set = " << std::dec << r_dcache_tlb_set.read()
    30823162              << " / way = " << r_dcache_tlb_way.read() << std::endl;
    30833163    r_itlb.printTrace();
     
    30993179
    31003180#if DEBUG_DCACHE
    3101 if ( m_debug_dcache_fsm )
     3181if ( m_debug_activated )
    31023182{
    3103     std::cout << "  <PROC " << name() << ".DCACHE_TLB_PTE1_UPDT> write PTE1 in DTLB";
    3104     std::cout << " / set = " << std::dec << r_dcache_tlb_set.read()
     3183    std::cout << "  <PROC " << name()
     3184              << " DCACHE_TLB_PTE1_UPDT> write PTE1 in DTLB"
     3185              << " / set = " << std::dec << r_dcache_tlb_set.read()
    31053186              << " / way = " << r_dcache_tlb_way.read() << std::endl;
    31063187    r_dtlb.printTrace();
     
    31153196
    31163197#if DEBUG_DCACHE
    3117 if ( m_debug_dcache_fsm )
     3198if ( m_debug_activated )
    31183199{
    3119     std::cout << "  <PROC " << name() << ".DCACHE_TLB_PTE1_UPDT> L/R bit update required"
     3200    std::cout << "  <PROC " << name()
     3201              << " DCACHE_TLB_PTE1_UPDT> L/R bit update required"
    31203202              << std::endl;
    31213203}
     
    31743256
    31753257#if DEBUG_DCACHE
    3176 if ( m_debug_dcache_fsm )
     3258if ( m_debug_activated )
    31773259{
    31783260    std::cout << "  <PROC " << name()
    3179               << " DCACHE_TLB_PTE2_GET> HIT in dcache, but PTE is unmapped"
     3261              << " DCACHE_TLB_PTE2_GET> HIT in dcache, but PTE unmapped"
    31803262              << " PTE_FLAGS = " << std::hex << pte_flags
    31813263              << " PTE_PPN = " << std::hex << pte_ppn << std::endl;
     
    31943276
    31953277#if DEBUG_DCACHE
    3196 if ( m_debug_dcache_fsm )
     3278if ( m_debug_activated )
    31973279{
    3198     std::cout << "  <PROC " << name() << ".DCACHE_TLB_PTE2_GET> HIT in dcache:"
     3280    std::cout << "  <PROC " << name()
     3281              << " DCACHE_TLB_PTE2_GET> HIT in dcache:"
    31993282              << " PTE_FLAGS = " << std::hex << pte_flags
    32003283              << " PTE_PPN = " << std::hex << pte_ppn << std::endl;
     
    32073290            // stalled until cleanup is acknowledged
    32083291            r_dcache_fsm   = DCACHE_TLB_PTE2_GET;
     3292
     3293#if DEBUG_DCACHE
     3294if ( m_debug_activated )
     3295{
     3296    std::cout << "  <PROC " << name()
     3297              << " DCACHE_TLB_PTE2_GET> ZOMBI in dcache: waiting cleanup ack"
     3298              << std::endl;
     3299}
     3300#endif
    32093301        }
    32103302        else            // we must load the missing cache line in dcache
     
    32173309
    32183310#if DEBUG_DCACHE
    3219 if ( m_debug_dcache_fsm )
     3311if ( m_debug_activated )
    32203312{
    32213313    std::cout << "  <PROC " << name()
     
    32553347
    32563348#if DEBUG_DCACHE
    3257 if ( m_debug_dcache_fsm )
     3349if ( m_debug_activated )
    32583350{
    32593351    if ( r_dcache_tlb_ins.read() )
     
    33313423
    33323424#if DEBUG_DCACHE
    3333 if ( m_debug_dcache_fsm )
     3425if ( m_debug_activated )
    33343426{
    33353427    std::cout << "  <PROC " << name()
     
    33553447
    33563448#if DEBUG_DCACHE
    3357 if ( m_debug_dcache_fsm )
     3449if ( m_debug_activated )
    33583450{
    33593451    std::cout << "  <PROC " << name()
     
    33733465
    33743466#if DEBUG_DCACHE
    3375 if ( m_debug_dcache_fsm )
     3467if ( m_debug_activated )
    33763468{
    33773469    std::cout << "  <PROC " << name()
     
    33863478    {
    33873479#if DEBUG_DCACHE
    3388 if ( m_debug_dcache_fsm )
     3480if ( m_debug_activated )
    33893481{
    33903482    std::cout << "  <PROC " << name()
     
    34313523        {
    34323524#if DEBUG_DCACHE
    3433 if ( m_debug_dcache_fsm )
     3525if ( m_debug_activated )
    34343526{
    34353527    std::cout << "  <PROC " << name()
     
    34463538    {
    34473539#if DEBUG_DCACHE
    3448 if ( m_debug_dcache_fsm )
     3540if ( m_debug_activated )
    34493541{
    34503542    std::cout << "  <PROC " << name()
     
    35413633                                // returns to IDLE and flush TLBs when last slot
    35423634    {
     3635        // coherence request (from CC_RECEIVE FSM)
     3636        if ( r_cc_receive_dcache_req.read() )
     3637        {
     3638            r_dcache_fsm = DCACHE_CC_CHECK;
     3639            r_dcache_fsm_cc_save = r_dcache_fsm.read();
     3640            break;
     3641        }
     3642
    35433643        if ( not r_dcache_cc_send_req.read() ) // blocked until previous cc_send request is sent
    35443644        {
    35453645            int       state;
    3546             uint32_t  tag;
     3646            paddr_t   tag;
    35473647            size_t    way = r_dcache_flush_count.read()/m_dcache_sets;
    35483648            size_t    set = r_dcache_flush_count.read()%m_dcache_sets;
     
    35603660                // request cleanup
    35613661                r_dcache_cc_send_req   = true;
    3562                 r_dcache_cc_send_nline = tag * m_dcache_sets;
     3662                r_dcache_cc_send_nline = tag * m_dcache_sets + set;
    35633663                r_dcache_cc_send_way   = way;
    35643664                r_dcache_cc_send_type  = CC_TYPE_CLEANUP;
     
    36643764
    36653765#if DEBUG_DCACHE
    3666 if ( m_debug_dcache_fsm )
     3766if ( m_debug_activated )
    36673767{
    36683768    std::cout << "  <PROC " << name()
     
    37073807
    37083808#if DEBUG_DCACHE
    3709 if ( m_debug_dcache_fsm )
     3809if ( m_debug_activated )
    37103810{
    37113811    std::cout << "  <PROC " << name()
     
    37673867
    37683868#if DEBUG_DCACHE
    3769 if ( m_debug_dcache_fsm )
     3869if ( m_debug_activated )
    37703870{
    37713871    std::cout << "  <PROC " << name()
     
    38043904        if ( not r_dcache_cc_send_req.read() ) // blocked until previous cc_send request is sent
    38053905        {
    3806             bool     found;
    3807             bool     cleanup;
    3808             size_t   way;
    3809             size_t   set;
    3810             paddr_t  victim;
     3906            bool     found = false;
     3907            bool     cleanup = false;
     3908            size_t   way = 0;
     3909            size_t   set = 0;
     3910            paddr_t  victim = 0;
    38113911
    38123912#ifdef INSTRUMENTATION
     
    38413941
    38423942#if DEBUG_DCACHE
    3843 if ( m_debug_dcache_fsm )
     3943if ( m_debug_activated )
    38443944{
    38453945    std::cout << "  <PROC " << name()
     
    38483948              << " / SET = "   << set
    38493949              << " / PADDR = " << std::hex << r_dcache_save_paddr.read();
    3850     if(cleanup) std::cout << " / VICTIM = " << std::hex << victim << std::endl;
     3950    if(cleanup) std::cout << " / VICTIM = " << (victim*m_dcache_words*4) << std::endl;
    38513951    else        std::cout << std::endl;
    38523952}
     
    38643964        size_t  way   = r_dcache_miss_way.read();
    38653965        size_t  set   = r_dcache_miss_set.read();
    3866         paddr_t nline = r_dcache_save_paddr.read() / (m_dcache_words<<2);
    38673966
    38683967#ifdef INSTRUMENTATION
     
    38733972                            CACHE_SLOT_STATE_ZOMBI );
    38743973#if DEBUG_DCACHE
    3875 if ( m_debug_dcache_fsm )
     3974if ( m_debug_activated )
    38763975{
    38773976    std::cout << "  <PROC " << name()
     
    38863985        {
    38873986            r_dcache_in_tlb[way*m_dcache_sets+set] = false;
    3888             r_dcache_tlb_inval_line  = nline;
     3987            r_dcache_tlb_inval_line  = r_dcache_cc_send_nline;
    38893988            r_dcache_tlb_inval_set   = 0;
    38903989            r_dcache_fsm_scan_save   = DCACHE_MISS_WAIT;
     
    39954094                                r_vci_rsp_fifo_dcache.read() );
    39964095#if DEBUG_DCACHE
    3997 if ( m_debug_dcache_fsm )
     4096if ( m_debug_activated )
    39984097{
    39994098    std::cout << "  <PROC " << name()
    40004099              << " DCACHE_MISS_DATA_UPDT> Write one word:"
    4001               << " / DATA = "  << r_vci_rsp_fifo_dcache.read()
     4100              << " / DATA = "  << std::hex << r_vci_rsp_fifo_dcache.read()
    40024101              << " / WAY = "   << std::dec << r_dcache_miss_way.read()
    40034102              << " / SET = "   << r_dcache_miss_set.read()
     
    40384137            if ( r_dcache_miss_inval.read() ) // switch slot to ZOMBI state, and new cleanup
    40394138            {
    4040                 if ( not r_dcache_cc_send_req.read() ) // blocked until previous cc_send request is sent
     4139                if ( not r_dcache_cc_send_req.read() ) // blocked until previous request sent
    40414140                {
    40424141                    r_dcache_miss_inval     = false;
     
    40554154                                        CACHE_SLOT_STATE_ZOMBI );
    40564155#if DEBUG_DCACHE
    4057 if ( m_debug_dcache_fsm )
    4058 {
    4059     std::cout << "  <PROC " << name()
    4060               << " DCACHE_MISS_DIR_UPDT> Switch slot to ZOMBI state"
    4061               << " PADDR = " << std::hex << r_dcache_save_paddr.read()
    4062               << " / WAY = "   << std::dec << r_dcache_miss_way.read()
    4063               << " / SET = "   << r_dcache_miss_set.read() << std::endl;
    4064 }
     4156if ( m_debug_activated )
     4157std::cout << "  <PROC " << name()
     4158          << " DCACHE_MISS_DIR_UPDT> Switch slot to ZOMBI state"
     4159          << " PADDR = " << std::hex << r_dcache_save_paddr.read()
     4160          << " / WAY = "   << std::dec << r_dcache_miss_way.read()
     4161          << " / SET = "   << r_dcache_miss_set.read() << std::endl;
    40654162#endif
    40664163                }
     
    40804177
    40814178#if DEBUG_DCACHE
    4082 if ( m_debug_dcache_fsm )
    4083 {
    4084     std::cout << "  <PROC " << name()
    4085               << " DCACHE_MISS_DIR_UPDT> Switch slot to VALID state"
    4086               << " PADDR = " << std::hex << r_dcache_save_paddr.read()
    4087               << " / WAY = "   << std::dec << r_dcache_miss_way.read()
    4088               << " / SET = "   << r_dcache_miss_set.read() << std::endl;
    4089 
    4090     r_dcache.printTrace();
    4091 
    4092 
    4093 }
     4179if ( m_debug_activated )
     4180std::cout << "  <PROC " << name()
     4181          << " DCACHE_MISS_DIR_UPDT> Switch slot to VALID state"
     4182          << " PADDR = " << std::hex << r_dcache_save_paddr.read()
     4183          << " / WAY = "   << std::dec << r_dcache_miss_way.read()
     4184          << " / SET = "   << r_dcache_miss_set.read() << std::endl;
    40944185#endif
    40954186                // reset directory extension
     
    42634354
    42644355#if DEBUG_DCACHE
    4265 if ( m_debug_dcache_fsm )
     4356if ( m_debug_activated )
    42664357{
    42674358    std::cout << "  <PROC " << name()
     
    43034394
    43044395#if DEBUG_DCACHE
    4305 if ( m_debug_dcache_fsm )
     4396if ( m_debug_activated )
    43064397{
    43074398    std::cout << "  <PROC " << name()
     
    43254416
    43264417#if DEBUG_DCACHE
    4327 if ( m_debug_dcache_fsm )
     4418if ( m_debug_activated )
    43284419{
    43294420    std::cout << "  <PROC " << name()
     
    43314422              << " r_dcache_vci_paddr = " << r_dcache_vci_paddr.read()
    43324423              << " mask = " << mask
    4333               << " (r_dcache_fsm_cc_save == DCACHE_MISS_WAIT) = " << (r_dcache_fsm_cc_save == DCACHE_MISS_WAIT)
    4334               << " (r_dcache_fsm_cc_save == DCACHE_MISS_DIR_UPDT) = " << (r_dcache_fsm_cc_save == DCACHE_MISS_DIR_UPDT)
    4335               << " ((r_dcache_vci_paddr.read() & mask) == (paddr & mask)) = " << ((r_dcache_vci_paddr.read() & mask) == (paddr & mask))
     4424              << " (r_dcache_fsm_cc_save == DCACHE_MISS_WAIT) = "
     4425              << (r_dcache_fsm_cc_save == DCACHE_MISS_WAIT)
     4426              << " (r_dcache_fsm_cc_save == DCACHE_MISS_DIR_UPDT) = "
     4427              << (r_dcache_fsm_cc_save == DCACHE_MISS_DIR_UPDT)
     4428              << " ((r_dcache_vci_paddr.read() & mask) == (paddr & mask)) = "
     4429              << ((r_dcache_vci_paddr.read() & mask) == (paddr & mask))
    43364430              <<std::endl;
    43374431}
     
    43614455            r_cc_receive_dcache_req = false;
    43624456#if DEBUG_DCACHE
    4363 if ( m_debug_dcache_fsm )
     4457if ( m_debug_activated )
    43644458{
    43654459    std::cout << "  <PROC " << name()
     
    43954489
    43964490#if DEBUG_DCACHE
    4397 if ( m_debug_dcache_fsm )
     4491if ( m_debug_activated )
    43984492{
    43994493    std::cout << "  <PROC " << name()
     
    44064500        else                                                    // no match
    44074501            {
    4408             int        state;
    4409             size_t         way;
    4410             size_t         set;
    4411             size_t         word;
     4502            int        state = 0;
     4503            size_t         way = 0;
     4504            size_t         set = 0;
     4505            size_t         word = 0;
    44124506
    44134507#ifdef INSTRUMENTATION
     
    44594553
    44604554#if DEBUG_DCACHE
    4461 if ( m_debug_dcache_fsm )
     4555if ( m_debug_activated )
    44624556{
    44634557    std::cout << "  <PROC " << name()
     
    44984592
    44994593#if DEBUG_DCACHE
    4500 if ( m_debug_dcache_fsm )
     4594if ( m_debug_activated )
    45014595{
    45024596    std::cout << "  <PROC " << name()
     
    45144608
    45154609#if DEBUG_DCACHE
    4516 if ( m_debug_dcache_fsm )
     4610if ( m_debug_activated )
    45174611{
    45184612    std::cout << "  <PROC " << name()
     
    45704664
    45714665#if DEBUG_DCACHE
    4572 if ( m_debug_dcache_fsm )
     4666if ( m_debug_activated )
    45734667{
    45744668    std::cout << "  <PROC " << name()
     
    45904684
    45914685#if DEBUG_DCACHE
    4592 if ( m_debug_dcache_fsm )
     4686if ( m_debug_activated )
    45934687{
    45944688    std::cout << "  <PROC " << name()
     
    46084702
    46094703                // wait to send a request to cc_send_fsm
    4610                 if(not r_icache_cc_send_req.read())
     4704                if(not r_dcache_cc_send_req.read())
    46114705                // cc_send is available
    46124706                {
     
    46634757
    46644758#if DEBUG_DCACHE
    4665 if ( m_debug_dcache_fsm )
     4759if ( m_debug_activated )
    46664760{
    46674761    std::cout << "  <PROC " << name()
     
    46804774                r_dcache_cc_need_write = false;
    46814775#if DEBUG_DCACHE
    4682 if ( m_debug_dcache_fsm )
     4776if ( m_debug_activated )
    46834777{
    46844778    std::cout << "  <PROC " << name()
     
    47344828
    47354829#if DEBUG_DCACHE
    4736 if ( m_debug_dcache_fsm and ok )
     4830if ( m_debug_activated and ok )
    47374831{
    47384832    std::cout << "  <PROC " << name()
     
    47504844
    47514845#if DEBUG_DCACHE
    4752 if ( m_debug_dcache_fsm and ok )
    4753 {
    4754     std::cout << "  <PROC " << name()
    4755               << ".DCACHE_INVAL_TLB_SCAN> Invalidate DTLB entry:" << std::hex
    4756               << " line = " << line << std::dec
    4757               << " / set = " << set
    4758               << " / way = " << way << std::endl;
    4759 }
     4846if ( m_debug_activated and ok )
     4847std::cout << "  <PROC " << name() << " DCACHE_INVAL_TLB_SCAN>"
     4848          << " Invalidate DTLB entry" << std::hex
     4849          << " / line = " << line << std::dec
     4850          << " / set = " << set
     4851          << " / way = " << way << std::endl;
    47604852#endif
    47614853        }
     
    48474939    ////////////////////////////////////////////////////////////////////////////////////
    48484940
     4941
    48494942    switch ( r_vci_cmd_fsm.read() )
    48504943    {
     
    48524945        case CMD_IDLE:
    48534946        {
    4854             // DDACHE read requests (r_dcache_vci_miss_req or r_dcache_vci_ll_req), and
     4947            // DCACHE read requests (r_dcache_vci_miss_req or r_dcache_vci_ll_req), and
    48554948            // ICACHE read requests (r_icache_miss_req) require both a write_buffer access
    48564949            // to check a possible pending write on the same cache line.
     
    48774970                     or r_vci_cmd_imiss_prio.read() );
    48784971
    4879 
    48804972            // 1 - Data Read Miss
    48814973            if ( dcache_miss_req and r_wbuf.miss(r_dcache_vci_paddr.read()) )
     
    49115003            else if ( r_icache_unc_req.read() )
    49125004            {
    4913                 r_vci_cmd_fsm    = CMD_INS_UNC;
    4914                 r_icache_unc_req = false;
     5005                r_vci_cmd_fsm       = CMD_INS_UNC;
     5006                r_icache_unc_req    = false;
    49155007//                m_cpt_iunc_transaction++;
    49165008            }
     
    49415033//              m_cpt_cas_transaction++;
    49425034            }
     5035
     5036#if DEBUG_CMD
     5037if ( m_debug_activated )
     5038{
     5039std::cout << "  <PROC " << name() << " CMD_IDLE>"
     5040          << " / dmiss_req = " << dcache_miss_req
     5041          << " / imiss_req = " << icache_miss_req
     5042          << std::endl;
     5043}
     5044#endif
    49435045            break;
    49445046        }
     
    49775079        {
    49785080            // all read VCI commands contain one single flit
    4979             if ( p_vci.cmdack.read() )  r_vci_cmd_fsm = CMD_IDLE;
     5081            if ( p_vci.cmdack.read() ) {
     5082                r_vci_cmd_fsm = CMD_IDLE;
     5083            }
    49805084            break;
    49815085        }
     
    51725276            break;
    51735277        }
    5174         ////////////////////
     5278        /////////////////
    51755279        case RSP_DATA_LL:
    51765280        {
     
    51815285                    r_vci_rsp_data_error = true;
    51825286                    r_vci_rsp_fsm = RSP_IDLE;
     5287                    break;
    51835288                }
    51845289                if (r_vci_rsp_cpt.read() == 0) //first flit
     
    52435348            // we first check for the last client and listen for //
    52445349            // a request of the other, then update the client    //
     5350            // r_cc_send_last_client : 0 dcache / 1 icache
    52455351            ///////////////////////////////////////////////////////
    5246             // r_cc_send_last_client : 0 dcache / 1 icache
    52475352            bool update_last_client = r_cc_send_last_client.read();
    52485353            if ( r_cc_send_last_client.read() == 0 ) // last client was dcache
     
    52615366            if (r_dcache_cc_send_req.read() or r_icache_cc_send_req.read())
    52625367            {
    5263                 // test if the new client is dcache and has a cleanup request
    5264                 if ( (update_last_client == 0) and (r_dcache_cc_send_type.read() == CC_TYPE_CLEANUP))
     5368                // the new client is dcache and has a cleanup request
     5369                if      ( (update_last_client == 0) and
     5370                          (r_dcache_cc_send_type.read() == CC_TYPE_CLEANUP))
    52655371                    r_cc_send_fsm = CC_SEND_CLEANUP_1;
    5266                 // test if the new client is dcache and has a multi acknowledgement request
    5267                 else if ( (update_last_client == 0) and (r_dcache_cc_send_type.read() == CC_TYPE_MULTI_ACK))
     5372                // the new client is dcache and has a multi acknowledgement request
     5373                else if ( (update_last_client == 0) and
     5374                          (r_dcache_cc_send_type.read() == CC_TYPE_MULTI_ACK))
    52685375                    r_cc_send_fsm = CC_SEND_MULTI_ACK;
    5269                 // test if the new client is icache and has a cleanup request
    5270                 else if ( (update_last_client == 1) and (r_icache_cc_send_type.read() == CC_TYPE_CLEANUP))
     5376                // the new client is icache and has a cleanup request
     5377                else if ( (update_last_client == 1) and
     5378                          (r_icache_cc_send_type.read() == CC_TYPE_CLEANUP))
    52715379                    r_cc_send_fsm = CC_SEND_CLEANUP_1;
    5272                 // test if the new client is icache and has a multi acknowledgement request
    5273                 else if ( (update_last_client == 1) and (r_icache_cc_send_type.read() == CC_TYPE_MULTI_ACK))
     5380                // the new client is icache and has a multi acknowledgement request
     5381                else if ( (update_last_client == 1) and
     5382                        (r_icache_cc_send_type.read() == CC_TYPE_MULTI_ACK))
    52745383                    r_cc_send_fsm = CC_SEND_MULTI_ACK;
    52755384            }
     
    53215430    //   C_RECEIVE  FSM
    53225431    // This FSM receive all coherence packets on a DSPIN40 port.
    5323     // There is 4 packet types:
     5432    // There is 7 packet types:
    53245433    // - CC_DATA_INVAL : DCACHE invalidate request
    53255434    // - CC_DATA_UPDT  : DCACHE update request (multi-words)
     
    53415450                uint64_t receive_data = p_dspin_in.data.read();
    53425451                // initialize coherence packet type
    5343                 uint64_t receive_type = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::FROM_MC_TYPE);
     5452                uint64_t receive_type = DspinDhccpParam::dspin_get(receive_data,
     5453                                            DspinDhccpParam::FROM_MC_TYPE);
    53445454                // initialize data/ins flip_flop (0 data / 1 ins)
    53455455                r_cc_receive_data_ins = (bool)(receive_type & 0x1);
     
    53765486
    53775487            // for data CLACK, wait for dcache to take the request
    5378             if ((r_cc_receive_data_ins.read() == 0) and not (r_cc_receive_dcache_req.read()))
     5488            if ((r_cc_receive_data_ins.read() == 0) and
     5489                   not (r_cc_receive_dcache_req.read()))
    53795490            {
    53805491                // request dcache to handle the CLACK
    53815492                r_cc_receive_dcache_req  = true;
    5382                 r_cc_receive_dcache_set  = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::CLEANUP_ACK_SET) & ((1ULL<<(uint32_log2(m_dcache_sets)))-1);
    5383                 r_cc_receive_dcache_way  = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::CLEANUP_ACK_WAY) & ((1ULL<<(uint32_log2(m_dcache_ways)))-1);
     5493                r_cc_receive_dcache_set  = DspinDhccpParam::dspin_get(receive_data,
     5494                                           DspinDhccpParam::CLEANUP_ACK_SET) &
     5495                                           ((1ULL<<(uint32_log2(m_dcache_sets)))-1);
     5496                r_cc_receive_dcache_way  = DspinDhccpParam::dspin_get(receive_data,
     5497                                           DspinDhccpParam::CLEANUP_ACK_WAY) &
     5498                                           ((1ULL<<(uint32_log2(m_dcache_ways)))-1);
    53845499                r_cc_receive_dcache_type = CC_TYPE_CLACK;
    53855500                // get back to idle state
     
    53885503            }
    53895504            // for ins CLACK, wait for icache to take the request
    5390             if ((r_cc_receive_data_ins.read() == 1) and not (r_cc_receive_icache_req.read()))
     5505            if ((r_cc_receive_data_ins.read() == 1) and
     5506                   not (r_cc_receive_icache_req.read()))
    53915507            {
    53925508                // request icache to handle the CLACK
    53935509                r_cc_receive_icache_req  = true;
    5394                 r_cc_receive_icache_set  = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::CLEANUP_ACK_SET) & ((1ULL<<(uint32_log2(m_icache_sets)))-1);
    5395                 r_cc_receive_icache_way  = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::CLEANUP_ACK_WAY) & ((1ULL<<(uint32_log2(m_icache_ways)))-1);
     5510                r_cc_receive_icache_set  = DspinDhccpParam::dspin_get(receive_data,
     5511                                           DspinDhccpParam::CLEANUP_ACK_SET) &
     5512                                           ((1ULL<<(uint32_log2(m_icache_sets)))-1);
     5513                r_cc_receive_icache_way  = DspinDhccpParam::dspin_get(receive_data,
     5514                                           DspinDhccpParam::CLEANUP_ACK_WAY) &
     5515                                           ((1ULL<<(uint32_log2(m_icache_ways)))-1);
    53965516                r_cc_receive_icache_type = CC_TYPE_CLACK;
    53975517                // get back to idle state
     
    54185538            // not to actually post a request to an available cache => need a
    54195539            // flip_flop to check that ?
    5420             if (not (r_cc_receive_icache_req.read()) and not (r_cc_receive_dcache_req.read()) and (p_dspin_in.write.read()))
     5540            if (not (r_cc_receive_icache_req.read()) and
     5541                not (r_cc_receive_dcache_req.read()) and
     5542                (p_dspin_in.write.read()))
    54215543            {
    54225544                // request dcache to handle the BROADCAST
    54235545                r_cc_receive_dcache_req  = true;
    5424                 r_cc_receive_dcache_nline  = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::BROADCAST_NLINE);
     5546                r_cc_receive_dcache_nline  = DspinDhccpParam::dspin_get(receive_data,
     5547                                             DspinDhccpParam::BROADCAST_NLINE);
    54255548                r_cc_receive_dcache_type = CC_TYPE_BRDCAST;
    54265549                // request icache to handle the BROADCAST
    54275550                r_cc_receive_icache_req  = true;
    5428                 r_cc_receive_icache_nline  = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::BROADCAST_NLINE);
     5551                r_cc_receive_icache_nline  = DspinDhccpParam::dspin_get(receive_data,
     5552                                             DspinDhccpParam::BROADCAST_NLINE);
    54295553                r_cc_receive_icache_type = CC_TYPE_BRDCAST;
    54305554                // get back to idle state
     
    54415565            uint64_t receive_data = p_dspin_in.data.read();
    54425566            // for data INVAL, wait for dcache to take the request
    5443             if ((r_cc_receive_data_ins.read() == 0) and not (r_cc_receive_dcache_req.read()))
    5444             {
    5445                 r_cc_receive_dcache_updt_tab_idx  = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::MULTI_INVAL_UPDT_INDEX);
     5567            if ((r_cc_receive_data_ins.read() == 0) and
     5568                 not (r_cc_receive_dcache_req.read()))
     5569            {
     5570                r_cc_receive_dcache_updt_tab_idx = DspinDhccpParam::dspin_get(receive_data,
     5571                                                   DspinDhccpParam::MULTI_INVAL_UPDT_INDEX);
    54465572                r_cc_receive_fsm = CC_RECEIVE_INVAL_NLINE;
    54475573                break;
    54485574            }
    54495575            // for ins INVAL, wait for icache to take the request
    5450             if ((r_cc_receive_data_ins.read() == 1) and not (r_cc_receive_icache_req.read()))
    5451             {
    5452                 r_cc_receive_icache_updt_tab_idx  = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::MULTI_INVAL_UPDT_INDEX);
     5576            if ((r_cc_receive_data_ins.read() == 1) and
     5577                 not (r_cc_receive_icache_req.read()))
     5578            {
     5579                r_cc_receive_icache_updt_tab_idx = DspinDhccpParam::dspin_get(receive_data,
     5580                                                   DspinDhccpParam::MULTI_INVAL_UPDT_INDEX);
    54535581                r_cc_receive_fsm = CC_RECEIVE_INVAL_NLINE;
    54545582                break;
     
    54635591            uint64_t receive_data = p_dspin_in.data.read();
    54645592            // for data INVAL, wait for dcache to take the request
    5465             if ((r_cc_receive_data_ins.read() == 0) and not (r_cc_receive_dcache_req.read()) and (p_dspin_in.write.read()))
     5593            if ( (r_cc_receive_data_ins.read() == 0) and
     5594                 not (r_cc_receive_dcache_req.read()) and
     5595                 (p_dspin_in.write.read()) )
    54665596            {
    54675597                // request dcache to handle the INVAL
     
    54855615            }
    54865616            // we should never get there
    5487             assert ( false && "CC_RECEIVE_INVAL_NLINE : incoherent handling of either r_cc_receive_data_ins or r_cc_receive_*cache_req\n");
     5617            assert ( false && "ERROR in CC_VCACHE : CC_RECEIVE_INVAL_NLINE\n");
    54885618        }
    54895619        ////////////////////////////
     
    55185648            // for data INVAL, wait for dcache to take the request and fifo to
    55195649            // be empty
    5520             if ((r_cc_receive_data_ins.read() == 0) and not (r_cc_receive_dcache_req.read()) and r_cc_receive_updt_fifo_be.empty() and (p_dspin_in.write.read()))
     5650            if ( (r_cc_receive_data_ins.read() == 0) and
     5651                 not (r_cc_receive_dcache_req.read()) and
     5652                 r_cc_receive_updt_fifo_be.empty() and
     5653                 (p_dspin_in.write.read()) )
    55215654            {
    55225655                r_cc_receive_dcache_nline  = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::MULTI_UPDT_NLINE);
     
    55295662            // for ins INVAL, wait for icache to take the request and fifo to be
    55305663            // empty
    5531             if ((r_cc_receive_data_ins.read() == 1) and not (r_cc_receive_icache_req.read()) and r_cc_receive_updt_fifo_be.empty() and (p_dspin_in.write.read()))
     5664            if ( (r_cc_receive_data_ins.read() == 1) and
     5665                 not (r_cc_receive_icache_req.read()) and
     5666                 r_cc_receive_updt_fifo_be.empty() and
     5667                 (p_dspin_in.write.read()))
    55325668            {
    55335669                r_cc_receive_icache_nline  = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::MULTI_UPDT_NLINE);
     
    55395675            }
    55405676            // we should never get there
    5541             assert ( false && "CC_RECEIVE_UPDT_NLINE : incoherent handling of either r_cc_receive_data_ins or r_cc_receive_*cache_req or r_cc_receive_fifo\n");
     5677            assert ( false && "ERROR in CC_VCACHE : CC_RECEIVE_UPDT_NLINE \n");
    55425678            break;
    55435679        }
     
    55505686                r_cc_receive_icache_req = true;
    55515687
    5552             // sample data, be and eop
    5553             uint64_t receive_data = p_dspin_in.data.read();
    55545688            // wait for the fifo
    55555689            if (r_cc_receive_updt_fifo_be.wok() and (p_dspin_in.write.read()))
    55565690            {
    5557                 cc_receive_updt_fifo_be = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::MULTI_UPDT_BE);
     5691                uint64_t receive_data = p_dspin_in.data.read();
     5692                bool     receive_eop  = p_dspin_in.eop.read();
     5693                cc_receive_updt_fifo_be   = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::MULTI_UPDT_BE);
    55585694                cc_receive_updt_fifo_data = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::MULTI_UPDT_DATA);
    5559                 // sample eop to test for state exit
    5560                 bool flit_eop = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::FROM_MC_EOP);
    5561                 cc_receive_updt_fifo_eop = flit_eop;
     5695                cc_receive_updt_fifo_eop  = receive_eop;
    55625696                cc_receive_updt_fifo_put  = true;
    5563                 if(flit_eop)
    5564                     r_cc_receive_fsm = CC_RECEIVE_IDLE;
     5697                if ( receive_eop ) r_cc_receive_fsm = CC_RECEIVE_IDLE;
    55655698            }
    55665699            break;
     
    56105743    p_vci.cfixed = false;
    56115744
     5745    if ( m_monitor_ok ) {
     5746        if ( p_vci.cmdack.read() == true and p_vci.cmdval == true) {
     5747            if (((p_vci.address.read()) >= m_monitor_base) and
     5748                ((p_vci.address.read()) < m_monitor_base + m_monitor_length) ) {
     5749                std::cout << "CC_VCACHE Monitor " << name() << std::hex
     5750                          << " Access type = " << vci_cmd_type_str[p_vci.cmd.read()]
     5751                          << " Pktid type = " << vci_pktid_type_str[p_vci.pktid.read()]
     5752                          << " : address = " << p_vci.address.read()
     5753                          << " / be = " << p_vci.be.read();
     5754                if ( p_vci.cmd.read() == vci_param::CMD_WRITE ) {
     5755                    std::cout << " / data = " << p_vci.wdata.read();
     5756                }
     5757                std::cout << std::dec << std::endl;
     5758            }
     5759        }
     5760    }
     5761
    56125762    switch ( r_vci_cmd_fsm.read() ) {
    56135763
     
    57385888
    57395889   
    5740     // Send coherence packets on DSPIN L2M
     5890    // Send coherence packets on DSPIN P2M
    57415891    // it depends on the CC_SEND FSM
    57425892
     
    57545904        {
    57555905            // initialize dspin send data
    5756             DspinDhccpParam::dspin_set(dspin_send_data,
    5757                                        0,
    5758                                        DspinDhccpParam::FROM_L1_EOP);
     5906//            DspinDhccpParam::dspin_set(dspin_send_data,
     5907//                                       0,
     5908//                                       DspinDhccpParam::FROM_L1_EOP);
    57595909            DspinDhccpParam::dspin_set(dspin_send_data,
    57605910                                       m_cc_global_id,
     
    57755925
    57765926                DspinDhccpParam::dspin_set(dspin_send_data,
    5777                                            r_dcache_cc_send_nline.read() & 0x300000000ULL,
     5927                                           (r_dcache_cc_send_nline.read() & 0x300000000ULL)>>32,
    57785928                                           DspinDhccpParam::CLEANUP_NLINE_MSB);
    57795929
     
    57975947
    57985948                DspinDhccpParam::dspin_set(dspin_send_data,
    5799                                            r_icache_cc_send_nline.read() & 0x300000000ULL,
     5949                                           (r_icache_cc_send_nline.read() & 0x300000000ULL)>>32,
    58005950                                           DspinDhccpParam::CLEANUP_NLINE_MSB);
    58015951
     
    58115961            p_dspin_out.data  = dspin_send_data;
    58125962            p_dspin_out.write = true;
     5963            p_dspin_out.eop   = false;
    58135964            break;
    58145965        }
     
    58175968        {
    58185969            // initialize dspin send data
    5819             DspinDhccpParam::dspin_set(dspin_send_data,
    5820                                        1,
    5821                                        DspinDhccpParam::FROM_L1_EOP);
     5970//            DspinDhccpParam::dspin_set(dspin_send_data,
     5971//                                       1,
     5972//                                       DspinDhccpParam::FROM_L1_EOP);
    58225973
    58235974            if(r_cc_send_last_client.read() == 0) // dcache active request
     
    58365987            p_dspin_out.data  = dspin_send_data;
    58375988            p_dspin_out.write = true;
     5989            p_dspin_out.eop   = true;
    58385990            break;
    58395991        }
     
    58425994        {
    58435995            // initialize dspin send data
    5844             DspinDhccpParam::dspin_set(dspin_send_data,
    5845                                        1,
    5846                                        DspinDhccpParam::FROM_L1_EOP);
     5996//            DspinDhccpParam::dspin_set(dspin_send_data,
     5997//                                       1,
     5998//                                       DspinDhccpParam::FROM_L1_EOP);
    58475999            DspinDhccpParam::dspin_set(dspin_send_data,
    58486000                                       0,
     
    58846036            p_dspin_out.data  = dspin_send_data;
    58856037            p_dspin_out.write = true;
     6038            p_dspin_out.eop   = true;
    58866039
    58876040            break;
     
    59516104                r_cc_receive_updt_fifo_be.empty())
    59526105                or
    5953                 ((r_cc_receive_data_ins.read() == 1) and
     6106                (((r_cc_receive_data_ins.read() == 1) and
    59546107                not r_cc_receive_icache_req.read()) and
    5955                 r_cc_receive_updt_fifo_be.empty())
     6108                r_cc_receive_updt_fifo_be.empty()))
    59566109                p_dspin_in.read = true;
    59576110            else
     
    59876140} // end genMoore
    59886141
     6142tmpl(void)::start_monitor(paddr_t base, paddr_t length)
     6143// This version of monitor print both Read and Write request
     6144{
     6145    m_monitor_ok        = true;
     6146    m_monitor_base      = base;
     6147    m_monitor_length    = length;
     6148}
     6149
     6150tmpl(void)::stop_monitor()
     6151{
     6152    m_monitor_ok        = false;
     6153}
     6154
    59896155}}
    59906156
Note: See TracChangeset for help on using the changeset viewer.