Deleted Added
sdiff udiff text old ( 8706:b1838faf3bcc ) new ( 8707:489489c67fd9 )
full compact
1/*
2 * Copyright (c) 2011 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
14 * Copyright (c) 2005-2006 The Regents of The University of Michigan
15 * All rights reserved.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions are
19 * met: redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer;
21 * redistributions in binary form must reproduce the above copyright

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

48#include "debug/Fetch.hh"
49#include "debug/LSQ.hh"
50#include "debug/Writeback.hh"
51#include "params/DerivO3CPU.hh"
52
53using namespace std;
54
55template <class Impl>
56LSQ<Impl>::LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params)
57 : cpu(cpu_ptr), iewStage(iew_ptr),
58 LQEntries(params->LQEntries),
59 SQEntries(params->SQEntries),
60 numThreads(params->numThreads),
61 retryTid(-1)
62{
63 //**********************************************/
64 //************ Handle SMT Parameters ***********/
65 //**********************************************/
66 std::string policy = params->smtLSQPolicy;
67
68 //Convert string to lowercase
69 std::transform(policy.begin(), policy.end(), policy.begin(),
70 (int(*)(int)) tolower);

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

106 assert(0 && "Invalid LSQ Sharing Policy.Options Are:{Dynamic,"
107 "Partitioned, Threshold}");
108 }
109
110 //Initialize LSQs
111 for (ThreadID tid = 0; tid < numThreads; tid++) {
112 thread[tid].init(cpu, iew_ptr, params, this,
113 maxLQEntries, maxSQEntries, tid);
114 thread[tid].setDcachePort(cpu_ptr->getDcachePort());
115 }
116}
117
118
119template<class Impl>
120std::string
121LSQ<Impl>::name() const
122{

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

296
297 if (thread[tid].violation())
298 return true;
299 }
300
301 return false;
302}
303
304template <class Impl>
305void
306LSQ<Impl>::recvRetry()
307{
308 if (retryTid == InvalidThreadID)
309 {
310 //Squashed, so drop it
311 return;
312 }
313 int curr_retry_tid = retryTid;
314 // Speculatively clear the retry Tid. This will get set again if
315 // the LSQUnit was unable to complete its access.
316 retryTid = -1;
317 thread[curr_retry_tid].recvRetry();
318}
319
320template <class Impl>
321bool
322LSQ<Impl>::recvTiming(PacketPtr pkt)
323{
324 if (pkt->isError())
325 DPRINTF(LSQ, "Got error packet back for address: %#X\n",
326 pkt->getAddr());
327 if (pkt->isResponse()) {
328 thread[pkt->req->threadId()].completeDataAccess(pkt);
329 } else {
330 DPRINTF(LSQ, "received pkt for addr:%#x %s\n", pkt->getAddr(),
331 pkt->cmdString());
332
333 // must be a snoop
334 if (pkt->isInvalidate()) {
335 DPRINTF(LSQ, "received invalidation for addr:%#x\n",
336 pkt->getAddr());
337 for (ThreadID tid = 0; tid < numThreads; tid++) {
338 thread[tid].checkSnoop(pkt);
339 }
340 }
341 // to provide stronger consistency model
342 }
343 return true;
344}
345
346template<class Impl>
347int
348LSQ<Impl>::getCount()
349{
350 unsigned total = 0;
351
352 list<ThreadID>::iterator threads = activeThreads->begin();
353 list<ThreadID>::iterator end = activeThreads->end();

--- 253 unchanged lines hidden ---