ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
System.h
Go to the documentation of this file.
1 
53 #ifndef ETISS_INCLUDE_SYSTEM_H_
54 #define ETISS_INCLUDE_SYSTEM_H_
55 
56 #include "etiss/jit/CPU.h"
57 #include "etiss/jit/ReturnCode.h"
58 #include "etiss/jit/System.h"
59 
60 #include <memory>
61 
62 namespace etiss
63 {
76 class System
77 {
78  public:
79  inline virtual ~System() {}
80 
102 
126 
145 
164 
184 
201 
214  virtual void syncTime(ETISS_CPU *cpu) = 0;
215 };
216 
220 class SimpleSystem : public System
221 {
222  public:
223  inline virtual ~SimpleSystem() {}
224  virtual etiss::int32 iread(ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint32 len);
225  virtual etiss::int32 iwrite(ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len);
226  virtual etiss::int32 dread(ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len);
227  virtual etiss::int32 dwrite(ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len);
230  virtual void syncTime(ETISS_CPU *cpu);
231 
232  virtual bool read(bool debug, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len) = 0;
233  virtual bool write(bool debug, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len) = 0;
234 };
235 
240 extern std::shared_ptr<ETISS_System> wrap(etiss::System *sys);
241 
242 } // namespace etiss
243 
244 #endif
etiss_uint8 uint8
Definition: 386-GCC.h:76
etiss_int32 int32
Definition: 386-GCC.h:81
etiss_uint32 uint32
Definition: 386-GCC.h:80
etiss_uint64 uint64
Definition: 386-GCC.h:82
A simple system, that implements the etiss::System interface.
Definition: System.h:221
virtual etiss::int32 dread(ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
Data read operation.
Definition: System.cpp:147
virtual etiss::int32 dwrite(ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
Data write operation.
Definition: System.cpp:154
virtual etiss::int32 iread(ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint32 len)
Instruction read operation.
Definition: System.cpp:132
virtual bool write(bool debug, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)=0
virtual etiss::int32 dbg_read(etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
Debug read operation.
Definition: System.cpp:161
virtual ~SimpleSystem()
Definition: System.h:223
virtual etiss::int32 dbg_write(etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
Debug write operation.
Definition: System.cpp:168
virtual bool read(bool debug, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)=0
virtual etiss::int32 iwrite(ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
Instruction write operation.
Definition: System.cpp:140
virtual void syncTime(ETISS_CPU *cpu)
Synchronize simulation time.
Definition: System.cpp:175
System Interface for the basic system IO operations and time synchronization.
Definition: System.h:77
virtual void syncTime(ETISS_CPU *cpu)=0
Synchronize simulation time.
virtual etiss::int32 dbg_write(etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)=0
Debug write operation.
virtual ~System()
Definition: System.h:79
virtual etiss::int32 dbg_read(etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)=0
Debug read operation.
virtual etiss::int32 iwrite(ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)=0
Instruction write operation.
virtual etiss::int32 iread(ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint32 len)=0
Instruction read operation.
virtual etiss::int32 dwrite(ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)=0
Data write operation.
virtual etiss::int32 dread(ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)=0
Data read operation.
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
Definition: Benchmark.h:53
std::shared_ptr< ETISS_System > wrap(etiss::System *sys)
wraps a etiss::System in a ETISS_System structure.
Definition: System.cpp:94
basic cpu state structure needed for execution of any cpu architecture.
Definition: CPU.h:89