aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-10-18 19:43:27 +0700
committerfixeria <vyanitskiy@sysmocom.de>2020-10-19 18:08:32 +0000
commit652e60eb83f928036a649fa45f7a4a4eb8207eac (patch)
treeb136c3b3b6a56a75352db209c6d81b22d5f0c822
parentceb1f9888f17222c78ccf1a194d42b0f9ae10aed (diff)
BTS_Tests: add TC_ms_pwr_ctrl_pf_ewma: test EWMA based power filtering
This test case is very similar to TC_ms_pwr_ctrl_constant(), but the key difference that we simulate sharp UL RSSI changes between -50 dBm and -100 dBm on each iteration. The 'uplink-power-target' (-75 dBm) is right in the middle of the change range, so with EWMA filtering and 80% smoothing it's expected that all averaged UL RSSI values would be around -75 dBm. It's expected that the Uplink power level remains constant, however this test case fails at the moment. The problem is that the IUT is still quite sensitive to small deviations from 'uplink-power-target', so ideally we should introduce a 'hysteresis' defining a range: ['target' - 'hysteresis' ... 'target' + 'hysteresis'] in which the MS power loop should not trigger any power changes. For example, let's say: 'uplink-power-target' is -75 dBm (default), and 'hysteresis' is 8 dBm, so then the range would be: -83 dBm ... -67 dBm. Change-Id: I3be1a4a4a0ab7eebb9a930eee7039295c045a791 Depends: Iacedbd4d69d3d74e2499af5622a07a8af0423da0 Related: SYS#4916
-rw-r--r--bts/BTS_Tests.ttcn75
1 files changed, 75 insertions, 0 deletions
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 6fc396d0..4128406f 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -106,6 +106,7 @@ modulepar {
integer mp_ms_actual_ta_exp := 0;
integer mp_timing_offset_256syms_exp := 512;
integer mp_uplink_power_target := -75;
+ integer mp_uplink_power_hysteresis := 8; /* -83 .. -67 */
/* Time to wait for RSL conn from BTS during startup of test */
float mp_ipa_up_timeout := 15.0;
float mp_ipa_up_delay := 0.0;
@@ -6922,6 +6923,19 @@ runs on ConnHdlr return octetstring {
return f_TC_ms_pwr_ctrl_cb_def(l1h, num_blocks);
}
+private function f_TC_ms_pwr_ctrl_cb_rssi_pwm(inout SacchL1Header l1h, integer num_blocks)
+runs on ConnHdlr return octetstring {
+ /* UL RSSI oscillation driven by SACCH block number */
+ if (num_blocks rem 2 == 0) {
+ f_trxc_fake_rssi(-100);
+ } else {
+ f_trxc_fake_rssi(-50);
+ }
+
+ /* Make sure that MS power level remains constant */
+ return f_TC_ms_pwr_ctrl_cb_const(l1h, num_blocks);
+}
+
/* Make sure that MS power level remains constant when 'rx-current' equals 'rx-target' */
private function f_TC_ms_pwr_ctrl_constant(charstring id)
runs on ConnHdlr {
@@ -6979,6 +6993,66 @@ testcase TC_ms_pwr_ctrl_constant() runs on test_CT {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
}
+/* Test Exponentially Weighted Moving Average (EWMA) power filtering */
+private function f_TC_ms_pwr_ctrl_pf_ewma(charstring id)
+runs on ConnHdlr {
+ var integer num_blocks := 16;
+ timer T := int2float(num_blocks);
+
+ f_l1_tune(L1CTL);
+ RSL.clear;
+
+ /* These IEs are needed for autonomous MS power control */
+ var template (value) RSL_IE_List ies := {
+ t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{
+ ms_power := ts_RSL_IE_MS_Power(g_pars.l1_pars.ms_power_level)
+ }),
+ t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{
+ ms_power_params := ts_RSL_IE_MS_Power_Parameters(''O)
+ })
+ };
+
+ /* Ensure that 'rx-current' equals 'rx-target' */
+ f_trxc_fake_rssi(mp_uplink_power_target);
+
+ /* Establish a dedicated channel */
+ f_est_dchan(more_ies := valueof(ies));
+
+ L1CTL.clear;
+ T.start;
+ alt {
+ [] as_TC_ms_pwr_ctrl(refers(f_TC_ms_pwr_ctrl_cb_rssi_pwm), num_blocks);
+ [] T.timeout {
+ setverdict(fail, "Not all SACCH blocks were processed in time, ",
+ num_blocks, " were not handled");
+ }
+ }
+}
+testcase TC_ms_pwr_ctrl_pf_ewma() runs on test_CT {
+ var ConnHdlr vc_conn;
+ var ConnHdlrPars pars;
+
+ f_init();
+
+ /* Explicitly configure EWMA filtering with 80% smoothing (alpha = 0.2) */
+ f_vty_config(BTSVTY, "bts 0", "uplink-power-filtering algo ewma beta 80");
+ /* Explicitly configure the Uplink power range (target and delte) */
+ f_vty_config(BTSVTY, "bts 0", "uplink-power-target " & int2str(mp_uplink_power_target)
+ & " hysteresis " & int2str(mp_uplink_power_hysteresis));
+
+ for (var integer i := 0; i < sizeof(g_AllChanTypes); i := i + 1) {
+ pars := valueof(t_Pars(g_AllChanTypes[i], ts_RSL_ChanMode_SIGN));
+ log(testcasename(), ": starting on ", pars.chan_nr);
+
+ vc_conn := f_start_handler(refers(f_TC_ms_pwr_ctrl_pf_ewma),
+ pars, trxc_comp := true);
+ vc_conn.done;
+ }
+
+ /* No need to reset Uplink power parameters - the IUT restarts anyway */
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
+}
+
/* test generation of RLL ERR IND based on Um errors (TS 48.058 3.9) */
/* protocol error as per 44.006 */
/* link layer failure (repetition of I-frame N200 times without ACK */
@@ -7164,6 +7238,7 @@ control {
execute( TC_chopped_ipa_payload() );
execute( TC_ms_pwr_ctrl_constant() );
+ execute( TC_ms_pwr_ctrl_pf_ewma() );
}