Live data from Hacker News

How FPGAs work, and why you'll buy one (2013)

yosefk.com

101–110 of 110 posts

Re: How FPGAs work, and why you'll buy one (2013)

#101
post #97
post #91

Earlier quoted context omitted.

Just implement an FPGA in Verilog, then use that FPGA as your target. It has the added bonus of making your bitstream portable across Altera, Xilinx, Lattice, etc. One could use genetic algorithm to map the search space so that the virtual fpga compiles cleanly using available resources of the hardware.

I did it (while playing with reconfigurable dataflow CPUs), and timings (expectably) were awful.

It could see cases where there is an impedance mismatch between the guest FPGA running on the host FPGA. The idea of the genetic algorithm to map out the search space is to find some identity function HDL that allows for a clean 1:1 or 2:1 mapping of resources without incurring some combinatorial inefficiency.

Maybe c-slowing could help with the timings, even if the area used was 4x it would still be a great research platform for reconfigurable computing since the bitstreams are proprietary, not documented and not portable.

http://blog.notdot.net/2012/10/Build-your-own-FPGA

Re: How FPGAs work, and why you'll buy one (2013)

#102

Earlier quoted context omitted.

One of the biggest problems is how insular and impenetrable that community is. The FPGA community, and to a certain extent the entire semiconductor industry, seems to have a prescribed path for engineers. First, you get an electrical or computer engineering degree with a couple internships at semiconductor companies. Then, you get a junior role at one of those companies where you are mentored by senior engineers, who…

I was one of those semiconductor guys for about 15 years but now I am in the retirement phase. I worked for Motorola, Freescale, Canon and Qualcomm. Did the FPGA stuff at Canon. Believe it or not they let people in all the time. And they let you back in. I got my Qualcomm gig after ~2 years of being out of tech entirely. I reckon it's because of that crappy tooling thing you mentioned. Years later and nothing has rea…

> I wouldn't worry about working for a HW company. The job is nothing special.

It's more the nature of the work. I want to work on hardware, but not for a defense contractor again. I'm reasonably good at the CS-ey stuff I'm doing now, but I don't really like it. I like making physical devices do things.

> Stuff like web and NLP (Natural Language Processing I assume?) is a little bit too high level for most HW engineering work unfortunately.

Until four weeks ago I had never done any serious web dev, and NLP was just the first escape path that presented itself when I desperately wanted out of a defense contractor black hole. I am, fundamentally, a signal processing engineer. Even when I was doing real-time radar code nobody wanted to talk to me.

Re: How FPGAs work, and why you'll buy one (2013)

#103
post #94

Earlier quoted context omitted.

PART 3/3 MY PROJECT: I want to pave the way for FPGAs to be usable in everything from laptop/desktop computers to phones (if the static power consumption gets better). I have some very interesting ideas of what an average user could do with in system FPGAs that can be reconfigured at runtime. My main target is fixing the huge tangled JTAG mess. I mentioned earlier that even though the JTAG standard is pretty solid, e…

Brilliant writeup, thanks! Please publish this somewhere more permanent and resubmit so it gets more attention (and hopefully discussion).

My friend put it up on his blog until I get around to making mine again. http://curtis.io/others-work/open-tooling-for-fpgas

Re: How FPGAs work, and why you'll buy one (2013)

#104

Earlier quoted context omitted.

I was one of those semiconductor guys for about 15 years but now I am in the retirement phase. I worked for Motorola, Freescale, Canon and Qualcomm. Did the FPGA stuff at Canon. Believe it or not they let people in all the time. And they let you back in. I got my Qualcomm gig after ~2 years of being out of tech entirely. I reckon it's because of that crappy tooling thing you mentioned. Years later and nothing has rea…

> I wouldn't worry about working for a HW company. The job is nothing special. It's more the nature of the work. I want to work on hardware, but not for a defense contractor again. I'm reasonably good at the CS-ey stuff I'm doing now, but I don't really like it. I like making physical devices do things. > Stuff like web and NLP (Natural Language Processing I assume?) is a little bit too high level for most HW enginee…

Radar is a bit niche. Embedded signal processing SW might be a good avenue. Verification is another one.

Like any job, HW companies either want experienced people or grads to do the crap work. You need a related skill-set to go for experienced positions.

FPGA hobbyists are not considered to be experienced.

Re: How FPGAs work, and why you'll buy one (2013)

#105
post #43

Earlier quoted context omitted.

What jbangert said is the crux of the JITing problem: "compilation" for FPGAs is not really at all like compiling software, and can be hugely computationally expensive. On top of that, pretty much the entire synthesis, mapping, and place and route flow is usually proprietary. That said, there have been some efforts in this direction. Search the literature for "warp processing".

Back in the day I learned about using VHDL to design circuits, is that the kind of compilation also used for FPGAs? That language paradigm is close to modern dataflow oriented programming languages. It should be theoretically possible to compile an application program written in that style and have the logical circuits in the FPGA be a direct mapping of the business logic in the application.

> Back in the day I learned about using VHDL to design circuits, is that the kind of compilation also used for FPGAs?

FPGAs can implement any digital circuit which fits, with some caveats. So yes, VHDL is commonly used to describe designs for FPGAs. I'm not sure what you mean by '[that] kind of compilation', though, as you never specify what kind of compilation you mean.

Implementing a circuit on an FPGA involves many of the same, or similar, steps and processes as implementing it on an ASIC (and obviously, does not involve all the physical design stuff). If that's what you're asking.

> That language paradigm is close to modern dataflow oriented programming languages. It should be theoretically possible to compile an application program written in that style and have the logical circuits in the FPGA be a direct mapping of the business logic in the application.

Sure, of course it's theoretically possible; there's nothing you can do in digital logic you cannot do on a UTM (space/memory constraints aside), and vice-versa. This field is known as "High-Level Synthesis", and it's been around for decades. It's only now becoming sort-of widely used for real-world stuff.

But it's nothing like "directly translating" to logic for the FPGA ;). It's probably easier for most programmers to design in such a language vs. an HDL, but AFAIK that's not even close to the biggest challenge with doing HLS. I think timing and resource allocation are much bigger problems (but I'm not very informed about HLS!).

Look through the HLS literature if you're interested in what's involved--I'm not an expert by any means. Also, if you're interested in alternative programming languages for hardware design, check out BlueSpec and Chisel.

Re: How FPGAs work, and why you'll buy one (2013)

#106
post #5

Earlier quoted context omitted.

