rob_impl.hh (8822:e7ae13867098) rob_impl.hh (9444:ab47fe7f03f0)
1/*
1/*
2 * Copyright (c) 2012 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 *
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;
9 * redistributions in binary form must reproduce the above copyright

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

42 std::string _smtROBPolicy, unsigned _smtROBThreshold,
43 ThreadID _numThreads)
44 : cpu(_cpu),
45 numEntries(_numEntries),
46 squashWidth(_squashWidth),
47 numInstsInROB(0),
48 numThreads(_numThreads)
49{
14 * Copyright (c) 2004-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

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

54 std::string _smtROBPolicy, unsigned _smtROBThreshold,
55 ThreadID _numThreads)
56 : cpu(_cpu),
57 numEntries(_numEntries),
58 squashWidth(_squashWidth),
59 numInstsInROB(0),
60 numThreads(_numThreads)
61{
50 for (ThreadID tid = 0; tid < numThreads; tid++) {
51 squashedSeqNum[tid] = 0;
52 doneSquashing[tid] = true;
53 threadEntries[tid] = 0;
54 }
55
56 std::string policy = _smtROBPolicy;
57
58 //Convert string to lowercase
59 std::transform(policy.begin(), policy.end(), policy.begin(),
60 (int(*)(int)) tolower);
61
62 //Figure out rob policy
63 if (policy == "dynamic") {

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

90 for (ThreadID tid = 0; tid < numThreads; tid++) {
91 maxEntries[tid] = threshold;
92 }
93 } else {
94 assert(0 && "Invalid ROB Sharing Policy.Options Are:{Dynamic,"
95 "Partitioned, Threshold}");
96 }
97
62 std::string policy = _smtROBPolicy;
63
64 //Convert string to lowercase
65 std::transform(policy.begin(), policy.end(), policy.begin(),
66 (int(*)(int)) tolower);
67
68 //Figure out rob policy
69 if (policy == "dynamic") {

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

96 for (ThreadID tid = 0; tid < numThreads; tid++) {
97 maxEntries[tid] = threshold;
98 }
99 } else {
100 assert(0 && "Invalid ROB Sharing Policy.Options Are:{Dynamic,"
101 "Partitioned, Threshold}");
102 }
103
98 // Set the per-thread iterators to the end of the instruction list.
99 for (ThreadID tid = 0; tid < numThreads; tid++) {
104 resetState();
105}
106
107template <class Impl>
108void
109ROB<Impl>::resetState()
110{
111 for (ThreadID tid = 0; tid < numThreads; tid++) {
112 doneSquashing[tid] = true;
113 threadEntries[tid] = 0;
100 squashIt[tid] = instList[tid].end();
114 squashIt[tid] = instList[tid].end();
115 squashedSeqNum[tid] = 0;
101 }
116 }
117 numInstsInROB = 0;
102
103 // Initialize the "universal" ROB head & tail point to invalid
104 // pointers
105 head = instList[0].end();
106 tail = instList[0].end();
107}
108
109template <class Impl>

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

118ROB<Impl>::setActiveThreads(list<ThreadID> *at_ptr)
119{
120 DPRINTF(ROB, "Setting active threads list pointer.\n");
121 activeThreads = at_ptr;
122}
123
124template <class Impl>
125void
118
119 // Initialize the "universal" ROB head & tail point to invalid
120 // pointers
121 head = instList[0].end();
122 tail = instList[0].end();
123}
124
125template <class Impl>

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

134ROB<Impl>::setActiveThreads(list<ThreadID> *at_ptr)
135{
136 DPRINTF(ROB, "Setting active threads list pointer.\n");
137 activeThreads = at_ptr;
138}
139
140template <class Impl>
141void
126ROB<Impl>::switchOut()
142ROB<Impl>::drainSanityCheck() const
127{
143{
128 for (ThreadID tid = 0; tid < numThreads; tid++) {
129 instList[tid].clear();
130 }
144 for (ThreadID tid = 0; tid < numThreads; tid++)
145 assert(instList[tid].empty());
146 assert(isEmpty());
131}
132
133template <class Impl>
134void
135ROB<Impl>::takeOverFrom()
136{
147}
148
149template <class Impl>
150void
151ROB<Impl>::takeOverFrom()
152{
137 for (ThreadID tid = 0; tid < numThreads; tid++) {
138 doneSquashing[tid] = true;
139 threadEntries[tid] = 0;
140 squashIt[tid] = instList[tid].end();
141 }
142 numInstsInROB = 0;
143
144 // Initialize the "universal" ROB head & tail point to invalid
145 // pointers
146 head = instList[0].end();
147 tail = instList[0].end();
153 resetState();
148}
149
150template <class Impl>
151void
152ROB<Impl>::resetEntries()
153{
154 if (robPolicy != Dynamic || numThreads > 1) {
155 int active_threads = activeThreads->size();

--- 402 unchanged lines hidden ---
154}
155
156template <class Impl>
157void
158ROB<Impl>::resetEntries()
159{
160 if (robPolicy != Dynamic || numThreads > 1) {
161 int active_threads = activeThreads->size();

--- 402 unchanged lines hidden ---