Good FPGA Starting Point? - Page 1
Forum section: electronics / general

author: Mario87
author_rank: Frequent Contributor
timestamp: August 16, 2020, 04:08:14 pm
content: Hi all,I am looking to get into FPGA's. I have not looked at them since my uni days about 12 years ago as I do not use them in my job, but the more I look into them again the more I think it would be great to know how to use them, even for my own projects as I have a couple of ideas that I would like to implement that could not be done on a microcontroller.I am looking at a Digilent Basys 3 board and the book Digital System Design with FPGA: Implementation Using Verilog and VHDL, link here...https://www.amazon.co.uk/Digital-System-Design-FPGA-Implementation/dp/1259837904Are these a good place to start? From what I can see the book focuses on the Basys 3 and Arty S7 boards which both use the same Xilinx FPGA if I'm not mistaken.Any feedback or recommendations welcome

author: Bassman59
author_rank: Super Contributor
timestamp: August 16, 2020, 05:07:48 pm
content: Quote from: Mario87 on August 16, 2020, 04:08:14 pmThink about what you'd like to implement using an FPGA and start there.

author: rstofer
author_rank: Super Contributor
timestamp: August 16, 2020, 07:36:58 pm
content: I prefer boards with a lot of 'gadgets' such as LEDs, switches and 7 segment displays. The Basys 3 fills that need very well and I have one. OTOH, I prefer a larger chip (100T variant) versus the MUCH smaller 35T but just about everyone around here will claim that this is overkill including me. However, with the larger variant I get a lot more BlockRAM and that comes in handy when I want to build a 64kx16 bit memory for the LC3 CPU project. So, I spend a lot more money on the Nexys A7 - 100T. Future proofing, I call it!https://store.digilentinc.com/nexys-a7-fpga-trainer-board-recommended-for-ece-curriculum/For beginners, this isn't usually that important and it's worth remembering that the first board won't be the last board. The Basys 3 is a great starter board. The Arty boards tend to have more pins but less 'gadgets'. I have the Artix board as well...I am going to direct you tohttps://vhdlwhiz.com/for just about all of the tutorials you are going to need. He tends to use the very inexpensive Lattice Ice 40 Stick and it's quite inexpensive. Not much in the IO department but adequate for his tutorials.https://www.amazon.com/LATTICE-SEMICONDUCTOR-ICE40HX1K-STICK-EVN-Evaluation-iCE40HX1K/dp/B00R3QU9K0This fall, if you have an opportunity and a few bucks to spend, consider the Dot Matrix program. It may cost money but it's a graduate level course in how to do this stuff right:https://academy.vhdlwhiz.com/dotmatrixThe much cheaper Fast Track course is also very good:https://academy.vhdlwhiz.com/fast-trackAll of the other tutorials are free.You can obviously use the Basys 3 for these projects along with the Vivado toolchain but there is a lot of handwringing to transmorgify between the tools and the "push here" instructions. Workable, not ideal. This begs for the Lattice board and tools as a place to start.Then there ishttps://www.nandland.com/and the development board he sells for his tutorials. The good news is that he also discusses Verilog. I have no interest in changing from VHDL but there are other opinions. That's why there are at least 2 other languages: Verilog and System Verilog in addition to VHDL.In my opinion, VHDLwhiz is the way to go. The emphasis is on simulation for just about everything. That was new to me because Xilinx ISE WebPack didn't always include a simulator - so I never learned how to create a testbench.Have fun!

author: rstofer
author_rank: Super Contributor
timestamp: August 16, 2020, 07:55:59 pm
content: I would buy the book based solely on the introduction to the Vivado toolchain. Chapter 4 (the last I can preview at Amazon) does a terrific job of getting the reader up to speed with Vivado. Reducing the frustration level is vitally important to having fun with FPGAs.As books go, it is reasonably priced. In fact, I just ordered a new paperback copy in the US for $21. It may turn out to be the most productive and least expensive thing I have ever done with FPGAs.

author: NorthGuy
author_rank: Super Contributor
timestamp: August 16, 2020, 08:41:01 pm
content: Quote from: Mario87 on August 16, 2020, 04:08:14 pmFPGA is a complex object. Lots of things you can do. Some people want to study digital logic. Others what to build something particular. Others like meddling with cool boards, or cool IPs. The best way to start depends on where you want to go.Alice: "Would you tell me, please, which way I ought to go from here?".Cat: "That depends a good deal on where you want to get to"Alice: "I don't much care where .."Cat: "Then it doesn't matter which way you go"

author: prophoss
author_rank: Contributor
timestamp: August 16, 2020, 09:20:21 pm
content: That VHDL whiz looks good I will have to check that out sometime. I have been wanting to give the Ice stick a try for a while. Good question and answer.

author: james_s
author_rank: Super Contributor
timestamp: August 16, 2020, 09:36:10 pm
content: I prefer simple boards with as many pins as possible brought out to headers so that I can connect the peripherals that I want to work with. I have several full-featured dev boards and while the buttons and LEDs are useful I find that 90% of the stuff never gets used and is just more pins to assign to safe states. It depends on what you want to do though, one of my favorite boards is still the EP2C5T144C8 mini boards because they are dirt cheap and easy to find. The FPGA they use is old and small by modern standards but that brings the advantage that compiling is very fast and if you fry it you're only out $15. Despite the small size it is big enough to implement a complete 8 bit computer.I found the book "Free Range VHDL" to be very helpful, you can download it for free.

author: rstofer
author_rank: Super Contributor
timestamp: August 16, 2020, 10:18:53 pm
content: I tend to think about FPGAs at two levels: The beginning is creating simple gate logic that takes switch inputs and produces LED outputs. Simple enough but truly a PITA to breadboard with off-board components. It's true that more pins is better than less but boards with no 'gadgets' are just a lot more difficult to play with.Second, I like messing about with CPUs. For that I need, at least, 16 switch inputs for console switches. It's nice if the switches are on the board as opposed to stuffing them on a PCB with an SPI based IO expander which is exactly what I did for one of my projects. I also need at least 4 digits of 7 segment displays and 8 is even better. These would typically be assaigned to the Program Counter and the Instruction Register although, given enough switches, I might be able to change the assignment. Then I need a switch/button pair to allow for single stepping. Do I step once per instruction or once per microstep? There's another switch. In my view, the more gadgets the better and having them on board makes it easy.Of course, there is the idea of building a 4x4 digit 7 segment display using one of the 7 segment driver chips and connecting it via SPI. I've done that too on a CPU project. In fact, it might be wise to build the entire front panel logic first.But that's a step too far for a beginner. They should at least get an LED to blink before kicking off the LC3 project (Google for LC3 appendix A and appendix C, or buy the book).Or, go the CMOD route with a boat load of pins and no gadgets whatsoever. It will plug in to a prototype board:https://store.digilentinc.com/cmod-a7-breadboardable-artix-7-fpga-module/This could be another 'starter' board (it's inexpensive) but even the largest FPGA (35T) is still pretty small.I guess I can't wrap my head around dangling toggle switches and DIP switches aren't a whole lot better.

author: james_s
author_rank: Super Contributor
timestamp: August 17, 2020, 12:32:30 am
content: I don't claim my preference to be the undisputed superior approach.Something to keep in mind is that you don't have to be limited to one single board or even one vendor to do everything. You can get some reasonably full featured development boards with lots of toys in the $100 range and you can pick up a few cheap bare bones boards for other projects. The cheap boards are cheap enough that you can toss them in a box and call it a finished project, it can be cheaper than buying the bare FPGA to put on your own board and all the fiddly power rails are routed for you.Whatever you do, start by picking up a book or reading some tutorials online, think about what sort of projects you are interested in and start learning. There was quite a learning curve before I could even get something simple to compile and work, then one day something just clicked and I could develop somewhat complex projects that actually worked.

author: rstofer
author_rank: Super Contributor
timestamp: August 17, 2020, 01:03:11 am
content: Quote from: james_s on August 17, 2020, 12:32:30 amNor do I!It has worked for me but my interests are in a very thin part of FPGAdom. I have worked with the Z80 core (T80 at OpenCores.org), I built an entire IBM1130 system on a Nexys 2 board that runs all of the factory software, unchanged, and then I spent time with the LC3 project on that Nexys 4 board. I still write Fortran code for the 1130 - my first machine back in '70. I like Fortran!It's hard for any of us to provide much in the way of guidance when we all have our own way of working. Of course it is compounded by the fact that new users have no idea where they want to go.Just toss everything up in the air and let the newcomer go whichever way they want!

author: james_s
author_rank: Super Contributor
timestamp: August 17, 2020, 01:08:15 am
content: Quote from: rstofer on August 17, 2020, 01:03:11 amYep, that's why I say jump in and learn something. If the budget is tight just buy one of the little <$20 dev boards and start coding, if you have the budget to purchase a fancier dev board then go for it. The thing not to do is be paralyzed by indecision trying to decide on the perfect board that does everything you could ever possibly want it to do. Any functional FPGA board is better than having no board.

author: james_s
author_rank: Super Contributor
timestamp: August 17, 2020, 02:38:18 am
content: I looked into Lattice at one point since I've been using Xilinx and Altera but there seems to be far less hobbyist support for the Lattice platform. Of the three, Altera has the cheapest programming hardware, the USB byte blaster clones are only about $6 and work perfectly.

author: Mario87
author_rank: Frequent Contributor
timestamp: August 17, 2020, 11:56:52 am
content: Lots of interesting replies and lots of different ways to go. Think I like the idea of both VHDLWiz / ICE FPGA and the book I linked to with the Basys 3 board.For now its really just to get me up to speed and as someone mentioned earlier the good with with that book is that it has an introduction to Vivado which I have never used before and from my previous experience with Xilinx developments environments (12 years ago) learning that side of things is half the battle.Might start off with the Basys 3 and the book then take it from there. As someone else mentioned, my first board wont be my last and I like that the Basys 3 has VGA output as my longer term projects will involve high speed video / HDMI and the VGA side of things should at least be a reasonable introduction to that.

author: Fred27
author_rank: Unknown
timestamp: August 17, 2020, 12:07:51 pm
content: You might find these upcoming webinars on Vivado useful:https://www.element14.com/community/events/5604/l/getting-started-with-xilinx-development-toolshttps://www.element14.com/community/events/5605/l/xilinx-workshop-getting-to-know-vivado-part-iYou may - or may not - want to consider the Zynq line which combines FPGA fabric with a hard ARM microcontroller. There are some cheap Zynq boards such as the MiniZed or Pynq-Z2 (which includes HDMI). Sorry to add more options! Obviously it's possible to create a soft processor on a pure FPGA board too.

author: mfro
author_rank: Regular Contributor
timestamp: August 17, 2020, 12:27:51 pm
content: I would recommend reading Grant Searle's pages (http://www.searle.wales/, scroll down to "Low Cost FPGA Projects") if you have at least remote affinity to anything retro computing.There is definitely no cheaper way to enter the world of FPGAs and you have something reasonably complex (but working) to play with from the very beginning.

author: rstofer
author_rank: Super Contributor
timestamp: August 17, 2020, 07:57:42 pm
content: That low cost board referenced in the web sitehttp://www.searle.wales/is just $31.45 for 2 boards including shipping from China. <corrected amount>https://www.ebay.com/itm/ALTERA-FPGA-Cyslonell-EP2C5T144-Minimum-System-Learning-Development-Board/163641195816The programmer is $9.02 shipped to the US from China <corrected amount>i would rather have the peripheral gadgets on the board but for the money, I could change my mind in a real big hurry. It might be worth having a couple of these boards around, just in case something comes up. <Removed Space Invaders comment because that is not an FPGA prooject, it is discrete.>

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 17, 2020, 09:24:01 pm
content: Quote from: rstofer on August 16, 2020, 07:36:58 pmThat's only one language: SystemVerilog. Verilog was subsumed into SystemVerilog in 2009. Sure, people still call it "Verilog", but unless you're referring to some legacy implementation in an old version of Quartus or ISE, you're really talking about SystemVerilog.

author: rstofer
author_rank: Super Contributor
timestamp: August 17, 2020, 09:59:22 pm
content: Sort of...With Vivado, you can select on project creation from VHDL or Verilog-2001. If you really want SystemVerilog, you can specify it when a source file is created. I don't know which of the two options are appropriate if the end result is to be SystemVerilog. I guess you could select VHDL and then create every source file as SystemVerilog but I haven't tried it.I don't know why SystemVerilog doesn't show up on project creation. Just the way it is (at least with Vivado WebPack).I'd be willing to bet that people are still using Verilog in one incantation or another and haven't made any move toward the advanced features of SystemVerilog.There are still 3 IEEE standards:VHDL IEEE 1076-2019Verilog IEEE 1364-2005SystenVerilog IEEE 1800-2017I would liken SystemVerilog subsuming Verilog in pretty much the same way that C subsumes Fortran. There is a bunch of Fortran in the wild and people are still using it for numerical analysis.It's pretty clear that Vivado still supports plain vanilla Verilog.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 17, 2020, 10:56:42 pm
content: Quote from: rstofer on August 17, 2020, 09:59:22 pmNope. To create a SystemVerilog file just choose it from the pull-down when creating the file:QuoteWrong. See above.QuotePeople still use SystemVerilog like it was 1995. For some reason they don't take advantage of the features of SystemVerilog that fixed the stuff that made Verilog a pain to use.QuoteNope. When the IEEE released the SystemVerilog standard, they cancelled the Verilog 1364 standard. It's no longer an IEEE standard.QuoteApples and oranges, and, in fact, a ridiculous analogy. SystemVerilog will compile old Verilog code. No C compiler I know of will compile any FORTRAN.QuoteYes, that's true.

author: rstofer
author_rank: Super Contributor
timestamp: August 17, 2020, 11:27:40 pm
content: Quote from: Sal Ammoniac on August 17, 2020, 10:56:42 pmThe pulldown menu under Settings (actually, project settings) shows only VHDL and Verilog. I am using version 2019.2 so that might explain it. I suppose I should upgrade someday but licensing used to be a real pain with updating so I avoid it.I do have the choice of SystemVerilog when I create a file, just as you show.I have never used Verilog and I have been thinking about trying a project with SystemVerilog. I might just take one of my existing VHDL projects and translate it. That won't use the best features of SV but it's a start.

author: rstofer
author_rank: Super Contributor
timestamp: August 17, 2020, 11:35:24 pm
content: Quote from: Sal Ammoniac on August 17, 2020, 10:56:42 pmBut Bell Labs did create a program 'f2c' to translate Fortran-77 to C, just pipe the output (I think). Everything else in Unix can be piped...I'm not entirely certain how gfortran works. The backend of the gcc compiler is the same for all of the languages it supports so I suspect only the frontend changes between languages. No doubt there is some intermediate code scheme in their somewhere. But you're right, I don't know of a native C compiler that has a clue about Fortran.

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 18, 2020, 12:22:19 am
content: Quote from: blueskull on August 17, 2020, 01:14:57 amI used a Xilinx dev board back when I started (Spartan 3) with some PSRAM, a few LEDs, a 4-digit LED display and a few buttons. I think it was already from Digilent IIRC.These days I would recommend Lattice as well, especially if you're just beginning and want to grasp all the concepts, use simple and cheap tools. A MachXO2/XO3 breakout board comes to mind for instance. Like $25. Embedded FTDI chip to program it. 8 LEDs. Most IOs broken out. Simple toolchain that just works. Especially if you come from an EE background, have some gear like a scope and some parts laying around, I don't think you need anything fancier as a starter kit.Now if you come more from a software dev background, and/or don't have any scope/soldering iron/etc around, I'd suggest some board with a bit more (LEDs, display, buttons, extension ports/boards, etc.)You can take a look at Digilent:https://store.digilentinc.com/fpga-development-boards-kits-from-digilent/(but I think they have almost exclusively Xilinx-based boards?) You can't go wrong with those.That said, I still highly suggest having at least a scope handy if you want to work with FPGAs. You don't necessarily need anything expensive (unless you want to design high-frequency stuff). But checking/verifying/debugging a digital design on FPGA without a scope is a bit like shooting in the dark. And now if you have a scope, you'll figure out you don't really need any fancy peripherals on your dev board.

author: rstofer
author_rank: Super Contributor
timestamp: August 18, 2020, 01:08:45 am
content: Everybody likes to do simulation and look at the signals but Vivado takes it a step farther with their Integrated Logic Analyzer. I have only played with it a couple of times so I'm not going to discuss it but maybe this video will generate some interest:https://www.xilinx.com/video/hardware/logic-debug-in-vivado.htmlI don't know if the other vendors have a similar feature but being able to debug the actual hardware at full speed is pretty slick. This feature may push toward Xilinx boards like those from Digilent. I have only used it on the retired Nexys 4 DDR board now known as the Nexys A7 board.It takes some editing of the constraints file but that is learnable.EDIT: The video shows a different way of connecting the probes than the method I used where things were wired up in the constraints file.

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 18, 2020, 01:24:46 am
content: Quote from: SiliconWizard on August 18, 2020, 12:22:19 amA logic analyzer is more useful with FPGAs, especially for beginners. A FX2 is really cheap and also comes in handy for fast data transfer between FPGA and PC. (Really need someone to make easy to use software for the even faster FX3...)

author: rstofer
author_rank: Super Contributor
timestamp: August 18, 2020, 01:53:57 am
content: Based on a recommendation in another thread somewhere around here, I bought this logic analyzer:https://www.ebay.com/itm/USB-Logic-Analyzer-24MHZ-8-Channel-12C-UART-SPI-IIC-CAN-1Wire-Debug-For-ARM-FPGA/124238666414It arrived quickly because it is shipped from California and, well, I live in California.There is no documentation telling you that the device enumerates as a 'Saleae Logic' device and that you need to download the driver and software from Saleae which is problematic, I suppose. I am using it with Pulseview (free software) under both Win10 and Linux Raspian (Raspberry Pi 4). I can't say I am thrilled with Pulseview but at least it's free.I asked the vendor for a recommendation and they replied that it looked just like the Saleae Logic.8 channels isn't nearly enough but it's better than nothing. My Digilent Digital Discovery and even the Analog Discoery 2 are much more capable and the software is orders of magnitude better.When I was working on my 1130 project, I built up a 32 channel LA from a spare Spartan 3 Starter Board:https://www.sump.org/projects/analyzer/I carried a 32 bit debug bus through most of the components and commented it out everywhere except where I needed it. This is required because, ultimately, the bus signals need to appear in the Port declaration of the top module/component. Worked well!

author: mfro
author_rank: Regular Contributor
timestamp: August 18, 2020, 06:03:36 am
content: Quote from: rstofer on August 18, 2020, 01:08:45 amIntel/Altera has SignalTap which is essentially the same thing.I do have a scope but basically never use it for FPGA development (except maybe to measure real timing of badly documented peripherials).The workflow is to develop a specification, implement it in HDL, simulate with ModelSim (or ghdl) and correct all the flaws you haven't seen during spec time and finally get the timing constraints right. Until then, Quartus really didn't see my sources (except for maybe occasional checks if the code compiles there as well).Only after everything red in the TimeQuest has been eliminated, the configuration goes to the chip for the first time. It then usually just works (and only needs SignalTap in very rare tenacious cases).The turnaround times of Analysys/Synthesis and Fitter are just way too long to work "evolutionary" with the real hardware. Even moderately complex designs take like 20 minutes to compile on a reasonably fast machine and that is way too long to "keep up the flow".

author: NorthGuy
author_rank: Super Contributor
timestamp: August 18, 2020, 12:52:55 pm
content: Quote from: rstofer on August 18, 2020, 01:08:45 amILA is not a separate hardware, just a design running on the FPGA and sampling the signals from your design. The data is collected through JTAG, which is 30 MHz with some overhead, so it cannot do much at full speed. If you have a better communication channel to your PC (such as Gigabit Ethernet or USB 3), you can roll out your own ILA which will be much more capable.

author: asmi
author_rank: Super Contributor
timestamp: August 18, 2020, 07:00:49 pm
content: Quote from: mfro on August 18, 2020, 06:03:36 amIs it free like ILA is? Antel loves charging for everythingI mostly use ILA when I need to verify interface with external devices. Internal stuff is ironed out with simulations. Xilinx also provides free "JTAG to AXI Master" IP which allows probing system buses in real time on a running system - this is very useful in CPU-less designs when you can't use debugger's "Memory view" (or whatever it's called in Eclypse), or when a bus of interest is not connected to CPU.

author: asmi
author_rank: Super Contributor
timestamp: August 18, 2020, 07:03:12 pm
content: Quote from: NorthGuy on August 18, 2020, 12:52:55 pmItcollectsdata at full speed (until it fills the sample buffer), you just can't stream it to PC in real time. But the latter is rarely needed anyway, certainly not for debugging - you can't really make sense of such stream of data in real time anyway.

author: hinxx
author_rank: Contributor
timestamp: August 18, 2020, 07:50:33 pm
content: I just started playing with the FPGAs as well. I wanted to learn Verilog, not VHDL or SystemVerilog at this point. Been warned of the steep learning curve, but after a couple of weeks I'm quite happy with where I am.I went with OLIMEX iCE40HX1K-EVBhttps://www.olimex.com/Products/FPGA/iCE40/iCE40HX1K-EVB/open-source-hardwaresince open source is kind of my cup of tea. Along with that I got their ADC and digital IO boards, and a programmer (not really necessary since you can use RPi or some other Arduino board for that). They also provide a guide on how to get the complete (open source) toolchain up and running ; it worked as advertised for me on Linux. I did not even download Lattice iCEcube2 tool. iverilog and GTKwave is serving me well for now, along with any text editor I feel like using that day..OLIMEX github provides programming SW tool and a Verilog blinky LED demo I started off:https://github.com/OLIMEX/iCE40HX1K-EVB/tree/master/demo/ice40hx1k-evb.Then I stumbled upon some tutorials athttp://hdlexpress.com/Verilog/VT.htmland went through couple of initial videos and did the examples (very important to actually do the lessons!). I like how Kirk is presenting material with very little bloat in those videos.. I did not finish the complete lecture series, I'm still at part 5 lessons; I was to eager to start hacking at the Verilog now that I understand the syntax and a little bit of modeling and simulating.What got me interested was discovery of this on this forum:https://www.eevblog.com/forum/fpga/verilog-rs232-uart-and-rs232-debugger-source-code-and-educational-tutorial/msg2801388/?topicseen#msg2801388by BrianHG. Managed to get it working on Olimex board, and now it talks to my PC based CLI tool that can talk to FPGA over UART (not being a Pascal fan myself I went with homebrew C code around FTDI DXX2 library). It was a great Verilog code for me to learn from, being a complete starter. If you can believe I managed to get my FPGA to talk to the SRAM on the EVB, plus I'm now doing SRAM memory 16-bit word reads/writes over the UART. Gotta have comms and memory under control before you can do more .I'll be tinkering with RLE and some OLED displays for fun next.

author: mfro
author_rank: Regular Contributor
timestamp: August 18, 2020, 08:24:56 pm
content: Quote from: asmi on August 18, 2020, 07:00:49 pmIt is. At least for the consumer FPGAs I'm dealing with.

author: rstofer
author_rank: Super Contributor
timestamp: August 18, 2020, 09:14:23 pm
content: Earlier in the thread I was talking about the LC3 RISC project and my use of 100T versions of the Artix 7 and how they are probably overkill. So, I drug out my Basys3 35T board, clipped off some unavailable signals (8 digit 7 seg display versus 4 digit, color LEDs, etc) and, voila', it fits. The big user is BlockRAM and it uses 32 of the 50 available blocks. On the 100T 32 of 100 blocks. Nevertheless, as an educational project, the LC3 will easily fit in the 35T devices.Attached is the utilization summary. Look at how few FFs and LUTs are used. Remember, this is a pretty significant RISC processor with 64k of 16 bit memory complete with a privilege control system.Google for LC3 Appendix A and LC3 Appendix CThere's a lot of logic in an Artix 7 35T. My projects tend to push the limits of BlockRAM, not logic. External memory is one solution but it takes a lot of pins.[ Specified attachment is not available ]