JuliaComputing / xtrx_julia

XTRX LiteX/LitePCIe based design for Julia Computing
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Automatically set CGEN to 8x samplerate #102

Closed staticfloat closed 1 year ago

staticfloat commented 1 year ago

This automatically sets CGEN to a default value when setting the samplerate of a Tx or Rx stream. Note that although the SoapySDR API makes it seem like the Tx and Rx samplerates are independent, they are rather tightly coupled by the LMS7002M chip. While there is some flexibility in the chip, we are likely never going to make use of a full duplex operation where the samplerates are different, so I have opted to take the simple approach and simplify the codebase to instead hint to the developer (where allowed by the SoapySDR API) that there is actually only a single TSP rate.

With this change we get much more reliably smooth looking transmissions, although as the samplerate increases we still get a bunch of noise and other issues. I suspect improper reference clock tuning may be an issue here, and so further experimentation will have to wait for that to get sorted.

Closes #73

staticfloat commented 1 year ago

For posterity, here are the results of the TRF loopack with this change applied, running at the following samplerates:

5 MHz

trf_loopback_re_5mhz

8 MHz

trf_loopback_re_8mhz

10 MHz

trf_loopback_re_10mhz

20 MHz

trf_loopback_re_20mhz

sjkelly commented 1 year ago

LGTM. Can we go higher than 20MHz? If not what are the limits?

staticfloat commented 1 year ago

We can go higher than 20MHz but performance continues to degrade, get noisier and noisier. We can push the limits once we stabilize our clocking problems I think.