A few days ago I got a Perf-V board. In case you’re wondering what that is, the Perf-V is an FPGA development board, supposedly “designed for [the] RISC-V opensource community” by PerfXLab, a Beijing-based company that does some pretty interesting things in addition to this particular board.
PerfXLab does (rightfully) claim that you can use the board and the enclosed JTAG adapter with Vivado, but they aren’t very forthcoming on the details. Since a lot of RISC-V enthusiasts are software developers who have never touched Vivado, I figured I’d fill you in about the missing piece of the puzzle.
First, you need Xilinx Vivado (obviously). The FPGA community has what can best be described as a hate-hate relationship with Vivado. It’s slow, clunky and awkward but it’s also the only one we have. It does a lot of things besides giving you an IDE for Verilog/VHDL; that’s only its most visible, and also its least important function.
If you don’t have access to a licensed Vivado installation (you don’t want to know how much that costs), Xilinx offers a free version called WebPack, which you can download here. It’s restricted in a bunch of ways but it’s more than enough to get started. The installation process is pretty straightforward: download the self-extracting .bin file, chmod +x, run it and follow the install wizard.
If you’re really impatient, you’ve probably already plugged in your board and JTAG cable, and powered on the board (in this order, because JTAG hotplug isn’t supported; keep it powered down when plugging and unplugging the JTAG cable). But Vivado isn’t very cooperative at first: it won’t recognize the JTAG programmer.
Now for the JTAG programmer. the PerfXLab FPGA USB Cable is a Digilent Adept 2 device. You need to download the Adept 2 Runtime and Utilities package from Digilent. Grab them and install them. Which ones you get will obviously depend on your platform. I use Ubuntu 18.04 on my development laptop (not my favourite distribution but definitely my clients’ favourite distribution) and the 64-bit .deb files worked straight away.
After you’ve installed the two packages, you should be able to connect to the board. Here’s how to do it.
Open Vivado and select “Open Hardware Manager” at the welcome screen. The Hardware Manager will rightfully insist that no hardware target is open, so click “Open Target”, then “Open New Target”
This will launch a wizard that’s as helpful as wizards always are. Select “local server” in the “Hardware Server Settings”, click Next, and you should see your adapter on the next page.
That’s it. It works. Now you’re ready to see why we all love Vivado so much.
While we’re at it…
…is this the right board to get started with RISC-V? Probably not, although it’s not a bad board. Here’s why.
The reason why the Perf-V is so cheap is that it comes almost devoid of useful connectors. You get no Gigabit Ethernet connector, no HDMI connector, no nothing. You get a few LEDs and buttons, and just enough analog and digital pins to hook it up to an Arduino.
The board does expose a “high-speed interface”. If you next question is “what interface is that?” — that’s a 60-pin interface that you can hook up to another board with a flex cable. 60 pins may look like a lot but that’s actually 18 signals (17 pairs of differential signals and 1 pair of high-speed AD sampling signals), plus the 5.5V, 3.3V, 1.8V and GND signals. What other board? Exactly!
If you need to connect your RISC-V (or whatever else) softcore through anything that’s faster than an SPI or an I2C port, you’re going to have to make your own board, which most people who are interested in writing software for RISC-V don’t want to do.
When the Perf-V was launched, I thought PerfXLab would follow up with a bunch of add-on boards. That didn’t happen, unfortunately.
That being said, the Perf-V is a pretty cheap Artix-7 development board. If you’re going to make your own peripheral board anyway, or if the limited connection options it has are enough for what you need, it’s not a completely terrible purchase. Most RISC-V-ready boards are more expensive (though possibly more useful). In the world of hardware, it’s still pretty common to get what you pay for, and this is one of those cases.