FPGA for beginner - Page 1
Forum section: electronics / general

author: anvoice
author_rank: Frequent Contributor
timestamp: August 20, 2024, 08:43:48 pm
content: I'm starting out with FPGAs, reading along with online lectures on Digital Design and Computer Architecture from Zurich University. They use a Basys 3 board for labs and eventually designing a MIPS processor. I was thinking of getting an FPGA board and trying some examples myself, but it would be nice to have the board be useful beyond the course, perhaps implementing other processors or working with computer vision/robotics.Considerations:Don't want to spend a fortune testing the waters, but also don't wish to outgrow this board after a few months.One board I have in mind is an Artix A7-lite. It has few buttons/switches/LEDs and no 7-segment displays, unlike the Basys 3. However, it has usb c ports, hdmi, and a bigger FPGA chip for about the same price. I feel that I can always add buttons/displays as needed.The board I mentioned above likely has worse documentation, which is a downside but not a deal breaker. Same for its inability to simply replicate lecture code written for the Basys: I'm willing to actually understand how this works, rather than copy-pasting.The biggest issue is my lack of knowledge. Trying to learn fast, but understanding what ports, how many LUTs, how much DDR or QSPI flash I need is beyond me at this point.Question: what is a good board to choose? Or should I stick to simulations until I can gain some traction?

author: ataradov
author_rank: Super Contributor
timestamp: August 20, 2024, 09:50:16 pm
content: Here is how it usually goes:1. Try simulations, it is cool, I want a board.2. Get a board, blink an LED, it is cool.3. Go back to the simulation, since it is the only meaningful way of developing a big project.4. Once it works in the simulation, start working with the real board.The only real reason to add (2) is if it makes you excited and you want to see something work. But it will not be very useful for the actual development.One of the reasons for this is that hardware synthesizers are annoyingly good at optimizing logic, so you need to have the project completed to a large degree before it would do anything at all in the hardware. Or you need to create stubs for everything to prevent the logic fro being optimized out.Also, MIPS is in the past, your life would be much easier if you switch to RISC-V. Basic ISA is 90% the same, so it is not a huge switch.

author: anvoice
author_rank: Frequent Contributor
timestamp: August 20, 2024, 10:12:54 pm
content: I was only thinking MIPS due to the course material using it, so if I want to follow along I'll need to do the same. I don't mean to say I'll stick to MIPS in future designs, just don't see how to learn otherwise, at least with this course.

