Thinkpad + M.2 FPGA board = awesome digital logic development machine

the setup

I replaced the Intel wifi card inside my T480s with this tiny FPGA board. It connects over 1 lane of PCIe and has a couple LEDs and several GPIOs on a miniature connector. This can now turn into almost anything from a co-processor, hardware accelerator to a physical interface for some less common protocol - pretty much anything you can think of.

In these pics I use the thinkpad's internal cable management to tuck the wifi antennas away and route the connector cables outside the case. They can come out neatly next to the lid hinge.

Everything works nicely on Linux: the Xilinx FPGA device is detected by 'lspci' out of the box and the drivers provided work too. Thankfully Lenovo stopped whitelisting wifi cards some time ago otherwise this wouldn't have been possible. The new 4C/8T Intel processor helps a lot when synthesizing an FPGA design. The board has some good clearance between the chip and the laptop lid so I'm planning on sticking a copper shim heatsink on it to keep the device cool during heavier workloads.

The Thinkpad makes the ideal candidate for this sort of setup because of its highly organized interior, good thermals, easily removable lid and robust motherboard design*.

*my heart skipped a beat when I accidentally made contact between two loose connector wires of different voltage levels, and after a small spark, the laptop shutdown. To my unspeakable relief it started again just fine with no damage to any of the components.

Posted Apr 15, 2018, 1:48 PM UTC

5321
chx_ThinkPad 25•

Note to anyone trying similar: the I/O cables, as far as I understand, are optional, you can just use the FPGA as a coprocessor. This is incredibly neat. I didn't know they squeezed an FPGA on a 2230 card. PCIe creates an entire new world here... can the FPGA communicate over PCIe or is that for programming only?

11
PastravMDOPT480s•

The programming is actually done over a regular serial port that's also bundled into M2 connector. The FPGA has the full PCIe lane for application purposes. The demo app it comes with allows you to copy some 4k block of data to and from device over pcie and toggle the leds from your os (linux or windows)

4
chx_ThinkPad 25•

. The demo app it comes with allows you to copy some 4k block of data to and from device over pcie

That's just sick.

4
kitelooper•

Wow, never heard of such a thing! Would it be possible to generate video graphics in the fpga and have then displayed on the screen?

4
PastravMDOPT480s•

It absolutely can, in fact this is one of the methods used to prototype GPUs, before the design is 'immortalized' in silicon. The limitation is the size of the FPGA, but this one is spacious enough to get something basic working I assume.

To get an ideea of what basic means in this context, here's a shining example of a hobbyist 2D GPU implementation on an older and slower FPGA device.

But with this one, you can output the the frames in the OS's framebuffer and make it into an alternative GPU. Would require some serious work on the graphics driver though.

3
kitelooper•

To get an ideea of what basic means in this context, here's a shining example of a hobbyist 2D GPU implementation on an older and slower FPGA device.

That's one of most interesting electronics projects I have ever seen. He goes 'full stack' in the implementation, from system design, MCU and FPGA programming, assembly, etc. to a fully functional game! Really neat, that site is going to favorites straight away!

But with this one, you can output the the frames in the OS's framebuffer and make it into an alternative GPU. Would require some serious work on the graphics driver though.

Yes, that was my thinking as well. Have no idea about the graphics driver but I supposed a lot of documentation already exists there and it shouldn't be too bad given the fact that the FPGA is already connected to the PCIe bus its a big step forward in getting that done

4
dekkshT60p T61 X32 X61 X230T•

Nice is that the only M2 board available, haven't been able to find anything via google.

3
PastravMDOPT480s•

It's amazing in hindsight that nobody bothered

2
blcsm•

Off topic but where did you buy these red port covers? They look really nice

2
PastravMDOPT480s•

After a user previously posted his on reddit I found similar stuff on ebay / amazon. For example.

1
ym_twosixonetwo•

The T480s has got three M.2 connectors, right? So it would be possible to use the SSD, the wifi module and an FPGA board...

1
PastravMDOPT480s•

The thing with this M.2 connector standard is that it allows different notches or keys to be added to it to prevent compatibility mistakes - like sticking an ssd in the wifi-slot and the other way around. The WWAN slot has a 'B' key, the SSD has 'M' while the wifi has 'A' and 'E' keys. So unfortunately compatibility is limited (quick explanation).

3
Darkknight512•

Dang, I was hoping to throw the PicoEVB into a T480 WWAN slot. Oh well, guess I'll have to stick with carrying a Zybo around. I'm writing a 2D graphics accelerator inspired by Andy Brown. I have 1080p output over HDMI working with background, background tiling (not controlled yet, just sequential) and overlay painting. I must say it is very nice working with fast DDR3 over AXI.

2
PastravMDOPT480s•

That's impressive, do you keep your project on github by chance ?

1
Darkknight512•

Yes but not public at the moment. It is an absolute mess, shoot me a PM.

1
ym_twosixonetwo•

Oh, I didn't know that, thanks for the explanation!

1
TotallyNotTheCIANot going to lie I'm a Dell guy but Thinkpads are cool too•

Wow, this is really cool! I have a T440p that I was planning on selling but now I think I might end up keeping it as using it for this.

1
SLK5TPY260 i5-6200u 16GB 256GB WiGiG&WWAN FHD•

Did you by chance check if WLAN slot is wired with 2x PCIe or single PCIe lane?

1
PastravMDOPT480s•

It's impossible to tell from the connector, but according to this post accounting for the PICe lanes of the t470, it might just be two lanes but can't know for sure.

2
SLK5TPY260 i5-6200u 16GB 256GB WiGiG&WWAN FHD•

On T470 it is definitely two-lanes, 200%. Yet nobody checked any 80-series Thinkpad so far. )'=

2
agree-with-you•

I agree, this does not seem possible.

1