Skip to main content

meminsp — Memory State Inspector

Use meminsp to inspect a tile's memory at a particular simulation cycle, compare values between cycles, or find when an address was written.

Start an inspection​

Use the image, symbol map, and log from the same simulation run:

meminsp img_path=bench.img map_path=bench.map log_path=bench-sim.log tile_str=T0.0
  • bench.img supplies the initial memory contents.
  • bench.map supplies symbol names and addresses.
  • bench-sim.log supplies the recorded memory writes.
  • T0.0 selects column 0, row 0. Change it to the tile you want to inspect. meminsp reports the selected tile as P0.0.

The image is required. Without the map, inspect numeric addresses; without the log, only the initial memory contents are available. Cycle inspection requires a log containing memory-write events, such as the log from a GOAL=debugx run.

Inspect values​

At the meminsp> prompt:

tile T0.0
symbols
seek 100
print recv.result
read 0x100 8

Replace recv.result with a name from symbols. Addresses are hexadecimal word addresses; each word is 16 bits. read 0x100 8 displays eight words starting at address 0x100.

Find a write​

seek 0
watch 0x100 changed
run
watchlist

run advances through the recorded writes until a watchpoint triggers or the log ends. It does not resume the simulator. Use unwatch <id> with the ID reported by watchlist to remove a watchpoint.

A watchpoint can target an address or a symbol. Conditions are ==, !=, <, >, and changed; omit the condition to stop on any write:

watch 0x100 == 42
watch recv.result != 0

Comparison values can be decimal or 0x-prefixed hexadecimal. Watchpoints compare individual 16-bit words. Set them after selecting the tile you want to inspect.

Command reference​

CommandPurpose
tile T<x>.<y>Select a tile and return to its initial state
seek <cycle>Inspect memory at a cycle; can move backward or forward
step [n]Advance by recorded write events, default 1
read <addr> [count]Display words starting at a hexadecimal address
dump <start> <end>Display an inclusive range of hexadecimal addresses
print <symbol> [@cycle]Display a symbol, optionally at a specified cycle
diff <symbol> @<c1> @<c2>Compare a symbol's contents between cycles
symbolsList symbols for the selected tile
info <symbol>Show a symbol's address, size, and dimensions
watch <addr-or-symbol> [condition] [value]Add a watchpoint
watchlistList watchpoints and their IDs
unwatch <id>Remove a watchpoint
runAdvance until a watchpoint triggers or the trace ends
statusShow the selected tile and cycle
helpShow available commands
quitExit

For example, diff recv.result @0 @200 compares that symbol at cycles 0 and 200. Both print ... @cycle and diff change the current inspection cycle; use status to check your position.

Use from a script​

Pass a command with cmd_str to execute it and exit. Add json for JSON output:

meminsp img_path=bench.img map_path=bench.map log_path=bench-sim.log \
tile_str=T0.0 cmd_str="print recv.result @100" json

If something is missing​

  • Unknown symbol: run symbols and check that the map belongs to this image.
  • No tile selected: use tile T<x>.<y> before inspecting memory.
  • Memory never changes: check that the log is from the same run and contains memory-write events for the selected tile. Writes absent from the log cannot be inspected.