fpga-gameoflife

所属分类:游戏
开发工具:VHDL
文件大小:7930KB
下载次数:0
上传日期:2020-01-12 23:27:11
上 传 者sh-1993
说明:  FPGA4U板的生命游戏实现,具有SDRAM、RS232 UART和VGA控制器
(A game-of-life implementation for the FPGA4U board, with SDRAM, RS232 UART, and VGA controllers)

文件列表:
Documentation (0, 2020-01-13)
Documentation\images (0, 2020-01-13)
Documentation\images\gol_buffer.svg (13006, 2020-01-13)
Documentation\images\gol_membanks.svg (50201, 2020-01-13)
Documentation\images\gol_membanks1.svg (58205, 2020-01-13)
Documentation\images\gol_memlayout.odg (19130, 2020-01-13)
Documentation\images\gol_memlayout.svg (22240, 2020-01-13)
Documentation\images\gol_moves.svg (113337, 2020-01-13)
Documentation\images\gol_statemachine.dia (2436, 2020-01-13)
Documentation\images\gol_statemachine.svg (51362, 2020-01-13)
Documentation\images\pic1.jpg (1022390, 2020-01-13)
Documentation\images\pic2.jpg (965469, 2020-01-13)
Documentation\images\picm.jpg (957297, 2020-01-13)
Documentation\images\quartus1.png (165697, 2020-01-13)
Documentation\images\quartus2.png (126458, 2020-01-13)
Documentation\images\quartus3.png (45340, 2020-01-13)
Documentation\images\quartus4.png (231642, 2020-01-13)
Documentation\images\space.jpg (199200, 2020-01-13)
Documentation\images\space.png (227000, 2020-01-13)
Documentation\images\spacem.png (1212934, 2020-01-13)
Documentation\images\syslayout.odg (12645, 2020-01-13)
Documentation\images\syslayout.svg (31374, 2020-01-13)
LICENSE (1067, 2020-01-13)
Samples (0, 2020-01-13)
Samples\background (0, 2020-01-13)
Samples\background\quartus.png (148992, 2020-01-13)
Samples\background\slideshow.sh (597, 2020-01-13)
Samples\background\space.jpg (199200, 2020-01-13)
Samples\background\space1.jpg (173407, 2020-01-13)
Samples\background\space2.jpg (309464, 2020-01-13)
Samples\background\space3.jpg (562378, 2020-01-13)
Samples\background\space4.jpg (571970, 2020-01-13)
Samples\grid (0, 2020-01-13)
Samples\grid\filler.bin (9600, 2020-01-13)
Samples\grid\filler.bmp (1254, 2020-01-13)
Samples\grid\filler.life (1336, 2020-01-13)
... ...

====================== Game of Life on FPGA4U ====================== In this project, we implement the game of life on the `FPGA4U `__. The final result features a high-resolution VGA controller, an RS232 UART, and an SDRAM controller. It allows uploading game of life patterns and eight-color high resolution images. It is possible to run the game step by step or in continuous mode. The VHDL design is entirely configurable: baud rate, VGA resolution, and grid size are customizable. The project uses two different PLLs for the VGA controller and the SDRAM to allow high screen refresh rates without being limited by the SDRAM speed. This project was originally done in spring semester 2007 at the Logic Systems Laboratory, EPFL (Lausanne) under the supervision of Prof. Eduardo Sanchez. .. image:: Documentation/images/picm.jpg Setup instructions ================== This readme explains how to build and run the project. For more details about the design and implementation, please go `here `__. 1. Download and install Quartus II WebEdition v13.0sp1 with Cyclone II support. Note that more recent versions do not support Cyclone II anymore. 2. Install the Quartus programming driver. This is required in order to flash the bitstream on the development board. You should find the driver in ``C:\altera\13.0sp1\quartus\drivers\usb-blaster-ii``. 3. Open the ``gameoflife.qpf`` project file. You should see something like this: .. image:: Documentation/images/quartus1.png 4. Build the project (Processing / Start Compilation). At the end of the process, you should see the following summary: .. image:: Documentation/images/quartus2.png 5. Connect the board via USB and open the programmer (Tools / Programmer). Select the ``USB Blaster`` and click ``Start``. .. image:: Documentation/images/quartus3.png 6. Connect the VGA extension board to the output pins of the board as shown on the photo at the beginning of this tutorial. You can use any similar board as long as it has 3 pins for color input, 1 for vertical retrace, and 1 for horizontal retrace. You can see the pin assignments in the main ``bdf`` file above. Customizing design parameters ============================= You may customize the screen resolution, the serial port speed, as well as the pre-defined grid pattern by modifying the following settings. By default, they assume a 1280x1024 resolution and a 921600 baud rate. The VGA controller runs at 134MHz while the SDRAM runs at 80MHz. .. warning:: If you change clock frequencies here, please also change the PLL settings in the ``bdf`` file (see the ``pll1`` and ``sdram_pll`` in the screenshot above). .. image:: Documentation/images/quartus4.png Uploading background images =========================== When the design is loaded, the screen is initialized with a blue-black pattern. You can upload the background picture through the RS232 connector. 1. Install Visual Studio 2019 and build the ``Utilities.sln`` project. You will need C# and C++ support. 2. Connect an RS232 module to the board. You may use any module you want, e.g., a MAX232 chip. Note that by default, the design is compiled assuming a 921600 bps rate. Some USB-to-serial adapters, such as the Prolific PL2303 support high rates. If this is too high, reduce it by modifying the corresponding parameter and rebuild the project. 4. Put the board into image upload mode. All the switches on the board must be in the ``0`` position. 5. Choose a bitmap image (jpeg, bmp, png...) and convert it to a bitstream file that is understood by the design. .. code-block:: bash cd C:\Users\demo\gameoflife\Samples\background ..\..\Utilities\Release\BitmapConverter.exe bin space.jpg 4 space.bin ..\..\Utilities\Release\Serial.exe 921600 space.bin \\.\com3 Uploading grid files ==================== You will find a few sample grids in the ``Samples\grid`` folder. A grid is a black-and-white 320x240 image. This image can be either generated from a ``.life`` file or hand-drawn. Then, the bitmap is converted to a binary file suitable for upload to the board. 1. Convert a ``.life`` file to a bitmap. .. code-block:: bash ..\..\Utilities\Release\net40\Grid2Bmp.exe 320 240 filler.life filler.bmp 2. Convert the bitmap to a binary .. code-block:: bash ..\..\Utilities\Release\BitmapConverter.exe bin filler.bmp 1 filler.bin 3. Put the board in grid upload mode. If you use the FPGA4U, enable switches 5 and 1 on ``SW2``. More information on the board layout and switch position can be found `here `__. 4. Upload the grid. .. code-block:: bash ..\..\Utilities\Release\Serial.exe 921600 filler.bin \\.\com3 5. Disable grid upload mode (switch 5), disable single step mode (switch 1), and resume the game (push button ``SW3``).

近期下载者

相关文件


收藏者