LogiPi Board Definition

fpga logipi amaranth nablopomo xilinx

A screen shot of the first dozen lines or so of the LogiPi platform definition

I previously wrote about getting the Xilinx toolchain installed on my laptop, allowing me to compile my own bitstreams for the LogiPi. But I don't want to use it directly: rather than using Verilog/VHDL, I want to use Amaranth, for many reasons - but one is that it makes it easier to use the same design on different boards.

Part of how it does this is that each board has a definition file that specifies the resources (buttons, switches, LEDs, DRAM etc), as well as connectors, that are available on the boards; then the design can specify that an output goes to "LED number 2" rather than "Pin 87", and if you recompile for a different board (inevitably with a different FPGA with a different pinout), it will still go to an LED. The board definition file also specifies which FPGA is in use and hence which toolchain should be used; this means Amaranth can generate all of the files needed, call the toolchain, and produce the final bitstream - all without you having to know the different commands, options and file formats for different vendors' software.

So we need a definition for the LogiPi.

To produce a definition for the LogiPi, I started with another board (the SK-XC6SLX9) that had the same FPGA (the XC6SLX9) as the LogiPi. I then carefully went through the LogiPi schematics to figure out which pins on the FPGA connect to:

The definitions go in a LogiPiPlatform class, which inherits from Amaranth's XilinxPlatform (which already knows about the toolchain). The FPGA details I left the same as the SK-XC6SLX9 (after checking they also apply to the LogiPi), and the pin details go in resources and connectors attributes of that class.

All very straightforward to put together, but does require a lot of careful checking and double-checking of the pin numbers. Once that's done we can see if we can finally run our own design on the LogiPi.

(I have raised a pull request to get my board definition added to the collection that Amaranth has already - fingers crossed it gets in!)

0 comments

Post a comment

All comments are moderated, and will not show up immediately on the site, or at all – and if they do, their content may be edited.