-
-
Notifications
You must be signed in to change notification settings - Fork 812
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
Adding Support for Verilog and SystemVerilog #3257
Comments
I will look at it later. |
Can you give me a hello world project with makefile? and where is the verilog and verilator? is this https://github.com/steveicarus/iverilog? |
I have supported it. #3274
Basicadd_requires("iverilog")
target("hello")
add_rules("iverilog.binary")
set_toolchains("@iverilog")
add_files("src/*.v") Set abstract configurationadd_requires("iverilog")
target("hello")
add_rules("iverilog.binary")
set_toolchains("@iverilog")
add_files("src/*.v")
add_defines("TEST")
add_includedirs("inc")
set_languages("v1800-2009") Set custom flagsadd_requires("iverilog")
target("hello")
add_rules("iverilog.binary")
set_toolchains("@iverilog")
add_files("src/*.v")
add_values("iverilogs.flags", "-DTEST") Build project$ xmake
checking for iverilog ... iverilog
checking for vvp ... vvp
[ 50%]: linking.iverilog hello.vvp
[100%]: build ok! Run with vvp$ xmake run
hello world!
LXT2 info: dumpfile hello.vcd opened for output.
src/main.v:6: $finish called at 0 (1s) |
How can I specify the generation of a vcd file via command parameters? I can't control the output path and I need to modify the code to generate it using dumpfile in the .v code. |
Verilator allows you to transpile verilog code into modern C++ or systemC, formal verification(lint) and iverilog is simulator only. |
But iverilog can also compile code directly, should I use Verilator or iverilog as a compiler? Also, I don't know how to specify the output path of vcd via the command line, it seems to be specified only in the code. |
Particularly, my unpleasant experience with icarus verilog was that it was slow compared to verilator in testbech. Note: iverolog can directly generate the binary, but verilator will always convert the code to C++( - Build a specific C project in the current directory:
verilator --binary --build-jobs 0 -Wall path/to/source.v
- Create a C++ executable in a specific folder:
verilator --cc --exe --build --build-jobs 0 -Wall path/to/source.cpp path/to/output.v
- Perform linting over a code in the current directory:
verilator --lint-only -Wall
- Create XML output about the design (files, modules, instance hierarchy, logic and data types) to feed into other tools:
verilator --xml-output -Wall path/to/output.xml
In the Verilator simply after executing the code get the VCD. |
thanks, I will look at it. |
Sorry for late replies. I can provide my working CMake configuration to you. Here's the repo link: https://github.com/BinhaoQin/verilator-demo |
I have supported both iverilog and verilator simulators. In addition, I have added support for them in compile_commands.json. iverilogSee the previous usage example above. verilatoradd_requires("verilator")
target("hello")
add_rules("verilator.binary")
set_toolchains("@verilator")
add_files("src/*.v")
add_files("src/*.cpp")
add_values("verilator.flags", "--trace", "--timing") /mnt/xmake/tests/projects/embed/verilator/hello_vcd$ xmake
checking for platform ... linux
checking for architecture ... x86_64
checking for verilator ... verilator
[ 0%]: compiling.verilog src/main.v
[ 11%]: cache compiling.release /home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated.cpp
[ 11%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__DepSet_h50fced7c__0__Slow.cpp
[ 11%]: cache compiling.release /home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated_threads.cpp
[ 11%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__DepSet_hac2b4ce6__0__Slow.cpp
[ 11%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__Slow.cpp
[ 11%]: cache compiling.release /home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated_vcd_c.cpp
[ 17%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello.cpp
[ 23%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__DepSet_hac2b4ce6__0.cpp
[ 29%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__DepSet_h50fced7c__0.cpp
[ 35%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello__Syms.cpp
[ 41%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello__Trace__0__Slow.cpp
[ 47%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello__Trace__0.cpp
[ 52%]: cache compiling.release src/sim_main.cpp
[ 88%]: linking.release hello
[100%]: build ok!
ruki@4db94baa81bc:/mnt/xmake/tests/projects/embed/verilator/hello_vcd$ xmake run hello /tmp/hello.vcd
hello world!
%Warning: $dumpvar ignored as not preceded by $dumpfile
- src/main.v:5: Verilog $finish /mnt/xmake/tests/projects/embed/verilator/hello_vcd$ xmake -rv
[ 0%]: compiling.verilog src/main.v
/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/bin/verilator --cc --make cmake --prefix hello --Mdir build/.gens/hello/linux/x86_64/release/rules/verilator --trace --timing src/main.v
[ 5%]: compiling.verilog src/main.v
/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/bin/verilator --cc --make cmake --prefix hello --Mdir build/.gens/hello/linux/x86_64/release/rules/verilator --trace --timing src/main.v
[ 11%]: cache compiling.release src/sim_main.cpp
/usr/bin/gcc -c -std=c++20 -Ibuild/.gens/hello/linux/x86_64/release/rules/verilator -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_THREADS=1 -DVM_TIMING=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -o build/.objs/hello/linux/x86_64/release/src/sim_main.cpp.o src/sim_main.cpp
[ 11%]: cache compiling.release /home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated.cpp
/usr/bin/gcc -c -std=c++20 -Ibuild/.gens/hello/linux/x86_64/release/rules/verilator -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_THREADS=1 -DVM_TIMING=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -o build/.objs/hello/linux/x86_64/release/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated.cpp.o /home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated.cpp
[ 11%]: cache compiling.release /home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated_vcd_c.cpp
/usr/bin/gcc -c -std=c++20 -Ibuild/.gens/hello/linux/x86_64/release/rules/verilator -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_THREADS=1 -DVM_TIMING=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -o build/.objs/hello/linux/x86_64/release/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated_vcd_c.cpp.o /home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated_vcd_c.cpp
[ 11%]: cache compiling.release /home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated_threads.cpp
/usr/bin/gcc -c -std=c++20 -Ibuild/.gens/hello/linux/x86_64/release/rules/verilator -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_THREADS=1 -DVM_TIMING=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -o build/.objs/hello/linux/x86_64/release/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated_threads.cpp.o /home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated_threads.cpp
[ 11%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__Slow.cpp
/usr/bin/gcc -c -std=c++20 -Ibuild/.gens/hello/linux/x86_64/release/rules/verilator -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_THREADS=1 -DVM_TIMING=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello___024root__Slow.cpp.o build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__Slow.cpp
[ 11%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__DepSet_hac2b4ce6__0__Slow.cpp
/usr/bin/gcc -c -std=c++20 -Ibuild/.gens/hello/linux/x86_64/release/rules/verilator -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_THREADS=1 -DVM_TIMING=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello___024root__DepSet_hac2b4ce6__0__Slow.cpp.o build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__DepSet_hac2b4ce6__0__Slow.cpp
[ 17%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__DepSet_h50fced7c__0__Slow.cpp
/usr/bin/gcc -c -std=c++20 -Ibuild/.gens/hello/linux/x86_64/release/rules/verilator -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_THREADS=1 -DVM_TIMING=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello___024root__DepSet_h50fced7c__0__Slow.cpp.o build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__DepSet_h50fced7c__0__Slow.cpp
[ 41%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello.cpp
/usr/bin/gcc -c -std=c++20 -Ibuild/.gens/hello/linux/x86_64/release/rules/verilator -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_THREADS=1 -DVM_TIMING=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello.cpp.o build/.gens/hello/linux/x86_64/release/rules/verilator/hello.cpp
[ 41%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__DepSet_hac2b4ce6__0.cpp
/usr/bin/gcc -c -std=c++20 -Ibuild/.gens/hello/linux/x86_64/release/rules/verilator -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_THREADS=1 -DVM_TIMING=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello___024root__DepSet_hac2b4ce6__0.cpp.o build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__DepSet_hac2b4ce6__0.cpp
[ 41%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__DepSet_h50fced7c__0.cpp
/usr/bin/gcc -c -std=c++20 -Ibuild/.gens/hello/linux/x86_64/release/rules/verilator -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_THREADS=1 -DVM_TIMING=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello___024root__DepSet_h50fced7c__0.cpp.o build/.gens/hello/linux/x86_64/release/rules/verilator/hello___024root__DepSet_h50fced7c__0.cpp
[ 41%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello__Syms.cpp
/usr/bin/gcc -c -std=c++20 -Ibuild/.gens/hello/linux/x86_64/release/rules/verilator -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_THREADS=1 -DVM_TIMING=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello__Syms.cpp.o build/.gens/hello/linux/x86_64/release/rules/verilator/hello__Syms.cpp
[ 47%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello__Trace__0__Slow.cpp
/usr/bin/gcc -c -std=c++20 -Ibuild/.gens/hello/linux/x86_64/release/rules/verilator -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_THREADS=1 -DVM_TIMING=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello__Trace__0__Slow.cpp.o build/.gens/hello/linux/x86_64/release/rules/verilator/hello__Trace__0__Slow.cpp
[ 52%]: cache compiling.release build/.gens/hello/linux/x86_64/release/rules/verilator/hello__Trace__0.cpp
/usr/bin/gcc -c -std=c++20 -Ibuild/.gens/hello/linux/x86_64/release/rules/verilator -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include -I/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_THREADS=1 -DVM_TIMING=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello__Trace__0.cpp.o build/.gens/hello/linux/x86_64/release/rules/verilator/hello__Trace__0.cpp
[ 88%]: linking.release hello
/usr/bin/g++ -o build/linux/x86_64/release/hello build/.objs/hello/linux/x86_64/release/src/sim_main.cpp.o build/.objs/hello/linux/x86_64/release/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated.cpp.o build/.objs/hello/linux/x86_64/release/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated_vcd_c.cpp.o build/.objs/hello/linux/x86_64/release/home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated_threads.cpp.o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello___024root__Slow.cpp.o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello___024root__DepSet_hac2b4ce6__0__Slow.cpp.o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello___024root__DepSet_h50fced7c__0__Slow.cpp.o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello.cpp.o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello___024root__DepSet_hac2b4ce6__0.cpp.o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello___024root__DepSet_h50fced7c__0.cpp.o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello__Syms.cpp.o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello__Trace__0__Slow.cpp.o build/.objs/hello/linux/x86_64/release/gens/rules/verilator/hello__Trace__0.cpp.o -lpthread
[100%]: build ok! |
add_requires("verilator")
target("Vregister_test")
add_rules("verilator.binary")
set_toolchains("@verilator")
add_files("*.v")
add_files("simulation/*.cpp")
add_values("verilator.flags", "-GWIDTH=4", "--trace", "--timing") verilator-demo$ xmake
[ 0%]: compiling.verilog register_test.v
[ 0%]: compiling.verilog register.v
[ 5%]: compiling.verilog register_test.v
[ 5%]: compiling.verilog register.v
[ 10%]: cache compiling.release simulation/main.cpp
[ 10%]: cache compiling.release /home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated.cpp
[ 10%]: cache compiling.release /home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated_vcd_c.cpp
[ 10%]: cache compiling.release /home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated_timing.cpp
[ 10%]: cache compiling.release /home/ruki/.xmake/packages/v/verilator/2023.1.10/e75fe612bb12409694b6e09b14731d42/share/verilator/include/verilated_threads.cpp
[ 10%]: cache compiling.release build/.gens/Vregister_test/linux/x86_64/release/rules/verilator/Vregister_test___024root__Slow.cpp
[ 15%]: cache compiling.release build/.gens/Vregister_test/linux/x86_64/release/rules/verilator/Vregister_test___024root__DepSet_h21587979__0__Slow.cpp
[ 20%]: cache compiling.release build/.gens/Vregister_test/linux/x86_64/release/rules/verilator/Vregister_test___024root__DepSet_h252a163f__0__Slow.cpp
[ 25%]: cache compiling.release build/.gens/Vregister_test/linux/x86_64/release/rules/verilator/Vregister_test___024unit__Slow.cpp
[ 30%]: cache compiling.release build/.gens/Vregister_test/linux/x86_64/release/rules/verilator/Vregister_test___024unit__DepSet_h58c8ecdb__0__Slow.cpp
[ 35%]: cache compiling.release build/.gens/Vregister_test/linux/x86_64/release/rules/verilator/Vregister_test.cpp
[ 40%]: cache compiling.release build/.gens/Vregister_test/linux/x86_64/release/rules/verilator/Vregister_test___024root__DepSet_h21587979__0.cpp
[ 45%]: cache compiling.release build/.gens/Vregister_test/linux/x86_64/release/rules/verilator/Vregister_test___024root__DepSet_h252a163f__0.cpp
[ 50%]: cache compiling.release build/.gens/Vregister_test/linux/x86_64/release/rules/verilator/Vregister_test__Syms.cpp
[ 55%]: cache compiling.release build/.gens/Vregister_test/linux/x86_64/release/rules/verilator/Vregister_test__Trace__0__Slow.cpp
[ 60%]: cache compiling.release build/.gens/Vregister_test/linux/x86_64/release/rules/verilator/Vregister_test__Trace__0.cpp
[ 90%]: linking.release Vregister_test
[100%]: build ok!
verilator-demo$ xmake run
%Warning: $dumpvar ignored as not preceded by $dumpfile
Time: 0:: reset: 1, D: 1111, Q: 0000
Time: 5:: reset: 1, D: 1111, Q: 0000
Time: 10:: reset: 1, D: 1111, Q: 0000
Time: 10:: reset: 1, D: 1111, Q: 0000
Time: 15:: reset: 1, D: 1111, Q: 0000
Time: 20:: reset: 0, D: 1111, Q: 0000
Time: 20:: reset: 0, D: 1111, Q: 0000
Time: 25:: reset: 0, D: 1111, Q: 1111
Time: 30:: reset: 0, D: 1111, Q: 1111
Time: 30:: reset: 0, D: 1111, Q: 1111
Time: 35:: reset: 0, D: 1111, Q: 1111
- register_test.v:36: Verilog $finish
Time: 40:: reset: 0, D: 1111, Q: 1111
Time: 40:: reset: 0, D: 1111, Q: 1111 |
How to test it? # update to iverilog branch version
xmake update -s github:xmake-io/xmake#iverilog
# update xmake repository
xrepo update-repo
# build and run example
cd xmake/tests/project/embed/verilator/hello
xmake
xmake run |
It work fine on linux/macOS now. But I'm having some problems on windows, and I'm not sure what's causing the problem at the moment. verilator/verilator#3873 |
For the issue #3873, Perhaps the compilation command does not specify a top module? I'm not really sure if it is the issue. |
I try setting it. It still does not work. |
I have also supported for windows on dev branch now. |
Is your feature request related to a problem? Please describe.
Recently, I'm developing for some FPGA using Verilog, which is a Hardware Description Language. Common setup for Verilog uses Makefile to automate simulation and synthesize using a Verilog "compiler", e.g.,
iverilog
orverilator
. Then, the module and testbenches would be "compiled" (simulation output) to a VCD (Value Change Dump) file which is able to generate waveforms. Therefore, I'm wondering ifxmake
could also support similar feature out-of-box.Describe the solution you'd like
In order to port to current architecture of
xmake
, I suggest takingiverilog
andverilator
as "compiler" chains, and treat simulation as "build" task. The simulation testbenches are the same as boilerplate code in testing in C/C++. Similarly, the Verilog code can also be build without testbenches, which is called synthesize, which produce something similar to LLVM IR for FPGAs. This is the same as building the main part of a C/C++ project. Therefore, I'm thinking of anxmake
file like this:Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: