/******************************************************************************/
// @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-08-19 00:48:00 +0200 (Thu, 19 Aug 2010) $
// $Rev: 3727 $
/******************************************************************************/

module EUTRA_ASP_TypeDefs {
  /* Type definitions for configuration of the system simulator;
   * Common design principles:
   * Semantics of OMIT: for all TTCN-3 type definitions used in ASPs omit means "keep as it is" =>
   * - on inital configuration in general all fields shall be provided
   * - no default values for fields are foreseen
   * - if necessary non-existence of information shall be explicitly configured
   *   (e.g. with a union of "no configuration" and "configuration parameters"
   * - fields within structures imported from the core spec are excepted from this rule */

  import from CommonDefs all;
  import from EUTRA_CommonDefs all;
  import from EUTRA_RRC_ASN1_Definitions language "ASN.1:1997" all;

  //****************************************************************************

  group ASN1_Container { /* Definitions containing ASN.1 types for backward compatibility;
                          * NOTE 1: PCCH_Message and BCCH_DL_SCH_Message already have a critical extension mechanism by RRC type definition
                          * NOTE 2: BCCH_BCH_Message contains the MIB and therefore is considered to be not extendable
                          * NOTE 3: "simple types" are not considered: C_RNTI, PhysCellId, CellIdentity, ARFCN_ValueEUTRA
                          */
  type union TDD_Config_Type {
    TDD_Config R8
  };
  type union AntennaInfoCommon_Type {
    AntennaInfoCommon R8
  };
  type union AntennaInfoDedicated_Type {
    AntennaInfoDedicated R8
  };
  type union PHICH_Config_Type {
    PHICH_Config R8
  };
  type union PRACH_Config_Type {
    PRACH_Config R8
  };
  type union PUCCH_ConfigCommon_Type {
    PUCCH_ConfigCommon R8
  };
  type union PUCCH_ConfigDedicated_Type {
    PUCCH_ConfigDedicated R8
  };
  type union PUSCH_ConfigCommon_Type {
    PUSCH_ConfigCommon R8
  };
  type union PUSCH_ConfigDedicated_Type {
    PUSCH_ConfigDedicated R8
  };
  type union SoundingRS_UL_ConfigCommon_Type {
    SoundingRS_UL_ConfigCommon R8
  };
  type union SoundingRS_UL_ConfigDedicated_Type {
    SoundingRS_UL_ConfigDedicated R8
  };
  type union SchedulingRequestConfig_Type {
    SchedulingRequestConfig R8
  };
  type union CQI_ReportConfig_Type {
    CQI_ReportConfig R8
  };
  type union RACH_ConfigCommon_Type {
    RACH_ConfigCommon R8
  };
  type union RACH_ConfigDedicated_Type {
    RACH_ConfigDedicated R8
  };
  type union MeasGapConfig_Type {
    MeasGapConfig R8
  };
  type union PDCP_Config_Type {
    PDCP_Config R8
  };
  type union UL_AM_RLC_Type {
    UL_AM_RLC R8
  };
  type union DL_AM_RLC_Type {
    DL_AM_RLC R8
  };
  type union UL_UM_RLC_Type {
    UL_UM_RLC R8
  };
  type union DL_UM_RLC_Type {
    DL_UM_RLC R8
  };
  type union TTI_BundlingConfig_Type {
    boolean   R8
  };
  type union DRX_Config_Type {
    DRX_Config R8
  };
  type union SpsConfigurationDL_Type {
    SPS_ConfigDL.setup R8
  };
  type union SpsConfigurationUL_Type {
    SPS_ConfigUL.setup R8
  };
  type union UplinkPowerControlCommon_Type {
    UplinkPowerControlCommon R8
  };
  type union UplinkPowerControlDedicated_Type {
    UplinkPowerControlDedicated R8
  };

  } // End group System_Configuration

  //****************************************************************************

  group System_Configuration {
  //****************************************************************************
  // Formal ASP Definitions for system configuration
  //****************************************************************************

  type union SystemRequest_Type {
    CellConfigRequest_Type              Cell,                   /* configure/release a cell */
    CellAttenuationList_Type            CellAttenuationList,    /* power attenuation for one or several cells;
                                                                 * all cells included in the list shall be changed at the same time;
                                                                 * all cells in the list shall reach the new cell power within a maximum of 100ms (10 frames)
                                                                 * acc. to the tolerances given in TS 36.508
                                                                 * NOTE: In the common ASP part the CellId shall be set
                                                                 * - to the cell the timing information refers to if activation time shall be applied
                                                                 * - to eutra_Cell_NonSpecific when there is no activation time */
    RadioBearerList_Type                RadioBearerList,        /* configure/release one or several SRBs and/or DRBs */
    Null_Type                           EnquireTiming,          /* get SFN and sub-frame number for this cell */
    AS_Security_Type                    AS_Security,            /* StartRestart/Release of AS security */
    SpsConfig_Type                      Sps,                    /* to configure/activate or release semi-persistent scheduling */
    PagingTrigger_Type                  Paging,                 /* to trigger SS to send paging at the given paging occasion (as calculated in TTCN) */
    L1Mac_IndicationControl_Type        L1MacIndCtrl,           /* to configure SS to generate indications for L1/MAC events */
    Rlc_IndicationControl_Type          RlcIndCtrl,             /* to configure SS to generate indications for RLC events */
    PDCP_CountReq_Type                  PdcpCount,              /* to set or enquire PDCP COUNT for one ore more RBs */
    PDCP_HandoverControlReq_Type        PdcpHandoverControl,    /* to inform the target cell about the handover */
    L1_TestMode_Type                    L1_TestMode,            /* To Set L1/MAC in special Test modes eg. DL CRC, PHICH etc */
    RA_PDCCH_Order_Type                 PdcchOrder              /* to configure SS to transmit a PDCCH order with configured C-RNTI to the UE
                                                                   to trigger RA procedure;
                                                                   result in DCI Format 1A transmission as in TS 36.212, clause 5.3.3.1.3 */
  };

  type union SystemConfirm_Type {                               /* confirmations for system configuration;
                                                                   in general to be sent after the configuration has been done */
    Null_Type                           Cell,                   /* (no further parameters from SS) */
    Null_Type                           CellAttenuationList,    /* (no further parameters from SS)
                                                                 * NOTE 1:
                                                                 * the confirmation shall be sent when all cells have changed power levels
                                                                 * NOTE 2:
                                                                 * for the CellId in the common ASP part the same rules are applied as for the SYSTEM REQ */
    Null_Type                           RadioBearerList,        /* (no further parameters from SS) */
    Null_Type                           EnquireTiming,          /* SFN and sub-frame number are included in the TimingInfo */
    Null_Type                           AS_Security,            /* (no further parameters from SS) */
    Null_Type                           Sps,                    /* (no further parameters from SS) */
    Null_Type                           Paging,                 /* normally not needed but defined for completeness */
    Null_Type                           L1MacIndCtrl,           /* (no further parameters from SS) */
    Null_Type                           RlcIndCtrl,             /* (no further parameters from SS) */
    PDCP_CountCnf_Type                  PdcpCount,              /* as response to 'Get' a list is returned containing COUNT information for the requested RBs */
    Null_Type                           PdcpHandoverControl,    /* confirmation for PDCP handover control */
    Null_Type                           L1_TestMode,            /* confirmation for L1 test mode */
    Null_Type                           PdcchOrder              /* confirmation for PDCCH Order */
  };

  type union SystemIndication_Type {
    charstring                          Error,                  /* indicates an error situation in SS;
                                                                 * is not explicitly handled in TTCN but causes an INCONC due to default behaviour;
                                                                 * an additional error code can be signalled in the common part of the ASP;
                                                                 * SS shall raise an error in case of
                                                                 * - Invalid TimingInfo for TDD
                                                                 * - Contradiction of periodic UL grants and TDD configuration
                                                                 * - Data scheduled for the same TTI does not fit into an available transport block
                                                                 * (NOTE: additional cases may occur) */
    RachPreamble_Type                   RachPreamble,           /* RACH preamble being sent by the UE */
    Null_Type                           SchedReq,               /* indication for scheduling request sent by the UE */
    BSR_Type                            BSR,                    /* to report the Buffer status report being received */
    HARQ_Type                           UL_HARQ,                /* to report the UL HARQ as received on PUCCH[TTI] for corresponding DL transmission in TTI-x,
                                                                 * where x is normally 4 */
    C_RNTI                              C_RNTI,                 /* indicates C-RNTI being contained in a MAC PDU sent by the UE */
    PHR_Type                            PHR,                    /* to report the Power headroom report received */
    HarqError_Type                      HarqError,              /* indicates detection of HARQ error:
                                                                 * 1. HARQ CRC error for UL data
                                                                 * 2. HARQ NACK from the UE unless SS is configured to report HARQ ACK/NACK */
    RlcDiscardInd_Type                  RlcDiscardInd           /* indicates e.g. discarded PDUs */
  };

  } // End group System_Configuration

  //****************************************************************************

