Deleted Added
sdiff udiff text old ( 2693:18c6be231eb1 ) new ( 2698:d5f35d41e017 )
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;

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

37#include <queue>
38
39#include "arch/faults.hh"
40#include "config/full_system.hh"
41#include "base/hashmap.hh"
42#include "cpu/inst_seq.hh"
43#include "mem/packet.hh"
44#include "mem/port.hh"
45//#include "mem/page_table.hh"
46//#include "sim/debug.hh"
47//#include "sim/sim_object.hh"
48
49/**
50 * Class that implements the actual LQ and SQ for each specific
51 * thread. Both are circular queues; load entries are freed upon
52 * committing, while store entries are freed once they writeback. The
53 * LSQUnit tracks if there are memory ordering violations, and also
54 * detects partial load to store forwarding cases (a store only has
55 * part of a load's data) that requires the load to wait until the

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

82
83 /** Sets the CPU pointer. */
84 void setCPU(FullCPU *cpu_ptr);
85
86 /** Sets the IEW stage pointer. */
87 void setIEW(IEW *iew_ptr)
88 { iewStage = iew_ptr; }
89
90 /** Sets the page table pointer. */
91// void setPageTable(PageTable *pt_ptr);
92
93 /** Switches out LSQ unit. */
94 void switchOut();
95
96 /** Takes over from another CPU's thread. */
97 void takeOverFrom();
98
99 /** Returns if the LSQ is switched out. */
100 bool isSwitchedOut() { return switchedOut; }

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

206 int numStoresToWB() { return storesToWB; }
207
208 /** Returns if the LSQ unit will writeback on this cycle. */
209 bool willWB() { return storeQueue[storeWBIdx].canWB &&
210 !storeQueue[storeWBIdx].completed &&
211 !isStoreBlocked; }
212
213 private:
214 void writeback(DynInstPtr &inst, PacketPtr pkt);
215
216 void storePostSend(Packet *pkt);
217
218 /** Completes the store at the specified index. */
219 void completeStore(int store_idx);
220
221 /** Handles doing the retry. */
222 void recvRetry();
223

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

236
237 private:
238 /** Pointer to the CPU. */
239 FullCPU *cpu;
240
241 /** Pointer to the IEW stage. */
242 IEW *iewStage;
243
244 MemObject *mem;
245
246 class DcachePort : public Port
247 {
248 protected:
249 FullCPU *cpu;
250 LSQUnit *lsq;
251
252 public:
253 DcachePort(FullCPU *_cpu, LSQUnit *_lsq)
254 : Port(_lsq->name() + "-dport"), cpu(_cpu), lsq(_lsq)
255 { }
256
257 protected:
258 virtual Tick recvAtomic(PacketPtr pkt);
259
260 virtual void recvFunctional(PacketPtr pkt);
261
262 virtual void recvStatusChange(Status status);
263
264 virtual void getDeviceAddressRanges(AddrRangeList &resp,
265 AddrRangeList &snoop)
266 { resp.clear(); snoop.clear(); }
267
268 virtual bool recvTiming(PacketPtr pkt);
269
270 virtual void recvRetry();
271 };
272
273 /** Pointer to the D-cache. */
274 DcachePort *dcachePort;
275
276 class LSQSenderState : public Packet::SenderState
277 {
278 public:
279 LSQSenderState()
280 : noWB(false)
281 { }
282
283// protected:
284 DynInstPtr inst;
285 bool isLoad;
286 int idx;
287 bool noWB;
288 };
289
290 /** Pointer to the page table. */
291// PageTable *pTable;
292
293 class WritebackEvent : public Event {
294 public:
295 /** Constructs a writeback event. */
296 WritebackEvent(DynInstPtr &_inst, PacketPtr pkt, LSQUnit *lsq_ptr);
297
298 /** Processes the writeback event. */
299 void process();
300
301 /** Returns the description of this event. */
302 const char *description();
303
304 private:
305 DynInstPtr inst;
306
307 PacketPtr pkt;
308
309 /** The pointer to the LSQ unit that issued the store. */
310 LSQUnit<Impl> *lsqPtr;
311 };
312
313 public:
314 struct SQEntry {

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

399 bool stalled;
400 /** The store that causes the stall due to partial store to load
401 * forwarding.
402 */
403 InstSeqNum stallingStoreIsn;
404 /** The index of the above store. */
405 int stallingLoadIdx;
406
407 PacketPtr sendingPkt;
408
409 bool isStoreBlocked;
410
411 /** Whether or not a load is blocked due to the memory system. */
412 bool isLoadBlocked;
413
414 /** Has the blocked load been handled. */
415 bool loadBlockedHandled;
416

--- 275 unchanged lines hidden ---