summaryrefslogtreecommitdiff
path: root/verilator_example_c++/sim_main.cc
diff options
context:
space:
mode:
authorMartin Stensgård <mastensg@mastensg.net>2025-04-26 17:45:52 +0200
committerMartin Stensgård <mastensg@mastensg.net>2025-04-26 17:45:52 +0200
commita9859aebb4a1baf58b2cf383ca85ba80d4eea313 (patch)
tree5c4b075eb0868bf08ba156172c68e2ee1124b640 /verilator_example_c++/sim_main.cc
parent554b69e206027918e38c8da33099937da9332456 (diff)
verilator_example_c++: hello
Diffstat (limited to 'verilator_example_c++/sim_main.cc')
-rw-r--r--verilator_example_c++/sim_main.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/verilator_example_c++/sim_main.cc b/verilator_example_c++/sim_main.cc
new file mode 100644
index 0000000..6652dd9
--- /dev/null
+++ b/verilator_example_c++/sim_main.cc
@@ -0,0 +1,15 @@
+#include <cstdio>
+
+#include "Vhello.h"
+#include "verilated.h"
+
+int
+main(int argc, char **argv)
+{
+ VerilatedContext *cp = new VerilatedContext;
+ cp->commandArgs(argc, argv);
+ Vhello *top = new Vhello{cp};
+ while (!cp->gotFinish())
+ top->eval();
+ fprintf(stderr, "it finished.\n");
+}