Skip to content

Commit

Permalink
doc: update slides with new API
Browse files Browse the repository at this point in the history
sbourdeauducq committed Jul 1, 2015
1 parent e5e035d commit 984e82b
Showing 2 changed files with 16 additions and 12 deletions.
14 changes: 8 additions & 6 deletions doc/slides/artiq_overview.tex
Original file line number Diff line number Diff line change
@@ -91,18 +91,19 @@

\begin{minted}[frame=leftline]{python}
trigger.sync() # wait for trigger input
start = now() # capture trigger time
start = now_mu() # capture trigger time
for i in range(3):
delay(5*us)
dds.pulse(900*MHz, 7*us) # first pulse 5 µs after trigger
at(start + 1*ms) # re-reference time-line
# re-reference time-line
at(start + seconds_to_mu(1*ms))
dds.pulse(200*MHz, 11*us) # exactly 1 ms after trigger
\end{minted}

\begin{itemize}
\item Written in a subset of Python
\item Executed on a CPU embedded on a FPGA (the \emph{core device})
\item \verb!now(), at(), delay()! describe time-line of an experiment
\item \verb!now_mu(), at_mu(), delay_mu(), delay()! describe time-line of an experiment
\item Exact time is kept in an internal variable
\item That variable only loosely tracks the execution time of CPU instructions
\item The value of that variable is exchanged with the RTIO fabric that
@@ -148,11 +149,12 @@
for i in range(n):
delay(dt) # must round to native cycles

dt_raw = time_to_cycles(dt) # integer number of cycles
dt_raw = seconds_to_mu(dt) # integer number of cycles
f_raw = dds.frequency_to_ftw(f) # integer frequency tuning word

# determine correct phase despite accumulation of rounding errors
phi = n*cycles_to_time(dt_raw)*dds.ftw_to_frequency(f_raw)
# determine correct (to FP precision) phase
# despite accumulation of rounding errors
phi = mu_to_seconds(n*dt_raw)*dds.ftw_to_frequency(f_raw)
\end{minted}

\begin{itemize}
14 changes: 8 additions & 6 deletions doc/slides/taaccs.tex
Original file line number Diff line number Diff line change
@@ -105,18 +105,19 @@

\begin{minted}[frame=leftline]{python}
trigger.sync() # wait for trigger input
start = now() # capture trigger time
start = now_mu() # capture trigger time
for i in range(3):
delay(5*us)
dds.pulse(900*MHz, 7*us) # first pulse 5 µs after trigger
at(start + 1*ms) # re-reference time-line
# re-reference time-line
at_mu(start + seconds_to_mu(1*ms))
dds.pulse(200*MHz, 11*us) # exactly 1 ms after trigger
\end{minted}

\begin{itemize}
\item Written in a subset of Python
\item Executed on a CPU embedded on a FPGA (the \emph{core device})
\item \verb!now(), at(), delay()! describe time-line of an experiment
\item \verb!now_mu(), at_mu(), delay_mu(), delay()! describe time-line of an experiment
\item Exact time is kept in an internal variable
\item That variable only loosely tracks the execution time of CPU instructions
\item The value of that variable is exchanged with the RTIO fabric that
@@ -162,11 +163,12 @@
for i in range(n):
delay(dt) # must round to native cycles

dt_raw = time_to_cycles(dt) # integer number of cycles
dt_raw = seconds_to_mu(dt) # integer number of cycles
f_raw = dds.frequency_to_ftw(f) # integer frequency tuning word

# determine correct phase despite accumulation of rounding errors
phi = n*cycles_to_time(dt_raw)*dds.ftw_to_frequency(f_raw)
# determine correct (to FP precision) phase
# despite accumulation of rounding errors
phi = n*mu_to_seconds(dt_raw)*dds.ftw_to_frequency(f_raw)
\end{minted}

\begin{itemize}

0 comments on commit 984e82b

Please sign in to comment.