porting regular software to FPGA's is certainly an interesting idea and many people have worked on it (google C to FPGA). Unfortunately, these solutions aren't quite what you would think, because the programming model of a microprocessor (serial execution of instructions) is very different from that of an FPGA (parallel evaluation of gates, non-uniform state access/routing -- you cannot just access any variable in Ve…

Just wanted to add that many FPGAs physically support updating parts of their configuration without turning off or stopping the rest of the chip. This is just very hard to do without the docs we need of the chips, and almost no one does it.

> ... almost no one does it.

I've heard an anecdote that Altera kept getting pestered by customers asking why they don't have it--"but why not? Xilinx has it!".

So they implemented it just so they could say, "We have it too!".

It shut them up, and since no non-academics actually use PR (that I'm aware of; I'd love to hear counterexamples), they've promptly ignored it again :).

Re: How FPGAs work, and why you'll buy one (2013)

#107
I've written a number of IP cores with FPGAs over 10 years ago and the sad fact is that the same problems and criticisms that led me to forget about using them anywhere than at some big company are still very relevant today. Problems include:

* Hostile toolchains for independent developers / engineers. Lack of reasonably useful toolchains including simulators, synthesis tools, the works. iVerilog has been lame before in my experience, for example. * Expensive hardware that's artificially inflated in price due to lack of commodity concerns (perhaps lack of competition in general) * Toolchains unfriendly / bad UX for traditional software developers. I read a Linux Journal article with a Python-like HDL featured - myHDL and its traction is what I suspected it would be - irrelevant to anyone but hobbyists, and hobbyists have basically zero input into the industry unlike software's dynamics. After working with different compiler vendors and doing some research in the space (GPGPUs completely destroyed the market like I figured back then because software developer use cases of hardware tend to be very narrow uses of FPGA / ASIC capabilities - parallel processing or custom FPUs for boutique DSPs being typical), I've seen rather little progress compared to the leaps in software productivity. Even the recent Scala-based Chisel language seems a bit trite as well and more research-ware that won't be adopted by manufacturers probably because... * Most FPGA and ASIC targeted use cases for HDLs are primarily for hardware engineers first most, not people that are software engineers first. When people get specs on hardware, nobody really cares about the HDL code written as much as whether the SOC has a lot of test benches and they look at the block diagrams instead of the HDL typically and things tend to be developed typically as black boxes due to how IP cores work (per industry conventions). * Compilers for hardware languages have had tons of issues for a long, long time because expressing bit math and signals (especially the analog extensions to VHDL and Verilog) have been really cumbersome with imperative style languages. Historically, we've gotten far more concise, legible results with language clarity by using conventions from Matlab and R than with C and Ada, but Verilog and VHDL are just too damn dominant and most experienced electrical engineers that are hardware gurus really do not like to learn a lot of new languages and semantics unlike how software developers tend to behave typically.

However, I've always felt that hardware engineers and software engineers should talk a lot more, and the ever-increasing gap has been a disappointment for me. I'm totally on-board with a lot of testing for software, but at the same time I understand that software is typically designed with the expectation to change things frequently while hardware is typically written to be reliable-first and to go through insanely rigorous testing because you cannot patch hardware. Most IP cores that are distributed a lot have at least 2.5 times as much test benches / harnesses as the code to actually do the work. Hardware has much more rigorous specification designs than software typically though, so this is possible at least. Haskell's QuickCheck would be totally helpful for how a lot of hardware is tested because nowadays you can't test all the combinations of signals on, say, a 128-bit bus in a reasonable amount of time. So test benches are full of tons of statistical functions and are sometimes even generated with machine learning techniques to exercise the most likely to fail use cases and states. This all goes out the window if you switch languages typically. That kind of attention to testing is almost unheard of in software in my experience.

A trivial-seeming example of how HDLs are hostile to software developers is the difference when you write a switch statement in C versus in an HDL (tremendous apologies, I haven't written Verilog in 10 years):

  switch (input) {
    case b'10: 
      output 
vs.

  switch (input) {
    case b'10: 
      output 
Omitting a default case causes a latch to be produced by the compiler, so the two are VERY different and will punish software developers that like to use shortcuts (my Perl background bit me real hard trying to do shortcuts in the Verilog compilers I used before - I was even more surprised to see my C-style macros failing after only 2 levels of indirection to try to make my cores more configurable, forcing me to rewrite my cores often). Unlike in software where something like whether a switch statement becomes a jump table or a series of if statements isn't typically make or break, in hardware the difference between a single clock cycle being used up or not is massively important.

After basically yelling at my compiler and tools oftentimes for doing things that defied their documentation enough times, waiting hours for place and routes to finish (they ARE NP hard, after all), and uncovering so many edge cases in FPGAs that required use of clock trees and manual refinement of the resulting FPGA image file, I realized that this just wasn't going to get much better of an experience because these levels of concerns are what hardware engineers are responsible for tuning themselves and you just can't abstract and delegate it away.

I asked my boss back then why Intel shouldn't enter the market and he responded "because if it's commoditized, the entire industry will lose all their margins because the market for FPGAs is primarily large company hardware engineers." It took over 10 years later for Intel to finally buy Altera it seems... and in the meantime we had an incredible number of things happen across the spectrum while FPGAs are still practically the same user experience and fundamental architectures (nothing like SMT happened in FPGA land really, no really revolutionary compilers to make writing hardware super easy).

There's a gazillion more reasons why we'll see more people using the Raspberry Pi and Arduino for learning to tinker with hardware, and Xilinx, Altera, etc. have always been the way they are now, so my decision to just never go back to the fun world of FPGAs seems to have been justified, sadly.

Re: How FPGAs work, and why you'll buy one (2013)

#108
post #51
post #46

Earlier quoted context omitted.

(Apologies for deletion. I moved my comment to parent. Won't try that again.) It is, but on a different level. I think the analogy would be that in VHDL/Verliog you are dealing with a template or macro language (which is executed to generate code) as opposed to a low-level language (which translates almost directly to machine instructions).

I'm not sure a presence of a stream of instructions or anything comparable is a requirement for a definition of a "programming". You can program a DNA, or a slime mold: http://www.wired.com/2013/06/slime-mold-computers/ Or even crabs: http://hackaday.com/2012/09/28/making-logic-gates-out-of-cra... Anything which can be used to implement any kind of computing in a broad sense is a programming, as long as it's done usi…

Or carnivorous plant! http://www.dailymotion.com/video/xbwqej_david-naccache-quel-... (sorry it is in French).

Re: How FPGAs work, and why you'll buy one (2013)

#109

The major issue with FPGAs today is that there is no free toolchain for compiling the bitstreams that run on them. The only project I know of to make any real progress on fixing this is fpgatools. [0] It supports a single model of the Xilinx Spartan-6 series, the XC6SLX9. I know almost nothing about FPGAs, but seeing as how almost no one is working on this problem, I figured I'd try to add support for the XC6SLX45, t…

I disagree strongly. The major issue with FPGAs today is that they cost money (because they are chips). They cost even more than your CPU. So you can't treat them life software. To put it in simpler words: everyone has access to a CPU, less than 1% have access to an FPGA. Fix that* and the tooling will follow. * one way to make FPGAs "free" is to incorporate some FPGA blocks in an Intel CPU. Then it will feel free.

It's the programming model, not the FPGA itself that people are asking to be free (as in freedom, not cost). Comparing to the world of software: the FPGA is analogous to the CPU, the programming model is analogous to the instruction set, the tool chain is analogous to the compiler and the hardware Description Language" is analogous to source code. The freedoms that apply to software/compiler/information can equally be applied to their analogue in the FPGA space.

Incidentally, FPGAs start at US$1.24 in single unit quantities from Digikey, and go up from there. US$6.75 will buy a "proper" logic cell based FPGA. They are no more expensive than a CPU. A Zynq development board, which has 2 x ARM cores with integrated FPGA, can be had for US$119 [1].

https://adapteva.myshopify.com/collections/featured-products...

--- Edit: fixed price on dev. board

Re: How FPGAs work, and why you'll buy one (2013)

#110
post #34

Our experience with GPU cloud computing at Graphistry should be pretty representative. We spend a lot of effort getting subsecond interactivity in funny C dialects (OpenCL/CUDA). To get those down further, we can put together a few GPUs and reuse most of the code. Eventually, however, data communication costs get too high, so FPGAs would be the next step. That is certainly doable: OpenCL -> FPGA compilers are a thing…

With OpenCL + FPGA what you do is basically instantiate a GPU architecture inside an FPGA and then execute the OpenCL algorithm into that. I think that's cool but you aren't getting a better throughput than what you would get with a GPU. The better solution would be to do your custom optimised control/data path for the FPGA architecture you are currently using (VHDL/Verilog).

That's not how it works, actually. The compiler generates the dataflow directly in hardware.
Post reply on HN