tknopp / RedPitayaDAQServer

Advanced DAQ Tools for the RedPitaya (STEMlab 125-14)
https://tknopp.github.io/RedPitayaDAQServer/dev/
Other
37 stars 10 forks source link

Synchronous Slow DAC #14

Closed tknopp closed 4 years ago

tknopp commented 6 years ago

I am splitting this off from #12 which is for the slow ADC.

I have tested the "synchronous" slow DAC code (https://github.com/tknopp/RedPitayaDAQServer/blob/master/src/server/daq_server_scpi.c#L413) and it works more or less. Sometimes everything is fine but sometimes the thread is not fast enough. This happens in particular if data is collected from the host. In that case 3 threads are active (acquisition thread, slowDAC thread and main thread) and this leads to unpredicted timings (The rp has only two cores). I have played around with real-time scheduling but have not reached a satisfying result.

Proposal:

I think we should try moving the slow DAC thread on the FPGA. I will specify it in a way that its not MPI specific:

Questions: Is this design feasible? Is uploading the LUT feasible? We would need to have it dynamically. So maybe we would need to allocate a larger buffer (i.e. 2000 entries) and only use the first N entries of that. This is how the RP image applies an "arbitrary waveform".

jonschumacher commented 6 years ago

Well, this could work. The best way would be to use a LUT in RAM which is accessed from the FPGA via DMA, but this is (quite likely) more work than your proposal. The problem which might arise with your proposal is, that with the current imlementation for getting stuff from the memory via GP bus a value is read every cycle. Therefore the whole sub-LUT has to be loaded at once, which might be too much for the bus.

tknopp commented 4 years ago

this is basically implemented now.