private void Run_Click(object sender, EventArgs e) { StreamReader sr = new StreamReader(Path.Combine(Application.StartupPath, "Testbench.v")); string all = sr.ReadToEnd(); sr.Close(); if (!all.Contains("endmodule")) { string[] FooterText = { "join", "always", "begin", "#1", " CLK = ~CLK;", "end", "endmodule" }; StreamWriter sw = new StreamWriter(Path.Combine(Application.StartupPath, "Testbench.v"), true); foreach (string line in FooterText) { sw.WriteLine(line); } sw.Close(); } //Start Icarus and Waveform //Opening the file string text = " "; try { FileHandler.OpenFileAbsolute(Path.Combine(Application.StartupPath, "Testbench.v"), out text); } catch (Exception ex) { GUIDriver.ShowIDE(); return; } GUIDriver.mainForm.OnFileOpened(text); int exitCode; string errors; string output; ExecutionHandler.CompileAll(out exitCode, out errors); if (exitCode != 0) { GUIDriver.mainForm.OnCompiled(exitCode, errors); GUIDriver.ShowIDE(); return; } ExecutionHandler.Simulate(out exitCode, out errors, out output); if (exitCode != 0 && exitCode != -1) { GUIDriver.mainForm.OnSimulated(exitCode, errors, output); GUIDriver.ShowIDE(); return; } ExecutionHandler.DrawWave(); }
//RUN private void button4_Click(object sender, EventArgs e) { program = System.IO.File.ReadAllText(PATH); instructions = new List <string>(program.Split('\n')); Assembler(); int exitCode; string errors; string output; ExecutionHandler.CompileAll(out exitCode, out errors); if (exitCode != 0) { GUIDriver.mainForm.OnCompiled(exitCode, errors); GUIDriver.ShowIDE(); return; } ExecutionHandler.Simulate(out exitCode, out errors, out output); if (exitCode != 0 && exitCode != -1) { GUIDriver.mainForm.OnSimulated(exitCode, errors, output); GUIDriver.ShowIDE(); return; } ExecutionHandler.DrawWave(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); GUIDriver.Initialize(); Application.Run(GUIDriver.mainForm); }
private void gUIToolStripMenuItem_Click(object sender, EventArgs e) { GUIDriver.ShowGUI(); }
private void easyVerilog_Click(object sender, EventArgs e) { GUIDriver.ShowIDE(); }