Coder Social home page Coder Social logo

rt's Introduction

Racing the Beam Ray Tracer

This project implements a Real-Time Ray-Tracer on a small FPGA.

You can read all about it here.

I also gave a presentation about this at Bang Bang Con West (slides, video).

HW Requirements

  • A Pano Logic G1 (one with VGA port)
  • A JTAG programmer to load the bitstream into the FPGA

Loading the Bitstream

If you simply want to run the finished project on your Pano, then all you need to do is load a pre-made bitstream into the device.

The bitstream can be found here.

Changing the software

You don't to resynthesize the bitstream to change the software that runs on the MR1 RISC-V processor.

Once you have made the changes to your C code, just do the following:

cd xilinx
make update_ram

This will update the Pano.bit file with your latest binary.

Building Everything from Scratch

  • Install RISC-V GCC compiler suite.

    See the picorv32 github project on how to do that. It can take a long time to build!

  • Install SpinalHDL.

    The actual installation instructions can be found in the VexRisc project.

  • Clone this github repository to ~/projects/rt.

  • Build font binary file

cd ~/projects/rt/fonts
make
  • Build the firmware. This creates a file called ./sw/progmem8k.bin.
cd ~/projects/rt/sw
make
  • Build the Verilog for synthesis.

    When you run this, not only will you create the Pano.v file, but also a bunch of .bin file that contain RAM initialization contents, which will be loaded by Xilinx ISE during synthesis

cd ~/projects/rt
make syn
  • Fire up Xilinx ISE
cd ~/projects/rt/xilinx
make ise
  • Create the bitstream

    • File -> Open Project -> ~/projects/rt/xilinx/xilinx.xise
    • Double click on 'Generate Programming File'
  • Fire up Xilinx Impact

cd ~/projects/rt/xilinx
make impact
  • Load bitstream into the device

Simulation

I have an eye-balling-only simulation set up.

To use it, you first need to make 1 change in the RTL:

Change this line to

    val hwMulGlobal = false

After that, just do make sim.

The simulation can take quite a while because it simulates a full frame at 648x480.

To see waveforms, do make waves.

Don't forget to do the hwMulGlobal change before you generate the synthesis Pano.v, because otherwise the design won't fit in the FPGA!

rt's People

Contributors

tomverbeure avatar

Watchers

 avatar

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.