Block

For conceptual usage, see:

Implementation

This Python API is provided by a Rogue C++ class exported into Python.

Native C++ class: - Block

Generated API

class rogue.interfaces.memory.Block(offset, size)

C++: rogue::interfaces::memory::Block

Binding source: [Block.cpp]

Memory interface block device.

Bridges higher-level variable access to lower-level memory transactions. A Block owns staged byte storage for a register region and one or more Variable objects that map bit fields into that storage. Typed access methods (setUInt, getString, setFloat, etc.) are not selected directly by users of Block; instead, each Variable binds to the appropriate Block method pair according to its model (UInt, Int, Bool, String, Float, Double, Fixed, Bytes, PyFunc) and width constraints. Conversion and transport are separated:

  • Conversion methods (set*/get*) pack/unpack values between native types and staged bytes using variable metadata (bit offsets, bit widths, byte order, list indexing/stride).

  • Transaction methods (write, read, startTransaction, checkTransaction) move staged bytes to/from hardware and handle verify/retry/update behavior. Typical usage is through Variable APIs, which call the matching Block conversion method and then issue read/write transactions.

__init__(offset, size)

C++: rogue::interfaces::memory::Block

Constructs a block device with a given offset and size.

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

Parameters:
  • offset – Memory offset of the block.

  • size – Memory size (footprint) of the block.

setEnable(enable)

C++: rogue::interfaces::memory::Block::setEnable()

Sets the block enable state.

Exposed as setEnable() in Python.

Parameters:

enable – Set to true to enable block operations.

addVariables(variables)

C++: rogue::interfaces::memory::Block::addVariables()

Adds variables to this block (C++ API).

Exposed as addVariables() in Python.

Parameters:

variables – Variable list.

_setSlave(slave)

C++: rogue::interfaces::memory::Master::setSlave()

Sets the downstream slave or hub.

Transactions generated by this master are forwarded to this target. The target may be a leaf slave or a hub that forwards to lower levels. Exposed as _setSlave() in Python.

Parameters:

slave – Downstream slave or hub pointer.

_getSlave()

C++: rogue::interfaces::memory::Master::getSlave()

Returns the configured downstream slave or hub.

Exposed as _getSlave() in Python.

Returns:

Downstream slave or hub pointer.

_reqSlaveId()

C++: rogue::interfaces::memory::Master::reqSlaveId()

Queries the downstream slave ID.

Forwards the request to the lowest-level slave servicing this master path. This is used to determine which masters share an address space. Exposed as _reqSlaveId() in Python.

Returns:

Unique 32-bit slave ID.

_reqSlaveName()

C++: rogue::interfaces::memory::Master::reqSlaveName()

Queries the downstream slave name.

Forwards the request to the lowest-level slave servicing this master path. This allows the system to determine which memory Masters share an address space. Exposed as _reqSlaveName() in Python.

Returns:

Slave name string.

_reqMinAccess()

C++: rogue::interfaces::memory::Master::reqMinAccess()

Queries minimum access size in bytes for this interface path.

Request is forwared to the lowest-level slave to determine the minimum transaction size. Exposed as _reqMinAccess() in Python.

Returns:

Minimum transaction size in bytes.

_reqMaxAccess()

C++: rogue::interfaces::memory::Master::reqMaxAccess()

Queries maximum access size in bytes for this interface path.

Request is forwared to the lowest-level slave to determine the maximum transaction size. Exposed as _reqMaxAccess() in Python.

Returns:

Maximum transaction size in bytes.

_reqAddress()

C++: rogue::interfaces::memory::Master::reqAddress()

Queries the address offset of the next downstream layer.

Returns the relative offset of the connected slave/hub and does not include any local master offset. Exposed as _reqAddress() in Python.

Returns:

Downstream relative address offset.

_getError()

C++: rogue::interfaces::memory::Master::getError()

Returns the last transaction error string.

Exposed as _getError() in Python.

Returns:

Error string for the last transaction sequence.

_clearError()

C++: rogue::interfaces::memory::Master::clearError()

Clears the stored transaction error string.

Exposed as _clearError() in Python.

_setTimeout(timeout)

C++: rogue::interfaces::memory::Master::setTimeout()

Sets the timeout value for future transactions.

Timeout controls how long the master waits for transaction completion. Exposed as _setTimeout() in Python.

Parameters:

timeout – Timeout value in microseconds. A value of 0 leaves the current timeout unchanged.

_reqTransaction()

C++: rogue::interfaces::memory::Master::_reqTransaction()

No binding docstring provided.

_waitTransaction(id)

C++: rogue::interfaces::memory::Master::waitTransaction()

Waits for transaction completion or timeout.

Passing 0 waits for all currently pending transactions. Exposed as _waitTransaction() in Python.

Parameters:

id – Transaction ID to wait for, or 0 for all.

_copyBits(dstData, dstLsb, srcData, srcLsb, size)

C++: rogue::interfaces::memory::Master::copyBits()

Copies bits between two byte arrays.

Copies size bits from srcData starting at bit srcLsb into dstData starting at bit dstLsb. Bit numbering is least-significant-bit-first within each byte (bit 0 is the LSB of byte 0). The routine preserves destination bits outside the copied range and supports arbitrary unaligned source/destination bit offsets. When both offsets are byte-aligned, it uses a byte-copy fast path. This helper underpins variable packing/unpacking logic in the memory layer. Exposed as _copyBits() in Python.

Parameters:
  • dstData – Destination byte array.

  • dstLsb – Least-significant destination bit index.

  • srcData – Source byte array.

  • srcLsb – Least-significant source bit index.

  • size – Number of bits to copy.

_setBits(dstData, lsb, size)

C++: rogue::interfaces::memory::Master::setBits()

Sets a contiguous bit range in a byte array.

Sets size bits to 1 in dstData starting at bit lsb. Bit numbering is least-significant-bit-first within each byte (bit 0 is the LSB of byte 0). Bits outside the requested range are left unchanged. For byte-aligned regions, it uses a byte-fill fast path. This helper is used to build masks such as overlap and verify masks. Exposed as _setBits() in Python.

Parameters:
  • dstData – Destination byte array.

  • lsb – Least-significant bit index to set.

  • size – Number of bits to set.

_anyBits(srcData, lsb, size)

C++: rogue::interfaces::memory::Master::anyBits()

Tests whether any bit in a range is set.

Checks size bits in srcData starting at bit lsb and returns true if at least one bit is 1. Bit numbering is least-significant-bit-first within each byte (bit 0 is the LSB of byte 0). This helper is commonly used for overlap and mask checks. Exposed as _anyBits() in Python.

Parameters:
  • srcData – Source byte array to check.

  • lsb – Least-significant bit index to check.

  • size – Number of bits to check.

Returns:

true if any bit in the range is set; otherwise false.

__rshift__(other)

C++: rogue::interfaces::memory::Master::rshiftPy()

Supports >> operator usage from Python.

_stop()

C++: rogue::interfaces::memory::Master::stop()

Stops the interface and releases runtime resources.