Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

multithread in c++ for fpga communication

Not open for further replies.


Advanced Member level 1
Feb 27, 2012
Reaction score
Trophy points
Jeonju, South Korea
Activity points
Hi all

I am acquiring data from FPGA using PCIe and I am facing timing problems or problems because of timing while acquiring and
storing data...

Hence I was wondering about to ask if multi-threading is possible in my case... well in first place I know it is possible in
C++, but since I am mostly VHDL or verilog doer, have little or only relevant experience over C++.

What I want is that since thread runs in Parallel, is there any possibility that one thread can read data while other thread can simultaneously
but independently (of course after acquiring from THREAD-1 ) write data to file....

Waiting for expert's replies...

Best regards,

Am I right in thinking that you are collecting data from an FPGA through PCIe onto your PC?
Yes what you are asking is certainly possible but having more than a single thread working on performing a task adds all kinds of timing problems in itself, the two threads need to be synchronized to each other to make sure that you don't end up with a deadlock condition ... It seems odd to me that you are having timing problems on a PC, it should have plenty of power to acquire and store data! Have you tried to make your thread a higher priority so that it gets more of the processors time??


Hi Pheetuz.

Thank you for your reply.
Yes you are right I am doing the same.

And I am having timing problem since my system is scanning and then collecting data, based on constant triggering rate.
Hence before the next trigger I need to empty my buffer inside the FPGA, but because I am reading from FPGA to PC
and then writing to file(.bin format) after 1 trigger...

Hence I get timing misalignment, I have never tried the multiple threads in my program or in any case earlier...
If possible I would like to avoid this thing since as I mentioned in my previous post that I am more on VHDL side,
but have also to do with the C++ which I only do as-per-needed case.

I think I will do some home work and then come back here... ^^


Not open for further replies.

Part and Inventory Search

Welcome to