bpred_unit.hh (10244:d2deb51a4abf) bpred_unit.hh (10273:6e6557085eb7)
1/*
1/*
2 * Copyright (c) 2011-2012 ARM Limited
2 * Copyright (c) 2011-2012, 2014 ARM Limited
3 * Copyright (c) 2010 The University of Edinburgh
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating
9 * to a hardware implementation of the functionality of the software
10 * licensed hereunder. You may use the software subject to the license

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

42 * Korey Sewell
43 * Timothy M. Jones
44 * Nilay Vaish
45 */
46
47#ifndef __CPU_PRED_BPRED_UNIT_HH__
48#define __CPU_PRED_BPRED_UNIT_HH__
49
3 * Copyright (c) 2010 The University of Edinburgh
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating
9 * to a hardware implementation of the functionality of the software
10 * licensed hereunder. You may use the software subject to the license

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

42 * Korey Sewell
43 * Timothy M. Jones
44 * Nilay Vaish
45 */
46
47#ifndef __CPU_PRED_BPRED_UNIT_HH__
48#define __CPU_PRED_BPRED_UNIT_HH__
49
50#include <list>
50#include <deque>
51
52#include "base/statistics.hh"
53#include "base/types.hh"
54#include "cpu/pred/btb.hh"
55#include "cpu/pred/ras.hh"
56#include "cpu/inst_seq.hh"
57#include "cpu/static_inst.hh"
58#include "params/BranchPredictor.hh"

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

239
240 /** Whether or not the instruction was a call. */
241 bool wasCall;
242
243 /** Whether or not the instruction was a return. */
244 bool wasReturn;
245 };
246
51
52#include "base/statistics.hh"
53#include "base/types.hh"
54#include "cpu/pred/btb.hh"
55#include "cpu/pred/ras.hh"
56#include "cpu/inst_seq.hh"
57#include "cpu/static_inst.hh"
58#include "params/BranchPredictor.hh"

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

239
240 /** Whether or not the instruction was a call. */
241 bool wasCall;
242
243 /** Whether or not the instruction was a return. */
244 bool wasReturn;
245 };
246
247 typedef std::list<PredictorHistory> History;
248 typedef History::iterator HistoryIt;
247 typedef std::deque<PredictorHistory> History;
249
250 /** Number of the threads for which the branch history is maintained. */
251 uint32_t numThreads;
252
253 /**
254 * The per-thread predictor history. This is used to update the predictor
255 * as instructions are committed, or restore it to the proper state after
256 * a squash.
257 */
248
249 /** Number of the threads for which the branch history is maintained. */
250 uint32_t numThreads;
251
252 /**
253 * The per-thread predictor history. This is used to update the predictor
254 * as instructions are committed, or restore it to the proper state after
255 * a squash.
256 */
258 History *predHist;
257 std::vector<History> predHist;
259
260 /** The BTB. */
261 DefaultBTB BTB;
262
263 /** The per-thread return address stack. */
258
259 /** The BTB. */
260 DefaultBTB BTB;
261
262 /** The per-thread return address stack. */
264 ReturnAddrStack *RAS;
263 std::vector<ReturnAddrStack> RAS;
265
266 /** Stat for number of BP lookups. */
267 Stats::Scalar lookups;
268 /** Stat for number of conditional branches predicted. */
269 Stats::Scalar condPredicted;
270 /** Stat for number of conditional branches predicted incorrectly. */
271 Stats::Scalar condIncorrect;
272 /** Stat for number of BTB lookups. */

--- 14 unchanged lines hidden ---
264
265 /** Stat for number of BP lookups. */
266 Stats::Scalar lookups;
267 /** Stat for number of conditional branches predicted. */
268 Stats::Scalar condPredicted;
269 /** Stat for number of conditional branches predicted incorrectly. */
270 Stats::Scalar condIncorrect;
271 /** Stat for number of BTB lookups. */

--- 14 unchanged lines hidden ---