Memory
- class lauterbach.trace32.rcl.MemoryService(conn)
- read(address, *, length, width=None)
Read data at address.
The raw data is returned in an array of bytes.
- Parameters:
address (Address) – Address of the access.
length (int) – Length of the read access in
byte.width (int | None) – Width of the data access. Defaults to None.
- Raises:
MemoryReadError – Memory access failed.
- Return type:
bytes
- read_int8(address, *, width=1)
Read signed 8-bit value from address and return result.
- Parameters:
address (Address) – Address to read from.
width (int, optional) – Reserved.
- Returns:
Result
- Return type:
int
- read_int8_array(address, *, length, width=1)
Read signed 8-bit values from address and return result.
- Parameters:
address (Address) – Address to read from
length (int) – Array Length.
width (int, optional) – Reserved.
- Returns:
Result
- Return type:
array.array
- read_uint8(address, *, width=1)
Read unsigned 8-bit value from address and return result.
- Parameters:
address (Address) – Address to read from
width (int, optional) – Reserved.
- Returns:
Result
- Return type:
int
- read_uint8_array(address, *, length=1, width=1)
Read unsigned 8-bit values from address and return result.
- Parameters:
address (Address) – Address to read from
length (int) – Number of 8-bit values to read
width (int, optional) – Reserved.
- Returns:
Result
- Return type:
Tuple[int]
- read_int16(address, *, byteorder=None, width=2)
Read signed 16-bit value from address and return result.
- Parameters:
address (Address) – Address to read from
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int, optional) – Reserved.
- Returns:
Result
- Return type:
int
- read_uint16(address, *, byteorder=None, width=2)
Read unsigned 16-bit value from address and return result.
- Parameters:
address (Address) – Address to read from
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int) – Reserved
- Returns:
Result
- Return type:
int
- read_int32(address, *, byteorder=None, width=4)
Read signed 32-bit value from address and return result.
- Parameters:
address (Address) – Address to read from
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int) – Reserved
- Returns:
Result
- Return type:
int
- read_uint32(address, *, byteorder=None, width=4)
Read unsigned 32-bit value from address and return result.
- Parameters:
address (Address) – Address to read from
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int) – Reserved
- Returns:
Result
- Return type:
int
- read_int64(address, *, byteorder=None, width=8)
Read signed 64-bit value from address and return result.
- Parameters:
address (Address) – Address to read from
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int) – Reserved
- Returns:
Result
- Return type:
int
- read_uint64(address, *, byteorder=None, width=8)
Read unsigned 64-bit value from address and return result.
- Parameters:
address (Address) – Address to read from
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int) – Reserved
- Returns:
Result
- Return type:
int
- read_float(address, *, byteorder=None, width=4)
Read 32-bit IEEE floating point value from address and return result.
- Parameters:
address (Address) – Address to read from
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int) – Reserved
- Returns:
Result
- Return type:
float
- read_double(address, *, byteorder=None, width=8)
Read IEEE double value from address and return result.
- Parameters:
address (Address) – Address to read from
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int) – Reserved
- Returns:
Result
- Return type:
float
- write(address, data, *, length=None, width=None)
Write data to address.
- Parameters:
address (Address) – Address of the access.
data (bytes) – Data to write.
length (int | None) – Length of the write access in
byteor none to infer the length fromlen(data). Defaults to None.width (int | None) – Width of the data access. Defaults to None.
- Raises:
MemoryWriteAccessError – Memory access failed.
- Return type:
None
- write_int8(address, value, *, width=1)
Write signed 8-bit value to address.
- Parameters:
address (Address) – Address to write to.
value (int) – Value to write.
width (int, optional) – Reserved.
- write_int8_array(address, data, *, width=1)
Write data as signed 8-bit values to address.
- Parameters:
address (Address) – Address to read from
data (Tuple[int]) – Data to write.
width (int, optional) – Reserved.
- write_uint8(address, value, *, width=1)
Write unsigned 8-bit value to address.
- Parameters:
address (Address) – Address to write to.
value (int) – Value to write.
width (int, optional) – Reserved.
- write_uint8_array(address, data, *, width=1)
Write data as signed 8-bit values to address.
- Parameters:
address (Address) – Address to read from
data (Tuple[int]) – Data to write.
width (int, optional) – Reserved.
- write_int16(address, value, *, byteorder=None, width=2)
Write signed 16-bit value to address.
- Parameters:
address (Address) – Address to write to.
value (int) – Value to write.
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int, optional) – Reserved.
- write_uint16(address, value, *, byteorder=None, width=2)
Write unsigned 16-bit value to address.
- Parameters:
address (Address) – Address to write to.
value (int) – Value to write.
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int, optional) – Reserved.
- write_int32(address, value, *, byteorder=None, width=4)
Write signed 32-bit value to address.
- Parameters:
address (Address) – Address to write to.
value (int) – Value to write.
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int, optional) – Reserved.
- write_uint32(address, value, *, byteorder=None, width=4)
Write unsigned 32-bit value to address.
- Parameters:
address (Address) – Address to write to.
value (int) – Value to write.
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int, optional) – Reserved.
- write_int64(address, value, *, byteorder=None, width=8)
Write signed 64-bit value to address.
- Parameters:
address (Address) – Address to write to.
value (int) – Value to write.
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int, optional) – Reserved.
- write_uint64(address, value, *, byteorder=None, width=8)
Write unsigned 64-bit value to address.
- Parameters:
address (Address) – Address to write to.
value (int) – Value to write.
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int, optional) – Reserved.
- write_float(address, value, *, byteorder=None, width=4)
Write 32-bit IEEE floating point value to address.
- Parameters:
address (Address) – Address to read from.
value (float) – Value to write.
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int) – Reserved
- write_double(address, value, *, byteorder=None, width=8)
Write IEEE double value to address.
- Parameters:
address (Address) – Address to read from.
value (float) – Value to write.
byteorder (NoneType, str) – Accepted values are None, “little” and “big”.
width (int) – Reserved
- execute_bundle(bundle)
Execute memory access bundle.
All accesses are executed, even if some fail. It’s the caller’s responsibility to check each MemoryAccessResult’s error attribute.
- Parameters:
bundle (MemoryAccessBundle) – Memory access bundle to execute.
- Returns:
List of results, one per command in the bundle.
- Return type:
list[MemoryAccessResult]
- Raises:
MemoryAccessError – TODO
- class lauterbach.trace32.rcl.MemoryAccessBundle
- add_read(address, *, length, width=None)
Add a read access to the bundle.
- Parameters:
address (Address) – Read address.
length (int) – Access length in bytes.
width (Optional[int], optional) – Access width in bytes. Defaults to None.
- Return type:
None
- add_write(address, data, *, width=None)
Add a write access to the bundle.
- Parameters:
address (Address) – Write address.
data (bytes) – Bytes to write.
width (Optional[int], optional) – Access width in bytes. Defaults to None.
- Return type:
None
- add_readwrite(address, data, mask, *, width=None)
Add a read-write access to the bundle.
First reads len(data) bytes at address. Then writes ((read_data & ~mask) | (data & mask)) to address.
- Parameters:
address (Address) – Read-write address
data (bytes) – Bytes to write.
mask (bytes) – Mask for write.
width (Optional[int], optional) – Access width in bytes. Defaults to None.
- Return type:
None
- class lauterbach.trace32.rcl.MemoryAccessResult(data=None, error=None)
Result of a memory access.
- Parameters:
data (bytes | None)
error (Exception | None)
- data
Data if data was returned, None otherwise.
- Type:
Optional[bytes]
- error
Exception when an error occurred, None otherwise.
- Type:
Optional[Exception], optional