Square Snake is a RISC-V assembly version of the classic Snake game. Designed and programmed by students at the University of Brasília, it brings together fundamental computer architecture concepts and hands-on programming on real hardware.
Built with RISC-V assembly and executed using the RARS simulator, this game runs on an FPGA development board (DE1-SoC) with visual and audio feedback. The game is controlled using a PS2 keyboard and rendered through VGA video output.
🧠
Key Learning Features
- Assembly programming using RV32IMF (Integer, Multiply, Floating-Point) instruction sets.
- Real hardware interaction using FPGA memory, bitmaps, and custom system calls.
- Modular program design using .asm files and register-level logic.
- Demonstrates concepts of pipeline architecture, instruction execution, and real-time I/O.
🎨
Game Design
- Snake made of 8x8 pixel blocks
- Snake grows with each apple eaten (adds 1 block)
- Score increases by 7 for each apple
- Snake speed increases as it eats more, raising difficulty
- Game Over conditions: snake hits the wall or itself
- Start/End screens use custom images rendered in separate VGA frames
🛠️
Tools Used
- RARS SYSTEMv17b – Enhanced RISC-V Simulator with ecall extensions
- Paint.NET – Created pixel graphics in BMP format
- GitHub – Version control and team collaboration
- PS2 Keyboard – Used for snake movement via “WASD” keys
🐛 Known Issues
- Apple may randomly spawn inside the snake’s body, making it unreachable. A future fix could include validating the spawn location before confirming.
🧪 Project Link
- 🔗 Watch Demo Video
- 🗂️ Ideal for use in upper high school or early college computer architecture and embedded systems courses.
Would you like this formatted for Webflow’s CMS fields or saved as a markdown or HTML snippet?