summaryrefslogtreecommitdiff
path: root/tests/projects/embed/verilator/static/src/sim_main.cpp
diff options
context:
space:
mode:
authorruki <[email protected]>2024-05-05 21:20:01 +0800
committerruki <[email protected]>2024-05-05 21:21:16 +0800
commitba1f9f4eaa90aa786a714f8f8da6f0e95a6a6327 (patch)
tree7f77b353f03a8a6ffca7fc389af9d645a8562bc6 /tests/projects/embed/verilator/static/src/sim_main.cpp
parent382b22c3d6ec529bf085aaa7498c39dd83758e69 (diff)
Support Verilator target build to static library #5060
Diffstat (limited to 'tests/projects/embed/verilator/static/src/sim_main.cpp')
-rw-r--r--tests/projects/embed/verilator/static/src/sim_main.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/projects/embed/verilator/static/src/sim_main.cpp b/tests/projects/embed/verilator/static/src/sim_main.cpp
new file mode 100644
index 000000000..44cb1da1f
--- /dev/null
+++ b/tests/projects/embed/verilator/static/src/sim_main.cpp
@@ -0,0 +1,12 @@
+#include "hello.h"
+#include "verilated.h"
+
+int main(int argc, char** argv) {
+ VerilatedContext* contextp = new VerilatedContext;
+ contextp->commandArgs(argc, argv);
+ hello* top = new hello{contextp};
+ while (!contextp->gotFinish()) { top->eval(); }
+ delete top;
+ delete contextp;
+ return 0;
+}