ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
VirtualStructMemory.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_VIRTUALSTRUCTMEMORY_H
8#define ETISS_PLUGIN_VIRTUALSTRUCTMEMORY_H
9
10#include "etiss/Misc.h"
11#include "etiss/System.h"
12#include "etiss/VirtualStruct.h"
13
14namespace etiss
15{
16namespace plugin
17{
18
24{
25 public:
27 std::function<uint64_t(etiss::VirtualStruct::Field *, bool & /*dontMount*/)> mountPoint,
28 bool littleendian = true);
29 virtual ~VirtualStructMemory();
30
34 virtual bool read(bool debug, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len);
38 virtual bool write(bool debug, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len);
39
41
42 typedef std::map<uint64_t, std::pair<etiss::VirtualStruct::Field * /*field*/, size_t /*offset*/>> mapping_t;
46 inline const mapping_t &getMapping() { return memmap_; }
47 std::set<etiss::VirtualStruct::Field *> getMappedFields();
48
49 inline uint64_t startAddr() { return startaddr_; }
50 inline uint64_t endAddr() { return endaddr_; }
51
52 protected:
53 private:
58 std::list<std::shared_ptr<VirtualStruct::Field>> references;
59};
60
61} // namespace plugin
62} // namespace etiss
63
64#endif // ETISS_PLUGIN_VIRTUALSTRUCTMEMORY_H
general configuration and logging
static __inline__ uint64_t
Definition arm_cde.h:31
A simple system, that implements the etiss::System interface.
Definition System.h:182
a Field instance represents e.g.
abstract representation of an module of a simulation which could be a embedded device of the cpu of a...
allows to read/write to a virtual structure as if it is a memory.
virtual bool read(bool debug, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
virtual bool write(bool debug, ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
const etiss::VirtualStruct & mem_
std::list< std::shared_ptr< VirtualStruct::Field > > references
const mapping_t & getMapping()
returns the internal mapping
std::map< uint64_t, std::pair< etiss::VirtualStruct::Field *, size_t > > mapping_t
std::set< etiss::VirtualStruct::Field * > getMappedFields()
conatins a convinience class that can be wrapped as a ETISS_System structure
forwards: include/jit/*
Definition Benchmark.h:17
basic cpu state structure needed for execution of any cpu architecture.
Definition CPU.h:51