multithread in c++ for fpga communication

Status
Not open for further replies.

syedshan

Advanced Member level 1
Joined
Feb 27, 2012
Messages
463
Helped
27
Reputation
54
Reaction score
26
Trophy points
1,308
Location
Jeonju, South Korea
Visit site
Activity points
5,134
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,
Shan
 

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??

Pete
 

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... ^^


Bests,
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…