/******************************************************************************/
// @copyright   Copyright Notification
//   No part may be reproduced except as authorized by written permission.
//   The copyright and the foregoing restriction extend to reproduction in all media.
//   Trademark 2010, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC).
//   All rights reserved.
// @version: IWD_10wk37
// $Date: 2010-09-17 16:46:33 +0200 (Fri, 17 Sep 2010) $
// $Rev: 3960 $
/******************************************************************************/
module Idle_CellReselection
{
//=========================================================================
// Imports
//=========================================================================

  import from EUTRA_RRC_ASN1_Definitions language "ASN.1:1997" all;
  import from EUTRA_ASP_TypeDefs all;
  import from EUTRA_Component all;
  import from EUTRA_CommonDefs all;
  import from EUTRA_CellInfo all;
  import from EUTRA_ConfigurationSteps all;
  import from EUTRA_IdleMode all;
  import from EUTRA_NASSteps all;
  import from EUTRA_RRCSteps all;
  import from EUTRA_CommonProcedures all;
  import from EUTRA_AuxiliaryFunctions all;
  import from EUTRA_AspCommon_Templates all;
  import from EUTRA_SRB_Templates all;
  import from EUTRA_RRC_Templates all;
  import from EUTRA_SysInfo_Templates all;
  import from EUTRA_NASCommonFunctions all;
  import from EUTRA_ASP_SrbDefs all;
  import from EUTRA_Parameters all;

  import from EPS_NAS_Templates all;
  import from EPS_NAS_Constants all;
  import from EPS_NAS_MsgContainers all;
  import from EPS_NAS_TypeDefs all;

  import from CommonDefs all;
  import from UpperTesterFunctions all;
  import from Parameters all;

  import from NAS_24008Templates all;
  import from NAS_CommonTypeDefs all;


//==============================================================================
// Templates
//==============================================================================

  template (value) IntraFreqNeighCellInfo cs_IntraFreqNeighCellInfo ( PhysCellId p_PhysCellId,
                                                                      Q_OffsetRange p_Q_OffsetRange) :=
  { /* @status    APPROVED */
    physCellId   := p_PhysCellId,
    q_OffsetCell := p_Q_OffsetRange
  };

  template (value) SystemInformationBlockType4 cs_SIB4_OneNeighCellEntry ( PhysCellId p_PhysCellId,
                                                                           Q_OffsetRange p_Q_OffsetRange) :=
    /* @status     */
    cs_SIB4_NeighCellList( { cs_IntraFreqNeighCellInfo(p_PhysCellId, p_Q_OffsetRange) } );

  template (value) SystemInformationBlockType4 cs_SIB4_ThreeNeighCellEntries ( PhysCellId p_PhysCellId1,
                                                                               Q_OffsetRange p_Q_OffsetRange1,
                                                                               PhysCellId p_PhysCellId2,
                                                                               Q_OffsetRange p_Q_OffsetRange2,
                                                                               PhysCellId p_PhysCellId3,
                                                                               Q_OffsetRange p_Q_OffsetRange3) :=
    /* @status    APPROVED */
    cs_SIB4_NeighCellList( { cs_IntraFreqNeighCellInfo(p_PhysCellId1, p_Q_OffsetRange1),
                             cs_IntraFreqNeighCellInfo(p_PhysCellId2, p_Q_OffsetRange2),
                             cs_IntraFreqNeighCellInfo(p_PhysCellId3, p_Q_OffsetRange3) } );

  // Default values according to 36.508 cl. 6.3.1.1
  template (value) SystemInformationBlockType4 cs_508_Cell1_DefSIB4_IntraFreqCellList :=
    /* @status    APPROVED */
    cs_SIB4_ThreeNeighCellEntries ( 2, dB0,//q-OffsetCell = 0 dB for cell 2
                                    4, dB0,//q-OffsetCell = 0 dB for cell 4
                                    11, dB0 );//q-OffsetCell = 0 dB for cell 11)

  // Default values according to 36.508 cl. 6.3.1.1
  template (value) SystemInformationBlockType4 cs_508_Cell2_DefSIB4_IntraFreqCellList :=
    /* @status    APPROVED */
    cs_SIB4_ThreeNeighCellEntries ( 1, dB0,//q-OffsetCell = 0 dB for cell 2
                                    4, dB0,//q-OffsetCell = 0 dB for cell 4
                                    11, dB0 );//q-OffsetCell = 0 dB for cell 11)

//==============================================================================
// Functions
//==============================================================================

  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.1.2.2
   * @status    APPROVED
   */
  function f_TC_6_1_2_2_EUTRA ( ) runs on EUTRA_PTC
  {
    var Q_Rxlevmin_Type v_Q_Rxlevmin := -42;
    timer t_WaitTime := 60.0;
    timer t_IdleMode_GenericTimer := tsc_IdleMode_GenericTimer;

    //Initialise all cell, security and mobile parameters
    f_EUTRA_Init( c1 );

    //Set Cell powel level for Cell 1 to be used in creation
    f_EUTRA_CellInfo_InitMaxReferencePower ( eutra_Cell1, -75 );

    //Create and configure Cell 1
    f_EUTRA_CellConfig_Def ( eutra_Cell1 );

    //@sic R5-104791 : Removed Pre-test conditions for UE sic@

    f_EUTRA_TestBody_Set ( true );

    //@sic R5-104791 : Step 0a & 0b added to Test procedure sequence sic@
    //@siclog "Step 0a-0b" siclog@
    f_EUTRA_CellInfo_SetSysInfo_Q_Rxlevmin ( eutra_Cell1, v_Q_Rxlevmin );
    f_EUTRA_ModifySysinfoUE_Off ( eutra_Cell1 ); //@sic R5s100466 Change 13 sic@
    f_EUTRA_SetCellPower ( eutra_Cell1, -95, cs_TimingInfo_Now );

    //@siclog "Step 1" siclog@
    //UE is switched on
    f_UT_SwitchOnUE ( UT, false );

    //@siclog "Step 2" siclog@
    //Check for no RRCConnectionRequest message on Cell 1
    t_WaitTime.start;
    alt {
      [] SRB.receive( car_SRB0_RrcPdu_IND ( eutra_Cell1, cr_508_RRCConnectionRequest ) ) //@sic R5-101052 sic@
      {
        //* @verdict fail UE sent RRCConnectionRequest message on Cell 1 within t_WaitTime
        f_EUTRA_SetVerdictFailOrInconc (__FILE__, __LINE__, "Test Case 6.1.2.2 Step 2");
      }
      [] t_WaitTime.timeout {   }
    }

    //@siclog "Step 3" siclog@
    //Adjusts cell power level according to T2
    f_EUTRA_SetCellPower ( eutra_Cell1, -75, cs_TimingInfo_Now );
    t_IdleMode_GenericTimer.start;

    //@siclog "Step 4" siclog@
    //Receive RRCConnectionRequest on Cell 1
    SRB.receive( car_SRB0_RrcPdu_IND ( eutra_Cell1, cr_508_RRCConnectionRequest ) ); // @sicR5-101052 sic@
    //Stop Idle Mode Geberic Timer
    t_IdleMode_GenericTimer.stop;
    //* @verdict pass RRCConnectionRequest message received on Cell 1
    f_EUTRA_PreliminaryPass (__FILE__, __LINE__, "Test Case 6.1.2.2 Step 4");

    //@siclog "Step 5 - 19" siclog@
    //Perform step 3 to 17 of the registration procedure defined in 36.508 cl. 4.5.2.3
    f_EUTRA_IdleUpdated_WithoutRRCConnReq ( eutra_Cell1, STATE2_IDLEUPDATE );

    f_EUTRA_TestBody_Set ( false );

    //Switch/power off UE
    f_EUTRA_Postamble ( eutra_Cell1, E1_IDLE ); //@sic R5-103681 sic@
  }

  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.1.2.3
   * @status    APPROVED
   */
  function f_TC_6_1_2_3_EUTRA ( ) runs on EUTRA_PTC
  {
    var Q_Hyst_Type v_Q_Hyst := dB0;
    var Q_Rxlevmin_Type v_Q_Rxlevmin := -55;
    var T_ReselectionEutran_Type v_T_Reselection := 7;
    var CellBarred_Type v_CellBarred := barred;
    var IntraFreqRes_Type v_IntraFreqRes := allowed;
    var template (value) CellPowerList_Type v_CellPowerList_AtT1 := { //@sic R5-104777 : Remove T0 from test case sic@
      cs_CellPower ( eutra_Cell1, tsc_NonSuitableOffCellRS_EPRE ),
      cs_CellPower ( eutra_Cell2, tsc_ServingCellRS_EPRE )
    };

    //Initialise all cell, security and mobile parameters
    f_EUTRA_Init( c1 );

    //Set maximum cell powel level for Cell 1 & 2
    f_EUTRA_CellInfo_InitMaxReferencePower ( eutra_Cell1, -79 );

    //Set SIB1 according to specific message contents (36.523-1 Table 6.1.2.3.3.3-2)
    f_EUTRA_CellInfo_SetSysInfo_Q_Rxlevmin ( eutra_Cell1, v_Q_Rxlevmin );
    f_EUTRA_CellInfo_SetSysInfo_Q_Rxlevmin ( eutra_Cell2, v_Q_Rxlevmin );

    //Set SIB3 according to specific message contents (36.523-1 Table 6.1.2.3.3.3-3)
    f_EUTRA_CellInfo_SetSysInfo_Intra_QRxlevmin ( eutra_Cell1, v_Q_Rxlevmin );
    f_EUTRA_CellInfo_SetSysInfo_Intra_QRxlevmin ( eutra_Cell2, v_Q_Rxlevmin );
    f_EUTRA_CellInfo_SetSysInfo_Q_Hyst ( eutra_Cell1, v_Q_Hyst );
    f_EUTRA_CellInfo_SetSysInfo_Q_Hyst ( eutra_Cell2, v_Q_Hyst );
    f_EUTRA_CellInfo_SetSysInfo_T_Reselection ( eutra_Cell1, v_T_Reselection );
    f_EUTRA_CellInfo_SetSysInfo_T_Reselection ( eutra_Cell2, v_T_Reselection );

    //Set TAC according to 36.523-1 Table 6.0.4-2: Tracking Area Code (TAC) for E-UTRAN cells
    //TAC for Cell 1 is set to 1 in f_EUTRA_Init
    f_EUTRA_CellInfo_SetTAC ( eutra_Cell2, tsc_IdleMode_TAC_Cell2 );

    //Create and configure all cells
    f_EUTRA_CellConfig_Def ( eutra_Cell1 );
    f_EUTRA_CellConfig_Def ( eutra_Cell2 ); // @sic R5s100356, R5s100456 & R5s100466 sic@

    //Bring UE to initial state
    f_EUTRA_Preamble ( eutra_Cell1, STATE2_IDLEUPDATE );

    //@sic R5-104777 : Remove T0 from test case sic@

    f_EUTRA_TestBody_Set ( true );

    //@siclog "Step 1" siclog@
    //Change cell power level according to T1
    f_EUTRA_SetCellPowerList ( v_CellPowerList_AtT1, cs_TimingInfo_Now ); //@sic R5-104777 : Remove T0 from test case sic@

    //@siclog "Step 2" siclog@
    //Check if UE camps on Cell 2
    f_EUTRA_IdleMode_TAU ( eutra_Cell2 );

    //@siclog "Step 3" siclog@
    //Change cell settings according to T2
    f_EUTRA_SetCellPower ( eutra_Cell1, -91, cs_TimingInfo_Now );
    f_EUTRA_CellInfo_SetSysInfo_CellBarred ( eutra_Cell2, v_CellBarred );
    f_EUTRA_Cellinfo_SetSysInfo_IntraFreqRes ( eutra_Cell2, v_IntraFreqRes );
    f_EUTRA_ModifySysinfo ( eutra_Cell2 );

    //@siclog "Step 4" siclog@
    //Check if UE camps on Cell 1
    f_EUTRA_IdleMode_TAU ( eutra_Cell1 );

    f_EUTRA_TestBody_Set ( false );

    //Switch/power off UE
    f_EUTRA_Postamble ( eutra_Cell1, E1_IDLE );
  }
 
  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.1.2.4
   * @status    APPROVED
   */
  function f_TC_6_1_2_4_EUTRA ( ) runs on EUTRA_PTC
  {
    //@sic R5-104778 : Remove T0 from test case sic@

    //Initialise all cell, security and mobile parameters
    f_EUTRA_Init (c1); //@sic R5s100029 change 2/1 sic@

    //Set TAC for Cell 1 and 2 according to 36.523-1 Table 6.0.4-2: Tracking Area Code (TAC) for E-UTRAN cells
    //TAC for Cell 1 is set to 1 in f_EUTRA_Init
    f_EUTRA_CellInfo_SetTAC (eutra_Cell2, tsc_IdleMode_TAC_Cell2);

    //Set maximum cell powel level for Cell 1 & 2 be used in creation
    f_EUTRA_CellInfo_InitMaxReferencePower (eutra_Cell2, -79); //@sic R5s100029 change 2/2 sic@

    //Create and configure all cells
    f_EUTRA_CellConfig_Def (eutra_Cell1);
    f_EUTRA_CellConfig_Def (eutra_Cell2); //@sic R5s100029 cl. 4.6 sic@

    //Bring UE to initial state
    f_EUTRA_Preamble (eutra_Cell1, STATE2_IDLEUPDATE);

    //@sic R5-104778 : Remove T0 from test case sic@

    f_EUTRA_TestBody_Set (true);

    //@siclog "Step 1" siclog@
    //Change cell power level according to T1
    f_EUTRA_SetCellPower (eutra_Cell2, -79, cs_TimingInfo_Now); //@sic R5-104778 : Remove T0 from test case sic@

    //@siclog "Step 2" siclog@
    //Check if UE camps on cell 2
    f_EUTRA_IdleMode_TAU (eutra_Cell2);

    f_EUTRA_TestBody_Set (false);

    //Switch/power off UE
    f_EUTRA_Postamble (eutra_Cell2, E1_IDLE);
  }

  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.1.2.5
   * @status
   */
  function f_TC_6_1_2_5_EUTRA ( ) runs on EUTRA_PTC {

    var CellRes_Prio_Type v_CellRes_Prio_Cell1, v_CellRes_Prio_Cell3, v_CellRes_Prio_Cell10;
    var ReselectionThreshold v_ThreshXHigh := 10;
    var CellReselectionPriority v_CellReselectionPriority_for_Cell1 := 1;
    var CellReselectionPriority v_CellReselectionPriority_for_Cell3 := 3;
    var CellReselectionPriority v_CellReselectionPriority_for_Cell10 := 5;
    var CarrierFreqEUTRA v_CarrierFreq_Cell1, v_CarrierFreq_Cell3, v_CarrierFreq_Cell10;
    var ChannelBandwidthDependency_Type v_ChannelBandwidthDependency;
    var Ul_Bandwidth_Type v_UL_PrimaryBandwidth := f_ConvertDL_BandwidthToUL (px_ePrimaryBandChannelBandwidth);
    var Dl_Bandwidth_Type v_DL_PrimaryBandwidth := px_ePrimaryBandChannelBandwidth;
    var Ul_Bandwidth_Type v_UL_SecondaryBandwidth := f_ConvertDL_BandwidthToUL (px_eSecondaryBandChannelBandwidth);
    var Dl_Bandwidth_Type v_DL_SecondaryBandwidth := px_eSecondaryBandChannelBandwidth;
    var template (value) CellPowerList_Type v_CellPowerList_AtT1 := {
      cs_CellPower (eutra_Cell3, -73),
      cs_CellPower (eutra_Cell10, -73)
    };
    
    v_CellRes_Prio_Cell1 := 1;
    v_CellRes_Prio_Cell3 := 3;
    v_CellRes_Prio_Cell10 := 5;

    //Initialise all cell, security and mobile parameters
    //SIB5 is init. in f_EUTRA_InitSystemInformation5 with default values according to 36.508 cl. 6.3.1.2
    f_EUTRA_Init (c3);
    
    //Since f5 (interband frequency) is not initialised by default in SIB5...
    //...we need to re-init SIB5 this time including f5
    f_EUTRA_SetDefaultSIB5_MultiBand (eutra_Cell1);
    f_EUTRA_SetDefaultSIB5_MultiBand (eutra_Cell3);
    f_EUTRA_SetDefaultSIB5_MultiBand (eutra_Cell10);

    //Get band dependent parameters
    v_ChannelBandwidthDependency := f_EUTRA_BandDependentParam (v_DL_PrimaryBandwidth, v_UL_PrimaryBandwidth);

    //Get DL carrier frequency of cell 3 and 10
    v_CarrierFreq_Cell1 := f_EUTRA_CellInfo_GetEARFCN (eutra_Cell1);
    v_CarrierFreq_Cell3 := f_EUTRA_CellInfo_GetEARFCN (eutra_Cell3);
    v_CarrierFreq_Cell10 := f_EUTRA_CellInfo_GetEARFCN (eutra_Cell10);

    //Set maximum cell powel level for cell 1, cell 3 and cell 10 to be used in creation
    f_EUTRA_CellInfo_InitMaxReferencePower (eutra_Cell3, -73);
    f_EUTRA_CellInfo_InitMaxReferencePower (eutra_Cell10, -73);

    //Set sys info and cell info for cell 1, cell 3 and cell 10 to be used in creation
    //TAC for Cell 1 is set to 1 in f_EUTRA_Init ();
    f_EUTRA_CellInfo_SetTAC (eutra_Cell3, tsc_IdleMode_TAC_Cell3);
    f_EUTRA_CellInfo_SetTAC (eutra_Cell10, tsc_IdleMode_TAC_Cell10);
    /* PLMN for cell 1, 3 and 10 is set according to Table 4.4.2-2:
       Default NAS parameters for simulated cells in 36.508 in f_EUTRA_Init */
    
    //Set SystemInformationBlockType3 for Cell 1, 3 and 10 according to Table 6.1.2.5.3.3-1
    f_EUTRA_CellInfo_SetSysInfo_CellRes_Prio (eutra_Cell1, v_CellRes_Prio_Cell1);
    f_EUTRA_CellInfo_SetSysInfo_CellRes_Prio (eutra_Cell3, v_CellRes_Prio_Cell3);
    f_EUTRA_CellInfo_SetSysInfo_CellRes_Prio (eutra_Cell10, v_CellRes_Prio_Cell10);

    //Update SystemInformationBlockType5 on Cell 1 according to 36.523-1 Table 6.1.2.5.3.3-2 and 36.508 cl. 6.3.1.2
    // v_CarrierFreq_Cell3 is f2
    // v_CarrierFreq_Cell6 is f3
    // v_CarrierFreq_Cell10 is f5
    f_EUTRA_CellInfo_SetSIB5 (eutra_Cell1, cs_508_SystemInformationBlockType5_Def ( { cs_InterFreqCarrierFreq_ThreshXHigh_CRPri ( v_CarrierFreq_Cell3,
                                                                                        v_ChannelBandwidthDependency.AllowedMeasBandwidth,
                                                                                        v_ThreshXHigh,
                                                                                        v_CellReselectionPriority_for_Cell3 ),
                                                                                      //InterFreqCarrierFreqInfo ( v_CarrierFreq_Cell6, v_ChannelBandwidthDependency.AllowedMeasBandwidth ),
                                                                                      //According to 6.523-1 Table 6.1.2.5.3.3-2 only 2 entries are provided.
                                                                                      cs_InterFreqCarrierFreq_ThreshXHigh_CRPri ( v_CarrierFreq_Cell10,
                                                                                        v_ChannelBandwidthDependency.AllowedMeasBandwidth,
                                                                                        v_ThreshXHigh,
                                                                                        v_CellReselectionPriority_for_Cell10 ) } ) );

    //Update SystemInformationBlockType5 on Cell 3 according to 36.523-1 Table 6.1.2.5.3.3-2 and 36.508 cl. 6.3.1.2
    // v_CarrierFreq_Cell1 is f1
    // v_CarrierFreq_Cell6 is f3
    // v_CarrierFreq_Cell10 is f5
    f_EUTRA_CellInfo_SetSIB5 (eutra_Cell3, cs_508_SystemInformationBlockType5_Def ( { cs_InterFreqCarrierFreq_ThreshXHigh_CRPri ( v_CarrierFreq_Cell1,
                                                                                        v_ChannelBandwidthDependency.AllowedMeasBandwidth,
                                                                                        v_ThreshXHigh,
                                                                                        v_CellReselectionPriority_for_Cell1 ),
                                                                                      //InterFreqCarrierFreqInfo ( v_CarrierFreq_Cell6, v_ChannelBandwidthDependency.AllowedMeasBandwidth ),
                                                                                      //According to 6.523-1 Table 6.1.2.5.3.3-2 only 2 entries are provided.
                                                                                      cs_InterFreqCarrierFreq_ThreshXHigh_CRPri ( v_CarrierFreq_Cell10,
                                                                                        v_ChannelBandwidthDependency.AllowedMeasBandwidth,
                                                                                        v_ThreshXHigh,
                                                                                        v_CellReselectionPriority_for_Cell10 ) } ) );

    //Update SystemInformationBlockType5 on Cell 10 according to 36.523-1 Table 6.1.2.5.3.3-2 and 36.508 cl. 6.3.1.2
    // v_CarrierFreq_Cell1 is f1
    // v_CarrierFreq_Cell3 is f2
    // v_CarrierFreq_Cell6 is f3
    //Get band dependent parameters for the secondary band
    v_ChannelBandwidthDependency := f_EUTRA_BandDependentParam (v_DL_SecondaryBandwidth, v_UL_SecondaryBandwidth);
    f_EUTRA_CellInfo_SetSIB5 (eutra_Cell10, cs_508_SystemInformationBlockType5_Def ( { cs_InterFreqCarrierFreq_ThreshXHigh_CRPri ( v_CarrierFreq_Cell1,
                                                                                         v_ChannelBandwidthDependency.AllowedMeasBandwidth,
                                                                                         v_ThreshXHigh,
                                                                                         v_CellReselectionPriority_for_Cell1 ),
                                                                                       cs_InterFreqCarrierFreq_ThreshXHigh_CRPri ( v_CarrierFreq_Cell3,
                                                                                         v_ChannelBandwidthDependency.AllowedMeasBandwidth,
                                                                                         v_ThreshXHigh,
                                                                                         v_CellReselectionPriority_for_Cell3 )//,
                                                                                       //InterFreqCarrierFreqInfo ( v_CarrierFreq_Cell6, v_ChannelBandwidthDependency.AllowedMeasBandwidth ),
                                                                                       //According to 6.523-1 Table 6.1.2.5.3.3-2 only 2 entries are provided.
                                                                                        } ) );

    //Create and configure all cells
    f_EUTRA_CellConfig_Def (eutra_Cell1);
    f_EUTRA_CellConfig_Def (eutra_Cell3);
    f_EUTRA_CellConfig_Def (eutra_Cell10);

    //Bring UE to initial state
    f_EUTRA_Preamble (eutra_Cell1, STATE2_IDLEUPDATE);

    f_EUTRA_TestBody_Set (true);

    //@siclog "Step 1" siclog@
    //Change cell settings according to T1
    f_EUTRA_SetCellPowerList (v_CellPowerList_AtT1, cs_TimingInfo_Now);

    //@siclog "Step 2" siclog@
    //Check if UE camps on Cell 10
    f_EUTRA_IdleMode_TAU (eutra_Cell10);

    f_EUTRA_TestBody_Set (false);

    //Switch/power off UE
    f_EUTRA_Postamble (eutra_Cell10, E1_IDLE);
  }

  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.1.2.6
   * @status    APPROVED
   */
  function f_TC_6_1_2_6_EUTRA ( ) runs on EUTRA_PTC
  {
    var template (value) CellPowerList_Type v_CellPowerList_AtT1, v_CellPowerList_AtT3, v_CellPowerList_AtT4, v_CellPowerList_AtT6, v_CellPowerList_AtT7; //@sic R5s100475 Change 1 & R5-104792 sic@
    var float v_ModificationPeriod_s; // Modification period in second //@sic R5-104792 & R5s100475 : Delay for step 5B sic@
    var Q_Hyst_Type v_Q_Hyst_dB24 := dB24;
    var Q_Hyst_Type v_Q_Hyst_dB0 := dB0;
    var T_ReselectionEutran_Type v_T_Reselection := 7;
    var float v_RRC_NoResponseTime := 10.0;//Value according to 36.523-1 Table 6.1.2.6.3.2-2 Step 1.
    timer t_IdleMode_GenericTimer := tsc_IdleMode_GenericTimer;
    timer t_ResponseTimer := 12.0;
    
    v_CellPowerList_AtT1 := {
      cs_CellPower (eutra_Cell1, -91),
      cs_CellPower (eutra_Cell2, -85)
    };
    v_CellPowerList_AtT3 := {
      cs_CellPower (eutra_Cell1, -85),
      cs_CellPower (eutra_Cell2, -91)
    };
    v_CellPowerList_AtT4 := {
      cs_CellPower (eutra_Cell1, -91),
      cs_CellPower (eutra_Cell2, -85)
    };
    v_CellPowerList_AtT6 := {
      cs_CellPower (eutra_Cell1, -85),
      cs_CellPower (eutra_Cell2, -91)
    };
    v_CellPowerList_AtT7 := {
      cs_CellPower (eutra_Cell1, -91),
      cs_CellPower (eutra_Cell2, -85)
    };

    //Initialise all cell, security and mobile parameters
    f_EUTRA_Init (c2);

    //Set sys info and cell info for Cell 1 and Cell 2 to be used in creation
    //TAC for Cell 1 is set to 1 in f_EUTRA_Init ();
    f_EUTRA_CellInfo_SetTAC (eutra_Cell2, tsc_IdleMode_TAC_Cell2);

    //Set SIB3 according to specific message contents (36.523-1 Table 6.1.2.6.3.3-3)
    f_EUTRA_CellInfo_SetSysInfo_Q_Hyst (eutra_Cell1, v_Q_Hyst_dB24);

    //Set SIB4 according to specific message contents and 36.508 cl. 6.3.1.1 Table 6.3.1.1-1
    f_EUTRA_CellInfo_SetSIB4 (eutra_Cell1, cs_508_Cell1_DefSIB4_IntraFreqCellList);
    f_EUTRA_CellInfo_SetSIB4 (eutra_Cell2, cs_508_Cell2_DefSIB4_IntraFreqCellList);

    //Create and configure all cells
    f_EUTRA_CellConfig_Def (eutra_Cell1);
    f_EUTRA_CellConfig_Def (eutra_Cell2);

    //Bring UE to initial state
    f_EUTRA_Preamble (eutra_Cell1, STATE2_IDLEUPDATE);

    //@sic R5-104792 : T0 removed from test case sic@

    f_EUTRA_TestBody_Set (true);

    //@siclog "Step 1" siclog@
    //Change cell settings according to T1
    f_EUTRA_SetCellPowerList (v_CellPowerList_AtT1, cs_TimingInfo_Now);

    //@siclog "Step 2" siclog@
    //Check for no RRCConnectionRequest message on Cell 2
    f_EUTRA_CheckNoAttachOn1Cell (eutra_Cell2,
                                  v_RRC_NoResponseTime,
                                  "Test Case 6.1.2.6 Step 2 : RRCConnectionRequest message received on Cell 2 within wait time");

    //@siclog "Step 3" siclog@
    //Change cell settings according to T2
    f_EUTRA_CellInfo_SetSysInfo_Q_Hyst (eutra_Cell1, v_Q_Hyst_dB0);
    f_EUTRA_ModifySysinfo (eutra_Cell1);

    //@siclog "Step 4" siclog@
    //Check for camp on Cell 2
    f_EUTRA_IdleMode_TAU (eutra_Cell2);

    //@sic R5-104792 & R5s100475: Step 5 made Void sic@
    //@siclog "Step 5" siclog@
    //VOID
    
    //@sic R5-104792 & R5s100475 : Step 5A is added sic@
    //@siclog "Step 5A" siclog@
    //Change system information according to T3
    f_EUTRA_CellInfo_SetSIB4 (eutra_Cell1, cs_SIB4_ThreeNeighCellEntries ( 2, dB24,//q-OffsetCell = 24 dB for cell 2
                                                                           4, dB0,//q-OffsetCell = 0 dB for cell 4
                                                                           11, dB0 ) );//q-OffsetCell = 0 dB for cell 11
    f_EUTRA_ModifySysinfo (eutra_Cell1);
    
    //@sic R5-104792 & R5s100475 : Step 5B is added sic@
    //@siclog "Step 5B" siclog@
    //Wait 1.1*modification period to allow new system information to take effect
    v_ModificationPeriod_s := int2float(f_CalculateModificationPeriod (eutra_Cell1))/100.0;
    f_Delay (1.1*v_ModificationPeriod_s);
    
    //@sic R5-104792 & R5s100475 : Step 5C is added sic@
    //@siclog "Step 5C" siclog@
    //Change cell power level according to T3
    f_EUTRA_SetCellPowerList (v_CellPowerList_AtT3, cs_TimingInfo_Now);
    t_IdleMode_GenericTimer.start;

    //@siclog "Step 6" siclog@
    //Receive RRCConnectionRequest on Cell 1
    SRB.receive (car_SRB0_RrcPdu_IND (eutra_Cell1, cr_508_RRCConnectionRequest));
    t_IdleMode_GenericTimer.stop;

    //@siclog "Step 7 - 11" siclog@
    //Perform steps 2 to 6 of procedure 6.4.2.7 in 36.508
    f_EUTRA_TrackingAreaUpdate_WithoutRrcConnReq (eutra_Cell1);

    //@siclog "Step 12" siclog@
    //Change cell settings according to T4
    f_EUTRA_SetCellPowerList (v_CellPowerList_AtT4, cs_TimingInfo_Now);

    //@siclog "Step 13" siclog@
    //Check for no RRCConnectionRequest message on Cell 2
    f_EUTRA_CheckNoAttachOn1Cell (eutra_Cell2,
                                  v_RRC_NoResponseTime,
                                  "Test Case 6.1.2.6 Step 13 : RRCConnectionRequest message received on Cell 2 within wait time");

    //@siclog "Step 14" siclog@
    //Change cell settings according to T5
    f_EUTRA_CellInfo_SetSIB4 (eutra_Cell1, cs_508_Cell1_DefSIB4_IntraFreqCellList);
    f_EUTRA_ModifySysinfo (eutra_Cell1);

    //@siclog "Step 15" siclog@
    //Check for random access request on Cell 2
    f_EUTRA_IdleMode_TAU (eutra_Cell2);
    
    //@sic R5-104792 & R5s100475: Step 16 made Void sic@
    //@siclog "Step 16" siclog@
    //VOID
    
    //@sic R5-104792 & R5s100475: Step 16A is added sic@
    //@siclog "Step 16A" siclog@
    //Change system information according to T6
    f_EUTRA_CellInfo_SetSysInfo_T_Reselection (eutra_Cell1, v_T_Reselection);
    f_EUTRA_ModifySysinfo (eutra_Cell1);
    
    //@sic R5-104792 & R5s100475: Step 16B is added sic@
    //@siclog "Step 16B" siclog@
    //Wait 1.1*modification period to allow new system information to take effect
    v_ModificationPeriod_s := int2float(f_CalculateModificationPeriod (eutra_Cell1))/100.0;
    f_Delay (1.1*v_ModificationPeriod_s);

    //@sic R5-104792 & R5s100475: Step 16C is added sic@
    //@siclog "Step 16C" siclog@
    //Change cell power level according to T6
    f_EUTRA_SetCellPowerList (v_CellPowerList_AtT6, cs_TimingInfo_Now);
    t_IdleMode_GenericTimer.start;

    //@siclog "Step 17" siclog@
    //Receive RRCConnectionRequest on Cell 1
    SRB.receive(car_SRB0_RrcPdu_IND (eutra_Cell1, cr_508_RRCConnectionRequest));
    t_IdleMode_GenericTimer.stop;

    //@siclog "Step 18 -22" siclog@
    //Perform steps 2 to 6 of procedure 6.4.2.7 in 36.508
    f_EUTRA_TrackingAreaUpdate_WithoutRrcConnReq (eutra_Cell1);

    //@siclog "Step 23" siclog@
    //Change cell settings according to T7
    f_EUTRA_SetCellPowerList (v_CellPowerList_AtT7, cs_TimingInfo_Now);

    //@siclog "Step 24" siclog@
    //Check for no RRCConnectionRequest message on Cell 2
    f_EUTRA_CheckNoAttachOn1Cell (eutra_Cell2,
                                  6.0,
                                  "Test Case 6.1.2.6 Step 24 : RRCConnectionRequest message received on Cell 2 within wait time");

    //@siclog "Step 25" siclog@
    //Receive RRCConnectionRequest on Cell 1 within t_ResponseTimer
    t_ResponseTimer.start;
    alt {
      [] SRB.receive( car_SRB0_RrcPdu_IND (eutra_Cell2, cr_508_RRCConnectionRequest))
        {
          t_ResponseTimer.stop;
          //* @verdict pass RRCConnectionRequest message received within t_ResponseTimer
          f_EUTRA_PreliminaryPass (__FILE__, __LINE__, "Test Case 6.1.2.6 Step 25");
          //@siclog "Step 26-30" siclog@
          //Step 26-30: Perform steps 2 to 6 of procedure 6.4.2.7 in 36.508
          f_EUTRA_TrackingAreaUpdate_WithoutRrcConnReq (eutra_Cell2);
        }
      [] t_ResponseTimer.timeout
        {
          //* @verdict fail No RRCConnectionRequest message received on Cell 2 within t_ResponseTimer time
          f_EUTRA_SetVerdictFailOrInconc (__FILE__, __LINE__, "Test Case 6.1.2.6 Step 25");
        }
    }

    f_EUTRA_TestBody_Set (false);

    //Switch/power off UE
    f_EUTRA_Postamble (eutra_Cell2, E1_IDLE);
  }

  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.1.2.7
   * @status
   */
  function f_TC_6_1_2_7_EUTRA ( ) runs on EUTRA_PTC {

    var RRC_TransactionIdentifier v_RRC_TI := tsc_RRC_TI_Def;
    var template (value) CellPowerList_Type v_CellPowerList_Initial := {
      cs_CellPower (eutra_Cell1, -67),
      cs_CellPower (eutra_Cell12, -82),
      cs_CellPower (eutra_Cell13, -97)
    };
    var CellBarred_Type v_CellBarred := barred;
    var CarrierFreqEUTRA v_CarrierFreq_Cell1, v_CarrierFreq_Cell12, v_CarrierFreq_Cell13;
    var ChannelBandwidthDependency_Type v_ChannelBandwidthDependency;
    var Ul_Bandwidth_Type v_UL_Bandwidth := f_ConvertDL_BandwidthToUL (px_ePrimaryBandChannelBandwidth) ;
    var Dl_Bandwidth_Type v_DL_Bandwidth := px_ePrimaryBandChannelBandwidth;
    timer t_IdleMode_GenericTimer := tsc_IdleMode_GenericTimer;

    /* Initialise all cell, security and mobile parameters
     * SIB5 is init. in f_EUTRA_InitSystemInformation5 with default values according to 36.508 cl. 6.3.1.2
     * but since no cells on different PLMN is added to SIB5, it means that:
     * 1. SIB5 of cell 1 will not have freq. of cell 12 & 13
     * 2. Combination c3 can not be set to cell 12 & 13, hence no SIB5 will be set for these cells
     * => Addiional initialisation is needed...se below functions f_EUTRA_CellInfo_SetSIB5 & f_EUTRA_ChangeSIB5_Combination3 */
    f_EUTRA_Init (c3);

    //Get DL carrier frequency of cell 1, 12 & 13
    v_CarrierFreq_Cell1 := f_EUTRA_CellInfo_GetEARFCN (eutra_Cell1);
    v_CarrierFreq_Cell12 := f_EUTRA_CellInfo_GetEARFCN (eutra_Cell12);
    v_CarrierFreq_Cell13 := f_EUTRA_CellInfo_GetEARFCN (eutra_Cell13);

    //Get band dependent parameters
    v_ChannelBandwidthDependency := f_EUTRA_BandDependentParam (v_DL_Bandwidth, v_UL_Bandwidth);

    //Configure SIB5 for Cell 1 according to 36.508 Table 6.3.1.2-1
    //@ sic R5s100527 Change 1.1 sic@
    f_EUTRA_CellInfo_SetSIB5 (eutra_Cell1,
                              cs_508_SystemInformationBlockType5_Def ({cs_InterFreqCarrierFreq (v_CarrierFreq_Cell12,
                                                                                                v_ChannelBandwidthDependency.AllowedMeasBandwidth),
                                                                       cs_InterFreqCarrierFreq (v_CarrierFreq_Cell13,
                                                                                                v_ChannelBandwidthDependency.AllowedMeasBandwidth)}));
    
    //Configure SIB5 for Cell 12 according to Table 6.1.2.7.3.3-6
    //CellReselectionPriority for Cell 1 not present //@ sic R5s100527 Change 1.2 sic@
    f_EUTRA_ChangeSIB5_Combination3 (eutra_Cell12,
                                     cs_508_SystemInformationBlockType5_Def ({cs_InterFreqCarrierFreq_CRPri (v_CarrierFreq_Cell1,
                                                                                                             v_ChannelBandwidthDependency.AllowedMeasBandwidth,
                                                                                                             omit),
                                                                              cs_InterFreqCarrierFreq (v_CarrierFreq_Cell13,
                                                                                                       v_ChannelBandwidthDependency.AllowedMeasBandwidth)}));

    //Configure SIB5 for Cell 13 according to Table 6.1.2.7.3.3-7
    //CellReselectionPriority for Cell 1 not present //@ sic R5s100527 Change 1.2 sic@
    f_EUTRA_ChangeSIB5_Combination3 (eutra_Cell13,
                                     cs_508_SystemInformationBlockType5_Def ({cs_InterFreqCarrierFreq_CRPri (v_CarrierFreq_Cell1,
                                                                                                             v_ChannelBandwidthDependency.AllowedMeasBandwidth,
                                                                                                             omit),
                                                                              cs_InterFreqCarrierFreq (v_CarrierFreq_Cell12,
                                                                                                       v_ChannelBandwidthDependency.AllowedMeasBandwidth)}));

    //Set maximum cell powel level for Cell 1 & 12 to be used in creation
    f_EUTRA_CellInfo_InitMaxReferencePower (eutra_Cell1, -67);
    f_EUTRA_CellInfo_InitMaxReferencePower (eutra_Cell12, -82);

    //Create and configure all cells
    f_EUTRA_CellConfig_Def (eutra_Cell1);
    f_EUTRA_CellConfig_Def (eutra_Cell12);
    f_EUTRA_CellConfig_Def (eutra_Cell13);

    //First switch cell back on
    f_EUTRA_SetCellPower (eutra_Cell1, tsc_ServingCellRS_EPRE, cs_TimingInfo_Now);

    //Switch on UE
    f_UT_SwitchOnUE (UT, false);

    //Bring UE to inital state with Equivalent PLMN3 (Cell13)
    f_EUTRA_IdleUpdated_WithEplmn (eutra_Cell1,
                                   PREAMBLE,
                                   cs_PLMN_List1 (f_Asn2Nas_PlmnId (f_EUTRA_CellInfo_GetGutiPLMN (eutra_Cell13 ))));

    //Set initial cell power level according to T0
    f_EUTRA_SetCellPowerList (v_CellPowerList_Initial, cs_TimingInfo_Now);

    f_EUTRA_TestBody_Set (true);

    //@siclog "Step 1" siclog@
    //Check for no RRCConnectionRequest message on any cell
    f_EUTRA_CheckNoAttachOn3Cells (eutra_Cell1,
                                   eutra_Cell12,
                                   eutra_Cell13,
                                   100.0,//Tolerance is taken care of inside function f_EUTRA_CheckNoAttachOn3Cells
                                   "Test Case 6.1.2.7 Step 1 : RRCConnectionRequest message received within no-response-time");
    
    //@siclog "Step 2" siclog@
    //Set initial cell power level according to T1
    f_EUTRA_SetCellPower (eutra_Cell1, -115, cs_TimingInfo_Now);

    //Start the Idle Mode Generic timer for Step 3
    t_IdleMode_GenericTimer.start;

    //@siclog "Step 3" siclog@
    //Check if UE camps on Cell 13.
    //Send TAU accept with PLMN1 and PLMN2 listed as Equivalent PLMN
    f_EUTRA_TrackingAreaUpdate_WithEplmn (eutra_Cell13,
                                          v_RRC_TI, cs_PLMN_List2(f_Asn2Nas_PlmnId(f_EUTRA_CellInfo_GetGutiPLMN(eutra_Cell1)),
                                          f_Asn2Nas_PlmnId( f_EUTRA_CellInfo_GetGutiPLMN(eutra_Cell12))));

    //Restart the Idle Mode Generic timer for step 5
    t_IdleMode_GenericTimer.start;

    //@siclog "Step 4" siclog@
    //Check if PLMN3 is indicated by UE */
    f_UT_PLMN_Check (UT, "00321");
    //* @verdict pass PLMN3 is indicated by UE
    f_EUTRA_PreliminaryPass (__FILE__, __LINE__, "Test Case 6.1.2.7 Step 4");

    //@siclog "Step 5" siclog@
    //Check if UE camps on Cell 12.
    //Send TAU accept with PLMN1 and PLMN3 listed as Equivalent PLMN
    f_EUTRA_TrackingAreaUpdate_WithEplmn (eutra_Cell12,
                                          v_RRC_TI,
                                          cs_PLMN_List2(f_Asn2Nas_PlmnId(f_EUTRA_CellInfo_GetGutiPLMN(eutra_Cell1)),
                                          f_Asn2Nas_PlmnId( f_EUTRA_CellInfo_GetGutiPLMN(eutra_Cell13))));

    //Stop the Idle Mode Generic timer since TAU has happened
    t_IdleMode_GenericTimer.stop;

    //@siclog "Step 6" siclog@
    //Check if PLMN2 is indicated by UE
    f_UT_PLMN_Check (UT, "00211");
    //* @verdict pass PLMN2 is indicated by UE
    f_EUTRA_PreliminaryPass (__FILE__, __LINE__, "Test Case 6.1.2.7 Step 6");

    //@siclog "Step 7" siclog@
    //Set initial cell power level according to T0
    f_EUTRA_SetCellPower (eutra_Cell1, -67, cs_TimingInfo_Now);

    //@siclog "Step 8" siclog@
    //Check for no RRCConnectionRequest message on any cell
    f_EUTRA_CheckNoAttachOn3Cells (eutra_Cell1,
                                   eutra_Cell12,
                                   eutra_Cell13,
                                   100.0,//Tolerance is taken care of inside function f_EUTRA_CheckNoAttachOn3Cells
                                   "Test Case 6.1.2.7 Step 8 : RRCConnectionRequest message received within no-response-time");

    //@siclog "Step 9" siclog@
    //Set cell status according to T2 & Notify UE of change of System Information
    f_EUTRA_CellInfo_SetSysInfo_CellBarred (eutra_Cell12, v_CellBarred);
    f_EUTRA_ModifySysinfo (eutra_Cell12);

    //@siclog "Step 10" siclog@
    //Void

    //@siclog "Step 11" siclog@
    //Start the Idle Mode Generic timer for step 11 and check if UE camps on Cell 13.
    //TAU accept is sent with PLMN1 and PLMN2 listed as Equivalent PLMN
    t_IdleMode_GenericTimer.start;
    f_EUTRA_TrackingAreaUpdate_WithEplmn (eutra_Cell13,
                                          v_RRC_TI,
                                          cs_PLMN_List2(f_Asn2Nas_PlmnId(f_EUTRA_CellInfo_GetGutiPLMN(eutra_Cell1)),
                                          f_Asn2Nas_PlmnId( f_EUTRA_CellInfo_GetGutiPLMN(eutra_Cell12))));

    //Stop the Idle Mode Generic timer since TAU has happened
    t_IdleMode_GenericTimer.stop;

    //@siclog "Step 12" siclog@
    //Check if PLMN3 is indicated by UE
    f_UT_PLMN_Check (UT, "00321");
    //* @verdict pass PLMN3 is indicated by UE
    f_EUTRA_PreliminaryPass (__FILE__, __LINE__, "Test Case 6.1.2.7 Step 12");

    f_EUTRA_TestBody_Set (false);

    //Switch/power off UE
    f_EUTRA_Postamble (eutra_Cell13, E1_IDLE);
  }

  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.1.2.8
   * @status    APPROVED
   */
  function f_TC_6_1_2_8_EUTRA ( ) runs on EUTRA_PTC
  {
    var CellBarred_Type v_CellBarred := barred;
    var CellBarred_Type v_CellNotBarred := notBarred;
    var CellReservedForOpUse_Type v_CellReservedForOpUse := reserved;
    var template (value) CellPowerList_Type v_CellPowerList_AtT0;
    v_CellPowerList_AtT0 := {
      cs_CellPower ( eutra_Cell1, -97 ),
      cs_CellPower ( eutra_Cell3, -82 ),
      cs_CellPower ( eutra_Cell6, -67 )
    };

    //Initialise all cell, security and mobile parameters
    f_EUTRA_Init (c3);//SIB2, SIB3 and SIB5 are transmitted //@sic R5s100500 sic@

    //Set TAC according to 36.523-1 Table 6.0.4-2: Tracking Area Code (TAC) for E-UTRAN cells */
    //TAC for Cell 1 is set to 1 in f_EUTRA_Init ();
    f_EUTRA_CellInfo_SetTAC ( eutra_Cell3, tsc_IdleMode_TAC_Cell3 );
    f_EUTRA_CellInfo_SetTAC ( eutra_Cell6, tsc_IdleMode_TAC_Cell6 );

    //Set system information according to specific message contents
    f_EUTRA_CellInfo_SetSysInfo_CellBarred ( eutra_Cell3, v_CellBarred );
    f_EUTRA_CellInfo_SetSysInfo_CellBarred ( eutra_Cell6, v_CellBarred );

    //Set maximum cell powel level for Cell 1, 3 & 6 to be used in creation
    f_EUTRA_CellInfo_InitMaxReferencePower ( eutra_Cell3, -82 );
    f_EUTRA_CellInfo_InitMaxReferencePower ( eutra_Cell6, -67 );

    //Set Minimum UL flag for Cell 6
    f_EUTRA_SetCellConfigCapability ( eutra_Cell6, minimumUplinkCell );

    //Create and configure all cells
    f_EUTRA_CellConfig_Def ( eutra_Cell1 );
    f_EUTRA_CellConfig_Def ( eutra_Cell3 );
    f_EUTRA_CellConfig_Def ( eutra_Cell6 ); //@sic R5s100500 sic@

    //@sic R5s100500 : Default USIM is used sic@

    //Bring UE to inital state
    f_EUTRA_Preamble ( eutra_Cell1, STATE2_IDLEUPDATE );

    //Make sure the UE is in automatic mode
    f_UT_AutomaticPLMN_Select ( UT );

    //Set initial cell power level according to T0
    f_EUTRA_SetCellPowerList ( v_CellPowerList_AtT0, cs_TimingInfo_Now );

    f_EUTRA_TestBody_Set ( true );

    //@siclog "Step 1" siclog@
    //Adjust SIB1 of Cell 3 to indicate cellBarred = notBarred
    f_EUTRA_CellInfo_SetSysInfo_CellBarred ( eutra_Cell3, v_CellNotBarred );
    f_EUTRA_ModifySysinfo_ValueTag_NoPaging ( eutra_Cell3 );

    //@siclog "Step 2" siclog@
    //Check if UE camps on Cell 3
    f_EUTRA_IdleMode_TAU ( eutra_Cell3 );

    //@sic R5-104722 : Notification of system information modification moved to step 3 sic@
    //@siclog "Step 3" siclog@
    //Adjust SIB1 of Cell 3 to indicate cellBarred = barred & notify UE of change of System Information
    f_EUTRA_CellInfo_SetSysInfo_CellBarred ( eutra_Cell3, v_CellBarred );
    f_EUTRA_ModifySysinfo ( eutra_Cell3 );

    //@sic R5-104722 : Notification of system modification moved to step 3 sic@
    //@siclog "Step 4" siclog@
    //Void

    //@siclog "Step 5" siclog@
    //Check if UE camps on Cell 1
    f_EUTRA_IdleMode_TAU ( eutra_Cell1 );

    //@siclog "Step 6" siclog@
    //Adjust SIB1 of Cell 3 and 6
    f_EUTRA_CellInfo_SetSysInfo_CellBarred ( eutra_Cell3, v_CellNotBarred );
    f_EUTRA_CellInfo_SetSysInfo_CellBarred ( eutra_Cell6, v_CellNotBarred );
    f_EUTRA_CellInfo_SetSysInfo_CellReservedForOpUse ( eutra_Cell6, v_CellReservedForOpUse );
    f_EUTRA_ModifySysinfo_ValueTag_NoPaging ( eutra_Cell3 );
    f_EUTRA_ModifySysinfo_ValueTag_NoPaging ( eutra_Cell6 );

    //@siclog "Step 7" siclog@
    //Check if UE camps on Cell 3
    f_EUTRA_IdleMode_TAU ( eutra_Cell3 );

    //@sic R5-104722 : Notification of system information modification moved to step 8 sic@
    //@siclog "Step 8" siclog@
    //Adjusts SIB1 of Cell 3 and Cell 6 to indicate cellReservedForOperatorUse=reserved & notify UE of change of System Information
    f_EUTRA_CellInfo_SetSysInfo_CellReservedForOpUse ( eutra_Cell3, v_CellReservedForOpUse );
    f_EUTRA_ModifySysinfo ( eutra_Cell3 );

    //@sic R5-104722 : Notification of system modification moved to step 8 sic@
    //@siclog "Step 9" siclog@
    //Void

    //@siclog "Step 10" siclog@
    //Check if UE camps on Cell 1
    f_EUTRA_IdleMode_TAU ( eutra_Cell1 );

    f_EUTRA_TestBody_Set ( false );

    //Switch/power off UE
    f_EUTRA_Postamble ( eutra_Cell1, E1_IDLE );
  }

  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.1.2.9
   * @status    APPROVED
   */
  function f_TC_6_1_2_9_EUTRA ( ) runs on EUTRA_PTC
  {
    var CellBarred_Type v_CellBarred := barred;
    var CellBarred_Type v_CellNotBarred := notBarred;
    var CellReservedForOpUse_Type v_CellReservedForOpUse := reserved;
    var template (value) CellPowerList_Type v_CellPowerList_AtT0 := {
      cs_CellPower ( eutra_Cell1, -97 ),
      cs_CellPower ( eutra_Cell3, -82 ),
      cs_CellPower ( eutra_Cell6, -67 )
    };
    
    //Initialise all cell, security and mobile parameters
    f_EUTRA_Init (c3);//SIB2, SIB3 and SIB5 are transmitted //@sic R5s100507 sic@
    
    //Set TAC according to 36.523-1 Table 6.0.4-2: Tracking Area Code (TAC) for E-UTRAN cells
    //TAC for Cell 1 is set to 1 in f_EUTRA_Init ();
    f_EUTRA_CellInfo_SetTAC ( eutra_Cell3, tsc_IdleMode_TAC_Cell3 );
    f_EUTRA_CellInfo_SetTAC ( eutra_Cell6, tsc_IdleMode_TAC_Cell6 );
    
    //Set system information according to specific message contents
    f_EUTRA_CellInfo_SetSysInfo_CellBarred ( eutra_Cell3, v_CellBarred );
    f_EUTRA_CellInfo_SetSysInfo_CellBarred ( eutra_Cell6, v_CellBarred );
    
    //Set maximum cell powel level for Cell 3 to be used in creation
    f_EUTRA_CellInfo_InitMaxReferencePower ( eutra_Cell3, -82 );
    f_EUTRA_CellInfo_InitMaxReferencePower ( eutra_Cell6, -67 );
    
    //Create and configure all cells
    f_EUTRA_CellConfig_Def ( eutra_Cell1 );
    f_EUTRA_CellConfig_Def ( eutra_Cell3 );
    f_EUTRA_CellConfig_Def ( eutra_Cell6 );
    
    //Equip UE with a USIM containing default values (as per TS 36.508) except for those shown in Table 6.1.2.9.3.1-2
    f_UT_USIM_Insert ( UT, "36.523-1 Table 6.1.2.9.3.1-2" );
    
    //Bring UE to inital state
    f_EUTRA_Preamble ( eutra_Cell1, STATE2_IDLEUPDATE );
    
    //Make sure the UE is in automatic mode
    f_UT_AutomaticPLMN_Select ( UT );
    
    //Set initial cell power level according to T0
    f_EUTRA_SetCellPowerList ( v_CellPowerList_AtT0, cs_TimingInfo_Now );
    
    f_EUTRA_TestBody_Set ( true );
    
    //@siclog "Step 1" siclog@
    //Adjust SIB1 of Cell 3 according to specific message contents
    f_EUTRA_CellInfo_SetSysInfo_CellBarred ( eutra_Cell3, v_CellNotBarred );
    f_EUTRA_ModifySysinfo_ValueTag_NoPaging ( eutra_Cell3 );
    
    //@siclog "Step 2" siclog@
    //Check if UE camps on Cell 3
    f_EUTRA_IdleMode_TAU ( eutra_Cell3 );
    
    //@siclog "Step 3" siclog@
    //Adjust SIB1 of Cell 3 according to specific message contents and
    f_EUTRA_CellInfo_SetSysInfo_CellBarred ( eutra_Cell3, v_CellBarred );
    
    //@siclog "Step 4" siclog@
    //Notify UE of change of System Information
    f_EUTRA_ModifySysinfo ( eutra_Cell3 );
    
    //@siclog "Step 5" siclog@
    //Check if UE camps on Cell 1
    f_EUTRA_IdleMode_TAU ( eutra_Cell1 );
    
    //@siclog "Step 6" siclog@
    //Adjust SIB1 of Cell 3 & 6 according to specific message contents
    f_EUTRA_CellInfo_SetSysInfo_CellBarred ( eutra_Cell3, v_CellNotBarred );
    f_EUTRA_CellInfo_SetSysInfo_CellBarred ( eutra_Cell6, v_CellNotBarred );
    f_EUTRA_CellInfo_SetSysInfo_CellReservedForOpUse ( eutra_Cell6, v_CellReservedForOpUse );
    f_EUTRA_ModifySysinfo_ValueTag_NoPaging ( eutra_Cell3 );
    f_EUTRA_ModifySysinfo_ValueTag_NoPaging ( eutra_Cell6 );
    
    //@siclog "Step 7" siclog@
    //Check if UE camps on Cell 6
    f_EUTRA_IdleMode_TAU ( eutra_Cell6 );
    
    f_EUTRA_TestBody_Set ( false );
    
    //Switch/Power off UE
    f_EUTRA_Postamble ( eutra_Cell6, E1_IDLE );
  }
  
  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.1.2.10
   * @status
   */
  function f_TC_6_1_2_10_EUTRA ( ) runs on EUTRA_PTC {
  
    var NAS_MSG_Indication_Type v_NasInd;
    var EPS_BearerContextStatus v_EPS_ContextStatus;
    var SRB_COMMON_IND v_ReceivedAsp;
    var template (value) TrackingAreaIdList v_TaiList;
    var template (omit) LocAreaId v_LAI;
    var GutiParameters_Type v_GutiParams;
    //var CarrierFreqEUTRA v_CarrierFreq_Cell1, v_CarrierFreq_Cell12, v_CarrierFreq_Cell13;
    //var Ul_Bandwidth_Type v_UL_Bandwidth := f_ConvertDL_BandwidthToUL (px_ePrimaryBandChannelBandwidth) ;
    //var Dl_Bandwidth_Type v_DL_Bandwidth := px_ePrimaryBandChannelBandwidth;
    var ReleaseCause v_ReleaseCause := other;
    var EPS_UpdateTypeValue v_UpdateType := f_GetEPSTAUType();
    var template AdditionalUpdateType v_AdditionalUpdateType := f_GetAdditionalUpdateType ();
    timer t_IdleMode_GenericTimer := tsc_IdleMode_GenericTimer;

    /* Initialise all cell, security and mobile parameters
     * SIB5 is init. in f_EUTRA_InitSystemInformation5 with default values according to 36.508 cl. 6.3.1.2
     * but since no cells on different PLMN is added to SIB5, it means that:
     * 1. SIB5 of cell 1 will not have freq. of cell 12
     * 2. Combination c3 can not be set in cell 12, hence no SIB5 will be set for these cells
     * 3. Combination of system information is not specified in prose
     * =>  Either
     *  1. Addiional initialisation is needed...se below functions f_EUTRA_CellInfo_SetSIB5 & f_EUTRA_ChangeSIB5_Combination3
     *  2. or combination c1 is used */
    f_EUTRA_Init (c1);
    
    v_GutiParams := f_EUTRA_CellInfo_GetGuti(eutra_Cell12);
    v_LAI := f_GetLAI (f_Asn2Nas_PlmnId(v_GutiParams.PLMN_Identity), f_EUTRA_CellInfo_GetLocationAreaCode(eutra_Cell12));
    v_TaiList := cds_TAIListNonConsecutive_tlv (f_Asn2Nas_PlmnId(v_GutiParams.PLMN_Identity), { bit2oct(f_EUTRA_CellInfo_GetTAC(eutra_Cell12))});
    
    /* Since system combination c1 is used no need to initialise SIB5
    //Get DL carrier frequency of cell 1 & 12
    v_CarrierFreq_Cell1 := f_EUTRA_CellInfo_GetEARFCN (eutra_Cell1);
    v_CarrierFreq_Cell12 := f_EUTRA_CellInfo_GetEARFCN (eutra_Cell12);

    //Get band dependent parameters
    v_ChannelBandwidthDependency := f_EUTRA_BandDependentParam (v_DL_Bandwidth, v_UL_Bandwidth);

    //Configure SIB5 for Cell 1 according to 36.508 Table 6.3.1.2-1
    f_EUTRA_CellInfo_SetSIB5 (eutra_Cell1,
                              cs_508_SystemInformationBlockType5_Def ({cs_InterFreqCarrierFreq (v_CarrierFreq_Cell12,
                                                                                                v_ChannelBandwidthDependency.AllowedMeasBandwidth),
                                                                       cs_InterFreqCarrierFreq (v_CarrierFreq_Cell13,
                                                                                                v_ChannelBandwidthDependency.AllowedMeasBandwidth)}));
    
    //Configure SIB5 for Cell 12 according to 36.508 Table 6.3.1.2-1
    f_EUTRA_ChangeSIB5_Combination3 (eutra_Cell12,
                                     cs_508_SystemInformationBlockType5_Def ({cs_InterFreqCarrierFreq (v_CarrierFreq_Cell1,
                                                                                                       v_ChannelBandwidthDependency.AllowedMeasBandwidth),
                                                                              cs_InterFreqCarrierFreq (v_CarrierFreq_Cell13,
                                                                                                       v_ChannelBandwidthDependency.AllowedMeasBandwidth)}));
    */

    //Set TAC according to 36.523-1 Table 6.0.1-2: Tracking Area Code (TAC) for E-UTRAN cells
    //TAC for Cell 1 is set to 1 in f_EUTRA_Init ();
    f_EUTRA_CellInfo_SetTAC (eutra_Cell12, tsc_IdleMode_TAC_Cell12);

    //Set Sys info and cell infor for cell 12 to be used @ creation
    f_EUTRA_CellInfo_SetPLMN_2Entries (eutra_Cell12, cs_HPLMN_001_02, cs_HPLMN_Def);

    //Set maximum cell powel level for Cell 1, 3 & 6 to be used in creation
    f_EUTRA_CellInfo_InitMaxReferencePower (eutra_Cell12, -73);

    //Create and configure all cells
    f_EUTRA_CellConfig_Def (eutra_Cell1);
    f_EUTRA_CellConfig_Def (eutra_Cell12);

    //Bring UE to inital state
    f_EUTRA_Preamble (eutra_Cell1, STATE2_IDLEUPDATE);

    //After preamble initial cell power level according to T0 is already set

    f_EUTRA_TestBody_Set (true);

    //@siclog "Step 1" siclog@
    //Change cell settings according to T1
    f_EUTRA_SetCellPower (eutra_Cell12, -73, cs_TimingInfo_Now);
    t_IdleMode_GenericTimer.start;

    //@siclog "Step 2" siclog@
    //Receive RRCConnectionRequest on Cell 12
    SRB.receive(car_SRB0_RrcPdu_IND(eutra_Cell12, cr_508_RRCConnectionRequest));
    t_IdleMode_GenericTimer.stop;
    //* @verdict pass RRCConnectionRequest message received on Cell 12
    f_EUTRA_PreliminaryPass (__FILE__, __LINE__, "Test Case 6.1.2.10 Step 2");

    //@siclog "Step 3" siclog@
    //Transmits RRCConnectionSetup
    f_EUTRA_RRC_ConnectionSetup_Def(eutra_Cell12, cs_TimingInfo_Now, tsc_RRC_TI_Def);

    //@siclog "Step 4" siclog@
    //Receive RRCConnectionSetupComplete
    SRB.receive(car_SRB1_RrcNasPdu_IND (eutra_Cell12,
                                        cdr_RRCConnectionSetupComplete_2ndSelPlmnId (tsc_RRC_TI_Def, ?),
                                        cr_NAS_Indication (tsc_SHT_IntegrityProtected,
                                                           cr_508_TAU_Request(v_UpdateType,
                                                                              f_EUTRA_SecurityKSIasme_Get(),
                                                                              v_AdditionalUpdateType)))) -> value v_ReceivedAsp;

    v_NasInd := v_ReceivedAsp.Signalling.Nas[0];
    v_EPS_ContextStatus := v_NasInd.Pdu.Msg.tRACKING_AREA_UPDATE_REQUEST.epsBearerContextStatus; //Send this back in the Accept

    //@siclog "Step 5-7" siclog@
    //Perform steps 4 to 6 of generic test procedure in TS 36.508 subclause 6.4.2.7
    //Transmit TRACKING AREA UPDATE ACCEPT
    SRB.send (cas_SRB1_NasPdu_REQ (eutra_Cell12,
                                   cs_TimingInfo_Now,
                                   cs_NAS_Request (tsc_SHT_IntegrityProtected_Ciphered,
                                                   cs_508_TAU_Accept (f_GetEPSTAUType(),
                                                                      f_GutiParameters2MobileIdentity (tsc_IEI_Guti, v_GutiParams),
                                                                      v_TaiList,
                                                                      v_EPS_ContextStatus,
                                                                      v_LAI,
                                                                      f_GetMSId(),
                                                                      f_GetAdditionalUpdateResult(v_NasInd.Pdu.Msg.tRACKING_AREA_UPDATE_REQUEST.addUpdateType)))));

    //Receive TRACKING AREA UPDATE COMPLETE
    SRB.receive (car_SRB1_NasPdu_IND (eutra_Cell12,
                                      cr_NAS_Indication(tsc_SHT_IntegrityProtected_Ciphered,
                                                        cr_508_TAU_Complete)));

    //Release RRC connection
    f_EUTRA_RRC_ConnectionRelease (eutra_Cell12, tsc_RRC_TI_Def, v_ReleaseCause);

    f_EUTRA_TestBody_Set (false);

    //Switch/Power off UE
    f_EUTRA_Postamble (eutra_Cell12, E1_IDLE);
  }

  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.1.2.11
   * @status    APPROVED
   */
  function f_TC_6_1_2_11_EUTRA ( ) runs on EUTRA_PTC
  {
    //@sic R5-104780 : T0 removed from test case sic@
    var template (value) CellPowerList_Type v_CellPowerList_AtT1 := {
      cs_CellPower (eutra_Cell2, -91),
      cs_CellPower (eutra_Cell3, -73)
    };

    //Initialise all cell, security and mobile parameters
    //SIB5 is init. in f_EUTRA_InitSystemInformation5 with default values according to 36.508 cl. 6.3.1.2 =>
    //specific message contents in Table 6.1.2.11.3.3-3 will be included in the default broadcasted SIB5
    f_EUTRA_Init (c3);

    //Set TAC according to 36.523-1 Table 6.0.1-2: Tracking Area Code (TAC) for E-UTRAN cells
    //TAC for Cell 1 is set to 1 in f_EUTRA_Init ();
    f_EUTRA_CellInfo_SetTAC (eutra_Cell2, tsc_IdleMode_TAC_Cell2);
    f_EUTRA_CellInfo_SetTAC (eutra_Cell3, tsc_IdleMode_TAC_Cell3);

    //Set maximum cell powel level for Cell 3 to be used in creation
    //@sic R5-104780 : T0 removed from test case sic@
    f_EUTRA_CellInfo_InitMaxReferencePower (eutra_Cell3, -73);

    //Create and configure all cells
    f_EUTRA_CellConfig_Def (eutra_Cell1);
    f_EUTRA_CellConfig_SRBs_Only (eutra_Cell2);
    f_EUTRA_CellConfig_Def (eutra_Cell3);

    //Bring UE to inital state
    f_EUTRA_Preamble (eutra_Cell1, STATE2_IDLEUPDATE);

    //@sic R5-104780 : T0 removed from test case sic@

    f_EUTRA_TestBody_Set (true);

    //@siclog "Step 1" siclog@
    //Change cell settings according to T1
    f_EUTRA_SetCellPowerList (v_CellPowerList_AtT1, cs_TimingInfo_Now); //@sic R5-104780 : T0 removed from test case sic@

    //@siclog "Step 2" siclog@
    //Check if UE camps on cell 3
    f_EUTRA_IdleMode_TAU (eutra_Cell3);

    f_EUTRA_TestBody_Set (false);

    //Switch/power ff UE
    f_EUTRA_Postamble (eutra_Cell3, E1_IDLE);
  }

  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.1.2.12
   * @status
   */
  function f_TC_6_1_2_12_EUTRA ( ) runs on EUTRA_PTC {
  
    var template (value) CellPowerList_Type v_CellPowerList_AtT2;
    timer t_WaitForRandomAccess := 120.0;
    
    v_CellPowerList_AtT2 := {
      cs_CellPower ( eutra_Cell1, tsc_NonSuitableOffCellRS_EPRE ),
      cs_CellPower ( eutra_Cell4, tsc_ServingCellRS_EPRE )
    };
  
    //Initialise all cell, security and mobile parameters
    f_EUTRA_Init ( c2 );//Combination 2 to include SIB4
    
    //Set TAC according to 36.523-1 Table 6.0.1-2: Tracking Area Code (TAC) for E-UTRAN cells
    //TAC for Cell 1 is set to 1 in f_EUTRA_Init ();
    f_EUTRA_CellInfo_SetTAC ( eutra_Cell2, tsc_IdleMode_TAC_Cell2 );
    f_EUTRA_CellInfo_SetTAC ( eutra_Cell4, tsc_IdleMode_TAC_Cell4 );
    
    //Set Minimum UL flag for Cell 4
    f_EUTRA_SetCellConfigCapability ( eutra_Cell4, minimumUplinkCell );

    //Set SIB4 for cell 1 & 2 to be used at creation
    f_EUTRA_CellInfo_SetSIB4 ( eutra_Cell1, cs_SIB4_OneNeighCellEntry ( 2, dB_24 ) );
    f_EUTRA_CellInfo_SetSIB4 ( eutra_Cell2, cs_SIB4_Neigh_BlackCellList_1Entry ( { cs_IntraFreqNeighCellInfo(1, dB24) },//IntraFreqNeighCellList
                                                                                 { cs_PhysCellIdRange_StartOnly(4) } ));//IntraFreqBlackCellList

    //Create and configure all cells
    f_EUTRA_CellConfig_Def ( eutra_Cell1 );
    f_EUTRA_CellConfig_Def ( eutra_Cell2 );
    f_EUTRA_CellConfig_Def ( eutra_Cell4 );
    
    //Activate PRACH Ind on cell 4
    f_EUTRA_SS_ConfigRachPreambleIndMode(eutra_Cell4, tsc_L1Mac_IndicationMode_Enable);

    //Bring UE to inital state
    f_EUTRA_Preamble ( eutra_Cell1, STATE2_IDLEUPDATE );

    //After preamble initial cell power level according to T0 is already set

    f_EUTRA_TestBody_Set ( true );

    //@siclog "Step 1" siclog@
    //Change cell settings according to T1
    f_EUTRA_SetCellPower ( eutra_Cell2, -91, cs_TimingInfo_Now );

    //@siclog "Step 2" siclog@
    //Does the UE camp on Cell 2?
    f_EUTRA_IdleMode_TAU (eutra_Cell2);

    //@siclog "Step 3" siclog@
    //Change cell settings according to T2
    f_EUTRA_SetCellPowerList ( v_CellPowerList_AtT2, cs_TimingInfo_Now );

    //@siclog "Step 4" siclog@
    //Check for no Preamble indication
    t_WaitForRandomAccess.start;
    alt {
      [] t_WaitForRandomAccess.timeout {
        //do nothing and exit the statement
      }
      [] SYSIND.receive ( car_PRACH_Preamble_IND_Any (eutra_Cell4, ?)) {
        f_EUTRA_SetVerdictFailOrInconc (__FILE__, __LINE__, "Test case 6.1.2.12 Step 4");
      }
    }

    f_EUTRA_TestBody_Set ( false );

    //Switch/Power off UE
    f_EUTRA_Postamble ( eutra_Cell2, E1_IDLE );
  }
  
  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.1.2.14
   * @status
   */
  function f_TC_6_1_2_14_EUTRA ( ) runs on EUTRA_PTC {
  
    var template (value) CellPowerList_Type v_CellPowerList_T0toT1, v_CellPowerList_T1toT2, v_CellPowerList_T2toT3, v_CellPowerList_T3toT1;
    var float v_WaitForCamp := 20.0;
    timer t_WaitForRRCConnReq;
    
    v_CellPowerList_T0toT1 := {
      cs_CellPower ( eutra_Cell1, -91 ),
      cs_CellPower ( eutra_Cell2, tsc_ServingCellRS_EPRE ),
      cs_CellPower ( eutra_Cell4, -91 )
    };
    
    v_CellPowerList_T1toT2 := {
      cs_CellPower ( eutra_Cell2, -91 ),
      cs_CellPower ( eutra_Cell4, tsc_ServingCellRS_EPRE )
    };
    
    v_CellPowerList_T2toT3 := {
      cs_CellPower ( eutra_Cell1, tsc_ServingCellRS_EPRE ),
      cs_CellPower ( eutra_Cell4, -91 )
    };
    
    v_CellPowerList_T3toT1 := {
      cs_CellPower ( eutra_Cell1, -91 ),
      cs_CellPower ( eutra_Cell2, tsc_ServingCellRS_EPRE )
    };
    
    //Initialise all cell, security and mobile parameters
    f_EUTRA_Init ( c1 );
    
    //Create and configure all cells
    f_EUTRA_CellConfig_Def ( eutra_Cell1 );
    f_EUTRA_CellConfig_Def ( eutra_Cell2 );
    f_EUTRA_CellConfig_Def ( eutra_Cell4 );
    
    //Bring UE to inital state
    f_EUTRA_Preamble ( eutra_Cell1, STATE2_IDLEUPDATE );
    
    f_EUTRA_TestBody_Set ( true );
    
    //@siclog "Step 1" siclog@
    //Set changes the power level setting according to the row "T1" in table 6.1.2.14.3.2-1
    f_EUTRA_SetCellPowerList ( v_CellPowerList_T0toT1, cs_TimingInfo_Now );
    
    //@siclog "Step 2" siclog@
    //Wait for 20s for the UE to perform cell reselection procedure
    f_Delay ( v_WaitForCamp );
    
    //@siclog "Step 3" siclog@
    //Set the power level setting according to the row "T2" in table 6.1.2.14.3.2-1
    f_EUTRA_SetCellPowerList ( v_CellPowerList_T1toT2, cs_TimingInfo_Now );
    
    //@siclog "Step 4" siclog@
    //Wait for 20s for the UE to perform cell reselection procedure
    f_Delay ( v_WaitForCamp );
    
    //@siclog "Step 5" siclog@
    //Set the power level setting according to the row "T3" in table 6.1.2.14.3.2-1
    f_EUTRA_SetCellPowerList ( v_CellPowerList_T2toT3, cs_TimingInfo_Now );
    
    //@siclog "Step 6" siclog@
    //Wait for 20s for the UE to perform cell reselection procedure
    f_Delay ( v_WaitForCamp );
    
    //@siclog "Step 7" siclog@
    //Set changes the power level setting according to the row "T1" in table 6.1.2.14.3.2-1
    f_EUTRA_SetCellPowerList ( v_CellPowerList_T3toT1, cs_TimingInfo_Now );
    
    //@siclog "Step 8" siclog@
    //Wait for 20s for the UE to perform cell reselection procedure
    f_Delay ( v_WaitForCamp );
    
    //@siclog "Step 9" siclog@
    //Change TAC of cell 4 according to Table 6.1.2.14.3.3-3
    f_EUTRA_CellInfo_SetTAC ( eutra_Cell4, tsc_IdleMode_TAC_Cell2 );
    f_EUTRA_ModifySysinfo_ValueTag_NoPaging (eutra_Cell4);
    
    //FFS - Maybe some wait time is needed here to allow UE to read new system information before change off cell power?
    //If needed prose change is also needed.
    
    //@siclog "Step 10" siclog@
    //Set the power level setting according to the row "T2" in table 6.1.2.14.3.2-1
    f_EUTRA_SetCellPowerList ( v_CellPowerList_T1toT2, cs_TimingInfo_Now );
    
    //@siclog "Step 11" siclog@
    //Check for no RRCConnectionRequest on Cell 4 within 5s
    t_WaitForRRCConnReq.start(5.0);//FFS - Timer tolerance has not yet been implemented
    alt {
      [] SRB.receive( car_SRB0_RrcPdu_IND ( eutra_Cell1, cr_508_RRCConnectionRequest ) )
      {
        //* @verdict fail UE sent RRCConnectionRequest message on Cell 4 within t_WaitForRRCConnReq
        f_EUTRA_SetVerdictFailOrInconc (__FILE__, __LINE__, "Test Case 6.1.2.14 Step 11");
      }
      [] t_WaitForRRCConnReq.timeout
      {
        t_WaitForRRCConnReq.start(7.0);//FFS - Timer tolerance has not yet been implemented
      }
    }

    //@siclog "Step 12" siclog@
    //Check for RRCConnectionRequest on Cell 4 within 7s from previous step
    SRB.receive( car_SRB0_RrcPdu_IND ( eutra_Cell4, cr_508_RRCConnectionRequest ) );
    //* @verdict pass RRCConnectionRequest message received on Cell 4
    f_EUTRA_PreliminaryPass (__FILE__, __LINE__, "Test Case 6.1.2.14 Step 12");
    
    //@siclog "Step 13-17" siclog@
    //Perform steps 2-6 of TAU procedure (36.508 cl. 6.4.2.7)
    f_EUTRA_TrackingAreaUpdate_WithoutRrcConnReq (eutra_Cell14);
    
    f_EUTRA_TestBody_Set ( false );
    
    //Switch/Power off UE
    f_EUTRA_Postamble ( eutra_Cell4, E1_IDLE );
  }

  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.1.2.15
   * @status    APPROVED
   */
  function f_TC_6_1_2_15_EUTRA ( ) runs on EUTRA_PTC
  {
    var ReselectionThreshold v_ThreshServingLow_Cell6 := 10;
    var CellRes_Prio_Type v_CellRes_Prio := 5;
    var ReselectionThreshold v_ThreshXHigh_Cell6 := 10;
    var CellReselectionPriority v_CellReselectionPriority_Cell6 := 5;
    var CarrierFreqEUTRA v_CarrierFreq_Cell1, v_CarrierFreq_Cell3, v_CarrierFreq_Cell6;
    var ChannelBandwidthDependency_Type v_ChannelBandwidthDependency;
    var Ul_Bandwidth_Type v_UL_Bandwidth := f_ConvertDL_BandwidthToUL (px_ePrimaryBandChannelBandwidth);
    var Dl_Bandwidth_Type v_DL_Bandwidth := px_ePrimaryBandChannelBandwidth;
    var template (value) CellPowerList_Type v_CellPowerList_AtT2 := {
      cs_CellPower ( eutra_Cell1, tsc_NonSuitableOffCellRS_EPRE ),
      cs_CellPower ( eutra_Cell6, -73 )
    };

    //Initialise all cell, security and mobile parameters
    //SIB5 is init. in f_EUTRA_InitSystemInformation5 with default values according to 36.508 cl. 6.3.1.2
    f_EUTRA_Init (c3);

    //Get DL carrier frequency of cell 3 and 6
    v_CarrierFreq_Cell1 := f_EUTRA_CellInfo_GetEARFCN (eutra_Cell1);
    v_CarrierFreq_Cell3 := f_EUTRA_CellInfo_GetEARFCN (eutra_Cell3);
    v_CarrierFreq_Cell6 := f_EUTRA_CellInfo_GetEARFCN (eutra_Cell6);

    //Get bandwidth dependent parameters
    v_ChannelBandwidthDependency := f_EUTRA_BandDependentParam (v_DL_Bandwidth, v_UL_Bandwidth);

    //Set TAC according to 36.523-1 Table 6.0.1-2: Tracking Area Code (TAC) for E-UTRAN cells
    //TAC for Cell 1 is set to 1 in f_EUTRA_Init ();
    f_EUTRA_CellInfo_SetTAC (eutra_Cell3, tsc_IdleMode_TAC_Cell3);
    f_EUTRA_CellInfo_SetTAC (eutra_Cell6, tsc_IdleMode_TAC_Cell6);

    //Set system information according to specific message contents
    f_EUTRA_CellInfo_SetSysInfo_CellRes_Prio (eutra_Cell6, v_CellRes_Prio);
    f_EUTRA_CellInfo_SetSysInfo_ThreshServingLow (eutra_Cell6, v_ThreshServingLow_Cell6);


    //Update SIB5 on Cell 1 & 3 according to 36.523-1 Table 6.1.2.15.3.3-4
    //This will overwrite the default initialised ones
    f_EUTRA_CellInfo_SetSIB5 (eutra_Cell1, cs_508_SystemInformationBlockType5_Def ( { cs_InterFreqCarrierFreq ( v_CarrierFreq_Cell3,
                                                                                                                v_ChannelBandwidthDependency.AllowedMeasBandwidth ),
                                                                                      cs_InterFreqCarrierFreq_ThreshXHigh_CRPri ( v_CarrierFreq_Cell6,
                                                                                                                                  v_ChannelBandwidthDependency.AllowedMeasBandwidth,
                                                                                                                                  v_ThreshXHigh_Cell6,
                                                                                                                                  v_CellReselectionPriority_Cell6 ) } ) );

    f_EUTRA_CellInfo_SetSIB5 (eutra_Cell3, cs_508_SystemInformationBlockType5_Def ( { cs_InterFreqCarrierFreq ( v_CarrierFreq_Cell1,
                                                                                                                v_ChannelBandwidthDependency.AllowedMeasBandwidth ),
                                                                                      cs_InterFreqCarrierFreq_ThreshXHigh_CRPri ( v_CarrierFreq_Cell6,
                                                                                                                                  v_ChannelBandwidthDependency.AllowedMeasBandwidth,
                                                                                                                                  v_ThreshXHigh_Cell6,
                                                                                                                                  v_CellReselectionPriority_Cell6 ) } ) );

    //Set maximum cell powel level for Cell 1, 3 & 6 to be used in creation
    f_EUTRA_CellInfo_InitMaxReferencePower (eutra_Cell3, -73);
    f_EUTRA_CellInfo_InitMaxReferencePower (eutra_Cell6, -73);
    
    //Create and configure all cells
    f_EUTRA_CellConfig_Def (eutra_Cell1);
    f_EUTRA_CellConfig_Def (eutra_Cell3);
    f_EUTRA_CellConfig_Def (eutra_Cell6); //@sic R5s100356 & R5s100505 sic@
    
    //Bring UE to inital state
    f_EUTRA_Preamble (eutra_Cell1, STATE2_IDLEUPDATE);
    
    f_EUTRA_TestBody_Set (true);
    
    //@siclog "Step 1" siclog@
    //Change cell settings according to T1
    f_EUTRA_SetCellPower (eutra_Cell3, -73, cs_TimingInfo_Now);
    
    //@siclog "Step 2" siclog@
    //Check that the UE is camped on EUTRA cell 3
    f_EUTRA_IdleMode_TAU (eutra_Cell3);
    
    //@siclog "Step 3" siclog@
    //Change cell settings according to T2
    f_EUTRA_SetCellPowerList (v_CellPowerList_AtT2, cs_TimingInfo_Now);
    
    //@siclog "Step 4" siclog@
    //Check that the UE is camped on EUTRA cell 6
    f_EUTRA_IdleMode_TAU (eutra_Cell6);

    //@siclog "Step 5" siclog@
    //Change cell settings according to T3
    f_EUTRA_SetCellPower (eutra_Cell6, -95, cs_TimingInfo_Now);

    //@siclog "Step 6" siclog@
    //Check that the UE is camped on EUTRA cell 3
    f_EUTRA_IdleMode_TAU (eutra_Cell3);

    f_EUTRA_TestBody_Set (false);

    //Switch/power off UE
    f_EUTRA_Postamble (eutra_Cell3, E1_IDLE);
  }
}
