News for hackers. Stuff that matters.
Re:Parallel Programming for FPGAs by eachro on Tuesday August 02, 2022 @01:13AM (#32315362)
How does one actually program on an FPGA? I know for GPU, you can buy an nvidia graphics cardm, rent an aws gpu machine or use google colab. Is there some consumer facing equivalent for FPGA programming?
Re:Parallel Programming for FPGAs by Teknoman117 on Tuesday August 02, 2022 @01:49AM (#32315538)
There are some FPGAs that have been _fully_ reverse engineered and now have open source toolchains, such as Lattice iCE40 and Lattice ECP5(-5G). Others are coming along, such as Xilinx 7 series and Lattice's Nexus FPGAs (CrossLink and Certus products).

See: https://f4pga.org/

The open source tools operate at an RTL level (register transfer language, such as SystemVerilog) though, I'm not aware of any open source HLS tools.

Problem at the moment is that FPGAs are being hit really hard by the current global supply chain problems. They're almost impossible to get unless you're a billion dollar corp and the prices are going through the roof for the available supply.

As far as boards go, there are many, many out there. Some of my favorites are:

Alchitry Au: https://www.sparkfun.com/products/16527

Olimex iCE40HX8K-EVN: https://www.olimex.com/Products/FPGA/iCE40/iCE40HX8K-EVB/ope...

ECP5-5G evaluation kit: https://www.latticesemi.com/products/developmentboardsandkit...

Re:Parallel Programming for FPGAs by fjfaase on Tuesday August 02, 2022 @05:43AM (#32316767)
Defintely should also have a look at Ice Studio: Visual editor for open FPGA boards. https://icestudio.io/
Re:Parallel Programming for FPGAs by dannymi on Tuesday August 02, 2022 @04:49AM (#32316463)
You can use a simulation program. One of the professional ones that I like is ModelSim.

You design your chip in VHDL or Verilog, compile it, and then make a (virtual) testbench in ModelSim. Then you run your design in ModelSim.

You can have a look at signals while it's running the simulation in simulated oscilloscopes or you can script a better view in Tcl/Tk or you can have the testbench assert stuff. The latter lets you do something like unit tests. I do that a lot.

Note that simulations are lies. So it's helpful to find obvious bugs--but in the real world all the signals run IN PARALLEL, and they can grow phase differences depending on the routing (which is generated). The simulation cannot test all the combinations (but of course the compiler tries to make the gate to gate timing work on its own).

Open source variants exist. I like https://github.com/nickg/nvc.git . In includes a compiler (from VHDL) and simulator. You can have nvc generate waveform outputs and look at those in gtkwave. It's neat. But it's not as full-featured as ModelSim.

Eventually, you can buy an FPGA development board like the Terasic DE10-Nano and download the program Quartus Prime and actually synthesize your design and load it on the board. You need a REALLY beefy computer to do the synthesis in finite time.

Re:Parallel Programming for FPGAs by dailykoder on Tuesday August 02, 2022 @01:41AM (#32315500)
You could just download the Vendor tools (Xilinx, Intel, Lattice) and start with simulations. They are usually free of charge for private use. Often including their smaller chips. For Xilinx you could, for example, get the Digilent Arty-A7 board, which is based on Xilinx' Artix-7 chip and has plenty of space. There are also free tools for Simulation like GHDL+Gtkwave, but i am completely unsure if there is any that lets you do HLS

FPGA hardware is expensive though

Re:Parallel Programming for FPGAs by nicolas_t on Tuesday August 02, 2022 @01:35AM (#32315463)
There are some development boards like the Terasic DE10 Nano. It's sometimes a bit hard to come by because it's used by Misterfpga (a retrogaming fpga based simulator) but it's perfect to learn to develop on.

Other than that I really recommend 8bitworkshop and the Designing Video Game Hardware in Verilog. It's a great way to get started without an actual fpga board to test with.

Re:Parallel Programming for FPGAs by Joel_Mckay on Tuesday August 02, 2022 @03:22AM (#32315997)
There are a few niches where FPGA make sense, but for things like DSP they naturally parallelize ops well.

The LCMXO3D-9400HC-B-EVN demo board from Lattice can still be found for $60, and Verilog is the most common dialect to learn.

If you are from the sequential CPU/MCU world, than expect to see some very different paradigms. The language define a logic circuit where states propagate in parallel (within physical limits)... latch-up avoidance and clock domain crossing must be handled properly.

If you are good with hardware, there is also the $20 EBAZ4205 (Xilinx ZYNQ 7Z010 fpga has a cpu that runs 32bit linux) since the crash of various crypto currency trends.

T[p: the next generation of Desktop CPUs are supposed to include configurable logic similar to current ZYNQ chips. We shall see what this means when the other boot drops... Good luck... =)

Re:Parallel Programming for FPGAs by rowanG077 on Tuesday August 02, 2022 @09:36AM (#32318284)
Do you have any information on the next gen of desktop CPUs including configurable logic? I'm in the FPGA space and have never heard of it.
Re:Parallel Programming for FPGAs by Joel_Mckay on Tuesday August 02, 2022 @10:45AM (#32319169)
I would recommend watching the TechTechPotato youtube channel interviews. They cover a lot of domain specific hardware. ;)
Re:Parallel Programming for FPGAs by rowanG077 on Tuesday August 02, 2022 @03:33PM (#32323243)
I searched for FPGA in his videos but nothing came up. Could you link me the relevant video? I'm interested in it!
Re:Parallel Programming for FPGAs by Joel_Mckay on Tuesday August 02, 2022 @06:42PM (#32325217)
Sorry I can't help you more, but if I recall correctly it was in a summery at the end of an interview with one of the major players. Likely AMD or TSMC related given Intel/Apple/Qualcomm is more secretive about future products, and I seem to vaguely remember something about ML accelerators and chiplets internal bus bandwidths as some of the subjects. However, as I tend to binge watch the episodes once in awhile, and the set never notably changes much... it is difficult for me to narrow down when the episode was published. Good luck. =)
Re:Parallel Programming for FPGAs by NCC1701DEngage on Tuesday August 02, 2022 @12:46PM (#32321068)
You aware of the AnandTech channel and their podcast?

https://www.youtube.com/channel/UC6Qjj9Jpww3iQarwt8HOcDw

I could give you a list of channels that do similar content to TechTechPotato.

Re:Parallel Programming for FPGAs by uticus on Tuesday August 02, 2022 @09:34AM (#32318266)
> How does one actually program on an FPGA?

Traditional: as others have pointed out, create design in Hardware Description Language (HDL). Simulate / test. Use tool(s) of choice (or usually no choice) to synthesize. Resulting bitstream written to FPGA. Ref https://en.wikipedia.org/wiki/Field-programmable_gate_array#...

Somewhat newer: High-Level Synthesis (as detailed in the OP). Similar to HDL, but more abstracted design. Ref https://en.wikipedia.org/wiki/High-level_synthesis

> Is there some consumer facing equivalent for FPGA programming?

AWS F1 Instances (https://aws.amazon.com/ec2/instance-types/f1/), or dev boards (https://digilent.com/shop/boards-and-components/system-board...)

Re:Parallel Programming for FPGAs by d_tr on Tuesday August 02, 2022 @04:55AM (#32316491)
You use a tool to convert your HDL code (Verilog, VHDL or something else) to a bitstream which then needs to be sent to the FPGA to configure its components. Most of these tools and the bitstream formats are proprietary. So, for Intel you want to download Quartus, and for Xilinx you want Vivado. Both are free but I have only used Vivado, which you only need to buy if you want to use it with very expensive FPGAs. After the bitstream has been generated, you need connect your board to your computer to send the bitstream to it, and the board handles the FPGA's interface to actually program it. As a consumer you can buy bare FPGA chips and make your own board, but for learning and prototyping you probably want to just buy a development board. Digilent has some very nice ones with various peripherals.
Re:Parallel Programming for FPGAs by elsjaako on Tuesday August 02, 2022 @05:16AM (#32316603)
There are places you van rent an fpga, it looks like azure offers this for example.

For programming, you need a language (eg. Verilog, VHDL), a toolchain (most commonly the vendor one), and a target chip on some kind of board, either rented or on your desk.