ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
etiss::MemSegment Class Reference

#include <SimpleMemSystem.h>

Collaboration diagram for etiss::MemSegment:
Collaboration graph
[legend]

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::uint8mem_
 
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 }
 

Detailed Description

Definition at line 66 of file SimpleMemSystem.h.

Member Enumeration Documentation

◆ access_t

Enumerator
UNSET 
READ 
WRITE 
EXEC 

Definition at line 71 of file SimpleMemSystem.h.

Constructor & Destructor Documentation

◆ MemSegment()

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.

Parameters
start_addrStart address of segment
sizeSize in bytes
modeAccess Mode (R/W/X)
nameSegment name
memPre-allocated Memory (not overwritten with initString)
initStringString for initialization with imple_mem_system.memseg_initelement_ value: hex_string with 0x... / string /random options
InitEleSetShould self allocated MemSegment be initialized?
randomRootIf 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_.

Here is the call graph for this function:

◆ ~MemSegment()

virtual etiss::MemSegment::~MemSegment ( void  )
inlinevirtual

Definition at line 107 of file SimpleMemSystem.h.

References mem_, and self_allocated_.

Member Function Documentation

◆ addr_in_range()

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().

Here is the caller graph for this function:

◆ load()

void MemSegment::load ( const void *  data,
size_t  offset,
size_t  file_size_bytes 
)

Definition at line 170 of file SimpleMemSystem.cpp.

References mem_, memcpy(), and size_.

Here is the call graph for this function:

◆ memInit()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ payload_in_range()

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_.

Here is the call graph for this function:

Member Data Documentation

◆ 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().

◆ mem_

etiss::uint8* etiss::MemSegment::mem_

Definition at line 84 of file SimpleMemSystem.h.

Referenced by load(), memInit(), MemSegment(), and ~MemSegment().

◆ mode_

access_t etiss::MemSegment::mode_

Definition at line 90 of file SimpleMemSystem.h.

◆ name_

std::string etiss::MemSegment::name_

Definition at line 86 of file SimpleMemSystem.h.

◆ self_allocated_

bool etiss::MemSegment::self_allocated_ { false }
private

Definition at line 68 of file SimpleMemSystem.h.

Referenced by MemSegment(), and ~MemSegment().

◆ size_

const etiss::uint64 etiss::MemSegment::size_

Definition at line 89 of file SimpleMemSystem.h.

Referenced by load(), memInit(), and MemSegment().

◆ start_addr_

const etiss::uint64 etiss::MemSegment::start_addr_

Definition at line 87 of file SimpleMemSystem.h.

Referenced by addr_in_range().


The documentation for this class was generated from the following files: