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

Support running make and creating top C file #593

Closed
veripoolbot opened this issue Dec 19, 2012 · 4 comments
Closed

Support running make and creating top C file #593

veripoolbot opened this issue Dec 19, 2012 · 4 comments
Labels
area: usability Issue involves general usability resolution: wontfix Closed; work won't continue on an issue or pull request

Comments

@veripoolbot
Copy link
Contributor


Author Name: Wojciech Koszek
Original Redmine Issue: 593 from https://www.veripool.org


I would like to use Verilator for my development. I use Icarus Verilog now.

Typical use case for me is to: start 1 .v file, add 3 lines,
compile/simulate, add 3 more lines, compile/simulate, etc..

Icarus makes it relatively easy:

     iverilog file.v -o file

Verilator isn't too competitive. I do understand more difficult use
scenario that you picked might be because willingness to deal with only those users
who spend time on studying Verilator, but honestly I can't start doing
stuff like what I described quickly with Verilator.

So 2 things which I'd like to see:

  • Verilator --cp option should generate some form of ready-to-use .cpp
    wrapper so that the sources in obj_dir are ready to be compiled

  • Verilator with -o switch should probably start the compiler
    automatically
    and build everything for me.

Basically whatever VCS is doing I'd like to see in Verilator

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2013-01-01T00:12:07Z


I agree with the intent of making it easier to compile and run.

There's a few complicating decisions....

What does Verilator do to make the top level? Since verilator doesn't make it's own clocks, the model being generated can have no inputs which implies a fairly trivial model. This would be a lot more valuable when a event model is added.

Presumably Verilator would need to call 'make'. This requires subshell process management, and the addition of appropriate -make-option-flags or somesuch for passing to make. Also, what does Verilator do on Windows and machines without gmake?

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wojciech Koszek
Original Date: 2013-01-03T04:52:02Z


Wilson,

Typically it's up to me to generate the clocks, so Verilator shouldn't be any different in that case. In my design, in a test-bench, I typically have:

always clk_reg = #(CLK_PERIOD) ~clk_reg;

And this is my clock. This is what you meant?

In terms of calling "make" -- this could be left to user, if necessary. Verilator for:

verilator file.c -o output

could generate directory file.dir with .c/.h stuff and shell script "output", which would invoke make with necessary arguments. file.dir would have a plain "makefile", which is handled by GNU/BSD make as well as Microsoft "nmake". Or it could just geneate output.c, output.h, output.makefile in the current directory. There's lots of options.

I wouldn't worry about bringing support for all possible systems at once. I assume you can't use Verilator nowadays on Windows machines without C compiler anyway, so suggested feature wouldn't change too much.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-10-09T01:28:58Z


Verilating and making can be done with cmake which is soon to be completed.

Making a main.cpp needs timescales, which is going to be an (even longer) wait, so closing out due to age.

@veripoolbot veripoolbot added area: usability Issue involves general usability resolution: wontfix Closed; work won't continue on an issue or pull request labels Dec 22, 2019
@wsnyder
Copy link
Member

wsnyder commented Apr 15, 2020

Note making (--build option) is in git, towards version 4.034.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: usability Issue involves general usability resolution: wontfix Closed; work won't continue on an issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants