diff options
Diffstat (limited to 'library/RLCMAC_Templates.ttcn')
-rw-r--r-- | library/RLCMAC_Templates.ttcn | 269 |
1 files changed, 237 insertions, 32 deletions
diff --git a/library/RLCMAC_Templates.ttcn b/library/RLCMAC_Templates.ttcn index 5bdc17d4..5e273413 100644 --- a/library/RLCMAC_Templates.ttcn +++ b/library/RLCMAC_Templates.ttcn @@ -18,6 +18,10 @@ module RLCMAC_Templates { import from RLCMAC_CSN1_Templates all; import from RLCMAC_Types all; + template CodingScheme cs_gprs_any := (CS_1, CS_2, CS_3, CS_4); + template CodingScheme mcs_egprs_any := (MCS_1, MCS_2, MCS_3, MCS_4, MCS_5, + MCS_6, MCS_7, MCS_8, MCS_9); + /* TS 44.060 10.4.5 */ function f_rrbp_fn_delay(MacRrbp rrbp) return uint32_t { select (rrbp) { @@ -34,6 +38,13 @@ module RLCMAC_Templates { return (current_fn + f_rrbp_fn_delay(rrbp)) mod 2715648; } + function f_rlcmac_cs_mcs_is_mcs(CodingScheme cs_mcs) return boolean { + if (cs_mcs >= MCS_0) { + return true; + } + return false; + } + function f_rlcmac_mcs2headertype(CodingScheme mcs) return EgprsHeaderType { select (mcs) { case (MCS_0) { return RLCMAC_HDR_TYPE_3; } @@ -93,7 +104,27 @@ module RLCMAC_Templates { return CS_1; } - /* Minimum CodingScheme required to fit RLCMAC block */ + function f_rlcmac_cs_mcs2block_len_no_spare_bits(CodingScheme cs_mcs) return uint32_t { + select (cs_mcs) { + /* 3GPP TS 44.060 Table 10.2.1: RLC data block size, discounting padding in octet */ + case (CS_1) { return 23; } + case (CS_2) { return 33; } + case (CS_3) { return 39; } + case (CS_4) { return 53; } + case (MCS_1) { return 27; } + case (MCS_2) { return 33; } + case (MCS_3) { return 42; } + case (MCS_4) { return 49; } + case (MCS_5) { return 61; } + case (MCS_6) { return 79; } + case (MCS_7) { return 119; } + case (MCS_8) { return 143; } + case (MCS_9) { return 155; } + } + return 0; + } + + /* Minimum CodingScheme required to fit RLCMAC block. Spare bits not counted. */ function f_rlcmac_block_len_required_cs_mcs(uint32_t len, boolean is_mcs) return CodingScheme { if (is_mcs) { if (len <= 27) { return MCS_1; } @@ -330,8 +361,16 @@ module RLCMAC_Templates { } } + private function f_presence_bit_chreq_desc(template (omit) ChannelReqDescription chreq_desc) return BIT1 { + if (istemplatekind(chreq_desc, "omit")) { + return '0'B; + } + return '1'B; + } + /* Send Template for Downlink ACK/NACK */ - template RlcmacUlBlock ts_RLCMAC_DL_ACK_NACK(template uint5_t tfi, AckNackDescription andesc, boolean retry := false) := { + template (value) RlcmacUlBlock ts_RLCMAC_DL_ACK_NACK(template (value) uint5_t tfi, AckNackDescription andesc, boolean retry := false, + template (omit) ChannelReqDescription chreq_desc := omit) := { ctrl := { mac_hdr := { payload_type := MAC_PT_RLCMAC_NO_OPT, @@ -344,8 +383,8 @@ module RLCMAC_Templates { dl_ack_nack := { dl_tfi := tfi, ack_nack_desc := andesc, - chreq_desc_presence := '0'B, - chreq_desc := omit, + chreq_desc_presence := f_presence_bit_chreq_desc(chreq_desc), + chreq_desc := chreq_desc, ch_qual_rep := c_ChQualRep_default } } @@ -353,17 +392,31 @@ module RLCMAC_Templates { } } - template RlcmacUlBlock ts_RLCMAC_DL_ACK_NACK_CHREQ(template uint5_t tfi, - AckNackDescription andesc, - boolean retry := false, - template ChannelReqDescription chreq_desc := c_ChReqDesc_default) - modifies ts_RLCMAC_DL_ACK_NACK := { + /* Send Template for Egprs Downlink ACK/NACK */ + template (value) RlcmacUlBlock ts_RLCMAC_DL_ACK_NACK_EGPRS(template (value) uint5_t tfi, + EgprsAckNackDescription andesc, + boolean retry := false, + template (omit) ChannelReqDescription chreq_desc := omit) := { ctrl := { + mac_hdr := { + payload_type := MAC_PT_RLCMAC_NO_OPT, + spare := '00000'B, + retry := retry + }, payload := { + msg_type := PACKET_EGPRS_DL_ACK_NACK, u := { - dl_ack_nack := { - chreq_desc_presence := '1'B, - chreq_desc := chreq_desc + dl_ack_nack_egprs := { + dl_tfi := tfi, + ms_oom := '0'B, + egprs_ch_qual_rep_presence := '0'B, + egprs_ch_qual_rep := omit, + chreq_desc_presence := f_presence_bit_chreq_desc(chreq_desc), + chreq_desc := chreq_desc, + pfi_presence := '0'B, + pfi := omit, + epdan_presence := '0'B, + ack_nack_desc_ie := ts_EgprsAckNackDescriptionIE(andesc) } } } @@ -371,13 +424,18 @@ module RLCMAC_Templates { } /* Template for uplink Data block */ - template RlcmacUlBlock t_RLCMAC_UL_DATA(template uint5_t tfi, template uint4_t cv, template uint7_t bsn, - template LlcBlocks blocks := {}, template boolean stall := false) := { + template (value) RlcmacUlBlock t_RLCMAC_UL_DATA(template (value) CodingScheme cs, + template (value) uint5_t tfi, + template (value) uint4_t cv, + template (value) uint7_t bsn, + template (value) LlcBlocks blocks := {}, + template (value) boolean stall := false) := { data := { + cs := cs, mac_hdr := { payload_type := MAC_PT_RLC_DATA, countdown := cv, - stall_ind := false, + stall_ind := stall, retry := false, spare := '0'B, pfi_ind := false, @@ -391,13 +449,19 @@ module RLCMAC_Templates { blocks := blocks } } - template RlcmacUlBlock t_RLCMAC_UL_DATA_TLLI(template uint5_t tfi, template uint4_t cv, template uint7_t bsn, - template LlcBlocks blocks := {}, template boolean stall := false, template GprsTlli tlli) := { + template (value) RlcmacUlBlock t_RLCMAC_UL_DATA_TLLI(template (value) CodingScheme cs, + template (value) uint5_t tfi, + template (value) uint4_t cv, + template (value) uint7_t bsn, + template (value) LlcBlocks blocks := {}, + template (value) boolean stall := false, + template (value) GprsTlli tlli) := { data := { + cs := cs, mac_hdr := { payload_type := MAC_PT_RLC_DATA, countdown := cv, - stall_ind := false, + stall_ind := stall, retry := false, spare := '0'B, pfi_ind := false, @@ -413,10 +477,14 @@ module RLCMAC_Templates { } /* Template for uplink Data block */ - template RlcmacUlBlock t_RLCMAC_UL_EGPRS_DATA(CodingScheme mcs, - template uint5_t tfi, template uint4_t cv, - template uint11_t bsn1, template EgprsLlcBlocks blocks := {}) := { + template (value) RlcmacUlBlock t_RLCMAC_UL_EGPRS_DATA(CodingScheme mcs, + template (value) uint5_t tfi, + template (value) uint4_t cv, + template (value) uint11_t bsn1, + template (value) uint8_t bsn2_offset := 0, + template (value) EgprsLlcBlocks blocks := {}) := { data_egprs := { + mcs := mcs, mac_hdr := { header_type := f_rlcmac_mcs2headertype(mcs), tfi := tfi, @@ -424,6 +492,7 @@ module RLCMAC_Templates { foi_si := '0'B, r_ri := '0'B, bsn1 := bsn1, + bsn2_offset := bsn2_offset, cps := f_rlcmac_mcs_to_cps(mcs, 1, false), pfi_ind := false, rsb := '0'B, @@ -437,17 +506,59 @@ module RLCMAC_Templates { } } - template DlMacHeader t_RLCMAC_DlMacH(template (present) MacPayloadType pt, - template (present) boolean rrbp_valid, - template (present) MacRrbp rrbp, - template (present) uint3_t usf) := { + template (value) DlMacHeader + ts_RLCMAC_DlMacH(template (value) MacPayloadType pt := MAC_PT_RLCMAC_NO_OPT, + template (value) boolean rrbp_valid := false, + template (value) MacRrbp rrbp := RRBP_Nplus13_mod_2715648, + template (value) uint3_t usf := 7) := { + payload_type := pt, + rrbp := rrbp, + rrbp_valid := rrbp_valid, + usf := usf + } + template DlMacHeader + t_RLCMAC_DlMacH(template (present) MacPayloadType pt, + template (present) boolean rrbp_valid, + template (present) MacRrbp rrbp, + template (present) uint3_t usf) := { payload_type := pt, rrbp := rrbp, rrbp_valid := rrbp_valid, usf := usf } - template RlcmacDlBlock tr_RLCMAC_DUMMY_CTRL(template uint3_t usf := ?, template PageMode page_mode := ?) := { + template RlcmacDlBlock tr_RLCMAC_DL_CTRL(template uint3_t usf := ?, template RlcmacDlCtrlMsg dl_ctrl := ?) := { + ctrl := { + mac_hdr := { + payload_type := (MAC_PT_RLCMAC_NO_OPT, MAC_PT_RLCMAC_OPT), + rrbp:= ?, + rrbp_valid := ?, + usf := usf + }, + opt := *, + payload := dl_ctrl + } + } + + template (value) RlcmacDlBlock + ts_RLCMAC_DL_DUMMY_CTRL(template (value) DlMacHeader mac_hdr := ts_RLCMAC_DlMacH, + template (value) PageMode page_mode := PAGE_MODE_NORMAL) := { + ctrl := { + mac_hdr := mac_hdr, + opt := omit, + payload := { + msg_type := PACKET_DL_DUMMY_CTRL, + u := { + dl_dummy := { + page_mode := page_mode, + persistence_levels_present := '0'B, + persistence_levels := omit + } + } + } + } + } + template RlcmacDlBlock tr_RLCMAC_DL_DUMMY_CTRL(template uint3_t usf := ?, template PageMode page_mode := ?) := { ctrl := { mac_hdr := { payload_type := (MAC_PT_RLCMAC_NO_OPT, MAC_PT_RLCMAC_OPT), @@ -594,7 +705,7 @@ module RLCMAC_Templates { } }; - template RlcmacDlBlock tr_RLCMAC_UL_ACK_NACK_GPRS(template uint5_t ul_tfi, template UlAckNackGprs gprs := tr_UlAckNackGprs(*)) + template RlcmacDlBlock tr_RLCMAC_UL_ACK_NACK_GPRS(template uint5_t ul_tfi := ?, template UlAckNackGprs gprs := tr_UlAckNackGprs(*)) modifies tr_RLCMAC_UL_ACK_NACK := { ctrl := { payload := { @@ -609,7 +720,7 @@ module RLCMAC_Templates { } }; - template RlcmacDlBlock tr_RLCMAC_UL_ACK_NACK_EGPRS(template uint5_t ul_tfi, template UlAckNackEgprs egprs := tr_UlAckNackEgprs(*)) + template RlcmacDlBlock tr_RLCMAC_UL_ACK_NACK_EGPRS(template uint5_t ul_tfi := ?, template UlAckNackEgprs egprs := tr_UlAckNackEgprs(*)) modifies tr_RLCMAC_UL_ACK_NACK := { ctrl := { payload := { @@ -642,8 +753,8 @@ module RLCMAC_Templates { persistence_levels := *, nln_present := ?, nln := *, - repeated_pageinfo_present := ?, - repeated_pageinfo := * + repeated_pageinfo := *, + repeated_pageinfo_term := '0'B } } } @@ -657,6 +768,7 @@ module RLCMAC_Templates { template (present) MacRrbp rrbp := ?, template (present) uint3_t usf := ?) := { data := { + cs := ?, mac_hdr := { mac_hdr := { payload_type := MAC_PT_RLC_DATA, @@ -672,6 +784,7 @@ module RLCMAC_Templates { template RlcmacDlBlock tr_RLCMAC_DATA_EGPRS := { data_egprs := { + mcs := ?, mac_hdr := ?, fbi := ?, e := ?, @@ -680,14 +793,16 @@ module RLCMAC_Templates { } /* Template for Uplink MAC Control Header */ - template UlMacCtrlHeader t_RLCMAC_UlMacCtrlH(template MacPayloadType pt, template boolean retry := false) := { + template (value) UlMacCtrlHeader t_RLCMAC_UlMacCtrlH(template (value) MacPayloadType pt, + template (value) boolean retry := false) := { payload_type := pt, spare := '00000'B, retry := retry } /* Template for Uplink Control ACK */ - template RlcmacUlBlock ts_RLCMAC_CTRL_ACK(GprsTlli tlli, CtrlAck ack := MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN) := { + template (value) RlcmacUlBlock + ts_RLCMAC_CTRL_ACK(GprsTlli tlli, CtrlAck ack := MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN) := { ctrl := { mac_hdr := t_RLCMAC_UlMacCtrlH(MAC_PT_RLCMAC_NO_OPT), payload := { @@ -702,6 +817,21 @@ module RLCMAC_Templates { } } + template (value) RlcmacUlBlock + ts_RLCMAC_UL_DUMMY_CTRL(template (value) GprsTlli tlli) := { + ctrl := { + mac_hdr := t_RLCMAC_UlMacCtrlH(MAC_PT_RLCMAC_NO_OPT), + payload := { + msg_type := PACKET_UL_DUMMY_CTRL, + u := { + ul_dummy := { + tlli := tlli + } + } + } + } + } + template LlcBlockHdr t_RLCMAC_LLCBLOCK_HDR(uint16_t length_ind, boolean more, boolean e) := { length_ind := length_ind, more := more, /* 1 = new LLC PDU starts */ @@ -726,4 +856,79 @@ module RLCMAC_Templates { payload := data } + template (value) PTCCHDownlinkMsg + ts_PTCCHDownlinkMsg(template (value) uint7_t tai0_ta := 0, + template (value) uint7_t tai1_ta := 0, + template (value) uint7_t tai2_ta := 0, + template (value) uint7_t tai3_ta := 0, + template (value) uint7_t tai4_ta := 0, + template (value) uint7_t tai5_ta := 0, + template (value) uint7_t tai6_ta := 0, + template (value) uint7_t tai7_ta := 0, + template (value) uint7_t tai8_ta := 0, + template (value) uint7_t tai9_ta := 0, + template (value) uint7_t tai10_ta := 0, + template (value) uint7_t tai11_ta := 0, + template (value) uint7_t tai12_ta := 0, + template (value) uint7_t tai13_ta := 0, + template (value) uint7_t tai14_ta := 0, + template (value) uint7_t tai15_ta := 0) := { + ta_idx := { + { spare := '0'B, ta_val := tai0_ta }, + { spare := '0'B, ta_val := tai1_ta }, + { spare := '0'B, ta_val := tai2_ta }, + { spare := '0'B, ta_val := tai3_ta }, + { spare := '0'B, ta_val := tai4_ta }, + { spare := '0'B, ta_val := tai5_ta }, + { spare := '0'B, ta_val := tai6_ta }, + { spare := '0'B, ta_val := tai7_ta }, + { spare := '0'B, ta_val := tai8_ta }, + { spare := '0'B, ta_val := tai9_ta }, + { spare := '0'B, ta_val := tai10_ta }, + { spare := '0'B, ta_val := tai11_ta }, + { spare := '0'B, ta_val := tai12_ta }, + { spare := '0'B, ta_val := tai13_ta }, + { spare := '0'B, ta_val := tai14_ta }, + { spare := '0'B, ta_val := tai15_ta } + }, + padding := '2B2B2B2B2B2B2B'O + } + template PTCCHDownlinkMsg + tr_PTCCHDownlinkMsg(template (present) uint7_t tai0_ta := ?, + template (present) uint7_t tai1_ta := ?, + template (present) uint7_t tai2_ta := ?, + template (present) uint7_t tai3_ta := ?, + template (present) uint7_t tai4_ta := ?, + template (present) uint7_t tai5_ta := ?, + template (present) uint7_t tai6_ta := ?, + template (present) uint7_t tai7_ta := ?, + template (present) uint7_t tai8_ta := ?, + template (present) uint7_t tai9_ta := ?, + template (present) uint7_t tai10_ta := ?, + template (present) uint7_t tai11_ta := ?, + template (present) uint7_t tai12_ta := ?, + template (present) uint7_t tai13_ta := ?, + template (present) uint7_t tai14_ta := ?, + template (present) uint7_t tai15_ta := ?) := { + ta_idx := { + { spare := '0'B, ta_val := tai0_ta }, + { spare := '0'B, ta_val := tai1_ta }, + { spare := '0'B, ta_val := tai2_ta }, + { spare := '0'B, ta_val := tai3_ta }, + { spare := '0'B, ta_val := tai4_ta }, + { spare := '0'B, ta_val := tai5_ta }, + { spare := '0'B, ta_val := tai6_ta }, + { spare := '0'B, ta_val := tai7_ta }, + { spare := '0'B, ta_val := tai8_ta }, + { spare := '0'B, ta_val := tai9_ta }, + { spare := '0'B, ta_val := tai10_ta }, + { spare := '0'B, ta_val := tai11_ta }, + { spare := '0'B, ta_val := tai12_ta }, + { spare := '0'B, ta_val := tai13_ta }, + { spare := '0'B, ta_val := tai14_ta }, + { spare := '0'B, ta_val := tai15_ta } + }, + padding := '2B2B2B2B2B2B2B'O + } + } with { encode "RAW"; variant "FIELDORDER(msb)" } |