Ejemplo n.º 1
0
        //[Test, Combinatorial] From Arm v)0.5 Loopback Profile Not loaded unless Tx Profile Valid
        public static void CheckLoopbackAdcPrForWithInvalidTxProfile([Values("Tx 75/200MHz, IQrate 245.76MHz, Dec5")] string TxProfile,
                                                                     [Values("Rx 20MHz, IQrate 30.72MHz, Dec5", "Rx 40MHz, IQrate 61.44MHz, Dec5", "Rx 100MHz, IQrate 122.88MHz, Dec5")] string RxProfile,
                                                                     [Values("ORX 100MHz, IQrate 122.88MHz, Dec5", "ORX 200MHz, IQrate 245.75MHz, Dec5")] string OrxProfile)
        {
            settings.mykSettings.rxProfileName  = RxProfile;
            settings.mykSettings.txProfileName  = TxProfile;
            settings.mykSettings.orxProfileName = OrxProfile;
            settings.mykSettings.txChannel      = Mykonos.TXCHANNEL.TXOFF;
            //Call Test Setup
            TestSetup.AdcProfileTestSetupInit(settings, false, true);

            AdiCommandServerClient Link = AdiCommandServerClient.Instance;

            Link.hw.Connect(TestSetupConfig.ipAddr, TestSetupConfig.port);

            //Read Orx Profile settings from ARM
            string LBADCProfile = Helper.readArmAdcProfilesStruct();

            Mykonos.VCODIV vcoDiv;
            UInt32         vcoDivTimes10 = 10;

            //Calculate Expected OrxProfile Settings: Expect Rx Profile to be used
            vcoDiv = settings.rxProfileData.ClkPllVcoDiv;
            switch (vcoDiv)
            {
            case Mykonos.VCODIV.VCODIV_1: vcoDivTimes10 = 10; break;

            case Mykonos.VCODIV.VCODIV_1p5: vcoDivTimes10 = 15; break;

            case Mykonos.VCODIV.VCODIV_2: vcoDivTimes10 = 20; break;

            case Mykonos.VCODIV.VCODIV_3: vcoDivTimes10 = 30; break;

            default: vcoDivTimes10 = 10; break;
            }
            Console.Write("Test" + settings.rxProfileData.ClkPllFrequency_kHz);
            uint hsDigClk_MHz = settings.rxProfileData.ClkPllFrequency_kHz / vcoDivTimes10 / 100 / settings.rxProfileData.ClkPllHsDiv;

            Console.Write("Test" + settings.rxProfileData.adcDacDiv);
            double ADCClk_MHz = hsDigClk_MHz / settings.rxProfileData.adcDacDiv;

            Console.Write("Test" + ADCClk_MHz);
            UInt16 adcClk_MHz = (UInt16)ADCClk_MHz;

            Console.Write("Test" + (settings.rxProfileData.RfBw_Hz / 1000000));


            int profileIndex = 15;
            int i;

            for (i = 0; i < 15; i++)
            {
                Console.Write("Index" + i + " " + adcProfileLut[i, 1] + " " + adcProfileLut[i, 0]);
                /* Find a row in the LUT that matches the ADC clock frequency */
                if ((adcProfileLut[i, 1] == adcClk_MHz) && (adcProfileLut[i, 0] >= (settings.rxProfileData.RfBw_Hz / 1000000)))
                {
                    profileIndex = i;
                    break;
                }
            }

            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            for (i = 0; i < 16; i++)
            {
                sb.Append((adcProfileLut[profileIndex, i + 2].ToString()) + ", ");
            }
            Console.WriteLine(LBADCProfile);
            Assert.AreEqual(sb.ToString(), LBADCProfile, "Loopback ADC profile not as expected");
        }