Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapting DAQ Server for SDRLab122-16 #85

Open
tlpurz opened this issue Jun 11, 2024 · 9 comments
Open

Adapting DAQ Server for SDRLab122-16 #85

tlpurz opened this issue Jun 11, 2024 · 9 comments

Comments

@tlpurz
Copy link

tlpurz commented Jun 11, 2024

Hey folks,
I am currently trying to use this on the SDRLab122-16 and it works relatively well with a few changes on Vivado (clocks, 16 bit ADC). The issue I have is that 16 bit values works fine until I reach the 14 bit limit, i.e., I can send numbers up to 8192 (I tested this by just wiring a 16 bit constant to the cic_Compiler), but for numbers above that it wraps around. E.g., sending 12000, it sets the first two bits to "11", yielding a negative number. Is there anything on the FPGA/Vivado or C-Code side that I am overlooking that would be forcing this behavior?

Thanks!

@tknopp
Copy link
Owner

tknopp commented Jun 11, 2024

Independent of the issue, it would be great to get your code into our repo.

@tknopp
Copy link
Owner

tknopp commented Jun 11, 2024

@nHackel: I am not 100% sure anymore, but IIRC we somewhere use the upper two bits somewhere for the enable bit?

@tknopp
Copy link
Owner

tknopp commented Jun 11, 2024

But maybe its just:

if(amplitude < 0 || amplitude >= 8192) {

@jonschumacher
Copy link
Collaborator

First of all I am no completely sure if you are talking about the send or receive side. Send side looks all 16 bit except for the output:
grafik

If it is the receive side (which I guess because you mention the CIC compiler), check the AXI stream block:
grafik

This part could also be relevant:
grafik

Please be also aware of the fact that the decimation can actually get you a higher ENOB than the 16 bit that are available (at least at higher decimations). Switching to 32 bit per channel ist the only feasible option but this would require higher decimations due to the limited bandwidth of the NIC.

@tlpurz
Copy link
Author

tlpurz commented Jun 11, 2024

Hi Tobias and Jonas,
thanks for your quick reply. Here's some additional information:
I am looking at the receiving side, and I'm not too worried about the ADC being the issue (I did adjust the AXI stream block to 16 bit already and it seems to work fine). I confirmed that the issue is elsewhere by plugging a 16 bit constant directly into the cic_compiler in the write_to_ram block, so whatever my ADC does shouldn't matter if I am not mistaken:
image
I saw the sign_extend blocks but bypassed those, however the effect I am getting is exactly the same, that's why I was wondering whether there is some additional sign_extend function or something along those liens buried either deeper on the firmware/Vivado side or somewhere in the C-Code. The specific C-Code line @tknopp was referencing is on the DAC side I believe, so this should not have an effect.
I hope this clarification helps, let me know if you have any additional ideas!

@jonschumacher
Copy link
Collaborator

jonschumacher commented Jun 11, 2024

Did you check the FIR compiler?
grafik
C code looks fine to me.

@tknopp
Copy link
Owner

tknopp commented Jun 12, 2024

Sorry for confusing Send/Receive. Since we handle receive data as 16 bit already, I hope that we can figure this out.
@jonschumacher: Very good input! I share your concern regarding the issue that we might need 32 (or maybe 24?) bit due to decimation. But maybe @tlpurz can start with 16 bit support, which seems to be easier to integrate right now. 32/24 bit support is than a little bit more work but doable. I currently think, 24 bit would be quite nice. The client would then of course handle the conversion to a processing friendly format. But before that, I don't see issues with 24 bit.

@tlpurz
Copy link
Author

tlpurz commented Jun 18, 2024

Hey folks,
Sorry for the late reply, I got sidetracked with other projects. The FIR Compiler was a good find; however, now, the bottom two bits seem to be missing. I think I need to go through more functions and ensure both the timing with the external clock and the bit numbers are right. I will keep you posted!

@nHackel
Copy link
Collaborator

nHackel commented Jun 19, 2024

I vaguely remember having this 2-bit cutoff issue when I implemented the FIR together with @jusack. Have you tried setting the output of the FIR compiler to 18 and then taking the upper 16-bits of each path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants