Author Topic: Total beginner at FPGA  (Read 10272 times)

0 Members and 1 Guest are viewing this topic.

Offline mehulkasi85Topic starter

  • Newbie
  • Posts: 1
  • Country: us
Total beginner at FPGA
« on: December 26, 2020, 04:16:28 pm »
Hello everybody

I'm an electrical engineering student who found a huge interest in embedded systems. First, I learned arduino, no big deal, then I learned STM32 MCU, which was challenging, but then I found out about FPGA and read about them, and that caught my interest, so I borrowed a DE0-Nano SoC from a friend of mine to learn VHDL and Verilog and how to use FPGA, the problem is I have no experience with programmable hardware at all, I know nothing about VHDL/Verilog or how to use an FPGA, and I used google to look for some resources but I didn't find much or maybe didn't understand much.

So, my problem is, I wanna learn FPGA but I am a complete beginner at that and I just want some books or resources to learn them.

Thanks in advance for the help :)

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9929
  • Country: us
Re: Total beginner at FPGA
« Reply #1 on: December 26, 2020, 04:33:37 pm »
Here's a place to start:

https://www.nandland.com/

Here's a place to go with VHDL

https://vhdlwhiz.com/

I'm sure there is a Verilog site of equal quality but I haven't gone looking for it.
 
The following users thanked this post: S. Petrukhin

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3918
  • Country: ua
Re: Total beginner at FPGA
« Reply #2 on: December 29, 2020, 04:10:46 pm »
I wanna learn FPGA but I am a complete beginner at that and I just want some books or resources to learn them.

just buy some cheap Chinese FPGA dev board, they are come with examples and step-by-step instructions. You can open LED flash example, compile it and upload into  FPGA. After that you can start to learn verilog and make experiments.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6637
  • Country: ro
Re: Total beginner at FPGA
« Reply #3 on: December 29, 2020, 04:33:11 pm »
Since you mentioned microcontrollers and embedded programming first, then the FPGA and hardware description languages, keep in mind that they are unrelated.

Verilog and VHDL is just a text to describe a schematic diagram.  DO NOT THINK ABOUT THEM AS "PROGRAMING".  They do not describe a program, they describe a schematic.  Again, FPGAs are unrelated with software, it's hardware.

If you keep that in mind, you'll love digital design.   :-+

This is an easy and clean intro to the FPGA world, see if you like it (you'll need to know digital circuits first):
https://www.fpga4fun.com/FPGAinfo1.html
« Last Edit: December 29, 2020, 04:36:09 pm by RoGeorge »
 

Online asmi

  • Super Contributor
  • ***
  • Posts: 2778
  • Country: ca
Re: Total beginner at FPGA
« Reply #4 on: December 29, 2020, 04:37:40 pm »
just buy some cheap Chinese FPGA dev board, they are come with examples and step-by-step instructions. You can open LED flash example, compile it and upload into  FPGA. After that you can start to learn verilog and make experiments.
I disagree. These kind of boards typically very poorly supported, and it's the beginners who need that support the most - as people with some experience under their belts only really need a schematic and datasheets for all peripherals which are on a board. So I would recommend some of the better supported boards like the ones from Digilent, which has support forums for their boards, with their staff usually being quite responsive and helpful.

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3918
  • Country: ua
Re: Total beginner at FPGA
« Reply #5 on: December 29, 2020, 07:31:18 pm »
I disagree. These kind of boards typically very poorly supported, and it's the beginners who need that support the most - as people with some experience under their belts only really need a schematic and datasheets for all peripherals which are on a board. So I would recommend some of the better supported boards like the ones from Digilent, which has support forums for their boards, with their staff usually being quite responsive and helpful.

I started with cheapest Chinese Cyclone IV board which consists of just FPGA, some LED's and one button. Such board is really not convenient in use, because you're needs to attach all peripherals manually. But then I bought QMTech board which consists of 3 digit 7 segment LED, usb2serial, Ethernet GMII and SDRAM on the board. And I think it is good enough for the novice...

Here it is: https://www.aliexpress.com/item/33007471265.html

It has some issues:
- there is just one clock pin, and it used for onboard TCXO, which unfortunately too small to replace.
- GMII clock pins routed to the regular pin instead of CLK, so you cannot use GMII clock as a PLL source, but it still usable
- usb2serial max speed is too small (it uses CP2102 and only RX and TX pins are available)

But it still good enough for the start. And has interesting price.
« Last Edit: December 29, 2020, 07:39:22 pm by radiolistener »
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9929
  • Country: us
Re: Total beginner at FPGA
« Reply #6 on: December 29, 2020, 11:05:25 pm »
I want a board with 'everything' and lots of it.  I realize it is pricey but I don't care.

https://store.digilentinc.com/nexys-a7-fpga-trainer-board-recommended-for-ece-curriculum/

It is quite convenient to single pulse the clock and display debug information on the LEDs or 7-segment displays.  I can even use the decimal points in the 7-segment display for additional status information.

I have and use lesser boards like the Arty 7 and the Lattice IceStick but if I am starting a new project then I will pick the Nexys A7 unless there is a compelling reason to use one of the lesser boards.

 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3918
  • Country: ua
Re: Total beginner at FPGA
« Reply #7 on: December 29, 2020, 11:24:53 pm »
I want a board with 'everything' and lots of it.  I realize it is pricey but I don't care.

https://store.digilentinc.com/nexys-a7-fpga-trainer-board-recommended-for-ece-curriculum/

It is worse than QMTech Cyclone 4 starter kit for 24 USD that I posted above.
Because it has 100 MBit Ethernet. It's too slow for FPGA experiments.
And the price is 10 times higher.

QMTech Cyclone 4 has less digits for 7-LED display, but it has 1000 MBit Ethernet and it allows you to make much more interesting experiments than a simple LED blinking. :)

