示例#1
0
        public VerilogTreeNode(VerilogFile vFile)
        {
            this.vFile = vFile;
            StringBuilder sb = new StringBuilder();

            foreach (int chainLength in this.vFile.ShadowChains)
            {
                sb.AppendFormat("%d|", chainLength);
            }
            this.Text = this.vFile.ModuleName + " - " + this.vFile.NumDffBits + " [" + sb.ToString() + "]";
        }
示例#2
0
 public void AddSubModule(VerilogFile subModule)
 {
     this.subModules.Add(subModule);
     this.totalDffBits += subModule.NumDffBits;
     subModule.SetParentUpdater(new VerilogFileUpdate(Update));
     Update();
     if (this.parentUpdater != null)
     {
         this.parentUpdater.Invoke();
     }
 }
示例#3
0
        private Token ParseSubmodule(StringTokenizer tok, VerilogFile submodule)
        {
            Token currToken = null;
            Token prevToken = new Token(TokenKind.Unknown, "", 0, 0, 0);

            while (true)
            {
                currToken = tok.Next();
                if (currToken.Kind == TokenKind.EOF)
                {
                    return(null);
                }
                if (currToken.Value == ";" && prevToken.Value == ")")
                {
                    return(prevToken);
                }
                prevToken = currToken;
            }
        }
示例#4
0
        private void ShadowFile_Click(object sender, EventArgs e)
        {
            this.progressBar1.Value = 0;
            string fileLocation = this.FileLoc.Text;

            FileInfo     fi;
            StreamReader sr;

            try {
                fi = new FileInfo(fileLocation);
                sr = fi.OpenText();
            } catch {
                MessageBox.Show("Error opening file '" + fileLocation + "'.", "ShadowWriter", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            string writeLocation = fileLocation.Insert(fileLocation.Length - 2, this.appendixTextBox.Text);

            if (File.Exists(writeLocation) && !this.owCheckBox.Checked)
            {
                MessageBoxButtons btn    = MessageBoxButtons.OKCancel;
                MessageBoxIcon    icon   = MessageBoxIcon.Warning;
                DialogResult      result = MessageBox.Show("File '" + writeLocation + "' already exists, overwrite?", "ShadowWriter", btn, icon);

                switch (result)
                {
                case DialogResult.Cancel:
                    sr.Close();
                    return;

                default:
                    break;    //Continue
                }
            }
            StreamWriter sw            = new StreamWriter(writeLocation);
            bool         shadowSuccess = WriteShadowDffs(sw, sr);

            //Deal with failed shadow here<----------
            sr.Close();
            sw.Close();
            VerilogFile vf = new VerilogFile(fileLocation);
        }
示例#5
0
        private void SubmoduleAddButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.FileName = "Derp.v";
            dlg.Filter   = "Verilog Documents (.v)|*.v";
            dlg.ShowDialog();
            VerilogFile     newModule = new VerilogFile(dlg.FileName);
            VerilogTreeNode vTNode    = (VerilogTreeNode)moduleTreeView.SelectedNode;

            if (vTNode != null)
            {
                vTNode.VFile.AddSubModule(newModule);
                vTNode.Nodes.Add(new VerilogTreeNode(newModule));
                vTNode.Refresh();
            }
            else
            {
                moduleTreeView.Nodes.Add(new VerilogTreeNode(newModule));
            }
        }