1/* 2 * Copyright (c) 2004-2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 20 unchanged lines hidden (view full) --- 29 */ 30 31#include "base/intmath.hh" 32#include "base/misc.hh" 33#include "base/trace.hh" 34#include "cpu/o3/store_set.hh" 35#include "debug/StoreSet.hh" 36 |
37StoreSet::StoreSet(uint64_t clear_period, int _SSIT_size, int _LFST_size) 38 : clearPeriod(clear_period), SSITSize(_SSIT_size), LFSTSize(_LFST_size) |
39{ 40 DPRINTF(StoreSet, "StoreSet: Creating store set object.\n"); 41 DPRINTF(StoreSet, "StoreSet: SSIT size: %i, LFST size: %i.\n", 42 SSITSize, LFSTSize); 43 44 if (!isPowerOf2(SSITSize)) { 45 fatal("Invalid SSIT size!\n"); 46 } --- 16 unchanged lines hidden (view full) --- 63 for (int i = 0; i < LFSTSize; ++i) { 64 validLFST[i] = false; 65 LFST[i] = 0; 66 } 67 68 indexMask = SSITSize - 1; 69 70 offsetBits = 2; |
71 72 memOpsPred = 0; |
73} 74 75StoreSet::~StoreSet() 76{ 77} 78 79void |
80StoreSet::init(uint64_t clear_period, int _SSIT_size, int _LFST_size) |
81{ 82 SSITSize = _SSIT_size; 83 LFSTSize = _LFST_size; |
84 clearPeriod = clear_period; |
85 86 DPRINTF(StoreSet, "StoreSet: Creating store set object.\n"); 87 DPRINTF(StoreSet, "StoreSet: SSIT size: %i, LFST size: %i.\n", 88 SSITSize, LFSTSize); 89 90 SSIT.resize(SSITSize); 91 92 validSSIT.resize(SSITSize); --- 8 unchanged lines hidden (view full) --- 101 for (int i = 0; i < LFSTSize; ++i) { 102 validLFST[i] = false; 103 LFST[i] = 0; 104 } 105 106 indexMask = SSITSize - 1; 107 108 offsetBits = 2; |
109 110 memOpsPred = 0; |
111} 112 113 114void 115StoreSet::violation(Addr store_PC, Addr load_PC) 116{ 117 int load_index = calcIndex(load_PC); 118 int store_index = calcIndex(store_PC); --- 61 unchanged lines hidden (view full) --- 180 DPRINTF(StoreSet, "StoreSet: Store had smaller store set: %i; " 181 "for load %#x, store %#x\n", 182 store_SSID, load_PC, store_PC); 183 } 184 } 185} 186 187void |
188StoreSet::checkClear() 189{ 190 memOpsPred++; 191 if (memOpsPred > clearPeriod) { 192 DPRINTF(StoreSet, "Wiping predictor state beacuse %d ld/st executed\n", 193 clearPeriod); 194 memOpsPred = 0; 195 clear(); 196 } 197} 198 199void |
200StoreSet::insertLoad(Addr load_PC, InstSeqNum load_seq_num) 201{ |
202 checkClear(); |
203 // Does nothing. 204 return; 205} 206 207void 208StoreSet::insertStore(Addr store_PC, InstSeqNum store_seq_num, ThreadID tid) 209{ 210 int index = calcIndex(store_PC); 211 212 int store_SSID; 213 |
214 checkClear(); |
215 assert(index < SSITSize); 216 217 if (!validSSIT[index]) { 218 // Do nothing if there's no valid entry. 219 return; 220 } else { 221 store_SSID = SSIT[index]; 222 --- 145 unchanged lines hidden --- |