summaryrefslogtreecommitdiff
path: root/verilator_example_systemc/sc_main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'verilator_example_systemc/sc_main.cc')
-rw-r--r--verilator_example_systemc/sc_main.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/verilator_example_systemc/sc_main.cc b/verilator_example_systemc/sc_main.cc
new file mode 100644
index 0000000..0634207
--- /dev/null
+++ b/verilator_example_systemc/sc_main.cc
@@ -0,0 +1,19 @@
+#include <cstdio>
+
+#include "Vhello.h"
+
+using namespace sc_core;
+
+int
+sc_main(int argc, char **argv)
+{
+ Verilated::commandArgs(argc, argv);
+ sc_clock clk{"clk", 10, SC_NS, 0.5, 3, SC_NS, true};
+
+ Vhello *top = new Vhello{"top"};
+ top->clk(clk);
+ while (!Verilated::gotFinish())
+ sc_start(1, SC_NS);
+ fprintf(stderr, "it finished.\n");
+ return 0;
+}