ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
RV32IMACFDArchSpecificImp.h
Go to the documentation of this file.
1
11#ifndef ETISS_RV32IMACFDArch_RV32IMACFDARCHSPECIFICIMP_H_
12#define ETISS_RV32IMACFDArch_RV32IMACFDARCHSPECIFICIMP_H_
13
14#include <cstdint>
15#include "etiss/Instruction.h"
16#include "etiss/VirtualStruct.h"
17#include "etiss/jit/CPU.h"
18#include "RV32IMACFD.h"
19
28{
29 private:
30 const unsigned gprid_;
31
32 public:
34 // clang-format off
35 : Field(
36 parent,
37 std::string("X") + etiss::toString(gprid),
38 std::string("X") + etiss::toString(gprid),
39 R|W,
40 4
41 ),
42 // clang-format on
43 gprid_(gprid)
44 {
45 }
46
47 RegField_RV32IMACFD(etiss::VirtualStruct &parent, std::string name, unsigned gprid)
48 // clang-format off
49 : Field(
50 parent,
51 name,
52 name,
53 R|W,
54 4
55 ),
56 // clang-format on
57 gprid_(gprid)
58 {
59 }
60
62
63 protected:
64 virtual uint64_t _read() const
65 {
66 // clang-format off
68 // clang-format on
69 }
70
71 virtual void _write(uint64_t val)
72 {
73 // clang-format off
74 etiss::log(etiss::VERBOSE, "write to ETISS cpu state", name_, val);
76 // clang-format on
77 }
78};
79
81{
82 public:
84 // clang-format off
85 : Field(
86 parent,
87 "instructionPointer",
88 "instructionPointer",
89 R|W,
90 4
91 )
92 // clang-format on
93 {
94 }
95
97
98 protected:
99 virtual uint64_t _read() const
100 {
101 // clang-format off
102 return (uint64_t) ((ETISS_CPU *)parent_.structure_)->instructionPointer;
103 // clang-format on
104 }
105
106 virtual void _write(uint64_t val)
107 {
108 // clang-format off
109 etiss::log(etiss::VERBOSE, "write to ETISS cpu state", name_, val);
110 ((ETISS_CPU *)parent_.structure_)->instructionPointer = (etiss_uint32) val;
111 // clang-format on
112 }
113};
114
115#endif
contains container classes to store instruction definitions + translation functions and build a trans...
static __inline__ uint64_t
Definition arm_cde.h:31
uint32_t etiss_uint32
Definition types.h:55
Generated on Mon, 10 Nov 2025 11:27:12 +0000.
virtual void _write(uint64_t val)
override this function to implement writes in case of AccessMode::VIRTUAL / AccessMode::PREFER_LAMBDA
RegField_RV32IMACFD(etiss::VirtualStruct &parent, std::string name, unsigned gprid)
virtual uint64_t _read() const
override this function to implement reads in case of AccessMode::VIRTUAL / AccessMode::PREFER_LAMBDA
RegField_RV32IMACFD(etiss::VirtualStruct &parent, unsigned gprid)
a Field instance represents e.g.
static const int W
write flag
Field(VirtualStruct &parent, const std::string &name, const std::string &prettyname, int flags, size_t width, size_t bitwidth=0)
const std::string name_
name of the field.
VirtualStruct & parent_
reference to parent virtual struct
static const int R
read flag
abstract representation of an module of a simulation which could be a embedded device of the cpu of a...
virtual uint64_t _read() const
override this function to implement reads in case of AccessMode::VIRTUAL / AccessMode::PREFER_LAMBDA
virtual void _write(uint64_t val)
override this function to implement writes in case of AccessMode::VIRTUAL / AccessMode::PREFER_LAMBDA
pcField_RV32IMACFD(etiss::VirtualStruct &parent)
forwards: include/jit/*
Definition Benchmark.h:17
@ VERBOSE
Definition Misc.h:88
void log(Verbosity level, std::string msg)
write log message at the given level.
Definition Misc.cpp:94
STL namespace.
basic cpu state structure needed for execution of any cpu architecture.
Definition CPU.h:51
Generated on Mon, 10 Nov 2025 11:27:12 +0000.
Definition RV32IMACFD.h:18