Difference between revisions of "Getting Started with RFNoC Development"

From Ettus Knowledge Base
Jump to: navigation, search
(Cleaned up language and formatting)
Line 3: Line 3:
 
==Overview==
 
==Overview==
 
{|
 
{|
|style="vertical-align:top; width: 60%;"|In order to minimize the effort needed to implement a new RFNoC Out-Of-Tree 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 discusse the features for this specific variation
+
|style="vertical-align:top; width: 60%;"|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 implementaton and the tool does the linking for you.
+
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 ==
 
== Tool Installation ==
The tool is currently shipped within gr-ettus within the branch {BRANCH NAME}, so you can install it using pybombs or by source
 
  
=== gr-ettus Installation using PyBOMBS ===
+
The tool is currently shipped within gr-ettus (radio-redo branch), so you can install it using PyBOMBS or from source.
  
If you don't have already downloaded and installed PyBOMBS, you can do it by running the following commands:
+
=== 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
 
     $ 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 gr-recipes git+https://github.com/gnuradio/gr-recipes.git
     $ pybombs recipes add gr-etcetera git+https://github.com/gnuradio/gr-etcetera.git
+
     $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git
  
Now you have two options for setting up the gr-ettus branch. You can run directly the pybombs installation command:
+
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 gr-ettus%{BRANCH NAME} [-a alias]
+
     $ pybombs prefix init /path/to/prefix -R rfnoc [-a alias]
  
or you could use the specific recipe that contains the packages compatible with the tool:
+
This will do the following:
  
 
+
- Create a directory in /path/to/prefix
    $ pybombs prefix init /path/to/prefix -R gr-ettus-modtool [-a alias]
+
- Clone UHD, FPGA, GNU Radio, and gr-ettus sources into that directory
 +
- Start the builds for the software
  
 
=== gr-ettus Installation by source ===
 
=== gr-ettus Installation by source ===
Line 35: Line 37:
 
     $ git clone -b radio-redo https://github.com/EttusResearch/gr-ettus.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 depicted branches and pull them. Thereafter, build each of the repositories (building UHD before GNURadio is, because of the dependencies, recommended.)
+
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 ==
 
== Tool Utilization ==
Line 65: Line 67:
  
 
=== Creating a RFNoC OOT Module ===
 
=== 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:
 
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]
 
     $ rfnocmodtool newmod [NAME OF THE MODULE]
  
For this manual and for explanatory purposes, lets give the module a 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.
+
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
 
     $ rfnocmodtool newmod example
Line 80: Line 83:
 
     $ apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig
 
     $ apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig
  
In contrast with the gr_modtool, here is to notice the generation of the folder 'rfnoc', which will held the UHD/fpga files. More details on this will come later in this reference manual.
+
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 ===
 
=== Adding custom blocks ===

Revision as of 16:58, 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