decode_impl.hh (9046:a1104cc13db2) decode_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

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

47 : cpu(_cpu),
48 renameToDecodeDelay(params->renameToDecodeDelay),
49 iewToDecodeDelay(params->iewToDecodeDelay),
50 commitToDecodeDelay(params->commitToDecodeDelay),
51 fetchToDecodeDelay(params->fetchToDecodeDelay),
52 decodeWidth(params->decodeWidth),
53 numThreads(params->numThreads)
54{
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

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

59 : cpu(_cpu),
60 renameToDecodeDelay(params->renameToDecodeDelay),
61 iewToDecodeDelay(params->iewToDecodeDelay),
62 commitToDecodeDelay(params->commitToDecodeDelay),
63 fetchToDecodeDelay(params->fetchToDecodeDelay),
64 decodeWidth(params->decodeWidth),
65 numThreads(params->numThreads)
66{
67 // @todo: Make into a parameter
68 skidBufferMax = (fetchToDecodeDelay + 1) * params->fetchWidth;
69}
70
71template<class Impl>
72void
73DefaultDecode<Impl>::startupStage()
74{
75 resetStage();
76}
77
78template<class Impl>
79void
80DefaultDecode<Impl>::resetStage()
81{
55 _status = Inactive;
56
57 // Setup status, make sure stall signals are clear.
58 for (ThreadID tid = 0; tid < numThreads; ++tid) {
59 decodeStatus[tid] = Idle;
60
61 stalls[tid].rename = false;
62 stalls[tid].iew = false;
63 stalls[tid].commit = false;
64 }
82 _status = Inactive;
83
84 // Setup status, make sure stall signals are clear.
85 for (ThreadID tid = 0; tid < numThreads; ++tid) {
86 decodeStatus[tid] = Idle;
87
88 stalls[tid].rename = false;
89 stalls[tid].iew = false;
90 stalls[tid].commit = false;
91 }
65
66 // @todo: Make into a parameter
67 skidBufferMax = (fetchToDecodeDelay + 1) * params->fetchWidth;
68}
69
70template <class Impl>
71std::string
72DefaultDecode<Impl>::name() const
73{
74 return cpu->name() + ".decode";
75}

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

159template<class Impl>
160void
161DefaultDecode<Impl>::setActiveThreads(std::list<ThreadID> *at_ptr)
162{
163 activeThreads = at_ptr;
164}
165
166template <class Impl>
92}
93
94template <class Impl>
95std::string
96DefaultDecode<Impl>::name() const
97{
98 return cpu->name() + ".decode";
99}

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

183template<class Impl>
184void
185DefaultDecode<Impl>::setActiveThreads(std::list<ThreadID> *at_ptr)
186{
187 activeThreads = at_ptr;
188}
189
190template <class Impl>
167bool
168DefaultDecode<Impl>::drain()
169{
170 // Decode is done draining at any time.
171 cpu->signalDrained();
172 return true;
173}
174
175template <class Impl>
176void
191void
177DefaultDecode<Impl>::takeOverFrom()
192DefaultDecode<Impl>::drainSanityCheck() const
178{
193{
179 _status = Inactive;
180
181 // Be sure to reset state and clear out any old instructions.
182 for (ThreadID tid = 0; tid < numThreads; ++tid) {
194 for (ThreadID tid = 0; tid < numThreads; ++tid) {
183 decodeStatus[tid] = Idle;
184
185 stalls[tid].rename = false;
186 stalls[tid].iew = false;
187 stalls[tid].commit = false;
188 while (!insts[tid].empty())
189 insts[tid].pop();
190 while (!skidBuffer[tid].empty())
191 skidBuffer[tid].pop();
192 branchCount[tid] = 0;
195 assert(insts[tid].empty());
196 assert(skidBuffer[tid].empty());
193 }
197 }
194 wroteToTimeBuffer = false;
195}
196
197template<class Impl>
198bool
199DefaultDecode<Impl>::checkStall(ThreadID tid) const
200{
201 bool ret_val = false;
202

--- 559 unchanged lines hidden ---
198}
199
200template<class Impl>
201bool
202DefaultDecode<Impl>::checkStall(ThreadID tid) const
203{
204 bool ret_val = false;
205

--- 559 unchanged lines hidden ---