Topic: Generate Random waveform using FMC150 and Xilink KC705  (Read 15527 times)

varunv123 July 03, 2013, 09:05 PM (#15)

  • Member
  • *
  • Posts: 10
Erik,


Thank you so much for this! It was extremely helpful and I am able to get sine waves now when reading from the ADC at different frequencies, even though it took a while to find the magic numbers that worked.


I have also been trying to split up the .exe file into a init, read and write. The reason is we want to do this is so, for instance, that the read time can be reduced significantly. Ideally we'd like to call the init exe and then call the read exe repeatedly, each time reading from the ADC as quickly. I tried to do this by commenting various sections of the code but I can't get the read to work well, probably because I am ignoring some part of the code that sets up the connection.  I don't close the connection (I don't call sipif_free() at the end of main) in the init exe so ideally the connection to the Xilinx FPGA should still be open (Assuming the windows OS does not close it at the termination of the exe) and the read should work. Do you have any suggestions/ pointers on how I could implement this?

Thanks and regards,

Varun



arnaudNL July 04, 2013, 03:54 AM (#16)

  • 4DSP Staff (EU)
  • Administrator
  • Member
  • *****
  • Posts: 7110
Dear Varun,
I believe opening the hardware will cause a firmware reset, this might be a problem for you, this reset code is in the ethapi. I don't think splitting the executable in two is the right approach. What I would do if I would be you is to modify the reference application so it first do the init and then wait on a key to be pressed in a loop. Each time you press a key, you get samples and this until you press CTRL-C.
Best Regards,
Arnaud
 
 

varunv123 July 12, 2013, 07:59 PM (#17)

  • Member
  • *
  • Posts: 10
Arnaud,

I went with a similar approach to what you suggested so that the executable can now be controlled by an external application and perform repeated reads or writes. I am now trying to optimize the read operation so each read takes around 10-20 milliseconds. I can do this now by setting up the read operation with the sxdx_configurerouter(),fmc150_ctrl_enable_channel(), fmc150_ctrl_arm_dac(), fmc150_ctrl_sw_trigger() functions and then reading every time with the sipif_readdata() function ONLY. However the obvious problem here is that I can only read a certain number of samples total before it sipif_readdata() fails, and seems this number is 2*65536 (probably the size of the ADC FIFO). The reason I think this is so is because when I call sipif_readdata() after this, without calling any of the functions mentioned above that set up the read pipe, the ADC tries to write data out of bounds in its fifo. There must be something in one of the functions that sets up the read that makes sure this doesn't happen, maybe by sending a signal or resting a pointer or something. I tried looking for this but haven't had any luck yet.

Ideally I would like to call sipif_readdata() and then ONLY make the change that prevents this error as apposed to calling all the initializing functions again to make the reads as fast as possible. Do you have any idea where this may be? I hope I have described my problem well enough.

Thank you very much for your help so far and look forward to hearing from you.

Best,

Varun

ebarhorst July 15, 2013, 09:09 AM (#18)

  • 4DSP Staff (EU)
  • Administrator
  • Member
  • *****
  • Posts: 1222
Hi,


you should not setup the system in a way that you can overflow the FIFO. Either read fast enough on the output of the FIFO (not possible with the Ethernet interface) or reduce the burst size to that of the maximum FIFO size.


If this reference design does not suit your application needs you have access to all the sources and you are free to modify the design.


4DSP can deliver a PCIexpress interface  (400 + MB/s data transfer rate) as well as a FIFO design that uses the external DDR3 memory for storing ADC data. Please contact your local sales person if you are interested in these options.


Best regards,
Erik