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
This commit is contained in:
parent
b58b7308e5
commit
20f8700767
|
@ -133,6 +133,37 @@ type component RAW_PCU_ClckGen_CT {
|
||||||
var integer fn := 0;
|
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()
|
function f_ClckGen_CT_handler()
|
||||||
runs on RAW_PCU_ClckGen_CT {
|
runs on RAW_PCU_ClckGen_CT {
|
||||||
var integer fn104, fn52, fn13;
|
var integer fn104, fn52, fn13;
|
||||||
|
|
|
@ -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
|
* indications to the PCU, checking the correctness of two received PTCCH/D
|
||||||
* messages (period of PTCCH/D is two multi-frames).
|
* 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 {
|
runs on RAW_PCU_Test_CT {
|
||||||
var integer counter := 0;
|
|
||||||
var RAW_PCU_Event event;
|
var RAW_PCU_Event event;
|
||||||
|
var integer ss;
|
||||||
|
|
||||||
/* Send Access Bursts on PTCCH/U for every TA Index */
|
/* Send Access Bursts on PTCCH/U for every TA Index */
|
||||||
[] BTS.receive(tr_RAW_PCU_EV(TDMA_EV_PTCCH_UL_BURST)) -> value event {
|
[] 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",
|
log("Sending an Access Burst on PTCCH/U",
|
||||||
|
", sub-slot=", ss, " (TAI)",
|
||||||
", fn=", event.data.tdma_fn,
|
", fn=", event.data.tdma_fn,
|
||||||
", ToA=", counter * toa_factor);
|
", ToA=", toa_map[ss], " (QTA)");
|
||||||
/* TODO: do we care about RA and burst format? */
|
/* TODO: do we care about RA and burst format? */
|
||||||
BTS.send(ts_PCUIF_RACH_IND(bts_nr := bts_nr,
|
BTS.send(ts_PCUIF_RACH_IND(bts_nr := bts_nr,
|
||||||
ra := oct2int('3A'O),
|
ra := oct2int('3A'O),
|
||||||
|
@ -783,14 +800,14 @@ runs on RAW_PCU_Test_CT {
|
||||||
burst_type := BURST_TYPE_0,
|
burst_type := BURST_TYPE_0,
|
||||||
fn := event.data.tdma_fn,
|
fn := event.data.tdma_fn,
|
||||||
arfcn := 871,
|
arfcn := 871,
|
||||||
qta := counter * toa_factor * 4,
|
qta := toa_map[ss],
|
||||||
sapi := PCU_IF_SAPI_PTCCH));
|
sapi := PCU_IF_SAPI_PTCCH));
|
||||||
counter := counter + 1;
|
|
||||||
repeat;
|
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 {
|
runs on RAW_PCU_Test_CT {
|
||||||
var PTCCHDownlinkMsg ta_msg;
|
var PTCCHDownlinkMsg ta_msg;
|
||||||
var PCUIF_Message pcu_msg;
|
var PCUIF_Message pcu_msg;
|
||||||
|
@ -804,7 +821,7 @@ runs on RAW_PCU_Test_CT {
|
||||||
alt {
|
alt {
|
||||||
/* Keep sending of Access Bursts during two multi-frames (period of PTCCH/D)
|
/* 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... */
|
* 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 */
|
/* 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,
|
[] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := 0, trx_nr := 0, ts_nr := 7,
|
||||||
sapi := PCU_IF_SAPI_PTCCH)) -> value pcu_msg {
|
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,
|
/* Now we have all 7 TBFs established in one-phase access mode,
|
||||||
* however we will not be sending any data on them. Instead, we
|
* however we will not be sending any data on them. Instead, we
|
||||||
* will be sending RACH.ind on PTCCH/U during 4 multi-frame
|
* 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
|
* 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
|
* time-slots, so at the moment of scheduling a PTCCH/D block
|
||||||
* the PCU has odd number of PTCCH/U Access Bursts received. */
|
* 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,
|
tai0_ta := 7, tai1_ta := 14, tai2_ta := 21,
|
||||||
/* Other values are not known (yet) */
|
/* Other values are not known (yet) */
|
||||||
tai3_ta := ?));
|
tai3_ta := ?));
|
||||||
f_TC_ta_ptcch_ul_multi_tbf(tr_PTCCHDownlinkMsg(
|
f_TC_ta_ptcch_ul_multi_tbf(toa_map, tr_PTCCHDownlinkMsg(
|
||||||
/* Other values are out of our interest */
|
|
||||||
tai0_ta := 7, tai1_ta := 14, tai2_ta := 21,
|
tai0_ta := 7, tai1_ta := 14, tai2_ta := 21,
|
||||||
tai3_ta := 28, tai4_ta := 35, tai5_ta := 42,
|
tai3_ta := 28, tai4_ta := 35, tai5_ta := 42,
|
||||||
/* Other values are not known (yet) */
|
/* Other values are out of our interest */
|
||||||
tai6_ta := ?));
|
tai6_ta := ?));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue