Author Topic: Total beginner at FPGA  (Read 10252 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 :)

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9925
  • 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

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • 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: 6633
  • 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: 2777
  • 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.

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • 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 »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9925
  • 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.

 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • 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: 2777
  • 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 »
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • 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 »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9925
  • 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 »
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • 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 :)
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • 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 »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9925
  • 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.
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • 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: 2777
  • 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: 2777
  • 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.
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • 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: 2777
  • 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: 2777
  • Country: ca

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • 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.
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • 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? :)
 

Online asmi

  • Super Contributor
  • ***
  • Posts: 2777
  • Country: ca
Re: Total beginner at FPGA
« Reply #25 on: December 30, 2020, 02:37:32 am »
Yes,
Using FPGA which has ZERO pins that can reach even 1Gpbs?  :palm:

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.
BS. I have implemented designs going as high as 8 Gbps per differential pair using MEMS oscillator and had zero issues with dropped links. So if you can't do that - you are doing it wrong, and MEMS is 100% not a problem.

Online asmi

  • Super Contributor
  • ***
  • Posts: 2777
  • Country: ca
Re: Total beginner at FPGA
« Reply #26 on: December 30, 2020, 02:39:05 am »
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? :)
I've NEVER burned a single pin in all of my FPGA experiments and projects. So refer to my previous post - if you did, you are doing it wrong.
But then again - I don't actually have any 1000 USD boards. The most expensive one I got is Genesys 2, which is just 999 USD :P This is the board I used to reach 8 Gbps per diff pair, as Artix can only go as high as 6 Gbps. Though I have plans to make SFP+ FMC board which should allow me to reach full 10G per channel. If only I would have enough spare time for that :(
« Last Edit: December 30, 2020, 02:43:33 am by asmi »
 

Offline JohnnyMalaria

  • Super Contributor
  • ***
  • Posts: 1154
  • Country: us
    • Enlighten Scientific LLC
Re: Total beginner at FPGA
« Reply #27 on: December 30, 2020, 02:43:32 am »
https://www.bugblat.com/products/pif/index.html
Quote
a powerful FPGA (7000 LUTs)
:palm: :-DD

Why laugh? For a beginner, it's good enough. $49.

God, I hate smug buggers.
 
The following users thanked this post: james_s, radiolistener

Online asmi

  • Super Contributor
  • ***
  • Posts: 2777
  • Country: ca
Re: Total beginner at FPGA
« Reply #28 on: December 30, 2020, 02:44:41 am »
Why laugh? For a beginner, it's good enough. $49.
It's fine for beginners, but calling it "powerful" is just wrong. Call it for what it really is - low end device good enough for very simple projects.

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • Country: ua
Re: Total beginner at FPGA
« Reply #29 on: December 30, 2020, 02:49:25 am »
I have implemented designs going as high as 8 Gbps per differential pair using MEMS oscillator and had zero issues with dropped links. So if you can't do that - you are doing it wrong, and MEMS is 100% not a problem.

if your circuit has a single clock with no asynchronous lines, you can do that and it will works at some conditions with proper PCB layout. But I tried this MEMS oscillator to wire FPGA with external serial port (RX/TX line with start/stop bits) and it has transfer errors at megabit speed. This is not what beginner needs to fight with.

Such board needs good and stable oscillator for different experiments, for example serial communication or frequency meter is a nice project for a beginner.
« Last Edit: December 30, 2020, 02:52:22 am by radiolistener »
 

Online asmi

  • Super Contributor
  • ***
  • Posts: 2777
  • Country: ca
Re: Total beginner at FPGA
« Reply #30 on: December 30, 2020, 03:02:30 am »
if your circuit has a single clock with no asynchronous lines, you can do that and it will works at some conditions with proper PCB layout. But I tried this MEMS oscillator to wire FPGA with external serial port (RX/TX line with start/stop bits) and it has transfer errors at megabit speed. This is not what beginner needs to fight with.
So your problem was crappy layout, not oscillator. At 1 Mbps even really bad oscillator is going to be just fine, as even super bad ones have jitter in the order of 100's of ps. So for 1000 ns period even 1 ns jitter (which I've never seen in person even on a cheap-ass Chinese boards) will make zero difference because you are going to be sampling at 500 ns into the change.