  group Cell_Configuration { /* Specific Info for Cell Configuration Primitive */

  // Primitive definition covers:
  // - Initial cell configuration
  // - Cell reconfigurations, mainly:
  //   - Cell Power configuration
  //   - System information
  //   - (to be continued)
  // - Release of a cell

  //----------------------------------------------------------------------------

  group Cell_Configuration_Common {

  type union CellConfigRequest_Type {

    CellConfigInfo_Type         AddOrReconfigure,               /* for cell configuration:
                                                                 * CellId : identifier of the cell to be configured
                                                                 * RoutingInfo : None
                                                                 * TimingInfo : Now (for initial configuration and for reconfiguration in general)
                                                                 * ControlInfo : CnfFlag:=true; FollowOnFlag:=false (in general) */
    Null_Type                   Release                         /* to remove a cell completely -
                                                                 * CellId : identifier of the cell to be released; eutra_Cell_NonSpecific, in case all cells shall be released
                                                                 * RoutingInfo : None
                                                                 * TimingInfo : Now
                                                                 * ControlInfo : CnfFlag:=true; FollowOnFlag:=false (in general) */
  };

  type record CellConfigInfo_Type {
    /* common information for initial cell configuration or reconfiguration;
       in case of reconfiguration OMIT means 'keep configuration as it is' */
    BasicCellConfig_Type        Basic     optional,             /* basic information for a cell (e.g. broadcasting) */
    ActiveCellConfig_Type       Active    optional              /* add. configuration for active cell (i.e. cell being capable to receive RACH preamble) */
  };

  type enumerated CellConfigCapability_Type {                  /* capabilities af a cell acc. to the initial condition of a test case */
    broadcastOnlyCell,          /* no detection of RACH preables required; cell is only broadcasting */
    minimumUplinkCell,          /* detection of RACH preables required but not any further RX capability */
    fullCell                    /* full TX and RX capabilities */
  };

  type record BasicCellConfig_Type {
    CellConfigCapability_Type   ConfigCapability      optional, /* mandatory for the initial configuration; to be omitted afterwards */
    StaticCellInfo_Type         StaticCellInfo        optional, /* Common information which does not change during a test */
    // Physical layer:
    PhysicalLayerConfigDL_Type  PhysicalLayerConfigDL optional, /* default settings regarding physical control channels: PCFICH, PHICH, PDCCH */
    InitialCellPower_Type       InitialCellPower      optional, /* reference cell power for the RS of each antenna in DL
                                                                 * NOTE 1:
                                                                 * the power of the RS of an antenna may be reduced by antenna specific configuration
                                                                 * NOTE 2:
                                                                 * in general the power may be adjusted on a per resource element basis
                                                                 * => all physical channel/signal power settings shall be ajusted relatively to the RS;
                                                                 * if there are more than one TX antennas each one may have its own attenuation;
                                                                 * independently from those relative power settings the cell power can easily be adjusted by just changing the reference power */
    // MAC: locical channels shared by all UEs
    BcchConfig_Type             BcchConfig            optional, /* configuration of BCCH/BCH; SS is triggered to configure RLC/MAC regardingly;
                                                                 * BCCH data on the PDSCH is distiguished by the SI-RNTI
                                                                 * PBCH: MIB;
                                                                 * PDSCH: scheduling and resource allocation; SIBs */
    PcchConfig_Type             PcchConfig            optional  /* configuration of PCCH/PCH; SS is triggered to configure RLC/MAC regardingly;
                                                                 * PCCH data on the PDSCH is distiguished by the P-RNTI
                                                                 * (needed even to modify SI => shall be configured for CELL_BROADCASTING) */
  };

  type record ActiveCellConfig_Type {
    C_RNTI                      C_RNTI                optional, /* (pre-)configured C-RNTI;
                                                                 * affects scrambling of PDSCH/PUSCH and CRC of PDCCH(s);
                                                                 * shall be used implicitly in RACH procedure (i.e. as CE in RAR) */
    // Physical layer:
    PhysicalLayerConfigUL_Type  PhysicalLayerConfigUL optional, /* parameters for PRACH, PUCCH, PUSCH */
    // MAC: RACH procedure
    RachProcedureConfig_Type    RachProcedureConfig   optional, /* to configure the SS's behaviour for the RACH procedure */
    // MAC: UE-specific logical channels and related information
    CcchDcchDtchConfig_Type     CcchDcchDtchConfig    optional  /* Parameters related to CCCH/DCCH/DTCH in UL and DL */
  };

  //----------------------------------------------------------------------------
  // Static cell info
  //----------------------------------------------------------------------------

  type record StaticCellInfo_Type {
    /* Common information which (normally) does not change during a test;
       therefore all fields are mandatory */
    CommonStaticCellInfo_Type   Common,
    DownlinkStaticCellInfo_Type Downlink,
    UplinkStaticCellInfo_Type   Uplink optional                 /* NOTE: for TDD UL and DL are using the same parameters */
  };
  //--------------------------------------------------------
  // Common Static Cell Info
  type record CommonStaticCellInfo_Type {
    /* information common for UL and DL; all fields are mandatory */
    EUTRA_RAT_Type              RAT,                            /* FDD or TDD; FDD/TDD specific parameters */
    PhysCellId                  PhysicalCellId,                 /* N(cell, ID): imported from core spec;
                                                                 * -> cell specific reference signals (non-MBSFN)
                                                                 * -> scrambling of all DL physical channels:
                                                                 * PBCH, PCFICH, PDCCH, PHICH and PDSCH (together with nRNTI) */
    CellIdentity                eNB_CellId optional,            /* Placeholder for Cell identity (28 bits): eNB (20bits) and cell identity (8bits).
                                                                 * The use of that field is for future usage and omit for the time being */
    EutraBand_Type              EutraBand,                      /* NOTE:
                                                                 * in 3G there are overlapping bands therefore the band needs to be provided;
                                                                 * in EUTRA it is provided as well to be extendable in the future */
    CellTimingInfo_Type         CellTimingInfo
  };

  // ***** RAT types: FDD, TDD, HalfDuplexFDD
  type Null_Type EUTRA_FDD_Info_Type;                           /* no further parameters defined for FDD */
  type record EUTRA_TDD_Info_Type {
    TDD_Config_Type             Configuration                   /* TDD_Config acc. to RRC ASN.1 (acc. TS 36.331, clause 6.3.2 ) */
  };
  type record EUTRA_HalfDuplexFDD_Info_Type {
    /* NOTE:
     * for the time being there is no test case or test configuration using half duplex FDD;
     * (type definition is used as place holder only) */
  };
  type union EUTRA_RAT_Type {
    /* specifies RAT type and frame structure (TS 36.211, clause 4) */
    EUTRA_FDD_Info_Type                 FDD,
    EUTRA_TDD_Info_Type                 TDD,
    EUTRA_HalfDuplexFDD_Info_Type       HalfDuplexFDD
  };


  // ***** Cell Timing
  type record CellTimingInfo_Type {  /* Cell Timing */
    integer Tcell (0..307199),       /* frame duration Tf = 307200 * Ts = 10ms; System Time Unit Ts = 1/(15000 * 2048) */
    integer SfnOffset (0..1023)      /* (assuming 10 bit SFN) */
  };

  //--------------------------------------------------------

  type record DownlinkStaticCellInfo_Type {     /* DL Static Info */
    ARFCN_ValueEUTRA            Earfcn,                         /* DL-EARFCN as defined in TS 36.101 */
    Dl_Bandwidth_Type           Bandwidth,                      /* N(DL, RB) = 6..110 (6, 15, 25, 50, 75, 100) */
    EUTRA_RBSize_Type           RBSize,                         /* may be skipped assuming normal sub-carrier spacing => N(RB, SC) = 12 */
    EUTRA_CyclicPrefix_Type     CyclicPrefix
  };

  //--------------------------------------------------------

  type record UplinkStaticCellInfo_Type {       /* UL Static Info */
    ARFCN_ValueEUTRA            Earfcn,                         /* UL-EARFCN as defined in TS 36.101 */
    Ul_Bandwidth_Type           Bandwidth,                      /* N(DL, RB) = 6..110 (6, 15, 25, 50, 75, 100) */
    EUTRA_CyclicPrefix_Type     CyclicPrefix
  }

  //----------------------------------------------------------------------------
  // Common Types
  type enumerated EUTRA_RBSize_Type       {n_RB_SC_12, n_RB_SC_24};             /* Resource Block Size in freq domain;
                                                                                   N(RB,SC) is 12 for normal sub-carrier spacing */
  type enumerated EUTRA_CyclicPrefix_Type {normal, extended};                   /* NOTE: in DL extended cyclic prefix depends on sub-carrier spacing */
  type enumerated Modulation_Type         {unused, qpsk, qam16, qam64};         /* 'unused' e.g. for 2nd codeword when there is no spatial multiplexing */

  type integer EutraBand_Type           (1..40);        /* E-UTRA Band acc. to TS 36.101, clause 5.2 (common for UL/DL) */
  type integer CfiValue_Type            (1..3);

  // Reference Cell Power
  type integer AbsoluteCellPower_Type (-145..0);        /* absolute cell power (dBm) */
  type union Attenuation_Type {                         /* attenuation of the reference power */
    integer Value (0..144),                             /* cell power reference power reduced by the given attenuation (value is in dB) */
    Null_Type Off                                       /* even though in TS 36.508 -145dBm is given for a non suitable cell we specify an explicit "Off" value here */
  };

  const Attenuation_Type tsc_CellAttenuation_Off := {Off:=true};
  type Attenuation_Type InitialAttenuation_Type (tsc_CellAttenuation_Off);  /* Attenuation restricted to 'Off' */

  type integer ToRS_EPRE_Ratio_Type (-35..0);           /* any-resource-element to RS ratio in dB (e.g. PDSCH-to-RS ratio; see TS 36.213, clause 5.2) */

  type record ToRS_EPRE_Ratios_Type  {                  /* RA and RB ratios according to see TS 36.213, clause 5.2 */
    ToRS_EPRE_Ratio_Type        RA      optional,
    ToRS_EPRE_Ratio_Type        RB      optional
  };

  type record InitialCellPower_Type {
    AbsoluteCellPower_Type         MaxReferencePower,   /* maximum value of cell reference power (RS EPRE in dBm/15kHz as per TS 36.508, clause 4.3.4.1);
                                                         * a cell is initialised with this reference power;
                                                         * its value is the upper bound of the cell power during the test case */
    InitialAttenuation_Type        Attenuation          /* initial attenuation */
  };

  } // End sub-group Cell_Configuration_Common

  //----------------------------------------------------------------------------

  group Downlink_Physical_Layer_Configuration {
  /* Downlink physical layer configuration:
     - DL antenna configuration
     - control region (PCFICH, PHICH, PDCCH)
     - primary/secondary sync signals
     - power control for physical channels and signals */

  //----------------------------------------------------------------------------

  group Antenna_Configuration {

  type integer AntennaPortId_Type (0, 1, 2, 3);

  type record AntennaPortInfo_Type {
    /* NOTE:
     * for conformance tests it may not be necessary to consider propagation pathes for different antennas;
     * => fields of AntennaPortInfo_Type are used as place holders for future usage and are of 'Dummy_Type' for the time being */
    Dummy_Type                  PowerAttenuation,       /* even though eNb shall send with the same power on all antennas at the UE there may be different signal strength
                                                         * => RS will have reduced power
                                                         * NOTE: the EPRE ratios (e.g. PDSCH-to-RS ratio) are assumed to be equal for all antennas */
    Dummy_Type                  PropagationDelay        /* signal from different antennas may have different propagation delay */
  };


  type union AntennaPortConfig_Type {
    AntennaPortInfo_Type        AddOrReconfigure,       /* add / re-configure antenna port */
    Null_Type                   Release                 /* release antenna port */
  };

  type record AntennaPort_Type {
    AntennaPortId_Type          Id,
    AntennaPortConfig_Type      Config
  };

  type record DownlinkAntennaGroupConfig_Type {
    AntennaInfoCommon_Type      AntennaInfoCommon,       /* acc. to TS 36.331, clause 6.3.2; contains antennaPortsCount = an1, an2, an4;
                                                          * static parameter; will (normally) not be modified whilst a test;
                                                          * NOTE:
                                                          * information is redundant since number of antenna ports may implicitly be determined by the number of ports being configured */
    record length (1..4) of
      AntennaPort_Type          AntennaPort              /* 1, 2 or 4 antennas;
                                                          * from the UE's point of view each antenna may have a different power level and a different propagation delay */
  };

  } // End sub-sub-group Antenna_Configuration

  //----------------------------------------------------------------------------

  group Physical_Channels {

  //****** PBCH
  type record PbchConfig_Type {
    ToRS_EPRE_Ratios_Type       RelativeTxPower       optional  /* power ratio for PBCH's resource elements relative to the RS */
  };

  //****** PFICH
  type record PcfichConfig_Type {
    CfiValue_Type               CfiValue              optional, /* control format indicator signalled on PCFICH */
    ToRS_EPRE_Ratios_Type       RelativeTxPower       optional  /* power ratio for PFCICH's resource elements relative to the RS */
  };

  //****** PHICH
  type record PhichConfig_Type {
    PHICH_Config_Type           PhichConfig           optional, /* parameters acc. TS 36.331, clause 6.3.2:
                                                                 * phich-Duration, phich-Resource;
                                                                 * may have impact on Cfi */
    ToRS_EPRE_Ratios_Type       RelativeTxPower       optional  /* power ratio for PHICH's resource elements relative to the RS */
  };

  //****** PDCCH
  type record CCE_StartIndex_DL_UL_Type {  /* CCE_St_Ind' or CCE_St_Ind'' acc. to table 7.1.1-1 in TS 36.523-3 */
    integer CCE_StartIndex_DL,
    integer CCE_StartIndex_UL
  };

  type record length(10) of CCE_StartIndex_DL_UL_Type CCE_StartIndexList_Type;   /* describes PDCCH candidates for all sub-frames */

  type record PdcchCandidate_Type {             /* CCE start indeces for a given RNTI value acc. to table 7.1.1-1 in TS 36.523-3 */
    C_RNTI                      RNTI,                           /* RNTI value as per table 7.1.1-1 */
    CCE_StartIndexList_Type     CCE_StartIndexList              /* CCE Start Indices corresponding to the RNTI */
  };

  type record of PdcchCandidate_Type PdcchCandidateList_Type;   /* list of RNTIs and their corresponding CCE Start Indices */

  type record PdcchConfig_Type {
    /* UE performs blind detection for common and UE specific search spaces for different aggregation levels (PDCCH formats acc. TS 36.211, clause 6.8.1) */
    /* content of the PDCCHs (DCI formats acc. TS 36.212, clause 5.3.3) shall be controlled together with scheduling and resource allocation */
    integer CommonSearchSpaceFormat (2, 3)            optional, /* PDCCH format for common search space;
                                                                   acc. to TS 36.213, clause 9.1.1 only aggregation level 4 and 8 are allowed (i.e. PDCCH format 2 and 3*/
    integer UeSpecificSearchSpaceFormat (0, 1, 2, 3)  optional, /* UE specific search space: corresponding aggregation levels 1, 2, 4, 8 */
    PdcchCandidateList_Type     PdcchCandidateList    optional, /* PDCCH candidate list acc. to table 7.1.1-1 in TS 36.523-3 */
    ToRS_EPRE_Ratios_Type       RelativeTxPower       optional  /* power ratio for PDCCH's resource elements relative to the RS */
  };

  //****** PDSCH
  type record PdschRelativeTxPower_Type {
    /* NOTE 1:
     * the power control for the PDSCH is assumed to be (semi-)static for signalling conformance tests acc. to TS 36.323;
     * nevertheless for different channels and purposes with the PDSCH there may be different power settings;
     * NOTE 2:
     * acc. to TS 36.213, clause 5.2 the EPRE ratio is different in time domain for OFDM symbols containing or not containing reference signals;
     * this needs to be considered by SS */
    ToRS_EPRE_Ratios_Type       RachResponse          optional,
    ToRS_EPRE_Ratios_Type       BcchOnPdsch           optional,
    ToRS_EPRE_Ratios_Type       PcchOnPdsch           optional,
    ToRS_EPRE_Ratios_Type       CcchDcchDtch          optional
  };
  type record PdschConfig_Type {
    PdschRelativeTxPower_Type   RelativeTxPower       optional
  };

  } // End sub-sub-group Physical_Channels

  //----------------------------------------------------------------------------

  group Physical_Signals {

  type record PrimarySyncSignal_Type {
    ToRS_EPRE_Ratios_Type       RelativeTxPower       optional  /* power ratio for PSS's resource elements relative to the RS */
  };

  type record SecondarySyncSignal_Type {
    ToRS_EPRE_Ratios_Type       RelativeTxPower       optional  /* power ratio for PSS's resource elements relative to the RS */
  };

  type record SRS_UL_Config_Type {
    SoundingRS_UL_ConfigCommon_Type     Common,
    SoundingRS_UL_ConfigDedicated_Type  Dedicated
  };

  } // End sub-sub-group Physical_Signals

  //----------------------------------------------------------------------------

  type record PhysicalLayerConfigDL_Type {
    /* all fields are declared as optional to allow single reconfigurations; in this case omit means "keep as it is" */
    DownlinkAntennaGroupConfig_Type     AntennaGroup  optional,
    PbchConfig_Type                     Pbch          optional,
    PcfichConfig_Type                   Pcfich        optional,
    PhichConfig_Type                    Phich         optional,
    PdcchConfig_Type                    Pdcch         optional,
    PdschConfig_Type                    Pdsch         optional,
    PrimarySyncSignal_Type              Pss           optional,
    SecondarySyncSignal_Type            Sss           optional
  };

  } // End sub-group Downlink_Physical_Layer_Configuration

  //----------------------------------------------------------------------------

  group Uplink_Physical_Layer_Configuration {
  // Uplink physical channel configuration: PRACH, PUCCH, PUSCH and UL RS

  type record PUCCH_Configuration_Type {
    PUCCH_ConfigCommon_Type     Common              optional,
    PUCCH_ConfigDedicated_Type  Dedicated           optional
  };

  type record PUSCH_Configuration_Type {
    PUSCH_ConfigCommon_Type     Common              optional,
    PUSCH_ConfigDedicated_Type  Dedicated           optional
  };

  type union SS_TimingAdvanceConfig_Type {
    RACH_TimingAdvance_Type     InitialValue,                 /* initial value corresponding to what is sent to the UE in RACH response
                                                               * (range acc. 11 bit value; 0 in normal cases) */
    TimingAdvanceIndex_Type     Relative                      /* timing advance command to adjust changes of timing advance acc. to TS 36.213, clause 4.2.3;
                                                               * (range acc. 6 bit value: -31..32) */
  };

  type record PhysicalLayerConfigUL_Type {
    /* NOTE:
     * For the time being there is no requirement to configure the SS with TPC-PDCCH-Config;
     * In general SS is required to keep the UE's UL power constant */
    PRACH_Config_Type           Prach               optional, /* parameters acc. TS 36.331, clause 6.3.2;
                                                               * in general depending on FDD/TDD (see TS 36.211, clause 5.7) */
    PUCCH_Configuration_Type    Pucch               optional, /* parameters acc. TS 36.331, clause 6.3.2 */
    PUSCH_Configuration_Type    Pusch               optional, /* parameters acc. TS 36.331, clause 6.3.2
                                                               * (including configuration of RS) */
    SS_TimingAdvanceConfig_Type TimingAdvance       optional, /* to adjust timing advance;
                                                               * normally timing advance is configured as 0 at the beginning and never changed during the test case;
                                                               * in some MAC test cases timing advance may be configured to a non-zero (11 bit value) at the beginning and modified by (6 bit) timing advance commands during the test */
    SRS_UL_Config_Type          SRS_UL_Config       optional, /* sounding reference symbol (SRS); -> TS 36.213, clause 8.2, TS 36.211, clause 5.5.3 */
    SchedulingRequestConfig_Type  SR_Config         optional, /* PUCCH resources for scheduling requests acc. to TS 36.213 table 10.15;
                                                               * as signalled to the UE acc. to TS 36.331, clause 6.3.2 */
    CQI_ReportConfig_Type       CQI_ReportConfig    optional,

    UplinkPowerControlCommon_Type    UplinkPowerControlCommon        optional,
    UplinkPowerControlDedicated_Type UplinkPowerControlDedicated     optional
  };

  } // End sub-group Uplink_Physical_Layer_Configuration

  //----------------------------------------------------------------------------

  group Common_MAC_Configuration {
  /* Transport channel and MAC related procedures and configuration */

  //----------------------------------------------------------------------------
  // common types

  type record length (1..28) of RedundancyVersion_Type  RedundancyVersionListDL_Type;   /* NOTE:
                                                                                         * in general the list shall contain maxHARQ-Tx elements;
                                                                                         * if there are not enough elements specified SS shall raise an error;
                                                                                         * per default the list is configured to 0,2,3,1,0 (TS 36.321, clause 5.4.2.2) */

  type union UL_TransRetransmission_Type {
    Null_Type NewTransmission,                          /* new transmission of data with redundancy version RV=0 (acc. to TS 36.321 clause 5.4.2.2); NDI is toggled */
    RedundancyVersion_Type ReTransmissionAdaptive,      /* SS assigns grant to requests retransmission of data with given redundancy version; NDI is not toggled */
    Null_Type ReTransmissionNonAdaptive                 /* place holder for non-adaptive retransmissions; SS does not send any grant */
  };
  type record length (1..28) of UL_TransRetransmission_Type UL_TransRetransmissionList_Type; /* list of transmission and subsequent retransmissions:
                                                                                              * in UL retransmissions are synchronous (every 8 TTIs for FDD);
                                                                                              * independent from the HARQ_ModeList SS shall send grants for every adaptive retransmissions;
                                                                                              * in case of non-adaptive retransmissions SS simply does not sent a grant (i.e. ReTransmissionNonAdaptive elements are used to adjust timing of the adaptive restransmissions only) */

  type integer ImcsValue_Type (0..31);                  /* Modulation and coding scheme index coding */
  type union Imcs_Type {
    ImcsValue_Type Value,
    Null_Type      NotUsed
  };

  type integer TimingAdvanceIndex_Type (0..63);         /* acc. to TS 36.321, clause 6.1.3.5 "Timing Advance Command MAC Control Element"
                                                           and TS 36.213, clause 4.2.3 "Transmission timing adjustments" */
  type integer TimingAdvance_Period_Type
  (150, 400, 600, 1020, 1530, 2040, 4090, 8190);        /* 150 coresponds to 75% of 200ms drx-InactivityTimer as used for L2 UM tests;
                                                         * the other values correspond to 80 % of TimeAlignmentTimer (acc. to TS 36.523-3, clause 7.2)
                                                         * (TS 36.331, clause 6.3.2: sf500, sf750, sf1280, sf1920, sf2560, sf5120, sf10240) rounded to nearest multiple of 10 */

  type union ULGrant_Period_Type {
    Null_Type           OnlyOnce,                       /* grant is sent out only once; no period */
    integer             Duration (-1,1..infinity)       /* duration of the grant period (TTI=1ms) */
  };

  type union TransmissionRepetition_Type {
    Null_Type           Continuous,
    integer             NumOfCycles (1..infinity)
  };

  type record PUCCH_AutoSynch_Type {
    TimingAdvanceIndex_Type     TimingAdvance,
    TimingAdvance_Period_Type   TA_Period,              /* time period after which TA MAC control elements need to be automatically transmitted */
    TransmissionRepetition_Type TA_Repetition           /* number of TA MAC control element repetitions to be automatically transmitted or 'Continuous' */
  };

  type union PUCCH_Synch_Type {
    Null_Type                   None,                   /* no PUCCH Synchronisation applied */
    PUCCH_AutoSynch_Type        Auto                    /* SS automatically maintains PUCCH synchronization at UE */
  };

  type record FreqDomainSchedulCommon_Type {
    /* common type to specify restrictions for frequency domain scheduling by a start index and a maximum range of RBs;
     * in general the resource allocation refers to virtual resource blocks:
     * - format 1A (localised):
     *   FirstRbIndex refers to the first physical RB; the RBs are subsequent (upto MaxRbCnt RBs);
     *   may be applied for all kind of channels
     * - format 1C (distributed):
     *   FirstRbIndex refers to the first virtual RB; the virtual RBs are subsequent (upto MaxRbCnt RBs)
     *   but mapped (distributed) to physical resource; typically applied on BCCH, PCCH and RAR
     * - format 1  (localised):
     *   FirstRbIndex refers to the first physical RB; RBs are not consecutive;
     *   SS needs to provided bitmap of RBs (see TS 36.523-3) to cope with mapping of virtual resource allocation (format 1C) applied on other channels;
     * typically there are either
     * - all channels having format 1A (localised)
     * - BCCH, PCCH and RAR having format 1C (distributed) + DTCH/DCCH having format 1 */
    integer FirstRbIndex,                               /* index of the first (vitual) resource block in frequency domain;
                                                         * 0 .. N(UL/DL, RB) - 1;
                                                         * NOTE:
                                                         * DCI format 1C refers to a virtual RB allocation i.e. the resource block index;
                                                         * differs from the physical resource allocation
                                                         * where the RBs are distributed over the whole frequency bandwidth (TS 36.213, clause 7.1.6.3) */
    integer MaxRbCnt                                    /* max. number of resource blocks to be assigned;
                                                         * FirstRbIndex + MaxRbCnt  <= N(UL/DL, RB);
                                                         * SS shall not assigned more than the given resource blocks to the respective channel
                                                         * (i.e. MaxRbCnt is the upper bound);
                                                         * if the the configuration for a channel exceeds the total bandwidth this is a TTCN error
                                                         * (=> SS shall raise an error) */
  };

  type record FreqDomainSchedulExplicit_Type {
    /* type used for explicit DL scheduling; Nprb is the exact nunber of RBs whereas in FreqDomainSchedulCommon_Type MaxRbCnt is the upper bound */
    integer FirstRbIndex,                               /* index of the first resource block in frequency domain;
                                                         * 0 .. N(UL/DL, RB) - 1 */
    integer Nprb                                        /* number of resource blocks to be assigned;  */
  };

  type enumerated PdcchDciFormat_Type {                 /* DCI format acc. to TS 36.212, clause 5.3.3.1;
                                                         * SS shall apply physical parameters accordingly as specified in TS 36.508, clause 4.3.6 */
    dci_0,      /* physical layer parameters acc. TS 36.508 Table 4.3.6.1.1-1 */
    dci_1,      /* physical layer parameters acc. TS 36.508 Table 4.3.6.1.2-1 */
    dci_1A,     /* physical layer parameters acc. TS 36.508 Table 4.3.6.1.3-1 */
    dci_1B,
    dci_1C,     /* physical layer parameters acc. TS 36.508 Table 4.3.6.1.4-1 */
    dci_1D,
    dci_2,      /* physical layer parameters acc. TS 36.508 Table 4.3.6.1.5-1 */
    dci_2A,     /* physical layer parameters acc. TS 36.508 Table 4.3.6.1.6-1 */
    dci_3,
    dci_3A
  };

  type enumerated PdcchResourceAllocation_Type {        /* Resource allocation acc. TS 36.213, clause 7.1.6 */
    ra_0,
    ra_1,
    ra_2_Localised,                                     /* => physical and virtual RB index are identical */
    ra_2_Distributed                                    /* => virtual resource allocation */
  };

  type union MIMO_PrecodingBits_Type {                  /* Number of bits for precoding information acc. TS 36.212, table 5.3.3.1.5-3 and 5.3.3.1.5A-1 */
    Null_Type           None,                           /* DCI 2A: 2 antenna ports at eNodeB (table 5.3.3.1.5A-1) */
    B2_Type             Bit2,                           /* DCI 2A: 4 antenna ports at eNodeB (table 5.3.3.1.5A-1) */
    B3_Type             Bit3,                           /* DCI 2:  2 antenna ports at eNodeB (table 5.3.3.1.5-3) */
    B6_Type             Bit6                            /* DCI 2:  4 antenna ports at eNodeB (table 5.3.3.1.5-3) */
  };

  type record MIMO_DciDlInfo_Type {                             /* additional information for DL DCI in case of MIMO (i.e. when a 2nd CW is specified) */
    RedundancyVersionListDL_Type        RedundancyVersionList_2ndCW optional,   /* list of Redundancy version for 2nd code word;
                                                                                 * shall have the same length as RedundancyVersionList_1stCW;
                                                                                 * if omit, for the 2nd CW the same RedundancyVersionList shall be applied as for the 1st CW */
    B1_Type                             CodeWordSwapFlag,       /* transport block to codeword mapping acc. to TS 36.212 Table 5.3.3.1.5-1 */
    MIMO_PrecodingBits_Type             PrecodingBits           /* precoding information acc. TS 36.212, table 5.3.3.1.5-3 and 5.3.3.1.5A-1 */
  };

  type record DciDlInfoCommon_Type {
    /* used for normal DL scheduling acc. to TS 36.523-3, clause 7.3 */
    PdcchDciFormat_Type                 Format,                 /* BCCH, PCCH and RACH Response:  1A or 1C  (TS 36.213, clause 7.1)
                                                                 * CCCH: 1A since transmission mode is not (may not be) configured at the UE yet (TS 36.213, clause 7.1)
                                                                 * DTCH/DCCH: depending on transmission mode */
    PdcchResourceAllocation_Type        ResourceAllocType,      /* depends on DCI format, e.g. ra_2_Localised or
                                                                 * ra_2_Distributed for DCI format 1A */
    Modulation_Type                     Modulation_1stCW,       /* max. modulation scheme for the 1st code word;
                                                                 * depending on the amount of data a lower modulation scheme may be by SS but not a higher one;
                                                                 * BCCH, PCCH and RACH Response: QPSK only */
    Modulation_Type                     Modulation_2ndCW,       /* modulation scheme for 2nd code word in case of spatial multiplexing;
                                                                 * can be different than 1st code word (see TS 36.211, clause 6.3.2; TS 36.212, clause 5.3.3.1.5);
                                                                 * 'unused' when there is no spatial multiplexing;
                                                                 * NOTE:
                                                                 * Acc. to 36.523-3 cl. 7.3.3.4 in normal mode MIMO shall not be used
                                                                 * => for the time being Modulation_2ndCW is always "unused" */
    FreqDomainSchedulCommon_Type        FreqDomainSchedul,      /* index of 1st RB; max. number of RBs per TTI;
                                                                 * NOTE:
                                                                 * in case of DCI format 1C the first RB index has no meaning since distributed virtual resource blocks assigned in this case (TS 36.213, clause 7.1.6.3) */
    RedundancyVersionListDL_Type        RedundancyVersionList   /* list of Redundancy version to be used in case of retransmission;
                                                                 * the number of elements in the list provides the maxHARQ-Tx */
  };

  type record DciDlInfoExplicit_Type {
    /* used for explicit DL scheduling acc. to TS 36.523-3, clause 7.3 */
    Imcs_Type                           Imcs_1stCW,             /* MCS index of table 7.1.7.1-1 of TS 36.213 */
    Imcs_Type                           Imcs_2ndCW,             /* MCS index for the 2nd code word in case of MIMO;
                                                                   'NotUsed' when MIMO is not used */
    PdcchDciFormat_Type                 Format,
    PdcchResourceAllocation_Type        ResourceAllocType,
    FreqDomainSchedulExplicit_Type      FreqDomainSchedul,
    RedundancyVersionListDL_Type        RedundancyVersionList,  /* list of Redundancy version to be used in case of retransmission the number of elements in the list provides the maxHARQ-Tx */
    MIMO_DciDlInfo_Type                 MimoInfo optional       /* shall be present when Imcs_2ndCW specifies a 2nd CW to be used;
                                                                 * shall be omit when Imcs_2ndCW is 'NotUsed' */
  };

  type union DciDlInfo_Type {
    DciDlInfoCommon_Type                Auto,                   /* SS shall chose the appropriate TBS up to the maximim number of resource blocks */
    DciDlInfoExplicit_Type              Explicit                /* used in MAC or RAB tests where exact TBS needs to be specified */
  };

  type record DciUlInfo_Type {
    Imcs_Type                           Imcs,                   /* MCS index of table 8.6.1-1 of TS 36.213 */
    UL_TransRetransmissionList_Type     TransRetransmissionList,/* list of possible retransmissions and their redundancy versions (depending on being adapive or non-adaptive);
                                                                 * the list shall
                                                                 * - start with
                                                                 *   - "New Transmission" (normal case) or
                                                                 *   - "Adaptive Retransmission" (e.g. to request a retransmission even when the data has been acknowledged with a HARQ ACK)
                                                                 * - end with "Adaptive Retransmission" (if there are retransmissions)
                                                                 * NOTE1: TTCN implementation shall ensure that a reconfiguration is done not before the previous list has been fully processed
                                                                 * NOTE2: for normal operation the list contains only one NewTransmission element (i.e. possible retransmissions are non-adaptive) */
    FreqDomainSchedulExplicit_Type      FreqDomainSchedul
  };

  type record PeriodicGrant_Type {
    ULGrant_Period_Type                 Period,                 /* time period after which UL Grant need to be automatically transmitted or 'OnlyOnce' */
    TransmissionRepetition_Type         NoOfRepetitions         /* number of UL Grant repetitions to be automatically transmitted or continuous repetition */
  };

  type union UL_GrantConfig_Type  {
    Null_Type                   OnSR_Reception,                 /* SS tranmits UL Grant as configured by CommonDciInfoUL_Type at every reception of SR;
                                                                 * to be used in non L2 Test */
    PeriodicGrant_Type          Periodic,                       /* SS tranmits UL Grant as configured by CommonDciInfoUL_Type periodically;
                                                                 * to be used in L2 tests;
                                                                 * MAC tests testing Grants might set the period as infinite and num grant as 1 */
    Null_Type                   None                            /* disable any grant transmission */
  };

  } // End sub-group Common_MAC_Configuration

  //----------------------------------------------------------------------------

  group Random_Access_Procedure {

  type record UplinkGrant_Type {      /* TS 36.213, clause 6.2 */
    B1_Type     HoppingFlag,          /* Hopping flag */
    B10_Type    RB_Allocation,        /* Fixed size resource block assignment */
    B4_Type     ModAndCodScheme,      /* Truncated modulation and coding scheme */
    B3_Type     TPC_Command,          /* TPC command for scheduled PUSCH */
    B1_Type     UL_Delay,             /* UL delay */
    B1_Type     CQI_Req               /* CQI request */
  };
  type integer   RACH_TimingAdvance_Type     (0..2047);         /* 11 bit timing advance as used in RACH response (absolute value) */

  const ContentionResolutionId_Type tsc_ContentionResolutionId_Unchanged := int2bit(0, 48);
  const ContentionResolutionId_Type tsc_ContentionResolutionId_Unmatch   := (int2bit(1, 48) << 20);

  type union ContentionResolution_ContainedRlcPdu_Type {
    octetstring         RlcPdu,                                 /* octetstring of an RLC PDU containing e.g. the RRC Connection Setup;
                                                                 * to be sent in the same MAC PDU as the MAC Contention Resolution Control Element */
    Null_Type           None                                    /* MAC PDU containing the MAC Contention Resolution Control Element does not contain an RLC PDU
                                                                 * (i.e. RRC Connection Setup is sent in another PDU) */
  };

  type union ContentionResolution_ContainedId_Type {
    ContentionResolutionId_Type               XorMask,          /* When SS receives Contention Resolution ID from the UE,
                                                                 * SS shall XOR it with the given mask and use this as Contention Resolution ID;
                                                                 * this allows to get an unmatching Contention Resolution ID;
                                                                 * in normal cases mask shall be set to tsc_ContentionResolutionId_Unchanged
                                                                 * (i.e. the Contention Resolution ID remains unchanged) */
    Null_Type                                 None              /* MAC Contention Resolution Control Element is not contained in the MAC PDU sent out as response on Msg3 */
  };

  type record TCRNTI_ContentionResolutionMacPdu_Type {          /* NOTE:
                                                                 * Either ContainedId or ContainedRlcPdu (or both) shall not be 'none';
                                                                 * (if no Contention Resolution Mac Pdu shall be sent, TCRNTI_ContentionResolutionCtrl_Type.NoContResolID shall be used instead) */
    ContentionResolution_ContainedId_Type     ContainedId,      /* Either the Contention Resolution ID as received from the UE
                                                                 * or a modified Contention Resolution ID (XorMask != tsc_ContentionResolutionId_Unchanged)
                                                                 * or no Contention Resolution ID  at all */
    ContentionResolution_ContainedRlcPdu_Type ContainedRlcPdu   /* the MAC PDU containing the MAC Contention Resolution Control Element may contain the RRC Connection Setup;
                                                                 * in this case the RRC PDU shall be completely encoded been contained in an RLC PDU */
  };

  type union TCRNTI_ContentionResolutionCtrl_Type {             /* when the UE responds on a Random Access Response with a RRC Connection Request on CCCH
                                                                 * and not with a C-RNTI SS shall assume initial Random Access Procedure (TS 36.300, clause 10.1.5.1),
                                                                 * i.e. sends a ContentionResolutionId back to the UE */
    TCRNTI_ContentionResolutionMacPdu_Type    MacPdu,           /* MAC PDU containing the Contention Resolution ID and optionally an RRC PDU (RRC Connection Setup) */
    TCRNTI_ContentionResolutionMacPdu_Type    MacPdu_CRC_Error, /* same as MacPdu (see above),
                                                                 * but SS shall generate CRC error by toggling CRC bits;
                                                                 * no retransmissions shall be made as UE shall not send a NACK */
    Null_Type                                 NoContResolID     /* SS shall not include contention resolution ID (i.e. no MAC PDU shall be sent);
                                                                 * used for contention resolution fail case */
  };

  type union CRNTI_ContentionResolutionCtrl_Type {              /* configuration for Random Access Procedure in RRC_CONNECTED (see TS 36.300, clause 10.1.5.1);
                                                                 * when SS receives C-RNTI MAC element sent by the UE after Random Access Response,
                                                                 * SS shall deal with the C-RNTI as specified in this structure */
    DciUlInfo_Type                            AutomaticGrant,   /* before expiry of the contention resolution timer SS shall automatically address PDCCH
                                                                 * using C-RNTI as sent by the UE; the UL grant is specified acc. to DciUlInfo_Type */
    Null_Type                                 None              /* Used in case of dedicated preamble transmission or to simulate failure cases;
                                                                 * SS shall not address PDCCH using C-RNTI
                                                                 * => expiry of contention resolution timer on UE side */
  };

  type union ContentionResolutionCtrl_Type {                    /* NOTE: SS only needs to consider one kind of contention resolution at one time;
                                                                 * in the initial configuration of a cell TCRNTI_Based shall be configured and
                                                                 * the common assuption is that in RRC_CONNECTED normally there are no RACH procedures
                                                                 * (i.e. no CRNTI_Based configuration needed)
                                                                 * whereas e.g. in case of handover scenarios CRNTI_Based shall be configured */
    TCRNTI_ContentionResolutionCtrl_Type      TCRNTI_Based,     /* TCRNTI based contention resolution (e.g. initial access),
                                                                 * hence involves inclusion contention resolution identity in DL message 4 of RACH procedure */
    CRNTI_ContentionResolutionCtrl_Type       CRNTI_Based       /* CRNTI based contention resolution (e.g. in case UE is being in RRC_CONNECTED):
                                                                 * hence uplink message in step 3 (of RACH procedure) is followed by PDCCH transmission with UE C-RNTI to end procedure */
  };

  type union RapIdCtrl_Type {
    Null_Type                           Automatic,              /* SS shall automatically use same RAPID as received from the UE */
    Null_Type                           Unmatched               /* SS shall use RAPID being different from preamble sent by the UE;
                                                                 * SS shall calculate this RAPID acc. to RAPID := (RAPID + 3..63) mod 64
                                                                 * if single RAR is transmitted in a MAC PDU then only 3 is added
                                                                 * if multiple RAR's are transmitted in MAC PDU, then for first unmatched RAR 3 is added, second unmatched 4 is added, third unmatched 5 is added and so on */
  };

  type union TempC_RNTI_Type {
    Null_Type                           SameAsC_RNTI,           /* in the RA response SS shall use the same C-RNTI as configured in ActiveCellConfig_Type;
                                                                 * this is useful for initial random access */
    C_RNTI                              Explicit                /* in the RA response SS shall use different value as configured in ActiveCellConfig_Type;
                                                                 * this can be used when the UE already is in RRC_CONNECTED to have a temporary C-RNTI different from the one used by the UE;
                                                                 * NOTE: when the UE is not in RRC_CONNECTED there shall be no explicit temp. C-RNTI since then the UE would assume this value as C-RNTI */
  };

  type record RandomAccessResponseParameters_Type {             /* paramenters to control content of RAR sent to the UE */
    RapIdCtrl_Type                      RapId,                  /* to control Random Access Preamble Id to be sent back to the UE; used in RAR MAC sub-header */
    UplinkGrant_Type                    InitialGrant,           /* initial UL grant */
    RACH_TimingAdvance_Type             TimingAdvance,          /* timing advance: granularity of 0.52 micro sec (16*Ts);
                                                                 * see TS 36.300, clause 5.2.7.3, TS 36.321, clause 6.1.3.5;
                                                                 * NOTE:
                                                                 * timing advance has impact not only on the RA procedure;
                                                                 * SS in general needs to adjust its timing accordingly */
    TempC_RNTI_Type                     TempC_RNTI              /* NOTE:
                                                                 * For initial Random Access Procedure at network (SS) side there is no temporary C-RNTI:
                                                                 * network assigns the C-RNTI which is used by any UE as being temporary;
                                                                 * the UE which 'wins' the contention resolution keeps the (temporary) C-RNTI;
                                                                 * other UEs need to repeat the RACH procedure;
                                                                 * => at the SS the TempC_RNTI shall be 'SameAsC_RNTI'
                                                                 * For Random Access Procedure in RRC_CONNECTED state the NW assigns a temporary C-RNTI which is replaced by the one stored at the UE;
                                                                 * => TempC_RNTI may be 'SameAsC_RNTI' (in this case temp. C-RNTI and C-RNTI are equal what is not likely in a real network),
                                                                 * or there is an explicit temp. C-RNTI what is used during RA procedure only (as in a real network) */
  };
  type record of RandomAccessResponseParameters_Type RarList_Type;      /* in general MAC PDU may contain one or several RARs;
                                                                         * normally only one RAR is contained */

  type union RandomAccessResponse_Type {
    Null_Type                           None,                   /* used for unsuccessful RA procedure */
    RarList_Type                        List                    /* normally one RAR to be sent to the UE; in general there can be more than one RAR */
  };

  type union RandomAccessBackoffIndicator_Type {
    Null_Type                           None,                   /* normal case, no back off indicator included */
    integer                             Index (0..15)           /* Backoff Parameter values acc. TS 36.321, clause 7.2;
                                                                 * values 0..12 are defined, 13..15 may be used in  error case */
  };

  type record RandomAccessResponseCtrl_Type {                   /* configuration for Random Access Response mapped to DL-SCH mapped to PDSCH */
    /* TransmissionMode: single antenna mode when there is only one antenna configured, transmit diversit else;
       RNTI: RA-RNTI (TS 36.321, clause 7.1);
       if both RAR msg and backoff indicator are 'None' SS shall not respond on RAP */
    DciDlInfoCommon_Type                DciInfo,                /* DCI format: 1A or 1C  (TS 36.213, clause 7.1)
                                                                 * ResourceAllocType: 2 (acc. to DCI format)
                                                                 * Modulation: QPSK
                                                                 * Frequency domain schedule: index of 1st RB; max. number of RBs per TTI */
    RandomAccessResponse_Type           Rar,                    /* RAR to be sent to the UE */
    RandomAccessBackoffIndicator_Type   BackoffInd              /* possible backoff indicator; 'None' for normal cases */
  };

  type union RandomAccessResponseConfig_Type {
    RandomAccessResponseCtrl_Type       Ctrl,                   /* contains information to control sending of RAR */
    RandomAccessResponseCtrl_Type       Ctrl_CRC_Error,         /* same as Ctrl (see above), but MAC PDU transmitted will contain CRC bits (0-3) being toggled;
                                                                 * no retransmissions shall be made as UE shall not send a NACK */
    Null_Type                           None                    /* to be used when there is no RAR to be sent at all */
  };

  type record RachProcedure_Type {
    RandomAccessResponseConfig_Type     RAResponse,             /* control of how the SS shall react on RA preamble;
                                                                 * this may be
                                                                 * - the RAP id as expected by the UE
                                                                 * - a RAP id not matching to the UE's RAP
                                                                 * - a backoff indicator
                                                                 * - nothing at all */
    ContentionResolutionCtrl_Type       ContentionResolutionCtrl
                                                                /* control of how the SS shall react on (first) scheduled transmission from UE:
                                                                 * 1. UE sends CCCH SDU => contention resulation based on contention resolution id
                                                                 * 1.a) successful contention resolution: contention resolution id matched to CCCH SDU
                                                                 * 1.b) unsuccessful contention resolution: contention resolution id  does not match
                                                                 * 2. UE sends C-RNTI => contention resolution based on C-RNTI
                                                                 * 2.a) successful contention resolution: SS addresses C-RNTI (e.g. UL-grant)
                                                                 * 2.b) unsuccessful contention resolution: SS does not address C-RNTI (timeout at UE) */
  };

  const integer tsc_RandomAccessResponseListSize := 10;         /* arbitrary value (needs to be extended, if necessary);
                                                                 * in case of RACH in idle, UE will keep on making RACH attempts until t300 expires
                                                                 * => number of PRACH preambles maybe even greater than maximum value of PREAMBLE_TRANS_MAX */

  type record length(1..tsc_RandomAccessResponseListSize) of
    RachProcedure_Type RachProcedureList_Type;                  /* to simulate RACH procedure with one or more than one attempt by the UE:
                                                                 * 1. Normal cases:
                                                                 * one single RandomAccessResponse is sent to the UE matching the UE's RACH preamble;
                                                                 * contention resolution is successful immediately
                                                                 * => list contains only one element which is used for any RA procedure
                                                                 *    (Even if a RACH procedure is repeated by the UE for any reason this element shall be used;
                                                                 *    e.g. it needs not to be handled as error when the UE sends another RACH preamble instead of the RRC connection request message)
                                                                 * 2. Special cases:
                                                                 * there are upto tsc_RandomAccessResponseListSize preambles sent by the UE
                                                                 * => there are upto tsc_RandomAccessResponseListSize responses to be configured as elements of the list;
                                                                 * SS shall start with the first element in the list and use the RAR as specified in this element;
                                                                 * if the RAR matches at the UE side the UE will send UL data and contention resolution is performed as configured for this element;
                                                                 * if the RAR does not match the UE sends another RAP and SS continues with the next element in the list;
                                                                 * in this case the contention resolution of the respective element is not used;
                                                                 * if the end of the list is reached and further RACH preambles are sent by the UE SS shall repeatively apply the last element of the list
                                                                 * (this is necessary because there might be not enough time to reconfigure SS after the end of the list has been reached and there shall be well-defined behaviour after the list has been processed);
                                                                 *
                                                                 * to change from a special mode to normal mode the RachProcedureList is reconfigured by TTCN to achieve transparency and readability of the code;
                                                                 *
                                                                 *  NOTE:
                                                                 *  when there are RACH_ConfigDedicated configured (see below) and the RA preamble matches with one the configured ones the contention resolution ctrl is obsolete (non contention based random access procedure) */

  type record RachProcedureConfig_Type {
    /* parameters to control the random access procedure; TS 36.321, clause 5.1 */
    RACH_ConfigCommon_Type              RACH_ConfigCommon             optional, /* acc. TS 36.331, clause 6.3.2; may not be necessary for SS;
                                                                                 * omit: "keep as it is" */
    RACH_ConfigDedicated_Type           RACH_ConfigDedicated          optional, /* acc. TS 36.331, clause 6.3.2;
                                                                                 * when random access preamble sent by the UE matches with the configured one,
                                                                                 * SS shall assume the random access procedure being non-contention based;
                                                                                 * initial configuration: no RACH_ConfigDedicated are configured;
                                                                                 * omit means "keep as it is" */
    RachProcedureList_Type              RachProcedureList             optional  /* in normal cases there is one element which is used for any RA procedure;
                                                                                 * special cases are used in MAC test cases;
                                                                                 * omit means "keep as it is" */
  };

  } // End sub-group Random_Access_Procedure

  //----------------------------------------------------------------------------

  group System_Information_Control {     /* Primitive to configuration BCCH/BCH */

  // ***** PBCH (MIB)
  type Null_Type BcchToPbchConfig_Type;                         /* place holder for BCCH mapped to BCH mapped to PBCH:
                                                                 * MIB using fixed scheduling (periodicity: 40ms);
                                                                 * transmission mode:
                                                                 * single antenna port configuration (layer mapping acc. TS 36.211, clause 6.3.3.1)
                                                                 * or transmit diversity (layer mapping acc. TS 36.211, clause 6.3.3.3) depending on antenna configuration */
  // ***** PDSCH (SIB1)
  type record Sib1Schedul_Type {                                /* SIB1: fixed scheduling in time domain acc. TS 36.331, clause 5.2.1.2 (periodicity: 80ms; repetitions every 20ms) */
    DciDlInfoCommon_Type        DciInfo               optional  /* DCI format: 1A or 1C  (TS 36.213, clause 7.1)
                                                                 * ResourceAllocType: 2 (acc. to DCI format)
                                                                 * Modulation: QPSK
                                                                 * Frequency domain schedule: index of 1st RB; max. number of RBs per TTI */
  };

  // ***** PDSCH (all other SIs)
  type record SingleSiSchedul_Type {                            /* specifies scheduling for a single SI in freq and time domain */
    DciDlInfoCommon_Type        DciInfo               optional, /* DCI format: 1A or 1C  (TS 36.213, clause 7.1)
                                                                 * ResourceAllocType: 2 (acc. to DCI format)
                                                                 * Modulation: QPSK
                                                                 * Frequency domain schedule: index of 1st RB; max. number of RBs per TTI */
    integer                     SubframeOffset        optional  /* offset within the SI-window;
                                                                 * NOTE: SI-window may span more than one frame */
  };

  type record SiSchedul_Type {                                  /* specifies for a specific SI scheduling and repetitions within as SI window */
    SiPeriodicity_Type          Periodicity           optional,
    record of
      SingleSiSchedul_Type      Window                optional  /* NOTE:
                                                                 * acc. to TS 36.331, clause 5.2.1.2 the same SI may occur more than once in an SI-window;
                                                                 * to allow this there is a "record of" even though acc. to TS 36.508, clause 4.4.3.3 all SIs are sent only once within the window */
  };

  type record length(1..maxSI_Message) of SiSchedul_Type SiSchedulList_Type;

  type record AllSiSchedul_Type {
    SiWindowLength_Type         WindowLength          optional, /* to calculate start of each SI window acc. TS 36.331, clause 5.2.3 */
    SiSchedulList_Type          SiList                optional  /* list of SIs containing one ore more SIBs */
  };

  // ***** PDSCH (SIB1 + SIs)
  type record BcchToPdschConfig_Type {                          /* configuration for BCCH mapped to DL-SCH mapped to PDSCH */
    /* TransmissionMode: single antenna mode when there is only one antenna configured, transmit diversity else;
       RNTI: SI-RNTI (TS 36.321, clause 7.1) */
    Sib1Schedul_Type            Sib1Schedul           optional, /* scheduling of SIB1 in frequency domain */
    AllSiSchedul_Type           SiSchedul             optional  /* scheduling of SIs in frequency and time domain */
  };

  type record of BCCH_DL_SCH_Message SI_List_Type;              /* TS 36.331, clause 6.2.1 BCCH-DL-SCH-Message and clause 6.2.2 SystemInformation */

  // ***** content of system information
  type record BcchInfo_Type {
    /* all fields are declared as optional to allow modification of single field;
     * acc. to TS 36.331, clause 9.1.1.1 "RRC will perform padding, if required due to the granularity of the TF signalling, as defined in 8.5.";
     * therefore this needs to be done by the system simulator */
    BCCH_BCH_Message            MIB                   optional, /* TS 36.331, clause 6.2.1 BCCH-BCH-Message and clause 6.2.2 MasterInformationBlock;
                                                                 * NOTE:
                                                                 * the sequence number included in MIB needs to be handled and maintained by the system simulator;
                                                                 * that means that the sequence number being setup by TTCN will be overwritten by SS */
    BCCH_DL_SCH_Message         SIB1                  optional, /* TS 36.331, clause 6.2.1 BCCH-DL-SCH-Message and clause 6.2.2 SystemInformationBlockType1 */
    SI_List_Type                SIs                   optional
  };

  // ***** configuration for BCCH
  type record BcchConfig_Type {
    /* all fields are optional to allow single modifications;
     * activation time may be applied in the common part of the ASP;
     * NOTE 1:
     * acc. to TS 36.331, clause 9.1.1.1 there is no PDCP and RLC/MAC are in TM
     * NOTE 2:
     * mapping/scheduling and contents of the System Information in general is done in one go
     * (i.e. there are no separate ports for SIB data and configuration) */
    BcchToPbchConfig_Type       Pbch                  optional,
    BcchToPdschConfig_Type      Pdsch                 optional,
    BcchInfo_Type               BcchInfo              optional
  };

  } // End sub-group System_Information_Control

  //----------------------------------------------------------------------------

  group Paging_Control {     /* Primitive to configuration PCCH/PCH */

  type record PcchConfig_Type {                                 /* configuration for PCCH mapped to PCH mapped to PDSCH */
    /* TransmissionMode: single antenna mode when there is only one antenna configured, transmit diversity else;
     * RNTI: P-RNTI (TS 36.321, clause 7.1)
     * NOTE: acc. to TS 36.331, clause 9.1.1.3 there is no PDCP and RLC/MAC are in TM */
    DciDlInfoCommon_Type        DciInfo               optional  /* DCI format: 1A or 1C  (TS 36.213, clause 7.1)
                                                                 * ResourceAllocType: 2 (acc. to DCI format)
                                                                 * Modulation: QPSK
                                                                 * Frequency domain schedule: index of 1st RB; max. number of RBs per TTI */
  };

  } // End sub-group Paging_Control

  //----------------------------------------------------------------------------

  group UE_Specific_Channel_Configuration {

  group UE_Specific_Channel_Configuration_DL {  /* Scheduling and other information for CCCH/DCCH/DTCH mapped to DL-SCH mapped to PDSCH */

  group MIMO_Configuration {                    /* Precoding information for spatial multiplexing (DCI format 2) */

  type union PrecodingInfoForOneCodeWord_Type {
    /* NOTE: not all index values may make sense (e.g. the indices refering to the values reported by the UE) */
    integer   TwoAntennasClosedLoop  (0..6),    /* index acc. to TS 36.212 Table 5.3.3.1.5-2;
                                                 * RI = 1; transmit diversity or code book index 0..3 acc. TS 36.211 Table 6.3.4.2.3-1 */
    integer   FourAntennasClosedLoop (0..34),   /* index acc. to TS 36.212 Table 5.3.3.1.5-3;
                                                 * RI = 1..2; transmit diversity or code book index 0..15 acc. TS 36.211 Table 6.3.4.2.3-2 */
    Null_Type TwoAntennasOpenLoop,              /* no precoding info; RI=1 when only codeword 1 is enabled */
    integer   FourAntennasOpenLoop   (0..1)     /* index acc. to TS 36.212 Table 5.3.3.1.5-4
                                                 * RI = 1..2; RI=1 => transmit diversity; RI=2 => large delay CDD */
  };
  type union PrecodingInfoForTwoCodeWords_Type {
    /* NOTE: not all index values may make sense (e.g. the indices refering to the values reported by the UE) */
    integer   TwoAntennasClosedLoop  (0..2),    /* index acc. to TS 36.212 Table 5.3.3.1.5-2;
                                                 * RI = 2; code book index 1, 2 acc. TS 36.211 Table 6.3.4.2.3-1 */
    integer   FourAntennasClosedLoop (0..50),   /* index acc. to TS 36.212 Table 5.3.3.1.5-3;
                                                 * RI = 2..4; code book index 0..15 acc. TS 36.211 Table 6.3.4.2.3-2 */
    Null_Type TwoAntennasOpenLoop,              /* no precoding info; RI=2 when both codewords are enabled */
    integer   FourAntennasOpenLoop   (0..2)     /* index acc. to TS 36.212 Table 5.3.3.1.5-4
                                                 * RI = 2..4; large delay CDD */
  };
  type union PrecodingInfoIndex_Type {
    PrecodingInfoForOneCodeWord_Type    OneCodeWord,            /* only codeword 1 shall be enabled in the DCI */
    PrecodingInfoForTwoCodeWords_Type   TwoCodeWords            /* both codewords shall be enabled in the DCI */
  };

  type enumerated PrecodingOperationMode_Type { /* how to determine precoding information for spatial multiplexing is signalled on PDCCH with DCI format 2 and 2A (TS 36.212, clause 5.3.3.1.5) */
    hardcoded,          /* SS shall apply configured precoding info as configured regardless RI and PMI reported by the UE */
    automatic           /* SS shall apply configured precoding info as long as there are no RI and PMI reported by the UE;
                         * when there are RI and PMI reported by the UE these shall be used */
  };

  type record SpatialMultiplexingInfo_Type {
    /* NOTE: there may be codebookSubsetRestriction as signalled to the UE (TS 36.331, clause 6.3.2 AntennaInfoDedicated) to be considered */
    PrecodingOperationMode_Type         OperationMode,
    PrecodingInfoIndex_Type             PrecodingIndex          /* NOTE: contains information about number of code words to be used in DCI format 2 */
  };

  type union MimoInfo_Type {
    Null_Type                           NoMimo,
    SpatialMultiplexingInfo_Type        Spatial
  };

  } // End sub-sub-sub-group MIMO_Configuration

  //============================================================================

  type union HarqProcessConfigDL_Type {                         /* HARQ processes to be used automatically for DL assignments */
    Null_Type                           AllProcesses,           /* all HARQ processes shall be used for automatic assignmnet; this is the normal case */
    HarqProcessList_Type                SpecificSubset          /* only the HARQ processes of this list shall be used automatically, other processes are excluded from automatic assignments;
                                                                 * nevertheless all HARQ processes may be addressed explicitly by DRB_DataPerSubframe_DL_Type.HarqProcess */
  };

  type record CcchDcchDtchConfigDL_Type {   /* configuration for CCCH/DCCH/DTCH mapped to DL-SCH mapped to PDSCH */
    /* TransmissionMode: as signalled to the UE (AntennaInfoDedicated in RRCConnectionSetup);
     * RNTI: C-RNTI (TS 36.321, clause 7.1);
     * all fields optional (omit = "keep as it is") since DCI format and modulation may be changed during a test;
     * for initial configuration all fields are mandatory */
    DciDlInfo_Type                      DciInfo       optional, /* DCI format: 1A per default since for CCCH mimo cannot be applied in general
                                                                 * ResourceAllocType: (depending on DCI format)
                                                                 * Modulation: QPSK for signalling
                                                                 * Frequency domain schedule: index of 1st RB; max. number of RBs per TTI;
                                                                 * in case of spatial multiplexing if there are 2 code words FreqDomainSchedul shall be applied to both */
    AntennaInfoDedicated_Type           AntennaInfo   optional, /* as signalled to the UE (TS 36.331, clause 6.3.2): transmissionMode, codebookSubsetRestriction */
    MimoInfo_Type                       MimoInfo      optional, /* when spatial multiplexing is applied (transmissionMode 3, 4):
                                                                 * precoding information, number of code words */
    HarqProcessConfigDL_Type        HarqProcessConfig optional  /* HARQ processes automatically used by the SS in DL */
  };

  } // End sub-sub-group UE_Specific_Channel_Configuration_DL

  //============================================================================

  group UE_Specific_Channel_Configuration_UL {                  /* Scheduling information for CCCH/DCCH/DTCH mapped to UL-SCH mapped to PUSCH */
  
  type union PucchHoppingBits_Type {                            /* Number of hopping bits acc. to TS 36.213 table 8.4-2 */
    B1_Type           OneBit,                                   /* N(UL, RB) = 6..49 i.e. default system bandwidthis less than 10 MHz (does not include 10 MHz) */
    B2_Type           TwoBits                                   /* N(UL, RB) = 50..110 i.e. default system bandwidth is 10 MHz or above */
  };

  type record UplinkHoppingResourceParameters_Type {
    PucchHoppingBits_Type               PucchHopping            /* to control hopping resource allocation as signalled in DCI format 0 (TS 36.212, clause 5.3.3.1.1) */
  };

  type union UplinkHoppingControl_Type {    /* shall be considered by SS to fill in the information needed for DCI format 0 (TS 36.213, clause 7.1) */
    Null_Type                            Deactivated,
    UplinkHoppingResourceParameters_Type Activated
  };

  type record CcchDcchDtchConfigUL_Type {   /* scheduling for CCCH/DCCH/DTCH mapped to UL-SCH mapped to PUSCH */
    /* NOTE 1:
     * for definition of the possible UL grants the location of the PUCCH (TS 36.211, clause 5.4.3)
     * and the PRACH (TS 36.211, clause 5.7.3) need to be taken into account;
     * NOTE 2:
     * In contrast to the DL where the scheduling can be done (with consideration of some restrictions) by SS on a per need basis in the UL the scheduling depends on information provided by the UE: e.g. BSR (buffer status report), SR (scheduling request)
     * see TS 36.523-3 clause 7.2 for further information. */
    DciUlInfo_Type              DciInfo               optional, /* DCI format: 0  (TS 36.213, clause 7.1)
                                                                 * ResourceAllocType: 2 (acc. to DCI format)
                                                                 * Modulation: QPSK per default
                                                                 * Frequency domain schedule: index of 1st RB; max. number of RBs per TTI
                                                                 * (upper bound up to which SS may assign grants to the UE) */
    UplinkHoppingControl_Type   Hopping               optional, /* when Hopping = 'Activated' SS shall set hopping flag in DCI format 0 */
    PUCCH_Synch_Type            PUCCH_Synch           optional, /* parameters to control automatic control of timing advance */
    UL_GrantConfig_Type         UL_GrantConfig        optional  /* UL grant allocation to be applied */

    // for TDD there will be additional parameters like configuration of HARQ processes (see TS 36.213, clause 8)
  };

  } // End sub-sub-group UE_Specific_Channel_Configuration_UL

  //============================================================================

  type union DrxCtrl_Type {                                     /* DRX configuration for connected mode (TS 36.321, clause 5.7) */
    Null_Type                   None,                           /* DRX not configured */
    DRX_Config_Type             Config                          /* DRX is configured as signalled to the UE */
  };

  type record TimeDomainRestriction_Type {
    MeasGapConfig_Type          MeasGapConfig                   /* measurement gap configuration acc. to TS 36.331, clause 6.3.5 and gap pattern acc. TS 36.133 Table 8.1.2.1-1 */
  };

  type record CcchDcchDtchConfig_Type {

    TimeDomainRestriction_Type  TimeDomainRestriction optional, /* to tell the SS when no assignments/grants shall be assigned to the UE */
    CcchDcchDtchConfigDL_Type   DL                    optional, /* Scheduling, parameters related to CCCH, DCCH and DTCH in DL */
    CcchDcchDtchConfigUL_Type   UL                    optional, /* Scheduling, parameters related to CCCH, DCCH and DTCH in UL */
    DrxCtrl_Type                DrxCtrl               optional, /* DRX configuration as sent to the UE (or 'None' when the UE does not support connected mode DRX) */
    TTI_BundlingConfig_Type     TtiBundling           optional  /* TTI bundling as configured at the UE */
  };

  } // End sub-group UE_Specific_Channel_Configuration


  } // End group Cell_Configuration

  //****************************************************************************

  group Cell_Power_Attenuation {

  type record CellAttenuationConfig_Type {
    CellId_Type                 CellId,
    Attenuation_Type            Attenuation
  };

  type record length(1..tsc_EUTRA_MaxNumberOfCells) of CellAttenuationConfig_Type CellAttenuationList_Type;

  } // End group Cell_Power_Attenuation

  //****************************************************************************

  group Radio_Bearer_Configuration {            /* Radio Bearer Configuration: SRBs/DRBs */

  group PDCP_Configuration {

  type enumerated PDCP_SNLength_Type {
    // PDCP Sequence Number
    PDCP_SNLength5,        // TS 36.323 clause 6.2.2
    PDCP_SNLength7,        // TS 36.323 clause 6.2.3
    PDCP_SNLength12        // TS 36.323 clause 6.2.4
  };

  type record PDCP_ROHC_Mode_Type {
    PDCP_SNLength_Type          SN_Size
  };

  type record PDCP_NonROHC_Mode_Type {
    PDCP_SNLength_Type          SN_Size
  };

  type union PDCP_TestModeInfo_Type {
    PDCP_ROHC_Mode_Type         PDCP_ROHC_Mode,                 /* ROHC test mode acc. to TS 36.523-3, clause 4.2.1.3.1;
                                                                 * requires PDCP to be configured for this RB =>
                                                                 * - SS applies ciphering in UL and DL
                                                                 * - SS maintains PDCP sequence numbers and state variables
                                                                 * Furthermore in this mode
                                                                 * - SS does not add/remove PDCP headers
                                                                 *   (in UL the PDCP PDUs are decoded depending on SN_Size)
                                                                 * - SS applies ROHC in DL only */
    PDCP_NonROHC_Mode_Type      PDCP_NonROHC_Mode               /* PDCP test mode acc. to TS 36.523-3, clause 4.2.1.3.2 (non-ROCH test mode);
                                                                 * requires PDCP to be configured as transparant =>
                                                                 * - SS does not apply ciphering in UL and DL
                                                                 * - SS does not interpret, insert or remove PDCP headers
                                                                 *   (in UL PDCP PDUs are decoded depending on SN_Size)
                                                                 * - SS does not maintain PDCP sequence numbers and state variables */
  };

  type union PDCP_TestModeConfig_Type {
    Null_Type                   None,
    PDCP_TestModeInfo_Type      Info
  };

  type union PDCP_RbConfig_Type {
    Null_Type                   Srb,                            /* for SRB1/2 there are no PDCP_Parameters;
                                                                 * SN is always 5 bits */
    PDCP_Config_Type            Drb,                            /* PDCP-Configuration acc. to TS 36.331, clause 6.3.2;
                                                                 * among others for UM here pdcp-SN-Size is configured to be either len7bits or len12bits;
                                                                 * for AM it always is 12bit */
    Null_Type                   Transparent                     /* used for PDCP tests (TS 36.523-3, clause 4.2.1.3.2):
                                                                 * the SS does not apply ciphering and does not maintain
                                                                 * PDCP sequence numbers and state variables;
                                                                 * in UL the PDCP PDUs are decoded acc. to the TestMode;
                                                                 * Note: a reconfiguration of a RB from transparent mode to 'normal' mode is not foreseen
                                                                 *       (i.e. there is no mechanism to restore Ciphering,
                                                                 *       PDCP sequence numbers and state variables at the SS) */
  };

  type record PDCP_ConfigInfo_Type {
    PDCP_RbConfig_Type          Rb                    optional, /* mandatory for initial configuration; omit means "keep as it is" */
    PDCP_TestModeConfig_Type    TestMode              optional  /* mandatory for initial configuration; omit means "keep as it is" */
  };

  type union PDCP_Configuration_Type {
    Null_Type                   None,                           /* for SRB0 no PDCP is configured; furthermore the PDCP may not be configured e.g. for DRBs tested in MAC test cases */
    PDCP_ConfigInfo_Type        Config
  };

  } // End sub-group PDCP_Configuration

  //----------------------------------------------------------------------------

  group RLC_Configuration {                     /* RLC configuration: radio bearer specific */

  type enumerated RLC_ACK_Prohibit_Type {
    Prohibit,                   /* cause SS RLC layer to stop any ACK transmission for UL PDU's received from UE */
    Continue                    /* bring back the SS RLC in normal mode, where ACK/NACK are transmitted at polling */
  };


  type enumerated RLC_NotACK_NextRLC_PDU_Type {
    Start                       /* cause SS RLC layer not to ACK the next received RLC PDU;
                                 * this is done regardless of whether the poll bit is set or not;
                                 * Example [from UMTS]:
                                 * when the UE gets new security information in a SECURITY MODE COMMAND
                                 * the response (SECURITY MODE COMPLETE) sent by the UE is not acknowledged at the RLC level;
                                 * this causes the UE to continue using the "old" security information */
  };

  type integer RLC_AM_SequenceNumber_Type (0..1023);            /* RLC AM sequence number */

  type union RLC_TestModeInfo_Type {
    RLC_ACK_Prohibit_Type       AckProhibit,                    /* valid only when the RLC is configured in AM */
    RLC_NotACK_NextRLC_PDU_Type NotACK_NextRLC_PDU,             /* valid only when the RLC is configured in AM */
    RLC_AM_SequenceNumber_Type  ModifyVTS,                      /* to modify the VT(S) at SS: VT(S) at the SS side is set to this (absolute) value;
                                                                   valid only when the RLC is configured in AM */
    Null_Type                   TransparentMode_UMDwith5BitSN,  /* shall be set when TTCN expects RLC PDUs as UMD in UL with an SN of 5 bits;
                                                                   valid only when the RLC is configured in TM */
    Null_Type                   TransparentMode_UMDwith10BitSN, /* shall be set when TTCN expects RLC PDUs as UMD in UL with an SN of 10 bits;
                                                                   valid only when the RLC is configured in TM */
    Null_Type                   TransparentMode_AMD             /* shall be set when TTCN expects RLC PDUs as AMD in UL;
                                                                   valid only when the RLC is configured in TM */
  };


  type union RLC_TestModeConfig_Type {
    Null_Type                   None,
    RLC_TestModeInfo_Type       Info
  };

  type record SS_RLC_AM_Type {
    UL_AM_RLC_Type              Tx                    optional, /* the UE's UL setting to be used in SS's tx direction */
    DL_AM_RLC_Type              Rx                    optional  /* the UE's DL setting to be used in SS's rx direction */
  };
  type record SS_RLC_UM_Bi_Directional_Type {
    UL_UM_RLC_Type              Tx                    optional, /* the UE's UL setting to be used in SS's tx direction */
    DL_UM_RLC_Type              Rx                    optional  /* the UE's DL setting to be used in SS's rx direction */
  };
  type record SS_RLC_UM_Uni_Directional_UL_Type {
    DL_UM_RLC_Type              Rx                    optional  /* the UE's DL setting to be used in SS's rx direction */
  };
  type record SS_RLC_UM_Uni_Directional_DL_Type {
    UL_UM_RLC_Type              Tx                    optional  /* the UE's UL setting to be used in SS's tx direction */
  };
  type Null_Type SS_RLC_TM_Type;                                /* TM to configure SRB0; no parameters to be defined */

  type union RLC_RbConfig_Type {
    SS_RLC_AM_Type                      AM,
    SS_RLC_UM_Bi_Directional_Type       UM,
    SS_RLC_UM_Uni_Directional_UL_Type   UM_OnlyUL,
    SS_RLC_UM_Uni_Directional_DL_Type   UM_OnlyDL,
    SS_RLC_TM_Type                      TM                      /* normally SRB0 only; may be used for test purposes also */
  };

  type record RLC_Configuration_Type {
    RLC_RbConfig_Type           Rb                    optional, /* mandatory for initial configuration; omit means "keep as it is" */
    RLC_TestModeConfig_Type     TestMode              optional  /* mandatory for initial configuration; omit means "keep as it is" */
  };

  } // End sub-group RLC_Configuration

  //----------------------------------------------------------------------------

  group MAC_Configuration {                     /* MAC configuration: radio bearer specific configuration */

  // Types for test mode configuration:
  type union MAC_Test_DLLogChID_Type {
    TestLogicalChannelId_Type   LogChId,        /* Specifies to over write the logical channel ID in MAC header in all the DL messages sent on the configured logical channel */
    Null_Type                   ConfigLchId     /* Specifies that the normal mode of correct logical channel ID to be used in DL MAc header.
                                                 * This will be the default mode, when SS is initially configured. */
  };

  type enumerated MAC_Test_DL_SCH_CRC_Mode_Type {
    Normal,                     /* default mode, the CRC generation is correct */
    Erroneous,                  /* SS shall generate CRC error by toggling CRC bits;
                                 * the CRC error shall be applied for all PDUs of the given RNTI and their retransmission until SS is configured back to 'normal' operation */
    Error1AndNormal             /* the SS generates wrong CRC for first transmission and correct CRC on first retransmission.
                                 * Later SS operates in normal mode. The retransmission is automatically triggered by reception of HARQ NACK */
  };

  type enumerated MAC_Test_SCH_NoHeaderManipulation_Type {
    NormalMode,                 /* MAC header is fully controlled by the SS */
    DL_SCH_Only,                /* No header to be added for the DL SCH transport channel.
                                 * TTCN will submit a final MAC PDU including header and payloads.
                                 * It is possible that data belonging to multiple DRBs is sent in one MAC PDU and from one special RB configured.
                                 * SRBs shall not be used on DL-SCH when DL-SCH MAC is configured in this mode. */
    UL_SCH_Only,                /* No header to be removed for any transmission received on UL_SCH and the complete MAC PDU received on UL-SCH needs to be directed to the special RB configured with this MAC manipulation.
                                 * TTCN shall be written in such a way that when UL-SCH MAC is configured in this mode, the UE is not requested to transmit any other data on UL-SCH than using the special RB. */
    DL_UL_SCH                   /* The DL-SCH shall be configured as for DL_SCH_Only and UL-SCH as for UL_SCH_Only */
  };

  const integer tsc_MaxHarqRetransmission := 28;                /* maximum value for maxHARQ-Msg3Tx as being signalled to the UE */
  type record length (1..tsc_MaxHarqRetransmission) of HARQ_Type HARQ_ModeList_Type;
  type union PhichTestMode_Type {
    Null_Type                   NormalMode,                     /* PHICH is configured to operate in normal mode */
    HARQ_ModeList_Type          ExplicitMode                    /* the number of elements in explicit list shall match the number of retransmissions being expected */
  };

  type record MAC_TestModeInfo_Type {
    /* Parameters/Configuration for MAC tests */
    MAC_Test_DLLogChID_Type                     DiffLogChId,            /* to be used in test cases 7.1.1.1 and 7.1.1.2 for using a different logical channel ID in MAC-heaader on DL-SCH channel */
    MAC_Test_SCH_NoHeaderManipulation_Type      No_HeaderManipulation   /* to configure mode for  no header manipulation in SS MAC layer for DL/UL SCH */
  };

  type union MAC_TestModeConfig_Type {
    Null_Type                   None,
    MAC_TestModeInfo_Type       Info
  };

  type record MAC_LogicalChannelConfig_Type {
    integer                     Priority,                       /* logical channel priority for the DL as described in TS 36.321, clause 5.4.3.1 for the UL */
    PrioritizedBitRate_Type     PrioritizedBitRate              /* PBR as described for the UL; probably not needed at SS */
  };

  type record MAC_Configuration_Type {
    MAC_LogicalChannelConfig_Type   LogicalChannel    optional, /* mandatory for initial configuration; omit means "keep as it is" */
    MAC_TestModeConfig_Type         TestMode          optional  /* mandatory for initial configuration; omit means "keep as it is";
                                                                 * for none MAC tests "TestMode.None:=true" */
  };

  } // End sub-group MAC_Configuration

  //----------------------------------------------------------------------------

  type integer LogicalChannelId_Type (0..10);           /* acc. TS 36.331, clause 6.3.2 for DRBs DTCH-LogicalChannelIdentity is INTEGER (3..10);
                                                         * additionally we have 0..2 for the SRBs */
  type integer TestLogicalChannelId_Type (0..31);       /* To be used in MAC test mode for reserved values of Logicall channels;*/

  type record RadioBearerConfigInfo_Type {
    /* semantics of omit: "keep as it is" */
    PDCP_Configuration_Type     Pdcp                  optional, /* for SRB0: "Pdcp.None:=true"
                                                                 * mandatory for initial configuration; omit means "keep as it is" */
    RLC_Configuration_Type      Rlc                   optional, /* mandatory for initial configuration; omit means "keep as it is" */
    LogicalChannelId_Type       LogicalChannelId      optional, /* DRBs: DTCH-LogicalChannelIdentity as for rb-MappingInfo in DRB-ToAddModifyList;
                                                                 * SRBs: for SRBs specified configurations acc. to TS 36.331, clause 9.1.2 shall be applied:
                                                                 * SRB1: ul-LogicalChannel-Identity = dl-LogicalChannel-Identity = 1
                                                                 * SRB2: ul-LogicalChannel-Identity = dl-LogicalChannel-Identity = 2
                                                                 * for SRB0 being mapped to CCCH the LCID is '00000'B acc. to TS 36.321, clause 6.2.1;
                                                                 * mandatory for initial configuration; omit means "keep as it is" */
    MAC_Configuration_Type      Mac                   optional
  };

  type union RadioBearerConfig_Type {
    RadioBearerConfigInfo_Type  AddOrReconfigure,               /* add / re-configure RB -
                                                                 * CellId : identifier of the cell being configured
                                                                 * RoutingInfo : None
                                                                 * TimingInfo : 'Now' in common cases
                                                                 * ControlInfo : CnfFlag:=true; FollowOnFlag:=false (in general) */
    Null_Type                   Release                         /* release RB -
                                                                 * CellId : identifier of the cell being configured
                                                                 * RoutingInfo : None
                                                                 * TimingInfo : 'Now' in common cases
                                                                 * ControlInfo : CnfFlag:=true; FollowOnFlag:=false (in general) */
  };

  type record RadioBearer_Type {
    RadioBearerId_Type          Id,                             /* either for SRB or DRB */
    RadioBearerConfig_Type      Config
  };

  type record length (1..tsc_MaxRB) of RadioBearer_Type RadioBearerList_Type;    /* array of SRBs and/or DRBs (DRBs + 3 SRBs) */

  } // End group Radio_Bearer_Configuration

  //****************************************************************************

  group AS_Security {      /* Primitive for control of AS security */

  type record PdcpSQN_Type {
    PdcpCountFormat_Type      Format,                          /* 5 bit, 7 bit or 12 bit SQN */
    integer                   Value                            /* SQN value (5 bit, 7 bit or 12 bit SQN)
                                                                * NOTE:
                                                                * in TTCN the test case writer is responsible to deal with potential overflows
                                                                * (e.g. there shall be a "mod 32", "mod 128" or "mod 4096" according to the format) */
  };

  type union PDCP_ActTime_Type {
    /* The sequence number in UL and DL for SRB1 should be one more than the present SQN, as Ciphering starts in UL and DL soon after SMC and SMComp;
     * For other SRB/DRB it should be the present SQN. */
    Null_Type                   None,                           /* No Activation time; to be used if Ciphering is not applied */
    PdcpSQN_Type                SQN                             /* PDCP sequence number */
  };

  type record SecurityActTime_Type {
    RadioBearerId_Type          RadioBearerId,
    PDCP_ActTime_Type           UL,
    PDCP_ActTime_Type           DL
  };

  type record length (1..tsc_MaxRB) of SecurityActTime_Type SecurityActTimeList_Type;

  type record AS_IntegrityInfo_Type {
    /* for initial configuration activation time is not needed for integrity protection as all messages in DL after security activation are integrity protected;
     * this means this ASP is invoked before transmission of Security mode command;
     * if there is a integrity violation in UL SS shall set the IndicationStatus in the common ASP part to flag the integrity error
     * (IndicationStatus.Error.Integrity.Pdcp := true);
     * integrity to be provided for each SRB as per core spec */
    IntegrityProtAlgorithm_Type    Algorithm,                   /* IntegrityProtAlgorithm_Type being defined in RRC ASN.1 */
    B128_Key_Type             KRRCint,
    SecurityActTimeList_Type  ActTimeList optional              /* omit for initial configuration (i.e. all SRBs to be integrity protected immediately);
                                                                 * in HO scenarios activation time may be needed e.g. for SRB1 */
  };

  type record AS_CipheringInfo_Type {
    CipheringAlgorithm_Type   Algorithm,                        /* CipheringAlgorithm_Type being defined in RRC ASN.1 */
    B128_Key_Type             KRRCenc,
    B128_Key_Type             KUPenc,                           /* KUPenc is mandatory; and SS uses it when DRB are configured */
    SecurityActTimeList_Type  ActTimeList
  };

  type record AS_SecStartRestart_Type {
    AS_IntegrityInfo_Type     Integrity optional,               /* optional to allow separated activation of integrity and ciphering; omit: keep as it is */
    AS_CipheringInfo_Type     Ciphering optional                /* optional to allow separated activation of integrity and ciphering; omit: keep as it is */
  };

  type union AS_Security_Type {                                 /* Security mode command procedure (TS 36.331, clause 5.3.4):
                                                                 * both SMC and SMComp are integrity protected
                                                                 * (nevertheless SS shall be able to cope with unprotected SM reject);
                                                                 * ciphering is started just after SMComp (acc. to TS 36.331, clause 5.3.4.3 and 5.3.1.1) */
    AS_SecStartRestart_Type   StartRestart,                     /* information to start/restart AS security protection in the PDCP */
    Null_Type                 Release                           /* to release AS security protection in the PDCP */
  };

  } // End group AS_Security

  //****************************************************************************

  group Semi_Persistent_Scheduling {
  /* Semi-persistent scheduling (SPS)
   * NOTE 1:
   * configuration of SPS cannot be done completely in advance but needs to be activated by PDCCH signalling
   * => SPS is configured/activated in an own primitive which may be sent to SS during RBs are being configured
   * NOTE 2:
   * semi-persistent (configured) scheduling is per UE (as well as 'normal' scheduling; see e.g. TS 36.300, clause 11.1) */

  type record SpsAssignmentUL_Type {
    /* information to assign semi-persistent scheduls in UL */
    DciUlInfo_Type              DciInfo               optional, /* to apply a grant */
    SpsConfigurationUL_Type     SchedulInterval       optional, /* as in TS 36.331, clause 6.3.2 SPS-ConfigUL */
    Null_Type                   SetNDI_1              optional  /* if present then NDI is set as 1 indicating a retransmission; If absent then NDI is set as 0 indicating a new transmission */
  };

  type record SpsAssignmentDL_Type {
    /* information to assign semi-persistent scheduls in DL */
    DciDlInfo_Type              DciInfo               optional, /* to apply a assignment */
    SpsConfigurationDL_Type     SchedulInterval       optional, /* as in TS 36.331, clause 6.3.2 SPS-ConfigDL */
    Null_Type                   SetNDI_1              optional  /* if present then NDI is set as 1 indicating a retransmission; If absent then NDI is set as 0 indicating a new transmission */
  };

  type record SpsActivateInfo_Type {
    /* Semi-persistent scheduling (SPS):
     * Even though SPS is pre-configured at the UE (e.g. RRCConnectionSetup->RadioResourceConfiguration->MAC_MainConfig) it needs to be activated by L1 signalling
     * => SS shall 'activate' SPS by sending appropriate assignments/grants to the UE; this shall be done with an activation time.
     * If SPS is already configured and new Activate command is received, at the activation time SS locally deactivates old SPS configuration, sends UE an PDCCH assignment for new SPS assignment and locally activates new SPS configuration.
     * In DL, in addition to SS SPS assignment configuration with activation time 'T', TTCN writer shall also schedule a DL MAC PDU with same activation time 'T' and at every SPS ScheduleInterval (NOTE: in general it is an error when TTCN does not provide data for a SchedulInterval; SS shall send no data in this case).
     * Special fields of PDCCH assignment are filled as per table 9.2-1 of 36.213 */
    C_RNTI                      SPS_C_RNTI,                     /* SPS C-RNTI as signalled to UE */
    SpsAssignmentUL_Type        UplinkGrant           optional,
    SpsAssignmentDL_Type        DownlinkAssignment    optional
  };

  type record SpsPdcchRelease_Type {
    /* On reception of this information SS shall send an SPS release indicated by PDCCH transmission with indicated DCI format (0 or 1A) at the activation time.
     * Special fields of PDCCH assignment are filled as per table 9.2-1A of 36.213 */
    C_RNTI                      SPS_C_RNTI,
    PdcchDciFormat_Type         DCI_Format  /* only formats 0 (UL release) and 1A (DL release) are applicable. It is a TTCN error if any other formats are used. */
  };

  type union SpsDeactivateInfo_Type {
    Null_Type                   LocalRelease,         /* SPS configuration shall be released at the SS, that means as well that the SS shall not address SPS_C_RNTI anymore from the given TimingInfo onward;
                                                       * NOTE: there is no SPS release to be signalled on PDCCH (this is done with PdcchExplicitRelease - see below) */
    SpsPdcchRelease_Type        PdcchExplicitRelease  /* SS transmits PDCCH content indicating SPS release but holds the local SPS configuration until it is locally released */
  };

  type union SpsConfig_Type {
    SpsActivateInfo_Type        Activate,             /* CellId : identifier of the cell where the UE is active
                                                       * RoutingInfo : None
                                                       * TimingInfo : activation time for SPS assignment/grant transmission; NOTE: the first SPS DL data packet shall be sent with the same timing information
                                                       * ControlInfo : CnfFlag:=false; FollowOnFlag:=false
                                                       */
    SpsDeactivateInfo_Type      Deactivate            /* CellId : identifier of the cell where the UE is active
                                                       * RoutingInfo : None
                                                       * TimingInfo : activation time for SPS release indicated by PDCCH transmission or SS local deactivation
                                                       * ControlInfo : CnfFlag:=false; FollowOnFlag:=false
                                                       */
  };

  } // End group Semi_Persistent_Scheduling

  //****************************************************************************

  group Paging_Trigger {

  type record PagingTrigger_Type {                              /* CellId : identifier of the cell where the UE is active
                                                                   RoutingInfo : None
                                                                   TimingInfo : Calculated paging occassion
                                                                   ControlInfo : CnfFlag:=false; FollowOnFlag:=false */
    /* primitive to trigger transmission of a paging on the PCCH at a calculated paging occasion (TS 36.304, clause 7);
     * the paging occasion is calculated by TTCN and activation time is applied;
     * as for BCCH Infor acc. to TS 36.331, clause 9.1.1.3 "RRC will perform padding, if required due to the granularity of the TF signalling, as defined in 8.5.";
     * therefore this needs to be done by the system simulator */
    PCCH_Message                Paging                          /* paging to be send out at paging occasion and being announced on PDCCH using P-RNTI */
  };


  } // End group  Paging_Trigger

  //****************************************************************************

  group L1_MAC_Indication_Control {    /* Primitive for control of L1/MAC indication for special purposes */

  type enumerated L1Mac_IndicationMode_Type {enable, disable};

  type record L1Mac_IndicationControl_Type {
    /* NOTE:
       Initially all indications are disabled in SS (i.e. it shall not be nacessary in 'normal' test cases to use this primitive but only if a specific indication is needed); omit means indication mode is not changed */
    L1Mac_IndicationMode_Type           RachPreamble          optional, /* To enable/disable reporting of PRACH preamble received. */
    L1Mac_IndicationMode_Type           SchedReq              optional, /* To enable/disable reporting of reception of Scheduling Request on PUCCH. */
    L1Mac_IndicationMode_Type           BSR                   optional, /* To enable/disable reporting of Buffer Status Report.
                                                                         * NOTE:
                                                                         * this is applicable only when MAC is configured in normal mode in UL;
                                                                         * MAC configured in test mode, results in over writing the report. */
    L1Mac_IndicationMode_Type           UL_HARQ               optional, /* To enable/disable reporting of reception of HARQ ACK/NACK. */
    L1Mac_IndicationMode_Type           C_RNTI                optional, /* To enable/disable reporting of C-RNTI sent by the UE within MAC PDU */
    L1Mac_IndicationMode_Type           PHR                   optional, /* To enable/disable reporting of Power Headroom Report.
                                                                         * NOTE:
                                                                         * this is applicable only when MAC is configured in normal mode in UL;
                                                                         * MAC configured in test mode, results in over writing the report. */
    L1Mac_IndicationMode_Type           HarqError             optional  /* To enable/disable reporting of HARQ errors */
  };

  } // End group L1_MAC_Indication_Control

