Difference between revisions of "Getting Started with RFNoC Development"

From Ettus Knowledge Base
Jump to: navigation, search
(Cleaned up language and formatting)
m (MartinBraun moved page RFNoC-modtool to Getting Started with RFNoC Development: Old title was misleading)
(No difference)

Revision as of 17:26, 21 June 2016

NOT FINISHED DONT READ!

Overview

In order to minimize the effort needed to implement a new RFNoC module, this gr_modtool-based tool provides the basic structure of the necessary files needed for the user to start with the development of his/her custom design right away. As it is gr_modtool-based, the manual found at [1] is also a great reference for this tool. Here, we discuss the features for this specific variation

With the use of RFNoC ModTool, you can skip the struggle of locating the files of your design at different locations that depend (until now) on the location of your UHD and gr-ettus installation paths. Instead, you focus on your implementation and the tool takes care of boilerplate code and linking.

Tool Installation

The tool is currently shipped within gr-ettus (radio-redo branch), so you can install it using PyBOMBS or from source.

gr-ettus Installation using PyBOMBS

If you haven't already downloaded and installed PyBOMBS, you can do it by running the following commands:

   $ sudo pip install git+https://github.com/gnuradio/pybombs.git
   $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git
   $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git

From here, the easiest way to set up a PyBOMBS development environment is to run the following command:

   $ pybombs prefix init /path/to/prefix -R rfnoc [-a alias]

This will do the following:

- Create a directory in /path/to/prefix - Clone UHD, FPGA, GNU Radio, and gr-ettus sources into that directory - Start the builds for the software

gr-ettus Installation by source

It is important to notice that this tool is still in an early stage, and this creates the necessity of installing the gr-ettus dependencies that are compatible with the tool, reason why it is recommended to checkout directly to the stated branches:

   $ git clone --recursive -b rfnoc-radio-redo https://github.com/EttusResearch/uhd.git
   $ git clone -b maint https://github.com/gnuradio/gnuradio.git
   $ git clone -b radio-redo https://github.com/EttusResearch/gr-ettus.git

If you have already uhd, gnuradio and/or gr-ettus installed, it would be sufficient to checkout to the branches mentioned and pull them. Thereafter, build each of the repositories (first UHD, then GNU Radio, then gr-ettus).

Tool Utilization

After the installation, you are ready to use the tool to generate standard code for your Out-of-tree module. To check the usage of the tool, just type:

   $ rfnocmodtool --help
   linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e
   Usage:
   rfnocmodtool <command> [options] -- Run <command> with the given options.
   rfnocmodtool help -- Show a list of commands.
   rfnocmodtool help <command> -- Shows the help for a given command. 
   List of possible commands:
   Name      Aliases          Description
   =====================================================================
   disable   dis              Disable block (comments out CMake entries for files) 
   info      getinfo,inf      Return information about a given module 
   remove    rm,del           Remove block (delete files and remove Makefile entries) 
   makexml   mx               Make XML file for GRC block bindings 
   add       insert           Add block to the out-of-tree module. 
   newmod    nm,create        Create a new out-of-tree module 
   rename    mv               Rename a block in the out-of-tree module. 

If you have used the gr_modtool provided by GNURadio, you'd be familiar with this usage.

Creating a RFNoC OOT Module

At this point you are all set up to start generating your own RFNoC OOT and if you were thinking that it is just as easy as it is with gr_modtool, you are completely right! Simply go to a desired location and type:

   $ rfnocmodtool newmod [NAME OF THE MODULE]

In the following, assume we want to create a module with the name 'example'. You can write the name of your module right after the 'newmod' command, but if you happen to forget it, the tool will ask for it interactively. This will create a folder containing the basic folders that you may need for a functional module.

   $ rfnocmodtool newmod example
   linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e
   Creating out-of-tree module in ./rfnoc-example... Done.
   Use 'rfnocmodtool add' to add a new block to this currently empty module.
   $ ls rfnoc-example/
   $ apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig

In contrast with gr_modtool, this includes al folder called 'rfnoc', which is where we put the UHD/FPGA files (more details below).

Adding custom blocks

Now you can start adding blocks to your module. The only thing to do is go inside of the module you just created and type:

   $ rfnocmodule add [NAME OF THE BLOCK]


Other Resources

[1] GNURadio OutOfTree Modules: http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules

https://github.com/EttusResearch/uhd/wiki/RFNoC:-Getting-Started

https://github.com/EttusResearch/uhd/wiki/RFNoC:--Specification