Such board needs good and stable oscillator for different experiments, for example serial communication or frequency meter is a nice project for a beginner.
No you don't. For frequency meter that may be, but everybody's interests are different. For example, most of my FPGA projects were about realtime image and video processing, CV and stuff like that, for that kind of designs the type of oscillator makes no difference because all processing is done in digital domain. Same for serial links - proper layout is going to be much more critical than the oscillator stability. Take a look at the project in my signature - it's got a few 1.45 Gbps serial links (for HDMI 1080p), and they work with no problems using ordinary MEMS oscillator to synthesize required frequencies for the kind of bitrate that Cyclone 4 can only dream of. To be sure, MCMM block that I use inside that FPGA has a jitter filter, which helps, and it makes this debate even more pointless.

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • Country: ua
Re: Total beginner at FPGA
« Reply #31 on: December 30, 2020, 03:03:57 am »
So your problem was crappy layout, not oscillator. At 1 Mbps even really bad oscillator is going to be just fine

1 Mbps is too slow, I wanted to use at least 10-12 MBps.

« Last Edit: December 30, 2020, 03:29:44 am by radiolistener »
 

Online asmi

  • Super Contributor
  • ***
  • Posts: 2777
  • Country: ca
Re: Total beginner at FPGA
« Reply #32 on: December 30, 2020, 03:22:06 am »
1 Mbps is too slow, I wanted to use at least 10-12 MBps, but it has transfer errors even at 3 MBps.
Still. I recently designed small addon board for the board from my signature with 100 MBit ethernet PHY, so it has 25 MHz MII interface going over regular 0.1" pin header with no length matching nor controlled impedance, and that interface works at full speed with no errors.
So if you had bit errors at 3 Mbps, your sampling point was probably too close to data transition points. For 10 Mbps we're talking 100 ns periods, so you can have your sampling point at 25 ns and that will guarantee no bit errors regardless of jitter (unless you had like 25 ns of jitter which is just ridiculous, and no oscillator is going to have anything near it). Heck, I had 50 MHz SPI working over the breadboard with flying leads as connections, so the was definitely something wrong with your design. If you want to get to the bottom of this, begin a new thread and hopefully we can figure it out. But one thing is for certain - whatever the reason is, it's not related to the clock itself.

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • Country: ua
Re: Total beginner at FPGA
« Reply #33 on: December 30, 2020, 03:29:57 am »
Also the bad thing with MEMS is that when you produce 400 MHz and above with PLL, it works very unstable. If you want to use your FPGA board as a signal generator, it works very poor from MEMS oscillator. Just see the screenshot.

Such instability is unacceptable even for amateur purposes.
 

Online asmi

  • Super Contributor
  • ***
  • Posts: 2777
  • Country: ca
Re: Total beginner at FPGA
« Reply #34 on: December 30, 2020, 03:37:27 am »
Also the bad thing with MEMS is that when you produce 400 MHz and above with PLL, it works very unstable. If you want to use your FPGA board as a signal generator, it works very poor from MEMS oscillator. Just see the screenshot.
Again, the board in my signature generates bit clock of 742.5 MHz for HDMI output from input MEMS oscillator running at 100 MHz, and guess what - interface works just fine. So you are looking for a problem in the wrong place.

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • Country: ua
Re: Total beginner at FPGA
« Reply #35 on: December 30, 2020, 03:52:44 am »
Again, the board in my signature generates bit clock of 742.5 MHz for HDMI output from input MEMS oscillator

yes, it generates, you can see it on the screenshot above. But do you see how is dirty and unstable signal is when you clock FPGA from MEMS oscillator?

For comparison, here is TCXO 50MHz feeded to PLL to produce the same 400 MHz on QMTech starter kit board.

Do you see the difference between MEMS and TCXO?
« Last Edit: December 30, 2020, 03:55:52 am by radiolistener »
 

Online asmi

  • Super Contributor
  • ***
  • Posts: 2777
  • Country: ca
