tiny8.visualizer module¶
Visualization helpers using Matplotlib to plot register/memory changes.
This module provides a simple Visualizer class that can create an animated visualization of the CPU step trace showing SREG bits, registers and a memory range.
- class tiny8.visualizer.Visualizer(cpu)[source]¶
Bases:
object- animate_execution(mem_addr_start=96, mem_addr_end=127, filename=None, interval=200, fps=30, fontsize=9, cmap='inferno', plot_every=1)[source]¶
Animate SREG bits, registers (R0..R31), and a memory range as three stacked subplots.
- Parameters:
mem_addr_start (int) – Start memory address for memory subplot.
mem_addr_end (int) – End memory address for memory subplot.
filename (str | None) – Optional output filename for saving animation.
interval (int) – Milliseconds between frames.
fps (int) – Frames per second for saving output.
fontsize – Font size for labels and ticks.
cmap – Matplotlib colormap name for the heatmaps.
plot_every (int) – Plot every N steps (downsampling).
- show_register_history(registers=None, figsize=(14, 8))[source]¶
Plot timeline of register value changes over execution.
- show_memory_access(mem_addr_start=0, mem_addr_end=255, figsize=(12, 8))[source]¶
Plot a heatmap showing memory access patterns over time.