forked from github/verilator
Commentary on --build
This commit is contained in:
parent
58091edd68
commit
9b8aebb00c
2
Changes
2
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 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.
|
** Configuring with ccache present now defaults to using it; see OBJCACHE.
|
||||||
|
|
||||||
** Fix DPI import/export to be standard compliant, #2236. [Geza Lore]
|
** Fix DPI import/export to be standard compliant, #2236. [Geza Lore]
|
||||||
|
@ -1867,20 +1867,17 @@ compiled Verilator, you need to point to the kit:
|
|||||||
|
|
||||||
Now we run Verilator on our little example.
|
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
|
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.
|
section below for descriptions of some of the files that were created.
|
||||||
|
|
||||||
ls -l obj_dir
|
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
|
(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
|
--exe and passed a .cpp file on the Verilator command line. Verilator also
|
||||||
write your own compile rules, as we'll show in the SYSTEMC section.)
|
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
|
And now we run it
|
||||||
|
|
||||||
|
@ -51,11 +51,11 @@ run:
|
|||||||
@echo "-- Verilator CMake hello world example"
|
@echo "-- Verilator CMake hello world example"
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
@echo "-- CMake ----------------"
|
@echo "-- VERILATE ----------------"
|
||||||
mkdir -p build && cd build && cmake ..
|
mkdir -p build && cd build && cmake ..
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
@echo "-- COMPILE -----------------"
|
@echo "-- BUILD -------------------"
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
|
@ -87,11 +87,11 @@ run:
|
|||||||
@echo "-- Verilator CMake SystemC hello-world simple example"
|
@echo "-- Verilator CMake SystemC hello-world simple example"
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
@echo "-- CMake ----------------"
|
@echo "-- VERILATE ----------------"
|
||||||
mkdir -p build && cd build && cmake ..
|
mkdir -p build && cd build && cmake ..
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
@echo "-- COMPILE -----------------"
|
@echo "-- BUILD -------------------"
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
|
@ -51,11 +51,11 @@ run:
|
|||||||
@echo "-- Verilator CMake protect_lib example"
|
@echo "-- Verilator CMake protect_lib example"
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
@echo "-- CMake ----------------"
|
@echo "-- VERILATE ----------------"
|
||||||
mkdir -p build && cd build && cmake ..
|
mkdir -p build && cd build && cmake ..
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
@echo "-- COMPILE -----------------"
|
@echo "-- BUILD -------------------"
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
|
@ -51,11 +51,11 @@ run:
|
|||||||
@echo "-- Verilator CMake tracing example"
|
@echo "-- Verilator CMake tracing example"
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
@echo "-- CMake ----------------"
|
@echo "-- VERILATE ----------------"
|
||||||
mkdir -p build && cd build && cmake ..
|
mkdir -p build && cd build && cmake ..
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
@echo "-- COMPILE -----------------"
|
@echo "-- BUILD -------------------"
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
|
@ -87,11 +87,11 @@ run:
|
|||||||
@echo "-- Verilator CMake SystemC tracing example"
|
@echo "-- Verilator CMake SystemC tracing example"
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
@echo "-- CMake ----------------"
|
@echo "-- VERILATE ----------------"
|
||||||
mkdir -p build && cd build && cmake ..
|
mkdir -p build && cd build && cmake ..
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
@echo "-- COMPILE -----------------"
|
@echo "-- BUILD -------------------"
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
|
@ -36,10 +36,8 @@ endif
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
@echo "-- Verilator hello-world simple example"
|
@echo "-- Verilator hello-world simple example"
|
||||||
@echo "-- VERILATE ----------------"
|
@echo "-- VERILATE & BUILD --------"
|
||||||
$(VERILATOR) -cc --exe top.v sim_main.cpp
|
$(VERILATOR) -cc --exe --build -j top.v sim_main.cpp
|
||||||
@echo "-- COMPILE -----------------"
|
|
||||||
$(MAKE) -j 4 -C obj_dir -f Vtop.mk
|
|
||||||
@echo "-- RUN ---------------------"
|
@echo "-- RUN ---------------------"
|
||||||
obj_dir/Vtop
|
obj_dir/Vtop
|
||||||
@echo "-- DONE --------------------"
|
@echo "-- DONE --------------------"
|
||||||
|
@ -45,10 +45,8 @@ endif
|
|||||||
|
|
||||||
run:
|
run:
|
||||||
@echo "-- Verilator hello-world simple example"
|
@echo "-- Verilator hello-world simple example"
|
||||||
@echo "-- VERILATE ----------------"
|
@echo "-- VERILATE & COMPILE ------"
|
||||||
$(VERILATOR) -sc --exe top.v sc_main.cpp
|
$(VERILATOR) -sc --exe --build -j top.v sc_main.cpp
|
||||||
@echo "-- COMPILE -----------------"
|
|
||||||
$(MAKE) -j 4 -C obj_dir -f Vtop.mk
|
|
||||||
@echo "-- RUN ---------------------"
|
@echo "-- RUN ---------------------"
|
||||||
obj_dir/Vtop
|
obj_dir/Vtop
|
||||||
@echo "-- DONE --------------------"
|
@echo "-- DONE --------------------"
|
||||||
|
@ -68,11 +68,13 @@ run:
|
|||||||
$(VERILATOR) $(VERILATOR_FLAGS) $(VERILATOR_INPUT)
|
$(VERILATOR) $(VERILATOR_FLAGS) $(VERILATOR_INPUT)
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
@echo "-- COMPILE -----------------"
|
@echo "-- BUILD -------------------"
|
||||||
# To compile, we can either just do what Verilator asks,
|
# To compile, we can either
|
||||||
# or call a submakefile where we can override the rules ourselves
|
# 1. Pass --build to Verilator by editing VERILATOR_FLAGS above.
|
||||||
# $(MAKE) -j 4 -C obj_dir -f Vtop.mk
|
# 2. Or, run the make rules Verilator does:
|
||||||
$(MAKE) -j 4 -C obj_dir -f ../Makefile_obj
|
# $(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
|
||||||
@echo "-- RUN ---------------------"
|
@echo "-- RUN ---------------------"
|
||||||
|
@ -77,10 +77,12 @@ run:
|
|||||||
|
|
||||||
@echo
|
@echo
|
||||||
@echo "-- COMPILE -----------------"
|
@echo "-- COMPILE -----------------"
|
||||||
# To compile, we can either just do what Verilator asks,
|
# To compile, we can either
|
||||||
# or call a submakefile where we can override the rules ourselves
|
# 1. Pass --build to Verilator by editing VERILATOR_FLAGS above.
|
||||||
# $(MAKE) -j 4 -C obj_dir -f Vtop.mk
|
# 2. Or, run the make rules Verilator does:
|
||||||
$(MAKE) -j 4 -C obj_dir -f ../Makefile_obj
|
# $(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
|
||||||
@echo "-- RUN ---------------------"
|
@echo "-- RUN ---------------------"
|
||||||
|
Loading…
Reference in New Issue
Block a user