Re: Total beginner at FPGA
« Reply #36 on: December 30, 2020, 04:29:30 am »
Do you see the difference between MEMS and TCXO?
I don't see any difference on my monitor, which shows stable HDMI video stream with no problems, and that is the only thing that matters. Which was my point all along. If design works with MEMS, there is exactly zero reasons to bother with changing oscillators. Besides, how many FPGA devboards do you know which have TCXOs onboard? I can't think of a single one. You might want to think about the reasons for that. And before you say "cost", I urge you to take a look at something like Xilinx KC705, which cost over 1500 USD, and have interfaces going as far as 10 Gbps, yet all they have is regular MEMS oscillators.
Again, you are looking for a problem in the wrong place. Clock jitter doesn't matter in 99% of cases, as long as it's not ridiculously large. Anything lower than 1% is going to be just fine.
 
The following users thanked this post: james_s

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3892
  • Country: ua
Re: Total beginner at FPGA
« Reply #37 on: December 30, 2020, 05:06:11 am »
If design works with MEMS, there is exactly zero reasons to bother with changing oscillators.

But starter kit is not intended for a limited design. It should works good for different tasks, include frequency meter project and analog data acquisition and processing from high speed ADC/DAC ;)

Again, you are looking for a problem in the wrong place. Clock jitter doesn't matter in 99% of cases, as long as it's not ridiculously large. Anything lower than 1% is going to be just fine.

For me the clock jitter and phase noise matters very much, because I'm using it to produce DAC output. Any clock jitter leads to worse dynamic range and spectral purity of the output signal. From my point of view this is the main purpose of FPGA - fast DSP working at tens and hundred MHz speed to process ADC/DAC data and transfer it from and to PC at high speed.
« Last Edit: December 30, 2020, 05:09:46 am by radiolistener »
 

Online BrianHG

  • Super Contributor
  • ***
  • Posts: 8017
  • Country: ca
Re: Total beginner at FPGA
« Reply #38 on: December 30, 2020, 05:32:49 am »
Do you see the difference between MEMS and TCXO?
I don't see any difference on my monitor, which shows stable HDMI video stream with no problems, and that is the only thing that matters.

Warning, many HDMI screens support 'spread spectrum HDMI' meaning any crappy clock will work.  Can you say that your monitor supports spread spectrum HDMI or not?

If you were to plug your low quality source clock into an HDMI monitor which doesn't support spread spectrum HDMI, will you get jittery pixel errors?

I ran into this problem 10 years ago.  Many large screen Sharp TVs would work perfectly, but, some Sony TV had crap jitter around the pixels.  It took a month to discover all I had to do was disable spread-spectrum and the picture became perfect on the Sony TVs at the time.
« Last Edit: December 30, 2020, 05:36:29 am by BrianHG »
 

Online asmi

  • Super Contributor
  • ***
  • Posts: 2777
  • Country: ca
Re: Total beginner at FPGA
« Reply #39 on: December 30, 2020, 06:05:07 am »
Warning, many HDMI screens support 'spread spectrum HDMI' meaning any crappy clock will work.  Can you say that your monitor supports spread spectrum HDMI or not?
We're talking about <0.01 UI jitter as "bad clock". It's not really bad enough to matter.

Offline Canis Dirus Leidy

  • Regular Contributor
  • *
  • Posts: 218
  • Country: ru
Re: Total beginner at FPGA
« Reply #40 on: December 30, 2020, 04:35:59 pm »
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).
Not really, Their (QMTech's) starter kit version with XC7A100T costs just $100.
 

Offline Bud

  • Super Contributor
  • ***
  • Posts: 7062
  • Country: ca
Re: Total beginner at FPGA
« Reply #41 on: December 30, 2020, 05:04:52 pm »
Also the bad thing with MEMS is that when you produce 400 MHz and above with PLL, it works very unstable. If you want to use your FPGA board as a signal generator, it works very poor from MEMS oscillator. Just see the screenshot.

Such instability is unacceptable even for amateur purposes.
Seems an unlocked PLL to me. Poor PLL design.

Edit: Poor PLL loop filter design.
Facebook-free life and Rigol-free shack.
 

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Total beginner at FPGA
« Reply #42 on: December 30, 2020, 05:27:09 pm »
.
« Last Edit: August 19, 2022, 04:08:20 pm by emece67 »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9925
  • Country: us
Re: Total beginner at FPGA
« Reply #43 on: December 30, 2020, 06:57:58 pm »
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? :)

