예제 #1
0
        private void BuildBtn_Click(object sender, System.EventArgs e)
        {
            try
            {
                IsDone = false;
                UpdateErrorLog(ValidateInput.AssembleMsg());
                //string err = MainCTRL.BuildSourceCode(BlockSizeTxt.Text, CacheSizeTxt.Text,
                //    CodeEditorTxt.Text, IsMRU, IsLRU);
                string err = MainCTRL.BuildSourceCode(BlockSizeTxt.Text, CacheSizeTxt.Text,
                                                      CodeEditorCtrl.GetCodeEditorRTB(), IsMRU);
                if (string.IsNullOrEmpty(err))
                {
                    int cacheRowCount = 4 * Int32.Parse(BlockSizeTxt.Text) * Int32.Parse(CacheSizeTxt.Text);
                    MainCTRL.InitializeCache(cacheRowCount, Int32.Parse(BlockSizeTxt.Text));
                    SetCacheDT(MainCTRL.GenerateCacheDT());
                    int wordSize = DataCleaner.BitCounter(Int32.Parse(BlockSizeTxt.Text));
                    CacheController.Init(11 - wordSize, wordSize, Int32.Parse(BlockSizeTxt.Text));

                    UpdateErrorLog(ValidateInput.NoErr());
                    DataTab.SetTemplateDT(MainCTRL.GenerateDataSGDT());
                    TextTab.SetTemplateDT(MainCTRL.GenerateTextSGDT());
                    TextTab.SetColumnWidth();
                    IsAssembled = true;
                    OperationController.NextAddr = "0x00001000";
                }
                else
                {
                    UpdateErrorLog(err);
                    IsAssembled = false;
                }
            }
            catch (Exception ex)
            {
                IsAssembled = false;
                MessageBox.Show(ex.Message);
            }
        }