Hey David, this looks like you've gotten pretty far on a sophisticated project! I have a few observations:
- At first glance, your C++ looks correct. - I would expect samples to arrive at your block synchronously based on that. However, maybe I'm forgetting something that would cause the outputs of the DDCs to misalign data by a few clock cycles. Which makes me wonder: Are you sure your input packets are misaligned? In RFNoC, we make no guarantee that the output of the DDC (or any other) block is aligned to the clock cycle, because we encode the timestamp with the data. Meaning that the first, actual sample that arrives at your block on each channel is in fact time-aligned, they just arrive a few clock cycles apart. This is the same logic that applies when packets arrive at the host computer, where we make no assumptions that they arrive at the exact same time. - If this is the issue, I think we have some modules you can use to actually align samples within your block, or you just do some AXI alignment yourself by combining the tready and tvalid signals of two streams. - Side note, although it's not important: I would consider it a best practice to have your block call set_action_forwarding_policy(forwarding_policy_t::ONE_TO_FAN, "stream_cmd") so it would properly forward stream commands, and then you can plop the stream command into the streamer. --M On Sun, Dec 15, 2024 at 10:49 PM David <vitishlsfa...@gmail.com> wrote: > Hello all, > > I apologize in advance for data dumping. I have made a 2 input/1 output > RFNoC block that requires repeatable synchronized DDC starts. My current > method of starting the DDC is not working as desired. > > *Question - **How can I correctly start both DDC's so samples are > available on the same clock cycle, similar to the rx_samples_to_file, while > still using my 2 in/1 out RFNoC block? * > I would like to focus the conversation on my C++ implementation for now. > All my simulations have convinced me my block is consuming AXI-Stream data > correctly. > > *Problem* > When starting two DDCs with timed commands sent to DDC in my C++ > application, I am not getting the same result as the > rx_samples_to_file.cpp... rx_samples_to_file has repeatable alignment, and > mine has random. This has led me to believe the problem is in my > application and not my block. My Vivado simulations show my block is able > to consume the AXI-Stream transactions in parallel as I expect. > > Considering sampling noise from a sig gen that is split to both inputs, I > see the following behavior: > rx_samples_to_file (base image) davids_samples_to_file (custom image) > DDC A samples ... X_1 Y_1 Z_1 ... DDC A samples ... X_1 Y_1 Z_1 ... > DDC B samples ... X_2 Y_2 Z_2 ... DDC B samples X_2 Y_2 Z_2 ... ... > > *sample_1 is not equal to sample_2, but over a large number of samples > they will correlate well. > > In the above example, the noise correlates as expected, but it is delayed > by 1 sample. When using my application, I have seen no delay (desired), and > also delay in the range of 5 samples. > > *C++ Implementation* > [image: image.png] > > I am using* uhd::rfnoc::ddc_block_control* types to issue the stream > command because I was having issues with my block propagating. Issuing to > the DDCs lets the data flow from 2 inputs to the 1 output, where the output > is either a file or loopback to transmit. > > The base image with rx_samples_to_file uses a multi_usrp type, which > propagates the stream command from the rx_streamer. > > *RFNoC laydown* > > [image: image.png] > > Data flows in both Tx loopback configuration and Rx to file configuration. > > *Methods and Symptoms* > I have two methods of measuring the synchronization, with data collected > by ILA cores at either the output of DDC or input of custom block: > > 1. *Math: *When receiving correlated noise, I can measure the cross > correlation and show that the correlation peaks as expected, and show the > delay between channels in samples. > 2. *Vivado Waveform Viewer*: When the ILA cores are collecting DDC > channel data, I can see that the base image samples are available on the > same clock. My image does not have that behavior. > > > Thanks, > > David > > > > _______________________________________________ > USRP-users mailing list -- usrp-users@lists.ettus.com > To unsubscribe send an email to usrp-users-le...@lists.ettus.com >
_______________________________________________ USRP-users mailing list -- usrp-users@lists.ettus.com To unsubscribe send an email to usrp-users-le...@lists.ettus.com