Hi all,

I was trying to run the ex_1layer example for neural networks on FPGA.

Although the flowgraph starts, I get a series of ''timeout on chan0" and no output is produced.

Any suggestion?

Thanks,

Francesco

Below is my code:

###############################################

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Nnet Example 1Layer
# Generated: Thu Apr 12 08:45:12 2018
##################################################

from gnuradio import blocks
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio import uhd
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from optparse import OptionParser
import ettus
import pmt


class nnet_example_1layer(gr.top_block):

    def __init__(self, args=""):
        gr.top_block.__init__(self, "Nnet Example 1Layer")

        ##################################################
        # Parameters
        ##################################################
        self.args = args

        ##################################################
        # Variables
        ##################################################
        self.device3 = variable_uhd_device3_0 = ettus.device3(uhd.device_addr_t( ",".join(('type=x300', '')) ))
        self.samp_rate = samp_rate = 784*1000

        ##################################################
        # Blocks
        ##################################################
        self.uhd_rfnoc_streamer_fifo_0 = ettus.rfnoc_generic(
            self.device3,
            uhd.stream_args( # TX Stream Args
                cpu_format="u8",
                otw_format="u8",
                args="gr_vlen=2,spp=2"
            ),
            uhd.stream_args( # RX Stream Args
                cpu_format="u8",
                otw_format="u8",
                args="gr_vlen=2,spp=2"
            ),
            "FIFO", 0, -1,
        )
        self.fpgannet_ex1layer_0 = ettus.rfnoc_generic(
            self.device3,
            uhd.stream_args(
                cpu_format="s16",
                otw_format="s16",
                args="gr_vlen=1,spp=1"
            ),
            uhd.stream_args(
                cpu_format="s16",
                otw_format="s16",
                args="gr_vlen=1,spp=1"
            ),
            "ex1layer", -1, -1,
        )

        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_short*1, samp_rate,True)
        self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_short*1)
        self.blocks_file_source_0 = blocks.file_source(gr.sizeof_short*1, 'mnist_data_input.s16', False)
        self.blocks_file_source_0.set_begin_tag(pmt.PMT_NIL)
        self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_short*1, 'mnist_rfnoc_output.s16', False)
        self.blocks_file_sink_0.set_unbuffered(False)
        self.blocks_deinterleave_0 = blocks.deinterleave(gr.sizeof_short*1, 1)
        self.blocks_copy_0 = blocks.copy(gr.sizeof_short*1)
        self.blocks_copy_0.set_enabled(True)



        ##################################################
        # Connections
        ##################################################
        self.connect((self.blocks_copy_0, 0), (self.blocks_deinterleave_0, 0))         self.connect((self.blocks_deinterleave_0, 0), (self.blocks_file_sink_0, 0))         self.connect((self.blocks_deinterleave_0, 1), (self.blocks_null_sink_0, 0))         self.connect((self.blocks_file_source_0, 0), (self.blocks_throttle_0, 0))         self.connect((self.blocks_throttle_0, 0), (self.uhd_rfnoc_streamer_fifo_0, 0))         self.connect((self.fpgannet_ex1layer_0, 0), (self.blocks_copy_0, 0)) self.device3.connect(self.uhd_rfnoc_streamer_fifo_0.get_block_id(), 0, self.fpgannet_ex1layer_0.get_block_id(), 0)

    def get_args(self):
        return self.args

    def set_args(self, args):
        self.args = args

    def get_variable_uhd_device3_0(self):
        return self.variable_uhd_device3_0

    def set_variable_uhd_device3_0(self, variable_uhd_device3_0):
        self.variable_uhd_device3_0 = variable_uhd_device3_0

    def get_samp_rate(self):
        return self.samp_rate

    def set_samp_rate(self, samp_rate):
        self.samp_rate = samp_rate
        self.blocks_throttle_0.set_sample_rate(self.samp_rate)


def argument_parser():
    parser = OptionParser(usage="%prog: [options]", option_class=eng_option)
    parser.add_option(
        "", "--args", dest="args", type="string", default="",
        help="Set args [default=%default]")
    return parser


def main(top_block_cls=nnet_example_1layer, options=None):
    if options is None:
        options, _ = argument_parser().parse_args()

    tb = top_block_cls(args=options.args)
    tb.start()
    try:
        raw_input('Press Enter to quit: ')
    except EOFError:
        pass
    tb.stop()
    tb.wait()


if __name__ == '__main__':
    main()


_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Reply via email to