rogue
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
rogue::interfaces::memory::Emulate Class Reference

Memory interface emulator device. More...

#include <Emulate.h>

Inheritance diagram for rogue::interfaces::memory::Emulate:
rogue::interfaces::memory::Slave rogue::EnableSharedFromThis< rogue::interfaces::memory::Slave > rogue::EnableSharedFromThisBase

Public Member Functions

 Emulate (uint32_t min, uint32_t max)
 Constructs an emulator device.
 
 ~Emulate ()
 Destroys the emulator device.
 
void doTransaction (std::shared_ptr< rogue::interfaces::memory::Transaction > transaction)
 Handles an incoming memory transaction.
 
- Public Member Functions inherited from rogue::interfaces::memory::Slave
 Slave (uint32_t min, uint32_t max)
 Constructs a memory slave.
 
virtual ~Slave ()
 Destroys the memory slave instance.
 
virtual void stop ()
 Stops the memory slave interface.
 
void addTransaction (std::shared_ptr< rogue::interfaces::memory::Transaction > transaction)
 Adds a transaction to the internal tracking map.
 
std::shared_ptr< rogue::interfaces::memory::TransactiongetTransaction (uint32_t index)
 Gets a transaction from the internal tracking map.
 
uint32_t min ()
 Returns configured minimum transaction size.
 
uint32_t max ()
 Returns configured maximum transaction size.
 
uint32_t id ()
 Returns unique slave ID.
 
void setName (std::string name)
 Sets slave name.
 
std::string name ()
 Returns slave name.
 
virtual uint32_t doSlaveId ()
 Services SlaveId request from a master.
 
virtual std::string doSlaveName ()
 Services SlaveName request from a master.
 
virtual uint32_t doMinAccess ()
 Services getMinAccess request from an attached master.
 
virtual uint32_t doMaxAccess ()
 Services getMaxAccess request from an attached master.
 
virtual uint64_t doAddress ()
 Services getAddress request from an attached master.
 
void lshiftPy (boost::python::object p)
 Supports << operator usage from Python.
 
std::shared_ptr< rogue::interfaces::memory::Master > & operator<< (std::shared_ptr< rogue::interfaces::memory::Master > &other)
 Connects this slave to a master via chaining operator.
 
- Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::memory::Slave >
std::shared_ptr< rogue::interfaces::memory::Slaveshared_from_this ()
 Returns a shared_ptr<T> for this instance.
 
- Public Member Functions inherited from rogue::EnableSharedFromThisBase
virtual ~EnableSharedFromThisBase ()
 Virtual destructor for polymorphic base usage.
 

Static Public Member Functions

static std::shared_ptr< rogue::interfaces::memory::Emulatecreate (uint32_t min, uint32_t max)
 Creates an emulator device.
 
static void setup_python ()
 Registers this type with Python bindings.
 
- Static Public Member Functions inherited from rogue::interfaces::memory::Slave
static std::shared_ptr< rogue::interfaces::memory::Slavecreate (uint32_t min, uint32_t max)
 Creates a memory slave.
 
static void setup_python ()
 Registers this type with Python bindings.
 

Detailed Description

Memory interface emulator device.

Responds to memory read and write transactions and allocates backing memory on demand. This is primarily used for testing Rogue memory trees without hardware.

Definition at line 47 of file Emulate.h.

Constructor & Destructor Documentation

◆ Emulate()

rogue::interfaces::memory::Emulate::Emulate ( uint32_t  min,
uint32_t  max 
)

Constructs an emulator device.

Create an block.

This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.

Parameters
minMinimum transaction size in bytes, or 0 if not a virtual root.
maxMaximum transaction size in bytes, or 0 if not a virtual root.

Definition at line 49 of file Emulate.cpp.

◆ ~Emulate()

rogue::interfaces::memory::Emulate::~Emulate ( )

Destroys the emulator device.

Destroy a block.

Definition at line 56 of file Emulate.cpp.

Member Function Documentation

◆ create()

rogue::interfaces::memory::EmulatePtr rogue::interfaces::memory::Emulate::create ( uint32_t  min,
uint32_t  max 
)
static

Creates an emulator device.

Create a block, class creator.

Exposed to Python as rogue.interfaces.memory.Emulate(). This static factory is the preferred construction path when the object is shared across Rogue graph connections or exposed to Python. It returns std::shared_ptr ownership compatible with Rogue pointer typedefs.

Parameters
minMinimum transaction size in bytes, or 0 if not a virtual root.
maxMaximum transaction size in bytes, or 0 if not a virtual root.
Returns
Shared pointer to the created emulator.

Company : SLAC National Accelerator Laboratory

Description: A memory space emulator. Allows user to test a Rogue tree without real hardware.

This block will auto allocate memory as needed.

This file is part of the rogue software platform. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the rogue software platform, including this file, may be copied, modified, propagated, or distributed except according to the terms

contained in the LICENSE.txt file.

Definition at line 43 of file Emulate.cpp.

◆ doTransaction()

void rogue::interfaces::memory::Emulate::doTransaction ( std::shared_ptr< rogue::interfaces::memory::Transaction transaction)
virtual

Handles an incoming memory transaction.

Post a transaction. Master will call this method with the access attributes.

Parameters
transactionTransaction to execute against emulated memory.

Reimplemented from rogue::interfaces::memory::Slave.

Definition at line 65 of file Emulate.cpp.

◆ setup_python()

void rogue::interfaces::memory::Emulate::setup_python ( )
static

Registers this type with Python bindings.

Definition at line 115 of file Emulate.cpp.


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