source: trunk/modules/vci_cc_xcache_wrapper_v4/caba/source/include/vci_cc_xcache_wrapper_v4.h @ 140

Last change on this file since 140 was 140, checked in by kane, 13 years ago

yAjout du multi_cache : plusieurs processeur peuvent ce partager le même cache L1.
2 remarques, (1) deux nouveaux paramètres : nb_cpu, nb_cache. Pour avoir un cache dont le comportement est identique à la version d'avant, mettre ces paramètres à 1.
(2) le port d'interruption est maintenant un tableau dépendant du nombre de processeur.
Voir le fichier "platforms/caba-ring-ccxcachev4_memcachev4-mips32el/top.cpp" pour plus de détails.

--Cette ligne, et les suivantes ci-dessous, seront ignorées--

M platforms/tsarv4_dspin_generic_32/tsarv4_dspin_generic_32_top.cpp
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/segmentation.h
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/top.cpp
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/configuration/default.cfg
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/configuration/gen_config.sh
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/dhrystone/dhry21a.c
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/define.h
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/matrix_multiplication/matrix_multiplication.c
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/common/common.c
A platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/self_code_modifying
A platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/self_code_modifying/self_code_modifying.c
A platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/self_code_modifying/self_code_modifying.h
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark.h
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark_sort.c
A platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark_self_code_modifying.c
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark.c
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark_matrix_multiplication.c
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/Makefile
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/Makefile
M platforms/tsarv4_vgmn_generic_32/tsarv4_vgmn_generic_32_top.cpp
M modules/vci_cc_xcache_wrapper_v4/caba/source/include/vci_cc_xcache_wrapper_v4.h
M modules/vci_cc_xcache_wrapper_v4/caba/source/src/vci_cc_xcache_wrapper_v4.cpp
M modules/vci_mem_cache_v4/caba/source/include/vci_mem_cache_v4.h
M modules/vci_mem_cache_v4/caba/source/include/mem_cache_directory_v4.h
M modules/vci_mem_cache_v4/caba/source/src/vci_mem_cache_v4.cpp

  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Rev URL Revision"
  • Property svn:mime-type set to text/plain
File size: 20.0 KB
Line 
1/* -*- c++ -*-
2 *
3 * SOCLIB_LGPL_HEADER_BEGIN
4 *
5 * This file is part of SoCLib, GNU LGPLv2.1.
6 *
7 * SoCLib is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as published
9 * by the Free Software Foundation; version 2.1 of the License.
10 *
11 * SoCLib is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with SoCLib; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 *
21 * SOCLIB_LGPL_HEADER_END
22 *
23 * Copyright (c) UPMC, Lip6, SoC
24 *         Alain Greiner <alain.greiner@lip6.fr>, 2008
25 *
26 * Maintainers: alain
27 */
28 
29#ifndef SOCLIB_CABA_VCI_CC_XCACHE_WRAPPER_V4_H
30#define SOCLIB_CABA_VCI_CC_XCACHE_WRAPPER_V4_H
31
32#include <inttypes.h>
33#include <fstream>
34#include <systemc>
35#include <queue>
36#include "caba_base_module.h"
37#include "multi_write_buffer.h"
38#include "generic_cache.h"
39#include "vci_initiator.h"
40#include "vci_target.h"
41#include "mapping_table.h"
42#include "static_assert.h"
43
44/*
45 * CC_XCACHE_WRAPPER_SELECT_VICTIM :
46 *   The selection and the update of cache (after a read miss)
47 *   are separated in two step
48 *   Also, the cleanup can be send in parallel at the read miss.
49 *
50 * CC_XCACHE_WRAPPER_FIFO_RSP
51 *   Two simple fifo (each 2x32 depth) receive the cache line from
52 *   RAM. Instead of two buffers (m_icache_words and m_dcache_words)
53 *   
54 * CC_XCACHE_WRAPPER_CC_UPDATE_MULTI_CYCLE
55 *   Update cache in "2*cache_words" cycles (read+mask, write)
56 *   
57 * CC_XCACHE_WRAPPER_CC_UPDATE_MULTI_CYCLE_OPT
58 *   Update cache with only modified data (be != 0)
59 *   
60 * CC_XCACHE_WRAPPER_WBUF_UPDATE_SCHEME
61 *   Write buffer scheme for update step :
62 *     1    - multi_scan
63 *     2    - round_robin_scan
64 *     3    - one_scan
65 *     else - default scheme
66 *
67 * CC_XCACHE_WRAPPER_VCI_CMD_PRIORITY
68 *   Write buffer access is conditionnal with dcache_miss_req and icache_miss_req
69 *     1    - two access authorized
70 *     2    - one access with static priority (dcache prior)
71 *     3    - one access with static priority (icache prior)
72 *     4    - one access with round robin priority
73 *
74 * CC_XCACHE_WRAPPER_MULTI_CACHE :
75 *     1    - icache static partitionnement
76 *     2    - icache dedicated
77 *
78 * CC_XCACHE_WRAPPER_STOP_SIMULATION :
79 *   stop simulation if processor is stall after a long time
80 *   (configurable with "stop_simulation" function)
81 *
82 * CC_XCACHE_WRAPPER_DEBUG :
83 *   Add log to help the debugging
84 *
85 * CC_XCACHE_WRAPPER_DEBUG_CYCLE_MIN :
86 *   Number of cycle before to prinf debug message
87 *
88 * CC_XCACHE_WRAPPER_DEBUG_FILE_TRANSACTION
89 *   Print transaction between :
90 *     - the cpu and the cache (icache and dcache)
91 *     - vci
92 *     - cleanup
93 *     - coherency
94 */
95
96// implementation
97#ifndef CC_XCACHE_WRAPPER_SELECT_VICTIM
98#define CC_XCACHE_WRAPPER_SELECT_VICTIM               1
99#endif
100#ifndef CC_XCACHE_WRAPPER_FIFO_RSP
101#define CC_XCACHE_WRAPPER_FIFO_RSP                    1
102#endif
103#ifndef CC_XCACHE_WRAPPER_CC_UPDATE_MULTI_CYCLE
104#define CC_XCACHE_WRAPPER_CC_UPDATE_MULTI_CYCLE       1
105#endif
106#ifndef CC_XCACHE_WRAPPER_CC_UPDATE_MULTI_CYCLE_OPT
107#define CC_XCACHE_WRAPPER_CC_UPDATE_MULTI_CYCLE_OPT   1
108#endif
109#ifndef CC_XCACHE_WRAPPER_WBUF_UPDATE_SCHEME
110#define CC_XCACHE_WRAPPER_WBUF_UPDATE_SCHEME          2
111#endif
112#ifndef CC_XCACHE_WRAPPER_VCI_CMD_PRIORITY
113#define CC_XCACHE_WRAPPER_VCI_CMD_PRIORITY            4
114#endif 
115#ifndef CC_XCACHE_WRAPPER_MULTI_CACHE
116#define CC_XCACHE_WRAPPER_MULTI_CACHE                 2
117#endif 
118// debugging
119#ifndef CC_XCACHE_WRAPPER_STOP_SIMULATION
120#define CC_XCACHE_WRAPPER_STOP_SIMULATION             1
121#endif
122#ifndef CC_XCACHE_WRAPPER_DEBUG
123#define CC_XCACHE_WRAPPER_DEBUG                       0
124#endif
125#ifndef CC_XCACHE_WRAPPER_DEBUG_CYCLE_MIN
126#define CC_XCACHE_WRAPPER_DEBUG_CYCLE_MIN             949900
127#endif
128#ifndef CC_XCACHE_WRAPPER_DEBUG_FILE_TRANSACTION
129#define CC_XCACHE_WRAPPER_DEBUG_FILE_TRANSACTION      0
130#define CC_XCACHE_WRAPPER_DEBUG_FILE_TRANSACTION_PATH "log"
131#endif
132
133// don't change
134#if not CC_XCACHE_WRAPPER_CC_UPDATE_MULTI_CYCLE
135#undef  CC_XCACHE_WRAPPER_CC_UPDATE_MULTI_CYCLE_OPT
136#define CC_XCACHE_WRAPPER_CC_UPDATE_MULTI_CYCLE_OPT   0
137#endif
138
139namespace soclib {
140namespace caba {
141
142using namespace sc_core;
143
144////////////////////////////////////////////
145template<typename vci_param, typename iss_t>
146class VciCcXCacheWrapperV4
147///////////////////////////////////////////
148    : public soclib::caba::BaseModule
149{
150    typedef sc_dt::sc_uint<40>  addr_40;
151    typedef sc_dt::sc_uint<64>  data_64;
152    typedef uint32_t            data_t;
153    typedef uint32_t            tag_t;
154    typedef uint32_t            be_t;
155    typedef typename vci_param::fast_addr_t vci_addr_t;
156
157    enum dcache_fsm_state_e {
158        DCACHE_IDLE,
159        DCACHE_WRITE_UPDT,
160#if CC_XCACHE_WRAPPER_SELECT_VICTIM
161        DCACHE_MISS_VICTIM,
162#endif
163        DCACHE_MISS_WAIT,
164        DCACHE_MISS_UPDT,
165        DCACHE_UNC_WAIT,
166        DCACHE_SC_WAIT,
167        DCACHE_INVAL,
168        DCACHE_SYNC,
169        DCACHE_ERROR,
170        DCACHE_CC_CHECK,
171        DCACHE_CC_INVAL,
172        DCACHE_CC_UPDT,
173        DCACHE_CC_CLEANUP,
174    };
175
176    enum icache_fsm_state_e {
177        ICACHE_IDLE,
178#if CC_XCACHE_WRAPPER_SELECT_VICTIM
179        ICACHE_MISS_VICTIM,
180#endif
181        ICACHE_MISS_WAIT,
182        ICACHE_MISS_UPDT,
183        ICACHE_UNC_WAIT,
184        ICACHE_ERROR,
185        ICACHE_CC_CLEANUP,
186        ICACHE_CC_CHECK,
187        ICACHE_CC_INVAL,
188        ICACHE_CC_UPDT,
189    };
190
191    enum cmd_fsm_state_e {
192        CMD_IDLE,
193        CMD_INS_MISS,
194        CMD_INS_UNC,
195        CMD_DATA_MISS,
196        CMD_DATA_UNC,
197        CMD_DATA_WRITE,
198        CMD_DATA_SC,
199    };
200
201    enum rsp_fsm_state_e {
202        RSP_IDLE,
203        RSP_INS_MISS,
204        RSP_INS_UNC,
205        RSP_DATA_MISS,
206        RSP_DATA_UNC,
207        RSP_DATA_WRITE,
208        RSP_DATA_SC,
209    };
210
211    enum tgt_fsm_state_e {
212        TGT_IDLE,
213        TGT_UPDT_WORD,
214        TGT_UPDT_DATA,
215        TGT_REQ_BROADCAST,
216        TGT_REQ_ICACHE,
217        TGT_REQ_DCACHE,
218        TGT_RSP_BROADCAST,
219        TGT_RSP_ICACHE,
220        TGT_RSP_DCACHE,
221    };
222
223    enum cleanup_fsm_state_e {
224        CLEANUP_IDLE,
225        CLEANUP_REQ,
226        CLEANUP_RSP_DCACHE,
227        CLEANUP_RSP_ICACHE,
228    };
229
230    enum transaction_type_c_e {
231        // convention with memcache
232        TYPE_DATA_CLEANUP = 0x0,
233        TYPE_INS_CLEANUP  = 0x1
234    };
235
236    enum transaction_type_rw_e {
237        // convention with memcache
238        // b0 : 1 if cached
239        // b1 : 1 if instruction
240        // b2 : 1 if sc
241        TYPE_DATA_UNC     = 0x0,
242        TYPE_DATA_MISS    = 0x1,
243        TYPE_INS_UNC      = 0x2,
244        TYPE_INS_MISS     = 0x3,
245        TYPE_DATA_SC      = 0x4, // sc is data and no cached
246    };
247
248public:
249
250    // PORTS
251    sc_in<bool>                             p_clk;
252    sc_in<bool>                             p_resetn;
253    sc_in<bool>                          ** p_irq;//[m_nb_cpu][iss_t::n_irq];
254    soclib::caba::VciInitiator<vci_param>   p_vci_ini_rw;
255    soclib::caba::VciInitiator<vci_param>   p_vci_ini_c;
256    soclib::caba::VciTarget<vci_param>      p_vci_tgt;
257
258private:
259
260    // STRUCTURAL PARAMETERS
261    const soclib::common::AddressDecodingTable<vci_addr_t, bool>    m_cacheability_table;
262    const soclib::common::Segment                                   m_segment;
263    iss_t            ** m_iss; //[m_nb_cpu]
264    const uint32_t      m_srcid_rw;   
265    const uint32_t      m_srcid_c;   
266   
267    const size_t        m_nb_cpu;
268    const size_t        m_nb_icache;
269    const size_t        m_nb_dcache;
270    const size_t        m_nb_cache;
271    const size_t        m_dcache_ways;
272    const size_t        m_dcache_words;
273    const uint32_t      m_dcache_words_shift;
274    const size_t        m_dcache_yzmask;
275    const size_t        m_icache_ways;
276    const size_t        m_icache_words;
277    const uint32_t      m_icache_words_shift;
278    const size_t        m_icache_yzmask;
279    const size_t        m_cache_words; // max between m_dcache_words and m_icache_words
280
281#if CC_XCACHE_WRAPPER_STOP_SIMULATION
282    bool                m_stop_simulation;
283    uint32_t            m_stop_simulation_nb_frz_cycles_max;
284    uint32_t          * m_stop_simulation_nb_frz_cycles; //[m_nb_cpu]
285#endif // CC_XCACHE_WRAPPER_STOP_SIMULATION
286
287    // REGISTERS
288    sc_signal<uint32_t>     r_cpu_prior;
289    sc_signal<uint32_t>   * r_icache_lock;//[m_nb_icache]
290    sc_signal<uint32_t>   * r_dcache_lock;//[m_nb_dcache]
291    sc_signal<bool>       * r_dcache_sync;//[m_nb_dcache]
292
293    sc_signal<int>        * r_dcache_fsm;          //[m_nb_dcache]
294    sc_signal<int>        * r_dcache_fsm_save;     //[m_nb_dcache]
295    sc_signal<addr_40>    * r_dcache_addr_save;    //[m_nb_dcache]
296    sc_signal<data_t>     * r_dcache_wdata_save;   //[m_nb_dcache]
297    sc_signal<data_t>     * r_dcache_rdata_save;   //[m_nb_dcache]
298    sc_signal<int>        * r_dcache_type_save;    //[m_nb_dcache]
299    sc_signal<be_t>       * r_dcache_be_save;      //[m_nb_dcache]
300    sc_signal<bool>       * r_dcache_cached_save;  //[m_nb_dcache]
301    sc_signal<bool>       * r_dcache_cleanup_req;  //[m_nb_dcache]
302    sc_signal<addr_40>    * r_dcache_cleanup_line; //[m_nb_dcache]
303    sc_signal<bool>       * r_dcache_miss_req;     //[m_nb_dcache]
304    sc_signal<size_t>     * r_dcache_miss_way;     //[m_nb_dcache]
305    sc_signal<size_t>     * r_dcache_miss_set;     //[m_nb_dcache]
306    sc_signal<bool>       * r_dcache_unc_req;      //[m_nb_dcache]
307    sc_signal<bool>       * r_dcache_sc_req;       //[m_nb_dcache]
308    sc_signal<bool>       * r_dcache_inval_rsp;    //[m_nb_dcache]
309    sc_signal<size_t>     * r_dcache_update_addr;  //[m_nb_dcache]
310    sc_signal<data_64>   ** r_dcache_ll_data;      //[m_nb_dcache][m_nb_cpu]
311    sc_signal<addr_40>   ** r_dcache_ll_addr;      //[m_nb_dcache][m_nb_cpu]
312    sc_signal<bool>      ** r_dcache_ll_valid;     //[m_nb_dcache][m_nb_cpu]
313    sc_signal<uint32_t>   * r_dcache_num_cpu_save; //[m_nb_dcache]
314    sc_signal<bool>       * r_dcache_previous_unc; //[m_nb_dcache]
315                                                   
316    sc_signal<int>        * r_icache_fsm;          //[m_nb_icache]
317    sc_signal<int>        * r_icache_fsm_save;     //[m_nb_icache]
318    sc_signal<addr_40>    * r_icache_addr_save;    //[m_nb_icache]
319    sc_signal<bool>       * r_icache_miss_req;     //[m_nb_icache]
320    sc_signal<size_t>     * r_icache_miss_way;     //[m_nb_icache]
321    sc_signal<size_t>     * r_icache_miss_set;     //[m_nb_icache]
322    sc_signal<bool>       * r_icache_unc_req;      //[m_nb_icache]
323    sc_signal<bool>       * r_icache_cleanup_req;  //[m_nb_icache]
324    sc_signal<addr_40>    * r_icache_cleanup_line; //[m_nb_icache]
325    sc_signal<bool>       * r_icache_inval_rsp;    //[m_nb_icache]
326    sc_signal<size_t>     * r_icache_update_addr;  //[m_nb_icache]
327    sc_signal<bool>       * r_icache_buf_unc_valid;//[m_nb_icache]
328
329    sc_signal<int>          r_vci_cmd_fsm;
330    sc_signal<size_t>       r_vci_cmd_min;       
331    sc_signal<size_t>       r_vci_cmd_max;       
332    sc_signal<size_t>       r_vci_cmd_cpt;       
333    sc_signal<bool>         r_vci_cmd_dcache_prior;
334    sc_signal<uint32_t>     r_vci_cmd_num_cache;
335
336    sc_signal<int>          r_vci_rsp_fsm;
337    sc_signal<size_t>       r_vci_rsp_cpt; 
338              bool          s_vci_rsp_ack;
339    sc_signal<uint32_t>     r_vci_rsp_num_cache;
340    sc_signal<bool>       * r_vci_rsp_ins_error;  //[m_nb_icache]
341    sc_signal<bool>       * r_vci_rsp_data_error; //[m_nb_dcache]
342
343#if CC_XCACHE_WRAPPER_FIFO_RSP
344    std::queue<data_t>    * r_icache_miss_buf;    //[m_nb_icache]
345    std::queue<data_t>    * r_dcache_miss_buf;    //[m_nb_dcache]
346#else
347    bool                 ** r_icache_miss_val;    //[m_nb_icache][m_icache_words]
348    data_t               ** r_icache_miss_buf;    //[m_nb_icache][m_icache_words]
349    bool                 ** r_dcache_miss_val;    //[m_nb_dcache][m_dcache_words]
350    data_t               ** r_dcache_miss_buf;    //[m_nb_dcache][m_dcache_words]
351#endif
352    data_t                * r_tgt_buf;            //[m_cache_words]
353    be_t                  * r_tgt_be;             //[m_cache_words]
354#if CC_XCACHE_WRAPPER_CC_UPDATE_MULTI_CYCLE
355    sc_signal<uint32_t>     r_cache_word;
356#endif
357
358    sc_signal<int>          r_vci_tgt_fsm;
359    sc_signal<addr_40>      r_tgt_iaddr;
360    sc_signal<addr_40>      r_tgt_daddr;
361    sc_signal<size_t>       r_tgt_word;
362    sc_signal<bool>         r_tgt_update;
363    sc_signal<bool>         r_tgt_update_data;
364  //sc_signal<bool>         r_tgt_brdcast;
365    sc_signal<size_t>       r_tgt_srcid;
366    sc_signal<size_t>       r_tgt_pktid;
367    sc_signal<size_t>       r_tgt_trdid;
368  //sc_signal<size_t>       r_tgt_plen;
369    sc_signal<uint32_t>     r_tgt_num_cache;
370    sc_signal<bool>       * r_tgt_icache_req; //[m_nb_icache]
371    sc_signal<bool>       * r_tgt_icache_rsp; //[m_nb_icache]
372    sc_signal<bool>       * r_tgt_dcache_req; //[m_nb_dcache]
373    sc_signal<bool>       * r_tgt_dcache_rsp; //[m_nb_dcache]
374
375    sc_signal<int>          r_cleanup_fsm;              // controls initiator port of the coherence network
376    sc_signal<uint32_t>     r_cleanup_num_cache;
377    sc_signal<bool>         r_cleanup_icache;
378
379    MultiWriteBuffer<addr_40>** r_wbuf;
380    GenericCache<vci_addr_t> ** r_icache;
381    GenericCache<vci_addr_t> ** r_dcache;
382
383#if CC_XCACHE_WRAPPER_DEBUG_FILE_TRANSACTION
384    std::ofstream             * log_transaction_file_icache; //[m_nb_cpu]
385    std::ofstream             * log_transaction_file_dcache; //[m_nb_cpu]
386    std::ofstream               log_transaction_file_cmd;
387    std::ofstream               log_transaction_file_tgt;
388    std::ofstream               log_transaction_file_cleanup;
389#endif
390
391    // Activity counters
392    uint32_t   m_cpt_dcache_data_read;             // * DCACHE DATA READ
393    uint32_t   m_cpt_dcache_data_write;            // * DCACHE DATA WRITE
394    uint32_t   m_cpt_dcache_dir_read;              // * DCACHE DIR READ
395    uint32_t   m_cpt_dcache_dir_write;             // * DCACHE DIR WRITE
396                                                   
397    uint32_t   m_cpt_icache_data_read;             // * ICACHE DATA READ
398    uint32_t   m_cpt_icache_data_write;            // * ICACHE DATA WRITE
399    uint32_t   m_cpt_icache_dir_read;              // * ICACHE DIR READ
400    uint32_t   m_cpt_icache_dir_write;             // * ICACHE DIR WRITE
401               
402    uint32_t   m_cpt_cc_update_icache;             // number of coherence update packets (for icache)
403    uint32_t   m_cpt_cc_update_dcache;             // number of coherence update packets (for dcache)
404    uint32_t   m_cpt_cc_inval_broadcast;           // number of coherence inval packets
405    uint32_t   m_cpt_cc_inval_icache;              // number of coherence inval packets
406    uint32_t   m_cpt_cc_inval_dcache;              // number of coherence inval packets
407    uint32_t   m_cpt_cc_update_icache_word_useful; // number of valid word in coherence update packets
408    uint32_t   m_cpt_cc_update_dcache_word_useful; // number of valid word in coherence update packets
409               
410    uint32_t * m_cpt_frz_cycles;                       // * number of cycles where the cpu is frozen
411    uint32_t   m_cpt_total_cycles;                     // total number of cycles
412               
413    uint32_t   m_cpt_data_read;                    //   number of data read
414    uint32_t   m_cpt_data_read_miss;               //   number of data read miss
415    uint32_t   m_cpt_data_read_uncached;           //   number of data read uncached
416    uint32_t   m_cpt_data_write;                   //   number of data write
417    uint32_t   m_cpt_data_write_miss;              //   number of data write miss
418    uint32_t   m_cpt_data_write_uncached;          //   number of data write uncached
419    uint32_t   m_cpt_ins_miss;                     // * number of instruction miss
420               
421    uint32_t   m_cost_write_frz;                   // * number of frozen cycles related to write buffer         
422    uint32_t   m_cost_data_miss_frz;               // * number of frozen cycles related to data miss
423    uint32_t   m_cost_unc_read_frz;                // * number of frozen cycles related to uncached read
424    uint32_t   m_cost_ins_miss_frz;                // * number of frozen cycles related to ins miss
425               
426    uint32_t   m_cpt_imiss_transaction;            // * number of VCI instruction miss transactions
427    uint32_t   m_cpt_dmiss_transaction;            // * number of VCI data miss transactions
428    uint32_t   m_cpt_unc_transaction;              // * number of VCI uncached read transactions
429    uint32_t   m_cpt_data_write_transaction;       // * number of VCI write transactions
430               
431    uint32_t   m_cost_imiss_transaction;           // * cumulated duration for VCI IMISS transactions
432    uint32_t   m_cost_dmiss_transaction;           // * cumulated duration for VCI DMISS transactions
433    uint32_t   m_cost_unc_transaction;             // * cumulated duration for VCI UNC transactions
434    uint32_t   m_cost_write_transaction;           // * cumulated duration for VCI WRITE transactions
435    uint32_t   m_length_write_transaction;         // * cumulated length for VCI WRITE transactions
436
437    uint32_t * m_cpt_icache_access; //[m_nb_icache]
438    uint32_t * m_cpt_dcache_access; //[m_nb_dcache]
439
440    uint32_t ** m_cpt_fsm_dcache;  //[m_nb_dcache]
441    uint32_t ** m_cpt_fsm_icache;  //[m_nb_icache]
442    uint32_t  * m_cpt_fsm_cmd;
443    uint32_t  * m_cpt_fsm_rsp;
444    uint32_t  * m_cpt_fsm_tgt;
445    uint32_t  * m_cpt_fsm_cleanup;
446
447    // Non blocking multi-cache
448    typename iss_t::InstructionRequest  * ireq        ; //[m_nb_icache]
449    typename iss_t::InstructionResponse * irsp        ; //[m_nb_icache]
450    bool                                * ireq_cached ; //[m_nb_icache]
451    uint32_t                            * ireq_num_cpu; //[m_nb_dcache]
452    typename iss_t::DataRequest         * dreq        ; //[m_nb_dcache]
453    typename iss_t::DataResponse        * drsp        ; //[m_nb_dcache]
454    bool                                * dreq_cached ; //[m_nb_dcache]
455    uint32_t                            * dreq_num_cpu; //[m_nb_dcache]
456
457    const uint32_t m_num_cache_LSB;
458    const uint32_t m_num_cache_MSB;
459          addr_40  m_num_cache_LSB_mask;
460          addr_40  m_num_cache_mask;
461
462protected:
463    SC_HAS_PROCESS(VciCcXCacheWrapperV4);
464
465public:
466
467    VciCcXCacheWrapperV4(
468                       sc_module_name insname,
469                       int proc_id,
470                       const soclib::common::MappingTable &mtp,
471                       const soclib::common::MappingTable &mtc,
472                       const soclib::common::IntTab &initiator_index_rw,
473                       const soclib::common::IntTab &initiator_index_c,
474                       const soclib::common::IntTab &target_index,
475                       size_t nb_cpu,
476                       size_t nb_cache,
477                       size_t icache_ways,
478                       size_t icache_sets,
479                       size_t icache_words,
480                       size_t dcache_ways,
481                       size_t dcache_sets,
482                       size_t dcache_words,
483                       size_t wbuf_nwords,
484                       size_t wbuf_nlines,
485                       size_t wbuf_timeout
486                         );
487
488    ~VciCcXCacheWrapperV4();
489
490    void print_trace(size_t mode = 0);
491    void print_cpi();
492    void print_stats();
493
494// #if CC_XCACHE_WRAPPER_STOP_SIMULATION
495    void stop_simulation (uint32_t);
496// #endif // CC_XCACHE_WRAPPER_STOP_SIMULATION
497
498private:
499
500    void transition();
501    void genMoore();
502
503    uint32_t get_num_cache     (addr_40 & addr);
504    uint32_t get_num_cache_only(addr_40   addr);
505    void     set_num_cache     (addr_40 & addr, uint32_t num_cache);
506    addr_40  set_num_cache_only(addr_40   addr, uint32_t num_cache);
507
508    soclib_static_assert((int)iss_t::SC_ATOMIC     == (int)vci_param::STORE_COND_ATOMIC);
509    soclib_static_assert((int)iss_t::SC_NOT_ATOMIC == (int)vci_param::STORE_COND_NOT_ATOMIC);
510};
511
512}}
513
514#endif /* SOCLIB_CABA_VCI_CC_XCACHE_WRAPPER_V4_H */
515
516// Local Variables:
517// tab-width: 4
518// c-basic-offset: 4
519// c-file-offsets:((innamespace . 0)(inline-open . 0))
520// indent-tabs-mode: nil
521// End:
522
523// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
Note: See TracBrowser for help on using the repository browser.