Simple LiteX SoC for TinyFPGA BX


#1

I just got done putting together a working LiteX SoC for the BX that can be built out-of-tree (so it’s easy to hack on) and without using litex-buildenv (so the build isn’t as rigid and works on all sorts of systems). I had a hard time figuring out how to get LiteX running on this board, so I’m posting this in the hopes that it provides a useful jumping off point for others. Please give it a try and let me know how it works out for you!

The code is here:

The readme contains a quickstart, which is transcribed below. I apologize for the handwaving around the LiteX install for now, since it’s been a while since I set this up. If this becomes a pain point for anyone, please speak up and I’ll work on this!

Quick Start

  1. Install LiteX according to the Advanced or Medium quickstart guide on LiteX GitHub. Note that depending on what CPU you would like to use (see Caveats below) your target compiler may be available in your system’s package manager!

  2. Install tinyprog, if you don’t already have it

     pip3 install tinyprog
    
  3. Clone this repository

     git clone https://github.com/kekiefer/tinyfpga-litex
     cd tinyfpga-litex
    
  4. Build the SoC:

     python3 tinyfpga_litex.py --platform litex.boards.platforms.tinyfpga_bx --cpu-type vexriscv --cpu-variant=lite
    
  5. Program the gateware bitstream and the firmware:

     tinyprog -p soc_tinylitex_tinyfpga_bx/gateware/top.bin -u soc_tinylitex_tinyfpga_bx/software/userdata.bin
    

If everything works, you should see output on the UART and a flashing LED.