Close

FPGA Bootcamp Transcript

A event log for FPGA Bootcamp Hack Chat

Join Al Williams, the guy behind Hackaday.io's FPGA bootcamps, to ask FPGA questions and pitch what you want to see next on the bootcamp!

stephen-tranovichStephen Tranovich 10/12/2018 at 20:090 Comments

Stephen Tranovich12:04 PM
Okay, let's get started! A BIG welcome to @Al Williams for coming on the Hack Chat to talk FPGA with us!

Al Williams12:04 PM
Thanks Stephen and thanks everyone for jointing

Al Williams12:04 PM
joining rather

Stephen Tranovich12:05 PM
@Al Williams , kick us off by telling us a little about yourself!

Al Williams12:05 PM
Well most of you probably read some of my stuff on Hackaday but I've been doing electronics for the majority of my life -- ever since I was a kid. I had a ham radio license in 1977....

Boian Mitov12:05 PM
Hi @Al Williams and @Stephen Tranovich :-)

Al Williams12:05 PM
And when I went to school there were no FPGAs

Al Williams12:06 PM
So later when I got interested I tried really hard to learn about them and there were 2 or 3 things I just couldn't get. So I finally broke down and took one of the freebie seminars from Altera

Al Williams12:06 PM
If I could have just asked the guy those 3 things it would have taken 15 minutes

Al Williams12:06 PM
But I had to take the whole class ;-)

Al Williams12:07 PM
So since then I've really looked for ways to bring more people into FPGAs and make them more accessible. The costs have come down both of the parts and the tools

Al Williams12:07 PM
most of the tools are free and we have Open Source for at least one FPGA family now

Al Williams12:07 PM
The bootcamps are one way I wanted to try to make things easier for people to climb that learning curve

Stephen Tranovich12:08 PM
That's awesome. And they sure are helping.

Al Williams12:08 PM
FPGAs aren't for everything, of course. Neither is an AVR processor or a 555 chip. But it is a great trick to have in your toolbag and when you do need it almost nothing else will do short of building huge racks of logic circuits

Stephen Tranovich12:08 PM
And this is everyone's chance to ask you their own 3 questions!

Al Williams12:08 PM
So before we start...

Al Williams12:08 PM
If you know me, you know I’m always a little different. This is going to be a unique Hackchat because I’m going to flip it around. Sure, I’ll take questions, but I’m very interested in asking you questions. For example:

Have you tried the FPGA bootcamps? Why or why not?

What FPGAs would you like to see us cover? (Currently, only ice40)

What topics would you like to see in the future? More FPGA topics? Other topics?

If you haven’t heard, we released bootcamp #4 today which is all about developing state machines in Verilog. This is another one where you don’t really need the hardware to follow along -- you can do everything in your browser or an offline Verilog simulator like Icarus.

The next two will build on the state machine premise and we’ll build a serial to PWM “chip” that you could actually use (probably with the ice40 again, but maybe also with the MAX10, or other FPGAs depending on your feedback).

So… who’s taken any of the bootcamps?

Al Williams12:09 PM
Well while you are thinking... I see @Thomas Shaddack has a question about command line tools

Stephen Tranovich12:09 PM
Sure, here's @Thomas Shaddack 's question: Are there some commandline tools for FPGAs? Something that would not require a heavyweight multigigabyte GUI monstrosity just to compile a verilog or vhdl source, and could be run from a console?

Al Williams12:09 PM
That's one thing I like about the open source tools is they are command line and that's it! However, there's a secret about the tools

Stephen Tranovich12:10 PM
Tell us the secret!

Al Williams12:10 PM
All the vendor tools are GUI shells over a bunch of command line programs, TCL scripts, and Perl scripts

Adrian12:10 PM
only found out about the bootcamps today... as a result of the email to join this chat, but will get stuck in as they have always interested me

Al Williams12:10 PM
So for example if you use Xilinx: https://www.xilinx.com/support/documentation/sw_manuals/xilinx14_5/devref.pdf

Al Williams12:11 PM
Or Altera: https://www.intel.co.jp/content/dam/altera-www/global/ja_JP/pdfs/literature/an/an309.pdf

Al Williams12:11 PM
Don't know why that's a JP link

Al Williams12:11 PM
but it is in English

Al Williams12:11 PM
So you can easily build your own tool scripts, use Makefiles, build from emacs (I do that).

Al Williams12:11 PM
The Lattice open source tools (iceStorm) has really picked up a lot of capability

Al Williams12:11 PM

https://hackaday.com/2018/10/03/icestorm-tools-roundup/

HACKADAY AL WILLIAMS

Icestorm Tools Roundup: Open Source FPGA Dev Guide

We like the ICE40 FPGA from Lattice for two reasons: there are cheap development boards like the Icestick available for it and there are open source tools. We've based several tutorials on the Icestorm toolchain and it works quite well. However, the open source tools don't always expose everything that you see from commercial tools.

Read this on Hackaday

Al Williams12:12 PM
You might read that article about all the tools that are now up and also my command line driver for them is linked there on GitHub.

Al Williams12:12 PM
What FPGA family do you use @Thomas Shaddack ?

Kevin12:12 PM
I learned about the FPGA bootcamp a few weeks ago. Haven't had time to go through them yet. I picked up three inexpensive FPGA boards. Two are Spartan 3 and the other is Spartan 6. In reading about Verilog and VHDL I went with VHDL.

Al Williams12:13 PM
Hi Kevin. Well that's the old vi/emacs pc/mac debate isn't it?

Kevin12:13 PM
Pretty much. :)

Thomas Shaddack12:13 PM
@Al Williams none yet. tried to putz with some rudimentary CPLDs from Xilinx and one lower-end thing from Altera, available as cheapo Chinese boards on ebay.

Al Williams12:14 PM
My day job used to be with Boeing and we had to use a lot of VHDL because the government likes it. But most people I know prefer Verilog. With the modern extensions to Verilog the two are pretty much feature equivalent. But it just depends. Verilog is kind of C-like and VHDL is kind of Ada like

Al Williams12:14 PM
There are converters that can go either way but they are typically not great

Frank Buss12:14 PM
I think VHDL is better, because it catches more bugs at compile time. Verilog is to lax with implicit type conversions etc.

Al Williams12:14 PM
Depends on your tools though don't you think? And if you do a lint step.

Adrian12:14 PM
i don't have a FPGA /toolchain as yet and would welcome a recommendation on what best to follow along

Al Williams12:15 PM
Well the Bootcamps right now assume you have an icestick which is a Lattice ice40 for about $30 and very easy to set up

Frank Buss12:15 PM
needing an extra lint step proves my argument :-)

Kevin12:15 PM
I have one Spartan 3 board driving a set of 8 7-segment displays wired up for Charlieplexing (9 wires to control 64 segments). I'm using that display for my introduction to using VHDL.

MagicWolfi12:15 PM
I will go through the bootcamps when I an going to learn Verilog. I speak VHDL only at the moment.

Al Williams12:15 PM
I am about to do a post with a hands on with the version 2 of the Upduino which is really cheap like $12

Al Williams12:16 PM
I have found that learning VHDL then Verilog or vice versa isn't a big deal. The real big deal is changing how you think

Al Williams12:16 PM
for example...

Al Williams12:16 PM
using Verilog...

Frank Buss12:17 PM
true

Al Williams12:17 PM
a<=10;

b<=a;

Does NOT necessarily mean b==10! That usually shocks people for a few days or weeks.

Stephen Tranovich12:17 PM
Before we spend the while chat debating VHDL vs Verilog, let's take another community question! This question is from @Christoph : Where could I look for open source "hardware snippets" of decent quality, like an SPI?

I'd like to create a frame buffer that receives a packed monochrome frame (1 bit per pixel) via SPI and outputs a 16-bit per pixel (fixed color) frame to an SPI display.

Al Williams12:17 PM
The Upduino is very cool although the board is a bit of a mess. But it has the bigger Lattice part on it which is nice and I'm a big fan of iceStorm

Frank Buss12:17 PM
you could do a ":=" in VHDL

Al Williams12:17 PM
Yeah or an = in Verilog but...

Al Williams12:17 PM
just a shock

Al Williams12:18 PM
Great question @Christoph

Al Williams12:18 PM
One of the best and worst places to look is Open cores: https://opencores.org/

Al Williams12:18 PM
I say best because everything is there

Al Williams12:18 PM
I say worst because everything is there ;-)

Kevin12:18 PM
@Frank Buss I don't remember specifically what it was about VHDL that pointed me in that direction but what I read made me thing it was the better choice. IIRC, VHDL helps avoid some (timing?) problems you can have with Verilog. At the same time I know that in North America Verilog is the more common HDL for use with FPGAs. I've also seen a site online that will convert between Verilog and VHDL.

Al Williams12:19 PM
A little more cut and past snippet is on GitHub https://github.com/pConst/basic_verilog

Al Williams12:19 PM
Of course, like anything what you find on the Internet is of varying quality

Thomas Shaddack12:19 PM
sturgeon's law.

Christoph12:19 PM
I thought so, too. I guess as more and more hobbyists use FPGAs, github will see more fpga code

Al Williams12:19 PM
The vendors call little blocks like that IP -- or Intellectual Property and

Frank Buss12:19 PM
I don't think VHDL vs. Verilog helps with timing problems, but it definitely can help with other problems

Al Williams12:19 PM
Many times there is a vendor solution for things like UARTs or SPI and those are generally good quality and well documented

Al Williams12:20 PM
Good example... remember the Hackaday article on using the MAX1000 as a POV display?

Al Williams12:20 PM

https://hackaday.com/2018/08/31/max1000-tutorial-is-quite-persistent/

HACKADAY AL WILLIAMS

Learn FPGA with this Persistence of Vision Hack

Everybody wants to give FPGA development a try and here's a great way to get into it. You can build your own Persistence of Vision display using a $30 dev board. It's a fun project, and you'll learn quite a bit about designing for an FPGA, as well as using the Quartus design software.

Read this on Hackaday

Christoph12:20 PM
maybe, for that specific case (SPI), I just didn't find the vendor's SPI

Al Williams12:20 PM
Then I enhanced it with a serial port

Al Williams12:20 PM

https://hackaday.com/2018/09/06/fpga-pov-toy-gets-customized/

HACKADAY AL WILLIAMS

How to Add UART to Your FPGA Projects

Being able to communicate between a host computer and a project is often a key requirement, and for FPGA projects that is easily done by adding a submodule like a UART. A Universal Asynchronous Receiver-Transmitter is the hardware that facilitates communications with a serial port, so you can send commands from a computer and get messages in return.

Read this on Hackaday

Al Williams12:20 PM
Read the comments on that last one.

Al Williams12:21 PM
I used a UART "from the Internet" that I've used before and I couldn't find the exact version online that I was using. So I posted mine, but to give credit I linked to the "old version" on GitHub.

Al Williams12:21 PM
Well the old version had many problems.

Al Williams12:21 PM
I don't remember if I fixed it (and that's why I can't find it) or if someone else fixed it, I took it and now can't find the link

Al Williams12:22 PM
But you do have to do a little due diligence when you pick up someone else's code

Piotr Esden-Tempski12:22 PM
I did not have the time to work through the bootcamps yet. But big thanks for putting them together. I will definitely see if I can streamline and adapt them to the iCEBreaker that we are working on. :) It is a great resource. :)

Christoph12:22 PM
of course

Al Williams12:23 PM
Thanks @Piotr Esden-Tempski -- yeah I think if more people knew how cheap the ice family was, low power, and the availability of good free tools, we'd see a lot more of it. I'm glad you are building more with it.

Al Williams12:23 PM
I see @MagicWolfi has a question

Piotr Esden-Tempski12:23 PM
Also @Al Williams what do you think about the higher level solutions like migen. I spent some time with it recently and it is great to have a generator language at the fingertips to create repetitive logic.

Al Williams12:24 PM
@Piotr Esden-Tempski Great question. Give me a minute to work through some of the submitted ones

Al Williams12:24 PM
@MagicWolfi asks about bus structures for connecting modules

Stephen Tranovich12:24 PM
@Al Williams is calling for @MagicWolfi 's question! What standard bus structure would be recommended to connect modules for routing data between them. Any differences for continuous data streams vs. blocks of data at random times?

Piotr Esden-Tempski12:24 PM
At the end it is still Verilog at the backend, but the generator does not make typos as much as I do and keeps the lack of compiler complains away from me. :)

Al Williams12:25 PM
Remember the opencores site I just linked? On there you'll find a spec that's open for Wishbone which is a simple nice interconnect. If you are doing something open source and that's good enough then it helps to use that. You can reuse a lot of IP

Stephen Tranovich12:25 PM
@Piotr Esden-Tempski Feel free to submit your question in the discussion section here so that we can answer it in turn! https://hackaday.io/event/161622-fpga-bootcamp-hack-chat

Antti Lukats12:25 PM
anybody taking part in the RISCV softCPU contest?

Christoph12:25 PM
hey antti

Al Williams12:25 PM
Now there are two things to consider

Piotr Esden-Tempski12:25 PM
@Stephen Tranovich Yes right. sorry. :)

Frank Buss12:25 PM
yes, I have a pretty nice idea to make the core really small, but I don't know if they think it would be cheating :-)

Al Williams12:26 PM
If you have an ARM core either soft or on die then you get milage out of using the ARM busses which the vendor probably gives you (e.g., AXI, etc.)

Al Williams12:26 PM
But if you need a high speed bus... and interconnect, you might look at what Opal Kelly is doing which is "open" called Syzygy https://syzygyfpga.io/

Antti Lukats12:26 PM
Hi Frank, I wrote to riscv mailinglist

Discussions