diff --git a/Changes b/Changes index 053cbda98..0d40e8d85 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,8 @@ The contributors that suggested a given feature are shown in []. Thanks! ** Add simplistic class support with many restrictions, see manual, #377. +** Add --build to call make automatically, #2249. [Yutetsu TAKATSUKASA] + ** Configuring with ccache present now defaults to using it; see OBJCACHE. ** Fix DPI import/export to be standard compliant, #2236. [Geza Lore] diff --git a/bin/verilator b/bin/verilator index 2f554a77c..a361583f5 100755 --- a/bin/verilator +++ b/bin/verilator @@ -1867,20 +1867,17 @@ compiled Verilator, you need to point to the kit: Now we run Verilator on our little example. - verilator -Wall --cc our.v --exe sim_main.cpp + verilator -Wall --cc our.v --exe --build sim_main.cpp We can see the source code under the "obj_dir" directory. See the FILES section below for descriptions of some of the files that were created. ls -l obj_dir -We then can compile it - - make -j -C obj_dir -f Vour.mk Vour - (Verilator included a default compile rule and link rule, since we used ---exe and passed a .cpp file on the Verilator command line. You can also -write your own compile rules, as we'll show in the SYSTEMC section.) +--exe and passed a .cpp file on the Verilator command line. Verilator also +then used C to build a final executable. You can also write your own +compile rules, and run make yourself as we'll show in the SYSTEMC section.) And now we run it diff --git a/examples/cmake_hello_c/Makefile b/examples/cmake_hello_c/Makefile index 2e3120f65..03740f816 100644 --- a/examples/cmake_hello_c/Makefile +++ b/examples/cmake_hello_c/Makefile @@ -51,11 +51,11 @@ run: @echo "-- Verilator CMake hello world example" @echo - @echo "-- CMake ----------------" + @echo "-- VERILATE ----------------" mkdir -p build && cd build && cmake .. @echo - @echo "-- COMPILE -----------------" + @echo "-- BUILD -------------------" cmake --build build @echo diff --git a/examples/cmake_hello_sc/Makefile b/examples/cmake_hello_sc/Makefile index b63fe2d4b..c9405ce09 100644 --- a/examples/cmake_hello_sc/Makefile +++ b/examples/cmake_hello_sc/Makefile @@ -87,11 +87,11 @@ run: @echo "-- Verilator CMake SystemC hello-world simple example" @echo - @echo "-- CMake ----------------" + @echo "-- VERILATE ----------------" mkdir -p build && cd build && cmake .. @echo - @echo "-- COMPILE -----------------" + @echo "-- BUILD -------------------" cmake --build build @echo diff --git a/examples/cmake_protect_lib/Makefile b/examples/cmake_protect_lib/Makefile index 2e08b2a9a..6f43eab02 100644 --- a/examples/cmake_protect_lib/Makefile +++ b/examples/cmake_protect_lib/Makefile @@ -51,11 +51,11 @@ run: @echo "-- Verilator CMake protect_lib example" @echo - @echo "-- CMake ----------------" + @echo "-- VERILATE ----------------" mkdir -p build && cd build && cmake .. @echo - @echo "-- COMPILE -----------------" + @echo "-- BUILD -------------------" cmake --build build @echo diff --git a/examples/cmake_tracing_c/Makefile b/examples/cmake_tracing_c/Makefile index fe61cc730..14a518002 100644 --- a/examples/cmake_tracing_c/Makefile +++ b/examples/cmake_tracing_c/Makefile @@ -51,11 +51,11 @@ run: @echo "-- Verilator CMake tracing example" @echo - @echo "-- CMake ----------------" + @echo "-- VERILATE ----------------" mkdir -p build && cd build && cmake .. @echo - @echo "-- COMPILE -----------------" + @echo "-- BUILD -------------------" cmake --build build @echo diff --git a/examples/cmake_tracing_sc/Makefile b/examples/cmake_tracing_sc/Makefile index 6332ed2d5..fe59d8a16 100644 --- a/examples/cmake_tracing_sc/Makefile +++ b/examples/cmake_tracing_sc/Makefile @@ -87,11 +87,11 @@ run: @echo "-- Verilator CMake SystemC tracing example" @echo - @echo "-- CMake ----------------" + @echo "-- VERILATE ----------------" mkdir -p build && cd build && cmake .. @echo - @echo "-- COMPILE -----------------" + @echo "-- BUILD -------------------" cmake --build build @echo diff --git a/examples/make_hello_c/Makefile b/examples/make_hello_c/Makefile index 940c0bf25..2130e9756 100644 --- a/examples/make_hello_c/Makefile +++ b/examples/make_hello_c/Makefile @@ -36,10 +36,8 @@ endif default: @echo "-- Verilator hello-world simple example" - @echo "-- VERILATE ----------------" - $(VERILATOR) -cc --exe top.v sim_main.cpp - @echo "-- COMPILE -----------------" - $(MAKE) -j 4 -C obj_dir -f Vtop.mk + @echo "-- VERILATE & BUILD --------" + $(VERILATOR) -cc --exe --build -j top.v sim_main.cpp @echo "-- RUN ---------------------" obj_dir/Vtop @echo "-- DONE --------------------" diff --git a/examples/make_hello_sc/Makefile b/examples/make_hello_sc/Makefile index dc074b90e..3a4340017 100644 --- a/examples/make_hello_sc/Makefile +++ b/examples/make_hello_sc/Makefile @@ -45,10 +45,8 @@ endif run: @echo "-- Verilator hello-world simple example" - @echo "-- VERILATE ----------------" - $(VERILATOR) -sc --exe top.v sc_main.cpp - @echo "-- COMPILE -----------------" - $(MAKE) -j 4 -C obj_dir -f Vtop.mk + @echo "-- VERILATE & COMPILE ------" + $(VERILATOR) -sc --exe --build -j top.v sc_main.cpp @echo "-- RUN ---------------------" obj_dir/Vtop @echo "-- DONE --------------------" diff --git a/examples/make_tracing_c/Makefile b/examples/make_tracing_c/Makefile index ba4b30bc3..bd043c697 100644 --- a/examples/make_tracing_c/Makefile +++ b/examples/make_tracing_c/Makefile @@ -68,11 +68,13 @@ run: $(VERILATOR) $(VERILATOR_FLAGS) $(VERILATOR_INPUT) @echo - @echo "-- COMPILE -----------------" -# To compile, we can either just do what Verilator asks, -# or call a submakefile where we can override the rules ourselves -# $(MAKE) -j 4 -C obj_dir -f Vtop.mk - $(MAKE) -j 4 -C obj_dir -f ../Makefile_obj + @echo "-- BUILD -------------------" +# To compile, we can either +# 1. Pass --build to Verilator by editing VERILATOR_FLAGS above. +# 2. Or, run the make rules Verilator does: +# $(MAKE) -j -C obj_dir -f Vtop.mk +# 3. Or, call a submakefile where we can override the rules ourselves: + $(MAKE) -j -C obj_dir -f ../Makefile_obj @echo @echo "-- RUN ---------------------" diff --git a/examples/make_tracing_sc/Makefile b/examples/make_tracing_sc/Makefile index 4b91f5ddc..149d4238c 100644 --- a/examples/make_tracing_sc/Makefile +++ b/examples/make_tracing_sc/Makefile @@ -77,10 +77,12 @@ run: @echo @echo "-- COMPILE -----------------" -# To compile, we can either just do what Verilator asks, -# or call a submakefile where we can override the rules ourselves -# $(MAKE) -j 4 -C obj_dir -f Vtop.mk - $(MAKE) -j 4 -C obj_dir -f ../Makefile_obj +# To compile, we can either +# 1. Pass --build to Verilator by editing VERILATOR_FLAGS above. +# 2. Or, run the make rules Verilator does: +# $(MAKE) -j -C obj_dir -f Vtop.mk +# 3. Or, call a submakefile where we can override the rules ourselves: + $(MAKE) -j -C obj_dir -f ../Makefile_obj @echo @echo "-- RUN ---------------------"