Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile for --sc --exe with --vpi fails to build #1081

Closed
veripoolbot opened this issue Aug 16, 2016 · 2 comments
Closed

Makefile for --sc --exe with --vpi fails to build #1081

veripoolbot opened this issue Aug 16, 2016 · 2 comments
Labels
resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Arthur Kahlich
Original Redmine Issue: 1081 from https://www.veripool.org


While I think this is something I can work around, it would be nice if it "just worked".

I took the SystemC example given in the documentation and just changed the verilator command line to:

followed by:

and I get a linker failure as follows:

```verilated_vpi.o: In function vpi_get_time': verilated_vpi.cpp:(.text+0x11e4): undefined reference to sc_time_stamp()'
verilated_vpi.o: In function `vpi_register_cb':
verilated_vpi.cpp:(.text+0x7ea3): undefined reference to `sc_time_stamp()'
collect2: ld returned 1 exit status


The reason for the undefined reference is because verilated_vpi.cpp in this case really needs

```#include "systemc.h"

before the #include "verilated.h" so that the VL_TIME_IQD macros used within it are defined by verilated.h to refer to the SystemC sc_time_stamp() that returns a class instead of the default for non-systemC that returns a double.

This could easily be fixed by adding to $VERILATOR_ROOT/include/verilated.mk a definition of:

VK_CPPFLAGS_WALL += -DVM_SC=$(VM_SC)
endif

and then adding before line 29 of $VERILATOR_ROOT/include/verilated_vpi.cpp :

#include "systemc.h"
#endif
@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2016-08-23T22:10:34Z


Thanks for the good bug report. This is fixed in git towards 3.888.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2016-11-05T12:51:21Z


In 3.888 (on 2016-10-14).

@veripoolbot veripoolbot added the resolution: fixed Closed; fixed label Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

1 participant