Almost all things are present on QMTech Cyclone 4 starter kit:
- usb2serial
- VGA
- SDRAM
- gigabit Ethernet PHY
- one user button
- 3 digit 7-LED display
- two PMOD connectors
- one 40-pin connector with user IO pins

And you can buy almost 10 starter kit boards for the same price as nexys-a7
« Last Edit: December 29, 2020, 11:29:56 pm by radiolistener »
 

Online asmi

  • Super Contributor
  • ***
  • Posts: 2778
  • Country: ca
Re: Total beginner at FPGA
« Reply #8 on: December 29, 2020, 11:36:53 pm »
It is worse than QMTech Cyclone 4 starter kit for 24 USD that I posted above.
Because it has 100 MBit Ethernet. It's too slow for FPGA experiments.
And the price is 10 times higher.
And you can buy almost 10 starter kit boards for the same price as nexys-a7
You forgot that QMTech board has far more inferior FPGA onboard, which kind of makes everything else irrelevant :-DD
Oh, and exactly how many of your designs saturated 100 Mbit Ethernet network, so that 1G PHY actually made the difference? And how much resources did implementing 1G MAC took? 50% of the FPGA? :-DD
« Last Edit: December 29, 2020, 11:43:20 pm by asmi »
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3918
  • Country: ua
Re: Total beginner at FPGA
« Reply #9 on: December 30, 2020, 12:31:40 am »
You forgot that QMTech board has far more inferior FPGA onboard, which kind of makes everything else irrelevant :-DD

Cyclone EP4CE15 has 15 kLE, 504 kB memory and 112x9 bit multipliers and 4 PLL, this is good enough for starter kit. :)

Oh, and exactly how many of your designs saturated 100 Mbit Ethernet network, so that 1G PHY actually made the difference?

I'm using FPGA for DSP and 100 MBit is not enough to feed my PC with high speed realtime data stream from FPGA. Onboard GMII ethernet module is the reason why I bought that QMTech board. I would like to see 10G PHY, but it cost a lot of money. Currently my design utilize up to 900 MBit network bandwidth. I want more, but 900 MBit is good result, especially when you look at the price ;)
« Last Edit: December 30, 2020, 12:39:33 am by radiolistener »
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9929
  • Country: us
Re: Total beginner at FPGA
« Reply #10 on: December 30, 2020, 12:32:06 am »
And you can buy almost 10 starter kit boards for the same price as nexys-a7

And I would have to buy 10 starter kits to come anywhere close to an Artix 7 100T variant in terms of LUTs and BlockRAM (my two important characteristics).


Altera LUTs =  15,408
Xilinx LUTS = 102,400

Altera BlockRAM =   504 Kbits
Xilinx BlockRAM = 3,240 Kbits


I don't plan to use the Ethernet capability but HamsterNZ did a nice job creating a project to test throughput.  I have forgotten which board we were looking at.

It has been suggested that the 100T variant is overkill.  That's probably true but, again, I don't care.  I never have to worry about my little projects fitting in the device.  And I tend to use a LOT of BlockRAM...

How come the QMTech board has a 50 MHz clock input?  I hope that's not some kind of flag.  At least the Digilent board has a 100 MHz clock so I don't have to play with the PLLs to get a decent clock speed.
« Last Edit: December 30, 2020, 12:39:35 am by rstofer »
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3918
  • Country: ua
Re: Total beginner at FPGA
« Reply #11 on: December 30, 2020, 12:39:45 am »
And how much resources did implementing 1G MAC took? 50% of the FPGA? :-DD

Full 1G MAC implementation + UDP stack + ARP/DHCP + ICMP ping consume about 36% LE and 44% memory :)
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3918
  • Country: ua
Re: Total beginner at FPGA
« Reply #12 on: December 30, 2020, 12:49:47 am »
It has been suggested that the 100T variant is overkill.  That's probably true but, again, I don't care.

100M MII PHY is not enough for almost any design which is really needs FPGA for implementation.
GMII or USB3 is must have to have high speed transfer.

How come the QMTech board has a 50 MHz clock input?

??? It doesn't matter what is the frequency, TCXO anyway will be used to feed the PLL, so technicaly there is no difference between 50M and 100M TCXO. They have the same jitter/stability performance. And you're get exactly the same frequency set for both 50M and 100M source. Just no difference.  :-//

I tested onboard 50M TCXO performance. It's not the best, but good enough for the starter kit.
Tested it to produce up to 1 GHz clock on PLL, works ok.

And I tend to use a LOT of BlockRAM...

yes, EP4CE15 has just 504 kBit memory. This is not too much.
But there is onboard 32 MB SDRAM on QMTech starter kit :)
« Last Edit: December 30, 2020, 01:03:46 am by radiolistener »
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9929
  • Country: us
Re: Total beginner at FPGA
« Reply #13 on: December 30, 2020, 01:03:10 am »
I pointed out earlier NandLand.com and their $65 "Go Board".  I don't care about the board except that it is used for all of the tutorials.  It's worth the cost just to keep track with the tutorials.  Think of it as tuition.

For the tutorials at VHDLwhiz.com, the Lattice IceStick is the preferred device

https://www.digikey.com/en/products/detail/lattice-semiconductor-corporation/ICE40HX1K-STICK-EVN/4289604

I don't prefer the Lattice board and I'm not going to write home about their tools but it all works out and the tutorials (especially the two 'for pay' tutorials) are very good.

I probably have 8 or 10 development boards going back to the Spartan 2.  They have all been educational in one way or another and education, as we well know, is never free.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3918
  • Country: ua
Re: Total beginner at FPGA
« Reply #14 on: December 30, 2020, 01:09:03 am »
For the tutorials at VHDLwhiz.com, the Lattice IceStick is the preferred device

It has too small user IO.

For example, I'm using full JP1 slot for 15 data lines and 1 clock line from ADC module. If I decide to attach ADC and DAC module simultaneously, I can use 40-pin user IO connector.

I see just one PMOD connector on IceStick. This is not enough even to connect ADC module...

Also, I see that IceStick using MEMS oscillator as a clock source. This is bullshit.

I have similar stick CYC1000:
https://shop.trenz-electronic.de/en/Products/Trenz-Electronic/CYC1000-Intel-Cyclone-10/

its very small and good quality, but it also using MEMS oscillator.

I recommend to replace it with normal TCXO.
Because MEMS oscillators are very unstable and it's frequency floating like piece of ice in the water.
« Last Edit: December 30, 2020, 01:16:21 am by radiolistener »
 

Online asmi

  • Super Contributor
  • ***
  • Posts: 2778
  • Country: ca
Re: Total beginner at FPGA
« Reply #15 on: December 30, 2020, 01:34:36 am »
I recommend to replace it with normal TCXO.
Because MEMS oscillators are very unstable and it's frequency floating like piece of ice in the water.
I recommend to ignore this recommendation, because it's pointless outside of very few very specific use cases. Heck, even PCI Express 5.0 works just fine using MEMS oscillator.
 
