EttusResearch / uhd

The USRP™ Hardware Driver Repository
http://uhd.ettus.com
Other
1k stars 667 forks source link

rfnoc_modtool create and add requires some work after #813

Open zacaric opened 6 days ago

zacaric commented 6 days ago

Issue Description

I am using rfnoc_modtool to create an oot module called core and a block called square (squares the IQ data).

When doing this, there are a few issues that causes things to not work right away and requires changes right out of the box (See Actual Behavior to see what changes are required to get working). Some of the items in the list I can understand needing to do, but other items I feel should have been handled by rfnoc_modtool when generating the files.

Setup Details

UHD 4.7.0.0-149-g635ad362, Ubuntu 22.04, Vivado 2021.2 AR76780

Expected Behavior

Expected for files generated from rfnoc_modtool to work out of the box with little modification. Also expected adding an icore file would also work out of the box. Little modification is understandable, but some documentation on that would be helpful.

Actual Behavior

The following files require modification:

Even after doing this, I am still getting the following error: UPDATE: Found out the following error had to do with an incorrect path in my square.yml file and not the rfnoc_modtool

⛔   Error evaluating square0: File fpga/square/rfnoc_block_square/Makefile.srcs not found in include paths: ['/workspaces/rfnoc-project-example/src/oot/rfnoc-core', '/usr/local/share/uhd/rfnoc']
⛔   Image configuration contains issues: Skipping build. Use --ignore-warnings to build despite warnings.

Steps to reproduce the problem

rfnoc_modtool create core
cd rfnoc-core
rfnoc_modtool add square

# Next, do these steps
# 1. copy x310_rfnoc_image_core.yml from the gain example
# 2. change any instance of "gain" to "square"

mkdir build
cd build
cmake -DUHD_FPGA_DIR=/uhd/fpga ../
make # This fails require files to be modified
make install
make x310_rfnoc_image_core # This fails requiring even more files to be modified

Additional Information

I am running all of this in a docker image (using Ubuntu 22.04 as the base). I was able to get the rfnoc_gain example working in this docker image.

mbr0wn commented 14 hours ago

@zacaric Thanks for this super helpful report. FYI, we generate the OOT sources from rfnoc-gain, so that explains some of the issues, but not all of them. We're investigating and will provide a fix soon.

zacaric commented 12 hours ago

Another modification I had to make afterwards was to add a comma on line 182 of rfnoc-core/fpga/core/rfnoc_block_square/rfnoc_block_square.sv. Same thing with rfnoc-core/fpga/core/rfnoc_block_square/noc_shell_square.sv on line 116.

I will add this to the description as well to keep these needed modifications in one place

mbr0wn commented 12 hours ago

@zacaric do you have f0066cf16d3050c904edef8b5b70a7e2a34cd2ec? That should take care of the noc_shell fixes.

zacaric commented 11 hours ago

It seems like I do have those changes. I have my docker image setup to grab the latest code on the master branch every time it gets built and I rebuilt the image yesterday. So it should be running to most up to date version on master (UHD 4.7.0.0-149-g635ad362).

I also found some errors with double quotes (") not being around HDL_IP in a couple of the files. I added that to the issue description too.

ip_option I think should also be changed to IP_OPTION in those files since that is what it is in the Gain example, but it doesn't really break anything so I am not adding it in the description.

I also added that rfnoc-core/lib/square_block_control.cpp needs to be changed from "Gain" to "Square" on line 30