Memory

class chipscopy.api.memory.Memory(*args, **kwargs)[source]

Provides memory read and memory write service for a device.

Examples:

some_values = device.memory_read(address=0xF2010000, num=2, target="DPC")
rpu = session.memory.filter_by(name="RPU").at(0)
some_values = rpu.memory_read(0xF2010000, 2)
dpc = device.memory.get(name="DPC")
dpc.memory_write(0xF2010000, [0x12345678, 0xDEADC0FE])
static check_and_upgrade(memory_view, node)[source]

Converts a client MemoryNode to Memory

Return type:

Memory

property filter_by

Specifies the dict used for filtering memory objects in the device and session. Filters memory in the QueryList returned by Session.memory and Device.memory.

Returns:

dict[str,value]

static is_compatible(node)[source]

True if Memory is a compatible node type

Return type:

bool

memory_read(address, num=1, size='w')[source]

Read and return <num> data values from the target’s memory address specified by <address>.

num defaults to 1 if not specified. size defaults to ‘w’ if not specified.

size <access-size> can be one of the values below:
b = Bytes accesses
h = Half-word accesses
w = Word accesses (default)
d = Double-word accesses
Parameters:
  • address (int) – Address for memory write

  • num (int) – number of values to read

  • size (str) – ‘b’,’h’,’w’,’d’

Return type:

List[int]

memory_write(address, values, size='w')[source]

Write values from list of <values> to memory address specified by <address>.

size defaults to ‘w’ if not specified.

size <access-size> can be one of the values below:
b = Bytes accesses
h = Half-word accesses
w = Word accesses (default)
d = Double-word accesses
Parameters:
  • address (int) – Address for memory write

  • values (List[int]) – List of integer values to write

  • size (str) – ‘b’,’h’,’w’,’d’

post_init()[source]

Called at the end of node upgrade