ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
MemMappedPeriph.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_MEMMAPPEDPERIPH_H
8#define ETISS_PLUGIN_MEMMAPPEDPERIPH_H
9
10#include "etiss/Misc.h"
12
13namespace etiss
14{
15
16namespace plugin
17{
18
19static inline etiss_uint8 unimpl_read()
20{
21 etiss::log(etiss::WARNING, "Unimplemented MemMappedPeriph read");
22 return 0;
23}
24static inline void unimpl_write()
25{
26 etiss::log(etiss::WARNING, "Unimplemented MemMappedPeriph write");
27}
28
31{
33 size_t size = 0;
34};
35
38{
39 public:
47
48 public:
52 virtual MappedMemory getMappedMem() const = 0;
53
54 virtual etiss_uint8 read8(etiss_uint64 addr) { return unimpl_read(); }
55 virtual etiss_uint16 read16(etiss_uint64 addr) { return unimpl_read(); }
56 virtual etiss_uint32 read32(etiss_uint64 addr) { return unimpl_read(); }
57 virtual etiss_uint64 read64(etiss_uint64 addr) { return unimpl_read(); }
58 virtual void write8(etiss_uint64 addr, etiss_uint8 val) { unimpl_write(); }
59 virtual void write16(etiss_uint64 addr, etiss_uint16 val) { unimpl_write(); }
60 virtual void write32(etiss_uint64 addr, etiss_uint32 val) { unimpl_write(); }
61 virtual void write64(etiss_uint64 addr, etiss_uint64 val) { unimpl_write(); }
62
63 ETISS_System getWrapInfo(ETISS_System *origSystem) final;
64
65 private:
67};
68
69} // namespace plugin
70
71} // namespace etiss
72
73#endif
general configuration and logging
uint64_t etiss_uint64
Definition types.h:58
uint32_t etiss_uint32
Definition types.h:55
uint8_t etiss_uint8
Definition types.h:49
uint16_t etiss_uint16
Definition types.h:52
SystemWrapperPlugin to redirect data reads and writes to custom callbacks.
virtual etiss_uint8 read8(etiss_uint64 addr)
virtual void write64(etiss_uint64 addr, etiss_uint64 val)
virtual void write16(etiss_uint64 addr, etiss_uint16 val)
virtual MappedMemory getMappedMem() const =0
Defines in which memory region to map this peripheral.
virtual etiss_uint16 read16(etiss_uint64 addr)
virtual void write8(etiss_uint64 addr, etiss_uint8 val)
virtual etiss_uint64 read64(etiss_uint64 addr)
virtual etiss_uint32 read32(etiss_uint64 addr)
virtual void write32(etiss_uint64 addr, etiss_uint32 val)
ETISS_System getWrapInfo(ETISS_System *origSystem) final
Defines which System functions to wrap.
SystemWrapperPlugin that only wraps some of the System calls.
static void unimpl_write()
static etiss_uint8 unimpl_read()
forwards: include/jit/*
Definition Benchmark.h:17
@ WARNING
Definition Misc.h:86
void log(Verbosity level, std::string msg)
write log message at the given level.
Definition Misc.cpp:94
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
memory access and time synchronization functions.
Definition System.h:40
Represents a memory region that is associated with a MemMappedPeriph.