bpred_unit.cc revision 10244:d2deb51a4abf
14486Sbinkertn@umich.edu/*
27897Shestness@cs.utexas.edu * Copyright (c) 2004-2006 The Regents of The University of Michigan
34486Sbinkertn@umich.edu * Copyright (c) 2010 The University of Edinburgh
44486Sbinkertn@umich.edu * Copyright (c) 2012 Mark D. Hill and David A. Wood
54486Sbinkertn@umich.edu * All rights reserved.
64486Sbinkertn@umich.edu *
74486Sbinkertn@umich.edu * Redistribution and use in source and binary forms, with or without
84486Sbinkertn@umich.edu * modification, are permitted provided that the following conditions are
94486Sbinkertn@umich.edu * met: redistributions of source code must retain the above copyright
104486Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer;
114486Sbinkertn@umich.edu * redistributions in binary form must reproduce the above copyright
124486Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer in the
134486Sbinkertn@umich.edu * documentation and/or other materials provided with the distribution;
144486Sbinkertn@umich.edu * neither the name of the copyright holders nor the names of its
154486Sbinkertn@umich.edu * contributors may be used to endorse or promote products derived from
164486Sbinkertn@umich.edu * this software without specific prior written permission.
174486Sbinkertn@umich.edu *
184486Sbinkertn@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
194486Sbinkertn@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
204486Sbinkertn@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
214486Sbinkertn@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
224486Sbinkertn@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
234486Sbinkertn@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
244486Sbinkertn@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
254486Sbinkertn@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
264486Sbinkertn@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
274486Sbinkertn@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
284486Sbinkertn@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
297897Shestness@cs.utexas.edu *
304486Sbinkertn@umich.edu * Authors: Kevin Lim
313102SN/A *          Timothy M. Jones
326654Snate@binkert.org */
333102SN/A
343102SN/A#include "cpu/pred/2bit_local.hh"
356654Snate@binkert.org#include "cpu/pred/bi_mode.hh"
368931Sandreas.hansson@arm.com#include "cpu/pred/bpred_unit_impl.hh"
372212SN/A#include "cpu/pred/tournament.hh"
382902SN/A
392902SN/ABPredUnit *
408703Sandreas.hansson@arm.comBranchPredictorParams::create()
411783SN/A{
429338SAndreas.Sandberg@arm.com    // Setup the selected predictor.
438839Sandreas.hansson@arm.com    if (predType == "local") {
447673Snate@binkert.org        return new LocalBP(this);
459281Sandreas.hansson@arm.com    } else if (predType == "tournament") {
469313Sandreas.hansson@arm.com        return new TournamentBP(this);
479313Sandreas.hansson@arm.com    } else if (predType == "bi-mode") {
489313Sandreas.hansson@arm.com        return new BiModeBP(this);
499313Sandreas.hansson@arm.com    } else {
509281Sandreas.hansson@arm.com        fatal("Invalid BP selected!");
517673Snate@binkert.org    }
528597Ssteve.reinhardt@amd.com}
538597Ssteve.reinhardt@amd.com