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

Way to set CFLAGS for testbench code only #805

Closed
veripoolbot opened this issue Jul 20, 2014 · 2 comments
Closed

Way to set CFLAGS for testbench code only #805

veripoolbot opened this issue Jul 20, 2014 · 2 comments

Comments

@veripoolbot
Copy link

@veripoolbot veripoolbot commented Jul 20, 2014


Author Name: Jonathon Donaldson
Original Redmine Issue: 805 from https://www.veripool.org
Original Date: 2014-07-20


Is there a way to set special CFLAGS for the testbench code only (e.g. sim_main.cpp)? I'd like to try out some experimental CFLAGS for my testbench code but I don't want those flags affecting the verilator generated code. Is this possible?

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Jul 20, 2014


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2014-07-20T22:50:06Z


There isn't a command line way to do it, but you can just write your own makefile, including the verilator one. Then override the make rule for that file.

Roughly

include foo.mk
sim_main.o: sim_main.cpp

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Jul 20, 2014


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2014-07-20T22:51:26Z


(Sorry hit ctl-return too early)

There isn't a command line way to do it, but you can just write your own makefile, including the verilator one. Then override the make rule for that file.

Roughly

include foo.mk
sim_main.o: sim_main.cpp
    $(CC) flags... -o sim_main.o -c sim_main.cpp

Also see test_regress/Makefile_obj in the tarball which does exactly this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.