author: ataradov
author_rank: Super Contributor
timestamp: August 20, 2024, 10:23:35 pm
content: MIPS is fine, assuming the course material has toolchains in it. RISC-V is just better because there are a lot of pre-built toolchains, so you don't have to mess with building GCC from the source.At the same time many courses have been updated for RISC-V, so you may want to look for an updated version of the course.

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 20, 2024, 10:27:39 pm
content: Yep. Now of course there's a large gap between blinking a LED and implementing a CPU, so I'd suggest starting with the basics (if you're a beginner) and not run in all directions right from the start.

author: anvoice
author_rank: Frequent Contributor
timestamp: August 20, 2024, 10:55:32 pm
content: Quote from: ataradov on August 20, 2024, 10:23:35 pmIt's a 2024 course unfortunately. Perhaps I need to look for another one...Quote from: SiliconWizard on August 20, 2024, 10:27:39 pmAs in, do not buy a board to start out?

author: ataradov
author_rank: Super Contributor
timestamp: August 20, 2024, 11:02:07 pm
content: Buy a board and do simple stuff that has much shorter iteration cycles. So, the time from simulator to the board is much shorter and you will actually use the board.Like that 7 segment display is multiplexed. If you are new to the digital design, making it show some numbers is not a trivial task. So, start with doing that and begin very comfortable doing it.

author: anvoice
author_rank: Frequent Contributor
timestamp: August 20, 2024, 11:08:12 pm
content: Quote from: ataradov on August 20, 2024, 11:02:07 pmSounds good.Would the A7-lite without on board gadgets work for that assuming I add some 7-segments, or is the basys preferable?

author: ataradov
author_rank: Super Contributor
timestamp: August 20, 2024, 11:14:03 pm
content: For a beginner, the more stuff is on the board, the better. Adding displays is more annoying and takes more time that you might think.

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 20, 2024, 11:33:29 pm
content: Quote from: anvoice on August 20, 2024, 10:55:32 pmNope. Just start with simple stuff, not right away with a CPU.As to the board, there are many out there. You don't need a "beefy" FPGA, so you can start with something modest. What else is on the board is entirely up to you. Having at least a few LEDs is useful. More than this, depends on how comfortable you are with electronics and wiring/soldering stuff. A 7-seg LED display is always nice to have when starting with FPGAs.

author: daisizhou
author_rank: Super Contributor
timestamp: August 21, 2024, 12:35:44 am
content: Quote from: anvoice on August 20, 2024, 08:43:48 pmWhy don't you draw a circuit board yourself?Draw the schematic yourself, then give it to JLC to make the PCB, and finally buy the components for assembly

author: ataradov
author_rank: Super Contributor
timestamp: August 21, 2024, 12:39:29 am
content: This is the winner of the worst advice ever.

author: anvoice
author_rank: Frequent Contributor
timestamp: August 21, 2024, 12:45:09 am
content: Thanks for the suggestions everyone.I'm leaning towards the microphase A7-lite at the moment. I realize the 100T chip may be more than a beginner needs, but as long as I can add the needed hardware (I'm comfortable soldering and building circuits) maybe I can take advantage of some of its more advanced features eventually. Of course, I understand I'd be doing more work up front.Quote from: daisizhou on August 21, 2024, 12:35:44 amIs that... cost efficient? I'm fine with soldering, but my PCB design is on an amateur level and buying all the components the thing needs to function (usb c ports, etc.) seems like it will offset any cost advantages.

author: ataradov
author_rank: Super Contributor
timestamp: August 21, 2024, 12:53:25 am
content: Quote from: anvoice on August 21, 2024, 12:45:09 amThere are no cost advantages. In single quantities FPGA alone will cost you way more than the entire board. And there is zero chance a beginner would be able to design a board with 324-BGA IC.This is on the same level as telling someone to design and build their own car because it would be cheaper.

author: anvoice
author_rank: Frequent Contributor
timestamp: August 21, 2024, 01:02:35 am
content: Sounds about right.

author: brucehoult
author_rank: Super Contributor
timestamp: August 21, 2024, 01:06:33 am
content: Depends on how fancy a car you want!

author: Rainwater
author_rank: Regular Contributor
timestamp: August 21, 2024, 01:08:53 am
content: Quote from: daisizhou on August 21, 2024, 12:35:44 amThat's about the same as building a car from blocks of aluminum for the engine and some sand to make the windshield.I would recommend getting a prototypeing kit.The radio shack kit is the best for non-rf stuff. Over the years, i have not found anything equilivent to it.Good luck finding a complete set. I can provide a parts list if there is a needTe books are copyrighted, so im sure their available for download somewhere.https://www.ebay.com/b/Electronics-Learning-Lab/158698/bn_71609432This is what i got in the early 90s and still dev on today. Still have all the original chips(including the ones i burnt).At most, i would suggest getting some level shifter to convert voltage levels until you're more comfortable doing it with discrete hardware and protection circuits

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 21, 2024, 01:21:39 am
content: Not only cost, but as a beginner, when running into any "bug", you will always wonder whether this is a problem with your board design/soldering or whether it's a problem in your HDL. Awful situation.That's something you can think of doing much later on, when you have built more skills.

author: EEexpert
author_rank: Newbie
timestamp: August 21, 2024, 02:13:42 am
content: Quote from: Rainwater on August 21, 2024, 01:08:53 amThat's really good advice.The one who wants to explore FPGAs should get to know that FPGAs alone are not that usefull without other chips/components connected to them. And design of logic in FPGA heavily depends on what and how external electronics are connected, so prototyping kit and wires is a must have!

