store_set.cc (8232:b28d06a175be) store_set.cc (8519:ef35ce2bd73f)
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
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(int _SSIT_size, int _LFST_size)
38 : SSITSize(_SSIT_size), LFSTSize(_LFST_size)
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;
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;
71}
72
73StoreSet::~StoreSet()
74{
75}
76
77void
73}
74
75StoreSet::~StoreSet()
76{
77}
78
79void
78StoreSet::init(int _SSIT_size, int _LFST_size)
80StoreSet::init(uint64_t clear_period, int _SSIT_size, int _LFST_size)
79{
80 SSITSize = _SSIT_size;
81 LFSTSize = _LFST_size;
81{
82 SSITSize = _SSIT_size;
83 LFSTSize = _LFST_size;
84 clearPeriod = clear_period;
82
83 DPRINTF(StoreSet, "StoreSet: Creating store set object.\n");
84 DPRINTF(StoreSet, "StoreSet: SSIT size: %i, LFST size: %i.\n",
85 SSITSize, LFSTSize);
86
87 SSIT.resize(SSITSize);
88
89 validSSIT.resize(SSITSize);

--- 8 unchanged lines hidden (view full) ---

98 for (int i = 0; i < LFSTSize; ++i) {
99 validLFST[i] = false;
100 LFST[i] = 0;
101 }
102
103 indexMask = SSITSize - 1;
104
105 offsetBits = 2;
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;
106}
107
108
109void
110StoreSet::violation(Addr store_PC, Addr load_PC)
111{
112 int load_index = calcIndex(load_PC);
113 int store_index = calcIndex(store_PC);

--- 61 unchanged lines hidden (view full) ---

175 DPRINTF(StoreSet, "StoreSet: Store had smaller store set: %i; "
176 "for load %#x, store %#x\n",
177 store_SSID, load_PC, store_PC);
178 }
179 }
180}
181
182void
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
183StoreSet::insertLoad(Addr load_PC, InstSeqNum load_seq_num)
184{
200StoreSet::insertLoad(Addr load_PC, InstSeqNum load_seq_num)
201{
202 checkClear();
185 // Does nothing.
186 return;
187}
188
189void
190StoreSet::insertStore(Addr store_PC, InstSeqNum store_seq_num, ThreadID tid)
191{
192 int index = calcIndex(store_PC);
193
194 int store_SSID;
195
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();
196 assert(index < SSITSize);
197
198 if (!validSSIT[index]) {
199 // Do nothing if there's no valid entry.
200 return;
201 } else {
202 store_SSID = SSIT[index];
203

--- 145 unchanged lines hidden ---
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 ---