Beispiel #1
0
        private void SingleStepBtn_Click(object sender, EventArgs e)
        {
            try
            {
                if (IsAssembled)
                {
                    int nextValue = Int32.Parse(Converter.ConvertHexToDec(OperationController.NextAddr.Replace("0x", "")));
                    int lastAddr  = Int32.Parse(Converter.ConvertHexToDec(MainCTRL.txSG[MainCTRL.txSG.Count - 1].Address.Replace("0x", "")));
                    if (nextValue <= lastAddr)
                    {
                        MainCTRL.rxSG = MainCTRL.InitializeRegister(RegisterTab.ConvertDGtoDT("Register"));
                        TextSegment tx = MainCTRL.txSG.Where(x => x.Address == OperationController.NextAddr).FirstOrDefault();
                        MainCTRL.rxSG = OperationController.ExecuteOperation(tx, MainCTRL.DataSGDT, MainCTRL.rxSG);

                        RegisterTab.SetTemplateDT(MainCTRL.GenerateRegisterSGDT());
                        TextTab.SetSelectedRow(tx.Address, "TextSegment");
                        TextSGTabBtn_Click(sender, e);

                        // Cache Simulation
                        SimulateCache(tx);
                    }
                    else
                    {
                        IsDone = true;
                        UpdateErrorLog(ValidateInput.ExecuteMsg());
                    }
                }
                else
                {
                    MessageBox.Show("Please resolve all errors or warning before simulation.", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }