|
rogue
|
Memory-slave bridge for direct /dev/mem mapped register access.
More...
#include <MemMap.h>
Public Member Functions | |
| MemMap (uint64_t base, uint32_t size) | |
| Constructs a raw memory-map bridge instance. | |
| ~MemMap () | |
| Destroys the raw memory-map bridge instance. | |
| void | stop () |
Stops worker thread, unmaps memory, and closes /dev/mem. | |
| void | doTransaction (std::shared_ptr< rogue::interfaces::memory::Transaction > tran) |
| Queues a memory transaction for asynchronous mapped-memory access. | |
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. | |
| void | addTransaction (std::shared_ptr< rogue::interfaces::memory::Transaction > transaction) |
| Adds a transaction to the internal tracking map. | |
| std::shared_ptr< rogue::interfaces::memory::Transaction > | getTransaction (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::Slave > | shared_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::hardware::MemMap > | create (uint64_t base, uint32_t size) |
| Creates a raw memory-map bridge instance. | |
| static void | setup_python () |
| Registers Python bindings for this class. | |
Static Public Member Functions inherited from rogue::interfaces::memory::Slave | |
| static std::shared_ptr< rogue::interfaces::memory::Slave > | create (uint32_t min, uint32_t max) |
| Creates a memory slave. | |
| static void | setup_python () |
| Registers this type with Python bindings. | |
Memory-slave bridge for direct /dev/mem mapped register access.
MemMap maps a physical address range from Linux /dev/mem into user space and services Rogue memory transactions against that mapped region.
Transaction flow:
doTransaction() enqueues requests from upstream memory masters.This class is intended for environments where raw memory mapping is permitted and safe for the target platform.
| rogue::hardware::MemMap::MemMap | ( | uint64_t | base, |
| uint32_t | size | ||
| ) |
Constructs a raw memory-map bridge instance.
Creator.
This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.
Opens /dev/mem, maps the requested physical range, and starts worker thread for queued transaction processing.
| base | Physical base address to map. |
| size | Size of address space to map in bytes. |
Definition at line 54 of file MemMap.cpp.
| rogue::hardware::MemMap::~MemMap | ( | ) |
|
static |
Creates a raw memory-map bridge instance.
Class creation.
Parameter semantics are identical to the constructor; see MemMap() for mapping and worker-thread setup details. Exposed to Python as rogue.hardware.MemMap(). 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.
| base | Physical base address to map. |
| size | Size of address space to map in bytes. |
MemMap.Description:
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
Definition at line 48 of file MemMap.cpp.
|
virtual |
Queues a memory transaction for asynchronous mapped-memory access.
Post a transaction.
| tran | Transaction received from upstream memory master. |
Reimplemented from rogue::interfaces::memory::Slave.
Definition at line 91 of file MemMap.cpp.
|
static |
Registers Python bindings for this class.
Definition at line 159 of file MemMap.cpp.
|
virtual |
Stops worker thread, unmaps memory, and closes /dev/mem.
Reimplemented from rogue::interfaces::memory::Slave.
Definition at line 79 of file MemMap.cpp.