Giter Club home page Giter Club logo

clash-pong's Introduction

Pong

This repository implements Pong in Haskell, both as a software program (using SDL for input and graphics) and as a hardware FPGA design via Clash.

This code is part of the book Retrocomputing with Clash: Haskell for FPGA Hardware Design at https://unsafePerform.IO/retroclash/.

Building

Use stack build to build and stack run pong to run the software version.

For the hardware version, use the included Shakefile. An easy way to run it is via the provided mk shell script. Create a build.mk file with content like the following:

TARGET = nexys-a7-50t
VIVADO_ROOT = /opt/somewhere/where/vivado/is/installed/bin
ISE_ROOT = /opt/somewhere/where/ise/is/installed/ISE/bin/lin64
QUARTUS_ROOT = /opt/somewhere/where/quartus/is/installed/bin

Alternatively, if you have Vivado/ISE installed in Docker or similar, you can create a wrapper script and use that by setting VIVADO instead of VIVADO_ROOT:

TARGET = nexys-a7-50t
VIVADO = /usr/local/lib/docker-scripts/xilinx-vivado-2019.1-ubuntu-18.04/run
ISE = /usr/local/lib/docker-scripts/xilinx-ise-14.7-ubuntu-12.04/run
QUARTUS = /usr/local/lib/docker-scripts/intel-quartus-20.1-ubuntu-20.04/run

Supported target boards

  • Xilinx ISE toolchain

    • papilio-one: Papilio One (Spartan-3) with the Arcade MegaBoard
    • papilio-pro: Papilio Pro (Spartan-6) with the Arcade MegaBoard
  • Xilinx Vivado toolchain

    • nexys-a7-50t: Nexys A7-50T (Artix-7)
  • Intel Quartus toolchain

    • de0-nano: DE0-Nano (Cyclone IV) with Fen Logic VGA666 adapter
    • arrow-deca: Arrow DECA (MAX 10)
  • F4PGA (formerly SymbiFlow) open source toolchain

    • nexys-a7-50t.f4pga: Nexys A7-50T (Artix-7)

Bitfile can be built with e.g. ./mk papilio-pro/bitfile. For some targets, a rule to upload the resulting bitfile is also included, e.g. ./mk arrow-deca/upload.

Adding support for other Intel, Xilinx, or F4PGA based FPGA dev boards is very straightforward with the included Shake rules, as long as they have VGA output and at least two input pushbuttons.

Targeting other FPGA toolchains will require adding support in the Shake rules. Alternatively, you can always just run Clash, and import the resulting Verilog files into your FPGA toolchain in a non-automated way.

clash-pong's People

Contributors

gergoerdi avatar losiek avatar luketollefson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

clash-pong's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.