indirect.hh revision 13957:25e9c77a8a99
14680Sgblack@eecs.umich.edu/*
25442Sgblack@eecs.umich.edu * Copyright (c) 2014 ARM Limited
34680Sgblack@eecs.umich.edu * All rights reserved.
44680Sgblack@eecs.umich.edu *
54680Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
64680Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are
74680Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright
84680Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
94680Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
104680Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
114680Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution;
124680Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its
134680Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
144680Sgblack@eecs.umich.edu * this software without specific prior written permission.
154680Sgblack@eecs.umich.edu *
164680Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
174680Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
184680Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
194680Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
204680Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
214680Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
224680Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
234680Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
244680Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
254680Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
264680Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
274680Sgblack@eecs.umich.edu *
284680Sgblack@eecs.umich.edu * Authors: Mitch Hayenga
294680Sgblack@eecs.umich.edu */
304680Sgblack@eecs.umich.edu
314680Sgblack@eecs.umich.edu#ifndef __CPU_PRED_INDIRECT_BASE_HH__
324680Sgblack@eecs.umich.edu#define __CPU_PRED_INDIRECT_BASE_HH__
334680Sgblack@eecs.umich.edu
3412491Sgabeblack@google.com#include "arch/isa_traits.hh"
3512450Sgabeblack@google.com#include "config/the_isa.hh"
3612450Sgabeblack@google.com#include "cpu/inst_seq.hh"
374680Sgblack@eecs.umich.edu#include "params/IndirectPredictor.hh"
384680Sgblack@eecs.umich.edu#include "sim/sim_object.hh"
395543Ssaidi@eecs.umich.edu
404680Sgblack@eecs.umich.educlass IndirectPredictor : public SimObject
414680Sgblack@eecs.umich.edu{
424680Sgblack@eecs.umich.edu  public:
434680Sgblack@eecs.umich.edu
444680Sgblack@eecs.umich.edu    typedef IndirectPredictorParams Params;
454680Sgblack@eecs.umich.edu
464680Sgblack@eecs.umich.edu    IndirectPredictor(const Params *params)
4712450Sgabeblack@google.com        : SimObject(params)
4812450Sgabeblack@google.com    {
4912450Sgabeblack@google.com    }
5012450Sgabeblack@google.com
5112450Sgabeblack@google.com    virtual bool lookup(Addr br_addr, TheISA::PCState& br_target,
5212450Sgabeblack@google.com                        ThreadID tid) = 0;
5312450Sgabeblack@google.com    virtual void recordIndirect(Addr br_addr, Addr tgt_addr,
5412450Sgabeblack@google.com                                InstSeqNum seq_num, ThreadID tid) = 0;
5512450Sgabeblack@google.com    virtual void commit(InstSeqNum seq_num, ThreadID tid,
5612450Sgabeblack@google.com                        void * indirect_history) = 0;
5712450Sgabeblack@google.com    virtual void squash(InstSeqNum seq_num, ThreadID tid) = 0;
5812450Sgabeblack@google.com    virtual void recordTarget(InstSeqNum seq_num, void * indirect_history,
5912465Sgabeblack@google.com                              const TheISA::PCState& target, ThreadID tid) = 0;
6012465Sgabeblack@google.com    virtual void genIndirectInfo(ThreadID tid, void* & indirect_history) = 0;
6112465Sgabeblack@google.com    virtual void updateDirectionInfo(ThreadID tid, bool actually_taken) = 0;
6212465Sgabeblack@google.com    virtual void deleteIndirectInfo(ThreadID tid, void * indirect_history) = 0;
6312450Sgabeblack@google.com    virtual void changeDirectionPrediction(ThreadID tid,
6412465Sgabeblack@google.com                                           void * indirect_history,
6512465Sgabeblack@google.com                                           bool actually_taken) = 0;
6612465Sgabeblack@google.com};
6712465Sgabeblack@google.com
6812465Sgabeblack@google.com#endif // __CPU_PRED_INDIRECT_BASE_HH__
6912465Sgabeblack@google.com