src/Sim/Predictor/BPred/GShare.h

説明を見る。
00001 // 
00002 // Copyright (c) 2005-2008 Kenichi Watanabe.
00003 // Copyright (c) 2005-2008 Yasuhiro Watari.
00004 // Copyright (c) 2005-2008 Hironori Ichibayashi.
00005 // Copyright (c) 2008-2009 Kazuo Horio.
00006 // Copyright (c) 2009-2013 Naruki Kurata.
00007 // Copyright (c) 2005-2013 Ryota Shioya.
00008 // Copyright (c) 2005-2013 Masahiro Goshima.
00009 // 
00010 // This software is provided 'as-is', without any express or implied
00011 // warranty. In no event will the authors be held liable for any damages
00012 // arising from the use of this software.
00013 // 
00014 // Permission is granted to anyone to use this software for any purpose,
00015 // including commercial applications, and to alter it and redistribute it
00016 // freely, subject to the following restrictions:
00017 // 
00018 // 1. The origin of this software must not be misrepresented; you must not
00019 // claim that you wrote the original software. If you use this software
00020 // in a product, an acknowledgment in the product documentation would be
00021 // appreciated but is not required.
00022 // 
00023 // 2. Altered source versions must be plainly marked as such, and must not be
00024 // misrepresented as being the original software.
00025 // 
00026 // 3. This notice may not be removed or altered from any source
00027 // distribution.
00028 // 
00029 // 
00030 
00031 
00032 //
00033 // GShareタ
00034 // PHTGlobalHistoryAXV\/s
00035 // \~XCheckpointゥIXV
00036 //
00037 
00038 #ifndef __GSHARE_H__
00039 #define __GSHARE_H__
00040 
00041 #include "Sim/Predictor/BPred/DirPredIF.h"
00042 #include "Sim/Op/OpContainer/OpExtraStateTable.h"
00043 
00044 #include "Env/Param/ParamExchange.h"
00045 #include "Sim/Foundation/Resource/ResourceNode.h"
00046 
00047 namespace Onikiri 
00048 {
00049     class Core;
00050     class PHT;
00051     class GlobalHistory;
00052 
00053     class GShare : 
00054         public PhysicalResourceNode,
00055         public DirPredIF
00056     {
00057     private:
00058         // Parameter
00059         int m_globalHistoryBits;
00060         int m_pthIndexBits;
00061         bool m_addrXORConvolute;    // Calculate pht index using xor-convolution.
00062 
00063         // 
00064         Core* m_core;
00065         PHT*    m_pht;          // PHT
00066         PhysicalResourceArray<GlobalHistory> 
00067             m_globalHistory;    // GlobalHistory
00068 
00069         // Prediction information
00070         struct PredInfo
00071         {
00072             // PHT index used for updating PHT
00073             int  phtIndex;
00074 
00075             // predicted direction
00076             bool direction;
00077         };
00078         OpExtraStateTable<PredInfo> m_predTable;
00079 
00080         // statistical information
00081         s64 m_numPred;
00082         s64 m_numHit;
00083         s64 m_numMiss;
00084         s64 m_numRetire;
00085 
00086     public:
00087         BEGIN_PARAM_MAP("")
00088             BEGIN_PARAM_PATH( GetParamPath() )
00089                 PARAM_ENTRY("@GlobalHistoryBits",   m_globalHistoryBits)
00090                 PARAM_ENTRY("@AddressXORConvolute", m_addrXORConvolute)
00091             END_PARAM_PATH()
00092             BEGIN_PARAM_PATH( GetResultPath() )
00093                 PARAM_ENTRY( "@NumPred",        m_numPred)
00094                 PARAM_ENTRY( "@NumHit",     m_numHit)
00095                 PARAM_ENTRY( "@NumMiss",        m_numMiss)
00096                 PARAM_ENTRY( "@NumRetire",  m_numRetire)
00097                 RESULT_RATE_SUM_ENTRY( "@HitRate", \
00098                     m_numHit, m_numHit, m_numMiss )
00099             END_PARAM_PATH()
00100         END_PARAM_MAP()
00101 
00102         BEGIN_RESOURCE_MAP()
00103             RESOURCE_ENTRY( Core, "core", m_core )
00104             RESOURCE_ENTRY( PHT,  "pht",  m_pht )
00105             RESOURCE_ENTRY( GlobalHistory, "globalHistory", m_globalHistory )
00106         END_RESOURCE_MAP()
00107 
00108         GShare();
00109         virtual ~GShare();
00110 
00111         // 
00112         void Initialize(InitPhase phase);
00113 
00114         // \
00115         bool Predict(OpIterator op, PC predIndexPC);
00116 
00117         //
00118         // タs
00119         // タs\
00120         // A\
00121         //
00122         // opタsPHTUpdates
00123         void Finished(OpIterator op);
00124 
00125         // opretire
00126         void Retired(OpIterator op);
00127 
00128         // PCPHTCfbNX
00129         int GetPHTIndex(int localThreadID, const PC& pc);
00130 
00131     };
00132 
00133 }; // namespace Onikiri
00134 
00135 #endif // __GSHARE_H__
00136 

Onikiri2に対してTue Jun 18 14:34:25 2013に生成されました。  doxygen 1.4.7