/******************************************************************************/
// @copyright   Copyright Notification
//   No part may be reproduced except as authorized by written permission.
//   The copyright and the foregoing restriction extend to reproduction in all media.
//   Trademark 2010, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC).
//   All rights reserved.
// @version: IWD_10wk37
// $Date: 2010-09-15 17:58:51 +0200 (Wed, 15 Sep 2010) $
// $Rev: 3904 $
/******************************************************************************/

module UTRAN_RAB_TemplatesTDD {
  
  //----------------------------------------------------------------------
  // Import part
  //----------------------------------------------------------------------
  
  import from UTRAN_RRC_ASN1_Definitions language "ASN.1:1997" all;
  import from UTRAN_ASP_Definitions language "ASN.1:1997" all;
  import from UTRAN_RAB_Templates all;
  import from UTRAN_RAB_TemplatesFDD all;  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  import from UTRAN_Parameters all;
  import from UTRAN_ASN1_Templates all;
  import from UTRAN_Templates all;
  import from UTRAN_TypeDefs all;
   
  //----------------------------------------------------------------------
  // Template init functions
  //----------------------------------------------------------------------
  
  //* @desc Function that determines the number of HARQ processes for TDD
  function f_GetNrOfHarqProcesses_TDD ( ) return HarqNrOfProcesses_Type {
    var HarqNrOfProcesses_Type v_NumberOfProcesses := n4;
    
    if ( ( px_HSDSCH_UE_Category_TDD == 2 ) or
         ( px_HSDSCH_UE_Category_TDD == 5 ) or
         ( px_HSDSCH_UE_Category_TDD == 8 ) or
         ( px_HSDSCH_UE_Category_TDD == 11 ) or
         ( px_HSDSCH_UE_Category_TDD == 14 ) ) {
      v_NumberOfProcesses := n6;
    }
    else if ( ( px_HSDSCH_UE_Category_TDD == 3 ) or
              ( px_HSDSCH_UE_Category_TDD == 6 ) or
              ( px_HSDSCH_UE_Category_TDD == 9 ) or
              ( px_HSDSCH_UE_Category_TDD == 12 ) or
              ( px_HSDSCH_UE_Category_TDD == 15 ) ) {
      v_NumberOfProcesses := n8;
    }
    
    return v_NumberOfProcesses;
  }
  
  template (value) DL_AddReconfTransChInfoList_r7 cs_DL_AddReconfTransChInfoList_2DCH_HS_PS_HSDPA_TDD :=
  {
    cds_DL_AddReconfTransChInfoSameUL_HSDPA ( tsc_DL_DCH5, tsc_UL_DCH5 ),
    cs_DL_AddReconfTransChInfoDCH_PS_TFCS_01_HSDPA ( tsc_DL_DCH1 ),
    cs_DL_AddReconfTransChHSDSCHInfo_HSDPA ( cs_HSDSCH_Info ( cs_HARQ_Info_TDD,
                                                              cs_AddOrReconfMAC_dFlow ( cs_MAC_hs_AddReconfQueue336 ) ) )
  };
  
  template (value) HARQ_Info_r7 cs_HARQ_Info_TDD :=
  {
    numberOfProcesses := f_GetNrOfHarqProcesses_TDD(),
    memoryPartitioning := {
      implicit := NULL
    }
  };
  
  template (value) U_CPHY_CONFIG_REQ cas_TrChCfgInfo_TDD ( UTRAN_CellId_Type                      p_CellId,
                                                               integer                                p_PhyChId,
                                                               template (value) TrChConfigType        p_Type,
                                                               template (value) CphyTrchConfigReq_TDD p_TrChConfig ) :=
  {
    trchConfig_TDD := {
      cellId := p_CellId,
      routingInfo := {
        physicalChannelIdentity := p_PhyChId
      },
      ratType := tdd,
      trchConfigType := p_Type,
      configMessage := p_TrChConfig
    }
  };

  template (value) CommonOrDedicatedTFS_TDD cs_DCH_336_TFS_TDD :=
  {
        tfsMode := {dedicatedTransChTFS := cs_DCH_336_TFS_UE}
  };


  template (value) U_CPHY_CONFIG_REQ cas_HS_PDSCH_SetupInfo_TDD ( UTRAN_CellId_Type p_CellId,
                                                                      integer                                 p_PhyChId,
                                                                      template (value) HS_PDSCHInfo_r5OrLater p_HS_PDSCHInfo,
                                                                      template (value) SS_ActivationTime p_SS_ActTime ) :=
  {
    rlSetup_TDD := {
      cellId := p_CellId,
      secondaryFrequency := omit,
      routingInfo := {
        physicalChannelIdentity := p_PhyChId
      },
      ratType := tdd,
      setupMessage := {
        physicalChannelInfo := {
          hS_PDSCHInfo := p_HS_PDSCHInfo
        },
        activationTime := p_SS_ActTime,
        trchConfigToFollow := omit    // DEFAULT TRUE
      }
    }
  };

  template (value) CphyTrchConfigReq_TDD.ulconnectedTrCHList cs_DCH_336_148_UL_Info_TDD :=
  {
    {
      trchid := tsc_UL_DCH1,
      ul_TransportChannelType := dch,
      transportChannelInfo := cs_DCH_336_TFS_TDD
    },
    {
      trchid := tsc_UL_DCH5,
      ul_TransportChannelType := dch,
      transportChannelInfo := cs_DCH_148_TFS_UL_TDD
    }
  };
  

  template (value) U_CPHY_CONFIG_REQ cas_UL_DPCH_ModifyInfo_TDD ( UTRAN_CellId_Type p_CellId,
                                                                      integer           p_PhyChId,
                                                                      template (value)  UL_DPCH_Info_r7 p_UL_DPCHInfo,
                                                                      template (omit)   HS_DPCCHInfo    p_HS_DPCCHInfo,
                                                                      template (value)  SS_ActivationTime p_SS_ActTime ) :=
  {
    rlModify_TDD := {
      cellId := p_CellId,
      secondaryFrequency := omit,
      routingInfo := {
        physicalChannelIdentity := p_PhyChId
      },
      ratType := tdd,
      modifyMessage := {
        activationTime := p_SS_ActTime,
        physicalChannelInfo := {
          dPCHInfo_r5 := {
            r8 := {
              ul_DPCHInfo := p_UL_DPCHInfo,
              dl_DPCHInfo := omit,
              hs_DPCCHInd := p_HS_DPCCHInfo,
              ss_UL_DPCCH_DRX_Info := omit,
              ss_DRX_Info := omit
            }
          }
        },
        trchConfigToFollow := omit
      }
    }
  };
  
  template (value) CphyTrchConfigReq_TDD.dlconnectedTrCHList cs_DCH_336_148_DL_Info_TDD :=
  {
    {
      trchid := tsc_DL_DCH1,
      dl_TransportChannelType := dch,
      transportChannelInfo := cs_DCH_336_TFS_TDD
    },
    {
      trchid := tsc_DL_DCH5,
      dl_TransportChannelType := dch,
      transportChannelInfo := cs_DCH_148_TFS_DL_TDD
    }
  };
  
  template (value) U_CPHY_CONFIG_REQ cas_DL_DPCH_ModifyInfo_TDD ( UTRAN_CellId_Type p_CellId,
                                                                      integer           p_PhyChId,
                                                                      template (value)  DL_DPCHInfo_r8 p_DL_DPCHInfo,
                                                                      template (omit)   HS_DPCCHInfo   p_Hs_DPCCHInfo,
                                                                      template (value)  SS_ActivationTime p_SS_ActTime ) :=
  {
    rlModify_TDD := {
      cellId := p_CellId,
      secondaryFrequency := omit,
      routingInfo := {
        physicalChannelIdentity := p_PhyChId
      },
      ratType := tdd,
      modifyMessage := {
        activationTime := p_SS_ActTime,
        physicalChannelInfo := {
          dPCHInfo_r5 := {
            r8 := {
              ul_DPCHInfo := omit,
              dl_DPCHInfo := p_DL_DPCHInfo,
              hs_DPCCHInd := p_Hs_DPCCHInfo,
              ss_UL_DPCCH_DRX_Info := omit,
              ss_DRX_Info := omit
            }
          }
        },
        trchConfigToFollow := omit
      }
    }
  };
  
  template (value) DL_HSPDSCH_Information_r8 cs_DL_HSPDSCH_Information_TDD ( template (value) HS_SCCH_Info_r7                        p_HS_SCCH_Info,
                                                                             template (value) HS_PDSCH_Midamble_Configuration_TDD128 p_HS_PDSCH_Midamble_Configuration_TDD128 ) :=
  {
    hs_scch_Info := p_HS_SCCH_Info,
    measurement_feedback_Info := omit,
    modeSpecificInfo := {
      tdd := {
        tdd128 := {
          hs_PDSCH_Midamble_Configuration_tdd128 := p_HS_PDSCH_Midamble_Configuration_TDD128,
          dl_MultiCarrier_Information := omit
        }
      }
    }
  };
  
  template (value) HS_SCCH_Info_r7 cs_HS_SCCH_Info_TDD :=
  {
    modeSpecificInfo := {
      tdd := {
        tdd128 := {
          nack_ack_power_offset := 0,
          power_level_HSSICH := -60,
          tpc_step_size := s1,
          bler_target := 0,
          powerControlGAP := omit,
          pathlossCompensationSwitch := omit,
          hS_SCCH_SetConfiguration := {
            {
              timeslotNumber := tsc_DL_TS_SCCH,
              firstChannelisationCode := cc16_5,
              secondChannelisationCode := cc16_6,
              midambleAllocationMode := {
                defaultMidamble := NULL
              },
              midambleConfiguration := 4,
              hs_sich_configuration := {
                timeslotNumber := tsc_UL_TS_SICH,
                channelisationCode := cc16_11,
                midambleAllocationMode := {
                  defaultMidamble := NULL
                },
                midambleConfiguration := 4
              }
            },
            {
              timeslotNumber := tsc_DL_TS_SCCH,
              firstChannelisationCode := cc16_7,
              secondChannelisationCode := cc16_8,
              midambleAllocationMode := {
                defaultMidamble := NULL
              },
              midambleConfiguration := 4,
              hs_sich_configuration := {
                timeslotNumber := tsc_UL_TS_SICH,
                channelisationCode := cc16_12,
                midambleAllocationMode := {
                  defaultMidamble := NULL
                },
                midambleConfiguration := 4
              }
            },
            {
              timeslotNumber := tsc_DL_TS_SCCH,
              firstChannelisationCode := cc16_9,
              secondChannelisationCode := cc16_10,
              midambleAllocationMode := {
                defaultMidamble := NULL
              },
              midambleConfiguration := 4,
              hs_sich_configuration := {
                timeslotNumber := tsc_UL_TS_SICH,
                channelisationCode := cc16_13,
                midambleAllocationMode := {
                  defaultMidamble := NULL
                },
                midambleConfiguration := 4
              }
            },
            {
              timeslotNumber := tsc_DL_TS_SCCH,
              firstChannelisationCode := cc16_11,
              secondChannelisationCode := cc16_12,
              midambleAllocationMode := {
                defaultMidamble := NULL
              },
              midambleConfiguration := 4,
              hs_sich_configuration := {
                timeslotNumber := tsc_UL_TS_SICH,
                channelisationCode := cc16_14,
                midambleAllocationMode := {
                  defaultMidamble := NULL
                },
                midambleConfiguration := 4
              }
            }
          }
        }
      }
    }
  };
  
