Forum Discussion
Beginner lost
Hi, my name is Onofre Garrido and I'm currently working for a company called MECWINS. We have developed some prototype devices to test biological parameters. So far since we are on prototype stage we have built our devices around daq cards from N.I,, labview software and dedicated PC to manage all the components. Our last device uses a matlab software running on several pc cores in order to process images.
My current work focus is on exploring the possibility for using fpga's instead of dedicated pc's for instance in our last device. My knowledge about fpga’s is quite limited so now I think I need some support in order to go in the proper direction. I have seen for example that there are several softwares to convert matlab code to vhdl that could be potentially implemented on a fpga, but many doubts come up to my mid. How would be the interface for the fpga to be connected to the external world, for example to open a file in any kind of data format? What kind of fpga do I need for processing images? how to interface with the daq world, for example to receive signals from a PSD ...? May be we need a development card that surround a fpga with kind of peripheral hardware such memory, A/D converters, etc.. I've got a DEO-nano board that I am currently testing in order to get into the fpga world, but I need some support for sure. I know that perhaps this mail is a crazy mix of probably not well digested ideas. Sorry for that. Thank you in advance for your support.i15 Replies
- Altera_Forum
Honored Contributor
You need to know that FPGAs are blank canvases for you to add your own IP in to. They can do everything you describe, but YOU need to provide all of the code, connectivity etc. They are also NOTHING like writing software.
If you have little experience with FPGAs, you are going to struggle with what you describe as they can be fairly advanced projects to generate, debug and integrate and are not going to be turned around quick. So you know what you're getting into. - Altera_Forum
Honored Contributor
Let's simplify the thing. A good way to start would be just reading an image file from an input , make some calculations and just provide a numeric output.
How could I do just this as a starting point? kind regards - Altera_Forum
Honored Contributor
You will need to write a design that contains some form of input, the processing and then output it somewhere.
You do not transfer the data as a file, you transfer it as raw bytes. The FPGA has no knowledge of a file system or files, just pure binary data. - Altera_Forum
Honored Contributor
Ok understood.
Correct me if I am wrong but my assumption was that there should be any kind of card or development board which have already implemented such interface in order to simplify this job and get focused on the core of the question , that in this case is just the calculations required for processing the image.. Am I right??? - Altera_Forum
Honored Contributor
There may be reference designs with some interfaces, and IP cores are available for common ones (ethernet, PCI, PCIe, RS232) from altera that you can import into your design. Then its a case of connecting it all up to your custom logic.
Remember, writing logic for the FPGA is not like software programming. - Altera_Forum
Honored Contributor
And what about a FPGA SoC? would it be easier going on that direction?
thank you so much for your answers. It helps so much.. - Altera_Forum
Honored Contributor
The SoC gives you a hard ARM processor on the chip. You still need to set it up yourself, put an OS on it etc. You can put a processor on a normal FPGA too, but a NIOS core instead of an ARM. Either way, it will still take some set up and configuration by you.
- Altera_Forum
Honored Contributor
Yes , I see your point. My question about the SoC option was in the following reason. Having an already configured ARm processor running for example a Linux OS, the basic functions for accessing files, reading its content are already in place. This way the focus will be on setting up the communication betwen the FPGA and the ARM processor and the calculations on the FPGA. The objective is avoid the aditional work on designing staff like handling files with an FPGA.
Does it make sense??? - Altera_Forum
Honored Contributor
This does make sense, but you can easily just send data to the FPGA from an fpga and send it back to to the PC quite easily without an ARM/another CPU. The easily option is RS232 communication. Other methods are possible. The good thing about a CPU is that communcation is easier to set up, but it takes up a lot of resources just for coms.
- Altera_Forum
Honored Contributor
If you don't have FPGA experience in house, it can be quite a significant cost to build it up / learning curve.
In broad strokes, what you're describing (your background, what you are doing) might be a good fit for OpenCL. https://www.altera.com/products/design-software/embedded-software-developers/opencl/overview.html And your development might go like: cleanup Matlab and translate to OpenCL entirely on PC, figure out what OpenCL functions you want pushed into the FPGA vs. kept in software on the ARM side of your SoC. In general for some of your questions: a) yes, using a SoC with hard ARM with Linux will absolutely make your life easier especially if you are coming from software background. b) anything which is non-realtime related, think about doing it in software and not FPGA. if you aren't doing (continuous) Video processing and are instead only doing (single frame) Image processing, you can limit yourself to just creating "accelerator" IP blocks in the FPGA side of an SoC, where software drives the algorithm and does all the I/O and can easily fill in missing functionality that is outside your reach to develop the FPGA version of. Continuous real-time processing of video, you may need to do all of it in the FPGA with software limited to control activity. c) video in / video out if not on your development kit can often be added with a daughter card. Terasic is one vendor (http://www.terasic.com.tw/cgi-bin/page/archive.pl?language=english&categoryno=65#category68). Sometimes pairing daughter cards with a compatible development kit can be challenging, so before you buy, contact them. You've been mentioning SoC, but also mentioned you have DE0-NANO which isn't an SoC (Cyclone IV, 22KLE, no ARM). There is also the DE0-NANO-SOC aka Atlas-SoC (Cylclone V SoC, Ethernet, etc.). Getting started with a Cyclone IV, I'd recommend doing all your software / I/O on the PC and communicate with your hardware over JTAG using System Console. Getting started with a Cyclone V SoC, you can just get Linux up and running and communicate with your hardware directly on your board.