@@ -146,6 +146,23 @@ void L1_cache :: process_processor_request (cache_req *request, bool first)
146
146
147
147
DBG_L1_CACHE_TICK_ID ( cout, " ###### " << " process_processor_request(): addr= " <<hex<< request->addr <<dec<< ((request->op_type ==OpMemLd) ? " LD" : " ST" ) << " \n " );
148
148
149
+ #ifdef LIBKITFOX
150
+ if (request->op_type ==OpMemLd) {
151
+ counter.cache .read += 3 ;
152
+ counter.cache .search += 3 ;
153
+ counter.cache .read_tag += 3 ;
154
+ } else {
155
+ counter.cache .write += 3 ;
156
+ counter.cache .search += 3 ;
157
+ counter.cache .read_tag += 3 ;
158
+ counter.cache .write_tag += 3 ;
159
+ }
160
+ counter.tlb .search += 3 ;
161
+ counter.tlb .read += 3 ;
162
+ counter.tlb .write += 3 ;
163
+ counter.tlb .read_tag += 3 ;
164
+ #endif
165
+
149
166
/* * This code may be modified in the future to enable parallel events while transient (read while waiting for previous read-unblock). For the time being, just assume no parallel events for a single address */
150
167
if (mshr->has_match (request->addr ))
151
168
{
@@ -189,6 +206,17 @@ void L1_cache :: process_processor_request (cache_req *request, bool first)
189
206
if (!my_table->has_match (request->addr )) {
190
207
DBG_L1_CACHE (cout, " miss.\n " );
191
208
209
+ #ifdef LIBKITFOX
210
+ counter.missbuf .search += 3 ;
211
+ counter.missbuf .read_tag += 3 ;
212
+ counter.missbuf .write_tag += 3 ;
213
+ counter.missbuf .write += 3 ;
214
+ counter.prefetch .search += 3 ;
215
+ counter.prefetch .read_tag += 3 ;
216
+ counter.prefetch .write_tag += 3 ;
217
+ counter.prefetch .write += 3 ;
218
+ #endif
219
+
192
220
/* * Check if an invalid block exists already or the LRU block can begin eviction. */
193
221
hash_table_entry = my_table->reserve_block_for (request->addr );
194
222
@@ -200,6 +228,16 @@ void L1_cache :: process_processor_request (cache_req *request, bool first)
200
228
DBG_L1_CACHE (cout, " start eviction line= " <<hex<< my_table->get_replacement_entry (request->addr )->get_line_addr () <<dec<< " \n " );
201
229
202
230
start_eviction (mshr_entry, request);
231
+
232
+ #ifdef LIBKITFOX
233
+ counter.linefill .search += 3 ;
234
+ counter.linefill .write_tag += 3 ;
235
+ counter.linefill .write += 3 ;
236
+ counter.writeback .search += 3 ;
237
+ counter.writeback .write_tag += 3 ;
238
+ counter.writeback .write += 3 ;
239
+ #endif
240
+
203
241
}
204
242
else {
205
243
// the client for the victim is in transient, so it must have a stalled request in the
@@ -401,6 +439,24 @@ void L1_cache :: process_peer_and_manager_request(Coh_msg* request)
401
439
stall request
402
440
*/
403
441
442
+ #ifdef LIBKITFOX
443
+ if (request->rw == 0 ) {
444
+ counter.cache .read += 3 ;
445
+ counter.cache .search += 3 ;
446
+ counter.cache .read_tag += 3 ;
447
+ } else {
448
+ counter.cache .write += 3 ;
449
+ counter.cache .search += 3 ;
450
+ counter.cache .read_tag += 3 ;
451
+ counter.cache .write_tag += 3 ;
452
+ }
453
+
454
+ counter.tlb .search += 3 ;
455
+ counter.tlb .read += 3 ;
456
+ counter.tlb .write += 3 ;
457
+ counter.tlb .read_tag += 3 ;
458
+ #endif
459
+
404
460
if (request->type == Coh_msg::COH_RPLY) {
405
461
DBG_L1_CACHE (cout, " it is a reply.\n " );
406
462
0 commit comments