  template (value) HS_PDSCH_Midamble_Configuration_TDD128 cs_HS_PDSCH_Midamble_Configuration_TDD128 :=
  {
    midambleAllocationMode := {
      defaultMidamble := NULL
    },
    midambleConfiguration := 4
  };

  template (value) CphyTrchConfigReq_TDD cs_CphyTrchConfigReq_Common_TDD ( template (value) SS_ActivationTime               p_ActivationTime,
                                                                           template (omit) CphyUlConnectedTrCHList_TDD_Type p_UlconnectedTrCHList,
                                                                           template (omit) TFCS                             p_UlTfcs,
                                                                           template (omit) CphyDlConnectedTrCHList_TDD_Type p_DlconnectedTrCHList,
                                                                           template (omit) TFCS                             p_DlTfcs,
                                                                           template (omit) HS_DSCHMACdFlows                 p_HSDSCHMacdFlows,
                                                                           template (omit) E_DCHMACdFlows_TDD               p_E_DCHMacdFlows ) :=
  {
    activationTime       := p_ActivationTime,
    ulconnectedTrCHList  := p_UlconnectedTrCHList,
    ulTFCS               := p_UlTfcs,
    dlconnectedTrCHList  := p_DlconnectedTrCHList,
    dlTFCS               := p_DlTfcs,
    hsDSCHMacdFlows      := p_HSDSCHMacdFlows,
    e_DCHMacdFlows       := p_E_DCHMacdFlows,
    ehs_DSCH_Flows := omit,
    ehs_DSCH_CommonFlows := omit,
    e_DCHMacd_CommonFlows := omit
  };
  
  
  template (value) CphyTrchConfigReq_TDD.dlconnectedTrCHList cs_DCH_148_DL_TDD := {
    {
      trchid := tsc_DL_DCH5,
      dl_TransportChannelType := dch,
      transportChannelInfo := cs_DCH_148_TFS_DL_TDD
    }
  };
  
  template (value) DL_InformationPerRL_List_r7 cs_DL_InformationPerRL_r7_TDD ( CellParametersID                      p_CellParametersID,
                                                                               template (value) DL_DPCH_InfoPerRL_r7 p_DL_DPCH_InfoPerRL_r7 ) :=
  { /* According to condition A3 in TS 34.108 clause 9.1.1: Downlink information for each radio link list */
    {
      modeSpecificInfo := {
        tdd := {
          tdd := {
            tddOption := {
              tdd128 := {
                tstd_Indicator := false
              }
            },
            cellParametersID := p_CellParametersID,
            sctd_Indicator := false
          }
        }
      },
      dl_dpchInfo := {
        dl_DPCH_InfoPerRL := p_DL_DPCH_InfoPerRL_r7
      },
      e_AGCH_Information := omit,
      modeSpecificInfo2 := {
        tdd := {
          tdd128 := {
            e_HICH_Info := omit
          }
        }
      },
      cell_id := omit
    }
  };
  
  template (value) DL_CommonTransChInfo_r4 cs_DL_CommonTransChInfoDCH_TDD ( template (value) TFCS p_Tfcs ) :=
  { /* Values according to condition A3 in TS 34.108 clause 9.1.1: DL Transport channel information common for all transport channel */
    sccpch_TFCS := omit,
    modeSpecificInfo := {
      tdd := {
        individualDL_CCTrCH_InfoList := {{
            dl_TFCS_Identity := {
              tfcs_ID := 1,
              sharedChannelIndicator := false
            },
            tfcs_SignallingMode := {
              explicit_config := p_Tfcs
            }
          }
        }
      }
    }
  };

  template (value) UL_CommonTransChInfo_r4 cs_UL_CommTrChInfoDCH_PS_64k_TDD :=
  { // Values according to TS 34.108 clause 9.1.1: UL Transport channel information common for all transport channels using condition A3
    tfc_Subset := omit,
    prach_TFCS := omit,
    modeSpecificInfo := {
      tdd := {
        individualUL_CCTrCH_InfoList := {
          {
            ul_TFCS_Identity := {
              tfcs_ID := 1,
              sharedChannelIndicator := false
            },
            ul_TFCS := cs_TFCS_Cmpl0_1_2_3_4_5_6_7_8_9_Tx ( cs_PowerOffsetInfo_TDD ),
            tfc_Subset := {fullTFCS := NULL}
          }
        }
      }
    },
    tfc_SubsetList := omit
  };
  
  template (value) DL_CommonInformation_r8 cs_DL_CommonInfoDCH_initialise_TDD :=
  {
    dl_dpchInfoCommon := {
      dl_DPCH_InfoCommon := {
        cfnHandling := {
          initialise := NULL
        },
        modeSpecificInfo := {
          tdd := {
            dl_DPCH_PowerControlInfo := {
              modeSpecificInfo := {
                tdd := {
                  tpc_StepSizeTDD := 1
                }
              }
            }
          }
        },
        mac_d_HFN_initial_value := omit
      }
    },
    modeSpecificInfo := {
      tdd := {
        tddOption := {
          tdd128 := {
            tstd_Indicator := false
          }
        },
        defaultDPCH_OffsetValue := 0
      }
    },
    mac_hsResetIndicator := omit,
    postVerificationPeriod := omit
  };
  
  template (value) UL_DPCH_Info_r7 cs_UL_DPCH_64K_PS_TDD := cs_UL_DPCH_Info_1TS_TDD (1, 0, tfci_bits_16, pl0_56,1, tsc_UL_DPCH1_ChC_64k_PS);
  
  template (value) DL_DPCHInfo_r8 cs_DL_DPCH_64K_PS_TDD ( template (value) DL_CommonInformation_r8 p_DL_CommonInformation) :=
  {
    dl_CommonInformation := p_DL_CommonInformation,
    dl_Dpch_InfoPerRL := {
      dl_DPCH_InfoPerRL := cs_DL_DPCH_InfoPerRL_r7_64K_PS_TDD
    },
    rl_Information := cs_RL_InfoDef
  };

  template (value) DL_DPCH_InfoPerRL_r7 cs_DL_DPCH_InfoPerRL_r7_64K_PS_TDD :=
  {
    tdd := {
      dl_CCTrChListToEstablish := {
        {
          tfcs_ID := 1,
          timeInfo := {
            activationTime := omit,
            durationTimeInfo := omit
          },
          commonTimeslotInfo := {
            secondInterleavingMode := frameRelated,
            tfci_Coding     := tfci_bits_16,
            puncturingLimit := pl0_48,
            repetitionPeriodAndLength := { repetitionPeriod1:= NULL }
          },
          tddOption := {
            tdd128 := {
              dl_CCTrCH_TimeslotsCodes := {
                firstIndividualTimeslotInfo := {
                  timeslotNumber := 4,
                  tfci_Existence := true,
                  midambleShiftAndBurstType := {
                    midambleAllocationMode := {defaultMidamble := NULL},
                    midambleConfiguration := 4
                  },
                  modulation := mod_QPSK,
                  ss_TPC_Symbols := one,
                  additionalSS_TPC_Symbols := omit
                },  // first
                dl_TS_ChannelisationCodesShort := {
                  codesRepresentation := {  bitmap := '1111111100000000'B}
                },
                moreTimeslots := { noMore := NULL}
              }  // dl_CCTrCH
            }
          }, //tdd128
          ul_CCTrChTPCList := omit
        }
      },
      dl_CCTrChListToRemove := omit
    }
  };
  
  template (value) TrCHInfo_TDD cs_TrChInfoDL_336_148_TDD :=
  {
    ulconnectedTrCHList := omit,
    ulTFCS := omit,
    dlconnectedTrCHList := {
      {
        trchid := tsc_DL_DCH1,
        transportChannelInfo := cs_DCH_336_TFS_TDD
      },
      {
        trchid := tsc_DL_DCH5,
        transportChannelInfo := cs_DCH_148_TTI_10_TFS_TDD
      }
    },
    dlTFCS := cs_TFCS_Cmpl0_1_2_3_4_5_6_7_8_9_Tx ( cs_PowerOffsetInfo_TDD ),
    hsDSCHMacdFlows := omit
  };
  
  template (value) TrCHInfo_TDD cs_TrChInfoUL_336_148_TDD :=
  {
    ulconnectedTrCHList := {
      {
        trchid := tsc_UL_DCH1,
        transportChannelInfo := cs_DCH_336_TFS_TDD
      },
      {
        trchid := tsc_UL_DCH5,
        transportChannelInfo := cs_DCH_148_TFS_UL_TDD
      }
    },
    ulTFCS := cs_TFCS_Cmpl0_1_2_3_4_5_6_7_8_9_Rx,   // sent to SS
    dlconnectedTrCHList := omit,
    dlTFCS := omit,
    hsDSCHMacdFlows := omit
  };

  //* @desc ASN.1 PDU Constraint. Defined in TS 34.108 clause 9.
  template (value) DL_DCCH_Message cs_108_RB_SetUp64k_PS_TDD ( IntegrityCheckInfo        p_Integrityinfo,
                                                               RRC_TransactionIdentifier p_RRC_Ti,
                                                               ActivationTime            p_Activetime,
                                                               CellParametersID      p_CellParametersID) :=
  {//FFS - Check this template so that it matches the values in f_SS_HO_Config_64kPS_TDD
    integrityCheckInfo := p_Integrityinfo,
    message_ := {
      radioBearerSetup := {
        later_than_r3 := {
          rrc_TransactionIdentifier := p_RRC_Ti,
          criticalExtensions := {
            criticalExtensions := {
              criticalExtensions := {
                criticalExtensions := {
                  criticalExtensions := {
                    r8 := {
                      radioBearerSetup_r8 := {
                        integrityProtectionModeInfo := omit,
                        cipheringModeInfo := omit,
                        sr_vcc_Info := omit,//FFS - Check value
                        activationTime := p_Activetime,
                        new_U_RNTI := omit,
                        new_C_RNTI := omit,
                        new_DSCH_RNTI := omit,
                        new_H_RNTI := omit,
                        newPrimary_E_RNTI := omit, //FFS - Check value
                        newSecondary_E_RNTI := omit, //FFS - Check value
                        rrc_StateIndicator := cell_DCH,
                        utran_DRX_CycleLengthCoeff := omit,
                        ura_Identity := omit,//FFS - Check value
                        supportForChangeOfUE_Capability := omit,//FFS - chack value
                        cn_InformationInfo := omit,
                        srb_InformationSetupList := omit,
                        rab_InformationSetupList := {
                          cs_RAB_InfoSetupDCH_PS_64k ( cs_RLC_InfoAM_Def )
                        },
                        rab_InformationReconfigList := omit,//FFS - Check value
                        rb_InformationReconfigList := omit,//FFS - Check value
                        rb_InformationAffectedList := omit,
                        dl_CounterSynchronisationInfo := omit,//FFS - check value
                        pdcp_ROHC_TargetMode := omit, //FFS - Check value
                        ul_CommonTransChInfo := cs_UL_CommTrChInfoDCH_PS_64k_TDD,
                        ul_deletedTransChInfoList := omit,
                        ul_AddReconfTransChInfoList := cs_UL_AddReconfTransChInfoListDCH_PS_64k,
                        dl_CommonTransChInfo := cs_DL_CommonTransChInfoDCH_TDD ( cs_TFCS_Cmpl0_1_2_3_4_5_6_7_8_9_Rx ),
                        dl_DeletedTransChInfoList := omit,
                        dl_AddReconfTransChInfoList := cs_DL_AddReconfTransChInfoListDCH_PS_64k,
                        frequencyInfo := omit,
                        multi_frequencyInfo := omit,//FFS - Check value
                        dtx_drx_TimingInfo := omit, //FFS - Check value
                        dtx_drx_Info := omit, //FFS - Check value
                        hs_scch_LessInfo := omit, //FFS - Check value
                        mimoParameters := omit, //FFS - Check value
                        maxAllowedUL_TX_Power := tsc_MaxAllowPwr,
                        ul_DPCH_Info := cs_UL_DPCH_64K_PS_TDD,
                        ul_EDCH_Information := omit, //FFS - Check value
                        dl_HSPDSCH_Information := omit, //FFS - Check value
                        dl_CommonInformation := cs_DL_CommonInfoDCH_initialise_TDD,
                        dl_InformationPerRL_List := cs_DL_InformationPerRL_r8_TDD ( p_CellParametersID, cs_DL_DPCH_InfoPerRL_r7_64K_PS_TDD ),
                        dl_SecondaryCellInfoFDD := omit,//FFS - Check value
                        controlChannelDRXInfo_TDD128 := omit, //FFS - Check value
                        sps_Information_TDD128 := omit, //FFS - Check value
                        mbms_PL_ServiceRestrictInfo := omit//FFS - Check value
                      },
                      radioBearerSetup_r8_add_ext := omit,//FFS - Check Value
                      v7d0NonCriticalExtensions := omit                      /* @sic R5s100135 sic@ */
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  };
  
  template (value) DL_DCCH_Message cs_108_RB_SetUpSpeech_TDD ( IntegrityCheckInfo p_Integrityinfo,
                                                               RRC_TransactionIdentifier p_RRC_Ti,
                                                               ActivationTime p_Activetime,
                                                               bitstring p_RAB_Id,
                                                               CellParametersID p_CellParametersID) :=
  {
    integrityCheckInfo := p_Integrityinfo,
    message_ := {
      radioBearerSetup := {
        later_than_r3 := {
          rrc_TransactionIdentifier := p_RRC_Ti,
          criticalExtensions := {
            criticalExtensions := {
              criticalExtensions := {
                criticalExtensions := {
                  criticalExtensions := {
                    r8 := {
                      radioBearerSetup_r8 := {//RadioBearerSetup-r8-IEs
                        integrityProtectionModeInfo := omit,
                        cipheringModeInfo           := omit,
                        sr_vcc_Info                 := omit,
                        activationTime              := p_Activetime,
                        new_U_RNTI                  := omit,
                        new_C_RNTI                  := omit,
                        new_DSCH_RNTI               := omit,
                        new_H_RNTI                  := omit,
                        newPrimary_E_RNTI           := omit,
                        newSecondary_E_RNTI         := omit,
                        rrc_StateIndicator          := cell_DCH,
                        utran_DRX_CycleLengthCoeff  := omit,
                        ura_Identity                := omit,
                        supportForChangeOfUE_Capability := omit,
                        cn_InformationInfo              := omit,
                        srb_InformationSetupList        := omit,
                        rab_InformationSetupList := {
                          cs_RAB_InfoSetupTM_12_2k ( useT314, p_RAB_Id)
                        },
                        rab_InformationReconfigList   := omit,
                        rb_InformationReconfigList    := omit,
                        rb_InformationAffectedList    := omit,
                        dl_CounterSynchronisationInfo := omit,
                        pdcp_ROHC_TargetMode          := omit,
                        ul_CommonTransChInfo          := cs_UL_CommTrChInfoTM_12_2k_TDD,
                        ul_deletedTransChInfoList     := omit,
                        ul_AddReconfTransChInfoList   := cs_UL_AddReconfTransChInfoListTM_12_2k,
                        dl_CommonTransChInfo          := cs_DL_CommonTransChInfoSameAsUL_r4_TDD,
                        dl_DeletedTransChInfoList     := omit,
                        dl_AddReconfTransChInfoList   := cs_DL_AddReconfTransChInfoListTM_12_2k,
                        frequencyInfo                 := omit,
                        multi_frequencyInfo           := omit,
                        dtx_drx_TimingInfo            := omit,
                        dtx_drx_Info                  := omit,
                        hs_scch_LessInfo              := omit,
                        mimoParameters                := omit,
                        maxAllowedUL_TX_Power         := tsc_MaxAllowPwr,
                        ul_DPCH_Info                  := cs_UL_DPCH_Speech_TDD,
                        ul_EDCH_Information         := omit,
                        dl_HSPDSCH_Information      := omit,
                        dl_CommonInformation        := cs_DL_CommonInfoDCH_initialise_TDD,
                        dl_InformationPerRL_List    := cs_DL_InformationPerRL_r8_TDD ( p_CellParametersID, cs_DL_DPCH_InfoPerRL_Speech_TDD ),
                        dl_SecondaryCellInfoFDD      := omit,
                        controlChannelDRXInfo_TDD128 := omit,
                        sps_Information_TDD128       := omit,
                        mbms_PL_ServiceRestrictInfo  := omit
                      },
                      radioBearerSetup_r8_add_ext := omit,
                      v7d0NonCriticalExtensions := omit                      /* @sic R5s100135 sic@ */
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  };

  //* @desc ASN.1 PDU Constraint Defined in TS 34.108 clause 9. But uses 64 K uplink
  template (value) DL_DCCH_Message cs_108_RB_SetUpHS_FromDCH_UL_64k_TDD ( IntegrityCheckInfo        p_Integrityinfo,
                                                                          RRC_TransactionIdentifier p_RRC_Ti,
                                                                          ActivationTime            p_Activetime,
                                                                          CellParametersID          p_CellParametersID ) :=
  {
    integrityCheckInfo := p_Integrityinfo,
    message_ := {
      radioBearerSetup := {
        later_than_r3 := {
          rrc_TransactionIdentifier := p_RRC_Ti,
          criticalExtensions := {
            criticalExtensions := {
              criticalExtensions := {
                criticalExtensions := {
                  criticalExtensions := {
                    r8 := {
                      radioBearerSetup_r8 := {
                        integrityProtectionModeInfo := omit,
                        cipheringModeInfo := omit,
                        sr_vcc_Info := omit,
                        activationTime := p_Activetime,
                        new_U_RNTI := omit,
                        new_C_RNTI := omit,
                        new_DSCH_RNTI := omit,
                        new_H_RNTI := '1010101010101010'B,
                        newPrimary_E_RNTI := omit,
                        newSecondary_E_RNTI := omit,
                        rrc_StateIndicator := cell_DCH,
                        utran_DRX_CycleLengthCoeff := omit,
                        ura_Identity := omit,
                        supportForChangeOfUE_Capability := omit,
                        cn_InformationInfo := omit,
                        srb_InformationSetupList := omit,
                        rab_InformationSetupList := {
                          cs_RAB_InfoSetupDCH_PS_HSDPA ( cs_RLC_InfoAM_Def_HSDPA )//FFS - Checl values
                        },
                        rab_InformationReconfigList := omit,
                        rb_InformationReconfigList := omit,
                        rb_InformationAffectedList := omit,
                        dl_CounterSynchronisationInfo := omit,
                        pdcp_ROHC_TargetMode := omit,
                        ul_CommonTransChInfo := cs_UL_CommTrChInfoDCH_PS_64k_TDD,//FFS - Check values
                        ul_deletedTransChInfoList := omit,
                        ul_AddReconfTransChInfoList := cs_UL_AddReconfTransChInfoListDCH_PS_64k,//FFs - check values
                        dl_CommonTransChInfo := cs_DL_CommonTransChInfoDCH_TDD ( cs_TFCS_Cmpl0_1_Rx ),//FFS - check values
                        dl_DeletedTransChInfoList := omit,
                        dl_AddReconfTransChInfoList := cs_DL_AddReconfTransChInfoList_2DCH_HS_PS_HSDPA_TDD,//FFS - check values
                        frequencyInfo := omit,
                        multi_frequencyInfo := omit,
                        dtx_drx_TimingInfo := omit,
                        dtx_drx_Info := omit,
                        hs_scch_LessInfo := omit,
                        mimoParameters := omit,
                        maxAllowedUL_TX_Power := tsc_MaxAllowPwr,
                        ul_DPCH_Info := cs_UL_DPCH_64K_PS_TDD,
                        ul_EDCH_Information := omit,
                        dl_HSPDSCH_Information := cs_DL_HSPDSCH_Information_TDD ( cs_HS_SCCH_Info_TDD,
                                                                                  cs_HS_PDSCH_Midamble_Configuration_TDD128 ),
                        dl_CommonInformation := cs_DL_CommonInfoDCH_initialise_TDD,
                        dl_InformationPerRL_List := cs_DL_InformationPerRL_r8_TDD ( p_CellParametersID, cs_DL_DPCH_InfoPerRL_SRB_TDD ),
                        dl_SecondaryCellInfoFDD := omit,
                        controlChannelDRXInfo_TDD128 := omit,
                        sps_Information_TDD128 := omit,
                        mbms_PL_ServiceRestrictInfo := omit
                      },
                      radioBearerSetup_r8_add_ext := omit,
                      v7d0NonCriticalExtensions := omit                      /* @sic R5s100135 sic@ */
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  };
  
  template (value) PowerOffsetInformation cs_PowerOffsetInfo_TDD :=
  {
    gainFactorInformation := {
      signalledGainFactors := {
        modeSpecificInfo := {
          tdd := NULL
        },
        gainFactorBetaD := tsc_GainFactorBetaD,
        referenceTFC_ID := 0
      }
    },
    powerOffsetPp_m := omit
  };
  
  template (value) U_CRLC_CONFIG_REQ cas_RB25_AM_Info_TDD ( UTRAN_CellId_Type                 p_CellId,
                                                                integer                           p_RB_Id,
                                                                template (value) RB_LogCH_Mapping p_LogChMapping,
                                                                integer                           p_PayLoad ) :=
  {
    config := {
      cellId := p_CellId,
      routingInfo := {
        rB_Identity := p_RB_Id
      },
      ratType := tdd,
      configMessage := {
        setup := {
          sS_rlc_Info := omit,
          sS_rlc_Info_r8 := {
           r8 := {
            sS_ul_RLC_Mode := {
              dl_AM_RLC_Mode := cs_DL_AM_RLC_SS_HSDPA
            },
            sS_dl_RLC_Mode := {
              dl_PayloadSize := p_PayLoad,
              dl_RLCModeInfo := {
                ul_AM_RLC_Mode := cds_UL_AM_RLC_HSDPA
              },
              dl_UM_RLC_LI_size := omit, //only for UM RLC configuration
              dl_UM_outOfSeqDelivery := omit,
              dl_RLC_PDU_size := omit
            },
            rlc_OneSidedReEst := omit,//default false
            altE_bitInterpretation := omit,//default false
            useSpecialValueOfHEField := omit,//default false
            uM_SN_DeliveryMode := omit // DEFAULT nonConfigured
            }
          },
          rB_LogCH_Mapping := p_LogChMapping
        }
      },
      activationTime := omit
    }
  };
  
  template (value) U_CMAC_CONFIG_REQ cas_CMAC_MAChs_TFRC_ExplicitConfigReq_TDD ( UTRAN_CellId_Type p_CellId ) :=
  {
    tfrc_TDD := {
      cellId := p_CellId,
      tfrcConfigMode := {
        explicitlyConfigured := {
          modulationScheme := qpsk,
          noOfTimeSlots := 5,
          startCode := cc16_1,
          stopCode := cc16_12,
          noOfCodesPerTimeslot := 12,
          tbSizeIndexOnHS_SCCH := 1,
          redundancyVersions := { 0, 2, 5, 6, 1, 3, 7, 4  },
          hs_PDSCH_TxPower := tsc_DL_hs_PDSCH_TxPower
        }
      }
    }
  };

  template (value) TrCHInfo_TDD cs_TrCHInfo_Common_TDD ( template (omit) UlConnectedTrCHList_TDD_Type p_UlconnectedTrCHList_TDD,
                                                         template (omit) TFCS                         p_UlTfcs,
                                                         template (omit) DlConnectedTrCHList_TDD_Type p_DlconnectedTrCHList_TDD,
                                                         template (omit) TFCS                         p_DlTfcs,
                                                         template (omit) HS_DSCHMACdFlows             p_HsDSCHMacdFlows
                                                         //template (omit) EHS_DSCH_Flows               p_Ehs_DSCH_Flows,
                                                         //template (omit) EHS_DSCH_CommonFlows         p_Ehs_DSCH_CommonFlows
                                                         ) :=
  {
    ulconnectedTrCHList  := p_UlconnectedTrCHList_TDD,
    ulTFCS               := p_UlTfcs,
    dlconnectedTrCHList  := p_DlconnectedTrCHList_TDD,
    dlTFCS               := p_DlTfcs,
    hsDSCHMacdFlows      := p_HsDSCHMacdFlows
    // ehs_DSCH_Flows       := p_Ehs_DSCH_Flows,
    //ehs_DSCH_CommonFlows := p_Ehs_DSCH_CommonFlows
  };

  template (value) UL_CommonTransChInfo_r4 cs_UL_CommTrChInfoTM_12_2k_TDD :=
  {
    tfc_Subset := omit,
    prach_TFCS := omit,
    modeSpecificInfo := {
      tdd := {
        individualUL_CCTrCH_InfoList := {
          {
            ul_TFCS_Identity := {
              tfcs_ID := 1,
              sharedChannelIndicator := false
            },
            ul_TFCS := cs_TFCS_Cmpl0_1_11_12_13_23_Tx ( cs_PowerOffsetInfo_TDD ),
            tfc_Subset := {fullTFCS := NULL}
          }
        }
      }
    },
    tfc_SubsetList := omit
  };
  
  // =============================================================================
  // ASN.1 ASP Constraint
  // *** Comments:
  // For TDD mode only, used in aknowledged mode RLC testing
  // *** additional Notes:
  // For DCH1 transport channel the following parameters are fixed by core spec.(34.123 cl. 7.2):
  // TTI = 40 ms;
  // two transport formats: TransportBlocks = 1, TB size = 148 bits; TansportBlock = 0, Size = 148.
  // coding = convolutional;
  // coding rate = 1/3;
  // CRCsize = 16;
  // RateMatching = 155
  // -----------------------------------------------------------------------------
   template (value) U_CPHY_CONFIG_REQ cas_DCH4_DL_Info_TDD ( UTRAN_CellId_Type               p_CellId,
                                                                 integer                         p_PhyChId,
                                                                 template (value) TrChConfigType p_Type,
                                                                 ActivationTime                  p_ActivationTime ) :=
   {
     trchConfig_TDD := {
       cellId := p_CellId,
       routingInfo := {
         physicalChannelIdentity := p_PhyChId
       },
       ratType := tdd,
       trchConfigType := p_Type,
       configMessage := {
         activationTime := {
           activationCFN := p_ActivationTime
        },
        ulconnectedTrCHList := omit,
         ulTFCS              := omit,
         dlconnectedTrCHList := {
          {
             trchid := tsc_DL_DCH1,
             dl_TransportChannelType := dch,
             transportChannelInfo := cs_DCH_81_TFS_DL_TDD
           },
          {
            trchid := tsc_DL_DCH2,
            dl_TransportChannelType := dch,
            transportChannelInfo := cs_DCH_103_TFS_TDD
          },
          {
            trchid := tsc_DL_DCH3,
            dl_TransportChannelType := dch,
            transportChannelInfo := cs_DCH_60_TFS_TDD
          },
          {
             trchid := tsc_DL_DCH5,
            dl_TransportChannelType := dch,
           transportChannelInfo := cs_DCH_148_TFS_DL_TDD
           }
         },
        dlTFCS := cs_TFCS_Cmpl0_1_11_12_13_23_Tx(cs_PowerOffsetInfo_TDD),
         hsDSCHMacdFlows      := omit,
        e_DCHMacdFlows       := omit,
        ehs_DSCH_Flows := omit,
        ehs_DSCH_CommonFlows := omit,
        e_DCHMacd_CommonFlows := omit
      }
     }
  };
  
  template (value) DL_DPCHInfo_r8 cs_DL_DPCH_122_AMR_TDD ( template (value) DL_CommonInformation_r8 p_DL_CommonInformation) :=
  {
    dl_CommonInformation := p_DL_CommonInformation,
    dl_Dpch_InfoPerRL := {
      dl_DPCH_InfoPerRL := cs_DL_DPCH_InfoPerRL_Speech_TDD
    },
    rl_Information := {
      powerOffsetOfTFCI_PO1 := tsc_DPCH_PowerOffsetTFCI,
      powerOffsetOfTPC_PO2 := tsc_DPCH_PowerOffsetTPC,
      powerOffsetOfPILOT_PO3 := tsc_DPCH_PowerOffsetPILOT,
      dl_TxPower := tsc_DL_TxPower_DPCH,
      dl_TxPowerMax        := 15,
      dl_TxPowerMin        := -35,
      cfnTgtSfnFrameOffset := omit
    }
  };

  template (value) TrCHInfo_TDD cs_TrChInfoDL_122_AMR_TDD :=    // !!!!! IS NOT A TTD TYPE
  {
    ulconnectedTrCHList := omit,
    ulTFCS              := omit,
    dlconnectedTrCHList := {
      {
        trchid := tsc_DL_DCH1,
        transportChannelInfo := cs_DCH_81_TFS_DL_TDD
      },
      {
        trchid := tsc_DL_DCH2,
        transportChannelInfo := cs_DCH_103_TFS_TDD
      },
      {
        trchid := tsc_DL_DCH3,
        transportChannelInfo := cs_DCH_60_TFS_TDD
      },
      {
        trchid := tsc_DL_DCH5,
        transportChannelInfo := cs_DCH_148_TFS_DL_TDD
      }
    },
    dlTFCS := cs_TFCS_Cmpl0_1_11_12_13_23_Tx(cs_PowerOffsetInfo_TDD),
    hsDSCHMacdFlows       := omit
  };

  // =============================================================================
  // ASN.1 ASP Constraint
  // *** Comments:
  // For TDD mode only, used in aknowledged mode RLC testing
  // *** additional Notes:
  // For DCH1 transport channel the following parameters are fixed by core spec.(34.123 cl. 7.2):
  // TTI = 40 ms;
  // two transport formats: TransportBlocks = 1, TB size = 148 bits; TansportBlock = 0, Size = 148.
  // coding = convolutional;
  // coding rate = 1/3;
  // CRCsize = 16;
  // RateMatching = 155
  // -----------------------------------------------------------------------------
  template (value) U_CPHY_CONFIG_REQ cas_DCH4_UL_Info_TDD ( UTRAN_CellId_Type               p_CellId,
                                                                integer                         p_PhyChId,
                                                                template (value) TrChConfigType p_Type,
                                                                ActivationTime                  p_ActivationTime ) :=
  {
    trchConfig_TDD := {
      cellId := p_CellId,
      routingInfo := {
        physicalChannelIdentity := p_PhyChId
      },
      ratType := tdd,
      trchConfigType := p_Type,
      configMessage := {
        activationTime := {
          activationCFN := p_ActivationTime
        },
        ulconnectedTrCHList := {
          {
            trchid := tsc_UL_DCH1,
            ul_TransportChannelType := dch,
            transportChannelInfo := cs_DCH_81_TFS_TDD
          },
          {
            trchid := tsc_UL_DCH2,
            ul_TransportChannelType := dch,
            transportChannelInfo := cs_DCH_103_TFS_TDD
          },
          {
            trchid := tsc_UL_DCH3,
            ul_TransportChannelType := dch,
            transportChannelInfo := cs_DCH_60_TFS_TDD
          },
          {
            trchid := tsc_UL_DCH5,
            ul_TransportChannelType := dch,
            transportChannelInfo := cs_DCH_148_TFS_UL_TDD
          }
        },
        ulTFCS := cs_TFCS_Cmpl0_1_11_12_13_23_Rx,
        dlconnectedTrCHList := omit,
        dlTFCS          := omit,
        hsDSCHMacdFlows := omit,
        e_DCHMacdFlows  := omit,
        ehs_DSCH_Flows := omit,
        ehs_DSCH_CommonFlows := omit,
        e_DCHMacd_CommonFlows := omit
      }
    }
  };

}
