From ba1f9f4eaa90aa786a714f8f8da6f0e95a6a6327 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 5 May 2024 21:20:01 +0800 Subject: Support Verilator target build to static library #5060 --- tests/projects/embed/verilator/static/src/sim_main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/projects/embed/verilator/static/src/sim_main.cpp (limited to 'tests/projects/embed/verilator/static/src/sim_main.cpp') 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; +} -- cgit v1.3.1