src/Sim/Predictor/DepPred/RegDepPred/RMT.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 #ifndef __RMT_H__
00033 #define __RMT_H__
00034 
00035 #include "Sim/Foundation/Checkpoint/CheckpointedData.h"
00036 #include "Interface/EmulatorIF.h"
00037 #include "Sim/Dependency/PhyReg/PhyReg.h"
00038 #include "Sim/Register/RegisterFile.h"
00039 #include "Sim/Register/RegisterFreeList.h"
00040 #include "Sim/Foundation/Hook/HookDecl.h"
00041 #include "Sim/ISAInfo.h"
00042 
00043 #include "Sim/Predictor/DepPred/RegDepPred/RegDepPredBase.h"
00044 
00045 namespace Onikiri 
00046 {
00047 
00048     // WX^W\タ
00049     // WX^^C~Om
00050 
00051     class RMT :
00052         public RegDepPredBase, public PhysicalResourceNode
00053     {
00054     protected:
00055         int m_numLogicalReg;
00056         int m_numRegSegment;
00057 
00058         //
00059         Core* m_core;
00060         CheckpointMaster* m_checkpointMaster;
00061 
00062         // emulator
00063         EmulatorIF* m_emulator;
00064 
00065         // WX^{
00066         RegisterFile* m_registerFile;
00067 
00068         // _WX^ZOgi[e[u
00069         boost::array<int, SimISAInfo::MAX_REG_COUNT> m_segmentTable;
00070 
00071         // t[Xg
00072         // Allocation\WX^
00073         RegisterFreeList* m_regFreeList;
00074 
00075         // _WX^L[AWX^}bsOe[u
00076         CheckpointedData<
00077             boost::array< int, SimISAInfo::MAX_REG_COUNT >
00078         > m_allocationTable;
00079 
00080         // opfXeBl[VEWX^R~bgWX^}bsOe[u
00081         // opfXeBl[VEWX^WX^L[
00082         std::vector<int> m_releaseTable;
00083 
00084         // member methods
00085         int GetRegisterSegmentID(int index)
00086         {
00087             return m_segmentTable[index];
00088         }
00089 
00090     public:
00091         // s_releaseRegHook op CWX^C
00092         // WX^gKop
00093         struct HookParam
00094         {   
00095             OpIterator op;
00096             int logicalRegNum;
00097             int physicalRegNum;
00098         };
00099 
00100     protected:
00101         // AllocateReg/ReleaseReg/DeallocateReg タ
00102         virtual void AllocateRegBody( HookParam* param );
00103         virtual void ReleaseRegBody ( HookParam* param );
00104         virtual void DeallocateRegBody( HookParam* param ); 
00105 
00106     public:
00107         BEGIN_RESOURCE_MAP()
00108             RESOURCE_ENTRY( EmulatorIF, "emulator", m_emulator )
00109             RESOURCE_ENTRY( Core, "core", m_core )
00110             RESOURCE_ENTRY( RegisterFile, "registerFile", m_registerFile )
00111             RESOURCE_ENTRY( RegisterFreeList, "registerFreeList", m_regFreeList )
00112             RESOURCE_ENTRY( CheckpointMaster, "checkpointMaster", m_checkpointMaster )
00113         END_RESOURCE_MAP()
00114 
00115         RMT();
00116         virtual ~RMT();
00117 
00118         virtual void Initialize(InitPhase phase);
00119 
00120         // \[XEWX^WX^
00121         virtual int ResolveReg(const int lno);
00122 
00123         // ResolveReg lWX^D
00124         // CC
00125         // pD
00126         virtual int PeekReg(const int lno) const;
00127 
00128         // fXeBl[VEWX^WX^
00129         virtual int AllocateReg(OpIterator op, const int lno);
00130 
00131         // retireAopWX^
00132         virtual void ReleaseReg(OpIterator op, const int lno, int phyRegNo);
00133         // flushAopfXeBl[VEWX^
00134         virtual void DeallocateReg(OpIterator op, const int lno, int phyRegNo); 
00135 
00136         // numWX^
00137         virtual bool CanAllocate(OpIterator* infoArray, int numOp);
00138 
00139         // _/WX^
00140         virtual int GetRegSegmentCount();
00141         virtual int GetLogicalRegCount(int segment);
00142         virtual int GetTotalLogicalRegCount();
00143 
00144         //
00145         // Hook
00146         //
00147 
00148         // Prototype : void Method( HookParameter<RMT,HookParam>* param )
00149         static HookPoint<RMT,HookParam> s_allocateRegHook;
00150         static HookPoint<RMT,HookParam> s_releaseRegHook;
00151         static HookPoint<RMT,HookParam> s_deallocateRegHook;
00152 
00153     };
00154 
00155 }; // namespace Onikiri
00156 
00157 #endif // __RMT_H__
00158 

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