Examples: Clearer to define sc_time_stamp

This commit is contained in:
Wilson Snyder 2021-03-27 08:45:13 -04:00
parent 5b4448de23
commit d4d87ef300
3 changed files with 3 additions and 12 deletions

View File

@ -49,12 +49,6 @@ VERILATOR_FLAGS += --coverage
#VERILATOR_FLAGS += --debug
# Add this trace to get a backtrace in gdb
#VERILATOR_FLAGS += --gdbbt
# This example does not use vl_time_stamp but rather
# VerilatedContext::timeInc(), so to avoid a linker error on cygwin which
# does not support weak symbols, we need to define VL_TIME_CONTEXT *in CPP*
# to not compile in the vl_time_stamp using code.
VERILATOR_FLAGS += -CFLAGS -DVL_TIME_CONTEXT
# Input files for Verilator
VERILATOR_INPUT = -f input.vc top.v sim_main.cpp

View File

@ -45,12 +45,6 @@ OPT_FAST = -Os -fstrict-aliasing
#OPT_FAST = -O
#OPT_FAST =
#######################################################################
# Linking final exe -- presumes have a sim_main.cpp
# Special compile rule
sim_main.o: sim_main.cpp $(VM_PREFIX).h
######################################################################
######################################################################
# Automatically understand dependencies

View File

@ -14,6 +14,9 @@
// Include model header, generated from Verilating "top.v"
#include "Vtop.h"
// Legacy function required only so linking works on Cygwin and MSVC++
double sc_time_stamp() { return 0; }
int main(int argc, char** argv, char** env) {
// This is a more complicated example, please also see the simpler examples/make_hello_c.