discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] problem with custom RFNoC block output in GRC


From: Martin Braun
Subject: Re: [Discuss-gnuradio] problem with custom RFNoC block output in GRC
Date: Mon, 18 Jan 2016 13:34:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

I think the issue is that mixing GNU Radio + RFNoC connections is
confusing GNU Radio. You're connecting port 0 to another RFNoC block,
but port 1 to a GNU Radio block. GNU Radio now believes you must have 2
output ports (which is true, kind of) and you've left port 0 dangling
(because it doesn't know about the RFNoC connection).

Connecting the GNU Radio ports first might solve the issue, but requires
telling the GNU Radio connection that it needs to go to port 1 on the
RFNoC block.

This is an interesting use case, and I need to cook up an example of my
own to see how to make this more streamlined and intuitive.

Cheers,
Martin

On 01/06/2016 04:07 PM, Jason Matusiak wrote:
> I am having some issues with a custom RFNoC block output when trying to
> run my python script.  My block takes in a complex int 16, and outputs a
> complex int 16 as well as a "byte".  The byte is really a 32b value that
> the receiving end will use to convert to a float.  This is a follow on
> from a previous GRC conversation I had here [1].
> 
> Right now I am testing my pass-through of the complex data (to get my
> axi flags working right), so I don't even care about the byte data, but
> it is what is giving me issues...
> 
> So based on the previous thread, I have an RFNoC GRC block that has an
> output of a "byte", but I am attempting to put 32b through it.  I've
> tried passing that through a RFNoC: FIFO to a File Sink, as well as just
> going from the block to a Null Sink, neither are working.  When I got
> straight to a Null Sink, I get the following:
> Traceback (most recent call last):
>   File "time_sync.py", line 160, in <module>
>     main()
>   File "time_sync.py", line 148, in main
>     tb = top_block_cls()
>   File "time_sync.py", line 117, in __init__
>     self.connect((self.uhd_rfnoc_streamer_time_sync_0, 1),
> (self.blocks_null_sink_0, 0))    
>   File
> "/home/jason/target/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py",
> line 47, in wrapped
>     func(self, src, src_port, dst, dst_port)
>   File
> "/home/jason/target/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py",
> line 110, in connect
>     self.primitive_connect(*args)
>   File
> "/home/jason/target/lib/python2.7/dist-packages/gnuradio/gr/runtime_swig.py",
> line 4569, in primitive_connect
>     return _runtime_swig.top_block_sptr_primitive_connect(self, *args)
> ValueError: itemsize mismatch: uhd_rfnoc_TimeSync0:1 using 8,
> null_sink0:0 using 1
> Segmentation fault (core dumped)
> 
> 
> OK, makes sense, it says that I have 8B coming out of the TimeSync0:1,
> but the null is expecting 1.  So I go into the python script and change
> the following line:
> self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_char*1)
> to:
> self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_char*8)
> 
> and now I get the output:
> Traceback (most recent call last):
>   File "time_sync.py", line 160, in <module>
>     main()
>   File "time_sync.py", line 149, in main
>     tb.start()
>   File
> "/home/jason/target/lib/python2.7/dist-packages/gnuradio/gr/top_block.py",
> line 109, in start
>     top_block_start_unlocked(self._impl, max_noutput_items)
>   File
> "/home/jason/target/lib/python2.7/dist-packages/gnuradio/gr/runtime_swig.py",
> line 4876, in top_block_start_unlocked
>     return _runtime_swig.top_block_start_unlocked(*args, **kwargs)
> RuntimeError: uhd_rfnoc_TimeSync(1): missing connection from output port
> 0
> 
> 
> This doesn't make sense to me as the following is in my pythonscript:
>         self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_char*8)
>         self.blocks_file_source_0_0 =
> blocks.file_source(gr.sizeof_gr_complex*1,
> "/home/jason/reducedInput.txt", False)
>         self.blocks_file_sink_0 =
> blocks.file_sink(gr.sizeof_gr_complex*1, "/tmp/complexData.txt", False)
>         self.blocks_file_sink_0.set_unbuffered(False)
> 
>         ##################################################
>         # Connections
>         ##################################################
>         self.connect((self.blocks_file_source_0_0, 0),
> (self.uhd_rfnoc_streamer_fifo_0, 0))    
>         self.connect((self.uhd_rfnoc_streamer_fifo_1, 0),
> (self.blocks_file_sink_0, 0))    
>         self.connect((self.uhd_rfnoc_streamer_time_sync_0, 1),
> (self.blocks_null_sink_0, 0))    
>        
> self.device3.connect(self.uhd_rfnoc_streamer_fifo_0.get_block_id(), 0,
> self.uhd_rfnoc_streamer_time_sync_0.get_block_id(), 0)    
>        
> self.device3.connect(self.uhd_rfnoc_streamer_time_sync_0.get_block_id(),
> 0, self.uhd_rfnoc_streamer_fifo_1.get_block_id(), 0)  
> 
> 
> What am I missing here?  I assume I am doing something stupid somewhere
> or am following Martin's plan for me in [1] incorrectly....
> 
> [1]
> https://lists.gnu.org/archive/html/discuss-gnuradio/2015-12/msg00098.html
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]