Commit 7f56e7df authored by mullers's avatar mullers
Browse files

code review of today

parent c7f08aa4
Loading
Loading
Loading
Loading
+158 −31
Original line number Diff line number Diff line
@@ -20,8 +20,71 @@
	import from dPMR_Types all;
	import from dPMR_TestSystem all;
	import from dPMR_ExtFunctions all;
	import from dPMR_Pics all;
	import from dPMR_Pixits all;

	group initFunctions {
		
		function f_initMse()
		runs on Simu {

			vc_mse.useAllCallCommonId := e_noAllCall;
			vc_mse.iutId := f_createMsAddress(); //(PIC_ISF_OR_CSF, vc_mse.useAllCallCommonId, PXT_APPLICABLE_COMMON_ID,PXT_CSF_ADDRESS_IUT)
			vc_mse.testerId := f_createMsAddress();//(PIC_ISF_OR_CSF, vc_mse.useAllCallCommonId, PXT_APPLICABLE_COMMON_ID,PXT_CSF_ADDRESS_TESTER)
			vc_mse.iutIdUP := f_msAddress2Upper(vc_mse.iutId);
			vc_mse.iutIdLP := f_msAddress2Lower(vc_mse.iutId);
			vc_mse.testerIdUP := f_msAddress2Upper(vc_mse.testerId);
			vc_mse.testerIdLP := f_msAddress2Lower(vc_mse.testerId);
			
		}//end f_initMse

		function f_initMse_isfAllCall(UseAllCallCommonId p_useAllCallCommonId)
		runs on Simu {

			vc_mse.useAllCallCommonId := p_useAllCallCommonId;
			vc_mse.iutId := f_createMsAddress(); //(PIC_ISF_OR_CSF, vc_mse.useAllCallCommonId, PXT_APPLICABLE_COMMON_ID,PXT_CSF_ADDRESS_IUT)
			vc_mse.testerId := f_createMsAddress();//(PIC_ISF_OR_CSF, vc_mse.useAllCallCommonId, PXT_APPLICABLE_COMMON_ID,PXT_CSF_ADDRESS_TESTER)
			vc_mse.iutIdUP := f_msAddress2Upper(vc_mse.iutId);
			vc_mse.iutIdLP := f_msAddress2Lower(vc_mse.iutId);
			vc_mse.testerIdUP := f_msAddress2Upper(vc_mse.testerId);
			vc_mse.testerIdLP := f_msAddress2Lower(vc_mse.testerId);

		}//end f_initMse


	}//end initFunctions

	group configFunctions {

		/*
		 * @desc 	The ISF MSUT is configured to use PXT_APPLICABLE_COMMON_ID.
		 *			An CSF MSUT does not need to be configured. It will receive
		 *			in the Header frame the CalledId and OwnId. 
		*/
		function f_msConfigureRx(ColourCode p_cc)
		runs on Simu
		return FncRetCode {
			var FncRetCode v_ret := e_success;
			if (PIC_ISF_OR_CSF == e_isf) {
				v_ret := f_msConfig_Ut(  m_msCfgParamsIsfRx( p_cc, int2bit(PXT_APPLICABLE_COMMON_ID,8)), v_ret);
			}
			return v_ret;
		}//end f_msConfigureRx

		function f_msConfigureTx(ColourCode p_cc, PoliteLvl p_politeLvl, CallType p_callType)
		runs on Simu
		return FncRetCode {
			var FncRetCode v_ret := e_success;
			if (PIC_ISF_OR_CSF == e_isf) { 
				v_ret := f_iutMsTxInit_Ut(m_msCfgParamsIsfTx(p_cc, p_politeLvl, p_callType, int2bit(PXT_APPLICABLE_COMMON_ID,8)), v_ret); }
			else { 
				v_ret := f_iutMsTxInit_Ut(m_msCfgParamsCsfTx(p_cc, p_politeLvl, p_callType, fx_calcDialString(PXT_CSF_ADDRESS_TESTER)), v_ret);
			}
			return v_ret;
		}//end f_msConfigureTx

		
	}//end configFunctions
	
	function f_msConfig_Ut( template MsCfgParams p_msCfgParams , FncRetCode p_ret )
	runs on Ut return FncRetCode{
@@ -31,12 +94,12 @@
		utPort.send(p_msCfgParams);
		tc_maxTimeCfgActRly.start;
		alt{
			[]utPort.receive(e_success){
			[]utPort.receive(m_success){
				setverdict(pass);
				tc_maxTimeCfgActRly.stop;
				return e_success;
			}
			[]utPort.receive(e_error){
			[]utPort.receive(m_noSuccess){
				setverdict(fail);
				tc_maxTimeCfgActRly.stop;
				log("*** f_msConfig_Ut: Error message received on upper tester ***");
@@ -49,22 +112,6 @@
		return e_error;
	} // end f_msConfig_Ut

//	group UtilityFunctions {
//		function f_calledId2Upper(CalledId p_calledId) return CalledIdUP {
//			return p_calledId & 'FFF000'H;
//		}
//		function f_calledId2Lower(CalledId p_calledId) return CalledIdLP {
//			return p_calledId << 12;
//		}
//		function f_ownId2Upper(CalledId p_ownId) return OwnIdUP {
//			return p_ownId & 'FFF000'H;
//		}
//		function f_ownId2Lower(CalledId p_ownId) return OwnIdLP {
//			return p_ownId << 12;
//		}
//
//	} // end UtilityFunctions

	//@Desc: f_iutMsTxInit_Ut is used to prepare the MS for transmission and 
	//          sets the following parameters
	//          ColourCode 
@@ -119,7 +166,7 @@
	//		 This function shall be called only with a ISF address, if called with
	//       an CSF address it will return the reserved Common ID value 0.

	function f_getCommonId( MSAddress p_msAddress )
	function f_getCommonId( MsAddress p_msAddress )
	runs on Ut return Common_ID {
		if (ischosen(p_msAddress.isfAddress)) {
			return p_msAddress.isfAddress.common_ID; }
@@ -128,22 +175,102 @@
		}
	} // end f_getCommonId

	group converterFunctions {
		
		function f_getColourCode ()
		runs on Simu
		return ColourCode {
		
 	//@Desc: f_getDialString returns the Dial string from an CSF address.
	//       The return result is successful only if the function is called with an
	//       CSF address. If called with an ISF address the functions returns an
	//       error and non-dialable address "0000000", 
			//TODO JP implement
			var ColourCode v_cc := { isfColourCode := '11111'B };

	function f_getDialString( MSAddress p_msAddress )
	runs on Ut return DialString {
		if (ischosen(p_msAddress.csfAddress)) {
			return fx_calcDialString( p_msAddress.csfAddress ) ; }
		else {
			return c_nonUsedDialStr;   // Return non-used dial string
			//if (PIC_ISF_OR_CSF)
				
			return v_cc;
		
		}//end f_getColourCode	
	
		function f_createMsAddress()
		runs on Simu
		return MsAddress {
			//TODO JP implement
			return {csfAddress := int2bit(12,24)}
		
		}//end f_createCalledId

	
	}//end converterFunctions

group UtilityFunctions {

		//TODO JP chnage name to f_msAddress...
		function f_msAddress2Upper(MsAddress p_msAddress) return Bit12 {

		/*	if (ischosen(p_calledId.isfAddress)) {
				var Common_Id v_commonId := p_calledId.isfAddress.common_ID;
			}
	} // end f_getCommonId
			else {//csf
				
				
			}



			//var CalledIdUP p_tmp := CalledIdUP(p_calledId & 'FFF000'H);
			var CalledId t1 := p_calledId;
			var MSAddress t2 := p_calledId;
			var ISFAddress t3 := t2.isfAddress;
			var Common_ID t4 := t3.common_ID
			var FixedPart t5 := t3.fixedPart;

 	

			var CalledIdUP retval;
			var CalledIdUP tmp;


			retval := '000000000000'B;

			retval := retval or4b t4;
			tmp := t5 and4b '1111000000000000'B;
			tmp := tmp >> 12;

			retval := retval or4b tmp;


			return retval;


//			nn := p_calledId;
//			oo := nn and4b 'FFF000'H;
//			return oo;  */
			return int2bit(0,12);
		}
		function f_msAddress2Lower(MsAddress p_msAddress) return Bit12 {

		/*	var CalledId t1 := p_calledId;
			var MSAddress t2 := p_calledId;
			var ISFAddress t3 := t2.isfAddress;
			var Common_ID t4 := t3.common_ID
			var FixedPart t5 := t3.fixedPart;

			var CalledIdUP retval;
			var CalledIdUP tmp;


			retval := '000000000000'B;

			retval := retval or4b t4;
			tmp := t5 and4b '1111000000000000'B;
			tmp := tmp >> 12;

			retval := retval or4b tmp;


			return retval;  */
			return int2bit(0,12);
		}
	
} //end UtilityFunctions

} // end module dPMR_Functions
+5 −2
Original line number Diff line number Diff line
@@ -20,8 +20,11 @@ module dPMR_Pics {


	
	// @desc: Radio kind ISF or CSF
	modulepar {RadioKind PIC_ISF_OR_CSF := e_isf}
	/*
	* @desc: 	Is the IUT an ISF or CSF entity?
	* @remark:	see PICS, Table A.1/1.
	*/ 
	modulepar {Entity PIC_ISF_OR_CSF := e_isf}



+21 −15
Original line number Diff line number Diff line
@@ -14,15 +14,19 @@ module dPMR_Pixits {
	import from dPMR_Types all;
	import from dPMR_Values all;

	/*
	* @desc: 	ISF Channel Number to be used in ISF test cases.
	* @remark:	see clause 6.1.5
	*/ 
	modulepar {IsfChannelNr PXT_ISF_CHANNEL_NR := e_isfChannelNr_0 }

	// @desc: Colour Code used by the IUT
	modulepar {ColourCode PXT_COLOUR_CODE := { isfColourCode := '577577'O }}
	/*
	* @desc: 	ISF Channel Number to be used in ISF test cases.
	* @remark:	see clause 6.1.5
	*/ 
	modulepar {CsfChannelNr PXT_CSF_CHANNEL_NR := e_csfChannelNr_0 }

	
	// @desc: Colour Code (Channel) to be used in test case, must be chosen 
	// in the correct range (Group A or B) dependent on if IUT is an ISF or CSF radio.
	modulepar {ISFColourcode PXT_SELECTED_ISF_COLOURCODE  }
	modulepar {CSFColourcode PXT_SELECTED_CSF_COLOURCODE  }


	// @desc: Voice Test Tone for frame 1, 2, 3 and 4, must be chosen 
@@ -37,23 +41,25 @@ module dPMR_Pixits {
	modulepar { CallType PXT_CALL_TYPE := e_voiceGrp }

	// @desc: Applicable Common Id used for ISF only
	modulepar {UInt8 PXT_APPLICABLE_COMMON_ID := 1}
	modulepar {ApplicableCommonId  PXT_APPLICABLE_COMMON_ID := 1}

	// @desc: Applicable Common Id used for ISF only
	modulepar {CSFAddress PXT_TE_CSF_ADDRESS := '111111110000000000000001'B }
	modulepar {CSFAddress PXT_CSF_ADDRESS_TESTER := '111111110000000000000001'B }

	modulepar {CSFAddress PXT_CSF_ADDRESS_IUT := '111111110000000000000001'B }

	// @desc: Address value of IUT
	modulepar {MSAddress PXT_TE_ADDRESS := { csfAddress := '111111110000000000000001'B }} // Note this value shall be overwritten. Only valid for CSF
//	modulepar {MSAddress PXT_TE_ADDRESS := { csfAddress := '111111110000000000000001'B }} // Note this value shall be overwritten. Only valid for CSF

	// @desc: Address value of IUT
	modulepar {MSAddress PXT_IUT_ADDRESS := { csfAddress := '111111110000000000000001'B }} // Note this value shall be overwritten. Only valid for CSF
//	modulepar {MSAddress PXT_IUT_ADDRESS := { csfAddress := '111111110000000000000001'B }} // Note this value shall be overwritten. Only valid for CSF

	// @desc: Value of IUT Address
	modulepar {CalledId PXT_CALLED_ID} 
//	modulepar {CalledId PXT_CALLED_ID} 

	//:= {isfAddress := {commonID := '11111111'B, fixedPart := '0000000000000000'B}}}
 	// @desc: Value of Tester Address
	modulepar {OwnId PXT_OWN_ID } //:= '111111110000000000000001'B}
//	modulepar {OwnId PXT_OWN_ID } //:= '111111110000000000000001'B}



+37 −130
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
	import from LibCommon_DataStrings all;
	import from LibCommon_BasicTypesAndValues all;
	import from LibCommon_DataStrings all;
	import from LibCommon_VerdictControl all;

	//Ats
	import from dPMR_TestSystem all;
@@ -33,7 +34,7 @@ group MessageTemplates {
	} // end template m_payloadContTransmission


	template SuperFrameList m_superFrameListWith4Frames ( template SuperFrame p_superFrame) := {
	template SuperFrameList m_superFrameListWith4SuperFrames ( template SuperFrame p_superFrame) := {
	  p_superFrame,p_superFrame,p_superFrame,p_superFrame //,m_superFrame,m_superFrame,m_superFrame
	} // end template m_superFrameListWith4Frames

@@ -49,62 +50,62 @@ group MessageTemplates {
	} // end template m_superFrame


 	template Frame1 m_frame1AudibleTestTone (	CalledId p_calledID,
 	template Frame1 m_frame1AudibleTestTone (	CalledIdUP p_calledIdUP,
												Payload p_payload)  := {
		frameSync := c_fs2,
		frameNumber := e_frame1,
		calledIdUP := f_calledId2Upper(p_calledID),// & 'FFF000'H,
		calledIdUP := p_calledIdUP,
   		communicationsMode := e_voice,
        commsFormat := e_callAll, // This might be incorrect
        commsFormat := e_callAll, // TODO JP This is incorrect
        reserved2bit := c_reserved2bits,
        slowData := c_slowDataInVoiceEmpty,
        payload := p_payload
	} // end template m_frame1AudibleTestTone


  	template Frame2 m_frame2AudibleTestTone (	CalledId p_calledID,
  	template Frame2 m_frame2AudibleTestTone (	CalledIdLP p_calledIdLP,
												Payload p_payload, ColourCode p_cc)  := {
		colourCode := p_cc,
		frameNumber := e_frame2,
		calledIdLP := f_calledId2Lower(p_calledID),
		calledIdLP := p_calledIdLP,
   		communicationsMode := e_voice,
        commsFormat := e_callAll, // This might be incorrect
        commsFormat := e_callAll, // TODO JP This might be incorrect
        reserved2bit := c_reserved2bits,
        slowData := c_slowDataInVoiceEmpty,
        payload := p_payload
	} // end template m_frame2AudibleTestTone


  	template Frame3 m_frame3AudibleTestTone (	OwnId p_ownID,
  	template Frame3 m_frame3AudibleTestTone (	OwnIdUP p_ownIdUP,
												Payload p_payload)  := {
		frameSync := c_fs2,
		frameNumber := e_frame3,
		ownIdUP := f_ownId2Upper(p_ownID),
		ownIdUP := p_ownIdUP,
   		communicationsMode := e_voice,
        commsFormat := e_callAll, // This might be incorrect
        commsFormat := e_callAll, // TODO JP This might be incorrect
        reserved2bit := c_reserved2bits,
        slowData := c_slowDataInVoiceEmpty,
        payload := p_payload
	} // end template m_frame3AudibleTestTone


  	template Frame4 m_frame4AudibleTestTone (	OwnId p_ownID,
  	template Frame4 m_frame4AudibleTestTone (	OwnIdLP p_ownIdLP,
												Payload p_payload, ColourCode p_cc)  := {
		colourCode := p_cc,
		frameNumber := e_frame4,
		ownIdLP := f_ownId2Lower(p_ownID),
		ownIdLP := p_ownIdLP,
   		communicationsMode := e_voice,
        commsFormat := e_callAll, // This might be incorrect
        commsFormat := e_callAll, // TODO JP This might be incorrect
        reserved2bit := c_reserved2bits,
        slowData := c_slowDataInVoiceEmpty,
        payload := p_payload
	} // end tamplate m_frame4AudibleTestTone


 	template Frame1 mw_frame1Voice ( CalledId p_calledID )  := {
 	template Frame1 mw_frame1Voice ( CalledIdUP p_calledIdUP )  := {
		frameSync := c_fs2,
		frameNumber := e_frame1,
		calledIdUP := f_calledId2Upper(p_calledID), // & 'FFF000'H,
		calledIdUP := p_calledIdUP,
   		communicationsMode := e_voice,
        commsFormat := ?,
        reserved2bit := c_reserved2bits,
@@ -113,10 +114,10 @@ group MessageTemplates {
	} // end template mw_frame1Voice


  	template Frame2 mw_frame2Voice ( CalledId p_calledID, ColourCode p_cc)  := {
  	template Frame2 mw_frame2Voice ( CalledIdLP p_calledIdLP, ColourCode p_cc)  := {
		colourCode := p_cc,
		frameNumber := e_frame2,
		calledIdLP := f_calledId2Lower(p_calledID),
		calledIdLP := p_calledIdLP,
   		communicationsMode := e_voice,
        commsFormat := ?,
        reserved2bit := c_reserved2bits,
@@ -125,10 +126,10 @@ group MessageTemplates {
	} // end template mw_frame2Voice
 

  	template Frame3 mw_frame3Voice ( OwnId p_ownID )  := {
  	template Frame3 mw_frame3Voice ( OwnIdUP p_ownIdUP )  := {
		frameSync := c_fs2,
		frameNumber := e_frame3,
		ownIdUP := f_ownId2Upper(p_ownID),
		ownIdUP := p_ownIdUP,
   		communicationsMode := e_voice,
        commsFormat := ?,
        reserved2bit := c_reserved2bits,
@@ -137,10 +138,10 @@ group MessageTemplates {
	} // end template mw_frame3Voice


  	template Frame4 mw_frame4Voice ( OwnId p_ownID, ColourCode p_cc)  := {
  	template Frame4 mw_frame4Voice ( OwnIdLP p_ownIdLP, ColourCode p_cc)  := {
		colourCode := p_cc,
		frameNumber := e_frame4,
		ownIdLP := f_ownId2Lower(p_ownID),
		ownIdLP := p_ownIdLP,
   		communicationsMode := e_voice,
        commsFormat := ?,
        reserved2bit := c_reserved2bits,
@@ -217,113 +218,11 @@ group FrameTemplates {

} // end group FrameTemplates


group UtilityFunctions {

		function f_calledId2Upper(CalledId p_calledId) return CalledIdUP {
			//var CalledIdUP p_tmp := CalledIdUP(p_calledId & 'FFF000'H);
			var CalledId t1 := p_calledId;
			var MSAddress t2 := p_calledId;
			var ISFAddress t3 := t2.isfAddress;
			var Common_ID t4 := t3.common_ID
			var FixedPart t5 := t3.fixedPart;

 	

			var CalledIdUP retval;
			var CalledIdUP tmp;


			retval := '000000000000'B;

			retval := retval or4b t4;
			tmp := t5 and4b '1111000000000000'B;
			tmp := tmp >> 12;

			retval := retval or4b tmp;


			return retval;


//			nn := p_calledId;
//			oo := nn and4b 'FFF000'H;
//			return oo;
		}
		function f_calledId2Lower(CalledId p_calledId) return CalledIdLP {
			var CalledId t1 := p_calledId;
			var MSAddress t2 := p_calledId;
			var ISFAddress t3 := t2.isfAddress;
			var Common_ID t4 := t3.common_ID
			var FixedPart t5 := t3.fixedPart;

			var CalledIdUP retval;
			var CalledIdUP tmp;


			retval := '000000000000'B;

			retval := retval or4b t4;
			tmp := t5 and4b '1111000000000000'B;
			tmp := tmp >> 12;

			retval := retval or4b tmp;


			return retval;
		}
		function f_ownId2Upper(OwnId p_ownId) return OwnIdUP {
			var OwnId t1 := p_ownId;
			var MSAddress t2 := p_ownId;
			var ISFAddress t3 := t2.isfAddress;
			var Common_ID t4 := t3.common_ID
			var FixedPart t5 := t3.fixedPart;

			var CalledIdUP retval;
			var CalledIdUP tmp;


			retval := '000000000000'B;

			retval := retval or4b t4;
			tmp := t5 and4b '1111000000000000'B;
			tmp := tmp >> 12;

			retval := retval or4b tmp;


			return retval;
		}

	function f_ownId2Lower(OwnId p_ownId) return OwnIdLP {
		var OwnId t1 := p_ownId;
		var MSAddress t2 := p_ownId;
		var ISFAddress t3 := t2.isfAddress;
		var Common_ID t4 := t3.common_ID
		var FixedPart t5 := t3.fixedPart;

		var CalledIdUP retval;
		var CalledIdUP tmp;


		retval := '000000000000'B;

		retval := retval or4b t4;
		tmp := t5 and4b '1111000000000000'B;
		tmp := tmp >> 12;

		retval := retval or4b tmp;


		return retval;
	}
} //end UtilityFunctions

group InformationElementTemplates {

 	template HeaderInformation  m_headerInformation( HeaderType p_hdrTp,
													 CalledId p_calledId , 
												     OwnId    p_ownId, 
													 MsAddress p_calledId , 
												     MsAddress    p_ownId, 
												     CommunicationsMode p_commMode,
												     CommsFormat p_commFormat
												    ) := {
@@ -338,8 +237,8 @@ group InformationElementTemplates {
	} // end m_headerInformation


 	template HeaderInformation  mw_headerInformationVoiceTx ( CalledId p_calledId , 
												      		  OwnId    p_ownId, 
 	template HeaderInformation  mw_headerInformationVoiceTx ( MsAddress p_calledId , 
												      		  MsAddress    p_ownId, 
												      		  CommunicationsMode p_commMode,
												          	  CommsFormat p_commFormat
												     		) := {
@@ -365,12 +264,12 @@ group InformationElementTemplates {



	template MSAddress m_msAddressFromIsfAddr( ISFAddress p_iadr ) := {
	template MsAddress m_msAddressFromIsfAddr( ISFAddress p_iadr ) := {
		isfAddress := p_iadr 
	} // end m_msAddressFromIsfAddr


	template MSAddress m_msAddressFromCsfAddr( CSFAddress p_cadr ) := {
	template MsAddress m_msAddressFromCsfAddr( CSFAddress p_cadr ) := {
		csfAddress := p_cadr 
	} // end m_msAddressFromCsfAddr

@@ -386,6 +285,7 @@ group InformationElementTemplates {
group ConfigurationTemplates {


	//TODO JP change name , knowing that later politeLv1 is needed as well
	template MsCfgParams m_msCfgParamsIsfRx( ColourCode p_cc, Common_ID p_cid ) := {
  		colourCode := p_cc,
		politeLvl  := omit,
@@ -442,5 +342,12 @@ group ConfigurationTemplates {

} // end group ConfigurationTemplates

group FncRetCodeTmplts {
	
	template FncRetCode m_success := e_success;
	template FncRetCode m_noSuccess := complement(e_success);

}//end FncRetCodeTmplts


} // end module dPMR_Templates
+274 −271

File changed.

Preview size limit exceeded, changes collapsed.

Loading