Hello,
I am trying to create a custom RFNoC block for a USRP X310 (UHD_003.010.rfnoc-316-gb7546712). I have looked at the instructions on-line
for Getting Started and
RFNoC Specifications and they seem to say that all I should need to get the RFNoC block setup is a verilog, cpp, hpp, and xml file but this hasn't been the case.
I want my RFNoC block to be a copy of the default FIR block, so I copied the FIR verilog code, changed some of the variable names from 'FIR' to 'test' and gave it a unique NOC ID. I also edited the uhd/fpga-src/usrp3/top/x300/rfnoc_ce_auto_inst_x310.v file, replacing the fosphor block with the new test block.
Next I edited uhd/fpga-src/usrp3/lib/rfnoc/Makefile.srcs, adding a line for my noc_block_test.v.
I used then ran make X310_RFNOC_HGS (using Vivado 2015.2) to create my FPGA image which worked successfully and installed it onto the X310. Even though I was able to see the test block when running uhd_usrp_probe, the block did not appear in GNU Radio Companion.
-- ========== Full list of RFNoC blocks: ============
-- * 0/Radio_0
-- * 0/Radio_1
-- * 0/AddSub_0
-- * 0/FIR_0
-- * 0/FFT_0
-- * 0/Window_0
-- * 0/NullSrcSink_0
-- * 0/LogPwr_0
-- * 0/MovingAverage_0
-- * 0/VectorIIR_0
-- * 0/KeepOneInN_0
-- * 0/Test_0
-- * 0/FIFO_0
To try to get the block to appear in GRC I made copies of the cpp (uhd/host/lib/rfnoc/test_ctrl_impl.cpp), hpp (uhd/host/include/uhd/rfnoc/test_ctrl.hpp) and xml (uhd/host/include/uhd/rfnoc/blocks/test.xml) files used by the default FIR filter and again slightly customized them for my test block. After editing the files I also had to make changes to uhd/host/include/uhd/rfnoc/CMakeLists.txt and uhd/host/lib/rfnoc/CMakeLists.txt so that the new cpp and hpp files would be included when I rebuilt UHD. After rebuilding UHD the blocks still did not appear in GRC though.
To get the test block to appear in GRC I had to add files to my gr-ettus directory (gr-ettus/include/ettus/rfnoc_test_cci.h gr-ettus/lib/rfnoc_test_cci_impl.cc gr-ettus/lib/rfnoc_test_cci_impl.h gr-ettus/grc/uhd_rfnoc_test.xml) and update some makefiles (gr-ettus/include/ettus/CMakeLists.txt gr-ettus/lib/CMakeLists.txt gedit gr-ettus/build/grc/cmake_install.cmake). With the updated files, I rebuilt gr-ettus and the test block now appeared in GNU Radio Companion.
Now, even though I could add the test block to a flow graph when I tried to run the design I received an error about there being no module ettus.test. To fix this problem I had to edit gr-ettus/swig/ettus_swig.i and add lines for the test block. After rebuilding gr-ettus again the error went away, but was replaced with a new one: RuntimeError: Block control is not of requested type. I believe this error is caused by a lack of certain xml files. Looking in the directory gr-ettus/build/docs/doxygen/xml it contains files such as classgr_1_1ettus_1_1rfnoc__fir__cci.xml and classgr_1_1ettus_1_1rfnoc__fir__cci__impl.xml.
I have not found a way to generate similar xml files for my rfnoc test block. I am wondering how to generate these files, or if there is another method for creating a custom RFNoC block. I have looked at the instructions for creating out of tree modules using gr-modtool (
https://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules/5) and it did create the xml files I am looking for for the square_ff block but it seems to me that gr-modtool can only be used to create host layer blocks and not RFNoC blocks.
For summary these are all the files I edited or created:
uhd/fpga-src/usrp3/lib/rfnoc/noc_block_test.v
uhd/fpga-src/usrp3/top/x300/rfnoc_ce_auto_inst_x310.v
uhd/fpga-src/usrp3/lib/rfnoc/Makefile.srcs
uhd/host/include/uhd/rfnoc/test_ctrl.hpp
uhd/host/include/uhd/rfnoc/CMakeLists.txt
uhd/host/include/uhd/rfnoc/blocks/test.xml
uhd/host/lib/rfnoc/test_ctrl_impl.cpp
uhd/host/lib/rfnoc/CMakeLists.txt
gr-ettus/build/grc/cmake_install.cmake
gr-ettus/grc/uhd_rfnoc_test.xml
gr-ettus/include/ettus/CMakeLists.txt
gr-ettus/include/ettus/rfnoc_test_cci.h
gr-ettus/lib/rfnoc_test_cci_impl.cc
gr-ettus/lib/CMakeLists.txt
gr-ettus/swig/ettus_swig.i
Thank you,