FPGA application examples - Page 1
Forum section: electronics / general

author: daqq
author_rank: Super Contributor
timestamp: August 12, 2019, 08:22:34 pm
content: Hi guys,I'll be doing a presentation on FPGAs to a few hobbyists - the theme being mostly what they are, how can the be applied and how freakin' cool they are. I'm trying to come up with a few specific examples that robotics enthusiasts (though not all of them necessarily professionals) can relate to. In particular examples where an FPGA is shown to be the better (or only reasonable) choice. I'm trying to find applications in three* classes: low range FPGAs (some place you'd stick a Spartan 7 like device, or lower), mid range (some place you'd stick an Artix/Kintex) and the really really high range (top of the line UltraScale+ sort of thing).I will mention the cloud and supercomputer things, but mostly as a side note.So far I've got:Low:Multichannel analyzer - a fast 100Msps ADC was hooked up to a small FPGA that analyzed the signal and provided a peak height histogram. Just add a photomultiplier+scintillator and you have a gamma ray spectrometer.Brains on a multislope ADCMotor controllerMid:Serial port server - a SoC (Zynq) was used for a device that was pretty much a box full of serial lines (32 max IIRC) hooked up to an Ethernet connection. The ARM did the Linuxing and the networking, the USARTs were done on the fabric.Test equipment - seen everywhere, scopes, logic analyzers, signal digitizers, chewing high speed data, doing triggering, acquisition etc.Software defined radiosUltrasound machinesHigh end audio DACsHigh:Supercomputer accelerator cards, HPC, networkingReal time large scale image analysisI've had a few more, but removed them, as explaining where the FPGA/CPLD came into play would take a lot of time. I'll be scouring the Xilinx Xcell magazine for some additional applications as well.Any suggestions are welcome!Thanks,David

author: tunk
author_rank: Super Contributor
timestamp: August 12, 2019, 09:25:17 pm
content: I don't know anything abouts FPGAs, but this may be an example:https://www.eevblog.com/forum/testgear/hantek-2c422c722d422d72/

author: Mr. Scram
author_rank: Super Contributor
timestamp: August 12, 2019, 09:42:51 pm
content: Video is an obvious candidate. Those Tivo boxes tend to come with FPGAs so decoders and standards can be updated without changing the hardware.

author: james_s
author_rank: Super Contributor
timestamp: August 13, 2019, 12:10:19 am
content: I used to work at a company that made DVRs. Ours had a FPGA in them but it had nothing to do with the decoding, it was used as a crossbar switch to route video and audio between the tuners, recorder, local and remote TVs. I've never seen inside a TiVo but I'd guess it uses a similar arrangement.As far as examples of what they can be used for, recreating retro hardware is what interests me. Keep in mind this is just a hobby for me, I have no formal HDL training so don't expect flawless code but it does work.https://github.com/james10952001

author: notadave
author_rank: Contributor
timestamp: September 10, 2019, 07:23:44 am
content: Historically the most important high end application has been:EmulationThat is validating new large-scale integration IC designs before "tape out".

author: TomS_
author_rank: Frequent Contributor
timestamp: September 10, 2019, 12:32:33 pm
content: Quote from: Mr. Scram on August 12, 2019, 09:42:51 pmI would put my money on them doing their decoding etc in software. Video standards dont tend to change often enough, and low cost mass produced consumer devices wouldnt exactly be the kind of devices that might be considered a long term investment warranting full upgradability. By the time the next major standard worthy of replacing your kit comes along, people will just buy new boxes.Quick google, TiVo Bolt (seems to be the latest gen) looks to be more or less a single chip solution using a BCM7449, which looks basically like an SoC for set top boxes.

author: legacy
author_rank: Super Contributor
timestamp: September 10, 2019, 01:23:53 pm
content: FPGAs can *potentially* also be used for emulating old-computers, like Amigas and even SGIs.However, FPGAs cannot compete, in terms of effort and performances, to software emulation, especially when this one is made on JIT (Dynamic Re-compilation).

author: amspire
author_rank: Super Contributor
timestamp: September 10, 2019, 01:53:30 pm
content: A relatively simple application that is a perfect example of a FPGA application is a logic analyser like the old, but still very useful Logicport 32 bit analyser.https://www.eevblog.com/forum/reviews/intronix-logicport-34-channel-logic-analyzer-teardown/It can capture 2000 samples directly at 500MHz, but more interesting is it can capture potentially for an unlimited time at 200MHz.It only has room for about 2000 32 bit samples (probably pretty good for 2006), but what it does is it only stores the samples that include a change to one of the bits, and it records the time of those changes. So it can keep running for hours if necessary at 200MHz until there have been 2000 state changes following the trigger pattern. For many purposes, recording 2000 state changes is enough.The interesting thing is it has comprehensive triggering as well as performing the compression. It is able to do all of this at 200MHz for 32 bits of data with a clock that is either 200 or 400MHz by passing the data down a synchronous pipeline.The cyclone chip easily has enough logic to pass the input down 64 or more synchronous stages while it is doing the trigger pattern detection logic, and implementing the compression. The 32 bits can move down this pipeline at 200MHz and all the triggering logic and compression logic can be done with zero effect on the sampling speed. This is one of the abilities of FPGA's that cannot be duplicated by a CPU.I think the thing limiting sampling speed with this 2006-era FPGA is that the maximum speed you can run a 64 bit counter on this chip is 208MHz.Richard

author: voltsandjolts
author_rank: Unknown
timestamp: September 10, 2019, 02:38:22 pm
content: Before I turned on my Logicport 32 I took it apart!Cyclone FPGA + FTDI, thats it.Its a shame it hasn't been updated because the software works well, wouldn't take much to drop in a newer FPGA and FTDI.

author: rstofer
author_rank: Super Contributor
timestamp: September 10, 2019, 03:04:30 pm
content: Quote from: legacy on September 10, 2019, 01:23:53 pmNo potentially about it! I built an FPGA emulation of an IBM1130 computer system and all of the peripherals (CPU, Line Printer, Card Reader, Typewriter, Keyboard and Disk) and it runs the factory OS and compilers unchanged. I have used it for practical projects using Fortran including plotting to a LaserJet (versus the old drum plotter).PDP11/70s running on FPGAs are all over the place. Many are running 2.11BSD Unix unchanged. AVRs and PICs have been done - check OpenCores.org.I would have to think pretty hard about whether FPGAs can compete with a software emulation. FPGAs are fast, if you have the money, and can do in one cycle what an emulation may do in several instructions, each taking one or more cycles. As to effort, true, FPGA coding, at the bleeding edge, is quite difficult. Running down in the 50-100 MHz range, it's pretty straightforward. My 1130 runs at 50 MHz while the factory machine ran at 400 kHz and i can do a little cleanup (or porting) and get mine to 100 MHz. I made no effort to keep my implementation 'cycle accurate' as I could easily throw more hardware into the mix to speed things up a bit. With one of the Artix 7 chips, I could probably get to 100 MHz quite easily. Someday...FPGAs are the coolest toy on the planet! You can pretty much build whatever you want as long as it is primarily in the digital domain. Some FPGAs are incorporating ADCs (and DACs?) so a bit of analog is thrown in.In terms of robotics, I might use an FPGA for a vision processor but I certainly would not use it to replace a uC running the motors and servos. The entire mechanical system can run off one or more uCs and it would be far easier than creating specialized hardware. Unless there is a reason a uC is inadequate. There are some awesome uCs so I just don't see when an FPGA plays in this arena unless it's "just because".

author: rstofer
author_rank: Super Contributor
timestamp: September 10, 2019, 03:20:32 pm
content: Or you can grab the T80 core from OpenCores, add in copies of the original PacMan ROMs and, with very little effort, you have a REAL hardware implementation of the classic games. There are many others - check Google.https://www.fpgaarcade.com/And, yes, I have a very clean implementation of PacMan. Galaga is another possibility.https://www.fpgaarcade.com/kbtopic/games/Of course, MAME does a nice job and there are thousands of jobs. And, yes, I have a full size arcade cabinet with MAME. I built mine with a period accurate CRT but it looks a lot like this one:https://shop.xgaming.com/products/x-arcade-machine-cabinet-with-250-arcade-classicsFPGAs are quite useful for arcade games.

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 10, 2019, 03:22:38 pm
content: Quote from: rstofer on September 10, 2019, 03:04:30 pmWell, I think it would really depend on a number of factors. First, whether the processor(s) core you're targetting already exists in RTL (or conversely in software), or if you have to design it yourself from scratch. So, that's about development time.Then it would depend on part cost. The required FPGA may cost a lot more than the CPU you could run a software emulation on. Or not.Then it would depend on target performance. For cycle-accurate emulation, a pure software emulation may not cut it, or could be pretty hard to write correctly, could involve disabling caches, etc (hindering performance...) whereas it's pretty straightforward with an FPGA.Then it would depend on requirements for power consumption, if there is any. A pure FPGA solution may draw a lot more power than the software emulation approach. Or not. Really would depend on the complexity of the emulated hardware and the clock frequency...Then again, the software emulation approach could get you "cheap" access to additional resources (like peripherals, ethernet, USB, whatever...) that could be tough (or costly if you have to buy IPs) to implement on an FPGA.And probably many other factors.But one thing is certain, developing a whole system including CPU + peripherals on FPGAs is fun and rewarding.

author: coppice
author_rank: Super Contributor
timestamp: September 10, 2019, 03:54:11 pm
content: You listed SDR as a medium scale application. Try looking in a cellular base-station and you'll find the biggest application for large FPGAs is also SDR.

author: laugensalm
author_rank: Regular Contributor
timestamp: September 10, 2019, 03:56:13 pm
content: Quote from: SiliconWizard on September 10, 2019, 03:22:38 pmKeyword vision processor: I've hacked a MJPEG streaming camera 'SoC' a few years ago which consumes considerably less power than the multi core DSP variant of it. But it took some trickery to power-optimize.I guess you can find a few more vision applications where you're better off with the FPGA - if you can parallelize and keep the clocks low.In any case, many high throughput or low latency applications in industrial image processing depend on programmable custom logic, so industrial vision and special cameras is a main supporting pillar.Another interesting application is the convolutional neural network field, Lattice Semi has demonstrated a few applications on the last Embedded World trade show. Not sure how the power comparison turns out there compared to a DSP implementation. I'd guess in favor of the FPGA.Quote from: SiliconWizard on September 10, 2019, 03:22:38 pmActually, when it comes to tricky (time critical, or safety) applications, it can be the perfect solution for debugging down to the peripherals, the fully cycle accurate way. You can also prove that your program works right on another level. For example, many scenarios that could slip a MISRA-C source check turn out to go wrong in the simulation and might produce undefined results in the synthesized logic. Good, if you track this down early in development.

author: rstofer
author_rank: Super Contributor
timestamp: September 10, 2019, 04:46:55 pm
content: Quote from: SiliconWizard on September 10, 2019, 03:22:38 pmAnd software emulation is why 'simh' is so popular. I have two PiDP11 consoles which are PDP11/70 clones running in simh on Raspberry Pi 3B+ processors. These systems emulate a bunch of peripherals and the systems can be configured in many different ways. In addition, the emulation runs a multitude of OSes although mine are running just 2.11BSD Unix. These systems have a maximum memory configuration which very few real systems had (4 MB) and the emulation is faster than the real hardware. These machines are FUN! Especially if you like old-time Fortran and the vi editor. As it turns out, they also make a half decent web server.https://obsolescence.wixsite.com/obsolescence/pidp-11There's something satisfying about a multiuser Unix system with the bare essentials and none of the bloat.Of course there is also a simh emulation of the IBM1130http://ibm1130.org/

author: Bassman59
author_rank: Super Contributor
timestamp: September 10, 2019, 06:56:16 pm
content: Quote from: daqq on August 12, 2019, 08:22:34 pmOne thing not mentioned in the other replies is basically what we do: roll up a shit-ton of logic that used to occupy several VME-style boards into a chip that occupies a square inch of board space. And this is all custom -- application-specific -- stuff that doesn't really fall into any of the categories noted here.

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 11, 2019, 08:47:27 pm
content: Quote from: Bassman59 on September 10, 2019, 06:56:16 pmYup.Maybe it wasn't mentioned because the OP targets hobbyists. Of course that could still interest hobbyists that are into recreating vintage computers for instance...Generally speaking, with FPGAs you can do many things that once required either gigantic and power-hungry boards, or the design of ASICs, which was extremely expensive, and still is.

author: daqq
author_rank: Super Contributor
timestamp: September 13, 2019, 05:32:26 am
content: Thanks guys for the advice and examples! The vintage computer emulators are a great addition.The 'compress several square meters of logic boards into a single chip' will be mentioned, but more in terms of how FPGAs came to be. A large board with chips will be shown, then a few of those will disappear, replaced by a single PAL IC. Then more and more chips will be disappearing as the programmable logic devices improve, eventually gobbling up a CPU and being left alone on a large, otherwise empty board.

author: mac.6
author_rank: Regular Contributor
timestamp: September 18, 2019, 03:38:07 pm
content: Quote from: notadave on September 10, 2019, 07:23:44 amAnd they are still used for this *looking a the pile of FPGA on my left*

author: james_s
author_rank: Super Contributor
timestamp: September 19, 2019, 08:18:00 pm
content: Quote from: TomS_ on September 10, 2019, 12:32:33 pmAlmost all DVRs use Broadcom SOCs which have hardware MPG decoding built into them. I don't know offhand how the encoding is handled, that was not a part of the product I was closely involved in.

author: switch998
author_rank: Contributor
timestamp: September 23, 2019, 02:56:41 am
content: Quote from: james_s on September 19, 2019, 08:18:00 pmI was going to chime in with the same, most consumer grade set top boxes (even most industrial IRDs) use Broadcom SOCs to handle video. However, on the provider side where cost is no issue, it is likely the video is received, processed/ad-spliced/(re)multiplexed and QAM modulated using FPGAs.

author: daqq
author_rank: Super Contributor
timestamp: October 01, 2019, 07:52:04 pm
content: Question, aside from ASICs, is there any other kind of IC that can read and do something useful with, say, the data from a 200 MSps ADC?

author: rstofer
author_rank: Super Contributor
timestamp: October 01, 2019, 09:47:09 pm
content: Quote from: daqq on October 01, 2019, 07:52:04 pmAt such a low datarate, I would expect almost any FPGA to be capable of handing this. Assuming, of course, that the ADC sends parallel data. Dual port BlockRAM comes into play here. Grab the data from the ADC and stuff it into one side of the BlockRAM while processing the data from the other side.I would try to design my way out of using off-chip DDR memory although it is a possibility.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 01, 2019, 11:00:12 pm
content: Oh yeah. You can definitely handle this on many FPGAs. Lots of low-end (or even mid-end) scopes use FPGAs for that.As to external DDR.... well, if you need a sizeable amount of sample memory, it's hard to do without it. You can also use fast synchronous SRAM chips instead (and parallel as many as needed...)

author: james_s
author_rank: Super Contributor
timestamp: October 01, 2019, 11:21:12 pm
content: Many midrange FPGAs have onboard DDR hardware interfaces that make this even easier. There are also various implementations in HDL, it's common enough that a majority of dev boards I see have some DDR memory on them.Personally I much prefer SRAM but that's mostly because I'm focused on recreating retro hardware and SRAM is far easier to work with in that context. Hard to beat the price per capacity ratio of DDR though.

author: daqq
author_rank: Super Contributor
timestamp: October 02, 2019, 05:17:33 am
content: Whoops, sorry, I missposted, I meantaside from ASICs and FPGAs. I know that FPGAs can do this, I'm doing it right now in a project.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 02, 2019, 12:32:38 pm
content: Well, doing that with an all-purpose CPU may be possible, but certainly not easy, and with carefully hand-crafted code. Provided said CPU runs fast enough, and has appropriate interfaces. Usually the fast ADCs have some kind of LVDS I/Os, and not singled-ended ones, so you'd need to be able to interface with that, and the CPU needs to have an embedded serial controller that can handle those rates. If it has some kind of LVDS interface, for instance meant for displays/cameras, you may be able to use that to transfer ADC samples. Maybe. Something to check with some ARM SoC for instance.That would certainly be a challenging experience, probably requiring baremetal programming, and whatever processing (short of just storing samples) you could do with that would still be extremely limited, if it's even possible.

author: daqq
author_rank: Super Contributor
timestamp: October 02, 2019, 04:16:35 pm
content: Thanks, thought as much, just wasn't sure if there was some obscure architecture that could do this reasonably directly.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 02, 2019, 04:22:11 pm
content: Quote from: daqq on October 02, 2019, 04:16:35 pmMaybe very fast specialized DSPs?