The following users thanked this post: samofab

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Total beginner at FPGA
« Reply #16 on: December 30, 2020, 01:37:17 am »
Forget everything you know about programming because it's not going to help you with FPGAs, it will make things harder if you approach HDL like you are writing a program. It isn't a program, it doesn't execute, the instructions are not sequential commands. It is a language that describes the behavior of a digital circuit, it's more like describing a schematic in words than a list of instructions with flow control like the programming you're used to. Superficially it resembles a program but that is about where the similarity ends.

As far as learning, there are many resources out there. I found the free book "Free Range VHDL" to be very helpful. I also learned a great deal from Grant Searle's "Multicomp" project which is open source and freely available. There are several decent courses on Udemy if you learn well from video lectures.

Don't worry too much about the hardware, you don't even need hardware to get started, although it does make it more fun. I've acquired a lot of different FPGA boards over the years but still the ones I use most are also the cheapest I've ever found, the EP2C5T144C8 mini boards that you can get for about 13 bucks from China. They're small and cheap enough to just integrate into finished projects if you want. My next favorite is my DE2, it's also a rather old Cyclone II but it's quite a large one and the board has loads of LEDs and switches. The big complex boards can be a pain for simple projects though because you have hundreds of pins you have to assign and make sure all of the unused pins are in safe states that are not driving something high that is being held low by something else for example.
 

Online asmi

  • Super Contributor
  • ***
  • Posts: 2778
  • Country: ca
Re: Total beginner at FPGA
« Reply #17 on: December 30, 2020, 01:40:30 am »
100M MII PHY is not enough for almost any design which is really needs FPGA for implementation.
That is a very bold claim that could use some substantiation. So far most of my designs didn't need any Ethernet at all...

??? It doesn't matter what is the frequency, TCXO anyway will be used to feed the PLL, so technicaly there is no difference between 50M and 100M TCXO. They have the same jitter/stability performance. And you're get exactly the same frequency set for both 50M and 100M source. Just no difference.  :-//

I tested onboard 50M TCXO performance. It's not the best, but good enough for the starter kit.
As I said above, TCXO is overkill for just about any designs aside from those where frequency stability is critical (like frequency counters). For all other designs it's pointless.

But there is onboard 32 MB SDRAM on QMTech starter kit :)
With bandwidth of a snail - sure, otherwise it's as good as non-existent. That Digilent board has 128 Mbytes of much faster DDR2, and even that is kind of low, as their other boards have higher capacity DDR3 devices.

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Total beginner at FPGA
« Reply #18 on: December 30, 2020, 01:43:31 am »
How come the QMTech board has a 50 MHz clock input?  I hope that's not some kind of flag.  At least the Digilent board has a 100 MHz clock so I don't have to play with the PLLs to get a decent clock speed.

Why on earth would you avoid PLLs? It's trivial, Xilinx and Altera both have wizards that do all of the setup for you, you enter the input frequency and the frequencie(s) you want and it spits out a PLL that you instantiate into your design. I use a PLL in every one of my projects aside from the most trivial quick experiments, it's one of the first things I set up after defining the inputs and outputs. The input clock speed is irrelevant with the modern parts, the PLLs are very versatile. In the old Cyclone II's I use often they are not nearly as flexible but even so 50MHz is a good starting point. It's common because it works fine even on a relatively simple PCB layout.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3918
  • Country: ua
Re: Total beginner at FPGA
« Reply #19 on: December 30, 2020, 02:09:12 am »
I recommend to replace it with normal TCXO.
Because MEMS oscillators are very unstable and it's frequency floating like piece of ice in the water.
I recommend to ignore this recommendation, because it's pointless outside of very few very specific use cases. Heck, even PCI Express 5.0 works just fine using MEMS oscillator.

This is MEMS 12 MHz and result of feeding it to PLL to produce 100 MHz. At the center I put my hand near the board. All other is self instability. If you accept so high instability and high phase noise, you can use it.

But this is unacceptable if you want to clock high speed serial. Also it's unacceptable if you want to produce high frequency on PLL and capture data on high speed ADC from such clock.

MEMS oscillator is a crap...  :horse:
« Last Edit: December 30, 2020, 02:14:02 am by radiolistener »
 

Online asmi

  • Super Contributor
  • ***
  • Posts: 2778
  • Country: ca
Re: Total beginner at FPGA
« Reply #20 on: December 30, 2020, 02:19:49 am »
But this is unacceptable if you want to clock high speed serial.
It makes zero difference for most high speed serial interfaces because most of them are designed to tolerate quite a bit of clock variation. For things like PCI Express it's irrelevant at all, because both sides use the same reference clock, so even if in wanders, it does so on both sides at the same time. You can try it yourself - get rid of TCXO, and I guarantee you that your serial links will work just fine. For ADC it might be different, but not for serial links. Speaking of which - what kind of "high-speed serial interface" you are talking about with ancient Cyclone 4? :palm: It can't even get to 1 Gbps bandwidth per pin.
Besides, do you still remember that you are in the thread named "Total beginner at FPGA". So do you really expect a total beginner to mess with multi-gigabit links?

Offline JohnnyMalaria

  • Super Contributor
  • ***
  • Posts: 1154
  • Country: us
    • Enlighten Scientific LLC
Re: Total beginner at FPGA
« Reply #21 on: December 30, 2020, 02:20:37 am »
Hello everybody

I'm an electrical engineering student who found a huge interest in embedded systems. First, I learned arduino, no big deal, then I learned STM32 MCU, which was challenging, but then I found out about FPGA and read about them, and that caught my interest, so I borrowed a DE0-Nano SoC from a friend of mine to learn VHDL and Verilog and how to use FPGA, the problem is I have no experience with programmable hardware at all, I know nothing about VHDL/Verilog or how to use an FPGA, and I used google to look for some resources but I didn't find much or maybe didn't understand much.

So, my problem is, I wanna learn FPGA but I am a complete beginner at that and I just want some books or resources to learn them.

Thanks in advance for the help :)

I'm just starting out as well. My goal is to use a FPGA with a Raspberry Pi, so I bought one of these:

https://www.bugblat.com/products/pif/index.html

A snippet of the blurb:

Quote
Key features
a complete FPGA development target - FPGA programming hardware is not needed
plenty of on-chip 4-input LUTs. The PIF_Z has 1280, the PIF_2 has 6864
plenty of on-chip 9-Kbit SRAM blocks. The PIF_Z has 8, the PIF_2 has 26
the FPGA is non-volatile, with on-chip flash memory for storing the configuration bit stream
up to 256Kbits user flash memory
hard coded I2C, SPI, PLL, and timer/counter blocks
powered from the Raspberry Pi expansion connector (P1)
plenty of expansion connectors. Both boards have a 40-pin (2x20-pin) connector which matches the Raspberry Pi's P1 connector. In addition the PIF_2 has one 3x13-pin connector and one 2x8-pin connector; the PIF_Z has two 2x8-pin connectors
support software supplied (in Python) for injecting a new configuration into the FPGA
example projects supplied, including a project that controls logic inside the FPGA from a web browser
And Flashing Lights!!

both boards have red and green LEDs
as befits a more playful board, the PIF_Z mounts two RGB smart LEDs. Example firmware shows how to control these devices
 

Online asmi

  • Super Contributor
  • ***
  • Posts: 2778
  • Country: ca

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3918
  • Country: ua
Re: Total beginner at FPGA
« Reply #23 on: December 30, 2020, 02:29:34 am »
Besides, do you still remember that you are in the thread named "Total beginner at FPGA". So do you really expect a total beginner to mess with multi-gigabit links?

Yes, and this is why I recommend to not use boards with MEMS oscillator. You can catch instability and other issues with it and it's not obvious what is the root of cause, it's hard realize that the floating bug happens due to a poor clock from MEMS oscillator.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3918
  • Country: ua
Re: Total beginner at FPGA
« Reply #24 on: December 30, 2020, 02:34:32 am »
Quote
a powerful FPGA (7000 LUTs)
:palm: :-DD

do you think that the powerful and very expensive FPGA with a lot of resources is really what beginner needs for experiments? It's easy to burn some pin on FPGA. If you use cheap Chinese starter kit board, you can just buy a new one. Because it's not expensive.

But what happens if you bought 1000 USD FPGA board and burned it due to a wrong connection? :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf