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::plugin::VirtualStructMemory Class Reference

allows to read/write to a virtual structure as if it is a memory. More...

#include <VirtualStructMemory.h>

Inheritance diagram for etiss::plugin::VirtualStructMemory:
Inheritance graph
[legend]
Collaboration diagram for etiss::plugin::VirtualStructMemory:
Collaboration graph
[legend]

Public Types

typedef std::map< uint64_t, std::pair< etiss::VirtualStruct::Field *, size_t > > mapping_t
 

Public Member Functions

 VirtualStructMemory (const etiss::VirtualStruct &str, std::function< uint64_t(etiss::VirtualStruct::Field *, bool &)> mountPoint, bool littleendian=true)
 
virtual ~VirtualStructMemory ()
 
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 mapping_tgetMapping ()
 returns the internal mapping More...
 
std::set< etiss::VirtualStruct::Field * > getMappedFields ()
 
uint64_t startAddr ()
 
uint64_t endAddr ()
 
- Public Member Functions inherited from etiss::SimpleSystem
virtual ~SimpleSystem ()
 
virtual etiss::int32 iread (ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint32 len)
 Instruction read operation. More...
 
virtual etiss::int32 iwrite (ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
 Instruction write operation. More...
 
virtual etiss::int32 dread (ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
 Data read operation. More...
 
virtual etiss::int32 dwrite (ETISS_CPU *cpu, etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
 Data write operation. More...
 
virtual etiss::int32 dbg_read (etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
 Debug read operation. More...
 
virtual etiss::int32 dbg_write (etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
 Debug write operation. More...
 
virtual void syncTime (ETISS_CPU *cpu)
 Synchronize simulation time. More...
 
- Public Member Functions inherited from etiss::System
virtual ~System ()
 

Public Attributes

const etiss::VirtualStructmem_
 

Private Attributes

uint64_t startaddr_
 
uint64_t endaddr_
 excluded More...
 
mapping_t memmap_
 
std::list< std::shared_ptr< VirtualStruct::Field > > references
 

Detailed Description

allows to read/write to a virtual structure as if it is a memory.

Any mapped field is addressed as little endian.

Definition at line 58 of file VirtualStructMemory.h.

Member Typedef Documentation

◆ mapping_t

Definition at line 77 of file VirtualStructMemory.h.

Constructor & Destructor Documentation

◆ VirtualStructMemory()

etiss::plugin::VirtualStructMemory::VirtualStructMemory ( const etiss::VirtualStruct str,
std::function< uint64_t(etiss::VirtualStruct::Field *, bool &)>  mountPoint,
bool  littleendian = true 
)

Definition at line 50 of file VirtualStructMemory.cpp.

References endaddr_, max(), memmap_, references, startaddr_, get_metrics::str, uint64_t, and etiss::VirtualStruct::Field::width_.

Here is the call graph for this function:

◆ ~VirtualStructMemory()

etiss::plugin::VirtualStructMemory::~VirtualStructMemory ( )
virtual

Definition at line 84 of file VirtualStructMemory.cpp.

Member Function Documentation

◆ endAddr()

uint64_t etiss::plugin::VirtualStructMemory::endAddr ( )
inline

Definition at line 88 of file VirtualStructMemory.h.

References endaddr_.

◆ getMappedFields()

std::set< etiss::VirtualStruct::Field * > etiss::plugin::VirtualStructMemory::getMappedFields ( )

Definition at line 146 of file VirtualStructMemory.cpp.

References memmap_.

◆ getMapping()

const mapping_t& etiss::plugin::VirtualStructMemory::getMapping ( )
inline

returns the internal mapping

Definition at line 81 of file VirtualStructMemory.h.

References memmap_.

◆ read()

bool etiss::plugin::VirtualStructMemory::read ( bool  debug,
ETISS_CPU cpu,
etiss::uint64  addr,
etiss::uint8 buf,
etiss::uint32  len 
)
virtual
Attention
all mapped fields are addressed as little endian

Implements etiss::SimpleSystem.

Definition at line 89 of file VirtualStructMemory.cpp.

References memmap_, etiss::VirtualStruct::Field::read(), uint64_t, and uint8_t.

Here is the call graph for this function:

◆ startAddr()

uint64_t etiss::plugin::VirtualStructMemory::startAddr ( )
inline

Definition at line 87 of file VirtualStructMemory.h.

References startaddr_.

◆ write()

bool etiss::plugin::VirtualStructMemory::write ( bool  debug,
ETISS_CPU cpu,
etiss::uint64  addr,
etiss::uint8 buf,
etiss::uint32  len 
)
virtual
Attention
all mapped fields are addressed as little endian

Implements etiss::SimpleSystem.

Definition at line 111 of file VirtualStructMemory.cpp.

References memmap_, etiss::VirtualStruct::Field::name_, etiss::VirtualStruct::Field::prettyname_, etiss::VirtualStruct::Field::read(), uint64_t, uint8_t, and etiss::VirtualStruct::Field::write().

Here is the call graph for this function:

Member Data Documentation

◆ endaddr_

uint64_t etiss::plugin::VirtualStructMemory::endaddr_
private

excluded

Definition at line 94 of file VirtualStructMemory.h.

Referenced by endAddr(), and VirtualStructMemory().

◆ mem_

const etiss::VirtualStruct& etiss::plugin::VirtualStructMemory::mem_

Definition at line 75 of file VirtualStructMemory.h.

◆ memmap_

mapping_t etiss::plugin::VirtualStructMemory::memmap_
private

Definition at line 95 of file VirtualStructMemory.h.

Referenced by getMappedFields(), getMapping(), read(), VirtualStructMemory(), and write().

◆ references

std::list<std::shared_ptr<VirtualStruct::Field> > etiss::plugin::VirtualStructMemory::references
private

Definition at line 96 of file VirtualStructMemory.h.

Referenced by VirtualStructMemory().

◆ startaddr_

uint64_t etiss::plugin::VirtualStructMemory::startaddr_
private

Definition at line 92 of file VirtualStructMemory.h.

Referenced by startAddr(), and VirtualStructMemory().


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