src/Sim/Predictor/DepPred/MemDepPred/StoreSet.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 __STORESET_H__
00033 #define __STORESET_H__
00034 
00035 #include "Lib/shttl/setassoc_table.h"
00036 
00037 #include "Interface/Addr.h"
00038 #include "Env/Param/ParamExchange.h"
00039 
00040 #include "Sim/Predictor/DepPred/MemDepPred/MemDepPredIF.h"
00041 #include "Sim/Core/Core.h"
00042 #include "Sim/Op/OpArray/OpArray.h"
00043 #include "Sim/Op/OpContainer/OpExtraStateTable.h"
00044 #include "Sim/Dependency/MemDependency/MemDependency.h"
00045 #include "Sim/Foundation/Resource/ResourceNode.h"
00046 #include "Sim/ISAInfo.h"
00047 #include "Sim/Memory/AddrHasher.h"
00048 
00049 namespace Onikiri {
00050 
00051     // Store Set Predictor
00052     class StoreSet :
00053         public MemDepPredIF,
00054         public PhysicalResourceNode
00055     {
00056     private:
00057         static const int WORD_BITS = SimISAInfo::INSTRUCTION_WORD_BYTE_SHIFT;
00058         static const u64 INVALID_STORESET_ID = 1;
00059         typedef AdrHasher HasherType;
00060         typedef Addr StoreSetID;
00061         typedef shttl::setassoc_table< std::pair<Addr, StoreSetID>, HasherType> StoreIDTableType;
00062         typedef shttl::setassoc_table< std::pair<Addr, OpIterator>, HasherType> ProducerTableType;
00063 
00064         Core* m_core;
00065         StoreIDTableType* m_storeIDTable;
00066         ProducerTableType* m_producerTable;
00067         OpExtraStateTable<StoreSetID> m_allocatedStoreIDTable;
00068 
00069         int m_numStoreIDTableEntryBits;
00070         int m_numStoreIDTableWays;
00071         int m_numProducerTableEntryBits;
00072         int m_numProducerTableWays;
00073 
00074         int m_numStoreIDTableEntries;
00075         int m_numProducerTableEntries;
00076 
00077         int m_numAccessOrderViolated;
00078 
00079         SharedPtrObjectPool<MemDependency> m_memDepPool;
00080 
00081         void AllocateMemDependency(OpIterator op);
00082         void ResolveMemDependency(OpIterator consumer, OpIterator producer);
00083         void Deallocate(const OpIterator op);
00084 
00085         void UpdateStoreSetIDTable(OpIterator op, StoreSetID id);
00086         void UpdateProducerTable(StoreSetID id, OpIterator op);
00087         void ReleaseProducerTable(OpIterator op);
00088 
00089         StoreSetID GetNewID(const OpIterator op);
00090         StoreSetID GetStoreSetID(const OpIterator op);
00091         OpIterator GetProducerStore(const StoreSetID id);
00092 
00093 
00094     public:
00095         BEGIN_PARAM_MAP("")
00096             BEGIN_PARAM_PATH( GetParamPath() )
00097                 PARAM_ENTRY("@StoreIDTableEntryBits",   m_numStoreIDTableEntryBits)
00098                 PARAM_ENTRY("@StoreIDTableWays",        m_numStoreIDTableWays)
00099                 PARAM_ENTRY("@ProducerTableEntryBits",  m_numProducerTableEntryBits)
00100                 PARAM_ENTRY("@ProducerTableWays",       m_numProducerTableWays)
00101             END_PARAM_PATH()
00102             BEGIN_PARAM_PATH( GetResultPath() )
00103                 PARAM_ENTRY( "@NumStoreSetIDTableEntries",    m_numStoreIDTableEntries)
00104                 PARAM_ENTRY( "@NumProducerTableEntries",      m_numProducerTableEntries)
00105                 PARAM_ENTRY( "@NumAccessOrderViolation",      m_numAccessOrderViolated)
00106             END_PARAM_PATH()
00107         END_PARAM_MAP()
00108         
00109         BEGIN_RESOURCE_MAP()
00110             RESOURCE_ENTRY( Core, "core", m_core )
00111         END_RESOURCE_MAP()
00112 
00113         using ParamExchange::LoadParam;
00114         using ParamExchange::ReleaseParam;
00115 
00116         StoreSet();
00117         virtual ~StoreSet();
00118 
00119         virtual void Initialize(InitPhase phase);
00120 
00121         virtual void Resolve(OpIterator op);
00122         virtual void Allocate(OpIterator op);
00123         virtual void Commit(OpIterator op);
00124         virtual void Flush(OpIterator op);
00125 
00126         virtual void OrderConflicted(OpIterator producer, OpIterator consumer);
00127 
00128         virtual bool CanAllocate(OpIterator* infoArray, int numOp);
00129 
00130     };
00131 
00132 }; // namespace Onikiri
00133 
00134 #endif // __STORESET_H__

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