ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
|
#include <SimpleMemSystem.h>
Public Types | |
enum | access_t { UNSET = 0 , READ = 1 , WRITE = 2 , EXEC = 4 } |
Public Member Functions | |
MemSegment (etiss::uint64 start_addr, etiss::uint64 size, access_t mode, const std::string name, etiss::uint8 *mem=nullptr, std::string initString="", bool InitEleSet=false, uint64_t randomRoot=0) | |
Constructor of Memory Segment. More... | |
void | memInit (std::string initString, uint64_t randomRoot=0) |
virtual | ~MemSegment (void) |
void | load (const void *data, size_t offset, size_t file_size_bytes) |
bool | addr_in_range (etiss::uint64 addr) const |
bool | payload_in_range (etiss::uint64 addr, etiss::uint64 payload_size) const |
Public Attributes | |
etiss::uint8 * | mem_ |
std::string | name_ |
const etiss::uint64 | start_addr_ |
const etiss::uint64 | end_addr_ |
const etiss::uint64 | size_ |
access_t | mode_ |
Private Attributes | |
bool | self_allocated_ { false } |
Definition at line 66 of file SimpleMemSystem.h.
Enumerator | |
---|---|
UNSET | |
READ | |
WRITE | |
EXEC |
Definition at line 71 of file SimpleMemSystem.h.
MemSegment::MemSegment | ( | etiss::uint64 | start_addr, |
etiss::uint64 | size, | ||
access_t | mode, | ||
const std::string | name, | ||
etiss::uint8 * | mem = nullptr , |
||
std::string | initString = "" , |
||
bool | InitEleSet = false , |
||
uint64_t | randomRoot = 0 |
||
) |
Constructor of Memory Segment.
start_addr | Start address of segment |
size | Size in bytes |
mode | Access Mode (R/W/X) |
name | Segment name |
mem | Pre-allocated Memory (not overwritten with initString) |
initString | String for initialization with imple_mem_system.memseg_initelement_ value: hex_string with 0x... / string /random options |
InitEleSet | Should self allocated MemSegment be initialized? |
randomRoot | If initString==Random use this value as generator root |
Definition at line 79 of file SimpleMemSystem.cpp.
References etiss::INFO, etiss::log(), mem_, memInit(), self_allocated_, and size_.
|
inlinevirtual |
Definition at line 107 of file SimpleMemSystem.h.
References mem_, and self_allocated_.
bool MemSegment::addr_in_range | ( | etiss::uint64 | addr | ) | const |
Definition at line 178 of file SimpleMemSystem.cpp.
References end_addr_, and start_addr_.
Referenced by payload_in_range().
Definition at line 170 of file SimpleMemSystem.cpp.
References mem_, memcpy(), and size_.
void MemSegment::memInit | ( | std::string | initString, |
uint64_t | randomRoot = 0 |
||
) |
Definition at line 104 of file SimpleMemSystem.cpp.
References exp, etiss::FATALERROR, etiss::INFO, etiss::log(), mem_, size_, and uint8_t.
Referenced by MemSegment().
bool MemSegment::payload_in_range | ( | etiss::uint64 | addr, |
etiss::uint64 | payload_size | ||
) | const |
Definition at line 183 of file SimpleMemSystem.cpp.
References addr_in_range(), and end_addr_.
const etiss::uint64 etiss::MemSegment::end_addr_ |
Definition at line 88 of file SimpleMemSystem.h.
Referenced by addr_in_range(), and payload_in_range().
etiss::uint8* etiss::MemSegment::mem_ |
Definition at line 84 of file SimpleMemSystem.h.
Referenced by load(), memInit(), MemSegment(), and ~MemSegment().
access_t etiss::MemSegment::mode_ |
Definition at line 90 of file SimpleMemSystem.h.
std::string etiss::MemSegment::name_ |
Definition at line 86 of file SimpleMemSystem.h.
Definition at line 68 of file SimpleMemSystem.h.
Referenced by MemSegment(), and ~MemSegment().
const etiss::uint64 etiss::MemSegment::size_ |
Definition at line 89 of file SimpleMemSystem.h.
Referenced by load(), memInit(), and MemSegment().
const etiss::uint64 etiss::MemSegment::start_addr_ |
Definition at line 87 of file SimpleMemSystem.h.
Referenced by addr_in_range().