summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-10-06 00:51:50 +0700
committerfixeria <axilirator@gmail.com>2019-10-09 15:24:22 +0000
commit20f870076763f7b152d61a2dafc5ee90ee473c9f (patch)
tree6e5d78efcc38644fc8bea91c931eaa520fea0e3a
parentb58b7308e5cbc35494f853c8c87e7bc44da58460 (diff)
PCU_Tests_RAW.ttcn: fix ToA handling in as_ta_ptcch()HEADmaster
As it turns out, it was a bad idea to use a counter in altstep as_ta_ptcch(), because its value is getting lost. Let's instead introduce a new type PTCCH_TAI_ToA_MAP, which is basically a list of ToA values for each PTCCH/U sub-slot (TA Index), and pass it to the altstep. Change-Id: I74252dfb929fcb32d07e8728d692674931fae727
-rw-r--r--pcu/PCUIF_RAW_Components.ttcn31
-rw-r--r--pcu/PCU_Tests_RAW.ttcn45
2 files changed, 65 insertions, 11 deletions
diff --git a/pcu/PCUIF_RAW_Components.ttcn b/pcu/PCUIF_RAW_Components.ttcn
index 465e398..ab8b3b7 100644
--- a/pcu/PCUIF_RAW_Components.ttcn
+++ b/pcu/PCUIF_RAW_Components.ttcn
@@ -133,6 +133,37 @@ type component RAW_PCU_ClckGen_CT {
var integer fn := 0;
}
+/* Derive PTCCH/U sub-slot from a given TDMA frame-number */
+function f_tdma_ptcch_fn2ss(integer fn) return integer
+{
+ var integer ss := -1;
+
+ /* See 3GPP TS 45.002, table 6 */
+ select (fn mod 416) {
+ case (12) { ss := 0; }
+ case (38) { ss := 1; }
+ case (64) { ss := 2; }
+ case (90) { ss := 3; }
+
+ case (116) { ss := 4; }
+ case (142) { ss := 5; }
+ case (168) { ss := 6; }
+ case (194) { ss := 7; }
+
+ case (220) { ss := 8; }
+ case (246) { ss := 9; }
+ case (272) { ss := 10; }
+ case (298) { ss := 11; }
+
+ case (324) { ss := 12; }
+ case (350) { ss := 13; }
+ case (376) { ss := 14; }
+ case (402) { ss := 15; }
+ }
+
+ return ss;
+}
+
function f_ClckGen_CT_handler()
runs on RAW_PCU_ClckGen_CT {
var integer fn104, fn52, fn13;
diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index 0771cf9..af1ef99 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -766,16 +766,33 @@ testcase TC_ta_ptcch_idle() runs on RAW_PCU_Test_CT {
* indications to the PCU, checking the correctness of two received PTCCH/D
* messages (period of PTCCH/D is two multi-frames).
*/
-private altstep as_ta_ptcch(uint8_t bts_nr := 0, integer toa_factor := 0)
+
+/* List of ToA values for Access Bursts to be sent on PTCCH/U,
+ * each ToA (Timing of Arrival) value is in units of 1/4 of
+ * a symbol (i.e. 1 symbol is 4 QTA units). */
+type record length(16) of int16_t PTCCH_TAI_ToA_MAP;
+const PTCCH_TAI_ToA_MAP ptcch_toa_map_def := {
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0
+};
+
+private altstep as_ta_ptcch(uint8_t bts_nr := 0, /* TODO: TRX / TS number */
+ in PTCCH_TAI_ToA_MAP toa_map := ptcch_toa_map_def)
runs on RAW_PCU_Test_CT {
- var integer counter := 0;
var RAW_PCU_Event event;
+ var integer ss;
/* Send Access Bursts on PTCCH/U for every TA Index */
[] BTS.receive(tr_RAW_PCU_EV(TDMA_EV_PTCCH_UL_BURST)) -> value event {
+ ss := f_tdma_ptcch_fn2ss(event.data.tdma_fn);
+ if (ss < 0) { mtc.stop; } /* Shall not happen */
+
log("Sending an Access Burst on PTCCH/U",
+ ", sub-slot=", ss, " (TAI)",
", fn=", event.data.tdma_fn,
- ", ToA=", counter * toa_factor);
+ ", ToA=", toa_map[ss], " (QTA)");
/* TODO: do we care about RA and burst format? */
BTS.send(ts_PCUIF_RACH_IND(bts_nr := bts_nr,
ra := oct2int('3A'O),
@@ -783,14 +800,14 @@ runs on RAW_PCU_Test_CT {
burst_type := BURST_TYPE_0,
fn := event.data.tdma_fn,
arfcn := 871,
- qta := counter * toa_factor * 4,
+ qta := toa_map[ss],
sapi := PCU_IF_SAPI_PTCCH));
- counter := counter + 1;
repeat;
}
}
-private function f_TC_ta_ptcch_ul_multi_tbf(template PTCCHDownlinkMsg t_ta_msg)
+private function f_TC_ta_ptcch_ul_multi_tbf(in PTCCH_TAI_ToA_MAP ptcch_toa_map,
+ template PTCCHDownlinkMsg t_ta_msg)
runs on RAW_PCU_Test_CT {
var PTCCHDownlinkMsg ta_msg;
var PCUIF_Message pcu_msg;
@@ -804,7 +821,7 @@ runs on RAW_PCU_Test_CT {
alt {
/* Keep sending of Access Bursts during two multi-frames (period of PTCCH/D)
* with increasing ToA (Timing of Arrival) values: 0, 7, 14, 28, 35... */
- [] as_ta_ptcch(bts_nr := 0, toa_factor := 7);
+ [] as_ta_ptcch(bts_nr := 0, toa_map := ptcch_toa_map);
/* In the end of 2nd multi-frame we should receive a PTCCH/D block */
[] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := 0, trx_nr := 0, ts_nr := 7,
sapi := PCU_IF_SAPI_PTCCH)) -> value pcu_msg {
@@ -869,6 +886,13 @@ testcase TC_ta_ptcch_ul_multi_tbf() runs on RAW_PCU_Test_CT {
}
}
+ /* Prepare a list of ToA values for Access Bursts to be sent on PTCCH/U */
+ var PTCCH_TAI_ToA_MAP toa_map := ptcch_toa_map_def;
+ for (var integer i := 0; i < 7; i := i + 1) {
+ /* ToA in units of 1/4 of a symbol */
+ toa_map[i] := (i + 1) * 7 * 4;
+ }
+
/* Now we have all 7 TBFs established in one-phase access mode,
* however we will not be sending any data on them. Instead, we
* will be sending RACH.ind on PTCCH/U during 4 multi-frame
@@ -877,15 +901,14 @@ testcase TC_ta_ptcch_ul_multi_tbf() runs on RAW_PCU_Test_CT {
* Why not 4 TBFs at once? Because Uplink is delayed by 3 TDMA
* time-slots, so at the moment of scheduling a PTCCH/D block
* the PCU has odd number of PTCCH/U Access Bursts received. */
- f_TC_ta_ptcch_ul_multi_tbf(tr_PTCCHDownlinkMsg(
+ f_TC_ta_ptcch_ul_multi_tbf(toa_map, tr_PTCCHDownlinkMsg(
tai0_ta := 7, tai1_ta := 14, tai2_ta := 21,
/* Other values are not known (yet) */
tai3_ta := ?));
- f_TC_ta_ptcch_ul_multi_tbf(tr_PTCCHDownlinkMsg(
- /* Other values are out of our interest */
+ f_TC_ta_ptcch_ul_multi_tbf(toa_map, tr_PTCCHDownlinkMsg(
tai0_ta := 7, tai1_ta := 14, tai2_ta := 21,
tai3_ta := 28, tai4_ta := 35, tai5_ta := 42,
- /* Other values are not known (yet) */
+ /* Other values are out of our interest */
tai6_ta := ?));
}