CPUINSIGHT is a graphical user interface built on top of the CPUINSIGHT CPU simulation backend, providing real-time visualization of CPU instruction execution and branch prediction behavior.
This repository focuses on the GUI frontend, enabling interactive inspection of pipeline flow, register states, and branch predictor performance while leveraging the original CPU simulation core.
- Interactive GUI - Real-time visualization of CPU pipeline
- Multiple Branch Predictors - Support for various prediction algorithms
- Instruction Pipeline Display - Visualize instruction execution flow
- Register File Visualization - Watch register values update in real-time
- Performance Metrics - Track prediction accuracy and performance
- CMake 3.16+ - Download
- Git - Download
- C++17 Compiler
- Windows: Visual Studio 2019+ or MinGW
- Linux: GCC 8+ or Clang 7+
- Mac: Xcode Command Line Tools
# Clone the repository
git clone https://github.com/tuncaygafarli/cpuinsight.git
cd cpuinsight
# Create build directory
mkdir build
cd build
# Configure with CMake
cmake .. -DCMAKE_BUILD_TYPE=Release
# Build the project
cmake --build . --config Release
# Run the application
cd bin/Release
CPUINSIGHT.exe# Clone the repository
git clone https://github.com/tuncaygafarli/cpuinsight.git
cd cpuinsight
# Create build directory
mkdir build
cd build
# Configure with CMake
cmake .. -DCMAKE_BUILD_TYPE=Release
# Build the project
cmake --build . --config Release -j4 # Use 4 cores for faster build
# Run the application
cd bin/Release
./CPUINSIGHT@echo off
echo Building CPUINSIGHT...
mkdir build 2>nul
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
echo.
echo Running CPUINSIGHT...
cd bin/Release
CPUINSIGHT.exe
pause#!/bin/bash
echo "Building CPUINSIGHT..."
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release -j$(nproc)
echo -e "\nRunning CPUINSIGHT..."
cd bin
./CPUINSIGHTcpuinsight/
βββ cpu/ # CPU simulation core
β βββ cpu.cpp # CPU emulation
β βββ cpu.h # CPU definitions
β βββ branchpredictor.cpp # Branch predictor algorithms
β βββ branchpredictor.h # Branch predictor definitions
β βββ instruction.cpp # Instructions logic
β βββ instruction.h # Instructor definitions
βββ gui/ # GUI rendering and interface
β βββ gui_render.cpp # Main GUI rendering logic
β βββ gui_render.h # GUI Rendering definitions
β βββ gui_command_parser.cpp # GUI Command Parser logic (CLI)
β βββ gui_command_parser.h # GUI Command Parser definitions
β βββ helpers.cpp # Helper functions
β βββ helpers.h # Helpers definitions
βββ parser/ # Parser files
β βββ parser.cpp # Assembly parsing
β βββ parser.h # Parser definitions
β βββ lookup.cpp # Instruction lookup tables
β βββ lookup.h # Lookup definitions
β βββ token.h # Token definitions
βββ main.cpp # Entry point
βββ aliases.h # Aliases definitions
βββ CMakeLists.txt # CMake Lists
βββ (other files...)
- ArrowUp : Scrolls up in INSTRUCTION section
- ArrowDown : Scrolls down in INSTRUCTION section
- SpaceBar : Executes only one instruction
- V : Enables / disables automatic execution
- R : Resets the process
- LShift : Increases auto CPU execution delay
- LControl : Decreases auto CPU execution delay
# Debug build (with symbols)
cmake .. -DCMAKE_BUILD_TYPE=Debug
# Release build (optimized)
cmake .. -DCMAKE_BUILD_TYPE=Release
# RelWithDebInfo (optimized with debug info)
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
# MinSizeRel (minimum size)
cmake .. -DCMAKE_BUILD_TYPE=MinSizeRel# Build Debug version
cmake --build . --config Debug
# Build Release version
cmake --build . --config Release
# Clean and rebuild
cmake --build . --config Release --clean-firstBasic implementation using simple heuristics for branch prediction.
Uses a global history register to track branch patterns and adapts prediction based on recent history.
Maintains separate prediction history for each branch address, allowing per-branch optimization.
Hybrid approach that combines global branch history with branch address for improved accuracy.
- Add source files to the appropriate directory (
src/gui/,src/cpu/, orsrc/parser/) - Update
CMakeLists.txtif adding new source files:# Add to the existing file glob pattern file(GLOB_RECURSE SRC_FILES "src/gui/*.cpp" "src/cpu/*.cpp" "src/parser/*.cpp" # Add new patterns here if needed )
- Rebuild the project:
cd build cmake --build . --config Debug
-
CPU Simulation Backend Developed by f3rhd Licensed under the MIT License
-
GUI Frontend Developed by Tuncay Gafarli
This repository is a fork of the original CPUINSIGHT project and focuses on GUI-level visualization.
-
The CPU simulation backend is licensed under the MIT License Β© 2025 f3rhd
-
The GUI frontend additions in this repository are Β© 2025 Tuncay Gafarli
See the LICENSE files for full details.