summaryrefslogtreecommitdiff
path: root/verilator_example_systemc/sc_main.cc
blob: 0634207c2130384455593f6ced3b6bd5cb69798d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;
}