src/Sim/ExecUnit/ExecUnitBase.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 SIM_EXEC_UNIT_EXEC_UNIT_BASE_H
00033 #define SIM_EXEC_UNIT_EXEC_UNIT_BASE_H
00034 
00035 #include "Sim/Foundation/Resource/ResourceNode.h"
00036 #include "Sim/Foundation/Hook/HookDecl.h"
00037 #include "Sim/ExecUnit/ExecUnitIF.h"
00038 #include "Sim/ExecUnit/ExecUnitReserver.h"
00039 
00040 namespace Onikiri 
00041 {
00042     class ExecLatencyInfo;
00043     class Scheduler;
00044     class Core;
00045     struct IssueState;
00046 
00047     // Zタ
00048     class ExecUnitBase :
00049         public PhysicalResourceNode,
00050         public ExecUnitIF 
00051     {
00052     public:
00053         BEGIN_PARAM_MAP("")
00054             
00055             BEGIN_PARAM_PATH( GetParamPath() )
00056                 PARAM_ENTRY( "@Name",   m_name )
00057                 PARAM_ENTRY( "@Port",   m_numPorts )
00058                 PARAM_ENTRY( "@Code",   m_codeStr )
00059             END_PARAM_PATH()
00060             
00061             BEGIN_PARAM_PATH( GetResultPath() )
00062                 PARAM_ENTRY( "@Name",       m_name )
00063                 PARAM_ENTRY( "@NumUsed",    m_numUsed )
00064                 PARAM_ENTRY( "@NumUsable",  m_numUsable )
00065                 RESULT_RATE_SUM_ENTRY("@UseRate", \
00066                     m_numUsed, m_numUsed, m_numUsable
00067                 )
00068             END_PARAM_PATH()
00069 
00070         END_PARAM_MAP()
00071 
00072         BEGIN_RESOURCE_MAP()
00073             RESOURCE_ENTRY( ExecLatencyInfo,    "execLatencyInfo",  m_execLatencyInfo )
00074             RESOURCE_ENTRY( Core,               "core",             m_core )
00075         END_RESOURCE_MAP()
00076 
00077 
00078         ExecUnitBase();
00079         virtual ~ExecUnitBase();
00080         virtual void Initialize( InitPhase phase );
00081         virtual void Finalize();
00082 
00083         virtual int GetMappedCode(int index);
00084         virtual int GetMappedCodeCount();
00085 
00086         // タsCeV FinishEvent o^
00087         virtual void Execute( OpIterator op );
00088 
00089         // OpCode CeV
00090         virtual int GetLatencyCount( const OpClass& opClass );
00091 
00092         // OpCode CfNXCeV
00093         virtual int GetLatency( const OpClass& opClass, int index );
00094 
00095         // TCN
00096         virtual void Begin();
00097 
00098         // Called in Update phase.
00099         virtual void Update();
00100 
00101         // accessors
00102         ExecLatencyInfo* GetExecLatencyInfo()
00103         {
00104             return m_execLatencyInfo;
00105         }
00106 
00107         virtual ExecUnitReserver* GetReserver()  
00108         {
00109             return &m_reserver;
00110         }
00111 
00112     protected:
00113         std::string m_name;
00114         int         m_numPorts;     // ExecUnits\|[g
00115 
00116         // statistics
00117         u64 m_numUsed;
00118         u64 m_numUsable;
00119 
00120         // Latency 
00121         ExecLatencyInfo* m_execLatencyInfo;
00122         Core*            m_core;
00123         ExecUnitReserver m_reserver;
00124 
00125         void RegisterEvents( OpIterator op, const int latency );
00126         void RegisterFinishEvent( OpIterator op, const int latency );
00127         void RegisterRescheduleEvent( OpIterator op, const int latency, IssueState* issueState );
00128         void RegisterDetectEvent( OpIterator op, const int latency );
00129 
00130         std::vector<String> m_codeStr;
00131         std::vector<int>    m_code;
00132     };
00133 
00134 }; // namespace Onikiri
00135 
00136 #endif // SIM_EXEC_UNIT_EXEC_UNIT_BASE_H
00137 

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