A MIPS-based image processing system that demonstrates CPU-GPU style architecture using the MARS MIPS simulator. Images are processed through actual MIPS assembly code running on the simulator.
- Real MIPS Processing: Image filters execute as actual MIPS assembly instructions
- Memory-Mapped I/O: Uses MMIO for CPU-GPU communication
- Dynamic Resolution: Support for 64×64, 128×128, and 256×256 pixel processing
- Three Filter Modes:
MODE_01: INVERT- XOR-based color inversionMODE_02: GRAY- Weighted grayscale conversionMODE_03: BRIGHT- Brightness adjustment with clamping
- Download Output: Save processed images as PNG/JPG
- Modern GUI: Pygame-based "Pixel Glitch" aesthetic frontend
MIPS-VGPU/
├── cpu/ # Python Frontend (Host)
│ ├── client.py # Pygame GUI application
│ ├── requirements.txt # Python dependencies
│ └── imgs/ # Sample images
│
├── vgpu/ # VGPU Core
│ ├── brain/ # MIPS Assembly
│ │ ├── kernal.asm # Kernel dispatcher
│ │ └── filters.asm # Filter implementations
│ └── ... # NetBeans project files
│
└── web_frontend/ # Alternative web interface
├── index.html
├── script.js
└── style.css
- Java 23 (or compatible with your MARS build)
- Python 3.8+ with Pygame
- MARS MIPS Simulator with GpuBridge tool (included in
E:\Programs\MARS-main)
cd "E:\Programs\MARS-main"
& "C:\Program Files\Java\jdk-23\bin\javac.exe" -cp . mars\tools\GpuBridge.java
& "C:\Program Files\Java\jdk-23\bin\java.exe" Mars- File → Open → Navigate to
vgpu/brain/kernal.asm - Press F3 to assemble
- Tools → VGPU Bridge
- Click Connect to MIPS → Start Listening
- Press F5 to run the kernel
cd "MIPS-VGPU/cpu"
pip install -r requirements.txt
python client.py- Click LOAD_SOURCE → Select an image
- Click CONNECT_BUS → Connect to VGPU server
- Select a filter mode (INVERT / GRAY / BRIGHT)
- Select a resolution (64×64 / 128×128 / 256×256)
- Click EXECUTE_MIPS → Watch the magic!
- Click DOWNLOAD → Save the processed image
┌──────────────────┐ TCP/65432 ┌──────────────────┐
│ Python Client │◄─────────────────►│ MARS (Java) │
│ (Pygame GUI) │ Pixel Data │ GpuBridge.java │
└──────────────────┘ └────────┬─────────┘
│ MMIO
┌────────▼─────────┐
│ MIPS Kernel │
│ kernal.asm │
│ + filters.asm │
└──────────────────┘
| Address | Purpose |
|---|---|
0xFFFF0000 |
Command Flag (1=Ready, 0=Idle) |
0xFFFF0004 |
Filter Mode (1=Invert, 2=Gray, 3=Bright) |
0xFFFF0008 |
Pixel Count (set by host for dynamic resolution) |
0x10040000 |
VRAM Start (pixel buffer, up to 256×256) |
- Python sends:
"IMG"+filter_mode (4B)+size (4B)+pixels - Java writes: pixels to VRAM, pixel count, filter mode, sets flag=1
- MIPS kernel: detects flag, reads pixel count, processes all pixels, resets flag=0
- Java reads: processed pixels, sends:
"RES"+size (4B)+pixels - Python displays: the processed result
xor $t3, $t3, 0x00FFFFFF # Flip all RGB bits# gray = (R + G + B) / 3
add $t6, $t3, $t4 # R + G
add $t6, $t6, $t5 # + B
div $t6, $t7 # / 3add $t3, $t3, 50 # R += 50
ble $t3, 255, ok # Clamp to 255
li $t3, 255| Button | Function |
|---|---|
| LOAD_SOURCE | Open file dialog to select input image |
| CONNECT_BUS | Connect to MARS VGPU Bridge server |
| EXECUTE_MIPS | Send image through MIPS for processing |
| DOWNLOAD | Save processed image as PNG/JPG |
| Setting | Options |
|---|---|
| Filter Mode | INVERT, GRAY, BRIGHT |
| Resolution | 64×64 (fast), 128×128 (medium), 256×256 (high quality) |
| Resolution | Pixels | Processing Time |
|---|---|---|
| 64×64 | 4,096 | ~instant |
| 128×128 | 16,384 | ~1-2 seconds |
| 256×256 | 65,536 | ~5-10 seconds |
Higher resolutions mean more MIPS instructions executed, resulting in longer processing times.
- Start Listening: Begin accepting connections on port 65432
- Connect to MIPS: Link bridge to MARS memory system
- Reset: Close all connections and clear log (allows reconnecting)
- Nathan Asif - System Architect (Kernel Dispatcher)
- Additional team members as per project requirements
This project is for educational purposes as part of the Computer Organization and Architecture course.
SSUET University | Semester 3 | COA Lab Project