From 43dd80f6ef24639111ba9e692a8450288f84f50d Mon Sep 17 00:00:00 2001 From: Makise Kurisu Date: Mon, 19 Jan 2015 18:11:14 +0100 Subject: [PATCH] GtkWave integration OK --- vsim/main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/vsim/main.cpp b/vsim/main.cpp index 8d0f48a..54c20b0 100644 --- a/vsim/main.cpp +++ b/vsim/main.cpp @@ -99,17 +99,22 @@ int main(int argc, char **argv) { return 2; } - string cargs = "ghdl -m --ieee=synopsys --warn-no-vital-generic --workdir=" + string(tempdir) + " --work=" + work + " " + top; + string cargs = "cd " + string(tempdir) + "; ghdl -m --ieee=synopsys --warn-no-vital-generic --workdir=" + string(tempdir) + " --work=" + work + " " + top; - if (!run(cargs)) { + if (run(cargs)) { cerr << "Error: Compilation failed." << endl; } else { cargs = ""; // ./testb_file --stop-time=500ns --vcdgz=testb_file.vcdgz - if (run("./" + top + " --stop-time=500ns --vcdgz=" + top + ".vcdgz")) { + if (run("cd " + string(tempdir) + "; ./" + top + " --stop-time=500ns --vcdgz=" + top + ".vcdgz")) { cerr << "Error: Simulation failed." << endl; } + else { + if (run("gunzip --stdout " + string(tempdir) + "/" + top + ".vcdgz | gtkwave --vcd")) { + cerr << "Error: GtkWave failed."; + } + } } return 0;