bpred_unit.cc revision 9480
11689SN/A/* 22329SN/A * Copyright (c) 2004-2006 The Regents of The University of Michigan 39480Snilay@cs.wisc.edu * Copyright (c) 2010 The University of Edinburgh 49480Snilay@cs.wisc.edu * Copyright (c) 2012 Mark D. Hill and David A. Wood 51689SN/A * All rights reserved. 61689SN/A * 71689SN/A * Redistribution and use in source and binary forms, with or without 81689SN/A * modification, are permitted provided that the following conditions are 91689SN/A * met: redistributions of source code must retain the above copyright 101689SN/A * notice, this list of conditions and the following disclaimer; 111689SN/A * redistributions in binary form must reproduce the above copyright 121689SN/A * notice, this list of conditions and the following disclaimer in the 131689SN/A * documentation and/or other materials provided with the distribution; 141689SN/A * neither the name of the copyright holders nor the names of its 151689SN/A * contributors may be used to endorse or promote products derived from 161689SN/A * this software without specific prior written permission. 171689SN/A * 181689SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 191689SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 201689SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 211689SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 221689SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 231689SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 241689SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 251689SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 261689SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 271689SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 281689SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 292665SN/A * 302665SN/A * Authors: Kevin Lim 319480Snilay@cs.wisc.edu * Timothy M. Jones 321689SN/A */ 331061SN/A 349480Snilay@cs.wisc.edu#include "cpu/pred/2bit_local.hh" 359480Snilay@cs.wisc.edu#include "cpu/pred/bpred_unit_impl.hh" 369480Snilay@cs.wisc.edu#include "cpu/pred/tournament.hh" 371061SN/A 389480Snilay@cs.wisc.eduBPredUnit * 399480Snilay@cs.wisc.eduBranchPredictorParams::create() 409480Snilay@cs.wisc.edu{ 419480Snilay@cs.wisc.edu // Setup the selected predictor. 429480Snilay@cs.wisc.edu if (predType == "local") { 439480Snilay@cs.wisc.edu return new LocalBP(this); 449480Snilay@cs.wisc.edu } else if (predType == "tournament") { 459480Snilay@cs.wisc.edu return new TournamentBP(this); 469480Snilay@cs.wisc.edu } else { 479480Snilay@cs.wisc.edu fatal("Invalid BP selected!"); 489480Snilay@cs.wisc.edu } 499480Snilay@cs.wisc.edu} 50