PeePeePooPoo-Software-Industries-LTC / VoiceGame_VHDL

The VHDL/FPGA side of the project, meant to sythesize into hardware through the DE2-115 Board.
GNU General Public License v3.0
0 stars 0 forks source link

VoiceGame

The official documentation for the VoiceGame project.

Goal

The goal of this project is to develop a game that runs on custom synthesized hardware, running on a Cyclone IV FPGA on the DE2-115 board, using a microphone as method of input.

Setup

Connect the DE2-115 board to power via the power jack, then connect the board to a laptop/desktop via USB, using the USB-B port closest to the powerjack. (Blaster should be written on the PCB below it.)

Power up the DE2-115 board by pressing the red switch next to the powerjack, and wait until the board's default program starts running.

Open the "VoiceGame_VHDL.qpf" via Quartus (either by opening it as project, or double-clicking the file with Quartus installed).
Then, start the synthesis by pressing the play button icon (Or hitting Ctrl+L), and wait until this has completed.

Once this has completed, upload the synthesized code to the DE2-115 board via the Programmer in Quartus (the blue rhombus with colored lines above it), selecting the USB-Blaster hardware in the "Hardware Setup".

After this, pressing the "start" button should begin uploading the generated files.
Once the synthesized device has uploaded, open the Eclipse enviroment in "Tools > NIOS II Software Build Tools for Eclipse".

Once eclipse has started, if the folders "gameconsole" and "gameconsole_bsp" are already in the project list left of the screen, all that needs to be done is:

Right click the BSP folder, and click on "Nios II > Generate BSP", then wait until it has generated, before pressing "Project > Build All" (or pressing Ctrl+B).

Once it has build, all that's left to do is pressing the down arrow next to the run button and pressing "Run Configurations". Then, double click "Nios II Hardware" to create a new configuration, make sure both fields in the top of the "Project" tab are not empty, and then press "Run".

This should upload the compiled code directly to the NIOS II running on the board, and the game should start itself once the code is fully uploaded.

Files

This project contains the following files and directories:

Software

This directory stores all folders and files used in compiling for the NIOS II processor.

Gameconsole

The folder containing the game's actual C code, and the list of files/paths for including the BSP folder below.
hello_world.c contains the game logic, and the following are manually added libraries:

The above mentioned files each handle their respective section of the connected (synthesized) hardware and deeper functions, audio.h handles the audio IP component, graphics.h handles the VGA components & drawing the images onto the framebuffer.
The images.h file stores the used images in a special image format to optimize memory usage.

Gameconsole BSP

This folder contains most of the drivers and libraries used within the project, including things such as system.h which contains the DEFINES used within the game's code. This folder is auto-generated by quartus, and should not be used to change values directly (these will be overwriten when the BSP is regenerated).

Images

The folder used to store the game's images in PNG format as means of a preview. For the image 'files' directly used within the game, see images.c.

NIOSII_Test (and other files)

The folder for the NIOS II IP variation used, this folder contains a large amount of nested VHDL and Verilog files. Opening this should be done via the NIOSII_Test.qsys in Platform Designer.

Main.qsf

This is the file in which the pin assignments are made, can be read as .txt file.

Main.vhd

The top-level VHDL object, and the main code file ran when synthesizing the hardware via Quartus.