git.ucc.asn.au
/
ipdf
/
code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Totally FITH everything
[ipdf/code.git]
/
src
/
vfpu.cpp
diff --git
a/src/vfpu.cpp
b/src/vfpu.cpp
index
2c6d703
..
bf9e9e6
100644
(file)
--- a/
src/vfpu.cpp
+++ b/
src/vfpu.cpp
@@
-21,7
+21,7
@@
using namespace std;
namespace VFPU
{
namespace VFPU
{
-
+
static const char g_fpu[] = "vfpu";
static bool g_running = false;
static const char g_fpu[] = "vfpu";
static bool g_running = false;
@@
-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
*/
* 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
{
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
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.
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.
@@
-105,9
+114,8
@@
float Exec(float opa, float opb, Opcode op, Rmode rmode)
Register Exec(const Register & a, const Register & b, Opcode op, Rmode rmode)
{
assert(g_running);
Register Exec(const Register & a, const Register & b, Opcode op, Rmode rmode)
{
assert(g_running);
-
stringstream s;
stringstream s;
- s << hex << setw(8) << setfill('0') << a.to_ul
long() << "\n" << b.to_ullong() << "\n" << setw(3) << op <<"\n" << setw(2) << rmode << "\n
\n";
+ s << hex << setw(8) << setfill('0') << a.to_ul
ong() << "\n" << b.to_ulong() << "\n" << setw(1) << op <<"\n" << setw(1) << rmode << "
\n";
string str(s.str());
//Debug("Writing: %s", str.c_str());
string str(s.str());
//Debug("Writing: %s", str.c_str());
@@
-129,7
+137,8
@@
Register Exec(const Register & a, const Register & b, Opcode op, Rmode rmode)
}
stringstream s2;
}
stringstream s2;
- s2 << hex << result.to_ullong();
+ //TODO: Make it compile on non C++11
+ s2 << hex << result.to_ulong();
//Debug("Result is: %s", s2.str().c_str());
return result;
}
//Debug("Result is: %s", s2.str().c_str());
return result;
}
UCC
git Repository :: git.ucc.asn.au