4 ms·
FPGA programming is like another level below assembly programming. In high-level languages you got functions, variables and scopes while in assembly you need t
by 0x000xca0xfe 3y ago
FPGA programming is like another level below assembly programming.
In high-level languages you got functions, variables and scopes while in assembly you need to build them yourself using more primitive units, i.e. instructions and registers.
In assembly you got many helpful instructions and easy memory access while in FPGAs and ASICs you have... nothing. Only wires and boolean logic.
It allows you to build some things extremely efficiently, e.g.: Press button 1 and 2 to activate LED 1. No clocks, no memory accesses, no I/O polling or interrupts, just a direct connection from some inputs to others with some logic in between.
Although there are many modern tools, libraries and IP blocks to make FPGA programming easier or even possible with languages like Scala or C++, it usually takes way more time to build anything compared to doing it with the help of a CPU.
- jvanderbot 3y agoI've always been interested in coaxing extreme performance in a computational task by using FPGA or ASIC. This seems like a mad science. Is there a recommended entry point like a book or learning resource? The only exposure I have is from the FPGA stereo disparity module on the Mars Rover. And sadly I left before I could really pick any brains. Or ASIC Bitcoin mining.
- 0x000xca0xfe 3y agoWell first you need a problem where using a FPGA is a good fit. FPGAs usually clock much lower than CPUs. If you want to beat a modern multicore CPU running at 5GHz with a 100MHz FPGA, you need to do a lot more per cycle to win. Your optimal problem is either highly parallel or solvable using a deep pipeline that gives you crazy throughput. Since accessing external RAM is much more complicated on a FPGA and you don't have all the nice prefetching and caching levels of a CPU, you better make do with the limited on-board memory. Usually this limits you to real-time stream processing like audio, video, packet filtering or I/O muxing. But if you have an interesting problem in these spaces, FPGAs can be crazy power efficient and fun. At my university, we used a ZynqBerry (Raspberry Pi format and only around $100) with the Vivado tools, so maybe that would be a good start for you as well.
- rcxdude 3y agoThis. It's quite hard to find a computational task than an FPGA is more suited for than a CPU or GPU. Probably the biggest one is ASIC simulation. The biggest use for them otherwise is either dedicated high-speed I/O in embedded applications or super-low latency/jitter applications.
- imtringued 3y agoAccessing RAM in itself isn't actually that bad, the real challenge is that writing an AXI Manager is too much trouble. The fixed costs are too high for a hobbyist that just wants to do a single project.
- porsupah 3y agoYou might find "Digital Design and Computer Architecture" by Sarah Harris & David Harris helpful. (Note that it comes in ARM and RISC-V editions) https://www.waterstones.com/book/digital-design-and-computer-architecture-risc-v-edition/sarah-harris/david-harris/9780128200643 https://www.waterstones.com/book/digital-design-and-computer...
- MaKey 3y ago> This seems like a mad science. Is there a recommended entry point like a book or learning resource? There is this new book: https://nostarch.com/gettingstartedwithfpgas https://nostarch.com/gettingstartedwithfpgas