  //****************************************************************************

  group Rlc_Indication_Control {    /* Primitive for control of RLC indication for special purposes */

  type enumerated Rlc_IndicationMode_Type {enable, disable};

  type record Rlc_IndicationControl_Type {
    Rlc_IndicationMode_Type             Discard                 optional  /* To enable/disable reporting of discarded RLC PDUs */
  };

  } // End group RLC_Indication_Control

  //****************************************************************************

  group PDCP_Count {    /* Primitives to enquire PDCP COUNT */

  type B32_Type PdcpCountValue_Type;
  type enumerated PdcpCountFormat_Type {
    PdcpCount_Srb,                      /* 27 bit HFN; 5 bit SQF */
    PdcpCount_DrbLongSQN,               /* 20 bit HFN; 12 bit SQF */
    PdcpCount_DrbShortSQN               /* 25 bit HFN; 7 bit SQF */
  };
  type record PdcpCount_Type {
    PdcpCountFormat_Type      Format,
    PdcpCountValue_Type       Value
  };
  type record PdcpCountInfo_Type {
    RadioBearerId_Type        RadioBearerId,
    PdcpCount_Type            UL  optional,     /* omit: keep as it is */
    PdcpCount_Type            DL  optional      /* omit: keep as it is */
  };

  type record length (1..tsc_MaxRB) of  PdcpCountInfo_Type PdcpCountInfoList_Type;

  type union PdcpCountGetReq_Type {
    Null_Type                 AllRBs,   /* return COUNT values for all RBs being configured */
    RadioBearerId_Type        SingleRB
  };

  type union PDCP_CountReq_Type {
    PdcpCountGetReq_Type      Get,      /* Request PDCP count for one or all RBs being configured at the PDCP */
    PdcpCountInfoList_Type    Set       /* Set PDCP count for one or all RBs being configured at the PDCP;
                                         * list for RBs which's COUNT shall be manipulated */
  };

  type union PDCP_CountCnf_Type {
    PdcpCountInfoList_Type    Get,      /* RBs in ascending order; SRBs first */
    Null_Type                 Set
  };

  } // End group PDCP_Count