Which is one reason for putting 330 Ohm resistors in series with all IO pins.  It takes the worry out of short circuits and it also helps damp down reflections.

For the Nexys A7 board, Digilent is using 200 Ohm resistors and clamp diodes on the pins (Page 1, upper right corner).  I certainly wouldn't quibble about the lower value.

https://reference.digilentinc.com/_media/reference/programmable-logic/nexys-a7/nexys-a7-sch.pdf

These "student" boards are designed to help reduce mortality.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9925
  • Country: us
Re: Total beginner at FPGA
« Reply #44 on: December 30, 2020, 07:52:29 pm »
http://people.cs.georgetown.edu/~squier/Teaching/HardwareFundamentals/LC3-trunk/docs/LC3-uArch-PPappendC.pdf

Look at Figure C3 for a block diagram of the LC3 CPU.  The CPU isn't the point of this reply, the diagram is.

Notice the number of MUXes:  MARMUX, PCMUX, ADDR1MUX, ADDR2MUX, SR2MUX, INMUX and that MUX with the MIOEN control signal.  You would think that being able to code MUXen is an important task - and it is!  There's a straight out adder and an ALU - coding those would be the next topic.  The adder is trivial and the ALU is pretty simple.  We also have a register file with is actually two files (arrays) in parallel.  When we load a register, we write both copies but we can read them out separately so we can do R3 = R1 + R2 in one cycle.  We just read R1 from one copy and R2 from the other copy and present them to the ALU (and the SR2MUX).

These are the kinds of things you need to learn how to code.  All digital systems are built from these basic blocks and the complexity of a system is just a count of the number of blocks.

On page 2 there is a transition diagram.  You use that to create the Finite State Machine that makes the CPU work.  Every numbered state is duplicated exactly in some HDL and, in my case, I used an integer for the state type so I could match the state numbers on the diagram.  It takes a little time and thought to realize that every control signal is generated in that state machine.  Once you think about it, it's both obvious and brilliant!

Find a tutorial that teaches you how to code an FSM.  I prefer the two process approach, the one process and three process approaches will also work.  You have no idea what I'm going on about but don't worry!  It will be covered in great detail when you start on the tutorials.  Hint:  Don't forget to provide default values for all outputs of the two and three process models.  Again, this will be discussed in the tutorial (if it is worthwhile).

There's nothing on that page that resembles C++ although I could create a class for every block type and write some sequential code that would do in software what this CPU does in hardware.  It might even be an interesting experiment.  Hint:  It's been done before...  My PDP11/70s are software emulations running on a Raspberry Pi and they are faster than the real hardware.  No, I didn't write the code.

https://obsolescence.wixsite.com/obsolescence/pidp-11

Bottom line:  Find tutorials that will teach you how to code the basic blocks.  We just keep using the same blocks, over and over.  Different signals, different widths but, fundamentally, the same blocks.

Here are a couple of example MUXen:

Code: [Select]
    --PC Mux Control
    process(PCplusOne, PCadderOutput, mBus, PCSelect)
    begin
        case PCSelect is
            when PCplus1        => PCmuxOutput <= PCplusOne;
            when PCadder        => PCmuxOutput <= PCadderOutput;
            when PCmBus         => PCmuxOutput <= mBus;
            when others         => PCmuxOutput <= (others => '0');
        end case;
    end process;
   
    -- MAR Mux Control
    process(PCadderOutput, Zext, MARSelect)
    begin
        case MARSelect is
            when MARadder       => MARmuxOutput <= PCadderOutput;
            when MARzext        => MARmuxOutput <= Zext;
            when others         => MARmuxOutput <= (others => '0');
        end case;
    end process;

See how straightforward this stuff is?  It's the same code, over and over!
« Last Edit: December 30, 2020, 08:08:28 pm by rstofer »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9925
  • Country: us
Re: Total beginner at FPGA
« Reply #45 on: December 30, 2020, 08:22:19 pm »
In terms of VHDL, this book is pretty good and it's FREE!

http://freerangefactory.org/pdf/df344hdh4h8kjfh3500ft2/free_range_vhdl.pdf

The FSM discussion on page 93 is worth studying.  Remember when I said to provide default values to all outputs in a two process FSM?  Well, Z1 <= '0' (line 3 of comb_proc) is that default value and you have to provide defaults for every output of the FSM.  It's easy to forget and, more likely than not, nothing works!  There's a reason I know this and keep mentioning it.  If the synthesizer says you have inferred latches, that's where they are - outputs which aren't defined in every state and have no default value.  Every time you expand the capability of the FSM, you are probably creating a new output and you need to provide a default value.

See bullet item on page 95

An example of default values from my LC3 project:
Code: [Select]
       -- set default values for all signals
        GateBusSelect   <= GatePC;
        MIOenable       <= '0';
        LD_MAR          <= '0';
        LD_MDR          <= '0';
        LD_IR           <= '0';
        LD_BEN          <= '0';
        LD_PC           <= '0';
        LD_Reg          <= '0';
        LD_CC           <= '0';
        LD_Privilege    <= '0';
        LD_Priority     <= '0';
        LD_PSR          <= '0';
        LD_SavedUSP     <= '0';
        LD_SavedSSP     <= '0';
        LD_VectorAddr   <= '0';
        PCselect        <= PCplus1;
        MARSelect       <= MARzext;
        Addr1Select     <= Addr1PC;
        Addr2Select     <= Addr2Zero;
        SR2select       <= SR2OutSel;
        SR1addrSelect   <= SR1usesSR1;
        ALUop           <= ALUpassA;
        DRaddrSelect    <= DRusesDR;
        MemWr           <= '0';
        SPselect        <= SPminusOnesel;
        VectorMux       <= "00";
        Privilege       <= '0';
« Last Edit: December 30, 2020, 08:27:02 pm by rstofer »
 

Online asmi

  • Super Contributor
  • ***
  • Posts: 2777
  • Country: ca
Re: Total beginner at FPGA
« Reply #46 on: December 30, 2020, 08:46:46 pm »
I think nandland has the best tutorial series for total beginners. In my opinion his board is worth buying to support the author and so that you can follow tutorials and experiment with them. And they are bilingual, having sections for both Verilog and VHDL, so you can get a glimpse at both.

Online asmi

  • Super Contributor
  • ***
  • Posts: 2777
  • Country: ca
Re: Total beginner at FPGA
« Reply #47 on: December 30, 2020, 09:37:23 pm »
Not really, Their (QMTech's) starter kit version with XC7A100T costs just $100.
This is a typical Chinese crap board designed by a mindless drone who obviously had no idea what he was doing :palm: Because if he had even a single working brain cell, he would never placed a 3 Amps DC-DC converter for a device which can draw up to 7 Amps of current, not to mention there having zero provisions for any type of thermal control despite the fact that this FPGA can dissipate up to 10 W of power, and there is no way it won't overheat without some sort of cooling.
And this is exactly why I always recommend beginners to avoid these garbage boards in favor of name brands at least until they have enough experience and knowledge to know all of the above so they can judge by themselves if board is designed properly and will actually do what they think it can do.

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9925
  • Country: us
Re: Total beginner at FPGA
« Reply #48 on: December 31, 2020, 01:51:06 am »
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).
Not really, Their (QMTech's) starter kit version with XC7A100T costs just $100.
But where is the 8 digit 7-segment display to hold the Accumulator and Program Counter displays?
How about the 16 switches for Console Entry Switches?
Or the 16 LEDs for status information?
Or even the push buttons for Run, Halt and Single Step?

I realize that not everybody needs those features and I also realize the Digilent board is expensive, but I do need the features and I don't care about the extra cost.  Rigging up something off the board is certainly possible.  I have used one of the Maxim display chips to create 16 7-segment digits over an SPI bus and it worked very well.  I also used a port expander to collect up 16 console entry switches over SPI.  I would prefer to have the gadgets on the board rather than laying on the bench.  Or worse, group mounted on a plywood backboard.  Actually, that worked out rather well.  Considering...

Another use for the console switches:  Implement breakpoints based on the PC.  This is sometimes useful when bringing up an OS.  Once the CPU has hit the breakpoint, resort to single stepping.  The status LEDs will be helpful!

« Last Edit: December 31, 2020, 02:08:16 am by rstofer »
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15168
  • Country: fr
Re: Total beginner at FPGA
« Reply #49 on: December 31, 2020, 05:52:40 pm »
QMTECH boards are OK if you know what you're doing, but I agree they are not that well adapted to beginners.

As to their design itself - from what I've seen (I can only talk about the ones with Xilinx FPGAs), they are OK for the lower end parts (Spartan 6 up to LX25, Artix 7 up to 35T I'd say), but beyond that, nope. The reason is that, as said above, power supplies are not properly sized, there is not heat management, and there is overall poor decoupling.

