source: trunk/modules/vci_mem_cache/include/soclib/mem_cache.h @ 600

Last change on this file since 600 was 596, checked in by cfuguet, 11 years ago

Modification in vci_mem_cache:

  • The instrumentation registers are now accesible by software.
  • The different registers have been defined in the vci_mem_cache/include/soclib/mem_cache.h file and should be accessed using MEMC_REG(func,idx) defined also in the same file
File size: 5.4 KB
Line 
1/*
2 * SOCLIB_LGPL_HEADER_BEGIN
3 *
4 * This file is part of SoCLib, GNU LGPLv2.1.
5 *
6 * SoCLib is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; version 2.1 of the License.
9 *
10 * SoCLib is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with SoCLib; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 * SOCLIB_LGPL_HEADER_END
21 *
22 * Copyright (c) UPMC, Lip6, Asim
23 *         alain greiner
24 *
25 * Maintainers: alain
26 */
27#ifndef MEM_CACHE_REGS_H
28#define MEM_CACHE_REGS_H
29
30enum SoclibMemCacheFunc
31{
32    MEMC_CONFIG = 0,
33    MEMC_INSTRM = 1,
34
35    MEMC_FUNC_SPAN = 0x200
36};
37
38enum SoclibMemCacheConfigRegs
39{
40    MEMC_LOCK,
41    MEMC_ADDR_LO,
42    MEMC_ADDR_HI,
43    MEMC_BUF_LENGTH,
44    MEMC_CMD_TYPE
45};
46
47enum SoclibMemCacheConfigCmd
48{
49    MEMC_CMD_NOP,
50    MEMC_CMD_INVAL,
51    MEMC_CMD_SYNC
52};
53
54///////////////////////////////////////////////////////////
55//  Decoding CONFIG interface commands                   //
56//                                                       //
57//  VCI ADDRESS                                          //
58//  ================================================     //
59//  GLOBAL | LOCAL | ... | FUNC_IDX | REGS_IDX | 00      //
60//   IDX   |  IDX  |     | (3 bits) | (7 bits) |         //
61//  ================================================     //
62//                                                       //
63//  For instrumentation: FUNC_IDX = 0b001                //
64//                                                       //
65//  REGS_IDX                                             //
66//  ============================================         //
67//       Z     |    Y      |    X     |   W              //
68//    (1 bit)  | (2 bits)  | (3 bits) | (1 bit)          //
69//  ============================================         //
70//                                                       //
71//  For configuration: FUNC_IDX = 0b000                  //
72//                                                       //
73//  REGS_IDX                                             //
74//  ============================================         //
75//             RESERVED             |    X     |         //
76//             (4 bits)             | (3 bits) |         //
77//  ============================================         //
78//                                                       //
79//  X : REGISTER INDEX                                   //
80//                                                       //
81///////////////////////////////////////////////////////////
82
83enum SoclibMemCacheInstrRegs {
84    ///////////////////////////////////////////////////////
85    //          DIRECT instrumentation registers         //
86    ///////////////////////////////////////////////////////
87
88    // LOCAL
89
90    MEMC_LOCAL_READ_LO   = 0x00,
91    MEMC_LOCAL_READ_HI   = 0x01,
92    MEMC_LOCAL_WRITE_LO  = 0x02,
93    MEMC_LOCAL_WRITE_HI  = 0x03,
94    MEMC_LOCAL_LL_LO     = 0x04,
95    MEMC_LOCAL_LL_HI     = 0x05,
96    MEMC_LOCAL_SC_LO     = 0x06,
97    MEMC_LOCAL_SC_HI     = 0x07,
98    MEMC_LOCAL_CAS_LO    = 0x08,
99    MEMC_LOCAL_CAS_HI    = 0x09,
100
101    // REMOTE
102
103    MEMC_REMOTE_READ_LO  = 0x10,
104    MEMC_REMOTE_READ_HI  = 0x11,
105    MEMC_REMOTE_WRITE_LO = 0x12,
106    MEMC_REMOTE_WRITE_HI = 0x13,
107    MEMC_REMOTE_LL_LO    = 0x14,
108    MEMC_REMOTE_LL_HI    = 0x15,
109    MEMC_REMOTE_SC_LO    = 0x16,
110    MEMC_REMOTE_SC_HI    = 0x17,
111    MEMC_REMOTE_CAS_LO   = 0x18,
112    MEMC_REMOTE_CAS_HI   = 0x19,
113
114    // COST
115
116    MEMC_COST_READ_LO    = 0x20,
117    MEMC_COST_READ_HI    = 0x21,
118    MEMC_COST_WRITE_LO   = 0x22,
119    MEMC_COST_WRITE_HI   = 0x23,
120    MEMC_COST_LL_LO      = 0x24,
121    MEMC_COST_LL_HI      = 0x25,
122    MEMC_COST_SC_LO      = 0x26,
123    MEMC_COST_SC_HI      = 0x27,
124    MEMC_COST_CAS_LO     = 0x28,
125    MEMC_COST_CAS_HI     = 0x29,
126
127    ///////////////////////////////////////////////////////
128    //       COHERENCE instrumentation registers         //
129    ///////////////////////////////////////////////////////
130
131    // LOCAL
132
133    MEMC_LOCAL_MUPDATE_LO  = 0x40,
134    MEMC_LOCAL_MUPDATE_HI  = 0x41,
135    MEMC_LOCAL_MINVAL_LO   = 0x42,
136    MEMC_LOCAL_MINVAL_HI   = 0x43,
137    MEMC_LOCAL_CLEANUP_LO  = 0x44,
138    MEMC_LOCAL_CLEANUP_HI  = 0x45,
139
140    // REMOTE
141
142    MEMC_REMOTE_MUPDATE_LO = 0x50,
143    MEMC_REMOTE_MUPDATE_HI = 0x51,
144    MEMC_REMOTE_MINVAL_LO  = 0x52,
145    MEMC_REMOTE_MINVAL_HI  = 0x53,
146    MEMC_REMOTE_CLEANUP_LO = 0x54,
147    MEMC_REMOTE_CLEANUP_HI = 0x55,
148
149    // COST
150
151    MEMC_COST_MUPDATE_LO   = 0x60,
152    MEMC_COST_MUPDATE_HI   = 0x61,
153    MEMC_COST_MINVAL_LO    = 0x62,
154    MEMC_COST_MINVAL_HI    = 0x63,
155    MEMC_COST_CLEANUP_LO   = 0x64,
156    MEMC_COST_CLEANUP_HI   = 0x65,
157
158    // TOTAL
159
160    MEMC_TOTAL_MUPDATE_LO  = 0x68,
161    MEMC_TOTAL_MUPDATE_HI  = 0x69,
162    MEMC_TOTAL_MINVAL_LO   = 0x6A,
163    MEMC_TOTAL_MINVAL_HI   = 0x6B,
164    MEMC_TOTAL_BINVAL_LO   = 0x6C,
165    MEMC_TOTAL_BINVAL_HI   = 0x6D,
166};
167
168#define MEMC_REG(func,idx) ((func<<7)|idx)
169
170#endif /* MEM_CACHE_REGS_H */
171
172// Local Variables:
173// tab-width: 4
174// c-basic-offset: 4
175// c-file-offsets:((innamespace . 0)(inline-open . 0))
176// indent-tabs-mode: nil
177// End:
178
179// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
180
Note: See TracBrowser for help on using the repository browser.