452 Group Reportbreakout
452 Group Reportbreakout
Group Report
ENSC 452 Final Project Report, Group 14
Jianglin(Arlene) Fu, Ruisi(Sam) Wang
09/04/2018
1
Table of Contents
Introduction 2
Background 2
System overview 3
System Block Diagram 3
IP used 4
User Manual 4
Reference 19
2
1. Introduction
The goal of this ENSC 452 course is to implement a program on ZedBoard with
both Xilinx's system software and hardware. We decide our project to be a video game
similar to the brick breaker. In our game, the user can move the bar at the bottom of the
screen left and right in order to bounce the movable ball up and try to hit the bricks.
Once the ball hit any brick, the brick will be downgraded and eventually wiped out. We
will split our job into 6 milestones and use Agile methodology to accept greater
flexibility and to get higher efficiency. Each part will be tested by a specific test plan to
ensure the completeness.
2. Background
Breakout is a traditional arcade game developed and published by Atari, Inc. And
Brick Breaker is a clone of Breakout. The game consists of 50 bricks on the top of the
screen, a flying ball and a movable paddle on the bottom of the screen. The paddle is
controlled by the user to move either left or right. Player need to use this paddle to
prevent the ball from falling out of the screen. Three unbreakable walls on the side of
the screen are used to deflect the ball. The collision between the ball and bricks can
make brick downgraded or disappear. The speed of ball gradually goes up with time.
The level of bricks is also upgraded as time goes on, which means it requires more than
one collision to smash the upgraded bricks. The game will continuously proceed as long
as the ball is not falling out of the screen. During playing, the user is able to pause the
game and continuous again.
3
This game connects to a standard keyboard to get user input and use VGA port
to display the whole video screen. If we have enough time, we will play audio and make
sound synchronous to break a brick. And try to use the mouse to control the paddle.
3. System overview
a. System Block Diagram
Figure 1 is our system block diagram. The blocks with white background
is the Xilinx IP. Yellow block is designed by Arlene Fu, green block is designed by
Rui Si Wang. Arlene Fu has more resiblsibleslity on hardware of the project, and
Rui Si Wang has more in software of the project.
Figure 1. System block diagram
4
b. IP used
● Most of the IP cores used in our project are provided by Xilinx, which are
presented within blue border.
● The VGA controller is modified by Arlene, the original code is from:
http://blog.dev-flow.com/en/11-create-a-vga-controller-for-the-zedboard/
[1]
● The Audio controller is modified by Sam, the original code is from:
https://github.com/ems-kl/zedboard_audio [2]
● LFSR is the pseudo-random number generator designed by Arlene
● Button Controller / Debounce is AXI GPIO IP with a debounce block
designed by Arlene
● FIFO is a Stream FIFO, which is a Xilinx IP block but modified settings by
Arlene
● VDMA is the IP block from Xilinx, but the driver code is borrowed from
Wesley Kendall, https://piazza.com/class/jbenuzkh1151xw?cid=9 [ 3]
● PS GPIO and General Interrupt Controller are Xilinx IP blocks but Arlene
implemented the interrupt service routine
c. User Manual
Before playing the game, user need to be familiarize with 7 buttons on the
ZedBoard. As shown in Figure 2, the left two buttons are the control buttons for
the second player. For easy understanding, the left two buttons will be called as
BTN8 and BTN9 respectively. There are five buttons on the right hand side in
Figure 2. For these five buttons, here define the upper, left, center, right and lower
button as BTNU, BTNL, BTNC, BTNR and BTND respectively.
5
Figure 2.
To play our game, all the game logic is implemented by Sam, player can choose
to boot up the ZedBoard with or without an SD card. Figure 3 shows the home menu of
this game. In the top-left corner of the screen, the difficulty level and the historical
highest score has been displayed. If user boot the board without SD card, then the
highest score will be 0. In the top-middle part, it shows the current total brick number on
the screen. Since it is in the menu page, the brick number will be zero. The upper-right
corner displays the current score.
In the middle part of the screen, user can see two buttons. The first one is the
place to choose single-player mode or double-player mode. User can alter the setting by
press BTNL and BTNR.
If user want to change the game level, user can move to the second button by
pressing BTND. The highlight around the button tells which button does user current
located.
Now user can press the BTNC to increase the level. The highest level is 9, if
current level is 9 and user presse the BTNC again, the the level will loop back to 1.
If user want to start the game, just press BTNU to back to the first button and press
BTNC again to start the game.
6
Figure 3.
After starting the game, the game interface looks like Figure 4.
There is a block of bricks located on the top two third of the screen and a paddle
is in the lower part. The bricks with different color represent different levels. The brick
has 4 levels in total. The darkest color represents level 4, and the lightest color is level 1.
User should keep ball not falling out by controlling the panel to bounce the ball upwards.
If user chooses the single-player mode, then the paddle can be controlled by pressing
BTNL to move left and pressing BTNR to move right.
7
Figure 4.
If user selects double-player mode, the game interface looks like Figure 5. In this
case, the blue paddle represents play 1 and player 2 controls the green paddle. As
mentioned above, player 1 uses BTNL and BTNR while player 2 uses BTN8 and BTN9 to
move the paddle to the left and the right, respectively.
During the game, BTNC always reset the game, move the ball to its initial state.
Figure 5.
8
During the game, press BTNU can pause the game and the interface will change
to Figure 6. Press BTNU second time can resume the game.
Figure 6.
BTND is the button for quit the game.
Figure 7.
9
Once user’s current score is higher than 150, after game over for current round,
user will surprisingly see an extra option on the home page, which is the circular mode,
as shown in Figure 8.
Press BTND and then BTNL will move the focus to the third button. Then, press
BTNC to start the game. The method to control the paddle is the same as regular mode
mentioned above, but the interface looks like Figure 9 and Figure 10.
Figure 8.
10
Figure 9.
Figure 10.
11
4. Project Outcome
Our brick out project in ENSC 452 spring 2018 has been a total success. Its
performance, efficiency, and comprehensiveness are satisfactory. Our detail outcome
results are listed below:
Hardware Result
○ VGA
Arlene designed the VGA controller based on [1]. And the controller
successfully interacted with DDR via VDMA[3]. The implementation of the
double buffer helps displaying image without flicking.
○ Button Interface
○ SD Card
○ Audio
Our project is running on both CPU0 and CPU1 on the zedboard, it
is implemented by Sam, each core have their own tasks and they will
communicate with each other through a memory address (0X10100000)
and interact with each other from time to time. Each CPU execution time
will not depend on each other but exchanging information is secured and
managed.
Software Result
○ Game Play System
Figure 11. Power analysis
14
Figure 12. Critical path
○ Completion
Brick Out project is completed. the game and its details meet all the
requirements that we agreed on and all the components were design are
all implemented.
○ Algorithms
16
Figure 13. Block design for final VGA structure
18
FIFO Generator (Stream FIFO)
-Xilinx IP block with with version 13.2
-re-customize IP using the following settings:
-under Basic tab:
-Interface Type: AXI Stream
-Clock Type AXI: Independent Clock
-under AXI4 Stream Ports tab:
-TDATA NUM BYTES: 4
-TUSER WIDTH:0
Project Directory
--------------------
|-Project
|-final.srcs
|-final.sdk
|-final.xpr
To launch the whole project, just go to Project folder, open the .xpr project.
Launch SDK from Vivado.
In SDK, compile the FPGA first then go the Run Configuration, Compile the file in
System Debugger mode.
19
7. Reference
[1] Florent, “Create a VGA controller for the ZedBoard,” [Online]. Available:
http://blog.dev-flow.com/en/11-create-a-vga-controller-for-the-ZedBoard/ [Accessed 15
January 2018].