Change in ...osmo-ttcn3-hacks[master]: PCU_Tests_RAW.ttcn: fix ToA handling in as_ta_ptcch()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Wed Oct 9 15:24:26 UTC 2019


fixeria has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15679 )

Change subject: PCU_Tests_RAW.ttcn: fix ToA handling in as_ta_ptcch()
......................................................................

PCU_Tests_RAW.ttcn: fix ToA handling in as_ta_ptcch()

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
---
M pcu/PCUIF_RAW_Components.ttcn
M pcu/PCU_Tests_RAW.ttcn
2 files changed, 65 insertions(+), 11 deletions(-)

Approvals:
  fixeria: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



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 @@
 	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 @@
  * 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 @@
 					   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 @@
 	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 @@
 		}
 	}
 
+	/* 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 @@
 	 * 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 := ?));
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15679
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I74252dfb929fcb32d07e8728d692674931fae727
Gerrit-Change-Number: 15679
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191009/4065adcf/attachment.htm>


More information about the gerrit-log mailing list