-
Notifications
You must be signed in to change notification settings - Fork 671
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
Unable to add VHDL sources to RFNoC block #828
Labels
Comments
@zacaric Thanks for reporting. This is indeed an issue. Looks like the regex for identifying files in Makefiles.srcs is borked (and the CMake regex engine makes it easier for this mistake to occur). A fix is on the way -- I just can't promise that it will make it into the upcoming release. |
FYI here's a fix: diff --git a/host/examples/rfnoc-gain/CMakeLists.txt b/host/examples/rfnoc-gain/CMakeLists.txt
index 2533f4155..8ecc49444 100644
--- a/host/examples/rfnoc-gain/CMakeLists.txt
+++ b/host/examples/rfnoc-gain/CMakeLists.txt
@@ -151,7 +151,11 @@ macro(RFNOC_REGISTER_BLOCK_DIR)
message(STATUS "Registering RFNoC block: ${_blk_name}")
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.srcs _makefile_srcs)
list(APPEND _block_src_files "Makefile.srcs")
- string(REGEX MATCHALL "[a-z0-9_]+\\.(s?v|vhdl?)" _src_files ${_makefile_srcs})
+ # Note: CMake uses an old regex engine that does not (among other things)
+ # support word boundaries. When changing this regex, make sure that it
+ # full captures intended file names. For example, file.v is a subset of
+ # file.vhd, so the regex should match file.vhd first.
+ string(REGEX MATCHALL "[a-z0-9_]+\\.(vhdl?|s?v)" _src_files ${_makefile_srcs})
foreach(_src_file ${_src_files})
string(STRIP "${_src_file}" _src_file})
list(APPEND _block_src_files "${_src_file}") |
That fixed it. Thanks so much for the quick response and help! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Description
I have some VHDL code that I would like to use in the top system verilog file for the block (
rfnoc_block_<block_name>.sv
), but when I try to add it to theRFNOC_BLOCK_<block_name>_SRCS
, it has the following error:add8bit.v
should beadd8bit.vhd
Setup Details
UHD 4.7.0.0-149-g635ad362
in aUbuntu 22.04
docker image.Expected Behavior
Able to use VHDL, Verilog, or System Verilog
Actual Behaviour
Only can use System Verilog for the top module and Verilog for all other modulesYou can use Verilog or System Verilog files, but not VHDL. Any
.vhd
file will become a.v
file inbuild/fpga/<oot_name>/rfnoc_block_<block_name>/cmake_install.cmake
The solution for now is to manually modify the extensions after this file is created
Steps to reproduce the problem
fpga/<oot_name>/rfnoc_block_<block_name>
calledadd8bit.vhd
and create a vhdl module calledadd8bit
. Here is some code for it for conveniencefpga/<oot_name>/rfnoc_block_<block_name>/rfnoc_block_<block_name>.sv
fpga/<oot_name>/rfnoc_block_<block_name>/Makefile.src
file like so:Additional Information
The text was updated successfully, but these errors were encountered: