Commentary on --build

This commit is contained in:
Wilson Snyder 2020-04-15 18:08:37 -04:00
parent 58091edd68
commit 9b8aebb00c
11 changed files with 33 additions and 34 deletions

View File

@ -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]

View File

@ -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<make> 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 --------------------"

View File

@ -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 --------------------"

View File

@ -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 ---------------------"

View File

@ -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 ---------------------"