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() + "]"; }
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(); } }
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; } }
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); }
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)); } }