So yes, the board with an Artix 7-100T is basically designed just like the ones with lower end parts, and you won't be able to do anything serious with it in a reliable way, unless maybe you're designing very low frequency stuff.
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2812
  • Country: nz
Re: Total beginner at FPGA
« Reply #50 on: December 31, 2020, 09:07:58 pm »
It is like saying 'I want to take up cycling as a sport'.

You can pop down your local big-box store and buy a $100 bike and aseemble it. It will have two wheels and a handlebar just like any other bike. You will be able to ride down to the local store on it, on nice paved roads.

But if you really want to have a bike which will take you places, down tracks and trails you don't even know about yet, and will not break down and leave you stranded then move to a good known brand for a specialist retailer.

How many hours do you want to be stranded, figuring things out complex issues on your own, because of lack of documentation and as nobody (not even Google) can offer you meaningful advice?

A nice FPGA board is a pleasure to work with, and allows you to focus on your learning and experimenting, not trying to get the blasted thing just to accept a bit stream, clock properly, or work out that your LEDs are active low.

I recommend you find the resources you want to use to learn (PDFs, courses, YouTube subs) then get the board they use.

Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Total beginner at FPGA
« Reply #51 on: January 10, 2021, 12:50:31 am »
Why laugh? For a beginner, it's good enough. $49.
It's fine for beginners, but calling it "powerful" is just wrong. Call it for what it really is - low end device good enough for very simple projects.

The smallest 10 year old FPGAs on the market are "powerful" relative to the small microcontrollers most hobbyists are used to working with. A single IC that I can fit an entire 8 bit computer with VGA video output inside it is "powerful" in my book. It may not be spectacular compared to the state of the art but even small FPGAs can be very capable.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Total beginner at FPGA
« Reply #52 on: January 10, 2021, 12:52:24 am »
If design works with MEMS, there is exactly zero reasons to bother with changing oscillators.

But starter kit is not intended for a limited design. It should works good for different tasks, include frequency meter project and analog data acquisition and processing from high speed ADC/DAC ;)

If you want to make a frequency counter then connect an external high stability timebase, OCXO or GPSDO. I have never once found it necessary to replace the onboard oscillator on any of my FPGA boards, I just haven't built anything where it matters.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Total beginner at FPGA
« Reply #53 on: January 10, 2021, 12:57:33 am »
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).
Not really, Their (QMTech's) starter kit version with XC7A100T costs just $100.
But where is the 8 digit 7-segment display to hold the Accumulator and Program Counter displays?
How about the 16 switches for Console Entry Switches?
Or the 16 LEDs for status information?
Or even the push buttons for Run, Halt and Single Step?

I realize that not everybody needs those features and I also realize the Digilent board is expensive, but I do need the features and I don't care about the extra cost.  Rigging up something off the board is certainly possible.  I have used one of the Maxim display chips to create 16 7-segment digits over an SPI bus and it worked very well.  I also used a port expander to collect up 16 console entry switches over SPI.  I would prefer to have the gadgets on the board rather than laying on the bench.  Or worse, group mounted on a plywood backboard.  Actually, that worked out rather well.  Considering...

Another use for the console switches:  Implement breakpoints based on the PC.  This is sometimes useful when bringing up an OS.  Once the CPU has hit the breakpoint, resort to single stepping.  The status LEDs will be helpful!

Connect them externally if you need them. I have a handful of "drivers" in the form of HDL files I can instantiate into larger designs that drive various serially interfaced displays and input devices. A PS/2 keyboard and 8 (or however many) digit LED display can be connected with 4 or 5 pins and a handful of logic fabric.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf