114081Sjavier.bueno@metempsy.com/*
214081Sjavier.bueno@metempsy.com * Copyright 2019 Texas A&M University
314081Sjavier.bueno@metempsy.com *
414081Sjavier.bueno@metempsy.com * Redistribution and use in source and binary forms, with or without
514081Sjavier.bueno@metempsy.com * modification, are permitted provided that the following conditions are met:
614081Sjavier.bueno@metempsy.com *
714081Sjavier.bueno@metempsy.com * 1. Redistributions of source code must retain the above copyright notice,
814081Sjavier.bueno@metempsy.com *    this list of conditions and the following disclaimer.
914081Sjavier.bueno@metempsy.com *
1014081Sjavier.bueno@metempsy.com * 2. Redistributions in binary form must reproduce the above copyright notice,
1114081Sjavier.bueno@metempsy.com *    this list of conditions and the following disclaimer in the documentation
1214081Sjavier.bueno@metempsy.com *    and/or other materials provided with the distribution.
1314081Sjavier.bueno@metempsy.com *
1414081Sjavier.bueno@metempsy.com * 3. Neither the name of the copyright holder nor the names of its
1514081Sjavier.bueno@metempsy.com *    contributors may be used to endorse or promote products derived from this
1614081Sjavier.bueno@metempsy.com *    software without specific prior written permission.
1714081Sjavier.bueno@metempsy.com *
1814081Sjavier.bueno@metempsy.com *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1914081Sjavier.bueno@metempsy.com *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2014081Sjavier.bueno@metempsy.com *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2114081Sjavier.bueno@metempsy.com *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2214081Sjavier.bueno@metempsy.com *  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2314081Sjavier.bueno@metempsy.com *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2414081Sjavier.bueno@metempsy.com *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2514081Sjavier.bueno@metempsy.com *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2614081Sjavier.bueno@metempsy.com *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2714081Sjavier.bueno@metempsy.com *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2814081Sjavier.bueno@metempsy.com *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2914081Sjavier.bueno@metempsy.com *
3014081Sjavier.bueno@metempsy.com *  Author: Daniel A. Jiménez
3114081Sjavier.bueno@metempsy.com *  Adapted to gem5 by: Javier Bueno Hedo
3214081Sjavier.bueno@metempsy.com *
3314081Sjavier.bueno@metempsy.com */
3414081Sjavier.bueno@metempsy.com
3514081Sjavier.bueno@metempsy.com/*
3614081Sjavier.bueno@metempsy.com * Multiperspective Perceptron Predictor with TAGE (by Daniel A. Jiménez)
3714081Sjavier.bueno@metempsy.com * 8 KB version
3814081Sjavier.bueno@metempsy.com */
3914081Sjavier.bueno@metempsy.com
4014081Sjavier.bueno@metempsy.com#ifndef __CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_TAGE_8KB_HH__
4114081Sjavier.bueno@metempsy.com#define __CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_TAGE_8KB_HH__
4214081Sjavier.bueno@metempsy.com
4314081Sjavier.bueno@metempsy.com#include "cpu/pred/multiperspective_perceptron_tage.hh"
4414081Sjavier.bueno@metempsy.com#include "params/MPP_LoopPredictor_8KB.hh"
4514081Sjavier.bueno@metempsy.com#include "params/MPP_StatisticalCorrector_8KB.hh"
4614081Sjavier.bueno@metempsy.com#include "params/MPP_TAGE_8KB.hh"
4714081Sjavier.bueno@metempsy.com#include "params/MultiperspectivePerceptronTAGE8KB.hh"
4814081Sjavier.bueno@metempsy.com
4914081Sjavier.bueno@metempsy.comclass MPP_TAGE_8KB : public MPP_TAGE {
5014081Sjavier.bueno@metempsy.com  public:
5114081Sjavier.bueno@metempsy.com    MPP_TAGE_8KB(const MPP_TAGE_8KBParams *p) : MPP_TAGE(p) {}
5214081Sjavier.bueno@metempsy.com};
5314081Sjavier.bueno@metempsy.com
5414081Sjavier.bueno@metempsy.comclass MPP_LoopPredictor_8KB : public MPP_LoopPredictor {
5514081Sjavier.bueno@metempsy.com  public:
5614081Sjavier.bueno@metempsy.com    MPP_LoopPredictor_8KB(MPP_LoopPredictor_8KBParams *p) :
5714081Sjavier.bueno@metempsy.com        MPP_LoopPredictor(p) {}
5814081Sjavier.bueno@metempsy.com};
5914081Sjavier.bueno@metempsy.com
6014081Sjavier.bueno@metempsy.comclass MPP_StatisticalCorrector_8KB : public MPP_StatisticalCorrector {
6114081Sjavier.bueno@metempsy.com    StatisticalCorrector::SCThreadHistory *makeThreadHistory() override;
6214081Sjavier.bueno@metempsy.com    int gPredictions(ThreadID tid, Addr branch_pc,
6314081Sjavier.bueno@metempsy.com            StatisticalCorrector::BranchInfo* bi, int &lsum, int64_t phist)
6414081Sjavier.bueno@metempsy.com            override;
6514081Sjavier.bueno@metempsy.com    void getBiasLSUM(Addr branch_pc,
6614081Sjavier.bueno@metempsy.com            StatisticalCorrector::BranchInfo *bi, int &lsum) const override;
6714081Sjavier.bueno@metempsy.com    void gUpdates(ThreadID tid, Addr pc, bool taken,
6814081Sjavier.bueno@metempsy.com            StatisticalCorrector::BranchInfo* bi, int64_t phist) override;
6914081Sjavier.bueno@metempsy.com    void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken,
7014081Sjavier.bueno@metempsy.com            StatisticalCorrector::BranchInfo *bi, Addr corrTarget) override;
7114081Sjavier.bueno@metempsy.com  public:
7214081Sjavier.bueno@metempsy.com    MPP_StatisticalCorrector_8KB(const MPP_StatisticalCorrector_8KBParams *p);
7314081Sjavier.bueno@metempsy.com    size_t getSizeInBits() const override;
7414081Sjavier.bueno@metempsy.com};
7514081Sjavier.bueno@metempsy.com
7614081Sjavier.bueno@metempsy.comclass MultiperspectivePerceptronTAGE8KB :
7714081Sjavier.bueno@metempsy.com        public MultiperspectivePerceptronTAGE {
7814081Sjavier.bueno@metempsy.com    void createSpecs() override;
7914081Sjavier.bueno@metempsy.com  public:
8014081Sjavier.bueno@metempsy.com    MultiperspectivePerceptronTAGE8KB(
8114081Sjavier.bueno@metempsy.com            const MultiperspectivePerceptronTAGE8KBParams *p);
8214081Sjavier.bueno@metempsy.com};
8314081Sjavier.bueno@metempsy.com
8414081Sjavier.bueno@metempsy.com#endif // __CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_TAGE_8KB_HH__
85