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
Comments
Original Redmine Comment 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? |
Original Redmine Comment 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. |
Original Redmine Comment 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. |
Note making (--build option) is in git, towards version 4.034. |
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:
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
The text was updated successfully, but these errors were encountered: