lainchan / Δ
FPGA hacking
Spooky · 2019-04-17 05:56
I've been looking into FPGAs lately and I'm fascinated with the field in general, but it is a very niche technology. On top of being niche, most of it is covered by NDA...
Are you familiar with any sort of FPGA hacking that is not a simulation of old videogame consoles or ARM processors?
Could it be better than using a microcontroller or microprocessor?
Ein · 2019-04-17 08:11
I mean, FPGAs are only cost-effective low energy and not really that much solution to what graphics cards can already do. The only real uptake is that they already do their computations on pre-defined logic so their speed is much greater.
They have been used in hacking as far as I know only in some low cost solutions to password or encryption cracking, but only as far as DES, anything more it's easier to just pay AWS server with NVIDIA Tesla for an hour.
Seeing how you just combined an empty question by combining words "FPGA" and "hacking" you should probably inform yourself more about either one of those before asking any more questions.
>Could it be better than using a microcontroller or microprocessor?
Better in what way?
It's faster in it's computing speed, but it isn't multipurposed like microcontrollers and microprocessors. It is designed for certain purposes where few operations are already pre-defined.
Basic fundemental difference is that FPGAs use arrays of logic gates to get to their logical and mathematical operations whilst microcontrollers/processors use Arithmetic Logic Unit to make those operations in cycles with registers to store the values.
Meddler · 2019-04-17 08:30
>>2900
I don't think he meant "hacking" in that way.
I've spent 2 semesters in school doing labs with FPGA's but we only did MIPS implementations. Most people were awful at it. But some guy was able to do some interesting stuff using the vga output, making games etc. I always wanted to learn more about them too since I have one laying around but didn't have the time.
Just another Random Lainon · 2019-04-17 13:14
>>2901
>VGA output ,making games
FPGAs are really good at fast to do higher logic operations. I think I even saw CPLD being used in power supply of Tesla Model S when they dissasembled it.
Basically think of any high speed digital logic implementation that isn't THAT hard and you will see the benefits.
Hell, even before the ASIC miners of crypto back in the day (before GPUs) FPGAs were used.
Overall, FPGAs fell out of fashion because sometimes it's just easier to spend half a dollar more per chip on microprocessor.
Sipho Nkosi · 2019-04-17 13:52
>>2901
Op here.
>I don't think he meant "hacking" in that way
I meant it in a broader sense. Sorry that my message wasn't coherent, I was pretty sleep deprived when I made the thread.
There are some real time vga -> colored ascii vga converter on YouTube. Look up "ascii fpga" it should come up. That is one of the things i meant.
Another thing: I am interested if FPGAs could be used for say, monitors, where it would cache everything that resembles SSN or credit card number. All seemlessly done through the fpga embedded into the monitor.
Where could we leverage the FPGA computing speed maliciously?
Spooky · 2019-04-17 19:34
Op here again.
I would call this hacking: https://www.youtube.com/watch?v=C8txvmXUIJQ
One of the things this guy did is reverse engineer the board programmer so he wouldn't have to spend money on a proprietary device. Very fascinating video.
Here is the real-time ascii video thing I mentioned earlier: https://www.youtube.com/watch?v=7PCL33Pk270 doesn't quite fall in the "hacking" category now when I think about it again.
The reason I'm asking here is that most of other communities I find are obsessed with FPGAs strictly in mining sense. Please feel free to point me somewhere else.
Chan Siu Ming · 2019-04-17 20:50
>>2902
>Hell, even before the ASIC miners of crypto back in the day (before GPUs) FPGAs were used.
>Overall, FPGAs fell out of fashion because sometimes it's just easier to spend half a dollar more per chip on microprocessor.
I wouldn't say they're out of fashion, FPGAs are still very relevant. FPGAs are mostly used for prototyping, when your design is not ready to be burned into silicon yet, or for products that need to be flexible. They're also used when quantities are too low to manufacture ASICs.
Arisu Mizuki · 2019-04-26 01:23
I work with embedded systems that often include FPGAs. The big advantage of the FPGAs is not in computation (they are not all that efficient efficient compared to CPUs/GPUs) but in connectivity. These computers are often used to retrofit systems designed in the '80s that use long obsolete protocols that you can't buy dedicated hardware for anymore. It's way cheaper to just throw an FPGA on there with a core that translates whatever neolithic protocols are required to PCIe than to try finding something compatible.
Spooky · 2019-04-26 23:12
>>2918
Very interesting, never thought of this application.
Have you ever ran into older systems using FPGAs? How were they used?
The only common applications I heard about are in cameras and monitors.
Just another Random Lainon · 2019-05-06 22:54
>>2923
I can't think of any but I don't work with the actual old boards very much. A lot of these systems are like the Ship of Theseus where every component is pretending to be something older. The other common use case I see is for security, where the FPGA will monitor a CPU or whatever other component and prevent it from doing anything it's not allowed to do. Generally you want to have the FPGA firmware write protected or inaccessible to make that effective.
Frank Garza · 2019-06-30 00:45
>>2899
Alright OP, gonna give you an actual fuarrrking answer, as likely the only person to have serious experience with them outside of a generic lab requirement in university. A buddy of mine is doing his PhD, and he's monitoring voltage outputs of programs based on the input they receive, and the fluctuations in voltage output allow him to crack into sensitive info. My personal work (grad student) involves implementing a post-quantum cryptographic algorithm from the recent NIST competitions (not revealing which, as I've written a paper on it) and then finding its pros/cons via various methods. The particular algorithm I chose should not be implemented as an industry-standard in the future under any circumstance, although there currently aren't any other papers published on the subject so I won't name it here.
If we're being completely honest, FPGAs are much better suited for research environments at a university or corporate level. For enthusiasts you're better off with an arduino or a rPi.
Also, personal grudge - I hate xilinx boards as well as their IDE. I've always been a fan of the Altera/Intel boards and the Quartus IDE myself, although the recent acquisition of Altera by Intel has not been without its bumps.
Spooky · 2019-07-02 03:59
>>3346
I appreciate a proper answer.
Since I made the post I got quite a bit better with FPGAs and am planning on going into the field. Found a nice community of knowledgeable guys online. Check some posts on reddit/r/fpga and you can find a discord link.
Post-quantum crypto algorithms should be researched more before it's too late.
Koos van der Merwe · 2019-07-04 21:28
>>2903
Could you do the same thing by getting the data out of the video card buffer directly?
Rando · 2019-07-07 00:16
The iCE40 and ECP5 FPGAs have been reverse engineered, and some nice open source tools have been developed for them. Because there exists open source tools for them people have created a lot of prototype boards with them.
Unsigned · 2019-07-09 00:08
FPGAs have applications all over the shop.
Need a high-speed high-precision ADC? The AD7960 is Analog Devices' top chip for that niche but it has a 250MHz serial LVDS interface so you'll need an FPGA to use it.
Need to do lots of math quickly? Use a GPU. Need to do lots of maths quickly and maintain a hard max latency of a few dozen clocks between data going into the chip and coming out? Use an FPGA. There's a reason high-frequency traders hire hardware engineers.
Designing a digital ASIC? You better be validating your logic on an FPGA. The ARM ASIC devkit is just a bundle of FPGAs, and it's still hard to even find a RISC-V chip with an MMU that's baked in silicon.
Bob Arctor · 2019-08-07 01:43
>>3357
Are the FOSS tools any good? I know Xilinx's tools are wretched.
Cowboy · 2019-08-10 05:45
Depending on what microcontroller you're talking about, they are relatively cheap. AVR chips are like a buck or two a pop. FPGAs are not by any means cost effective unless what you need doesn't exist in the real world, is extremely exotic, or just isn't made anymore.
Unknown · 2019-08-17 22:57
>>3410
The icestorm tools are actually surprisingly amazing
Molly Millions · 2019-08-23 20:50
Couldn't FPGAs be used for hardware decoding of videos ? When you want to play a video the GPU loads the appropriate bitstream to decode it, so you can get hardware decoding for all codecs future and past.
Trinity · 2019-08-24 22:29
Unfortunately FPGA env is soykafty soykaf. IDEs are lagging, there isnt any cheap device and on top of that, Xilinx bans on github lotsa code that was developed on its platforms
Lord Nikon · 2019-08-25 11:04
>>3473
In theory yes. The problem is all the FPGAs use incompatible bitstreams even for slightly different models in a product line so you would need a separate bistream for every FPGA you support. What we need is something like SPIR-V for FPGAs and a standard API for loading it.
I thought when Intel bought Altera there was some sort of plan to add a standard FPGA coprocessor to their CPUs but I don't think that ever happened.
There is (or was) also work being done to support something like multithreading on FPGAs which would help a lot for using them as coprocessors. I think this is a copy of the video, the one I had bookmarked seems to have been deleted https://www.youtube.com/watch?v=Pha6g6OaGGU
Spooky · 2019-10-30 01:29
OP is back. I spent last 6 months on learning about FPGAs and everything related. I'm getting there. Let's try to keep this thread alive.
Here is an interesting reverse engineering attempt of an FPGA from a GSYNC monitor:
https://twitter.com/Claude1079/status/1122902285774880769
Spooky · 2019-10-30 01:31
>>3700
Just to be clear, this isn't me. I'm staying the fuaaark away from reverse engineering for now.
Unspecified · 2019-10-31 22:42
>>3479
There is this thing called project icestorm where some guys made an open source toolchain for ice40 fpga's, they might not be all that powerfull but you can get an icestick dev board for like 30 bucks and program it using open source tools straight from the commandline.
XERXES · 2019-11-03 17:02
>>3708
know the guy, in case of any questions ask warsaw hackerspace, q3k if i remember correctly
Tequila · 2020-04-10 07:43
What I can do with FPGAs?
BloodCat · 2020-04-19 15:55
>>4358
Stuff that needs speed. Stuff that requires a very specific piece of digital hardware you can't just buy. Stuff that I guess you could call super crazy parallelization (An fpga can do multiple things at the same time which a conventional processor can't really do).
Examples: Writing to a vga display. Implementing a custom processor.
Image processing.
Ishikura "Tatsu" Tatsuhiko · 2020-04-19 21:15
The XFM2 might be of interest to anyone who's into music production and synthesizers, it's a 6 operator, 64 voice polyphony FM synth running on a Digilent CMOD A7 35T FPGA board. Here's a link for anyone interested:
https://www.futur3soundz.com/
Void · 2020-04-24 08:33
Can I create FPGA that would increase matrix based calculations or it's pointless as there are easily available better solutions?
Molly Millions · 2020-04-24 10:54
>>4410
You can build a gpu in an fpga, so I am pretty sure you could build something that helps with your matrix calculations.
Nell · 2020-04-24 11:20
>>4411
The question was would it make sense not is that doable, as everyone knows it is doable.
Hououin Kyouma · 2020-05-11 21:50
Good thread.
Marly Krushkhova · 2020-05-26 04:30
Has anyone here worked with using a FPGA for audio solutions? I'd like to attempt to develop a guitar foot pedal with some preloaded effects for my dad.
Liet Kynes · 2020-05-29 02:28
>>4412
depends, what data types are you going to work with for your matrix calculations? Because of the limited resources of an FPGA you're best off tailoring the hardware to your application to get the most bang for you buck. Floating-point operations will be expensive to implement, and on the other hand many FPGAs come with dedicated "DSP" blocks that can be used for integer multiplication and addition. And if you're using fixed point (which is probably what you want to make good use of an FPGA), you'll need to think of how you handle data normalization and scaling in your algorithm due to not having an exponent that floating point usually affords you.
Once you have some algorithm figured out, you'll have to design your hardware and get it to meet your timing constraints. I doubt even with the most optimized design you can break 400-500 MHz. You'll then also have to consider how you're going to get your data into the FPGA and out, what the latency is, can you process in larger batches, etc.
If you have a large enough FPGA and have developed a design that sufficiently exploits the parallelism for a fixed-point matrix operation engine, you could get some good speed up so long as your are not I/O bound even if you only reach clocks of 400 MHz. I don't think you could get enough parallelism out of it though if you want to support IEEE doubles or something.
But, maybe you don't need this to be tethered to a PC. Maybe instead you want a compute engine to go an embedded processor for some other application. In this case the FPGA becomes much more attractive because it's offering a bigger advantage than it would if it was paired with a desktop system.
Special Agent Bob · 2020-05-30 06:08
>>4577
If you want some results get a DSP-Board like this http://store.sure-electronics.com/product/AA-AP23122 The Analog Devices "Sigma Studio" graphical programming interface is easy to use. So you can spend time developing the audio effects, not getting data in and out an fpga, messing with audio adc and dac etc.
Nanashi No Gombe · 2020-05-30 19:55
>>4395
>Stuff that needs speed.
How much speed it offers compared to CPU or GPU? Real case scenario please.
Cutter · 2020-05-30 19:59
>>4583
So it does not make sense for desktop but could make sense when paired with for example Cortex-M? Yes, I wrote _Cortex-M_ as it has no floating point. What usage? Hmm, maybe solving some equations needed in mechanics, 3D navigation and time synchronization?
Dox · 2020-05-30 20:01
What is the most Freedom Friendly FPGA environment? Or it's all requiring installing blobs and proprietary soft?
Nemissa · 2020-05-30 23:00
>>4588
I am not talking about processing speed, I am talking about speed in directly working with io. Lets say you wanted to directly interface with hdmi for example. Or any other high speed data protocol.
Netrunner · 2020-05-30 23:03
>>4590
Project icestorm. It might not give you the ability to work with the most powerfull fpga's. But it gives you a great open source toolchain.
fsociety · 2020-05-31 01:25
>>4589
Yeah sure, you could have an array of floating point units that you can feed data into. Best for it to be a streaming kind of data in nature, otherwise you will have to design a control unit to iterate and perhaps dedicate some Block RAM for intermediate results (which is fine, just something to think about).
Shogun · 2020-07-24 17:01
Hi! I would like to know if it might make sense to preprocess images with an (Icestorm) fpga for interference in image recognition. Could I take images from a video stream when something changes beyond a certain treashold? Could I get a image e.g. every 10 frames in b/w and some others with a lower resolution? Would it make sense to do this with an FPGA, when the images then go to a SBC like Jetson Nano with a GPU anyways? Is it much more efficient?
I would also like to compare images, like finding a difference, by checking for color changes in any area.
The other thing is voice alternation, like from espeak or festival, then changing it. Could I develop these changes in a software like Audacity or train a neural network, and then import these changes into a FPGA toolchain?