Go Down

Topic: Beginners guide to FPGAs (Read 4657 times) previous topic - next topic

DesignFoundry

Apr 28, 2015, 01:40 pm Last Edit: May 20, 2015, 09:48 pm by DesignFoundry
Hi,

Following on from the positive response to my previous blog post about adding an FPGA to your Arduino projects I received a request to write an beginners guide to FPGAs which I have now posted. You can read this new article and my previous posts at Beginners Guide . I hope you enjoy it and find it useful and I look forward to reading your feedback and comments.

LMI1

A problem with FPGA's is that you have to program them. For that you need somekind of an IDE. And a programming language which is not C. IDE is often free, but a programming dongle may cost something, or you have to buy a demo board.

Playing with a FPGA is fun, of course. Like building a NAND gate or something. But I thing that getting something really usefull and making it work is much more difficult. Like learning VHDL or Verilog. Or studying some messy Open core design.

I am not an expert in this, so if I am wrong, I am happy to hear it.

68tjs

Quote
A problem with FPGA's is that you have to program them
Like a micro-controler.
Quote
For that you need somekind of an IDE
It is a true IDE with editor, compilator, schematic editor, simulator
Quote
but a programming dongle may cost something
You can find at less than 10 €.
Quote
you have to buy a demo board.
Arduino boards are demo boards. On Ebay you can found demo-board around 15/20 €
Quote
I am not an expert in this, so if I am wrong, I am happy to hear it.
It will be no correct to say you are wrong, but you are not totaly right :smiley-mr-green: .

Programming an FPGA is very nice.
The language is close to the syntax of C, but it is not a programming language but description language.  
You have to think in terms of hardware so a minimum knowledge of digital electronics is desirable although the possibility of using ready to use libraries exist.

FPGA / CPLD is actually  multitasking.
Change output  level with an avr take  7-8 clock cycles with direct register manipulation (8 more time with arduino function), change 10 output take 10 more times as operations are done in series.
Change  output level with a FPGA or CPLD take ONE clock cycle whichever the number of outputs. The level of all outputs changes in the same clock cycle.

You can find open core to produce a micro-controller with a FPGA :smiley-mr-green: .

FPGA and CPLD need an external true oscillator not a simple cristal. The program must be loaded in EEPROM. With CPLD EEPROM is internal, with FPGA you must add EEPROM in external package.
The mixed Digital / Analog  FPGA (op amp) are rare and expensive.
Les Shadocks : L'ignorance ne s'apprend pas.

LMI1

Not much to add.

Lattice's own dongle is expensive, I think 50£$€ or so, Ebay and such, have clones with less price.

The Open cores I looked at, were messy, I would not like to adopt them in my own design.

There was/are? many kinds of FPGA IDEs. Lattice's is very large or has more functions than MS Visual Studio, and much larger than Arduino IDE.

68tjs

IDE for FPGA/CPLD can not be compare with Eclipse or Visual Studio
The FPGA/CPLD IDE have to do :
-edition
-compilation
-stimulation
AND proprietary operation  inside the IC which requires knowledge within the IC.

It is only the IC manufacturer that can do it.
IDEs for Lattice, Xilinx, Alterra  are all differents.

For Altera you can found :
up-to-date IDE for free. Limited version but perfectly usable. It lacks IC that are no longer manufactured. But all old versions are still avalaible to download.
On Ebay
- Cyclone IV for 15/30 €, be careful big price difference for the same product,
- Altera programming dongle less than 10 €.

I am not a specialist but generaly we can read :
best IC = Xilink
best IDE = Altera
most easy language to learn : verilog
most powerfull language, a bit more difficult, : VHDL
Les Shadocks : L'ignorance ne s'apprend pas.

DesignFoundry

The FPGA vendor's IDEs can appear very intimidating - particularly if your experience is in software development with Eclipse of Visual Studio. However you can normally leave a lot of the interfaces with their default values to push your initial designs through the tool chain to create your programming file. (I'm currently writing a new post based on programming an FPGA shield using an Arduino which does not require any vendors expensive dongle so I will let you know when that is posted.)

Learning a new language is always a bit of a challenge and when comparing verilog and VHDL there is an old saying that with verilog you will spend most of your time in the simulator and with VHDL you will spend most of your time in the editor! Verilog is not strongly type checked so you can get some rather unexpected consequences from your code while VHDL is strongly type checked (and was originally based upon ADA) so can be a real pain to get to compile in the first instance.

Both are equally powerful with verilog tending to be more popular in the US while VHDL was more popular in Europe - Altera like  to produce a lot of their IP in verilog too.

pito

#6
May 14, 2015, 11:41 pm Last Edit: May 14, 2015, 11:52 pm by pito
It is not about verilog or vhdl, or altera or xilinx - those are just tools.

It is about understanding digital electronics.

That understanding is very rare today, even among professionals.

So before you start with tools, you have to show to the beginners what it is good for.

I tried in past (see my xilinx cpld topic - a 32bit counter/freq meter) with minor response - http://forum.arduino.cc/index.php?topic=120220.0

I can hardly imagine somebody starts to mess with xilinx or altera ide without having a strong motivator. Yes, the idea you can create your own CPU this evening is nice, but a long way to go for vast majority of people here.


DesignFoundry

#7
May 15, 2015, 01:47 pm Last Edit: May 15, 2015, 02:56 pm by DesignFoundry
Hi Pito,

I'm not so sure that an understanding of digital electronics is rare but you're right to point out that there needs  to be a strong motivator to spend time learning about a new subject. I think a lot of people are interested in FPGAs within the maker community because of their strength in being able to re-purpose the same hardware.

I think this is well demonstrated by the success of the Arduino family of development boards.

If a subject is interesting then people will spend time and effort learning about it and while a CPU is beyond most people a simple state-machine isn't. If you think of all the projects that people have created with Arduino and a bit of time and effort I personally think the same can apply to FPGAs.

After all it is almost as simple to get an LED flashing with an FPGA written in HDL as it is to get to the 'Blink' sketch running on the Arduino for the first time!

68tjs

I agree with Pito: a good knowledge of electronics  is required.
BTW I wrote:
Quote
You have to think in terms of hardware.
FPGA / CPLD are more affordable for an electronician than for a programmer.
The hardest part is not to find the schematic.
You must be able to know when you have to work in asynchronous or synchronous logic logic.
You must  understand the significance and consequences of  rise or fall time and propagation delay, and how to manage it.
Bad layout reduce  max operating frequency. For huge project this requires being able to choose the location in the chip. This is possible only with experience.

For small project there are margins so you can let the IDE do the work :smiley-mr-green: .

In spite of everything if you have time and want to try it, don't hesitate, you can find on Ebay cheap product and the experience is very rewarding.

I am an (retire) analog electronician, without real knowledge in digital electronic. I try FPGA for pleasure, I have not persevered with : now time for project is completed :smiley-roll: .
I have found experience very interesting.
Les Shadocks : L'ignorance ne s'apprend pas.

DesignFoundry

I don't think you need an in-depth understanding of electronics to get going with FPGAs. As 68tjs points out you can get cheap development boards that have the 'experience' built in and then use these to explore and develop your understanding of FPGAs. Experience comes from learning and tinkering with circuits. I think that is the real appeal of FPGAs and that it what I love about working with them - they can be a blank canvas that you can use to create interesting projects and learn about all of the things that 68tjs mentions.

DesignFoundry

After posting a new blog entry I have had to amend the hyperlink to point to the permanent location of the post. Sorry if this misled anyone.

Go Up