From e3146a4830eeb07daf4688e1aae3690ff94db3e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Stensg=C3=A5rd?= Date: Sat, 26 Apr 2025 17:56:22 +0200 Subject: verilator_example_systemc: hello --- verilator_example_systemc/sc_main.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 verilator_example_systemc/sc_main.cc (limited to 'verilator_example_systemc/sc_main.cc') 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 + +#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; +} -- cgit v1.2.3