ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
MemoryDevice.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2//
3// This file is part of ETISS. It is licensed under the BSD 3-Clause License; you may not use this file except in
4// compliance with the License. You should have received a copy of the license along with this project. If not, see the
5// LICENSE file.
6
7#ifndef ETISS_PLUGIN_MEMORYDEVICE_H
8#define ETISS_PLUGIN_MEMORYDEVICE_H
9
10#include "etiss/Plugin.h"
11#include "etiss/Misc.h"
12
13namespace etiss
14{
15namespace plugin
16{
17
19{
20 public:
21 const std::string name_;
22 MemoryDeviceMapper(std::string name);
23 virtual ~MemoryDeviceMapper();
24 virtual ETISS_System *wrap(ETISS_CPU *cpu, ETISS_System *system);
25 virtual ETISS_System *unwrap(ETISS_CPU *cpu, ETISS_System *system);
26
27 // similar to etiss::System interface but not overrideable to increase performance
28 etiss::int32 iread(ETISS_System *sys, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint32 len);
29 etiss::int32 iwrite(ETISS_System *sys, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len);
30 etiss::int32 dread(ETISS_System *sys, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len);
31 etiss::int32 dwrite(ETISS_System *sys, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len);
32 etiss::int32 dbg_read(ETISS_System *sys, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len);
33 etiss::int32 dbg_write(ETISS_System *sys, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len);
34
35 inline const std::vector<etiss::System *> &devices() { return devices_; }
36
37 virtual int map(bool ibus, bool read, bool dbg, uint64_t addr, uint8_t *buf, unsigned len, unsigned &newlen);
38
39 virtual bool mount(etiss::System *sys, uint64_t mask, uint64_t addr);
40
41 protected:
42 std::vector<etiss::System *> devices_;
43 std::vector<std::pair<uint64_t, uint64_t>> mountPoints_;
44
45 private:
46};
47
48} // namespace plugin
49} // namespace etiss
50
51#endif // ETISS_PLUGIN_MEMORYDEVICE_H
general configuration and logging
plugins for extensions to code translation and instruction execution
static __inline__ uint64_t
Definition arm_cde.h:31
static __inline__ uint8_t
Definition arm_mve.h:323
this plugin allows to wrap the ETISS_System interface
Definition Plugin.h:286
System Interface for the basic system IO operations and time synchronization.
Definition System.h:38
std::vector< etiss::System * > devices_
etiss::int32 dread(ETISS_System *sys, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
etiss::int32 dbg_read(ETISS_System *sys, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
const std::vector< etiss::System * > & devices()
virtual int map(bool ibus, bool read, bool dbg, uint64_t addr, uint8_t *buf, unsigned len, unsigned &newlen)
virtual bool mount(etiss::System *sys, uint64_t mask, uint64_t addr)
virtual ETISS_System * unwrap(ETISS_CPU *cpu, ETISS_System *system)
undo wrap function call this function will be called AFTER etiss::Plugin::cleanup
etiss::int32 dbg_write(ETISS_System *sys, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
std::vector< std::pair< uint64_t, uint64_t > > mountPoints_
etiss::int32 iwrite(ETISS_System *sys, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
etiss::int32 iread(ETISS_System *sys, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint32 len)
etiss::int32 dwrite(ETISS_System *sys, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
virtual ETISS_System * wrap(ETISS_CPU *cpu, ETISS_System *system)
change/wrap the passed system structure.
forwards: include/jit/*
Definition Benchmark.h:17
basic cpu state structure needed for execution of any cpu architecture.
Definition CPU.h:51
memory access and time synchronization functions.
Definition System.h:40