8 ms·
FPGA Programming for the Masses
- solusglobus 14y agoThe code in Figure 1 should be for Figure 2 and vice-versa.
- easytiger 14y agoYea that was a tad confusing. I had to readread to make sure i hadn't missed something
- jbangert 14y agoWhile I am not an expert on FPGA design, I believe Figures 1 and 2 are slightly exaggerated. The C program is very ad-hoc (returning a double from main is actually illegal and will lead to interesting results) and avoids all I/O, whereas the Verilog program seems to be quite complicated (in particular with the use of ready flags and clocks). Please correct me if I am wrong, but couldn't the authors just have used a continuous assignment (or maybe a simple clock) for their conversion? Also, don't newer verilogs support specifying IEEE floating point numbers in their natural form, as opposed to having to manually convert them to hex? This seems a little like catching attention and potentially trying to make the alternative products (SystemVerilog, etc.) look nicer.
- deleted 14y ago[deleted]
- deleted 14y ago[deleted]
- knz42 14y ago" it's valid for C code to define the main() function as something other than int." It's a bit more complicated than that. True, C defines two environments called "freestanding" (without OS) and "hosted" (with OS). As per the ISO specification (sect. 5.1.2.2.1 for both 9899:1999 and :2011), main() must return int for hosted implementations, whereas anything goes in freestanding. Meanwhile, while it is true that most embedded systems are indeed "freestanding" as per the C standard, an increasing number is not. So one needs to be careful about these things.
- AndresNavarro 14y agoI think the last paragraph is key: > We also need to revisit the approach of compiling a high-level language to VHDL/Verilog and then using vendor-specific synthesis tools to generate bitstreams. If FPGA vendors open up FPGA architecture details, third parties could develop new tools that compile a high-level description directly to a bitstream without going through the intermediate step of generating VHDL/Verilog. This is attractive because current synthesis times are too long to be acceptable in the mainstream. This is both an ideological as well as a practical matter. Until the whole process INCLUDING bitstream generation is open, I don't see FPGAs as a viable alternative to general purpose processors.
- DanWaterworth 14y agoI can't up vote this enough. I keep gearing up to try using an FPGA, but ever time I do, I am prevented from continuing by my revulsion of closed source tools.
- VLM 14y agoI recently had to burn an old fashioned eprom using a non-legacy PC and found it impossible to find a USB connected linux compatible eprom burner. Yes if you have a parallel port on your laptop (not since 2003 or so?) there's the willem programmer. Yes there's a company in .de selling a USB burner with Ubuntu software but the shipping and handling to the states was kind of extreme. Why do they charge $75 or whatever it was from .de when Seeed studios charges approx nothing from .cn? So closed source problems are hardly limited solely to high tech FPGAs. Abandoning FPGAs doesn't mean you'll eliminate closed source from your life, it just means you'll eliminate FPGAs from your life... Also I suspect you do not have a copy of the firmware inside the microcontroller that runs your mouse, or your PC 8042 keyboard controller, or innumerable microcontrollers thru the machine, so either you are already OK with using "some" closed source or don't have a full picture of your whole system. Pessimism is your friend in this case and the situation is probably much worse than you think. I ALWAYS prioritize open source above all other criteria for obvious reasons, but when its not available I do my best with what I can get... Its an engineering background thing... Much as I'd love to ideally make everything outta aerospace carbon fiber and titanium, but lets face it, my house is made mostly outta wood and my car outta steel.
- VLM 14y agoThe article missed a VERY important modern FPGA design technique which is using raw VHDL/Verilog like a "PC programmer" would use hand optimized assembly. In other words, most of the time, not very much. So the "inner loop" which needs optimizing is a crazy deep complicated DSP pipeline, obviously you implement that in FGPA "hardware" directly in a HDL. On the other hand, you'd be crazy to implement your UI or a generic protocol like TCP/IP in hardware (unless you're building a router or switch...). Something like I2C is right about on the cusp where you're better off writing it in plain ole C or implement it as a "hardware" peripheral in the FPGA. Peripheral ... of what you ask? Well, depending on your license requirements and personal feelings there are a zillion options like microblaze/picoblaze from the FPGA mfgr, or visit the opencores website and download a Z80 or a 6502 or a PDP-10 or whatever floats your boat for the high level. Yes, a full PDP-10 will fit easily in one of the bigger hobby size Spartan FPGAs. Its not 1995 anymore, you've got enough space to put dozens (hundreds?) of picoblaze cores on a single FPGA if you want now a days. There's no point in hand optimized HDL to output "hello world" just like there's no point in the antique technique of software driven "bit banged" serial ports just "include" an off the shelf opencore UART to simplify your UI code. I've been in this game a long time and this is the future of microcontrollers and possibly general purpose computing. The engineering "skill" of searching a feature matrix to find which PIC microcontroller has 3 I2C hardware and 7 timers and 2 UARTS in your favorite core family is going to be dead, you'll just "include uart.h" and instantiate it 2 times and you pick your favorite core, be it a Z80 or a microblaze or an ARM or a SPARC. In the future I think very few people "programming" FPGAs are going to be writing anything other than a bunch of includes and then doing everything in the embedded synthesized Z80. The "old timers" who actually write in HDLs are going to look down on the noob FPGA progs much like the old assembly coders used to look down on the visual basic noobs, etc.
- mindslight 14y agoFPGAs aren't going to overtake microcontrollers just based on not having to pick out the correct chip. There's always going to be a cost difference between uCs and FPGAs, so unless the designer gets something very compelling from that flexibility, the uC will continue to be chosen. Keeping up with demand for peripheral flexibility is as simple as including more on each chip - unused peripheral blocks are still cheaper than building the peripherals out of reconfigurable blocks.
- zwieback 14y agoIt's been a while since I worked with FPGAs but my experience was that using drop-in CPU cores and peripherals is pure joy, drag and drop what you need, build your bits and you're good to go. Replacing an I2C with SPI or supporting a wide range of daughterboards is trivially easy. On the other hand, it only takes a day of writing low-level Verilog to realize that the problem of correctly and efficiently parallelizing algorithms is a hard one. We were using a very early C to Verilog (C2H) compiler from Altera and it worked but was very inefficient in terms of logic element use. I'm sure there's a lot of R&D going on in that space because without significant progress general purpose CPUs or at least cores will remain dominant for some time.
- dgrnbrg 14y agoI have been working on this problem as well, by writing a system that allows you to compile Clojure to FPGAs. I'll be giving a talk on it at Clojure West: http://clojurewest.org/sessions#greenberg http://clojurewest.org/sessions#greenberg </shamelessplug>
- DanWaterworth 14y agoI've also been working on a HDL DSL. I've been using Idris; the type of a circuit ensures that it implements the correct behaviour.
- toolslive 14y agowhat about this one? http://cufp.org/conference/sessions/2012/peter-braam-parallel-scientific-awesome-haskell-fp http://cufp.org/conference/sessions/2012/peter-braam-paralle...
- gatesphere 14y agoHaving worked with Lime hands-on, it is certainly going to make splashes. It's a fabulous idea and deserves much more attention than it's getting.