
TinyFarm is a small hardware-based farming game implemented in SystemVerilog. The design maintains internal state for four farm fields, each of which can be 1. empty, 2. growing a crop, or 3. ready to harvest. When a crop is planted, a growth timer begins and decreases on each game tick. Once the timer reaches zero, the crop becomes ready to harvest.
The system also includes an inventory and a customer order generator. The player must grow and harvest crops to fulfill orders before their timers expire. A background game clock controls crop growth and order countdown independently of user actions.
The design outputs a VGA signal (RGB222 format) that visually displays the farm grid, crop states, and game status. User inputs control field selection, crop selection, and actions such as planting, watering, harvesting, and fulfilling orders.
Use the input pins to control the game:
Mode select (ui[1:0])
Gameplay flow:
This project uses a Tiny VGA PMOD (RGB222 interface) to display the game output. The VGA signals are mapped to the output pins and can be connected directly to the Tiny VGA PMOD for visualization on a monitor.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | mode_sel[0] | vga_r[1] | |
| 1 | mode_sel[1] | vga_g[1] | |
| 2 | field_sel[0] | vga_b[1] | |
| 3 | field_sel[1] | vsync | |
| 4 | crop_sel[0] | vga_r[0] | |
| 5 | crop_sel[1] | vga_g[0] | |
| 6 | action_btn | vga_b[0] | |
| 7 | fulfill_btn | hsync |