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

Urukul FTW and attenuator update rate #939

Closed
cjbe opened this issue Mar 2, 2018 · 4 comments
Closed

Urukul FTW and attenuator update rate #939

cjbe opened this issue Mar 2, 2018 · 4 comments

Comments

@cjbe
Copy link
Contributor

cjbe commented Mar 2, 2018

I am surprised at how long it takes to update the attenuator and FTW on Urukul. Using an AD9910 Urukul on Kasli, and running an underflow test experiment (https://hastebin.com/qonukomaku.py), I find that the following brackets in mu (here 1mu=1ns):

freq update: 46875 46878
freq update mu: 8286 8289
att update: 35152 35156
att update mu: 1998 2001

So it takes ~50us to update the FTW if it is provided as a float, or 8us if it is provided in mu. Similarly 35us / 2us to update the attenuator using a float / mu value.

  1. I would expect the compiler to optimise the float cases into the mu cases, as everything is known at compile time.
  2. I am surprised that the frequency update takes ~8us even when the FTW is provided in mu, as the SPI transaction itself only takes ~1.1us - is there any way to speed this up?
@jordens
Copy link
Member

jordens commented Mar 2, 2018

Yes. The compiler sometimes does not fold constants for reasons I don't understand either.
Yes. Raw 64 bit RTIO events tend to be around the 6-10µs mark. Same as the old DDS bus.

#535 #636 #661 #667 and maybe #624

@whitequark
Copy link
Contributor

The compiler sometimes does not fold constants for reasons I don't understand either.

LLVM's IR is not powerful enough to express all invariants that we have, thus sometimes it does not recognize that it can hoist instructions out of loops. This is #655. There is a proper solution (adding metadata on GEP, as described in the linked review.llvm.org page) but it's not trivial.

@jordens
Copy link
Member

jordens commented Mar 8, 2018

You could also shave off one rtio_output(), i.e. one event, by not updating the spi config each time between two writes to the attenuators or the same DDS. But you'd do that in a separate API.

@jordens
Copy link
Member

jordens commented Mar 11, 2018

No new issue here.

@jordens jordens closed this as completed Mar 11, 2018
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

3 participants