author: hamster_nz
author_rank: Super Contributor
timestamp: August 21, 2024, 03:06:06 am
content: Don't worry about size too much. You can do advanced projects on a smaller FPGA, you just can't do large projects - a RV32I core might take up 10% of a XC7A35T, or 3% of a XC7A100T.Think of it this way - paying extra for a 4TB SSD offers minimal benefit when you never use more than 1TB of data.A larger FPGA does offer some advantages as the logic utilization grows (>50%), but it is also gives slower to implementation times.Side note - a XC7A35T is a XC7A50T with a few fuses blown, so if the GUI says your design uses 80% of the logic you are only really using 60% of the physical resources, allowing you to successfully implement designs that might normally expect to have contention.

author: daisizhou
author_rank: Super Contributor
timestamp: August 21, 2024, 03:43:12 am
content: Looking at this FPGA chip, I don't know why, but the failure rate of this model is always high. I have replaced many of them

author: pcprogrammer
author_rank: Super Contributor
timestamp: August 21, 2024, 06:22:18 am
content: Maybe a board likethis oneon Aliexpress suits your needs. Not cheap, but cheaper then an Artix-7 100 one, and it has a display on it.But don't forget about buying aprogrammerfor it too.Making your own board is not as simple as some would make you believe, especially when big BGA ic's are used. Easier to stick to development boards like the one you have in mind, but it does require adding extra hardware via the headers if needed and there you have to be aware of the voltage specifications of the FPGA. No 5V on these, so no old fashioned TTL ic's but newer versions that work on 3.3V or even lower voltages.If you still like theMicrofase A7-Lite, you can always search online for schematics of boards that do have displays on them and just copy the needed parts of those designs.But like others wrote, there is no need for a huge FPGA. Lots of designs work in older Spartan-6 or Spartan-7 series of FPGA's. Or even from other vendors. Risc-V cores are used on boards likeTang Nano 9K.

author: anvoice
author_rank: Frequent Contributor
timestamp: August 21, 2024, 08:56:11 am
content: Quote from: Rainwater on August 21, 2024, 01:08:53 amI have two of those actually. I also have level shifters, though I'll have to check if they can do the correct levels.Quote from: pcprogrammer on August 21, 2024, 06:22:18 amI have a programmer of some kind (bought years ago so history is gone on Aliexpress, and I'm travelling so can not verify). Do you know if you need a Xilinx specific one or if any generic JTAG programmer will do? I also have a logic analyzer from years back that I never used, hopefully that will come in handy.

author: pcprogrammer
author_rank: Super Contributor
timestamp: August 21, 2024, 09:03:09 am
content: Quote from: anvoice on August 21, 2024, 08:56:11 amI'm not sure, but think that the Xilinx (AMD) software wants a dedicated programmer. Maybe others with more experience can chime in on this.A logic analyzer is always handy when working with digital signals.

author: gpr
author_rank: Contributor
timestamp: August 21, 2024, 02:26:21 pm
content: btw, how safe is it to buy something like FPGA devboard on aliexpress, considering there are a lot of clones and fakes of everything there?I'm also thinking about getting devboard to start with FPGA, keeping opensource toolchain in mind, and trying to find some inexpensive board to start with.Right now looking at olimex with ice40, pretty well supported it seems:https://www.mouser.co.uk/ProductDetail/909-ICE40HX8K-EVBIt has some drawbacks, like requiring external SPI programmer, but overall 26£ price is hard to beat.FPGA devboards prices make me sad, everything under 50£ is in "nano" category with only a few pins available. Something capable of running riscV (and especially linux) is 100£ and more.There are also different versions of Tang/gowin boards everywhere, but I'm not sure how well they are supported and documented, I have an impression they are not very usable without proprietary gowin tools.Any advice is appreciated.

author: ataradov
author_rank: Super Contributor
timestamp: August 21, 2024, 02:37:27 pm
content: Nobody fakes FPGAs, especially high-end ones. If you get something that seems to work, it would be a genuine FPGA.None of the FPGAs are very usable without vendor tools. ice40 and OSS toolchain is cool, but if you want to do something serious, you are not avoiding proprietary tools.You are also all over the place with requirements. ice40 will not run Linux, nor will it fit feature-rich cores with a lot of peripherals. So, you need to decide what you actually want and then pick a board accordingly.

author: asmi
author_rank: Super Contributor
timestamp: August 21, 2024, 02:58:14 pm
content: FPGA boards from aliexpress is a terrible idea for beginners, as they typically come with zero support, the best you can hope for is schematics (if it's accurate), but it's of not much use for beginners who don't know how to read it yet. This is why I keep insisting that first FPGA devboard should be from a reputable brand which stands behind their products by providing support. Digilent is a very good example of such brand, they provide many examples for their boards, and also have forums, where their employers answer any questions quite quickly, and they also have a decent choice of addon boards to extend the functionality of a baseboard when you need to.

author: anvoice
author_rank: Frequent Contributor
timestamp: August 21, 2024, 03:17:12 pm
content: I bought a ton of stuff from Aliexpress. The general idea is: it's quite safe, but be ready to test what you get (for functionality and it not being a fake). The merchants cannot afford the shipping label to send merchandise back for a return, so they're not interested in sending you broken products (you'll just get a refund and keep the item likely), but I have gotten some bad parts over the years. When I took too long to test, I had no recourse in terms of getting money back.Whether there is support or not depends on the vendor/product. In some cases you can get example code, etc., though you're clearly not beating Mouser/Digikey for that. What you get in return is (usually) a better price.Quote from: pcprogrammer on August 21, 2024, 09:03:09 amReading more about the board's description on Aliexpress, it seems to have a built-in programmer circuit and only needs a usb C cable for the JTAG connection. If true, that's a nice bonus.Unfortunately I can't find the exact board anymore. It's still in my cart but showing "not shipping to your address". Boards from other merchants are more expensive, so I might have to get a XC735T or I'm out of luck.

author: asmi
author_rank: Super Contributor
timestamp: August 21, 2024, 03:43:54 pm
content: Quote from: anvoice on August 21, 2024, 03:17:12 pmUnfortunately that's not the end of story with FPGA devboards. Alongside lack of support you also often get an underspecced PDS which can not handle FPGA at full load, which means at some point your designs will just start crashing in hardware for no apparent reason. Another typical defect of such board - though that one is at least theoretically fixable by the end user - is a lack of/insufficient cooling. The problem for beginners is that they are not really in a position to evaluate a board and check if PDS and cooling is adequate or not before ordering.Yet another potential problem is with licensing. Many FPGA boards on aliexpress have FPGAs which you can only use if you have paid license. Such vendors typically provide some cracked old version of vendor tools.

author: pcprogrammer
author_rank: Super Contributor
timestamp: August 21, 2024, 04:19:07 pm
content: Quote from: anvoice on August 21, 2024, 03:17:12 pmMy experience with Aliexpress is the same. Yes you need to test it when it arrives and file a dispute with some proof to get your money back.When buying FPGA boards, you have to pay attention to the source, but there are some reputable ones out there. Maybe with a very elaborate design you might run in to problems like asmi described, but as a beginner the chance on that is not to high.Quote from: gpr on August 21, 2024, 02:26:21 pmLike ataradov wrote, the board you linked to is very small and won't support the things you listed above.And like he also stated the OSS does not provide much use for the more complex designs and you will need to use the FPGA manufacturers tools anyway, be it Xilinx (AMD), Altera (Intel), Gowin, Anlogic or which ever manufacturer out there.Aliexpress FPGA boards are fine for beginners to have fun with, but like amsi wrote there are some drawbacks. If you don't want to deal with those, then you have to open up your wallet way further.Another note, if it is Linux you want to run but also have some logic fabric to play with, you might want to look into Xilinx (AMD) zynq or Altera (Intel) cyclone V soc devices. These come with ARM cores on the chip and makes running Linux easier without taking a lot of the logic fabric.Edit: fixed a typo.

author: pcprogrammer
author_rank: Super Contributor
timestamp: August 21, 2024, 04:31:36 pm
content: Quote from: anvoice on August 21, 2024, 03:17:12 pmYes you are right, the Microfase boards do have a USB-C port for the JTAG connection on it. Indeed a nice bonus.Quote from: anvoice on August 21, 2024, 03:17:12 pmThat is also one of the downsides of Aliexpress. Prices can change rapidly when set as special offer. When I find something that is almost to cheap to believe, but still seems genuine, I buy it directly. Can always dispute and get my money back if it is crooked. (Or sometimes the seller just does not ship it and you get your money back automatically.)It can also be that an item is no longer available in a warehouse near you and then it suddenly does not ship to your country anymore.Shopping on Aliexpress can be frustrating.

author: rstofer
author_rank: Super Contributor
timestamp: August 21, 2024, 05:01:20 pm
content: I took a different path beginning with the Xilinx Spartan 2 about 20 years ago and today I have several boards but I really like the Nexys A7https://digilent.com/shop/nexys-a7-fpga-trainer-board-recommended-for-ece-curriculum/It is expensive but it has the gadgets I want on a board and I don't have to spend a lot of time wiring up displays and such.A more affordable board is the Basys 3 and while I don't have this version, I do have the Basys 2 which is quite similar. This is much more affordable.https://digilent.com/shop/basys-3-artix-7-fpga-trainer-board-recommended-for-introductory-users/I want gadgets on the board. I'm not interested in chasing reflections on jumper wires. Besides, I am not convinced that solderless breadboards are useful at 100 MHz.Yes, there are MANY cheaper boards and if you don't price your time, they may be adequate. I'm old, I don't have time to wire up displays, switches and buttons.I do consider price. Grad school tuition might be $50,000 per year, the cost of an FPGA board is insignificant when it is useful toward graduation. That logic applies to the Analog Discovery 3 and Digital Discovery as well. Undergrad may be similarly priced...https://digilent.com/shop/test-and-measurement-devices/essential-instruments/analog-discovery-3/https://digilent.com/shop/digital-discovery-portable-usb-logic-analyzer-and-digital-pattern-generator/

author: dietert1
author_rank: Super Contributor
timestamp: August 21, 2024, 05:30:46 pm
content: I was lucky to start with a XILINX FPGA kit, so there was easy upscaling later on. I also did small projects using Altera and Lattice FPGAs. All these are well supported by free development systems and there are examples and open source units on the web.For learning I'd recommend to get something small, like a Lattice LCMXO2-7000HE-B-EVN (still available from Digikey). Builtin supply, programming and communication via USB. Somebody wrote before: Any meaningful development happens on a simulator. Not everybody is born to make a large project with lots of external interfaces run on the chip.Regards, Dieter

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 21, 2024, 09:01:09 pm
content: My very first FPGA dev board was a Digilent (with a Spartan 3, it was quite a while ago). Not affiliated with them, but I think you can't go wrong with Digilent.When you're more experienced, you can sure move on to Aliexpress stuff.

author: brucehoult
author_rank: Super Contributor
timestamp: August 21, 2024, 10:46:48 pm
content: Quote from: pcprogrammer on August 21, 2024, 04:19:07 pmYes, and at much higher execution speeds of typically 600-800 MIPS vs maybe 100 MIPS for a softcore on a good FPGA (but very often 25-50 MIPS). I quote MIPS rather than MHz here as many softcores take 3-4 CPI which can make MHz misleading.Also don't forget the SoC FPGAs with RISC-V hard cores e.g. MicroSemi.The BeagleV "Fire" for $150 has Microchip’s PolarFire MPFS025T-FCVG484E which runs its five 64 bit SiFive RISC-V cores (4 Linux, one real-time) at up to 667 MHz (3.125 CoreMarks/MHz, 1.714 DMIPS/MHz), 16GB eMMC, 2GB RAM.And 23k FPGA logic elements, which is a lot if you're not building CPU cores from them!BeagleBoard.org are I think pretty well known for supporting their products.GOWIN also have FPGA SoCs with RISC-V cores.

author: DiTBho
author_rank: Super Contributor
timestamp: August 23, 2024, 01:38:40 pm
content: Quote from: SiliconWizard on August 21, 2024, 09:01:09 pmmy first and current boards are Digilent- SP3-200 (tini, without any gadgets)- SP3-500 (bigger, full of gadgets)I think it's enough for simple projects

author: zapta
author_rank: Super Contributor
timestamp: August 24, 2024, 03:59:10 pm
content: I was in a similar situation a few months ago, picked the UpDuino 3.1, and am very happy with that decision. Some of the reasons, in an arbitrary order are:1. It plugs into a solderless breadboard which allows me to easily connect and experiment with any peripheral I want.2. It has a simple and minimal circuit that allows me to cut my own custom boards down the road.3. It is supported the open source tool chain (I am very happy with APIO which is similar to the user friendly platformio but for FPGAs)4. Inexpensive. About $30.5. Self contained, including the programmer.https://tinyvision.ai/products/upduino-v3-1

author: anvoice
author_rank: Frequent Contributor
timestamp: August 24, 2024, 07:12:52 pm
content: Well, the saga continues.Firstly, I appreciate everyone's input. There's some great advice here, and I considered it carefully.I did decide to go with the A7-lite (which I may or may not get) for one simple reason: there was a great deal on it (about $100 before tax) for the XC7A100T version on Aliexpress when al the discounts were factored in.Unfortunately, since I bought it, the seller has increased the price for the 100T version and is taking their time shipping. Assuming it was a pricing mistake and they try to avoid shipping, I do have some recourse, and I will give an update on what happens (I assume this might be interesting to others who could potentially be dealing with similar things on hardware they buy).

author: iMo
author_rank: Super Contributor
timestamp: August 25, 2024, 07:45:45 am
content: The basic issue with playing with FPGAs is following, imho - whatever FPGA you buy it will be always too small for something you want to try next day..My advice - buy the largest FPGA you can afford (also mind you will need the dev chain and programmer for it as well).For an incremental approach from simplest up - you do not need any FPGA - you may simulate the stuff. But that is none fun..Simply take the biggest one and try to build and run an existing design - like a CPU or an entire computer etc. (for example there are off the shelf designs like PDP-8, PDP11/70 etc).What is important is to have a large external memory on the pcb as well (like a large sram or dram).This would be a minimum today when I would start againhttps://www.aliexpress.com/item/4000170003461.html

author: DiTBho
author_rank: Super Contributor
timestamp: August 25, 2024, 01:08:45 pm
content: Quote from: iMo on August 25, 2024, 07:45:45 amSpartan™ 3E 1600K Gates, for which Digilent has a kit(1), is so big that I haven't yet saturated it.250K Gates is ok for the most of my projects500K Gates is what I need to implement a RISC softcore and SoC-misc1200K/1600K Gates is what I need to implement two RISC softcores and SoC-miscBRAM is the problem for me.RAM, ROM, VRAM ... consume a lot of BRAM.(1) two kits available1200K Gates1600K Gatessame board, same gadgets(2) different fpga-chip(2) ethernet-phy, two RS232, dram, sram, 2x16-LCD, 2xrot-digi-encoders, 4xswitches, 1xVGA, 1xexpansion-port, ...

author: djsb
author_rank: Super Contributor
timestamp: September 22, 2024, 11:15:44 am
content: Quote from: anvoice on August 20, 2024, 08:43:48 pmDo you have a link to this online course? Thanks.PS In the meantime I'm starting over with Shawns excellent series of Tutorials that use the iCEstick devboard

author: zapta
author_rank: Super Contributor
timestamp: September 24, 2024, 05:32:30 am
content: Quote from: djsb on September 22, 2024, 11:15:44 amApio is indeed a great choice, in the spirit of platformio but for FPGAs.

author: glenenglish
author_rank: Frequent Contributor
timestamp: September 25, 2024, 12:20:45 am
content: just buy a Digilent board