aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2020-01-15 11:01:24 +0100
committerlaforge <laforge@osmocom.org>2020-01-20 14:33:49 +0000
commita0403d3769d3027639e35874c09808ce5c0ba860 (patch)
tree2cce8edf58ad8fd11864475886b5028d4d0e1570
parente7d835ca8c704f7cd256702a31a15b79824e21a4 (diff)
ta_control: move timing advance code from osmo-bts-trx to common
The timing advance controller that is implemented in loops.c of osmo-bts-trx only works for osmo-bts-trx and not for any of the phy based bts. Lets move the timing advance controller into the common part and make it available for every bts. Also lets add a unit-test. Change-Id: If7ddf74db3abc9b9872abe620a0aeebe3327e70a Related: SYS#4567
-rw-r--r--.gitignore1
-rw-r--r--configure.ac1
-rw-r--r--include/osmo-bts/Makefile.am2
-rw-r--r--include/osmo-bts/phy_link.h1
-rw-r--r--include/osmo-bts/ta_control.h5
-rw-r--r--src/common/Makefile.am2
-rw-r--r--src/common/measurement.c6
-rw-r--r--src/common/ta_control.c55
-rw-r--r--src/osmo-bts-trx/loops.c57
-rw-r--r--src/osmo-bts-trx/loops.h3
-rw-r--r--src/osmo-bts-trx/main.c1
-rw-r--r--src/osmo-bts-trx/scheduler_trx.c6
-rw-r--r--src/osmo-bts-trx/trx_vty.c14
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/ta_control/Makefile.am6
-rw-r--r--tests/ta_control/ta_control_test.c77
-rw-r--r--tests/ta_control/ta_control_test.ok609
-rw-r--r--tests/testsuite.at6
18 files changed, 773 insertions, 81 deletions
diff --git a/.gitignore b/.gitignore
index a4b794ac..7422edb2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,6 +62,7 @@ tests/meas/meas_test
tests/misc/misc_test
tests/handover/handover_test
tests/tx_power/tx_power_test
+tests/ta_control/ta_control_test
tests/testsuite
tests/testsuite.log
diff --git a/configure.ac b/configure.ac
index 1bcd2fe0..55755abd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -382,6 +382,7 @@ AC_OUTPUT(
tests/sysmobts/Makefile
tests/misc/Makefile
tests/handover/Makefile
+ tests/ta_control/Makefile
tests/tx_power/Makefile
tests/power/Makefile
tests/meas/Makefile
diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am
index a15ce3d2..668db325 100644
--- a/include/osmo-bts/Makefile.am
+++ b/include/osmo-bts/Makefile.am
@@ -2,4 +2,4 @@ noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h gsm_data_shared.h logging.h
oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \
handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \
power_control.h scheduler.h scheduler_backend.h phy_link.h \
- dtx_dl_amr_fsm.h
+ dtx_dl_amr_fsm.h ta_control.h
diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h
index b2e7c0e2..69c6bd6a 100644
--- a/include/osmo-bts/phy_link.h
+++ b/include/osmo-bts/phy_link.h
@@ -44,7 +44,6 @@ struct phy_link {
uint16_t base_port_local;
uint16_t base_port_remote;
struct osmo_fd trx_ofd_clk;
- bool trx_ta_loop;
uint32_t clock_advance;
uint32_t rts_advance;
bool use_legacy_setbsic;
diff --git a/include/osmo-bts/ta_control.h b/include/osmo-bts/ta_control.h
new file mode 100644
index 00000000..168f14a7
--- /dev/null
+++ b/include/osmo-bts/ta_control.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#include <osmo-bts/gsm_data.h>
+
+void lchan_ms_ta_ctrl(struct gsm_lchan *lchan);
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index 113ff2f4..0a10abf7 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -12,6 +12,6 @@ libbts_a_SOURCES = gsm_data_shared.c sysinfo.c logging.c abis.c oml.c bts.c \
load_indication.c pcu_sock.c handover.c msg_utils.c \
tx_power.c bts_ctrl_commands.c bts_ctrl_lookup.c \
l1sap.c cbch.c power_control.c main.c phy_link.c \
- dtx_dl_amr_fsm.c scheduler_mframe.c
+ dtx_dl_amr_fsm.c scheduler_mframe.c ta_control.c
libl1sched_a_SOURCES = scheduler.c
diff --git a/src/common/measurement.c b/src/common/measurement.c
index 3e0daf19..ddc17474 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -10,6 +10,7 @@
#include <osmo-bts/measurement.h>
#include <osmo-bts/scheduler.h>
#include <osmo-bts/rsl.h>
+#include <osmo-bts/ta_control.h>
/* Tables as per TS 45.008 Section 8.3 */
static const uint8_t ts45008_83_tch_f[] = { 52, 53, 54, 55, 56, 57, 58, 59 };
@@ -696,6 +697,11 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
lchan_meas_compute_extended(lchan);
+ /* Compute new ta_req value. This has to be done here since the value
+ * in lchan->meas.num_ul_meas together with lchan->meas.ms_toa256
+ * is needed for the computation. */
+ lchan_ms_ta_ctrl(lchan);
+
lchan->meas.num_ul_meas = 0;
/* return 1 to indicate that the computation has been done and the next
diff --git a/src/common/ta_control.c b/src/common/ta_control.c
new file mode 100644
index 00000000..2ccc41a8
--- /dev/null
+++ b/src/common/ta_control.c
@@ -0,0 +1,55 @@
+/* Loop control for Timing Advance */
+
+/* (C) 2013 by Andreas Eversberg <jolly@eversberg.eu>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <osmo-bts/gsm_data.h>
+#include <osmo-bts/logging.h>
+
+/* 90% of one bit duration in 1/256 symbols: 256*0.9 */
+#define TOA256_9OPERCENT 230
+
+/* rqd_ta value range */
+#define TOA_MIN 0
+#define TOA_MAX 63
+
+void lchan_ms_ta_ctrl(struct gsm_lchan *lchan)
+{
+ int16_t toa256 = lchan->meas.ms_toa256;
+
+ /* Do not perform any computation when the amount of measurement
+ * results is too little. */
+ if (lchan->meas.num_ul_meas < 4)
+ return;
+
+ if (toa256 < -TOA256_9OPERCENT && lchan->rqd_ta > TOA_MIN) {
+ LOGPLCHAN(lchan, DLOOP, LOGL_INFO,
+ "TOA is too early (%d), now lowering TA from %d to %d\n",
+ toa256, lchan->rqd_ta, lchan->rqd_ta - 1);
+ lchan->rqd_ta--;
+ } else if (toa256 > TOA256_9OPERCENT && lchan->rqd_ta < TOA_MAX) {
+ LOGPLCHAN(lchan, DLOOP, LOGL_INFO,
+ "TOA is too late (%d), now raising TA from %d to %d\n",
+ toa256, lchan->rqd_ta, lchan->rqd_ta + 1);
+ lchan->rqd_ta++;
+ } else
+ LOGPLCHAN(lchan, DLOOP, LOGL_DEBUG,
+ "TOA is correct (%d), keeping current TA of %d\n",
+ toa256, lchan->rqd_ta);
+}
diff --git a/src/osmo-bts-trx/loops.c b/src/osmo-bts-trx/loops.c
index eb25f64e..823c2d7d 100644
--- a/src/osmo-bts-trx/loops.c
+++ b/src/osmo-bts-trx/loops.c
@@ -35,63 +35,6 @@
#include "l1_if.h"
#include "loops.h"
-/*
- * Timing Advance loop
- */
-
-/* 90% of one bit duration in 1/256 symbols: 256*0.9 */
-#define TOA256_9OPERCENT 230
-
-void ta_val(struct gsm_lchan *lchan, struct l1sched_chan_state *chan_state, int16_t toa256)
-{
- /* check if the current L1 header acks to the current ordered TA */
- if (lchan->meas.l1_info[1] != lchan->rqd_ta)
- return;
-
- /* sum measurement */
- chan_state->meas.toa256_sum += toa256;
- if (++(chan_state->meas.toa_num) < 16)
- return;
-
- /* complete set */
- toa256 = chan_state->meas.toa256_sum / chan_state->meas.toa_num;
-
- /* check for change of TOA */
- if (toa256 < -TOA256_9OPERCENT && lchan->rqd_ta > 0) {
- LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "TOA is too early (%d), now lowering TA from %d to %d\n",
- toa256, lchan->rqd_ta, lchan->rqd_ta - 1);
- lchan->rqd_ta--;
- } else if (toa256 > TOA256_9OPERCENT && lchan->rqd_ta < 63) {
- LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "TOA is too late (%d), now raising TA from %d to %d\n",
- toa256, lchan->rqd_ta, lchan->rqd_ta + 1);
- lchan->rqd_ta++;
- } else
- LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "TOA is correct (%d), keeping current TA of %d\n",
- toa256, lchan->rqd_ta);
-
- chan_state->meas.toa_num = 0;
- chan_state->meas.toa256_sum = 0;
-}
-
-/*! Process a SACCH event as input to the MS power control and TA loop. Function
- * is called once every uplink SACCH block is received.
- * \param l1t L1 TRX instance on which we operate
- * \param chan_nr RSL channel number on which we operate
- * \param chan_state L1 scheduler channel state of the channel on which we operate
- * \param[in] rssi Receive Signal Strength Indication
- * \param[in] toa256 Time of Arrival in 1/256 symbol periods */
-void trx_loop_sacch_input(struct l1sched_trx *l1t, uint8_t chan_nr,
- struct l1sched_chan_state *chan_state, int16_t toa256)
-{
- struct gsm_lchan *lchan = &l1t->trx->ts[L1SAP_CHAN2TS(chan_nr)]
- .lchan[l1sap_chan2ss(chan_nr)];
- struct phy_instance *pinst = trx_phy_instance(l1t->trx);
-
- /* if TA loop is enabled, handle it */
- if (pinst->phy_link->u.osmotrx.trx_ta_loop)
- ta_val(lchan, chan_state, toa256);
-}
-
void trx_loop_amr_input(struct l1sched_trx *l1t, uint8_t chan_nr,
struct l1sched_chan_state *chan_state,
int n_errors, int n_bits_total)
diff --git a/src/osmo-bts-trx/loops.h b/src/osmo-bts-trx/loops.h
index bc87860f..13849603 100644
--- a/src/osmo-bts-trx/loops.h
+++ b/src/osmo-bts-trx/loops.h
@@ -11,9 +11,6 @@
* loops api
*/
-void trx_loop_sacch_input(struct l1sched_trx *l1t, uint8_t chan_nr,
- struct l1sched_chan_state *chan_state, int16_t toa);
-
void trx_loop_amr_input(struct l1sched_trx *l1t, uint8_t chan_nr,
struct l1sched_chan_state *chan_state,
int n_errors, int n_bits_total);
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index 00280ceb..6671243f 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -135,7 +135,6 @@ void bts_model_phy_link_set_defaults(struct phy_link *plink)
plink->u.osmotrx.base_port_remote = 5700;
plink->u.osmotrx.clock_advance = 20;
plink->u.osmotrx.rts_advance = 5;
- plink->u.osmotrx.trx_ta_loop = true;
/* attempt use newest TRXD version by default: */
plink->u.osmotrx.trxd_hdr_ver_max = TRX_DATA_FORMAT_VER;
}
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 2785d097..20d502f0 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -954,12 +954,6 @@ int rx_data_fn(struct l1sched_trx *l1t, enum trx_chan_type chan,
} else
memset(burst, 0, 58 * 2);
- /* send burst information to loops process */
- if (L1SAP_IS_LINK_SACCH(trx_chan_desc[chan].link_id)) {
- trx_loop_sacch_input(l1t, trx_chan_desc[chan].chan_nr | bi->tn,
- chan_state, bi->toa256);
- }
-
/* wait until complete set of bursts */
if (bid != 3)
return 0;
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index 5c5e477c..9c67a7f0 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -181,23 +181,19 @@ DEFUN_DEPRECATED(cfg_phy_no_ms_power_loop, cfg_phy_no_ms_power_loop_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_phy_timing_advance_loop, cfg_phy_timing_advance_loop_cmd,
+DEFUN_DEPRECATED(cfg_phy_timing_advance_loop, cfg_phy_timing_advance_loop_cmd,
"osmotrx timing-advance-loop", OSMOTRX_STR
"Enable timing advance control loop\n")
{
- struct phy_link *plink = vty->index;
-
- plink->u.osmotrx.trx_ta_loop = true;
+ vty_out (vty, "'osmotrx timing-advance-loop' is deprecated, ta control is now active by default%s", VTY_NEWLINE);
return CMD_SUCCESS;
}
-DEFUN(cfg_phy_no_timing_advance_loop, cfg_phy_no_timing_advance_loop_cmd,
+DEFUN_DEPRECATED(cfg_phy_no_timing_advance_loop, cfg_phy_no_timing_advance_loop_cmd,
"no osmotrx timing-advance-loop",
NO_STR OSMOTRX_STR "Disable timing advance control loop\n")
{
- struct phy_link *plink = vty->index;
-
- plink->u.osmotrx.trx_ta_loop = false;
+ vty_out (vty, "'no osmotrx timing-advance-loop' is deprecated, ta control is now active by default%s", VTY_NEWLINE);
return CMD_SUCCESS;
}
@@ -522,8 +518,6 @@ void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink)
vty_out(vty, " osmotrx ip remote %s%s",
plink->u.osmotrx.remote_ip, VTY_NEWLINE);
- vty_out(vty, " %sosmotrx timing-advance-loop%s", (plink->u.osmotrx.trx_ta_loop) ? "" : "no ", VTY_NEWLINE);
-
if (plink->u.osmotrx.base_port_local)
vty_out(vty, " osmotrx base-port local %"PRIu16"%s",
plink->u.osmotrx.base_port_local, VTY_NEWLINE);
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1eb28d6f..57687eef 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = paging cipher agch misc handover tx_power power meas
+SUBDIRS = paging cipher agch misc handover tx_power power meas ta_control
if ENABLE_SYSMOBTS
SUBDIRS += sysmobts
diff --git a/tests/ta_control/Makefile.am b/tests/ta_control/Makefile.am
new file mode 100644
index 00000000..4c89dd29
--- /dev/null
+++ b/tests/ta_control/Makefile.am
@@ -0,0 +1,6 @@
+AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
+AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS)
+LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS)
+noinst_PROGRAMS = ta_control_test
+EXTRA_DIST = ta_control_test.ok
+ta_control_test_LDADD = $(top_builddir)/src/common/libbts.a $(LDADD)
diff --git a/tests/ta_control/ta_control_test.c b/tests/ta_control/ta_control_test.c
new file mode 100644
index 00000000..2e981b38
--- /dev/null
+++ b/tests/ta_control/ta_control_test.c
@@ -0,0 +1,77 @@
+/* Test cases for tx_control.c Timing Advance Computation */
+
+/* (C) 2016 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
+ * All Rights Reserved
+ *
+ * Author: Philipp Maier
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdint.h>
+
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/application.h>
+#include <osmo-bts/logging.h>
+#include <osmo-bts/gsm_data.h>
+#include <osmo-bts/ta_control.h>
+
+void lchan_ms_ta_ctrl_test(int16_t toa256_start, unsigned int steps)
+{
+ struct gsm_lchan lchan = { };
+ unsigned int i;
+ uint8_t rqd_ta_after;
+ uint8_t rqd_ta_before;
+ int16_t toa256 = toa256_start;
+
+ /* Arbitrary value, high enough so that a computation can happen. */
+ lchan.meas.num_ul_meas = 10;
+
+ printf("toa256_start = %u / 256 = %u, steps = %u\n", toa256_start,
+ toa256_start / 256, steps);
+
+ for (i = 0; i < steps; i++) {
+ printf("Step #%u\n", i);
+ printf(" lchan.rqd_ta (before) = %u\n", lchan.rqd_ta);
+ printf(" toa256 (before) = %u / 256 = %u\n", toa256,
+ toa256 / 256);
+
+ rqd_ta_before = lchan.rqd_ta;
+
+ lchan.meas.ms_toa256 = toa256;
+ lchan_ms_ta_ctrl(&lchan);
+
+ rqd_ta_after = lchan.rqd_ta;
+ toa256 -= (rqd_ta_after - rqd_ta_before) * 256;
+
+ printf(" lchan.rqd_ta (after) = %u\n", lchan.rqd_ta);
+ printf(" toa256 (after) = %u / 256 = %u\n", toa256,
+ toa256 / 256);
+ }
+
+ printf("Done.\n");
+ printf("\n");
+}
+
+int main(int argc, char **argv)
+{
+ void *tall_bts_ctx;
+
+ tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
+ osmo_init_logging2(tall_bts_ctx, &bts_log_info);
+
+ lchan_ms_ta_ctrl_test(16 * 256, 20);
+ lchan_ms_ta_ctrl_test(4000, 50);
+ lchan_ms_ta_ctrl_test(12345, 50);
+}
diff --git a/tests/ta_control/ta_control_test.ok b/tests/ta_control/ta_control_test.ok
new file mode 100644
index 00000000..8ebe5d54
--- /dev/null
+++ b/tests/ta_control/ta_control_test.ok
@@ -0,0 +1,609 @@
+toa256_start = 4096 / 256 = 16, steps = 20
+Step #0
+ lchan.rqd_ta (before) = 0
+ toa256 (before) = 4096 / 256 = 16
+ lchan.rqd_ta (after) = 1
+ toa256 (after) = 3840 / 256 = 15
+Step #1
+ lchan.rqd_ta (before) = 1
+ toa256 (before) = 3840 / 256 = 15
+ lchan.rqd_ta (after) = 2
+ toa256 (after) = 3584 / 256 = 14
+Step #2
+ lchan.rqd_ta (before) = 2
+ toa256 (before) = 3584 / 256 = 14
+ lchan.rqd_ta (after) = 3
+ toa256 (after) = 3328 / 256 = 13
+Step #3
+ lchan.rqd_ta (before) = 3
+ toa256 (before) = 3328 / 256 = 13
+ lchan.rqd_ta (after) = 4
+ toa256 (after) = 3072 / 256 = 12
+Step #4
+ lchan.rqd_ta (before) = 4
+ toa256 (before) = 3072 / 256 = 12
+ lchan.rqd_ta (after) = 5
+ toa256 (after) = 2816 / 256 = 11
+Step #5
+ lchan.rqd_ta (before) = 5
+ toa256 (before) = 2816 / 256 = 11
+ lchan.rqd_ta (after) = 6
+ toa256 (after) = 2560 / 256 = 10
+Step #6
+ lchan.rqd_ta (before) = 6
+ toa256 (before) = 2560 / 256 = 10
+ lchan.rqd_ta (after) = 7
+ toa256 (after) = 2304 / 256 = 9
+Step #7
+ lchan.rqd_ta (before) = 7
+ toa256 (before) = 2304 / 256 = 9
+ lchan.rqd_ta (after) = 8
+ toa256 (after) = 2048 / 256 = 8
+Step #8
+ lchan.rqd_ta (before) = 8
+ toa256 (before) = 2048 / 256 = 8
+ lchan.rqd_ta (after) = 9
+ toa256 (after) = 1792 / 256 = 7
+Step #9
+ lchan.rqd_ta (before) = 9
+ toa256 (before) = 1792 / 256 = 7
+ lchan.rqd_ta (after) = 10
+ toa256 (after) = 1536 / 256 = 6
+Step #10
+ lchan.rqd_ta (before) = 10
+ toa256 (before) = 1536 / 256 = 6
+ lchan.rqd_ta (after) = 11
+ toa256 (after) = 1280 / 256 = 5
+Step #11
+ lchan.rqd_ta (before) = 11
+ toa256 (before) = 1280 / 256 = 5
+ lchan.rqd_ta (after) = 12
+ toa256 (after) = 1024 / 256 = 4
+Step #12
+ lchan.rqd_ta (before) = 12
+ toa256 (before) = 1024 / 256 = 4
+ lchan.rqd_ta (after) = 13
+ toa256 (after) = 768 / 256 = 3
+Step #13
+ lchan.rqd_ta (before) = 13
+ toa256 (before) = 768 / 256 = 3
+ lchan.rqd_ta (after) = 14
+ toa256 (after) = 512 / 256 = 2
+Step #14
+ lchan.rqd_ta (before) = 14
+ toa256 (before) = 512 / 256 = 2
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 256 / 256 = 1
+Step #15
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 256 / 256 = 1
+ lchan.rqd_ta (after) = 16
+ toa256 (after) = 0 / 256 = 0
+Step #16
+ lchan.rqd_ta (before) = 16
+ toa256 (before) = 0 / 256 = 0
+ lchan.rqd_ta (after) = 16
+ toa256 (after) = 0 / 256 = 0
+Step #17
+ lchan.rqd_ta (before) = 16
+ toa256 (before) = 0 / 256 = 0
+ lchan.rqd_ta (after) = 16
+ toa256 (after) = 0 / 256 = 0
+Step #18
+ lchan.rqd_ta (before) = 16
+ toa256 (before) = 0 / 256 = 0
+ lchan.rqd_ta (after) = 16
+ toa256 (after) = 0 / 256 = 0
+Step #19
+ lchan.rqd_ta (before) = 16
+ toa256 (before) = 0 / 256 = 0
+ lchan.rqd_ta (after) = 16
+ toa256 (after) = 0 / 256 = 0
+Done.
+
+toa256_start = 4000 / 256 = 15, steps = 50
+Step #0
+ lchan.rqd_ta (before) = 0
+ toa256 (before) = 4000 / 256 = 15
+ lchan.rqd_ta (after) = 1
+ toa256 (after) = 3744 / 256 = 14
+Step #1
+ lchan.rqd_ta (before) = 1
+ toa256 (before) = 3744 / 256 = 14
+ lchan.rqd_ta (after) = 2
+ toa256 (after) = 3488 / 256 = 13
+Step #2
+ lchan.rqd_ta (before) = 2
+ toa256 (before) = 3488 / 256 = 13
+ lchan.rqd_ta (after) = 3
+ toa256 (after) = 3232 / 256 = 12
+Step #3
+ lchan.rqd_ta (before) = 3
+ toa256 (before) = 3232 / 256 = 12
+ lchan.rqd_ta (after) = 4
+ toa256 (after) = 2976 / 256 = 11
+Step #4
+ lchan.rqd_ta (before) = 4
+ toa256 (before) = 2976 / 256 = 11
+ lchan.rqd_ta (after) = 5
+ toa256 (after) = 2720 / 256 = 10
+Step #5
+ lchan.rqd_ta (before) = 5
+ toa256 (before) = 2720 / 256 = 10
+ lchan.rqd_ta (after) = 6
+ toa256 (after) = 2464 / 256 = 9
+Step #6
+ lchan.rqd_ta (before) = 6
+ toa256 (before) = 2464 / 256 = 9
+ lchan.rqd_ta (after) = 7
+ toa256 (after) = 2208 / 256 = 8
+Step #7
+ lchan.rqd_ta (before) = 7
+ toa256 (before) = 2208 / 256 = 8
+ lchan.rqd_ta (after) = 8
+ toa256 (after) = 1952 / 256 = 7
+Step #8
+ lchan.rqd_ta (before) = 8
+ toa256 (before) = 1952 / 256 = 7
+ lchan.rqd_ta (after) = 9
+ toa256 (after) = 1696 / 256 = 6
+Step #9
+ lchan.rqd_ta (before) = 9
+ toa256 (before) = 1696 / 256 = 6
+ lchan.rqd_ta (after) = 10
+ toa256 (after) = 1440 / 256 = 5
+Step #10
+ lchan.rqd_ta (before) = 10
+ toa256 (before) = 1440 / 256 = 5
+ lchan.rqd_ta (after) = 11
+ toa256 (after) = 1184 / 256 = 4
+Step #11
+ lchan.rqd_ta (before) = 11
+ toa256 (before) = 1184 / 256 = 4
+ lchan.rqd_ta (after) = 12
+ toa256 (after) = 928 / 256 = 3
+Step #12
+ lchan.rqd_ta (before) = 12
+ toa256 (before) = 928 / 256 = 3
+ lchan.rqd_ta (after) = 13
+ toa256 (after) = 672 / 256 = 2
+Step #13
+ lchan.rqd_ta (before) = 13
+ toa256 (before) = 672 / 256 = 2
+ lchan.rqd_ta (after) = 14
+ toa256 (after) = 416 / 256 = 1
+Step #14
+ lchan.rqd_ta (before) = 14
+ toa256 (before) = 416 / 256 = 1
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #15
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #16
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #17
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #18
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #19
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #20
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #21
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #22
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #23
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #24
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #25
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #26
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #27
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #28
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #29
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #30
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #31
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #32
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #33
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #34
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #35
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #36
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #37
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #38
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #39
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #40
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #41
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #42
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #43
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #44
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #45
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #46
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #47
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #48
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #49
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Done.
+
+toa256_start = 12345 / 256 = 48, steps = 50
+Step #0
+ lchan.rqd_ta (before) = 0
+ toa256 (before) = 12345 / 256 = 48
+ lchan.rqd_ta (after) = 1
+ toa256 (after) = 12089 / 256 = 47
+Step #1
+ lchan.rqd_ta (before) = 1
+ toa256 (before) = 12089 / 256 = 47
+ lchan.rqd_ta (after) = 2
+ toa256 (after) = 11833 / 256 = 46
+Step #2
+ lchan.rqd_ta (before) = 2
+ toa256 (before) = 11833 / 256 = 46
+ lchan.rqd_ta (after) = 3
+ toa256 (after) = 11577 / 256 = 45
+Step #3
+ lchan.rqd_ta (before) = 3
+ toa256 (before) = 11577 / 256 = 45
+ lchan.rqd_ta (after) = 4
+ toa256 (after) = 11321 / 256 = 44
+Step #4
+ lchan.rqd_ta (before) = 4
+ toa256 (before) = 11321 / 256 = 44
+ lchan.rqd_ta (after) = 5
+ toa256 (after) = 11065 / 256 = 43
+Step #5
+ lchan.rqd_ta (before) = 5
+ toa256 (before) = 11065 / 256 = 43
+ lchan.rqd_ta (after) = 6
+ toa256 (after) = 10809 / 256 = 42
+Step #6
+ lchan.rqd_ta (before) = 6
+ toa256 (before) = 10809 / 256 = 42
+ lchan.rqd_ta (after) = 7
+ toa256 (after) = 10553 / 256 = 41
+Step #7
+ lchan.rqd_ta (before) = 7
+ toa256 (before) = 10553 / 256 = 41
+ lchan.rqd_ta (after) = 8
+ toa256 (after) = 10297 / 256 = 40
+Step #8
+ lchan.rqd_ta (before) = 8
+ toa256 (before) = 10297 / 256 = 40
+ lchan.rqd_ta (after) = 9
+ toa256 (after) = 10041 / 256 = 39
+Step #9
+ lchan.rqd_ta (before) = 9
+ toa256 (before) = 10041 / 256 = 39
+ lchan.rqd_ta (after) = 10
+ toa256 (after) = 9785 / 256 = 38
+Step #10
+ lchan.rqd_ta (before) = 10
+ toa256 (before) = 9785 / 256 = 38
+ lchan.rqd_ta (after) = 11
+ toa256 (after) = 9529 / 256 = 37
+Step #11
+ lchan.rqd_ta (before) = 11
+ toa256 (before) = 9529 / 256 = 37
+ lchan.rqd_ta (after) = 12
+ toa256 (after) = 9273 / 256 = 36
+Step #12
+ lchan.rqd_ta (before) = 12
+ toa256 (before) = 9273 / 256 = 36
+ lchan.rqd_ta (after) = 13
+ toa256 (after) = 9017 / 256 = 35
+Step #13
+ lchan.rqd_ta (before) = 13
+ toa256 (before) = 9017 / 256 = 35
+ lchan.rqd_ta (after) = 14
+ toa256 (after) = 8761 / 256 = 34
+Step #14
+ lchan.rqd_ta (before) = 14
+ toa256 (before) = 8761 / 256 = 34
+ lchan.rqd_ta (after) = 15
+ toa256 (after) = 8505 / 256 = 33
+Step #15
+ lchan.rqd_ta (before) = 15
+ toa256 (before) = 8505 / 256 = 33
+ lchan.rqd_ta (after) = 16
+ toa256 (after) = 8249 / 256 = 32
+Step #16
+ lchan.rqd_ta (before) = 16
+ toa256 (before) = 8249 / 256 = 32
+ lchan.rqd_ta (after) = 17
+ toa256 (after) = 7993 / 256 = 31
+Step #17
+ lchan.rqd_ta (before) = 17
+ toa256 (before) = 7993 / 256 = 31
+ lchan.rqd_ta (after) = 18
+ toa256 (after) = 7737 / 256 = 30
+Step #18
+ lchan.rqd_ta (before) = 18
+ toa256 (before) = 7737 / 256 = 30
+ lchan.rqd_ta (after) = 19
+ toa256 (after) = 7481 / 256 = 29
+Step #19
+ lchan.rqd_ta (before) = 19
+ toa256 (before) = 7481 / 256 = 29
+ lchan.rqd_ta (after) = 20
+ toa256 (after) = 7225 / 256 = 28
+Step #20
+ lchan.rqd_ta (before) = 20
+ toa256 (before) = 7225 / 256 = 28
+ lchan.rqd_ta (after) = 21
+ toa256 (after) = 6969 / 256 = 27
+Step #21
+ lchan.rqd_ta (before) = 21
+ toa256 (before) = 6969 / 256 = 27
+ lchan.rqd_ta (after) = 22
+ toa256 (after) = 6713 / 256 = 26
+Step #22
+ lchan.rqd_ta (before) = 22
+ toa256 (before) = 6713 / 256 = 26
+ lchan.rqd_ta (after) = 23
+ toa256 (after) = 6457 / 256 = 25
+Step #23
+ lchan.rqd_ta (before) = 23
+ toa256 (before) = 6457 / 256 = 25
+ lchan.rqd_ta (after) = 24
+ toa256 (after) = 6201 / 256 = 24
+Step #24
+ lchan.rqd_ta (before) = 24
+ toa256 (before) = 6201 / 256 = 24
+ lchan.rqd_ta (after) = 25
+ toa256 (after) = 5945 / 256 = 23
+Step #25
+ lchan.rqd_ta (before) = 25
+ toa256 (before) = 5945 / 256 = 23
+ lchan.rqd_ta (after) = 26
+ toa256 (after) = 5689 / 256 = 22
+Step #26
+ lchan.rqd_ta (before) = 26
+ toa256 (before) = 5689 / 256 = 22
+ lchan.rqd_ta (after) = 27
+ toa256 (after) = 5433 / 256 = 21
+Step #27
+ lchan.rqd_ta (before) = 27
+ toa256 (before) = 5433 / 256 = 21
+ lchan.rqd_ta (after) = 28
+ toa256 (after) = 5177 / 256 = 20
+Step #28
+ lchan.rqd_ta (before) = 28
+ toa256 (before) = 5177 / 256 = 20
+ lchan.rqd_ta (after) = 29
+ toa256 (after) = 4921 / 256 = 19
+Step #29
+ lchan.rqd_ta (before) = 29
+ toa256 (before) = 4921 / 256 = 19
+ lchan.rqd_ta (after) = 30
+ toa256 (after) = 4665 / 256 = 18
+Step #30
+ lchan.rqd_ta (before) = 30
+ toa256 (before) = 4665 / 256 = 18
+ lchan.rqd_ta (after) = 31
+ toa256 (after) = 4409 / 256 = 17
+Step #31
+ lchan.rqd_ta (before) = 31
+ toa256 (before) = 4409 / 256 = 17
+ lchan.rqd_ta (after) = 32
+ toa256 (after) = 4153 / 256 = 16
+Step #32
+ lchan.rqd_ta (before) = 32
+ toa256 (before) = 4153 / 256 = 16
+ lchan.rqd_ta (after) = 33
+ toa256 (after) = 3897 / 256 = 15
+Step #33
+ lchan.rqd_ta (before) = 33
+ toa256 (before) = 3897 / 256 = 15
+ lchan.rqd_ta (after) = 34
+ toa256 (after) = 3641 / 256 = 14
+Step #34
+ lchan.rqd_ta (before) = 34
+ toa256 (before) = 3641 / 256 = 14
+ lchan.rqd_ta (after) = 35
+ toa256 (after) = 3385 / 256 = 13
+Step #35
+ lchan.rqd_ta (before) = 35
+ toa256 (before) = 3385 / 256 = 13
+ lchan.rqd_ta (after) = 36
+ toa256 (after) = 3129 / 256 = 12
+Step #36
+ lchan.rqd_ta (before) = 36
+ toa256 (before) = 3129 / 256 = 12
+ lchan.rqd_ta (after) = 37
+ toa256 (after) = 2873 / 256 = 11
+Step #37
+ lchan.rqd_ta (before) = 37
+ toa256 (before) = 2873 / 256 = 11
+ lchan.rqd_ta (after) = 38
+ toa256 (after) = 2617 / 256 = 10
+Step #38
+ lchan.rqd_ta (before) = 38
+ toa256 (before) = 2617 / 256 = 10
+ lchan.rqd_ta (after) = 39
+ toa256 (after) = 2361 / 256 = 9
+Step #39
+ lchan.rqd_ta (before) = 39
+ toa256 (before) = 2361 / 256 = 9
+ lchan.rqd_ta (after) = 40
+ toa256 (after) = 2105 / 256 = 8
+Step #40
+ lchan.rqd_ta (before) = 40
+ toa256 (before) = 2105 / 256 = 8
+ lchan.rqd_ta (after) = 41
+ toa256 (after) = 1849 / 256 = 7
+Step #41
+ lchan.rqd_ta (before) = 41
+ toa256 (before) = 1849 / 256 = 7
+ lchan.rqd_ta (after) = 42
+ toa256 (after) = 1593 / 256 = 6
+Step #42
+ lchan.rqd_ta (before) = 42
+ toa256 (before) = 1593 / 256 = 6
+ lchan.rqd_ta (after) = 43
+ toa256 (after) = 1337 / 256 = 5
+Step #43
+ lchan.rqd_ta (before) = 43
+ toa256 (before) = 1337 / 256 = 5
+ lchan.rqd_ta (after) = 44
+ toa256 (after) = 1081 / 256 = 4
+Step #44
+ lchan.rqd_ta (before) = 44
+ toa256 (before) = 1081 / 256 = 4
+ lchan.rqd_ta (after) = 45
+ toa256 (after) = 825 / 256 = 3
+Step #45
+ lchan.rqd_ta (before) = 45
+ toa256 (before) = 825 / 256 = 3
+ lchan.rqd_ta (after) = 46
+ toa256 (after) = 569 / 256 = 2
+Step #46
+ lchan.rqd_ta (before) = 46
+ toa256 (before) = 569 / 256 = 2
+ lchan.rqd_ta (after) = 47
+ toa256 (after) = 313 / 256 = 1
+Step #47
+ lchan.rqd_ta (before) = 47
+ toa256 (before) = 313 / 256 = 1
+ lchan.rqd_ta (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #48
+ lchan.rqd_ta (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.rqd_ta (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #49
+ lchan.rqd_ta (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.rqd_ta (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Done.
+
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 2d1cefd3..d9bc1cee 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -49,3 +49,9 @@ AT_KEYWORDS([meas])
cat $abs_srcdir/meas/meas_test.ok > expout
AT_CHECK([$abs_top_builddir/tests/meas/meas_test], [], [expout], [ignore])
AT_CLEANUP
+
+AT_SETUP([ta_control])
+AT_KEYWORDS([ta_control])
+cat $abs_srcdir/ta_control/ta_control_test.ok > expout
+AT_CHECK([$abs_top_builddir/tests/ta_control/ta_control_test], [], [expout], [ignore])
+AT_CLEANUP