63 bool dontMount =
false;
64 uint64_t addr = mountPoint(f, dontMount);
75 for (
size_t i = 0; i < f->
width_; ++i)
78 memmap_.insert(std::make_pair(addr + i, std::make_pair(f, (littleendian ? i : (f->
width_ - 1 - i)))));
92 for (
unsigned i = 0; i < len; ++i)
94 auto find =
memmap_.find(addr + i);
98 size_t off = find->second.second << 3;
101 buf[i] = (
uint8_t)(fval & 0xFF);
114 for (
unsigned i = 0; i < len; ++i)
116 auto find =
memmap_.find(addr + i);
120 size_t off = find->second.second << 3;
129 std::stringstream ss;
130 ss <<
"write to field " << f->
name_ <<
"{" << f->
prettyname_ <<
"}: 0x" << std::hex << f->
read()
131 <<
" (offset: 0x" << std::hex << find->second.second <<
")" << std::endl;
149 std::set<etiss::VirtualStruct::Field *> ret;
153 ret.insert(iter->second.first);
__DEVICE__ int max(int __a, int __b)
static __inline__ uint64_t
static __inline__ uint8_t
a Field instance represents e.g.
const std::string name_
name of the field.
const size_t width_
width in bytes (rounded up if neccessary)
void write(uint64_t)
function to write bits/a value to the Field.
uint64_t read() const
function to read bits/a value from the Field.
const std::string prettyname_
alternative/human readable name of the field.
abstract representation of an module of a simulation which could be a embedded device of the cpu of a...
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)
VirtualStructMemory(const etiss::VirtualStruct &str, std::function< uint64_t(etiss::VirtualStruct::Field *, bool &)> mountPoint, bool littleendian=true)
std::list< std::shared_ptr< VirtualStruct::Field > > references
uint64_t endaddr_
excluded
std::set< etiss::VirtualStruct::Field * > getMappedFields()
virtual ~VirtualStructMemory()
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
basic cpu state structure needed for execution of any cpu architecture.