Tetris Game on SoPC, by: - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Tetris Game on SoPC, by:

Description:

A HS-DSL project of: Tetris Game on SoPC System Final Presentation By: Rami Busool & Ameer Abdel-hadi Supervisor: – PowerPoint PPT presentation

Number of Views:2890
Avg rating:3.0/5.0
Slides: 25
Provided by: aam78
Category:

less

Transcript and Presenter's Notes

Title: Tetris Game on SoPC, by:


1
A HS-DSL project ofTetris Game on SoPC System
Final
Presentation
  • By
  • Rami Busool
  • Ameer Abdel-hadi
  • Supervisor
  • Nitzan Miron
  • 26, May 2005

2
Agenda
  1. Preface
  2. Motivation
  3. Requirements
  4. Graphics
  5. Communication
  6. Design flow
  7. The hardware
  8. The software
  9. Further improvements
  10. Check list
  11. Time schedule
  12. Ideas? Questions?

3
1. Preface
  • Tetris, what is it?Tetris is a computer game
    invented by Alexey Pajitnov in 1985, while he was
    working for the Academy of Sciences in Moscow,
    Russia, inspired by a pentominoes game he had
    purchased earlier. Tetris is one of the
    best-known computer games ever devised, thanks
    partly to its success as a video game.where you
    should try to fit in block into a play-field,
    quite simple but really fun. All blocks are built
    from four bricks (the name Tetris is derived from
    the ancient Greek word for four "tetra"), there
    are six combinations of the four bricks as seen
    here below.

4
2. Motivation
  • Our goal is to develop a design of a Tetris game
    on a SoPC system.
  • The system gets the input from user, processes
    the data and sends pixels bit stream to a PC.
  • The display data are serial pixel information,
    delimited with a special bits series.
  • Delimited pixels make one frame.
  • The PC gets the bit stream and draw the pixels on
    the display.
  • The PC used for display only, the whole
    processing procedure done by the SoPC system.

5
3. Requirements
  • 3.1. The game definition
  • Tetrominoes or tetrads, shapes composed of 4
    blocks each, are falling down the screen that
    consists of a matrix or play field, and one has
    to direct them so they will fit to the wall on
    the bottom. When a line of blocks has no gaps, it
    is complete and collapse, this will gain the
    player points.
  • The six tetrominoes that make up Tetris are

Zigzag piece
Straight piece
T piece
Square piece
L piece
Backward L piece
6
3. Requirements
  • GravityWhen a row of blocks is cleared and
    removed, the stacks of blocks above it fall. Many
    versions of Tetris (like ours) simply move blocks
    down by a distance exactly equal to the height of
    the cleared rows below them. This results in
    behavior unlike real-world gravity, in that
    blocks may be left "floating in mid-air".

7
3. Requirements
  • 3.2. How to play the game? (input keys rule)
  • Input keys
  • 3 push buttons.
  • Reset button to restart the game.

Left
Middle
Right
Reset
8
3. Requirements
  • 3.3. How to play the game? (input keys rule)
  • Press any push button to start.
  • Left right buttons to move the brick
    accordingly.
  • Middle button to drop the brick down.
  • Right middle to rotate the brick clock
    clockwise.
  • Left middle to rotate the brick anticlockwise.
  • Right middle left to pause the game.
  • Reset button to restart the game.

9
4. Graphics
  • Pixel
  • The basic unit is pixel. Pixel is a structure
    which contains two fields background color
    foreground color.
  • We use 14 colors, so we can encode each color
    with 4 bits 0x0 ? 0xE (1110)
  • Pixel contains two colors 24 bits 1 byte.

10
4. Graphics
  • Frame
  • Frame is a matrix of NxM pixels.
  • Each frame is one screenshot of the game status.
  • We sees the picture by printing sequential frames
    on the screen.

11
5. Communication
  • We use a serial port in order to send the
    frames.
  • Each frame is coded as a serial bitstream.
  • In order to detect frame start we add a special
    byte, which is not a color (0xFF in our case) to
    the head of each frame.
  • See the following graph for more details.

12
5. Communication
13
6. Design flow
  • The Design flow is as the following
  • Choosing the suitable hardware for optimal
    solution for our problem and the connection
    methods between the hardware elements. The major
    hardware are the display and the development
    board.
  • Develop a software emulator, which emulates the
    hardware on a PC.
  • Rearrange the emulator code to fit the hardware.
  • Loading the code to the hardware.
  • Hardware integration.
  • Run, debug and check.
  • Further ideas and improvements.

14
7. The hardware
  • 6.1. Top hierarchy systems
  • Development board
  • Board Vendor Memec Design
  • Board Name Vertix-II Pro P7-ff672 Development
    Board
  • Board Revision 3
  • Board Description This board utilizes XILINX
    Virtex-II Pro FPGA xc2vp7ff672-6. The board
    includes one 8MB SDRAM, one RS232, four LED,
    eight DIP-switches and four push buttons.
  • PC for display.
  • Communication between board and pc is via RS232
    serial port.

15
7. The hardware
  • 6.2. On chip CPU
  • Processor type PowerPC 405
  • Frequencies
  • Reference clock 100 Mhz
  • Processor clock 100 Mhz
  • Bus clock 100 Mhz
  • Processor descriptionThe PowerPC 405 core is a
    32-bit implementation of a RISC PowerPC
    embedded-environment architecture. It is
    integrated into the Virtex-II Pro device using
    the IP-Immersion technology and supported by
    CoreConnect bus infrastructure and extensive IP
    cores for peripherals and utilities.
  • JTAG debug interface FPGA JTAG

16
7. The hardware
  • 6.3. On board peripherals
  • RS232
  • Peripheral OPB UARTLITE
  • Baudrate (BPS) 57600
  • Data Bits 8
  • Parity NONE
  • LEDs_4Bit
  • Peripheral OPB GPIO
  • Push_Buttons_3Bit
  • Peripheral OPB GPIO
  • DIP_Switches_8Bit
  • Peripheral OPB GPIO
  • PLB IF CNTLR
  • BRAM Memory size 64 KB

17
8. The software
  • 7.1. Algorithm development
  • 1st phase developing a Tetris PC game.Input to
    STDIN, output to STDOUT.
  • 2nd phase fitting the code to the development
    board environment, using the board peripherals as
    inputs and outputs.
  • 3rd phase splitting the code into senders code
    (the board) and receiver (PC).
  • The sender and the receiver communicates via the
    RS232 serial port.

18
8. The software
  • 7.2. Sender code description (Main code)
  • Known Tetris game algorithm used.
  • RS232 as standard input/output (used actually
    only as output)
  • The main code loop
  • Get users input
  • Process info/update frame data
  • Send frame data

19
8. The software
  • 7.3. Receiver code description
  • Opens communication port via RS232 serial port
    (as input).
  • Main loop
  • Get frame from sender (via serial port)
  • Wait for delimiter.
  • Read frame.
  • Print the frame to the screen.

20
9. Further improvements
  • Adding new core for LCD, showing the score and
    the game level.
  • Using DIP switches for on-line controlling the
    game speed.
  • Using the LEDs to inform the user about new
    actions like getting points or new level.
  • More push-buttons?
  • Friendly display, GUI?

21
10. Check list
  • Choose the suitable hardware (done)
  • Software emulator (done)
  • Rearranging the software to fit the hardware
    (splitting the code into senders code and
    receivers code) (done)
  • Hardware system integration (done)
  • SW/HW integration (done)
  • Run and check the system (done)
  • Further ideas and improvements (brainstorm just
    started)
  • Project book (Not yet)

22
11. Time schedule
  • Implementing new ideas and improvements, Final
    Project submission10 June 2005
  • Project book submission20 June 2005

23
13. Ideas? Questions?
24
  • Thanks!
Write a Comment
User Comments (0)
About PowerShow.com