source: branches/ODCCP/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h @ 479

Last change on this file since 479 was 479, checked in by devigne, 11 years ago

Merge with the lastest version of Trunk
Modification in vci_mem_cache : Using TRT's wdata field for
put request to ixr_cmd (just for INCLUSIVE mode)

File size: 47.0 KB
Line 
1/* -*- c++ -*-
2 * File         : vci_mem_cache.h
3 * Date         : 26/10/2008
4 * Copyright    : UPMC / LIP6
5 * Authors      : Alain Greiner / Eric Guthmuller
6 *
7 * SOCLIB_LGPL_HEADER_BEGIN
8 *
9 * This file is part of SoCLib, GNU LGPLv2.1.
10 *
11 * SoCLib is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License as published
13 * by the Free Software Foundation; version 2.1 of the License.
14 *
15 * SoCLib is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with SoCLib; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * 02110-1301 USA
24 *
25 * SOCLIB_LGPL_HEADER_END
26 *
27 * Maintainers: alain eric.guthmuller@polytechnique.edu
28 *              cesar.fuguet-tortolero@lip6.fr
29 *              alexandre.joannou@lip6.fr
30 */
31
32#ifndef SOCLIB_CABA_MEM_CACHE_H
33#define SOCLIB_CABA_MEM_CACHE_H
34
35#include <inttypes.h>
36#include <systemc>
37#include <list>
38#include <cassert>
39#include "arithmetics.h"
40#include "alloc_elems.h"
41#include "caba_base_module.h"
42#include "vci_target.h"
43#include "vci_initiator.h"
44#include "generic_fifo.h"
45#include "mapping_table.h"
46#include "int_tab.h"
47#include "generic_llsc_global_table.h"
48#include "mem_cache_directory.h"
49#include "xram_transaction.h"
50#include "update_tab.h"
51#include "dspin_interface.h"
52#include "dspin_dhccp_param.h"
53
54#define TRT_ENTRIES      4      // Number of entries in TRT
55#define UPT_ENTRIES      4      // Number of entries in UPT
56#define IVT_ENTRIES      4      // Number of entries in IVT
57#define HEAP_ENTRIES     1024   // Number of entries in HEAP
58
59namespace soclib {  namespace caba {
60
61  using namespace sc_core;
62
63  template<typename vci_param_int, 
64           typename vci_param_ext,
65           size_t   dspin_in_width,
66           size_t   dspin_out_width>
67    class VciMemCache
68    : public soclib::caba::BaseModule
69    {
70      typedef typename vci_param_int::fast_addr_t  addr_t;
71      typedef typename sc_dt::sc_uint<64>          wide_data_t;
72      typedef uint32_t                             data_t;
73      typedef uint32_t                             tag_t;
74      typedef uint32_t                             be_t;
75      typedef uint32_t                             copy_t;
76
77      /* States of the TGT_CMD fsm */
78      enum tgt_cmd_fsm_state_e
79      {
80        TGT_CMD_IDLE,
81        TGT_CMD_ERROR,
82        TGT_CMD_READ,
83        TGT_CMD_WRITE,
84        TGT_CMD_CAS,
85        TGT_CMD_CONFIG
86      };
87
88      /* States of the TGT_RSP fsm */
89      enum tgt_rsp_fsm_state_e
90      {
91        TGT_RSP_CONFIG_IDLE,
92        TGT_RSP_TGT_CMD_IDLE,
93        TGT_RSP_READ_IDLE,
94        TGT_RSP_WRITE_IDLE,
95        TGT_RSP_CAS_IDLE,
96        TGT_RSP_XRAM_IDLE,
97        TGT_RSP_MULTI_ACK_IDLE,
98        TGT_RSP_CLEANUP_IDLE,
99        TGT_RSP_CONFIG,
100        TGT_RSP_TGT_CMD,
101        TGT_RSP_READ,
102        TGT_RSP_WRITE,
103        TGT_RSP_CAS,
104        TGT_RSP_XRAM,
105        TGT_RSP_MULTI_ACK,
106        TGT_RSP_CLEANUP
107      };
108
109      /* States of the DSPIN_TGT fsm */
110      enum cc_receive_fsm_state_e
111      {
112        CC_RECEIVE_IDLE,
113        CC_RECEIVE_CLEANUP,
114        CC_RECEIVE_CLEANUP_EOP,
115        CC_RECEIVE_MULTI_ACK
116      };
117
118      /* States of the CC_SEND fsm */
119      enum cc_send_fsm_state_e
120      {
121        CC_SEND_CONFIG_IDLE,
122        CC_SEND_XRAM_RSP_IDLE,
123        CC_SEND_WRITE_IDLE,
124        CC_SEND_CAS_IDLE,
125        CC_SEND_CONFIG_INVAL_HEADER,
126        CC_SEND_CONFIG_INVAL_NLINE,
127        CC_SEND_CONFIG_BRDCAST_HEADER,
128        CC_SEND_CONFIG_BRDCAST_NLINE,
129        CC_SEND_XRAM_RSP_BRDCAST_HEADER,
130        CC_SEND_XRAM_RSP_BRDCAST_NLINE,
131        CC_SEND_XRAM_RSP_INVAL_HEADER,
132        CC_SEND_XRAM_RSP_INVAL_NLINE,
133        CC_SEND_WRITE_BRDCAST_HEADER,
134        CC_SEND_WRITE_BRDCAST_NLINE,
135        CC_SEND_WRITE_UPDT_HEADER,
136        CC_SEND_WRITE_UPDT_NLINE,
137        CC_SEND_WRITE_UPDT_DATA,
138        CC_SEND_CAS_BRDCAST_HEADER,
139        CC_SEND_CAS_BRDCAST_NLINE,
140        CC_SEND_CAS_UPDT_HEADER,
141        CC_SEND_CAS_UPDT_NLINE,
142        CC_SEND_CAS_UPDT_DATA,
143        CC_SEND_CAS_UPDT_DATA_HIGH
144      };
145
146      /* States of the MULTI_ACK fsm */
147      enum multi_ack_fsm_state_e
148      {
149        MULTI_ACK_IDLE,
150        MULTI_ACK_UPT_LOCK,
151        MULTI_ACK_UPT_CLEAR,
152        MULTI_ACK_WRITE_RSP,
153        MULTI_ACK_CONFIG_ACK
154      };
155
156      /* States of the CONFIG fsm */
157      enum config_fsm_state_e
158      {
159        CONFIG_IDLE,
160        CONFIG_LOOP,
161        CONFIG_RSP,
162        CONFIG_DIR_REQ,
163        CONFIG_DIR_ACCESS,
164        CONFIG_DIR_IVT_LOCK,
165        CONFIG_BC_SEND,
166        CONFIG_BC_WAIT,
167        CONFIG_INV_SEND,
168        CONFIG_HEAP_REQ,
169        CONFIG_HEAP_SCAN,
170        CONFIG_HEAP_LAST,
171        CONFIG_INV_WAIT
172      };
173
174      /* States of the READ fsm */
175      enum read_fsm_state_e
176      {
177        READ_IDLE,
178        READ_DIR_REQ,
179        READ_DIR_LOCK,
180        READ_DIR_HIT,
181        READ_HEAP_REQ,
182        READ_HEAP_LOCK,
183        READ_HEAP_WRITE,
184        READ_HEAP_ERASE,
185        READ_HEAP_LAST,
186        READ_RSP,
187        READ_TRT_LOCK,
188        READ_TRT_SET,
189        READ_TRT_REQ
190      };
191
192      /* States of the WRITE fsm */
193      enum write_fsm_state_e
194      {
195        WRITE_IDLE,
196        WRITE_NEXT,
197        WRITE_DIR_REQ,
198        WRITE_DIR_LOCK,
199        WRITE_DIR_READ,
200        WRITE_DIR_HIT,
201        WRITE_UPT_LOCK,
202        WRITE_UPT_HEAP_LOCK,
203        WRITE_UPT_REQ,
204        WRITE_UPT_NEXT,
205        WRITE_UPT_DEC,
206        WRITE_RSP,
207        WRITE_MISS_TRT_LOCK,
208        WRITE_MISS_TRT_DATA,
209        WRITE_MISS_TRT_SET,
210        WRITE_MISS_XRAM_REQ,
211        WRITE_BC_TRT_LOCK,
212        WRITE_BC_IVT_LOCK,
213        WRITE_BC_DIR_INVAL,
214        WRITE_BC_CC_SEND,
215        WRITE_BC_XRAM_REQ,
216        WRITE_WAIT
217      };
218
219      /* States of the IXR_RSP fsm */
220      enum ixr_rsp_fsm_state_e
221      {
222        IXR_RSP_IDLE,
223        IXR_RSP_ACK,
224        IXR_RSP_TRT_ERASE,
225        IXR_RSP_TRT_READ
226      };
227
228      /* States of the XRAM_RSP fsm */
229      enum xram_rsp_fsm_state_e
230      {
231        XRAM_RSP_IDLE,
232        XRAM_RSP_TRT_COPY,
233        XRAM_RSP_TRT_DIRTY,
234        XRAM_RSP_DIR_LOCK,
235        XRAM_RSP_DIR_UPDT,
236        XRAM_RSP_DIR_RSP,
237        XRAM_RSP_INVAL_LOCK,
238        XRAM_RSP_INVAL_WAIT,
239        XRAM_RSP_INVAL,
240        XRAM_RSP_WRITE_DIRTY,
241        XRAM_RSP_HEAP_REQ,
242        XRAM_RSP_HEAP_ERASE,
243        XRAM_RSP_HEAP_LAST,
244        XRAM_RSP_ERROR_ERASE,
245        XRAM_RSP_ERROR_RSP
246      };
247
248      /* States of the IXR_CMD fsm */
249      enum ixr_cmd_fsm_state_e
250      {
251        IXR_CMD_READ_IDLE,
252        IXR_CMD_WRITE_IDLE,
253        IXR_CMD_CAS_IDLE,
254        IXR_CMD_XRAM_IDLE,
255        IXR_CMD_CLEANUP_IDLE,
256        IXR_CMD_TRT_LOCK,
257        IXR_CMD_READ,
258        IXR_CMD_WRITE,
259        IXR_CMD_CAS,
260        IXR_CMD_XRAM,
261        IXR_CMD_CLEANUP_DATA
262      };
263
264      /* States of the CAS fsm */
265      enum cas_fsm_state_e
266      {
267        CAS_IDLE,
268        CAS_DIR_REQ,
269        CAS_DIR_LOCK,
270        CAS_DIR_HIT_READ,
271        CAS_DIR_HIT_COMPARE,
272        CAS_DIR_HIT_WRITE,
273        CAS_UPT_LOCK,
274        CAS_UPT_HEAP_LOCK,
275        CAS_UPT_REQ,
276        CAS_UPT_NEXT,
277        CAS_BC_TRT_LOCK,
278        CAS_BC_IVT_LOCK,
279        CAS_BC_DIR_INVAL,
280        CAS_BC_CC_SEND,
281        CAS_BC_XRAM_REQ,
282        CAS_RSP_FAIL,
283        CAS_RSP_SUCCESS,
284        CAS_MISS_TRT_LOCK,
285        CAS_MISS_TRT_SET,
286        CAS_MISS_XRAM_REQ,
287        CAS_WAIT
288      };
289
290      /* States of the CLEANUP fsm */
291      enum cleanup_fsm_state_e
292      {
293        CLEANUP_IDLE,
294        CLEANUP_GET_NLINE,
295        CLEANUP_GET_DATA,
296        CLEANUP_DIR_REQ,
297        CLEANUP_DIR_LOCK,
298        CLEANUP_DIR_WRITE,
299        CLEANUP_HEAP_REQ,
300        CLEANUP_HEAP_LOCK,
301        CLEANUP_HEAP_SEARCH,
302        CLEANUP_HEAP_CLEAN,
303        CLEANUP_HEAP_FREE,
304        CLEANUP_IVT_LOCK,
305        CLEANUP_IVT_DECREMENT,
306        CLEANUP_IVT_CLEAR,
307        CLEANUP_WRITE_RSP,
308        CLEANUP_CONFIG_ACK,
309        CLEANUP_IXR_REQ,
310        CLEANUP_WAIT,
311        CLEANUP_SEND_CLACK
312      };
313
314      /* States of the ALLOC_DIR fsm */
315      enum alloc_dir_fsm_state_e
316      {
317        ALLOC_DIR_RESET,
318        ALLOC_DIR_CONFIG,
319        ALLOC_DIR_READ,
320        ALLOC_DIR_WRITE,
321        ALLOC_DIR_CAS,
322        ALLOC_DIR_CLEANUP,
323        ALLOC_DIR_XRAM_RSP
324      };
325
326      /* States of the ALLOC_TRT fsm */
327      enum alloc_trt_fsm_state_e
328      {
329        ALLOC_TRT_READ,
330        ALLOC_TRT_WRITE,
331        ALLOC_TRT_CAS,
332        ALLOC_TRT_XRAM_RSP,
333        ALLOC_TRT_IXR_RSP,
334        ALLOC_TRT_CLEANUP,
335        ALLOC_TRT_IXR_CMD
336      };
337
338      /* States of the ALLOC_UPT fsm */
339      enum alloc_upt_fsm_state_e
340      {
341        ALLOC_UPT_WRITE,
342        ALLOC_UPT_CAS,
343        ALLOC_UPT_MULTI_ACK
344      };
345
346      /* States of the ALLOC_IVT fsm */
347      enum alloc_ivt_fsm_state_e
348      {
349        ALLOC_IVT_WRITE,
350        ALLOC_IVT_XRAM_RSP,
351        ALLOC_IVT_CLEANUP,
352        ALLOC_IVT_CAS,
353        ALLOC_IVT_CONFIG
354      };
355
356      /* States of the ALLOC_HEAP fsm */
357      enum alloc_heap_fsm_state_e
358      {
359        ALLOC_HEAP_RESET,
360        ALLOC_HEAP_READ,
361        ALLOC_HEAP_WRITE,
362        ALLOC_HEAP_CAS,
363        ALLOC_HEAP_CLEANUP,
364        ALLOC_HEAP_XRAM_RSP,
365        ALLOC_HEAP_CONFIG
366      };
367
368      /* transaction type, pktid field */
369      enum transaction_type_e
370      {
371          // b3 unused
372          // b2 READ / NOT READ
373          // Si READ
374          //  b1 DATA / INS
375          //  b0 UNC / MISS
376          // Si NOT READ
377          //  b1 accÚs table llsc type SW / other
378          //  b2 WRITE/CAS/LL/SC
379          TYPE_READ_DATA_UNC          = 0x0,
380          TYPE_READ_DATA_MISS         = 0x1,
381          TYPE_READ_INS_UNC           = 0x2,
382          TYPE_READ_INS_MISS          = 0x3,
383          TYPE_WRITE                  = 0x4,
384          TYPE_CAS                    = 0x5,
385          TYPE_LL                     = 0x6,
386          TYPE_SC                     = 0x7
387      };
388
389      /* SC return values */
390      enum sc_status_type_e
391      {
392          SC_SUCCESS  =   0x00000000,
393          SC_FAIL     =   0x00000001
394      };
395
396      /* Configuration commands */
397      enum cmd_config_type_e
398      {
399          CMD_CONFIG_INVAL = 0,
400          CMD_CONFIG_SYNC  = 1
401      };
402
403      // debug variables (for each FSM)
404      bool                 m_debug;
405      bool                 m_debug_previous_valid;
406      size_t               m_debug_previous_count;
407      bool                 m_debug_previous_dirty;
408      sc_signal<data_t>*   m_debug_previous_data;
409      sc_signal<data_t>*   m_debug_data;
410
411      bool         m_monitor_ok;
412      addr_t       m_monitor_base;
413      addr_t       m_monitor_length;
414
415      // instrumentation counters
416      uint32_t     m_cpt_cycles;        // Counter of cycles
417
418      uint32_t     m_cpt_read;          // Number of READ transactions
419      uint32_t     m_cpt_read_remote;   // number of remote READ transactions
420      uint32_t     m_cpt_read_flits;    // number of flits for READs
421      uint32_t     m_cpt_read_cost;     // Number of (flits * distance) for READs
422
423      uint32_t     m_cpt_read_miss;     // Number of MISS READ
424
425      uint32_t     m_cpt_write;         // Number of WRITE transactions
426      uint32_t     m_cpt_write_remote;  // number of remote WRITE transactions
427      uint32_t     m_cpt_write_flits;   // number of flits for WRITEs
428      uint32_t     m_cpt_write_cost;    // Number of (flits * distance) for WRITEs
429
430      uint32_t     m_cpt_write_miss;    // Number of MISS WRITE
431      uint32_t     m_cpt_write_cells;   // Cumulated length for WRITE transactions
432      uint32_t     m_cpt_write_dirty;   // Cumulated length for WRITE transactions
433      uint32_t     m_cpt_update;        // Number of UPDATE transactions
434      uint32_t     m_cpt_trt_rb;        // Read blocked by a hit in trt
435      uint32_t     m_cpt_trt_full;      // Transaction blocked due to a full trt
436      uint32_t     m_cpt_update_mult;   // Number of targets for UPDATE
437      uint32_t     m_cpt_inval;         // Number of INVAL  transactions
438      uint32_t     m_cpt_inval_mult;    // Number of targets for INVAL
439      uint32_t     m_cpt_inval_brdcast; // Number of BROADCAST INVAL
440      uint32_t     m_cpt_cleanup;       // Number of CLEANUP transactions
441      uint32_t     m_cpt_cleanup_data;  // Number of CLEANUP WITH DATA transactions
442      uint32_t     m_cpt_ll;            // Number of LL transactions
443      uint32_t     m_cpt_sc;            // Number of SC transactions
444      uint32_t     m_cpt_cas;           // Number of CAS transactions
445     
446      uint32_t     m_cpt_read_fsm_dir_lock;        // wait DIR LOCK
447      uint32_t     m_cpt_read_fsm_n_dir_lock;      // NB DIR LOCK
448      uint32_t     m_cpt_write_fsm_dir_lock;       // wait DIR LOCK
449      uint32_t     m_cpt_write_fsm_n_dir_lock;     // NB DIR LOCK
450      uint32_t     m_cpt_xram_rsp_fsm_dir_lock;    // wait DIR LOCK
451      uint32_t     m_cpt_xram_rsp_fsm_n_dir_lock;  // NB DIR LOCK
452      uint32_t     m_cpt_cas_fsm_dir_lock;         // wait DIR LOCK
453      uint32_t     m_cpt_cas_fsm_n_dir_lock;       // NB DIR LOCK
454      uint32_t     m_cpt_cleanup_fsm_dir_lock;     // wait DIR LOCK
455      uint32_t     m_cpt_cleanup_fsm_n_dir_lock;   // NB DIR LOCK
456     
457      uint32_t     m_cpt_dir_unused;            // NB cycles DIR LOCK unused
458      uint32_t     m_cpt_read_fsm_dir_used;     // NB cycles DIR LOCK used
459      uint32_t     m_cpt_write_fsm_dir_used;    // NB cycles DIR LOCK used
460      uint32_t     m_cpt_cas_fsm_dir_used;      // NB cycles DIR LOCK used
461      uint32_t     m_cpt_xram_rsp_fsm_dir_used; // NB cycles DIR LOCK used
462      uint32_t     m_cpt_cleanup_fsm_dir_used;  // NB cycles DIR LOCK used
463
464      uint32_t     m_cpt_read_fsm_trt_lock;      // wait TRT LOCK
465      uint32_t     m_cpt_write_fsm_trt_lock;     // wait TRT LOCK
466      uint32_t     m_cpt_cas_fsm_trt_lock;       // wait TRT LOCK
467      uint32_t     m_cpt_xram_rsp_fsm_trt_lock;  // wait TRT LOCK
468      uint32_t     m_cpt_ixr_fsm_trt_lock;       // wait TRT LOCK
469     
470      uint32_t     m_cpt_read_fsm_n_trt_lock;      // NB TRT LOCK
471      uint32_t     m_cpt_write_fsm_n_trt_lock;     // NB TRT LOCK
472      uint32_t     m_cpt_cas_fsm_n_trt_lock;       // NB TRT LOCK
473      uint32_t     m_cpt_xram_rsp_fsm_n_trt_lock;  // NB TRT LOCK
474      uint32_t     m_cpt_ixr_fsm_n_trt_lock;       // NB TRT LOCK
475
476      uint32_t     m_cpt_read_fsm_trt_used;      // NB cycles TRT LOCK used
477      uint32_t     m_cpt_write_fsm_trt_used;     // NB cycles TRT LOCK used
478      uint32_t     m_cpt_cas_fsm_trt_used;       // NB cycles TRT LOCK used
479      uint32_t     m_cpt_xram_rsp_fsm_trt_used;  // NB cycles TRT LOCK used
480      uint32_t     m_cpt_ixr_fsm_trt_used;       // NB cycles TRT LOCK used
481     
482      uint32_t     m_cpt_trt_unused;            // NB cycles TRT LOCK unused
483
484      uint32_t     m_cpt_write_fsm_upt_lock;     // wait UPT LOCK
485      uint32_t     m_cpt_xram_rsp_fsm_upt_lock;  // wait UPT LOCK
486      uint32_t     m_cpt_multi_ack_fsm_upt_lock; // wait UPT LOCK
487      uint32_t     m_cpt_cleanup_fsm_upt_lock;   // wait UPT LOCK
488      uint32_t     m_cpt_cas_fsm_upt_lock;       // wait UPT LOCK
489     
490      uint32_t     m_cpt_write_fsm_n_upt_lock;     // NB UPT LOCK
491      uint32_t     m_cpt_xram_rsp_fsm_n_upt_lock;  // NB UPT LOCK
492      uint32_t     m_cpt_multi_ack_fsm_n_upt_lock; // NB UPT LOCK
493      uint32_t     m_cpt_cleanup_fsm_n_upt_lock;   // NB UPT LOCK
494      uint32_t     m_cpt_cas_fsm_n_upt_lock;       // NB UPT LOCK
495     
496      uint32_t     m_cpt_write_fsm_upt_used;     // NB cycles UPT LOCK used
497      uint32_t     m_cpt_xram_rsp_fsm_upt_used;  // NB cycles UPT LOCK used
498      uint32_t     m_cpt_multi_ack_fsm_upt_used; // NB cycles UPT LOCK used
499      uint32_t     m_cpt_cleanup_fsm_upt_used;   // NB cycles UPT LOCK used
500      uint32_t     m_cpt_cas_fsm_upt_used;       // NB cycles UPT LOCK used
501     
502      uint32_t     m_cpt_ivt_unused;            // NB cycles UPT LOCK unused
503
504      uint32_t     m_cpt_read_fsm_heap_lock;     // wait HEAP LOCK
505      uint32_t     m_cpt_write_fsm_heap_lock;    // wait HEAP LOCK
506      uint32_t     m_cpt_cas_fsm_heap_lock;      // wait HEAP LOCK
507      uint32_t     m_cpt_cleanup_fsm_heap_lock;  // wait HEAP LOCK
508      uint32_t     m_cpt_xram_rsp_fsm_heap_lock; // wait HEAP LOCK
509     
510      uint32_t     m_cpt_read_fsm_n_heap_lock;     // NB HEAP LOCK
511      uint32_t     m_cpt_write_fsm_n_heap_lock;    // NB HEAP LOCK
512      uint32_t     m_cpt_cas_fsm_n_heap_lock;      // NB HEAP LOCK
513      uint32_t     m_cpt_cleanup_fsm_n_heap_lock;  // NB HEAP LOCK
514      uint32_t     m_cpt_xram_rsp_fsm_n_heap_lock; // NB HEAP LOCK
515     
516      uint32_t     m_cpt_read_fsm_heap_used;     // NB cycles HEAP LOCK used
517      uint32_t     m_cpt_write_fsm_heap_used;    // NB cycles HEAP LOCK used
518      uint32_t     m_cpt_cas_fsm_heap_used;      // NB cycles HEAP LOCK used
519      uint32_t     m_cpt_cleanup_fsm_heap_used;  // NB cycles HEAP LOCK used
520      uint32_t     m_cpt_xram_rsp_fsm_heap_used; // NB cycles HEAP LOCK used
521     
522      uint32_t     m_cpt_heap_unused;            // NB cycles HEAP LOCK unused
523
524      uint32_t     m_cpt_cleanup_cost;  // Number of (flits * distance) for CLEANUPs
525
526      uint32_t     m_cpt_update_flits;  // Number of flits for UPDATEs
527      uint32_t     m_cpt_update_cost;   // Number of (flits * distance) for UPDATEs
528
529      uint32_t     m_cpt_inval_cost;    // Number of (flits * distance) for INVALs
530
531      uint32_t     m_cpt_get;
532
533      uint32_t     m_cpt_put;
534
535      size_t       m_prev_count;
536
537      protected:
538
539      SC_HAS_PROCESS(VciMemCache);
540
541      public:
542      sc_in<bool>                                 p_clk;
543      sc_in<bool>                                 p_resetn;
544      soclib::caba::VciTarget<vci_param_int>      p_vci_tgt;
545      soclib::caba::VciInitiator<vci_param_ext>   p_vci_ixr;
546      soclib::caba::DspinInput<dspin_in_width>    p_dspin_p2m;
547      soclib::caba::DspinOutput<dspin_out_width>  p_dspin_m2p;
548      soclib::caba::DspinOutput<dspin_out_width>  p_dspin_clack;
549
550      VciMemCache(
551          sc_module_name name,                                // Instance Name
552          const soclib::common::MappingTable &mtp,            // Mapping table INT network
553          const soclib::common::MappingTable &mtx,            // Mapping table RAM network
554          const soclib::common::IntTab       &srcid_x,        // global index RAM network
555          const soclib::common::IntTab       &tgtid_d,        // global index INT network
556          const size_t                       cc_global_id,    // global index CC network
557          const size_t                       nways,           // Number of ways per set
558          const size_t                       nsets,           // Number of sets
559          const size_t                       nwords,          // Number of words per line
560          const size_t                       max_copies,      // max number of copies
561          const size_t                       heap_size=HEAP_ENTRIES,
562          const size_t                       trt_lines=TRT_ENTRIES, 
563          const size_t                       upt_lines=UPT_ENTRIES,     
564          const size_t                       ivt_lines=IVT_ENTRIES,     
565          const size_t                       debug_start_cycle=0,
566          const bool                         debug_ok=false );
567
568      ~VciMemCache();
569
570      void clear_stats();
571      void print_stats();
572      void print_trace();
573      void cache_monitor(addr_t addr);
574      void start_monitor(addr_t addr, addr_t length);
575      void stop_monitor();
576
577      private:
578
579      void transition();
580      void genMoore();
581      void check_monitor(addr_t addr, data_t data, bool read);
582
583      // Component attributes
584      std::list<soclib::common::Segment> m_seglist;          // segments allocated
585      size_t                             m_nseg;             // number of segments
586      soclib::common::Segment            **m_seg;            // array of segments pointers
587      size_t                             m_seg_config;       // config segment index
588      const size_t                       m_srcid_x;          // global index on RAM network
589      const size_t                       m_initiators;       // Number of initiators
590      const size_t                       m_heap_size;        // Size of the heap
591      const size_t                       m_ways;             // Number of ways in a set
592      const size_t                       m_sets;             // Number of cache sets
593      const size_t                       m_words;            // Number of words in a line
594      const size_t                       m_cc_global_id;     // global_index on cc network
595      size_t                             m_debug_start_cycle;
596      bool                               m_debug_ok;
597      uint32_t                           m_trt_lines;
598      TransactionTab                     m_trt;              // xram transaction table
599      uint32_t                           m_upt_lines;
600      UpdateTab                          m_upt;              // pending update
601      UpdateTab                          m_ivt;              // pending invalidate
602      CacheDirectory                     m_cache_directory;  // data cache directory
603      CacheData                          m_cache_data;       // data array[set][way][word]
604      HeapDirectory                      m_heap;             // heap for copies
605      size_t                             m_max_copies;       // max number of copies in heap
606      GenericLLSCGlobalTable
607      < 32  ,    // number of slots
608        4096,    // number of processors in the system
609        8000,    // registration life (# of LL operations)
610        addr_t >                         m_llsc_table;       // ll/sc registration table
611
612      // adress masks
613      const soclib::common::AddressMaskingTable<addr_t>   m_x;
614      const soclib::common::AddressMaskingTable<addr_t>   m_y;
615      const soclib::common::AddressMaskingTable<addr_t>   m_z;
616      const soclib::common::AddressMaskingTable<addr_t>   m_nline;
617
618      // broadcast address
619      uint32_t                           m_broadcast_boundaries;
620
621      //////////////////////////////////////////////////
622      // Registers controlled by the TGT_CMD fsm
623      //////////////////////////////////////////////////
624
625      sc_signal<int>         r_tgt_cmd_fsm;
626
627      // Fifo between TGT_CMD fsm and READ fsm
628      GenericFifo<addr_t>    m_cmd_read_addr_fifo;
629      GenericFifo<size_t>    m_cmd_read_length_fifo;
630      GenericFifo<size_t>    m_cmd_read_srcid_fifo;
631      GenericFifo<size_t>    m_cmd_read_trdid_fifo;
632      GenericFifo<size_t>    m_cmd_read_pktid_fifo;
633
634      // Fifo between TGT_CMD fsm and WRITE fsm
635      GenericFifo<addr_t>    m_cmd_write_addr_fifo;
636      GenericFifo<bool>      m_cmd_write_eop_fifo;
637      GenericFifo<size_t>    m_cmd_write_srcid_fifo;
638      GenericFifo<size_t>    m_cmd_write_trdid_fifo;
639      GenericFifo<size_t>    m_cmd_write_pktid_fifo;
640      GenericFifo<data_t>    m_cmd_write_data_fifo;
641      GenericFifo<be_t>      m_cmd_write_be_fifo;
642
643      // Fifo between TGT_CMD fsm and CAS fsm
644      GenericFifo<addr_t>    m_cmd_cas_addr_fifo;
645      GenericFifo<bool>      m_cmd_cas_eop_fifo;
646      GenericFifo<size_t>    m_cmd_cas_srcid_fifo;
647      GenericFifo<size_t>    m_cmd_cas_trdid_fifo;
648      GenericFifo<size_t>    m_cmd_cas_pktid_fifo;
649      GenericFifo<data_t>    m_cmd_cas_wdata_fifo;
650
651      // Fifo between CC_RECEIVE fsm and CLEANUP fsm
652      GenericFifo<uint64_t>  m_cc_receive_to_cleanup_fifo;
653     
654      // Fifo between CC_RECEIVE fsm and MULTI_ACK fsm
655      GenericFifo<uint64_t>  m_cc_receive_to_multi_ack_fifo;
656
657      // Buffer between TGT_CMD fsm and TGT_RSP fsm
658      // (segmentation violation response request)
659      sc_signal<bool>     r_tgt_cmd_to_tgt_rsp_req;
660
661      sc_signal<uint32_t> r_tgt_cmd_to_tgt_rsp_rdata;
662      sc_signal<size_t>   r_tgt_cmd_to_tgt_rsp_error;
663      sc_signal<size_t>   r_tgt_cmd_to_tgt_rsp_srcid;
664      sc_signal<size_t>   r_tgt_cmd_to_tgt_rsp_trdid;
665      sc_signal<size_t>   r_tgt_cmd_to_tgt_rsp_pktid;
666
667      sc_signal<addr_t>   r_tgt_cmd_config_addr;
668      sc_signal<size_t>   r_tgt_cmd_config_cmd;
669
670      ///////////////////////////////////////////////////////
671      // Registers controlled by the CONFIG fsm
672      ///////////////////////////////////////////////////////
673
674      sc_signal<int>      r_config_fsm;            // FSM state
675      sc_signal<bool>     r_config_lock;           // lock protecting exclusive access
676      sc_signal<int>      r_config_cmd;            // config request status
677      sc_signal<addr_t>   r_config_address;        // target buffer physical address
678      sc_signal<size_t>   r_config_srcid;          // config request srcid
679      sc_signal<size_t>   r_config_trdid;          // config request trdid
680      sc_signal<size_t>   r_config_pktid;          // config request pktid
681      sc_signal<size_t>   r_config_nlines;         // number of lines covering the buffer
682      sc_signal<size_t>   r_config_dir_way;        // DIR: selected way
683      sc_signal<size_t>   r_config_dir_count;      // DIR: number of copies
684      sc_signal<bool>     r_config_dir_is_cnt;     // DIR: counter mode (broadcast required)
685      sc_signal<size_t>   r_config_dir_copy_srcid; // DIR: first copy SRCID
686      sc_signal<bool>     r_config_dir_copy_inst;  // DIR: first copy L1 type
687      sc_signal<size_t>   r_config_dir_next_ptr;   // DIR: index of next copy in HEAP
688      sc_signal<size_t>   r_config_heap_next;      // current pointer to scan HEAP
689
690      sc_signal<size_t>   r_config_ivt_index;      // IVT index
691
692      // Buffer between CONFIG fsm and TGT_RSP fsm (send a done response to L1 cache)
693      sc_signal<bool>     r_config_to_tgt_rsp_req;    // valid request
694      sc_signal<bool>     r_config_to_tgt_rsp_error;  // error response
695      sc_signal<size_t>   r_config_to_tgt_rsp_srcid;  // Transaction srcid
696      sc_signal<size_t>   r_config_to_tgt_rsp_trdid;  // Transaction trdid
697      sc_signal<size_t>   r_config_to_tgt_rsp_pktid;  // Transaction pktid
698
699      // Buffer between CONFIG fsm and CC_SEND fsm (multi-inval / broadcast-inval)
700      sc_signal<bool>     r_config_to_cc_send_multi_req;    // multi-inval request
701      sc_signal<bool>     r_config_to_cc_send_brdcast_req;  // broadcast-inval request
702      sc_signal<addr_t>   r_config_to_cc_send_nline;        // line index
703      sc_signal<size_t>   r_config_to_cc_send_trdid;        // UPT index
704      GenericFifo<bool>   m_config_to_cc_send_inst_fifo;    // fifo for the L1 type
705      GenericFifo<size_t> m_config_to_cc_send_srcid_fifo;   // fifo for owners srcid
706
707#if L1_MULTI_CACHE
708      GenericFifo<size_t> m_config_to_cc_send_cache_id_fifo; // fifo for cache_id
709#endif
710
711      ///////////////////////////////////////////////////////
712      // Registers controlled by the READ fsm
713      ///////////////////////////////////////////////////////
714
715      sc_signal<int>      r_read_fsm;          // FSM state
716      sc_signal<size_t>   r_read_copy;         // Srcid of the first copy
717      sc_signal<size_t>   r_read_copy_cache;   // Srcid of the first copy
718      sc_signal<bool>     r_read_copy_inst;    // Type of the first copy
719      sc_signal<tag_t>    r_read_tag;          // cache line tag (in directory)
720      sc_signal<bool>     r_read_is_cnt;       // is_cnt bit (in directory)
721      sc_signal<bool>     r_read_lock;         // lock bit (in directory)
722      sc_signal<bool>     r_read_dirty;        // dirty bit (in directory)
723      sc_signal<size_t>   r_read_count;        // number of copies
724      sc_signal<size_t>   r_read_ptr;          // pointer to the heap
725      sc_signal<data_t> * r_read_data;         // data (one cache line)
726      sc_signal<size_t>   r_read_way;          // associative way (in cache)
727      sc_signal<size_t>   r_read_trt_index;    // Transaction Table index
728      sc_signal<size_t>   r_read_next_ptr;     // Next entry to point to
729      sc_signal<bool>     r_read_last_free;    // Last free entry
730      sc_signal<addr_t>   r_read_ll_key;       // LL key from the llsc_global_table
731
732      // Buffer between READ fsm and IXR_CMD fsm (ask a missing cache line to XRAM)
733      sc_signal<bool>     r_read_to_ixr_cmd_req;    // valid request
734      sc_signal<addr_t>   r_read_to_ixr_cmd_nline;  // cache line index
735      sc_signal<size_t>   r_read_to_ixr_cmd_trdid;  // index in Transaction Table
736
737      // Buffer between READ fsm and TGT_RSP fsm (send a hit read response to L1 cache)
738      sc_signal<bool>     r_read_to_tgt_rsp_req;    // valid request
739      sc_signal<size_t>   r_read_to_tgt_rsp_srcid;  // Transaction srcid
740      sc_signal<size_t>   r_read_to_tgt_rsp_trdid;  // Transaction trdid
741      sc_signal<size_t>   r_read_to_tgt_rsp_pktid;  // Transaction pktid
742      sc_signal<data_t> * r_read_to_tgt_rsp_data;   // data (one cache line)
743      sc_signal<size_t>   r_read_to_tgt_rsp_word;   // first word of the response
744      sc_signal<size_t>   r_read_to_tgt_rsp_length; // length of the response
745      sc_signal<addr_t>   r_read_to_tgt_rsp_ll_key; // LL key from the llsc_global_table
746
747      ///////////////////////////////////////////////////////////////
748      // Registers controlled by the WRITE fsm
749      ///////////////////////////////////////////////////////////////
750
751      sc_signal<int>      r_write_fsm;        // FSM state
752      sc_signal<addr_t>   r_write_address;    // first word address
753      sc_signal<size_t>   r_write_word_index; // first word index in line
754      sc_signal<size_t>   r_write_word_count; // number of words in line
755      sc_signal<size_t>   r_write_srcid;      // transaction srcid
756      sc_signal<size_t>   r_write_trdid;      // transaction trdid
757      sc_signal<size_t>   r_write_pktid;      // transaction pktid
758      sc_signal<data_t> * r_write_data;       // data (one cache line)
759      sc_signal<be_t>   * r_write_be;         // one byte enable per word
760      sc_signal<bool>     r_write_byte;       // (BE != 0X0) and (BE != 0xF)
761      sc_signal<bool>     r_write_is_cnt;     // is_cnt bit (in directory)
762      sc_signal<bool>     r_write_lock;       // lock bit (in directory)
763      sc_signal<tag_t>    r_write_tag;        // cache line tag (in directory)
764      sc_signal<size_t>   r_write_copy;       // first owner of the line
765      sc_signal<size_t>   r_write_copy_cache; // first owner of the line
766      sc_signal<bool>     r_write_copy_inst;  // is this owner a ICache ?
767      sc_signal<size_t>   r_write_count;      // number of copies
768      sc_signal<size_t>   r_write_ptr;        // pointer to the heap
769      sc_signal<size_t>   r_write_next_ptr;   // next pointer to the heap
770      sc_signal<bool>     r_write_to_dec;     // need to decrement update counter
771      sc_signal<size_t>   r_write_way;        // way of the line
772      sc_signal<size_t>   r_write_trt_index;  // index in Transaction Table
773      sc_signal<size_t>   r_write_upt_index;  // index in Update Table
774      sc_signal<bool>     r_write_sc_fail;    // sc command failed
775      sc_signal<bool>     r_write_pending_sc; // sc command pending
776
777      // Buffer between WRITE fsm and TGT_RSP fsm (acknowledge a write command from L1)
778      sc_signal<bool>     r_write_to_tgt_rsp_req;     // valid request
779      sc_signal<size_t>   r_write_to_tgt_rsp_srcid;   // transaction srcid
780      sc_signal<size_t>   r_write_to_tgt_rsp_trdid;   // transaction trdid
781      sc_signal<size_t>   r_write_to_tgt_rsp_pktid;   // transaction pktid
782      sc_signal<bool>     r_write_to_tgt_rsp_sc_fail; // sc command failed
783
784      // Buffer between WRITE fsm and IXR_CMD fsm (ask a missing cache line to XRAM)
785      sc_signal<bool>     r_write_to_ixr_cmd_req;   // valid request
786      sc_signal<bool>     r_write_to_ixr_cmd_write; // write request
787      sc_signal<addr_t>   r_write_to_ixr_cmd_nline; // cache line index
788      sc_signal<data_t> * r_write_to_ixr_cmd_data;  // cache line data
789      sc_signal<size_t>   r_write_to_ixr_cmd_trdid; // index in Transaction Table
790
791      // Buffer between WRITE fsm and CC_SEND fsm (Update/Invalidate L1 caches)
792      sc_signal<bool>     r_write_to_cc_send_multi_req;     // valid multicast request
793      sc_signal<bool>     r_write_to_cc_send_brdcast_req;   // valid brdcast request
794      sc_signal<addr_t>   r_write_to_cc_send_nline;         // cache line index
795      sc_signal<size_t>   r_write_to_cc_send_trdid;         // index in Update Table
796      sc_signal<data_t> * r_write_to_cc_send_data;          // data (one cache line)
797      sc_signal<be_t>   * r_write_to_cc_send_be;            // word enable
798      sc_signal<size_t>   r_write_to_cc_send_count;         // number of words in line
799      sc_signal<size_t>   r_write_to_cc_send_index;         // index of first word in line
800      GenericFifo<bool>   m_write_to_cc_send_inst_fifo;     // fifo for the L1 type
801      GenericFifo<size_t> m_write_to_cc_send_srcid_fifo;    // fifo for srcids
802
803#if L1_MULTI_CACHE
804      GenericFifo<size_t> m_write_to_cc_send_cache_id_fifo; // fifo for srcids
805#endif
806
807      // Buffer between WRITE fsm and MULTI_ACK fsm (Decrement UPT entry)
808      sc_signal<bool>     r_write_to_multi_ack_req;       // valid request
809      sc_signal<size_t>   r_write_to_multi_ack_upt_index; // index in update table
810
811      /////////////////////////////////////////////////////////
812      // Registers controlled by MULTI_ACK fsm
813      //////////////////////////////////////////////////////////
814
815      sc_signal<int>      r_multi_ack_fsm;       // FSM state
816      sc_signal<size_t>   r_multi_ack_upt_index; // index in the Update Table
817      sc_signal<size_t>   r_multi_ack_srcid;     // pending write srcid
818      sc_signal<size_t>   r_multi_ack_trdid;     // pending write trdid
819      sc_signal<size_t>   r_multi_ack_pktid;     // pending write pktid
820      sc_signal<addr_t>   r_multi_ack_nline;     // pending write nline
821
822      // signaling completion of multi-inval to CONFIG fsm
823      sc_signal<bool>     r_multi_ack_to_config_ack; 
824
825      // Buffer between MULTI_ACK fsm and TGT_RSP fsm (complete write/update transaction)
826      sc_signal<bool>     r_multi_ack_to_tgt_rsp_req;   // valid request
827      sc_signal<size_t>   r_multi_ack_to_tgt_rsp_srcid; // Transaction srcid
828      sc_signal<size_t>   r_multi_ack_to_tgt_rsp_trdid; // Transaction trdid
829      sc_signal<size_t>   r_multi_ack_to_tgt_rsp_pktid; // Transaction pktid
830
831      ///////////////////////////////////////////////////////
832      // Registers controlled by CLEANUP fsm
833      ///////////////////////////////////////////////////////
834
835      sc_signal<int>      r_cleanup_fsm;           // FSM state
836      sc_signal<size_t>   r_cleanup_srcid;         // transaction srcid
837      sc_signal<bool>     r_cleanup_inst;          // Instruction or Data ?
838      sc_signal<size_t>   r_cleanup_way_index;     // L1 Cache Way index
839      sc_signal<addr_t>   r_cleanup_nline;         // cache line index
840
841#if L1_MULTI_CACHE
842      sc_signal<size_t>   r_cleanup_pktid;         // transaction pktid
843#endif
844
845      sc_signal<copy_t>   r_cleanup_copy;          // first copy
846      sc_signal<copy_t>   r_cleanup_copy_cache;    // first copy
847      sc_signal<size_t>   r_cleanup_copy_inst;     // type of the first copy
848      sc_signal<copy_t>   r_cleanup_count;         // number of copies
849      sc_signal<size_t>   r_cleanup_ptr;           // pointer to the heap
850      sc_signal<size_t>   r_cleanup_prev_ptr;      // previous pointer to the heap
851      sc_signal<size_t>   r_cleanup_prev_srcid;    // srcid of previous heap entry
852      sc_signal<size_t>   r_cleanup_prev_cache_id; // srcid of previous heap entry
853      sc_signal<bool>     r_cleanup_prev_inst;     // inst bit of previous heap entry
854      sc_signal<size_t>   r_cleanup_next_ptr;      // next pointer to the heap
855      sc_signal<tag_t>    r_cleanup_tag;           // cache line tag (in directory)
856      sc_signal<bool>     r_cleanup_is_cnt;        // inst bit (in directory)
857      sc_signal<bool>     r_cleanup_lock;          // lock bit (in directory)
858      sc_signal<bool>     r_cleanup_dirty;         // dirty bit (in directory)
859      sc_signal<size_t>   r_cleanup_way;           // associative way (in cache)
860
861      sc_signal<size_t>   r_cleanup_write_srcid;   // srcid of write rsp
862      sc_signal<size_t>   r_cleanup_write_trdid;   // trdid of write rsp
863      sc_signal<size_t>   r_cleanup_write_pktid;   // pktid of write rsp
864
865      sc_signal<bool>     r_cleanup_need_rsp;      // write response required
866      sc_signal<bool>     r_cleanup_need_ack;      // config acknowledge required
867
868      sc_signal<size_t>   r_cleanup_index;         // index of the INVAL line (in the UPT)
869
870      // signaling completion of broadcast-inval to CONFIG fsm
871      sc_signal<bool>     r_cleanup_to_config_ack; 
872       
873      // Buffer between CLEANUP fsm and TGT_RSP fsm (acknowledge a write command from L1)
874      sc_signal<bool>     r_cleanup_to_tgt_rsp_req;   // valid request
875      sc_signal<size_t>   r_cleanup_to_tgt_rsp_srcid; // transaction srcid
876      sc_signal<size_t>   r_cleanup_to_tgt_rsp_trdid; // transaction trdid
877      sc_signal<size_t>   r_cleanup_to_tgt_rsp_pktid; // transaction pktid
878
879      ///////////////////////////////////////////////////////
880      // Registers controlled by CAS fsm
881      ///////////////////////////////////////////////////////
882
883      sc_signal<int>      r_cas_fsm;        // FSM state
884      sc_signal<data_t>   r_cas_wdata;      // write data word
885      sc_signal<data_t> * r_cas_rdata;      // read data word
886      sc_signal<uint32_t> r_cas_lfsr;       // lfsr for random introducing
887      sc_signal<size_t>   r_cas_cpt;        // size of command
888      sc_signal<copy_t>   r_cas_copy;       // Srcid of the first copy
889      sc_signal<copy_t>   r_cas_copy_cache; // Srcid of the first copy
890      sc_signal<bool>     r_cas_copy_inst;  // Type of the first copy
891      sc_signal<size_t>   r_cas_count;      // number of copies
892      sc_signal<size_t>   r_cas_ptr;        // pointer to the heap
893      sc_signal<size_t>   r_cas_next_ptr;   // next pointer to the heap
894      sc_signal<bool>     r_cas_is_cnt;     // is_cnt bit (in directory)
895      sc_signal<bool>     r_cas_dirty;      // dirty bit (in directory)
896      sc_signal<size_t>   r_cas_way;        // way in directory
897      sc_signal<size_t>   r_cas_set;        // set in directory
898      sc_signal<data_t>   r_cas_tag;        // cache line tag (in directory)
899      sc_signal<size_t>   r_cas_trt_index;  // Transaction Table index
900      sc_signal<size_t>   r_cas_upt_index;  // Update Table index
901      sc_signal<data_t> * r_cas_data;       // cache line data
902
903      // Buffer between CAS fsm and IXR_CMD fsm (XRAM write)
904      sc_signal<bool>     r_cas_to_ixr_cmd_req;   // valid request
905      sc_signal<addr_t>   r_cas_to_ixr_cmd_nline; // cache line index
906      sc_signal<size_t>   r_cas_to_ixr_cmd_trdid; // index in Transaction Table
907      sc_signal<bool>     r_cas_to_ixr_cmd_write; // write request
908      sc_signal<data_t> * r_cas_to_ixr_cmd_data;  // cache line data
909
910
911      // Buffer between CAS fsm and TGT_RSP fsm
912      sc_signal<bool>     r_cas_to_tgt_rsp_req;   // valid request
913      sc_signal<data_t>   r_cas_to_tgt_rsp_data;  // read data word
914      sc_signal<size_t>   r_cas_to_tgt_rsp_srcid; // Transaction srcid
915      sc_signal<size_t>   r_cas_to_tgt_rsp_trdid; // Transaction trdid
916      sc_signal<size_t>   r_cas_to_tgt_rsp_pktid; // Transaction pktid
917
918      // Buffer between CAS fsm and CC_SEND fsm (Update/Invalidate L1 caches)
919      sc_signal<bool>     r_cas_to_cc_send_multi_req;     // valid request
920      sc_signal<bool>     r_cas_to_cc_send_brdcast_req;   // brdcast request
921      sc_signal<addr_t>   r_cas_to_cc_send_nline;         // cache line index
922      sc_signal<size_t>   r_cas_to_cc_send_trdid;         // index in Update Table
923      sc_signal<data_t>   r_cas_to_cc_send_wdata;         // data (one word)
924      sc_signal<bool>     r_cas_to_cc_send_is_long;       // it is a 64 bits CAS
925      sc_signal<data_t>   r_cas_to_cc_send_wdata_high;    // data high (one word)
926      sc_signal<size_t>   r_cas_to_cc_send_index;         // index of the word in line
927      GenericFifo<bool>   m_cas_to_cc_send_inst_fifo;     // fifo for the L1 type
928      GenericFifo<size_t> m_cas_to_cc_send_srcid_fifo;    // fifo for srcids
929
930#if L1_MULTI_CACHE
931      GenericFifo<size_t> m_cas_to_cc_send_cache_id_fifo; // fifo for srcids
932#endif
933
934      ////////////////////////////////////////////////////
935      // Registers controlled by the IXR_RSP fsm
936      ////////////////////////////////////////////////////
937
938      sc_signal<int>      r_ixr_rsp_fsm;       // FSM state
939      sc_signal<size_t>   r_ixr_rsp_trt_index; // TRT entry index
940      sc_signal<size_t>   r_ixr_rsp_cpt;       // word counter
941
942      // Buffer between IXR_RSP fsm and XRAM_RSP fsm  (response from the XRAM)
943      sc_signal<bool>   * r_ixr_rsp_to_xram_rsp_rok; // A xram response is ready
944      sc_signal<bool>   * r_ixr_rsp_to_xram_rsp_no_coherent; // A xram response is ready and no coherent (ODCCP)
945
946      ////////////////////////////////////////////////////
947      // Registers controlled by the XRAM_RSP fsm
948      ////////////////////////////////////////////////////
949
950      sc_signal<int>      r_xram_rsp_fsm;               // FSM state
951      sc_signal<size_t>   r_xram_rsp_trt_index;         // TRT entry index
952      TransactionTabEntry r_xram_rsp_trt_buf;           // TRT entry local buffer
953      sc_signal<bool>     r_xram_rsp_victim_inval;      // victim line invalidate
954      sc_signal<bool>     r_xram_rsp_victim_coherent;   // victim line coherent
955      sc_signal<bool>     r_xram_rsp_victim_is_cnt;     // victim line inst bit
956      sc_signal<bool>     r_xram_rsp_victim_dirty;      // victim line dirty bit
957      sc_signal<size_t>   r_xram_rsp_victim_way;        // victim line way
958      sc_signal<size_t>   r_xram_rsp_victim_set;        // victim line set
959      sc_signal<addr_t>   r_xram_rsp_victim_nline;      // victim line index
960      sc_signal<copy_t>   r_xram_rsp_victim_copy;       // victim line first copy
961      sc_signal<copy_t>   r_xram_rsp_victim_copy_cache; // victim line first copy
962      sc_signal<bool>     r_xram_rsp_victim_copy_inst;  // victim line type of first copy
963      sc_signal<size_t>   r_xram_rsp_victim_count;      // victim line number of copies
964      sc_signal<size_t>   r_xram_rsp_victim_ptr;        // victim line pointer to the heap
965      sc_signal<data_t> * r_xram_rsp_victim_data;       // victim line data
966      sc_signal<size_t>   r_xram_rsp_ivt_index;         // IVT entry index
967      sc_signal<size_t>   r_xram_rsp_next_ptr;          // Next pointer to the heap
968
969      // Buffer between XRAM_RSP fsm and TGT_RSP fsm  (response to L1 cache)
970      sc_signal<bool>     r_xram_rsp_to_tgt_rsp_req;    // Valid request
971      sc_signal<size_t>   r_xram_rsp_to_tgt_rsp_srcid;  // Transaction srcid
972      sc_signal<size_t>   r_xram_rsp_to_tgt_rsp_trdid;  // Transaction trdid
973      sc_signal<size_t>   r_xram_rsp_to_tgt_rsp_pktid;  // Transaction pktid
974      sc_signal<data_t> * r_xram_rsp_to_tgt_rsp_data;   // data (one cache line)
975      sc_signal<size_t>   r_xram_rsp_to_tgt_rsp_word;   // first word index
976      sc_signal<size_t>   r_xram_rsp_to_tgt_rsp_length; // length of the response
977      sc_signal<bool>     r_xram_rsp_to_tgt_rsp_rerror; // send error to requester
978      sc_signal<addr_t>   r_xram_rsp_to_tgt_rsp_ll_key; // LL key from llsc_global_table
979
980      // Buffer between XRAM_RSP fsm and CC_SEND fsm (Inval L1 Caches)
981      sc_signal<bool>     r_xram_rsp_to_cc_send_multi_req;     // Valid request
982      sc_signal<bool>     r_xram_rsp_to_cc_send_brdcast_req;   // Broadcast request
983      sc_signal<addr_t>   r_xram_rsp_to_cc_send_nline;         // cache line index;
984      sc_signal<size_t>   r_xram_rsp_to_cc_send_trdid;         // index of UPT entry
985      GenericFifo<bool>   m_xram_rsp_to_cc_send_inst_fifo;     // fifo for the L1 type
986      GenericFifo<size_t> m_xram_rsp_to_cc_send_srcid_fifo;    // fifo for srcids
987
988#if L1_MULTI_CACHE
989      GenericFifo<size_t> m_xram_rsp_to_cc_send_cache_id_fifo; // fifo for srcids
990#endif
991
992      // Buffer between XRAM_RSP fsm and IXR_CMD fsm (XRAM write)
993      sc_signal<bool>     r_xram_rsp_to_ixr_cmd_req;   // Valid request
994      sc_signal<addr_t>   r_xram_rsp_to_ixr_cmd_nline; // cache line index
995      sc_signal<data_t> * r_xram_rsp_to_ixr_cmd_data;  // cache line data
996      sc_signal<size_t>   r_xram_rsp_to_ixr_cmd_trdid; // index in transaction table
997
998      ////////////////////////////////////////////////////
999      // Registers controlled by the IXR_CMD fsm
1000      ////////////////////////////////////////////////////
1001
1002      sc_signal<int>      r_ixr_cmd_fsm;
1003      sc_signal<size_t>   r_ixr_cmd_cpt;
1004
1005      ////////////////////////////////////////////////////
1006      // Registers controlled by TGT_RSP fsm
1007      ////////////////////////////////////////////////////
1008
1009      sc_signal<int>      r_tgt_rsp_fsm;
1010      sc_signal<size_t>   r_tgt_rsp_cpt;
1011      sc_signal<bool>     r_tgt_rsp_key_sent;
1012
1013      ////////////////////////////////////////////////////
1014      // Registers controlled by CC_SEND fsm
1015      ////////////////////////////////////////////////////
1016
1017      sc_signal<int>      r_cc_send_fsm;
1018      sc_signal<size_t>   r_cc_send_cpt;
1019      sc_signal<bool>     r_cc_send_inst;
1020
1021      ////////////////////////////////////////////////////
1022      // Registers controlled by CC_RECEIVE fsm
1023      ////////////////////////////////////////////////////
1024
1025      sc_signal<int>      r_cc_receive_fsm;
1026
1027      ////////////////////////////////////////////////////
1028      // Registers controlled by ALLOC_DIR fsm
1029      ////////////////////////////////////////////////////
1030
1031      sc_signal<int>      r_alloc_dir_fsm;
1032      sc_signal<unsigned> r_alloc_dir_reset_cpt;
1033
1034      ////////////////////////////////////////////////////
1035      // Registers controlled by ALLOC_TRT fsm
1036      ////////////////////////////////////////////////////
1037
1038      sc_signal<int>      r_alloc_trt_fsm;
1039
1040      ////////////////////////////////////////////////////
1041      // Registers controlled by ALLOC_UPT fsm
1042      ////////////////////////////////////////////////////
1043
1044      sc_signal<int>      r_alloc_upt_fsm;
1045
1046      ////////////////////////////////////////////////////
1047      // Registers controlled by ALLOC_IVT fsm
1048      ////////////////////////////////////////////////////
1049
1050      sc_signal<int>      r_alloc_ivt_fsm;
1051
1052      ////////////////////////////////////////////////////
1053      // Registers controlled by ALLOC_HEAP fsm
1054      ////////////////////////////////////////////////////
1055
1056      sc_signal<int>      r_alloc_heap_fsm;
1057      sc_signal<unsigned> r_alloc_heap_reset_cpt;
1058
1059
1060      ////////////////////////////////////////////////////
1061      // REGISTERS FOR ODCCP
1062      ////////////////////////////////////////////////////
1063
1064      sc_signal<uint32_t>  r_cleanup_data_index;
1065      sc_signal<uint32_t>  r_cleanup_trdid;
1066      sc_signal<uint32_t>  r_cleanup_pktid;
1067      sc_signal<data_t>    *r_cleanup_data;          // buffer for saving data from cleanup
1068      sc_signal<data_t>    *r_ixr_cmd_data;          // buffer for saving data from cleanup
1069      sc_signal<bool>      r_cleanup_contains_data;
1070      sc_signal<bool>      r_cleanup_ncc;
1071     
1072      sc_signal<bool>      r_xram_rsp_to_ixr_cmd_inval_ncc_pending;
1073     
1074      sc_signal<bool>      r_cleanup_to_ixr_cmd_req;
1075      sc_signal<data_t>    *r_cleanup_to_ixr_cmd_data;
1076      sc_signal<uint32_t>  r_cleanup_to_ixr_cmd_srcid;
1077      sc_signal<bool>      r_cleanup_to_ixr_cmd_l1_dirty_ncc; // this cleanup was dirty in L1
1078      sc_signal<uint32_t>  r_cleanup_to_ixr_cmd_trdid;
1079      sc_signal<uint32_t>  r_cleanup_to_ixr_cmd_pktid;
1080      sc_signal<addr_t>    r_cleanup_to_ixr_cmd_nline;
1081    }; // end class VciMemCache
1082
1083}}
1084
1085#endif
1086
1087// Local Variables:
1088// tab-width: 2
1089// c-basic-offset: 2
1090// c-file-offsets:((innamespace . 0)(inline-open . 0))
1091// indent-tabs-mode: nil
1092// End:
1093
1094// vim: filetype=cpp:expandtab:shiftwidth=2:tabstop=2:softtabstop=2
1095
Note: See TracBrowser for help on using the repository browser.