pcu: Parse TS and TRX allocation from Assignment in Ul/DlTbf objects
This will allow tests to use multitrx and multislot scenarios.
Change-Id: Ia2b9dd73f61c7068a729b427c118ae2ef027c30b
diff --git a/pcu/GPRS_Components.ttcn b/pcu/GPRS_Components.ttcn
index e73609f..e6406b7 100644
--- a/pcu/GPRS_Components.ttcn
+++ b/pcu/GPRS_Components.ttcn
@@ -76,9 +76,11 @@
};
type record DlTbf {
- GsmRrMessage rr_imm_ass,
- PacketDlAssignChan ass,
+ GsmRrMessage rr_imm_ass optional,
+ PacketDlAssignChan ass optional,
uint5_t tfi,
+ GsmArfcn arfcn,
+ BIT8 ts_mask,
AckNackDescription acknack_desc
};
@@ -92,6 +94,8 @@
GsmRrMessage rr_imm_ass optional,
PacketUlAssignChan ass optional,
uint5_t tfi,
+ GsmArfcn arfcn,
+ BIT8 ts_mask,
uint3_t usf[8],
boolean is_egprs,
uint14_t bsn,
@@ -131,10 +135,21 @@
dl_tbf := omit
};
+template (value) DlTbf t_DlTbf_def := {
+ rr_imm_ass := omit,
+ ass := omit,
+ tfi := 0,
+ arfcn := 0,
+ ts_mask := '00000000'B,
+ acknack_desc := t_AckNackDescription_init
+};
+
template (value) UlTbf t_UlTbf_def := {
rr_imm_ass := omit,
ass := omit,
tfi := 0,
+ arfcn := 0,
+ ts_mask := '00000000'B,
usf := { USF_UNUSED, USF_UNUSED, USF_UNUSED, USF_UNUSED, USF_UNUSED, USF_UNUSED, USF_UNUSED, USF_UNUSED },
is_egprs := false,
bsn := 0,
@@ -188,6 +203,11 @@
var uint3_t tn_allocated := rr_imm_ass.payload.imm_ass.pkt_chan_desc.tn;
ul_tbf.rr_imm_ass := rr_imm_ass;
+ if (rr_imm_ass.payload.imm_ass.pkt_chan_desc.presence == '0'B and
+ rr_imm_ass.payload.imm_ass.pkt_chan_desc.zero.hopping == '0'B) {
+ ul_tbf.arfcn := rr_imm_ass.payload.imm_ass.pkt_chan_desc.zero.arfcn;
+ }
+ ul_tbf.ts_mask[tn_allocated] := '1'B;
/* Make sure we received an UL TBF Assignment */
if (match(rr_imm_ass, tr_IMM_TBF_ASS(dl := false, rest := tr_IaRestOctets_ULAss(?)))) {
@@ -224,6 +244,8 @@
function f_ultbf_new_from_ass_pacch(RlcmacDlBlock dl_block)
runs on MS_BTS_IFACE_CT return UlTbf {
var UlTbf ul_tbf := valueof(t_UlTbf_def);
+ var boolean freq_par_present := false;
+ var FrequencyParameters freq_par;
ul_tbf.ass.pacch := dl_block.ctrl.payload.u.ul_assignment;
ul_tbf.tx_cs_mcs := f_rlcmac_dl_block_get_assigned_ul_cs_mcs(dl_block);
@@ -233,30 +255,51 @@
/* TODO: support single block allocation */
if (match(dl_block, tr_RLCMAC_UL_PACKET_ASS_GPRS(?, tr_PktUlAssGprsDynamic(tr_DynamicAllocation(?))))) {
ul_tbf.tfi := dl_block.ctrl.payload.u.ul_assignment.gprs.dyn_block_alloc.ul_tfi_assignment;
+ freq_par_present := dl_block.ctrl.payload.u.ul_assignment.gprs.freq_par_present == '1'B;
+ if (freq_par_present) {
+ freq_par := dl_block.ctrl.payload.u.ul_assignment.gprs.freq_par;
+ }
ul_tbf.is_egprs := false;
for (var integer i := 0; i < 8; i := i + 1) {
if (dl_block.ctrl.payload.u.ul_assignment.gprs.dyn_block_alloc.ts_allocation.ts[i].presence == '1'B) {
+ ul_tbf.ts_mask[i] := '1'B;
ul_tbf.usf[i] := dl_block.ctrl.payload.u.ul_assignment.gprs.dyn_block_alloc.ts_allocation.ts[i].usf_tn;
}
}
} else if (match(dl_block, tr_RLCMAC_UL_PACKET_ASS_EGPRS(?, tr_PktUlAssEgprsDynamic(tr_DynamicAllocation(?))))) {
ul_tbf.tfi := dl_block.ctrl.payload.u.ul_assignment.egprs.dyn_block_alloc.ul_tfi_assignment;
+ freq_par_present := dl_block.ctrl.payload.u.ul_assignment.egprs.freq_par_present == '1'B;
+ if (freq_par_present) {
+ freq_par := dl_block.ctrl.payload.u.ul_assignment.egprs.freq_par;
+ }
ul_tbf.is_egprs := true;
for (var integer i := 0; i < 8; i := i + 1) {
if (dl_block.ctrl.payload.u.ul_assignment.egprs.dyn_block_alloc.ts_allocation.ts[i].presence == '1'B) {
+ ul_tbf.ts_mask[i] := '1'B;
ul_tbf.usf[i] := dl_block.ctrl.payload.u.ul_assignment.egprs.dyn_block_alloc.ts_allocation.ts[i].usf_tn;
}
}
}
+
+ /* FIXME: freq_par and arfcn are optional. in that case we need to
+ * infer/reuse from current dl_tbf or ul_tbf */
+ if (freq_par_present and freq_par.presence == '00'B) {
+ ul_tbf.arfcn := freq_par.arfcn;
+ }
+
return ul_tbf;
}
function f_dltbf_new_from_rr_imm_ass(in GsmRrMessage rr_imm_ass, template PacketDlAssign dl_ass := tr_PacketDlAssign(?))
runs on MS_BTS_IFACE_CT return DlTbf {
- var DlTbf dl_tbf;
+ var DlTbf dl_tbf := valueof(t_DlTbf_def);
dl_tbf.rr_imm_ass := rr_imm_ass;
- dl_tbf.acknack_desc := valueof(t_AckNackDescription_init);
+ if (rr_imm_ass.payload.imm_ass.pkt_chan_desc.presence == '0'B and
+ rr_imm_ass.payload.imm_ass.pkt_chan_desc.zero.hopping == '0'B) {
+ dl_tbf.arfcn := rr_imm_ass.payload.imm_ass.pkt_chan_desc.zero.arfcn;
+ }
+ dl_tbf.ts_mask[rr_imm_ass.payload.imm_ass.pkt_chan_desc.tn] := '1'B;
/* Make sure we received a DL TBF Assignment */
if (match(rr_imm_ass, tr_IMM_TBF_ASS(dl := true, rest := tr_IaRestOctets_DLAss(dl_ass)))) {
@@ -279,15 +322,31 @@
return dl_tbf;
}
-/* TODO: get stuff from f_rx_rlcmac_dl_block_exp_pkt_ass */
function f_dltbf_new_from_ass_pacch(RlcmacDlBlock dl_block)
runs on MS_BTS_IFACE_CT return DlTbf {
- var DlTbf dl_tbf;
+ var DlTbf dl_tbf := valueof(t_DlTbf_def);
+ var boolean freq_par_present := false;
+ var FrequencyParameters freq_par;
dl_tbf.ass.pacch := dl_block.ctrl.payload.u.dl_assignment;
dl_tbf.tfi := f_rlcmac_dl_block_get_tfi(dl_block);
/* TODO: handle GlobalTfiOrTlli tfi_or_tlli from pkt_dl_ass */
- dl_tbf.acknack_desc := valueof(t_AckNackDescription_init);
+
+ if (match(dl_block, tr_RLCMAC_DL_PACKET_ASS(?))) {
+ dl_tbf.tfi := dl_block.ctrl.payload.u.dl_assignment.dl_tfi_assignment;
+ freq_par_present := dl_block.ctrl.payload.u.dl_assignment.freq_par_present == '1'B;
+ if (freq_par_present) {
+ freq_par := dl_block.ctrl.payload.u.dl_assignment.freq_par;
+ }
+ dl_tbf.ts_mask := dl_block.ctrl.payload.u.dl_assignment.timeslot_alloc; /* TODO: is this the correct order ? */
+ /* TODO: check egprs in dl_assignment.rel_additions (PktDlAssR99Additions) */
+ }
+
+ /* FIXME: freq_par and arfcn are optional. in that case we need to
+ * infer/reuse from current dl_tbf or ul_tbf */
+ if (freq_par_present and freq_par.presence == '00'B) {
+ dl_tbf.arfcn := freq_par.arfcn;
+ }
return dl_tbf;
}
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 0a44a18..df075bc 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -2522,11 +2522,9 @@
different TRX in an uniform way. */
for (i := 0; i < num_ms; i := i + 1) {
f_ms_establish_ul_tbf(g_ms[i]);
-
- var uint10_t arfcn := g_ms[i].ul_tbf.rr_imm_ass.payload.imm_ass.pkt_chan_desc.zero.arfcn;
- if (arfcn != info_ind.trx.v10[i mod 3].arfcn) {
- setverdict(fail, "Got assigned ARFCN ", arfcn, " vs exp ",
- info_ind.trx.v10[i mod 3].arfcn);
+ if (g_ms[i].ul_tbf.arfcn != info_ind.trx.v10[i mod 3].arfcn) {
+ setverdict(fail, "Got assigned ARFCN ", g_ms[i].ul_tbf.arfcn,
+ " vs exp ", info_ind.trx.v10[i mod 3].arfcn);
f_shutdown(__BFILE__, __LINE__);
}
}