commit.hh (9427:ddf45c1d54d4) commit.hh (9437:8088e94a9de0)
1/*
1/*
2 * Copyright (c) 2010 ARM Limited
2 * Copyright (c) 2010-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

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

124 };
125
126 /** Individual thread status. */
127 enum ThreadStatus {
128 Running,
129 Idle,
130 ROBSquashing,
131 TrapPending,
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

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

124 };
125
126 /** Individual thread status. */
127 enum ThreadStatus {
128 Running,
129 Idle,
130 ROBSquashing,
131 TrapPending,
132 FetchTrapPending
132 FetchTrapPending,
133 SquashAfterPending, //< Committing instructions before a squash.
133 };
134
135 /** Commit policy for SMT mode. */
136 enum CommitPolicy {
137 Aggressive,
138 RoundRobin,
139 OldestReady
140 };

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

254 void squashAll(ThreadID tid);
255
256 /** Handles squashing due to a trap. */
257 void squashFromTrap(ThreadID tid);
258
259 /** Handles squashing due to an TC write. */
260 void squashFromTC(ThreadID tid);
261
134 };
135
136 /** Commit policy for SMT mode. */
137 enum CommitPolicy {
138 Aggressive,
139 RoundRobin,
140 OldestReady
141 };

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

255 void squashAll(ThreadID tid);
256
257 /** Handles squashing due to a trap. */
258 void squashFromTrap(ThreadID tid);
259
260 /** Handles squashing due to an TC write. */
261 void squashFromTC(ThreadID tid);
262
262 /** Handles squashing from instruction with SquashAfter set.
263 /** Handles a squash from a squashAfter() request. */
264 void squashFromSquashAfter(ThreadID tid);
265
266 /**
267 * Handle squashing from instruction with SquashAfter set.
268 *
263 * This differs from the other squashes as it squashes following
264 * instructions instead of the current instruction and doesn't
269 * This differs from the other squashes as it squashes following
270 * instructions instead of the current instruction and doesn't
265 * clean up various status bits about traps/tc writes pending.
271 * clean up various status bits about traps/tc writes
272 * pending. Since there might have been instructions committed by
273 * the commit stage before the squashing instruction was reached
274 * and we can't commit and squash in the same cycle, we have to
275 * squash in two steps:
276 *
277 * <ol>
278 * <li>Immediately set the commit status of the thread of
279 * SquashAfterPending. This forces the thread to stop
280 * committing instructions in this cycle. The last
281 * instruction to be committed in this cycle will be the
282 * SquashAfter instruction.
283 * <li>In the next cycle, commit() checks for the
284 * SquashAfterPending state and squashes <i>all</i>
285 * in-flight instructions. Since the SquashAfter instruction
286 * was the last instruction to be committed in the previous
287 * cycle, this causes all subsequent instructions to be
288 * squashed.
289 * </ol>
290 *
291 * @param tid ID of the thread to squash.
292 * @param head_inst Instruction that requested the squash.
266 */
293 */
267 void squashAfter(ThreadID tid, DynInstPtr &head_inst,
268 uint64_t squash_after_seq_num);
294 void squashAfter(ThreadID tid, DynInstPtr &head_inst);
269
270 /** Handles processing an interrupt. */
271 void handleInterrupt();
272
273 /** Get fetch redirecting so we can handle an interrupt */
274 void propagateInterrupt();
275
276 /** Commits as many instructions as possible. */

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

367 ThreadID squashCounter;
368
369 /** Records if a thread has to squash this cycle due to a trap. */
370 bool trapSquash[Impl::MaxThreads];
371
372 /** Records if a thread has to squash this cycle due to an XC write. */
373 bool tcSquash[Impl::MaxThreads];
374
295
296 /** Handles processing an interrupt. */
297 void handleInterrupt();
298
299 /** Get fetch redirecting so we can handle an interrupt */
300 void propagateInterrupt();
301
302 /** Commits as many instructions as possible. */

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

393 ThreadID squashCounter;
394
395 /** Records if a thread has to squash this cycle due to a trap. */
396 bool trapSquash[Impl::MaxThreads];
397
398 /** Records if a thread has to squash this cycle due to an XC write. */
399 bool tcSquash[Impl::MaxThreads];
400
401 /**
402 * Instruction passed to squashAfter().
403 *
404 * The squash after implementation needs to buffer the instruction
405 * that caused a squash since this needs to be passed to the fetch
406 * stage once squashing starts.
407 */
408 DynInstPtr squashAfterInst[Impl::MaxThreads];
409
375 /** Priority List used for Commit Policy */
376 std::list<ThreadID> priority_list;
377
378 /** IEW to Commit delay. */
379 Cycles iewToCommitDelay;
380
381 /** Commit to IEW delay. */
382 Cycles commitToIEWDelay;

--- 111 unchanged lines hidden ---
410 /** Priority List used for Commit Policy */
411 std::list<ThreadID> priority_list;
412
413 /** IEW to Commit delay. */
414 Cycles iewToCommitDelay;
415
416 /** Commit to IEW delay. */
417 Cycles commitToIEWDelay;

--- 111 unchanged lines hidden ---