  //****************************************************************************

  group PDCP_Handover {         /* Primitives to control PDCP regarding handover */

  type record PDCP_HandoverInit_Type {
    CellId_Type                         SourceCellId
  };

  type union PDCP_HandoverControlReq_Type {
    PDCP_HandoverInit_Type              HandoverInit,           /* to inform SS that a handover will follow:
                                                                 * in the common ASP part the CellId shall be set to the id of the target cell */
    Null_Type                           HandoverComplete        /* to inform SS that the handover has successfully been performed by the UE;
                                                                 * this shall trigger the SS to sent a PDCP Status Report to the UE;
                                                                 * in the common ASP part the CellId shall be set to the id of the target cell */
  };

  } // End group PDCP_Handover

  //****************************************************************************

  group L1_MAC_Test_Mode {  /* Primitive for control of L1/MAC Test Modes */

  type record L1_TestMode_Type {
    // L1 test mode; in general RACH is handled separately
    DL_SCH_CRC_Type           DL_SCH_CRC,       /* Manipulation of CRC bit generation for DL-SCH */
    PhichTestMode_Type        Phich             /* HARQ feedback mode on the PHICH */
  };

  type union DL_SCH_CRC_Type {
    /* NOTE:
     * CRC error mode for RA_RNTI is not addressed as it will be configured in RACHProcedureConfig */
    MAC_Test_DL_SCH_CRC_Mode_Type  C_RNTI,      /* to configure mode for CRC bit for all MAC PDU's for which C-RNTI is used in PDCCH transmission */
    MAC_Test_DL_SCH_CRC_Mode_Type  SI_RNTI,     /* to configure mode for CRC bit for all MAC PDU's for which SI-RNTI is used in PDCCH transmission */
    MAC_Test_DL_SCH_CRC_Mode_Type  SPS_RNTI     /* to configure mode for CRC bit for all MAC PDU's for which SPS-RNTI is used in PDCCH transmission */
  };

  } // End group L1_MAC_Test_Mode

  //****************************************************************************

  group PDCCH_Order {           /* Primitive to trigger SS to send PDCCH order to initiate RA procedure (TS 36.321, clause 5.1.1) */

  type Ra_PreambleIndex_Type PrachPreambleIndex_Type;
  type integer PrachMaskIndex_Type (0..15);     /* TS 36.321, clause 7.3 */

  type record  RA_PDCCH_Order_Type {            /* see also TS 36.212, clause 5.3.3.1.3 */
    PrachPreambleIndex_Type     PreambleIndex,  /* naming acc. TS 36.212, clause 5.3.3.1.3 */
    PrachMaskIndex_Type         PrachMaskIndex  /* naming acc. TS 36.212, clause 5.3.3.1.3 */
  };

  } // End group PDCCH_Order

  //****************************************************************************
  
  group System_Indications {                    /* Primitives for System indications */

  type Dummy_Type PRTPower_Type;                                /* needs to define appropriately the power level report of PREAMBLE_RECEIVED_TARGET_POWER;
                                                                 * NOTE: for the time being this is just a place holder for enhancements in the future. */

  type integer LogicalChannelGroup_Type (0..3);
  type integer BSR_Value_Type (0..63);
  type integer PHR_Type (0..63);

  type union HarqError_Type {
    Null_Type           UL,                                     /* indicates HARQ error detected at the SS side (error at UL transmission) */
    Null_Type           DL                                      /* indicates HARQ NACK sent by the UE (error at DL transmission) */
  };

  type record RachPreamble_Type {
    PrachPreambleIndex_Type             RAPID,                  /* indicates the RAPID of the preamble used (integer (0..63)) */
    PRTPower_Type                       PRTPower                /* represents the PREAMBLE_RECEIVED_TARGET_POWER */
  };

  type record Short_BSR_Type {
    LogicalChannelGroup_Type            LCG,                    /* Logical channel Group */
    BSR_Value_Type                      Value                   /* BSR value */
  };
  type record Long_BSR_Type {
    BSR_Value_Type                      Value_LCG1,             /* BSR value for LCG 1 */
    BSR_Value_Type                      Value_LCG2,             /* BSR value for LCG 2 */
    BSR_Value_Type                      Value_LCG3,             /* BSR value for LCG 3 */
    BSR_Value_Type                      Value_LCG4              /* BSR value for LCG 4 */
  };
  type union BSR_Type {
    Short_BSR_Type                      Short,
    Short_BSR_Type                      Truncated,
    Long_BSR_Type                       Long
  };

  type enumerated HARQ_Type {ack, nack};                        /* ack represents HARQ ACK; nack represents HARQ_NACK */

  type record RlcDiscardInd_Type {                              /* SS shall send this indication if it discards a received RLC AMD PDU as specified in TS 36.322 cl. 5.1.3.2.2. */
    integer                             SequenceNumber          /* sequence number of the PDU being discarded */
  };

  } // End group System_Indications

  //****************************************************************************

  group System_Interface {

  type record SYSTEM_CTRL_REQ {
    ReqAspCommonPart_Type       Common,         /* TimingInfo depends on respective primitive: */
    SystemRequest_Type          Request         /* - Cell
                                                 *   TimingInfo: 'now' (in general)
                                                 * - CellAttenuationList
                                                 *   TimingInfo: 'now' (in general, but activation time may be used also)
                                                 * - RadioBearerList
                                                 *   TimingInfo: 'now' in general;
                                                 *     activation time may be used in special case for release and/or reconfiguration of one or several RBs;
                                                 *     the following rules shall be considered:
                                                 *       - release/Reconfiguration of an RB shall not be scheduled ealier than 5ms after a previous data transmission on this RB
                                                 *       - subsequent release and reconfiguration(s) shall be scheduled with an interval of at least 5ms
                                                 *       - a subsequent data transmission on an RB shall not be scheduled ealier than 5ms after the last reconfiguration of the RB
                                                 *     the configuration shall be performed exactly at the given time
                                                 * - EnquireTiming
                                                 *   TimingInfo: 'now'
                                                 * - AS_Security
                                                 *   TimingInfo: 'now';
                                                 *   NOTE: "activation time" may be specified in the primitive based on PDCP SQN
                                                 * - Sps
                                                 *   TimingInfo: activation time for SPS assignment transmission
                                                 * - Paging
                                                 *   TimingInfo: Calculated paging occassion
                                                 * - L1MacIndCtrl
                                                 *   TimingInfo: 'now' (in general)
                                                 * - PdcpCount
                                                 *   TimingInfo: 'now'
                                                 * - L1_TestMode
                                                 *   TimingInfo: depends on the test mode;
                                                 *   activation time is used e.g. for manipulation of the CRC
                                                 * - PdcchOrder
                                                 *   TimingInfo: 'now' (in general)
                                                 */
  };

  type record SYSTEM_CTRL_CNF {
    CnfAspCommonPart_Type       Common,         /* TimingInfo is ignored by TTCN (apart from EnquireTiming)
                                                 * => SS may set TimingInfo to "None" */
    SystemConfirm_Type          Confirm
  };

  type record SYSTEM_IND {
    IndAspCommonPart_Type       Common,         /* The SS shall provide TimingInfo (SFN + subframe number) depending on the respective indication: */
    SystemIndication_Type       Indication      /* - Error/HarqError
                                                 *   TimingInfo: related to the error (if available)
                                                 * - RachPreamble
                                                 *   TimingInfo: shall indicate start of the RACH preamble
                                                 * - SchedReq
                                                 *   TimingInfo: subframe containing the SR
                                                 * - BSR
                                                 *   TimingInfo: subframe in which the MAC PDU contains the BSR
                                                 * - UL_HARQ
                                                 *   TimingInfo: subframe containing the UL HARQ
                                                 * - C_RNTI
                                                 *   TimingInfo: subframe in which the MAC PDU contains the C_RNTI
                                                 * - PHR
                                                 *   TimingInfo: subframe in which the MAC PDU contains the PHR
                                                 */
  };

  type port EUTRA_SYSTEM_PORT message {         /* EUTRA PTC: Port for system configuration */
    out SYSTEM_CTRL_REQ;
    in  SYSTEM_CTRL_CNF;
  };

  type port EUTRA_SYSIND_PORT message {         /* EUTRA PTC: Port for system indications */
    in  SYSTEM_IND;
  };

  } // End group System_Interface

}
