#include <netinet/tcp.h>
#include <iostream>
+#include <fstream>
+
#include "add.cpp"
+#define VCD
+
+#ifdef VCD
+#include <backends/cxxrtl/cxxrtl_vcd.h>
+#endif
+
using namespace std;
extern "C" {
int main()
{
cxxrtl_design::p_add top;
+ int steps = 0;
+
+#ifdef VCD
+ // Load the debug items of the top down the whole design hierarchy
+ cxxrtl::debug_items all_debug_items;
+ top.debug_info(all_debug_items);
+
+ // set up vcdwriter with 1ns resu
+ cxxrtl::vcd_writer vcd;
+ vcd.timescale(1, "us");
+#endif
int listenfd = setup_socket();
int sock = -1;
+#ifdef VCD
+ //vcd.add_without_memories(all_debug_items);
+ vcd.add(all_debug_items);
+ std::ofstream waves("waves.vcd");
+#endif
+
top.step();
+#ifdef VCD
+ vcd.sample(0);
+#endif
while (true) {
top.p_clk.set<bool>(false);
top.step();
+#ifdef VCD
+ vcd.sample(steps*2 + 0);
+#endif
top.p_clk.set<bool>(true);
top.step();
+#ifdef VCD
+ vcd.sample(steps*2 + 1);
+#endif
+ steps++;
// if no current connection see if there is one
if (sock == -1) {
cout << "f " << f << endl;
*/
+
+ waves << vcd.buffer;
+ vcd.buffer.clear();
}
}