X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fvfpu.cpp;h=8783ca1c9e78df652f6c14b0a06998873d779987;hp=2c6d7038c1415528f8c5b36ebbaf0f006f52158d;hb=f06cfbc2d5986de9f9489e5cd9424231f310d471;hpb=c0f947a6ce10a329eec81e4df820ac52f7ab371f diff --git a/src/vfpu.cpp b/src/vfpu.cpp index 2c6d703..8783ca1 100644 --- a/src/vfpu.cpp +++ b/src/vfpu.cpp @@ -32,7 +32,7 @@ static pid_t g_fpu_pid = -1; * Starts the VFPU * @returns 0 on success, errno of the failing function on failure */ -int Start() +int Start(const char * vcd_output) { assert(!g_running); // create unix socket pair @@ -59,7 +59,16 @@ int Start() Debug("Child about to suppress stderr and exec vfpu"); dup2(open("/dev/null", O_APPEND), fileno(stderr)); //LALALA I AM NOT LISTENING TO YOUR STUPID ERRORS GHDL - execl(g_fpu, g_fpu,NULL); + if (vcd_output != NULL) + { + string s("--vcd="); + s += vcd_output; + execl(g_fpu, g_fpu, s.c_str(), NULL); + } + else + { + execl(g_fpu, g_fpu,NULL); + } int err = errno; // Because errno will be set again by the next system call Fatal("Uh oh! %s\n", strerror(err)); // We will never see this if something goes wrong... oh dear exit(err); // Child exits here. @@ -107,7 +116,7 @@ Register Exec(const Register & a, const Register & b, Opcode op, Rmode rmode) assert(g_running); stringstream s; - s << hex << setw(8) << setfill('0') << a.to_ullong() << "\n" << b.to_ullong() << "\n" << setw(3) << op <<"\n" << setw(2) << rmode << "\n\n"; + s << hex << setw(8) << setfill('0') << a.to_ullong() << "\n" << b.to_ullong() << "\n" << setw(1) << op <<"\n" << setw(1) << rmode << "\n"; string str(s.str()); //Debug("Writing: %s", str.c_str());