From 6f8a17e52424f479c4b67b03475931d1f75e1276 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Wed, 6 Mar 2019 14:47:00 +0800 Subject: remove static branch predictor Change-Id: Id15c9fd821ae32d4ef43b760c4c4feb072a6f346 --- src/cpu/pred/BranchPredictor.py | 9 ---- src/cpu/pred/SConscript | 1 - src/cpu/pred/static.cc | 63 ------------------------ src/cpu/pred/static.hh | 105 ---------------------------------------- 4 files changed, 178 deletions(-) delete mode 100644 src/cpu/pred/static.cc delete mode 100644 src/cpu/pred/static.hh diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index 46112b123..1b400c2b7 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -53,15 +53,6 @@ class BranchPredictor(SimObject): -class StaticBP(BranchPredictor): - type = 'StaticBP' - cxx_class = 'StaticBP' - cxx_header = "cpu/pred/static.hh" - - staticPrediction = Param.Bool(False, "Static prediction") - - - class LocalBP(BranchPredictor): type = 'LocalBP' cxx_class = 'LocalBP' diff --git a/src/cpu/pred/SConscript b/src/cpu/pred/SConscript index f353d051a..1cdf7bbd7 100644 --- a/src/cpu/pred/SConscript +++ b/src/cpu/pred/SConscript @@ -44,7 +44,6 @@ Source('ras.cc') Source('tournament.cc') Source ('bi_mode.cc') Source('ltage.cc') -Source('static.cc') DebugFlag('FreeList') DebugFlag('Branch') DebugFlag('LTage') diff --git a/src/cpu/pred/static.cc b/src/cpu/pred/static.cc deleted file mode 100644 index f3844e388..000000000 --- a/src/cpu/pred/static.cc +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2004-2006 The Regents of The University of Michigan - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer; - * redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution; - * neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: Kevin Lim - */ - -#include "cpu/pred/static.hh" - -StaticBP::StaticBP(const StaticBPParams *params) - : BPredUnit(params), - staticPrediction(params->staticPrediction) -{ - -} - -void -StaticBP::btbUpdate(ThreadID tid, Addr branch_addr, void * &bp_history) -{ -// Place holder for a function that is called to update predictor history when -// a BTB entry is invalid or not found. -} - - -bool -StaticBP::lookup(ThreadID tid, Addr branch_addr, void * &bp_history) -{ - return staticPrediction; -} - -void -StaticBP::uncondBranch(ThreadID tid, Addr pc, void *&bp_history) -{ -} - -StaticBP* -StaticBPParams::create() -{ - return new StaticBP(this); -} diff --git a/src/cpu/pred/static.hh b/src/cpu/pred/static.hh deleted file mode 100644 index 978038f74..000000000 --- a/src/cpu/pred/static.hh +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2011, 2014 ARM Limited - * All rights reserved - * - * The license below extends only to copyright in the software and shall - * not be construed as granting a license to any other intellectual - * property including but not limited to intellectual property relating - * to a hardware implementation of the functionality of the software - * licensed hereunder. You may use the software subject to the license - * terms below provided that you ensure that this notice is replicated - * unmodified and in its entirety in all distributions of the software, - * modified or unmodified, in source code or in binary form. - * - * Copyright (c) 2004-2006 The Regents of The University of Michigan - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer; - * redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution; - * neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: Kevin Lim - * Timothy M. Jones - */ - -#ifndef __CPU_PRED_STATIC_PRED_HH__ -#define __CPU_PRED_STATIC_PRED_HH__ - -#include - -#include "base/types.hh" -#include "cpu/pred/bpred_unit.hh" -#include "params/StaticBP.hh" - -/** - * Implements a local predictor that uses the PC to index into a table of - * counters. Note that any time a pointer to the bp_history is given, it - * should be NULL using this predictor because it does not have any branch - * predictor state that needs to be recorded or updated; the update can be - * determined solely by the branch being taken or not taken. - */ -class StaticBP : public BPredUnit -{ - public: - /** - * Default branch predictor constructor. - */ - StaticBP(const StaticBPParams *params); - - virtual void uncondBranch(ThreadID tid, Addr pc, void * &bp_history); - - /** - * Looks up the given address in the branch predictor and returns - * a true/false value as to whether it is taken. - * @param branch_addr The address of the branch to look up. - * @param bp_history Pointer to any bp history state. - * @return Whether or not the branch is taken. - */ - bool lookup(ThreadID tid, Addr branch_addr, void * &bp_history); - - /** - * Updates the branch predictor to Not Taken if a BTB entry is - * invalid or not found. - * @param branch_addr The address of the branch to look up. - * @param bp_history Pointer to any bp history state. - * @return Whether or not the branch is taken. - */ - void btbUpdate(ThreadID tid, Addr branch_addr, void * &bp_history); - - /** - * Updates the branch predictor with the actual result of a branch. - * @param branch_addr The address of the branch to update. - * @param taken Whether or not the branch was taken. - */ - void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, - bool squashed) - { assert(bp_history == NULL); } - - void squash(ThreadID tid, void *bp_history) - { assert(bp_history == NULL); } - - private: - /** Static prediction. */ - bool staticPrediction; -}; - -#endif // __CPU_PRED_STATIC_PRED_HH__ -- cgit v1.2.3