Deleted Added
sdiff udiff text old ( 2670:9107b8bd08cd ) new ( 2674:6d4afef73a20 )
full compact
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;

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

81 std::string name() const;
82
83 /** Initializes the unit with parameters and a thread id. */
84 void init(Params *params, int tid);
85
86 /** Registers statistics. */
87 void regStats();
88
89 void switchOut();
90
91 void takeOverFrom();
92
93 /** Sets the pointer to the IQ. */
94 void setIQ(InstructionQueue<Impl> *iq_ptr);
95
96 /** Inserts a memory instruction. */
97 void insert(DynInstPtr &inst);
98

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

152 */
153 class MemDepEntry : public RefCounted {
154 public:
155 /** Constructs a memory dependence entry. */
156 MemDepEntry(DynInstPtr &new_inst)
157 : inst(new_inst), regsReady(false), memDepReady(false),
158 completed(false), squashed(false)
159 {
160 ++memdep_count;
161
162 DPRINTF(MemDepUnit, "Memory dependency entry created. "
163 "memdep_count=%i\n", memdep_count);
164 }
165
166 /** Frees any pointers. */
167 ~MemDepEntry()
168 {
169 for (int i = 0; i < dependInsts.size(); ++i) {
170 dependInsts[i] = NULL;
171 }
172
173 --memdep_count;
174
175 DPRINTF(MemDepUnit, "Memory dependency entry deleted. "
176 "memdep_count=%i\n", memdep_count);
177 }
178
179 /** Returns the name of the memory dependence entry. */
180 std::string name() const { return "memdepentry"; }
181
182 /** The instruction being tracked. */
183 DynInstPtr inst;
184

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

193 /** If all memory dependencies have been satisfied. */
194 bool memDepReady;
195 /** If the instruction is completed. */
196 bool completed;
197 /** If the instruction is squashed. */
198 bool squashed;
199
200 /** For debugging. */
201 static int memdep_count;
202 static int memdep_insert;
203 static int memdep_erase;
204 };
205
206 /** Finds the memory dependence entry in the hash map. */
207 inline MemDepEntryPtr &findInHash(const DynInstPtr &inst);
208
209 /** Moves an entry to the ready list. */
210 inline void moveToReady(MemDepEntryPtr &ready_inst_entry);
211

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

224
225 /** The memory dependence predictor. It is accessed upon new
226 * instructions being added to the IQ, and responds by telling
227 * this unit what instruction the newly added instruction is dependent
228 * upon.
229 */
230 MemDepPred depPred;
231
232 bool loadBarrier;
233 InstSeqNum loadBarrierSN;
234 bool storeBarrier;
235 InstSeqNum storeBarrierSN;
236
237 /** Pointer to the IQ. */
238 InstructionQueue<Impl> *iqPtr;
239
240 /** The thread id of this memory dependence unit. */
241 int id;
242
243 /** Stat for number of inserted loads. */
244 Stats::Scalar<> insertedLoads;
245 /** Stat for number of inserted stores. */
246 Stats::Scalar<> insertedStores;
247 /** Stat for number of conflicting loads that had to wait for a store. */
248 Stats::Scalar<> conflictingLoads;
249 /** Stat for number of conflicting stores that had to wait for a store. */
250 Stats::Scalar<> conflictingStores;
251};
252
253#endif // __CPU_O3_MEM_DEP_UNIT_HH__