Skip to content
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

Is ventus RTL code now expected to be tested by OpenCL and higher level API users? #7

Open
fxzjshm opened this issue Nov 9, 2024 · 0 comments

Comments

@fxzjshm
Copy link

fxzjshm commented Nov 9, 2024

我在试图通过 verilating driver 在 ventus 上运行一些实际的负载, 但遇到了一些问题. 注意到 PoCL 中目前还是链接到 spike_driver 而不是 rtldriver, 那请问对于 OpenCL 以及用更上层 API 的开发者来说, ventus 的 RTL 目前是否被期望可用来测试?

I'm trying running some actual workload on ventus through verilating driver but have encountered some problems. Noticing that PoCL is now still linking to spike_driver instead of rtldriver, then is RTL code of ventus now expected to be tested by developers of OpenCL and higher level APIs?


遇到的一些问题
Some issues encountered:

1. 不能使用较新的 ventus-gpgpu 生成的代码 cannot use code generated by newer versions of ventus-gpgpu

把最近版本的 ventus-gpgpu 编译生成的 SystemVerilog 代码复制到本仓库目录的 rtl/ 下并相应修改 CMakeLists.txt
Copy SystemVerilog code generated by recent versions of ventus-gpgpu and modify CMakeLists.txt accordingly

diff --git a/devices/verilating_device/CMakeLists.txt b/devices/verilating_device/CMakeLists.txt
index 048e33c..d3c13bc 100644
--- a/devices/verilating_device/CMakeLists.txt
+++ b/devices/verilating_device/CMakeLists.txt
@@ -11,10 +11,11 @@ include_directories(${CMAKE_SOURCE_DIR}/common)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/page_table)
 file(GLOB_RECURSE SRCS "*.cpp" "${CMAKE_SOURCE_DIR}/common/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/page_table/*")
-file(GLOB RTL_SRC "${RTL_DIR}/${TOP}.v")
+file(GLOB RTL_SRC "${RTL_DIR}/${TOP}.sv")
 
 #message(${SRCS})
 
-set(CXX_FLAGS -std=c++11 -Wall -Wextra -Wfatal-errors -Wno-array-bounds
+set(CXX_FLAGS -std=c++20 -Wall -Wextra -Wfatal-errors -Wno-array-bounds
                     -Wno-maybe-uninitialized
                     -I${CMAKE_SOURCE_DIR}/include
                     -I${CMAKE_SOURCE_DIR}/common
@@ -28,7 +29,7 @@ execute_process(COMMAND python -c "import multiprocessing as mp; print(mp.cpu_co
 
 set(VL_FLAGS
             --cc ${TOP} --top-module ${TOP} -O2 --language 1800-2009 --assert -Wall -Wpedantic
-            -Wno-DECLFILENAME -Wno-REDEFMACRO -Wno-MODDUP -Wno-UNUSEDSIGNAL
+            -Wno-DECLFILENAME -Wno-REDEFMACRO -Wno-MODDUP -Wno-UNUSEDSIGNAL -Wno-PINCONNECTEMPTY -Wno-UNOPTTHREADS
             --x-initial unique --x-assign unique
 #            --lib-create ${PROJECT2}
             --debug --trace-structs

但有编译错误, 一部分是信号名称有改动 (io_out_a_bits_address -> io_out_a_0_bits_address), 还有一部分是变量类型不匹配.
But there are compile errors. Some are modifications of signal names (io_out_a_bits_address -> io_out_a_0_bits_address) and some are variable type mismatch.

2. 新版 Verilator 需要使用更新的 C++ 来编译 Newer versions of Verilator requires newer standards of C++

error: use of undeclared identifier 'std::exchange'; did you mean 'std::__exchange'?

解决方法: 把 CMakelists.txt 里的 set(CMAKE_CXX_STANDARD 11) 改成比如 20, -std=c++11 改成比如 20
Solution / Workaround: replace set(CMAKE_CXX_STANDARD 11) with e.g. 20 and -std=c++11 with e.g. 20 in CMakelists.txt

3. rtldriver 没有 vt_one_buf_free | rtldriver has no vt_one_buf_free

./vecadd: symbol lookup error: /home/user/workspace/ventus/llvm-ventus/install/lib/pocl/libpocl-devices-ventus.so: undefined symbol: vt_one_buf_free
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant