9
\$\begingroup\$

I am exploring the idea of using an FPGA for linear algebra. I would like the ability to work on large matrices (> 4 GB). But modern high-end FPGAs have RAM on the order of megabytes.

Please describe how I may either:

  • add external RAM chip
  • access and use RAM of a connected pc

Any other comments or feedback is welcome.

I currently have a Digilent basys2. I am a beginner.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Selection of the type of RAM can affect the performance of your system greatly; choose carefully. \$\endgroup\$ Commented Jan 28, 2013 at 2:53
  • \$\begingroup\$ Given there are only 16 general purpose I/O on that board interfacing to PC style external memory is likely to be a challenge and the only SPI solutions I can think of are much smaller. While performance will be bad for initial learning and experimentation you might be best trying to use the USB port. Looking at the circuit it does seem to have a AT90USB that at least takes care of some of the USB protocol side of things. I'm only an FPGA novice myself to wait to see what answers you get, but I think in general it may be a bit more challenging than it sounds with that board. \$\endgroup\$
    – PeterJ
    Commented Jan 28, 2013 at 4:00
  • 1
    \$\begingroup\$ In general if you are stuck with this board, you are not in a good position to do this project. If you are working with that much data, and speed matters, you want the memory on the same board with the FPGA, probably with a DDR2 or DDR3 interface between them (but I am not an expert on that). If speed doesn't matter, then just solve the problem on a PC, and save yourself the trouble of mucking around with the FPGA. \$\endgroup\$
    – The Photon
    Commented Jan 28, 2013 at 5:00
  • 1
    \$\begingroup\$ Is there any reason you do not use a computer with a very fast graphics card? NVIDIA CUDA or something similar. \$\endgroup\$
    – Kevin Chen
    Commented Jan 28, 2013 at 5:35
  • \$\begingroup\$ @KevinChen I have Nvidia Tesla CUDA cards. I am a research student in highly heterogeneous systems. An FPGA would make for interesting experiments for problems which do not apply well to that architecture. \$\endgroup\$
    – kobrien
    Commented Jan 28, 2013 at 13:59

1 Answer 1

12
\$\begingroup\$

For a variety of reasons, the Digilent Basys2 and the Xilinx Spartan-3E are not going to work for you.

For that amount of RAM, you will need something like DDR2 or DDR3 SDRAM running at a fairly high clock rate. This is not something that you can just solder down onto a prototype PCB. The PCB needs to be designed for interfacing to memory, ideally with the RAM already soldered down onto the PCB. If you have never designed such a circuit, I suggest you get an FPGA board that already has the RAM on it. This is going to be difficult, however, since all of the FPGA boards I saw (in 5 minutes of looking) had much less than 4 GB of RAM.

Next, you need something newer than the Spartan-3/3A/3E. While the S3 is an otherwise good FPGA, the Spartan-6 series has much more to offer you. It has much more internal RAM (but you still need external RAM), a lot more DSP48 blocks, and more logic. But most important, it has a much better SDRAM interface on it than what the Spartan-3 has. And by "much better", I mean "much easier for a beginner to successfully use". The memory controller in the S6 is a hard-IP, which for you means that it is much easier to achieve the strict timing requirements of interfacing to SDRAM.

But controlling DDR2/DDR3 SDRAM is not easy. Xilinx has a tool called the "Memory Interface Generator", which can be found in Core Generator. This will generate the memory interface logic for you, and gives you lots of cool features that will make your life easier.

An alternative to the Spartan-6 would be a Virtex-5 or any of the 7-series parts. All of these have memory interfaces as good or better than the Spartan-6.

This Virtex-7 based board has a socket for two SO-DIMM modules, which could get you past 4 GB of RAM-- but it is super expensive at US$5,000.

I should also mention that if you are doing this because you want to learn about FPGAs and electronics then I support your efforts. But if you think that this is somehow going to be faster than standard PC's then I have bad news for you. For the money, it is hard to beat an Intel i7 based quad-core machine with a reasonable GPU card. Just warning you, in case all you really care about is math speed.

\$\endgroup\$
1
  • \$\begingroup\$ +1 for comment about not beating a modern CPU/GPU for math. There's a reason modern supercomputers are made with those and not FPGAs! \$\endgroup\$
    – Dave Tweed
    Commented Jan 28, 2013 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.