00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef __EMULATOR_WRAPPER_H
00033 #define __EMULATOR_WRAPPER_H
00034
00035 #include "Interface/EmulatorIF.h"
00036 #include "Sim/Foundation/Resource/ResourceNode.h"
00037
00038 namespace Onikiri
00039 {
00040 class EmulatorWrapper :
00041 public EmulatorIF,
00042 public PhysicalResourceNode
00043 {
00044 EmulatorIF* m_body;
00045 public:
00046
00047 EmulatorWrapper()
00048 {
00049 m_body = NULL;
00050 }
00051
00052 ~EmulatorWrapper()
00053 {
00054 ReleaseParam();
00055 }
00056
00057 void SetEmulator( EmulatorIF* body )
00058 {
00059 m_body = body;
00060 }
00061
00062
00063
00064
00065 BEGIN_RESOURCE_MAP()
00066 END_RESOURCE_MAP()
00067
00068 void Initialize(InitPhase phase)
00069 {
00070 };
00071
00072
00073
00074
00075
00076 std::pair<OpInfo**, int> GetOp(PC pc)
00077 {
00078 return m_body->GetOp( pc );
00079 }
00080
00081 MemIF* GetMemImage()
00082 {
00083 return m_body->GetMemImage();
00084 }
00085
00086 void Execute( OpStateIF* opStateIF, OpInfo* opInfo )
00087 {
00088 m_body->Execute( opStateIF, opInfo );
00089 }
00090
00091 void Commit( OpStateIF* opStateIF, OpInfo* opInfo )
00092 {
00093 m_body->Commit( opStateIF, opInfo );
00094 }
00095
00096 int GetProcessCount() const
00097 {
00098 return m_body->GetProcessCount();
00099 }
00100
00101 PC GetEntryPoint(int pid) const
00102 {
00103 return m_body->GetEntryPoint( pid );
00104 }
00105
00106 u64 GetInitialRegValue(int pid, int index) const
00107 {
00108 return m_body->GetInitialRegValue( pid, index );
00109 }
00110
00111 ISAInfoIF* GetISAInfo()
00112 {
00113 return m_body->GetISAInfo();
00114 }
00115
00116 PC Skip(PC pc, u64 skipCount, u64* regArray, u64* executedInsnCount, u64* executedOpCount)
00117 {
00118 return m_body->Skip( pc, skipCount, regArray, executedInsnCount, executedOpCount );
00119 }
00120
00121 void SetExtraOpDecoder( ExtraOpDecoderIF* extraOpDecoder )
00122 {
00123 m_body->SetExtraOpDecoder( extraOpDecoder );
00124 }
00125 };
00126 }
00127
00128 #endif // #ifndef __EMULATOR_WRAPPER_H