Skip to content

jamylak/cpuinside03

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cpuinside03

cpuinside03 is a small Raylib app that renders an interactive CPU blueprint for an AArch64 lock-contention scenario. The code is AI Slop but the visualisation is cool.

cpuinside.mov

The visualization focuses on:

  • two CPU cores with register files, ALU, load/store units, and L1 data caches
  • a coherency fabric and main memory
  • a source-to-assembly view of a spinlock loop using LDAXR / STXR
  • a kernel-side futex path showing syscall entry, wait queue, scheduler, and wakeup flow

The app is not a hardware simulator. It is a visual walkthrough of a fixed 12-step sequence that shows how lock ownership, cache-line state, and the fallback into futex_wait move through the system.

Build

This repo contains a single C source file, main.c, and a simple Makefile.

Requirements:

  • a C compiler such as cc or clang
  • raylib
  • pkg-config so the Makefile can resolve Raylib compiler and linker flags

Build and run:

make
make run

The binary produced by the Makefile is blueprint_app.

Controls

  • q: quit
  • 1: switch to the blueprint page
  • 2: switch to Page 2
  • space: pause or resume time-based animation
  • n or Right Arrow: advance the lock/coherency demo by one step
  • r: reset the camera, execution state, page, and pause state
  • left mouse drag: pan the blueprint
  • mouse wheel: zoom around the cursor
  • left click or drag inside the minimap: jump the camera within the world
  • left click on the top bar page buttons: switch pages

What You See

Page 1 is the main view. It contains four top-level regions:

  • C++ Source
  • Assembly
  • CPU
  • Kernel

As you zoom in, more detail appears, including:

  • highlighted source and assembly lines for the current step
  • register values and read/write ports
  • active cache-line ownership and coherence state
  • syscall, futex queue, scheduler, and wakeup annotations
  • a minimap for navigating the large blueprint

Page 2 currently exists in the UI but is only a placeholder labeled "Reserved for future views."

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors