5 ms·
You can't emulate a real FPGA with a microcontroller
by eric__cartman 4y ago
You can't emulate a real FPGA with a microcontroller
- guhidalg 4y agoThat’s true but I think that’s not the only reason. Programming an FPGA isn’t as simple as writing and deploying compiled code, you have to write in a hardware specification language. Actually you can get the same experience with an FPGA if you pay for the FPGA development tools, maybe what you’re asking for is a low cost version of Quartus or similar tools. I would like it if that existed but I fear FPGA makers deliberately want to keep their tooling expensive and hard-to-learn to promote lock-in.
- rowanG077 4y agoYosys and nextpnr exists and work pretty well for a lot of use cases. Only some FPGAs and vendors are supported but the experience is literally light years ahead of vendor tooling.
- marcodiego 4y agoI think it is possible since you could load an sketch that emulates a fpga. Nevertheless it would surely be inconvenient. Probably performance would be sub-par.
- sgtnoodle 4y agoYou can emulate anything on a microcontroller if you're determined enough. It just won't run as fast as you might want. You could certainly use a microcontroller to implement arbitrary digital (or even analog) logic within a circuit. You'll be limited by the CPU speed. The trick is to avoid interrupts, and spin the CPU in a tight poll loop instead. An Arduino Uno's MCU can run an instruction perhaps every 150ns on average. You could implement some simple logic that runs upwards of 1Mhz. If you use a cortex-m CPU, you could do fairly complex logic at several Mhz. That's a silly way to use an MCU, though. You're supposed to use the peripherals to offload enough complexity from the CPU that you have plenty of cycles to implement your application logic in a straightforward, maintainable way.
- duskwuff 4y ago> You can emulate anything on a microcontroller if you're determined enough. It just won't run as fast as you might want. You can absolutely compile Verilog to C using Verilator and run it on a microcontroller. The performance is abysmal, and it completely misses the point of using HDL, but it does work. :) https://www.reddit.com/r/FPGA/comments/r86hod/running_verilated_verilog_on_a_microcontroller/ https://www.reddit.com/r/FPGA/comments/r86hod/running_verila...