<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://kb.ettus.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MartinBraun</id>
		<title>Ettus Knowledge Base - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://kb.ettus.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MartinBraun"/>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/Special:Contributions/MartinBraun"/>
		<updated>2026-10-30T19:45:26Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://kb.ettus.com/index.php?title=About_the_Motherboard_and_Daughtercard_EEPROM_on_USRP_Devices&amp;diff=6138</id>
		<title>About the Motherboard and Daughtercard EEPROM on USRP Devices</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=About_the_Motherboard_and_Daughtercard_EEPROM_on_USRP_Devices&amp;diff=6138"/>
				<updated>2025-07-15T07:10:05Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* USB VID/PID */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number and Authors ==&lt;br /&gt;
'''AN-309''' by Trip Humphries and Michael Dickens&lt;br /&gt;
&amp;lt;!-- Internal use only: please do keep this updated!&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-05-16  &lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Trip Humphries&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2020-08-05  &lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Michael Dickens&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Add 2945 and 2955 info&lt;br /&gt;
|}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=USRP EEPROM Settings &amp;amp; Recovery Guide=&lt;br /&gt;
&lt;br /&gt;
Some USRP products contain an EEPROM on the motherboard which is used to store information about the USRP. Currently, the N200/210, X300/310, B200/210, and E100 contain an on-board EEPROM. The EEPROM contains information about each USRP such as product code, revision number, USRP name, and IP address. The specific information stores on each USRP EEPROM is dependent on the USRP model.&lt;br /&gt;
&lt;br /&gt;
Daughter boards also contain an EEPROM that contains identification information about the daughter board. UHD reads the daughter board ID to determine the model and revision (if applicable) of the daughter board. This information is used to properly configure the USRP and daughter board for proper function.&lt;br /&gt;
&lt;br /&gt;
==EEPROM Burn Utility==&lt;br /&gt;
&lt;br /&gt;
'''Disclaimer: Ettus Research accepts no liability for misuse of this utility. It can very easily cause irreversible damage if used incorrectly! Please contact Ettus support at [mailto:support@ettus.com support@ettus.com] if you are unsure how to proceed.'''&lt;br /&gt;
&lt;br /&gt;
A utility, usrp_burn_mb_eeprom, is included with UHD to read/write values on the various motherboards that contain an EEPROM. The utility is located in the UHD install directory. The default folder is:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/lib/uhd/utils/&lt;br /&gt;
&lt;br /&gt;
The utility can be used with the USRP X300/310, N200/210, B200/210, and E100. In some cases, it is necessary to use the utility to write custom user settings to the USRP, such as USRP name or IP address. In other cases, some EEPROM settings set by the factory may become corrupted and need to be restored. This section will cover basic usage of the usrp_burn_mb_eeprom utility, with USRP specific instructions covered in the sections below.&lt;br /&gt;
&lt;br /&gt;
EEPROM settings can be read using the usrp_burn_mb_eeprom utility. All the EEPROM settings can be read at once using the 'read all' option:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;lt;optional device args&amp;gt; --read-all&lt;br /&gt;
&lt;br /&gt;
This will return the current contents in the EEPROM for the specified USRP. For example, if you want to read all the EEPROM contents for a USRP B210, the command would look like:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;type=b200&amp;quot; --read-all &lt;br /&gt;
&lt;br /&gt;
The EEPROM settings vary based on the specific USRP in use. The following sections document the EEPROM settings available for each USRP. Examples for each USRP with an EEPROM are also given.&lt;br /&gt;
&lt;br /&gt;
=X300/310 EEPROM=&lt;br /&gt;
The EEPROM on the X300/310 stores useful information about the USRP so that UHD can set the proper settings based on model and revision. Some of these settings are user customizable. The table below outlines the values stored in the X300/310 EEPROM. Any entry that is designated &amp;quot;User Customizable?=No&amp;quot; can cause irreversible damage to the USRP and should only be altered by proper guidance from Ettus Support. For example, certain settings in the EEPROM could become corrupted and can be restored with the proper commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''X300/310 EEPROM Setting:'''&lt;br /&gt;
|'''User Customizable?'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|revision&lt;br /&gt;
|No&lt;br /&gt;
|Hardware Number&lt;br /&gt;
|-&lt;br /&gt;
|revision_compat&lt;br /&gt;
|No&lt;br /&gt;
|Revision Number&lt;br /&gt;
|-&lt;br /&gt;
|product&lt;br /&gt;
|No&lt;br /&gt;
|Product Code&lt;br /&gt;
|-&lt;br /&gt;
|serial&lt;br /&gt;
|No&lt;br /&gt;
|Unique USRP Serial Number&lt;br /&gt;
|-&lt;br /&gt;
|mac-addr0&lt;br /&gt;
|No&lt;br /&gt;
|MAC Address (Port 0)&lt;br /&gt;
|-&lt;br /&gt;
|mac-addr1&lt;br /&gt;
|No&lt;br /&gt;
|MAC Address (Port 1)&lt;br /&gt;
|-&lt;br /&gt;
|gateway&lt;br /&gt;
|Yes&lt;br /&gt;
|Network Gateway&lt;br /&gt;
|-&lt;br /&gt;
|subnet0&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|subnet1&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|subnet2&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|subnet3&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr0&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr1&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr2&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr3&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|name&lt;br /&gt;
|Yes&lt;br /&gt;
|Custom USRP Name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As an example, the EEPROM settings of an X310 with IP address 192.168.10.2 could be read-back with the following command:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;addr=192.168.10.2,type=x300&amp;quot; --read-all&lt;br /&gt;
&lt;br /&gt;
and the output would look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fetching current settings from EEPROM...&lt;br /&gt;
	EEPROM [&amp;quot;revision&amp;quot;] is &amp;quot;4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;revision_compat&amp;quot;] is &amp;quot;2&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;product&amp;quot;] is &amp;quot;30AD2D4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;mac-addr0&amp;quot;] is &amp;quot;xx:xx:xx:xx:xx:xx&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;mac-addr1&amp;quot;] is &amp;quot;xx:xx:xx:xx:xx:xx&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;gateway&amp;quot;] is &amp;quot;192.168.10.1&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr0&amp;quot;] is &amp;quot;192.168.10.2&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet0&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr1&amp;quot;] is &amp;quot;192.168.20.2&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet1&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr2&amp;quot;] is &amp;quot;192.168.10.3&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet2&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr3&amp;quot;] is &amp;quot;192.168.40.2&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet3&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;serial&amp;quot;] is &amp;quot;30AF217&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;name&amp;quot;] is &amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Determining X300/X310 Revision Number==&lt;br /&gt;
It is useful in many cases to determine the revision number of your X300/X310. A part number sticker is located on the X300/310 motherboard. This sticker is located near the AUX-I/O connector and has the format 123456\&amp;lt;R&amp;gt;-\&amp;lt;XXX&amp;gt; where \&amp;lt;R&amp;gt; is a letter code that corresponds to the revision number. The photograph below highlights the location of the sticker:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:an-309-x3x0-rev-id.png|thumb|500px|center|The USRP X300/310 motherboard has a sticker that identifies the product and revision. The sticker is outlined in red.]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the letter code has been determined use the table below to map the letter code to a revision number:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Letter'''&lt;br /&gt;
|'''Revision #'''&lt;br /&gt;
|-&lt;br /&gt;
|C&lt;br /&gt;
|3&lt;br /&gt;
|-&lt;br /&gt;
|D&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
|E&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|F&lt;br /&gt;
|6&lt;br /&gt;
|-&lt;br /&gt;
|G&lt;br /&gt;
|7&lt;br /&gt;
|-&lt;br /&gt;
|H&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|I&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|J&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|K&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Restore X300/310 EEPROM Revision Code==&lt;br /&gt;
&lt;br /&gt;
A corrupted or missing revision code in the X300/310 EEPROM will be indicated by a UHD runtime error:&lt;br /&gt;
&lt;br /&gt;
 Error: RuntimeError: No revision compat detected. MB EEPROM must be reprogrammed!&lt;br /&gt;
&lt;br /&gt;
If this problem is encountered, the usrp_burn_mb_eeprom utility can be used to restore the X300/310 revision code in the EEPROM. First, the X300/X310 revision number must be determined. Once the revision number for your X300/310 is known, the usrp_burn_mb_eeprom utility can be used to restore the revision code to the EEPROM. The syntax is as follows:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom&amp;quot; --values=&amp;quot;revision=&amp;lt;#&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;#&amp;gt; is the revision number of your X300/310 to be written to the EEPROM. For example, to restore the revision number in EEPROM for a Rev. 6 X300 with an IP address of 192.168.10.2, the command would be:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom,addr=192.168.10.2&amp;quot; --values=&amp;quot;revision=6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After the utility has been run, power cycle the USRP and then run uhd_usrp_probe to ensure that the new revision number has been written to the EEPROM correctly. If you are unsure of how to accomplish these steps, please feel free to contact Ettus Support at [mailto:support@ettus.com support@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Restore X300/310 EEPROM Product Code==&lt;br /&gt;
&lt;br /&gt;
A corrupted product code in the X300/310 EEPROM will be indicated by a UHD warning:&lt;br /&gt;
&lt;br /&gt;
 UHD Warning: X300/X310 unknown product code in EEPROM: &amp;lt;###&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;###&amp;gt; is some numbered code that is unknown by UHD. If this problem is encountered, the usrp_burn_mb_eeprom utility can be used to write a new product code to the EEPROM. First, the X300/X310 revision number must be determined. Once the revision number has been determined, refer to the table below to find the product code for the X300/310:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''USRP'''&lt;br /&gt;
|'''Rev. 0-6'''&lt;br /&gt;
|'''Rev. 7-8'''&lt;br /&gt;
|-&lt;br /&gt;
|X300&lt;br /&gt;
|30518 (0x7736)&lt;br /&gt;
|30817 (0x7861)&lt;br /&gt;
|-&lt;br /&gt;
|X310&lt;br /&gt;
|30410 (0x76CA)&lt;br /&gt;
|30818 (0x7862)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the correct product code has been determined base on the X3x0 model and revision, the usrp_burn_mb_eeprom utility can be used to write the correct product code to the EEPROM. They syntax is as follows:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom&amp;quot; --values=&amp;quot;product=&amp;lt;###&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;###&amp;gt; is the product code to be written to the EEPROM. For example, on a Rev. 7 X300 with an IP address of 191.168.10.2, the command would be:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom,addr=192.168.10.2&amp;quot; --values=&amp;quot;product=30817&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After the utility has been run, power cycle the USRP and then run uhd_usrp_probe to ensure that the new revision number has been written to the EEPROM correctly. If you are unsure of how to accomplish these steps, please feel free to contact Ettus Support at [mailto:support@ettus.com support@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==National Instruments USRP RIO==&lt;br /&gt;
&lt;br /&gt;
The National Instruments branded X300/310 have unique product codes to identify the motherboard revision as well as the daughter-cards in the USRP. The product codes are listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Model (DB, BW, Rev.)'''&lt;br /&gt;
|'''Hex ID'''&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 40 MHz BW, Rev. 0-6)       &lt;br /&gt;
|0x772B&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 40 MHz BW, Rev. 7+)        &lt;br /&gt;
|0x7853&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 120 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x77FB&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 120 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x785B&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 40 MHz BW, Rev. 0-6)       &lt;br /&gt;
|0x772C&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 40 MHz BW, Rev. 7+)        &lt;br /&gt;
|0x7854&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 120 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x77FC&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 120 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x785C&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 40 MHz BW, Rev. 0-6)       &lt;br /&gt;
|0x772D&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 40 MHz BW, Rev. 7+)        &lt;br /&gt;
|0x7855&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 120 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x77FD&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 120 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x785D&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2944R (UBX, 160 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x772E&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2944R (UBX, 160 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x7856&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2945R (TwinRX, 80 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x78EF&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 40 MHz BW, Rev. 0-6)  &lt;br /&gt;
|0x772F&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 40 MHz BW, Rev. 7+)   &lt;br /&gt;
|0x7857&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 120 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x77FE&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 120 MHz BW, Rev. 7+   &lt;br /&gt;
|0x785E&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 40 MHz BW, Rev. 0-6)  &lt;br /&gt;
|0x7730&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 40 MHz BW, Rev. 7+)   &lt;br /&gt;
|0x7858&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 120 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x77FF&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 120 MHz BW, Rev. 7+   &lt;br /&gt;
|0x785F&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 40 MHz BW, Rev. 0-6)  &lt;br /&gt;
|0x7731&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 40 MHz BW, Rev. 7+)   &lt;br /&gt;
|0x7859&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 120 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x7800&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 120 MHz BW, Rev. 7+)  &lt;br /&gt;
|0x7860&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2954R (GPS, UBX, 160 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x7732&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2954R (GPS, UBX, 160 MHz BW, Rev. 7+)  &lt;br /&gt;
|0x785A&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2955R (TwinRX, 80 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x78F0&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=N200/210 EEPROM=&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''N200/210 EEPROM Setting'''&lt;br /&gt;
|'''User Customizable?'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|hardware&lt;br /&gt;
|No&lt;br /&gt;
|Hardware Number&lt;br /&gt;
|-&lt;br /&gt;
|revision&lt;br /&gt;
|No&lt;br /&gt;
|Revision Number&lt;br /&gt;
|-&lt;br /&gt;
|product&lt;br /&gt;
|No&lt;br /&gt;
|Product Code&lt;br /&gt;
|-&lt;br /&gt;
|mac-addr&lt;br /&gt;
|No&lt;br /&gt;
|MAC Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|subnet&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnetwork&lt;br /&gt;
|-&lt;br /&gt;
|gateway&lt;br /&gt;
|Yes&lt;br /&gt;
|Network Gateway&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The N200/210 do not store the product codes in the motherboard EEPROM. The &amp;quot;hardware&amp;quot; field is programmed at the factory but is not referenced by UHD. Instead, the revision field is used to determine the N200/210 hardware in use. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''USRP'''&lt;br /&gt;
|'''Motherboard Product ID'''&lt;br /&gt;
|-&lt;br /&gt;
|N200&lt;br /&gt;
|0x0A00&lt;br /&gt;
|-&lt;br /&gt;
|N210&lt;br /&gt;
|0x0A01&lt;br /&gt;
|-&lt;br /&gt;
|N200 - R4&lt;br /&gt;
|0x0A10&lt;br /&gt;
|-&lt;br /&gt;
|N210 - R4&lt;br /&gt;
|0x0A11&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=B200/210 and B200mini EEPROM=&lt;br /&gt;
&lt;br /&gt;
The USRP B200 and B210 EEPROM is used to store certain information about each board. The USB PID (Product ID) and VID (Vendor ID) are stored in the EEPROM as well as serial number, product code, hardware revision, and USRP name for each B200/210. A table of these settings and whether or not the setting is user customizable is given below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''B200/210 EEPROM Setting'''&lt;br /&gt;
|'''User Customizable?'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|revision&lt;br /&gt;
|No&lt;br /&gt;
|Revision Number&lt;br /&gt;
|-&lt;br /&gt;
|product&lt;br /&gt;
|No&lt;br /&gt;
|Product Code&lt;br /&gt;
|-&lt;br /&gt;
|serial&lt;br /&gt;
|No&lt;br /&gt;
|Unique Serial Number&lt;br /&gt;
|-&lt;br /&gt;
|name&lt;br /&gt;
|Yes&lt;br /&gt;
|Custom USRP Name&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To read the current EEPROM values from the USRP, use the usrp_burn_mb_eeprom utility:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;type=b200&amp;quot; --read-all&lt;br /&gt;
&lt;br /&gt;
This will read the settings and print them to the terminal. A sample output is shown below for a USRP B210:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fetching current settings from EEPROM...&lt;br /&gt;
	EEPROM [&amp;quot;revision&amp;quot;] is &amp;quot;4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;product&amp;quot;] is &amp;quot;2&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;serial&amp;quot;] is &amp;quot;30AD2D4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;name&amp;quot;] is &amp;quot;MyB210&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If desired, a B200/210 could be given a custom name with the following command:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;type=b200&amp;quot; --values=&amp;quot;name=Lab_B210&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After the command has been run, the device must be power-cycled for the new EEPROM setting to take effect. Reading the updated EEPROM values yields:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fetching current settings from EEPROM...&lt;br /&gt;
	EEPROM [&amp;quot;revision&amp;quot;] is &amp;quot;4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;product&amp;quot;] is &amp;quot;2&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;serial&amp;quot;] is &amp;quot;30AD2D4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;name&amp;quot;] is &amp;quot;Lab_B210&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EEPROM Product ID==&lt;br /&gt;
&lt;br /&gt;
The product code and the product revision stored in the EEPROM of the USRP&lt;br /&gt;
B200/B210 devices are used to identify the specific model and revision of the&lt;br /&gt;
device. The product code is a unique identifier that corresponds to the&lt;br /&gt;
specific hardware design, while the product revision indicates the version of&lt;br /&gt;
that design.&lt;br /&gt;
&lt;br /&gt;
In case of EEPROM corruption, the following table can help identify the correct&lt;br /&gt;
revision and product code that is written into the EEPROM during the manufacturing&lt;br /&gt;
process, by comparing to the USRP Type and NI Part Number, which can be found&lt;br /&gt;
on the blue sticker on the PCB. The &amp;quot;Letter Revision&amp;quot; is the last letter of&lt;br /&gt;
the NI Part Number.&lt;br /&gt;
&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  |'''USRP Type'''&lt;br /&gt;
  |'''NI PN'''&lt;br /&gt;
  |'''Letter Revision'''&lt;br /&gt;
  |'''EEPROM Product Code (Ettus Branding)'''&lt;br /&gt;
  |'''EEPROM Product Code (NI Branding)'''&lt;br /&gt;
  |'''EEPROM Revision No'''&lt;br /&gt;
  |'''Comments'''&lt;br /&gt;
  |-&lt;br /&gt;
  |B210&lt;br /&gt;
  |156229A-01L, 156229B-01L&lt;br /&gt;
  |A, B&lt;br /&gt;
  |2&lt;br /&gt;
  |0x7738, 0x7814&lt;br /&gt;
  |4&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200&lt;br /&gt;
  |156229A-02L, 156229B-02L&lt;br /&gt;
  |A, B&lt;br /&gt;
  |1&lt;br /&gt;
  |0x7737, 0x7813&lt;br /&gt;
  |4&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200&lt;br /&gt;
  |156229C-02L, 156229D-02L&lt;br /&gt;
  |C, D&lt;br /&gt;
  |1&lt;br /&gt;
  |0x7737, 0x7813&lt;br /&gt;
  |5&lt;br /&gt;
  |This revision switched from AD9361 to AD9634, and thus had to switch the RF side.&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034A-01L, 159034A-02L, 159034A-03L&lt;br /&gt;
  |A&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |1&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034B-01L, 159034B-02L, 159034B-03L&lt;br /&gt;
  |B&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |2&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034C-01L, 159034C-02L, 159034C-03L&lt;br /&gt;
  |C&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |3&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034D-01L, 159034D-02L, 159034D-03L&lt;br /&gt;
  |D&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |4&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034E-01L, 159034E-02L, 159034E-03L&lt;br /&gt;
  |E&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |5&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034{F,G}-01L, 159034{F,G}-02L, 159034{F,G}-03L&lt;br /&gt;
  |{F,G}&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |6&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B206mini&lt;br /&gt;
  |117434A-01L&lt;br /&gt;
  |A&lt;br /&gt;
  |0x0005&lt;br /&gt;
  |0x773b&lt;br /&gt;
  |1&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B206mini&lt;br /&gt;
  |117434B-01L&lt;br /&gt;
  |B&lt;br /&gt;
  |0x0005&lt;br /&gt;
  |0x773b&lt;br /&gt;
  |2&lt;br /&gt;
  |&lt;br /&gt;
  |- &lt;br /&gt;
  |}&lt;br /&gt;
&lt;br /&gt;
==USB VID/PID==&lt;br /&gt;
&lt;br /&gt;
The USB vendor identification (VID) and product identification (PID) numbers can be written to the USRP B200/210 using the &amp;quot;b2xx_fx3_utils&amp;quot; utility that is included with UHD. To reset the VID and PID, the command would be:&lt;br /&gt;
&lt;br /&gt;
 ./b2xx_fx3_utils --init-device --write-vid 0x2500 --write-pid -0x0020 --write-serial $SERIAL&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''USRP'''&lt;br /&gt;
|'''USB PID'''&lt;br /&gt;
|-&lt;br /&gt;
|B200&lt;br /&gt;
|0x0020&lt;br /&gt;
|-&lt;br /&gt;
|B210&lt;br /&gt;
|0x0020&lt;br /&gt;
|-&lt;br /&gt;
|B200 (NI)&lt;br /&gt;
|0x7813&lt;br /&gt;
|-&lt;br /&gt;
|B210 (NI)&lt;br /&gt;
|0x7814&lt;br /&gt;
|-&lt;br /&gt;
|B200mini&lt;br /&gt;
|0x0021&lt;br /&gt;
|-&lt;br /&gt;
|B205mini&lt;br /&gt;
|0x0022&lt;br /&gt;
|-&lt;br /&gt;
|B206mini&lt;br /&gt;
|0x0023&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VID is the same for all B2x0 variants, 0x2500.&lt;br /&gt;
&lt;br /&gt;
=Daughtercard IDs=&lt;br /&gt;
&lt;br /&gt;
Below is a comprehensive list of the daughtercard hex ID's.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Hex ID'''&lt;br /&gt;
|-&lt;br /&gt;
|Basic Tx		    &lt;br /&gt;
| 0x0000&lt;br /&gt;
|-&lt;br /&gt;
|Basic Rx   		    &lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|DBS Rx      		&lt;br /&gt;
| 0x0002&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx       		&lt;br /&gt;
| 0x0003&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Rx			&lt;br /&gt;
| 0x0004&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Rx			&lt;br /&gt;
| 0x0005&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Rx		&lt;br /&gt;
| 0x0006&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Rx		&lt;br /&gt;
| 0x0007&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Tx			&lt;br /&gt;
| 0x0008&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Tx			&lt;br /&gt;
| 0x0009&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Tx		&lt;br /&gt;
| 0x000a&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Tx		&lt;br /&gt;
| 0x000b&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 2			&lt;br /&gt;
| 0x000c&lt;br /&gt;
|-&lt;br /&gt;
|DBS Rx ClkMod		&lt;br /&gt;
| 0x000d&lt;br /&gt;
|-&lt;br /&gt;
|LF Tx				&lt;br /&gt;
| 0x000e&lt;br /&gt;
|-&lt;br /&gt;
|LF Rx				&lt;br /&gt;
| 0x000f&lt;br /&gt;
|-&lt;br /&gt;
|DBSRX2				&lt;br /&gt;
| 0x012&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Rx MIMO A	&lt;br /&gt;
| 0x0014&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Rx MIMO A	&lt;br /&gt;
| 0x0015&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Rx MIMO A &lt;br /&gt;
| 0x0016&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Rx MIMO A &lt;br /&gt;
| 0x0017&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Tx MIMO A  &lt;br /&gt;
| 0x0018&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Tx MIMO A	&lt;br /&gt;
| 0x0019&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Tx MIMO A &lt;br /&gt;
| 0x001a&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Tx MIMO A &lt;br /&gt;
| 0x001b&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Rx MIMO B	&lt;br /&gt;
| 0x0024&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Rx MIMO B  &lt;br /&gt;
| 0x0025&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Rx MIMO B &lt;br /&gt;
| 0x0026&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Rx MIMO B &lt;br /&gt;
| 0x0027&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Tx MIMO B	&lt;br /&gt;
| 0x0028&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Tx MIMO B	&lt;br /&gt;
| 0x0029&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Tx MIMO B	&lt;br /&gt;
| 0x002a&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Tx MIMO B &lt;br /&gt;
| 0x002b&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2200 Rx MIMO B &lt;br /&gt;
| 0x002c&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2200 Tx MIMO B	&lt;br /&gt;
| 0x002d&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Rx		&lt;br /&gt;
| 0x0030&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Tx		&lt;br /&gt;
| 0x0031&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Rx MIMO A	&lt;br /&gt;
| 0x0032&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Tx MIMO A	&lt;br /&gt;
| 0x0033&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Rx MIMO B &lt;br /&gt;
| 0x0034&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Tx MIMO B &lt;br /&gt;
| 0x0035&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 3			&lt;br /&gt;
| 0x0040&lt;br /&gt;
|-&lt;br /&gt;
|DTT754				&lt;br /&gt;
| 0x0041&lt;br /&gt;
|-&lt;br /&gt;
|DTT768				&lt;br /&gt;
| 0x0042&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx MIMO			&lt;br /&gt;
| 0x0043&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 2 MIMO	&lt;br /&gt;
| 0x0044&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 3 MIMO	&lt;br /&gt;
| 0x0045&lt;br /&gt;
|-&lt;br /&gt;
|TVRX2				&lt;br /&gt;
| 0x0046&lt;br /&gt;
|-&lt;br /&gt;
|WCDMA US			&lt;br /&gt;
| 0x004d&lt;br /&gt;
|-&lt;br /&gt;
|WCDMA EU			&lt;br /&gt;
| 0x004e&lt;br /&gt;
|-&lt;br /&gt;
|SIMPLE GDB			&lt;br /&gt;
| 0x004f&lt;br /&gt;
|-&lt;br /&gt;
|WBX LO TX			&lt;br /&gt;
| 0x0050&lt;br /&gt;
|-&lt;br /&gt;
|WBX LO RX			&lt;br /&gt;
| 0x0051&lt;br /&gt;
|-&lt;br /&gt;
|WBX NG TX			&lt;br /&gt;
| 0x0052&lt;br /&gt;
|-&lt;br /&gt;
|WBX NG RX			&lt;br /&gt;
| 0x0053&lt;br /&gt;
|-&lt;br /&gt;
|SBX v3 RX			&lt;br /&gt;
| 0x0054&lt;br /&gt;
|-&lt;br /&gt;
|SBX v3 TX			&lt;br /&gt;
| 0x0055&lt;br /&gt;
|-&lt;br /&gt;
|WBX v3 TX			&lt;br /&gt;
| 0x0056&lt;br /&gt;
|-&lt;br /&gt;
|WBX v3 RX			&lt;br /&gt;
| 0x0057&lt;br /&gt;
|-&lt;br /&gt;
|XCVR2450 - No Div	&lt;br /&gt;
| 0x0059&lt;br /&gt;
|-&lt;br /&gt;
|XCVR2450 TX			&lt;br /&gt;
| 0x0060&lt;br /&gt;
|-&lt;br /&gt;
|XCVR2450 RX			&lt;br /&gt;
| 0x0061&lt;br /&gt;
|-&lt;br /&gt;
|WBX v4 TX			&lt;br /&gt;
| 0x0062&lt;br /&gt;
|-&lt;br /&gt;
|WBX v4 RX			&lt;br /&gt;
| 0x0063&lt;br /&gt;
|-&lt;br /&gt;
|SBX v4 TX			&lt;br /&gt;
| 0x0064&lt;br /&gt;
|-&lt;br /&gt;
|SBX v4 RX			&lt;br /&gt;
| 0x0065&lt;br /&gt;
|-&lt;br /&gt;
|CBX v1 TX			&lt;br /&gt;
| 0x0066&lt;br /&gt;
|-&lt;br /&gt;
|CBX v1 RX			&lt;br /&gt;
| 0x0067&lt;br /&gt;
|-&lt;br /&gt;
|SBX v5 TX			&lt;br /&gt;
| 0x0068&lt;br /&gt;
|-&lt;br /&gt;
|SBX v5 RX			&lt;br /&gt;
| 0x0069&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v3 TX	&lt;br /&gt;
| 0x0073&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v3 RX &lt;br /&gt;
| 0x0074&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v4 TX &lt;br /&gt;
| 0x0075&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v4 RX &lt;br /&gt;
| 0x0076&lt;br /&gt;
|-&lt;br /&gt;
|UBX v1 TX			&lt;br /&gt;
| 0x0077&lt;br /&gt;
|-&lt;br /&gt;
|UBX v1 RX			&lt;br /&gt;
| 0x0078&lt;br /&gt;
|-&lt;br /&gt;
|UBX-160 v1 TX		&lt;br /&gt;
| 0x0079&lt;br /&gt;
|-&lt;br /&gt;
|UBX-160 v1 RX		&lt;br /&gt;
| 0x007a&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|UBX-40 v2 TX		&lt;br /&gt;
| 0x007b&lt;br /&gt;
|-&lt;br /&gt;
|UBX-40 v2 RX		&lt;br /&gt;
| 0x007c&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|UBX-160 v2 TX		&lt;br /&gt;
| 0x007d&lt;br /&gt;
|-&lt;br /&gt;
|UBX-160 v2 RX		&lt;br /&gt;
| 0x007e&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Bitshark RX			&lt;br /&gt;
| 0x0070&lt;br /&gt;
|-&lt;br /&gt;
|B150 v1 TX			&lt;br /&gt;
| 0x0071&lt;br /&gt;
|-&lt;br /&gt;
|B150 v1 RX			&lt;br /&gt;
| 0x0072&lt;br /&gt;
|-&lt;br /&gt;
|WBX-120 v1 TX		&lt;br /&gt;
| 0x0080&lt;br /&gt;
|-&lt;br /&gt;
|WBX-120 v1 RX		&lt;br /&gt;
| 0x0081&lt;br /&gt;
|-&lt;br /&gt;
|SBX-120 v1 TX		&lt;br /&gt;
| 0x0082&lt;br /&gt;
|-&lt;br /&gt;
|SBX-120 v1 RX		&lt;br /&gt;
| 0x0083&lt;br /&gt;
|-&lt;br /&gt;
|CBX-120 v1 TX		&lt;br /&gt;
| 0x0084&lt;br /&gt;
|-&lt;br /&gt;
|CBX-120 v1 RX		&lt;br /&gt;
| 0x0085&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev A TX		&lt;br /&gt;
| 0x0090&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev A RX 		&lt;br /&gt;
| 0x0091&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev B TX		&lt;br /&gt;
| 0x0092&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev B RX 		&lt;br /&gt;
| 0x0093&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev C TX 	&lt;br /&gt;
| 0x0094&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev C RX&lt;br /&gt;
| 0x0095&lt;br /&gt;
|-&lt;br /&gt;
|E300 AD3964 DB RevB	&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
|E310 AD9361 DB RevB	&lt;br /&gt;
| 0x0110&lt;br /&gt;
|-&lt;br /&gt;
|E300 AD9364 DB RevC	&lt;br /&gt;
| 0x0101&lt;br /&gt;
|-&lt;br /&gt;
|E310 AD9361 DB RevC	&lt;br /&gt;
| 0x0111&lt;br /&gt;
|-&lt;br /&gt;
|Unknown Tx			&lt;br /&gt;
| 0xfff0&lt;br /&gt;
|-&lt;br /&gt;
|Unknown Rx			&lt;br /&gt;
| 0xfff1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Motherboard IDs=&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Hex ID'''&lt;br /&gt;
|-&lt;br /&gt;
|B200&lt;br /&gt;
|0x7737&lt;br /&gt;
|-&lt;br /&gt;
|B210&lt;br /&gt;
|0x7738&lt;br /&gt;
|-&lt;br /&gt;
|B200mini&lt;br /&gt;
|0x7739&lt;br /&gt;
|-&lt;br /&gt;
|B205mini&lt;br /&gt;
|0x773a&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=About_the_Motherboard_and_Daughtercard_EEPROM_on_USRP_Devices&amp;diff=6137</id>
		<title>About the Motherboard and Daughtercard EEPROM on USRP Devices</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=About_the_Motherboard_and_Daughtercard_EEPROM_on_USRP_Devices&amp;diff=6137"/>
				<updated>2025-07-15T07:09:37Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* USB VID/PID */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number and Authors ==&lt;br /&gt;
'''AN-309''' by Trip Humphries and Michael Dickens&lt;br /&gt;
&amp;lt;!-- Internal use only: please do keep this updated!&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-05-16  &lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Trip Humphries&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2020-08-05  &lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Michael Dickens&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Add 2945 and 2955 info&lt;br /&gt;
|}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=USRP EEPROM Settings &amp;amp; Recovery Guide=&lt;br /&gt;
&lt;br /&gt;
Some USRP products contain an EEPROM on the motherboard which is used to store information about the USRP. Currently, the N200/210, X300/310, B200/210, and E100 contain an on-board EEPROM. The EEPROM contains information about each USRP such as product code, revision number, USRP name, and IP address. The specific information stores on each USRP EEPROM is dependent on the USRP model.&lt;br /&gt;
&lt;br /&gt;
Daughter boards also contain an EEPROM that contains identification information about the daughter board. UHD reads the daughter board ID to determine the model and revision (if applicable) of the daughter board. This information is used to properly configure the USRP and daughter board for proper function.&lt;br /&gt;
&lt;br /&gt;
==EEPROM Burn Utility==&lt;br /&gt;
&lt;br /&gt;
'''Disclaimer: Ettus Research accepts no liability for misuse of this utility. It can very easily cause irreversible damage if used incorrectly! Please contact Ettus support at [mailto:support@ettus.com support@ettus.com] if you are unsure how to proceed.'''&lt;br /&gt;
&lt;br /&gt;
A utility, usrp_burn_mb_eeprom, is included with UHD to read/write values on the various motherboards that contain an EEPROM. The utility is located in the UHD install directory. The default folder is:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/lib/uhd/utils/&lt;br /&gt;
&lt;br /&gt;
The utility can be used with the USRP X300/310, N200/210, B200/210, and E100. In some cases, it is necessary to use the utility to write custom user settings to the USRP, such as USRP name or IP address. In other cases, some EEPROM settings set by the factory may become corrupted and need to be restored. This section will cover basic usage of the usrp_burn_mb_eeprom utility, with USRP specific instructions covered in the sections below.&lt;br /&gt;
&lt;br /&gt;
EEPROM settings can be read using the usrp_burn_mb_eeprom utility. All the EEPROM settings can be read at once using the 'read all' option:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;lt;optional device args&amp;gt; --read-all&lt;br /&gt;
&lt;br /&gt;
This will return the current contents in the EEPROM for the specified USRP. For example, if you want to read all the EEPROM contents for a USRP B210, the command would look like:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;type=b200&amp;quot; --read-all &lt;br /&gt;
&lt;br /&gt;
The EEPROM settings vary based on the specific USRP in use. The following sections document the EEPROM settings available for each USRP. Examples for each USRP with an EEPROM are also given.&lt;br /&gt;
&lt;br /&gt;
=X300/310 EEPROM=&lt;br /&gt;
The EEPROM on the X300/310 stores useful information about the USRP so that UHD can set the proper settings based on model and revision. Some of these settings are user customizable. The table below outlines the values stored in the X300/310 EEPROM. Any entry that is designated &amp;quot;User Customizable?=No&amp;quot; can cause irreversible damage to the USRP and should only be altered by proper guidance from Ettus Support. For example, certain settings in the EEPROM could become corrupted and can be restored with the proper commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''X300/310 EEPROM Setting:'''&lt;br /&gt;
|'''User Customizable?'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|revision&lt;br /&gt;
|No&lt;br /&gt;
|Hardware Number&lt;br /&gt;
|-&lt;br /&gt;
|revision_compat&lt;br /&gt;
|No&lt;br /&gt;
|Revision Number&lt;br /&gt;
|-&lt;br /&gt;
|product&lt;br /&gt;
|No&lt;br /&gt;
|Product Code&lt;br /&gt;
|-&lt;br /&gt;
|serial&lt;br /&gt;
|No&lt;br /&gt;
|Unique USRP Serial Number&lt;br /&gt;
|-&lt;br /&gt;
|mac-addr0&lt;br /&gt;
|No&lt;br /&gt;
|MAC Address (Port 0)&lt;br /&gt;
|-&lt;br /&gt;
|mac-addr1&lt;br /&gt;
|No&lt;br /&gt;
|MAC Address (Port 1)&lt;br /&gt;
|-&lt;br /&gt;
|gateway&lt;br /&gt;
|Yes&lt;br /&gt;
|Network Gateway&lt;br /&gt;
|-&lt;br /&gt;
|subnet0&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|subnet1&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|subnet2&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|subnet3&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr0&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr1&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr2&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr3&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|name&lt;br /&gt;
|Yes&lt;br /&gt;
|Custom USRP Name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As an example, the EEPROM settings of an X310 with IP address 192.168.10.2 could be read-back with the following command:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;addr=192.168.10.2,type=x300&amp;quot; --read-all&lt;br /&gt;
&lt;br /&gt;
and the output would look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fetching current settings from EEPROM...&lt;br /&gt;
	EEPROM [&amp;quot;revision&amp;quot;] is &amp;quot;4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;revision_compat&amp;quot;] is &amp;quot;2&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;product&amp;quot;] is &amp;quot;30AD2D4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;mac-addr0&amp;quot;] is &amp;quot;xx:xx:xx:xx:xx:xx&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;mac-addr1&amp;quot;] is &amp;quot;xx:xx:xx:xx:xx:xx&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;gateway&amp;quot;] is &amp;quot;192.168.10.1&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr0&amp;quot;] is &amp;quot;192.168.10.2&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet0&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr1&amp;quot;] is &amp;quot;192.168.20.2&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet1&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr2&amp;quot;] is &amp;quot;192.168.10.3&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet2&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr3&amp;quot;] is &amp;quot;192.168.40.2&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet3&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;serial&amp;quot;] is &amp;quot;30AF217&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;name&amp;quot;] is &amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Determining X300/X310 Revision Number==&lt;br /&gt;
It is useful in many cases to determine the revision number of your X300/X310. A part number sticker is located on the X300/310 motherboard. This sticker is located near the AUX-I/O connector and has the format 123456\&amp;lt;R&amp;gt;-\&amp;lt;XXX&amp;gt; where \&amp;lt;R&amp;gt; is a letter code that corresponds to the revision number. The photograph below highlights the location of the sticker:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:an-309-x3x0-rev-id.png|thumb|500px|center|The USRP X300/310 motherboard has a sticker that identifies the product and revision. The sticker is outlined in red.]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the letter code has been determined use the table below to map the letter code to a revision number:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Letter'''&lt;br /&gt;
|'''Revision #'''&lt;br /&gt;
|-&lt;br /&gt;
|C&lt;br /&gt;
|3&lt;br /&gt;
|-&lt;br /&gt;
|D&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
|E&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|F&lt;br /&gt;
|6&lt;br /&gt;
|-&lt;br /&gt;
|G&lt;br /&gt;
|7&lt;br /&gt;
|-&lt;br /&gt;
|H&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|I&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|J&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|K&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Restore X300/310 EEPROM Revision Code==&lt;br /&gt;
&lt;br /&gt;
A corrupted or missing revision code in the X300/310 EEPROM will be indicated by a UHD runtime error:&lt;br /&gt;
&lt;br /&gt;
 Error: RuntimeError: No revision compat detected. MB EEPROM must be reprogrammed!&lt;br /&gt;
&lt;br /&gt;
If this problem is encountered, the usrp_burn_mb_eeprom utility can be used to restore the X300/310 revision code in the EEPROM. First, the X300/X310 revision number must be determined. Once the revision number for your X300/310 is known, the usrp_burn_mb_eeprom utility can be used to restore the revision code to the EEPROM. The syntax is as follows:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom&amp;quot; --values=&amp;quot;revision=&amp;lt;#&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;#&amp;gt; is the revision number of your X300/310 to be written to the EEPROM. For example, to restore the revision number in EEPROM for a Rev. 6 X300 with an IP address of 192.168.10.2, the command would be:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom,addr=192.168.10.2&amp;quot; --values=&amp;quot;revision=6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After the utility has been run, power cycle the USRP and then run uhd_usrp_probe to ensure that the new revision number has been written to the EEPROM correctly. If you are unsure of how to accomplish these steps, please feel free to contact Ettus Support at [mailto:support@ettus.com support@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Restore X300/310 EEPROM Product Code==&lt;br /&gt;
&lt;br /&gt;
A corrupted product code in the X300/310 EEPROM will be indicated by a UHD warning:&lt;br /&gt;
&lt;br /&gt;
 UHD Warning: X300/X310 unknown product code in EEPROM: &amp;lt;###&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;###&amp;gt; is some numbered code that is unknown by UHD. If this problem is encountered, the usrp_burn_mb_eeprom utility can be used to write a new product code to the EEPROM. First, the X300/X310 revision number must be determined. Once the revision number has been determined, refer to the table below to find the product code for the X300/310:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''USRP'''&lt;br /&gt;
|'''Rev. 0-6'''&lt;br /&gt;
|'''Rev. 7-8'''&lt;br /&gt;
|-&lt;br /&gt;
|X300&lt;br /&gt;
|30518 (0x7736)&lt;br /&gt;
|30817 (0x7861)&lt;br /&gt;
|-&lt;br /&gt;
|X310&lt;br /&gt;
|30410 (0x76CA)&lt;br /&gt;
|30818 (0x7862)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the correct product code has been determined base on the X3x0 model and revision, the usrp_burn_mb_eeprom utility can be used to write the correct product code to the EEPROM. They syntax is as follows:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom&amp;quot; --values=&amp;quot;product=&amp;lt;###&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;###&amp;gt; is the product code to be written to the EEPROM. For example, on a Rev. 7 X300 with an IP address of 191.168.10.2, the command would be:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom,addr=192.168.10.2&amp;quot; --values=&amp;quot;product=30817&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After the utility has been run, power cycle the USRP and then run uhd_usrp_probe to ensure that the new revision number has been written to the EEPROM correctly. If you are unsure of how to accomplish these steps, please feel free to contact Ettus Support at [mailto:support@ettus.com support@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==National Instruments USRP RIO==&lt;br /&gt;
&lt;br /&gt;
The National Instruments branded X300/310 have unique product codes to identify the motherboard revision as well as the daughter-cards in the USRP. The product codes are listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Model (DB, BW, Rev.)'''&lt;br /&gt;
|'''Hex ID'''&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 40 MHz BW, Rev. 0-6)       &lt;br /&gt;
|0x772B&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 40 MHz BW, Rev. 7+)        &lt;br /&gt;
|0x7853&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 120 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x77FB&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 120 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x785B&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 40 MHz BW, Rev. 0-6)       &lt;br /&gt;
|0x772C&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 40 MHz BW, Rev. 7+)        &lt;br /&gt;
|0x7854&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 120 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x77FC&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 120 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x785C&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 40 MHz BW, Rev. 0-6)       &lt;br /&gt;
|0x772D&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 40 MHz BW, Rev. 7+)        &lt;br /&gt;
|0x7855&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 120 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x77FD&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 120 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x785D&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2944R (UBX, 160 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x772E&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2944R (UBX, 160 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x7856&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2945R (TwinRX, 80 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x78EF&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 40 MHz BW, Rev. 0-6)  &lt;br /&gt;
|0x772F&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 40 MHz BW, Rev. 7+)   &lt;br /&gt;
|0x7857&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 120 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x77FE&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 120 MHz BW, Rev. 7+   &lt;br /&gt;
|0x785E&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 40 MHz BW, Rev. 0-6)  &lt;br /&gt;
|0x7730&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 40 MHz BW, Rev. 7+)   &lt;br /&gt;
|0x7858&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 120 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x77FF&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 120 MHz BW, Rev. 7+   &lt;br /&gt;
|0x785F&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 40 MHz BW, Rev. 0-6)  &lt;br /&gt;
|0x7731&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 40 MHz BW, Rev. 7+)   &lt;br /&gt;
|0x7859&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 120 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x7800&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 120 MHz BW, Rev. 7+)  &lt;br /&gt;
|0x7860&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2954R (GPS, UBX, 160 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x7732&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2954R (GPS, UBX, 160 MHz BW, Rev. 7+)  &lt;br /&gt;
|0x785A&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2955R (TwinRX, 80 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x78F0&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=N200/210 EEPROM=&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''N200/210 EEPROM Setting'''&lt;br /&gt;
|'''User Customizable?'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|hardware&lt;br /&gt;
|No&lt;br /&gt;
|Hardware Number&lt;br /&gt;
|-&lt;br /&gt;
|revision&lt;br /&gt;
|No&lt;br /&gt;
|Revision Number&lt;br /&gt;
|-&lt;br /&gt;
|product&lt;br /&gt;
|No&lt;br /&gt;
|Product Code&lt;br /&gt;
|-&lt;br /&gt;
|mac-addr&lt;br /&gt;
|No&lt;br /&gt;
|MAC Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|subnet&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnetwork&lt;br /&gt;
|-&lt;br /&gt;
|gateway&lt;br /&gt;
|Yes&lt;br /&gt;
|Network Gateway&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The N200/210 do not store the product codes in the motherboard EEPROM. The &amp;quot;hardware&amp;quot; field is programmed at the factory but is not referenced by UHD. Instead, the revision field is used to determine the N200/210 hardware in use. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''USRP'''&lt;br /&gt;
|'''Motherboard Product ID'''&lt;br /&gt;
|-&lt;br /&gt;
|N200&lt;br /&gt;
|0x0A00&lt;br /&gt;
|-&lt;br /&gt;
|N210&lt;br /&gt;
|0x0A01&lt;br /&gt;
|-&lt;br /&gt;
|N200 - R4&lt;br /&gt;
|0x0A10&lt;br /&gt;
|-&lt;br /&gt;
|N210 - R4&lt;br /&gt;
|0x0A11&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=B200/210 and B200mini EEPROM=&lt;br /&gt;
&lt;br /&gt;
The USRP B200 and B210 EEPROM is used to store certain information about each board. The USB PID (Product ID) and VID (Vendor ID) are stored in the EEPROM as well as serial number, product code, hardware revision, and USRP name for each B200/210. A table of these settings and whether or not the setting is user customizable is given below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''B200/210 EEPROM Setting'''&lt;br /&gt;
|'''User Customizable?'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|revision&lt;br /&gt;
|No&lt;br /&gt;
|Revision Number&lt;br /&gt;
|-&lt;br /&gt;
|product&lt;br /&gt;
|No&lt;br /&gt;
|Product Code&lt;br /&gt;
|-&lt;br /&gt;
|serial&lt;br /&gt;
|No&lt;br /&gt;
|Unique Serial Number&lt;br /&gt;
|-&lt;br /&gt;
|name&lt;br /&gt;
|Yes&lt;br /&gt;
|Custom USRP Name&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To read the current EEPROM values from the USRP, use the usrp_burn_mb_eeprom utility:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;type=b200&amp;quot; --read-all&lt;br /&gt;
&lt;br /&gt;
This will read the settings and print them to the terminal. A sample output is shown below for a USRP B210:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fetching current settings from EEPROM...&lt;br /&gt;
	EEPROM [&amp;quot;revision&amp;quot;] is &amp;quot;4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;product&amp;quot;] is &amp;quot;2&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;serial&amp;quot;] is &amp;quot;30AD2D4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;name&amp;quot;] is &amp;quot;MyB210&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If desired, a B200/210 could be given a custom name with the following command:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;type=b200&amp;quot; --values=&amp;quot;name=Lab_B210&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After the command has been run, the device must be power-cycled for the new EEPROM setting to take effect. Reading the updated EEPROM values yields:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fetching current settings from EEPROM...&lt;br /&gt;
	EEPROM [&amp;quot;revision&amp;quot;] is &amp;quot;4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;product&amp;quot;] is &amp;quot;2&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;serial&amp;quot;] is &amp;quot;30AD2D4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;name&amp;quot;] is &amp;quot;Lab_B210&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EEPROM Product ID==&lt;br /&gt;
&lt;br /&gt;
The product code and the product revision stored in the EEPROM of the USRP&lt;br /&gt;
B200/B210 devices are used to identify the specific model and revision of the&lt;br /&gt;
device. The product code is a unique identifier that corresponds to the&lt;br /&gt;
specific hardware design, while the product revision indicates the version of&lt;br /&gt;
that design.&lt;br /&gt;
&lt;br /&gt;
In case of EEPROM corruption, the following table can help identify the correct&lt;br /&gt;
revision and product code that is written into the EEPROM during the manufacturing&lt;br /&gt;
process, by comparing to the USRP Type and NI Part Number, which can be found&lt;br /&gt;
on the blue sticker on the PCB. The &amp;quot;Letter Revision&amp;quot; is the last letter of&lt;br /&gt;
the NI Part Number.&lt;br /&gt;
&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  |'''USRP Type'''&lt;br /&gt;
  |'''NI PN'''&lt;br /&gt;
  |'''Letter Revision'''&lt;br /&gt;
  |'''EEPROM Product Code (Ettus Branding)'''&lt;br /&gt;
  |'''EEPROM Product Code (NI Branding)'''&lt;br /&gt;
  |'''EEPROM Revision No'''&lt;br /&gt;
  |'''Comments'''&lt;br /&gt;
  |-&lt;br /&gt;
  |B210&lt;br /&gt;
  |156229A-01L, 156229B-01L&lt;br /&gt;
  |A, B&lt;br /&gt;
  |2&lt;br /&gt;
  |0x7738, 0x7814&lt;br /&gt;
  |4&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200&lt;br /&gt;
  |156229A-02L, 156229B-02L&lt;br /&gt;
  |A, B&lt;br /&gt;
  |1&lt;br /&gt;
  |0x7737, 0x7813&lt;br /&gt;
  |4&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200&lt;br /&gt;
  |156229C-02L, 156229D-02L&lt;br /&gt;
  |C, D&lt;br /&gt;
  |1&lt;br /&gt;
  |0x7737, 0x7813&lt;br /&gt;
  |5&lt;br /&gt;
  |This revision switched from AD9361 to AD9634, and thus had to switch the RF side.&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034A-01L, 159034A-02L, 159034A-03L&lt;br /&gt;
  |A&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |1&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034B-01L, 159034B-02L, 159034B-03L&lt;br /&gt;
  |B&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |2&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034C-01L, 159034C-02L, 159034C-03L&lt;br /&gt;
  |C&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |3&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034D-01L, 159034D-02L, 159034D-03L&lt;br /&gt;
  |D&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |4&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034E-01L, 159034E-02L, 159034E-03L&lt;br /&gt;
  |E&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |5&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034{F,G}-01L, 159034{F,G}-02L, 159034{F,G}-03L&lt;br /&gt;
  |{F,G}&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |6&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B206mini&lt;br /&gt;
  |117434A-01L&lt;br /&gt;
  |A&lt;br /&gt;
  |0x0005&lt;br /&gt;
  |0x773b&lt;br /&gt;
  |1&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B206mini&lt;br /&gt;
  |117434B-01L&lt;br /&gt;
  |B&lt;br /&gt;
  |0x0005&lt;br /&gt;
  |0x773b&lt;br /&gt;
  |2&lt;br /&gt;
  |&lt;br /&gt;
  |- &lt;br /&gt;
  |}&lt;br /&gt;
&lt;br /&gt;
==USB VID/PID==&lt;br /&gt;
&lt;br /&gt;
The USB vendor identification (VID) and product identification (PID) numbers can be written to the USRP B200/210 using the &amp;quot;b2xx_fx3_utils&amp;quot; utility that is included with UHD. To reset the VID and PID, the command would be:&lt;br /&gt;
&lt;br /&gt;
 ./b2xx_fx3_utils --init-device --write-vid 0x2500 --write-pid -0x0020&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''USRP'''&lt;br /&gt;
|'''USB PID'''&lt;br /&gt;
|-&lt;br /&gt;
|B200&lt;br /&gt;
|0x0020&lt;br /&gt;
|-&lt;br /&gt;
|B210&lt;br /&gt;
|0x0020&lt;br /&gt;
|-&lt;br /&gt;
|B200 (NI)&lt;br /&gt;
|0x7813&lt;br /&gt;
|-&lt;br /&gt;
|B210 (NI)&lt;br /&gt;
|0x7814&lt;br /&gt;
|-&lt;br /&gt;
|B200mini&lt;br /&gt;
|0x0021&lt;br /&gt;
|-&lt;br /&gt;
|B205mini&lt;br /&gt;
|0x0022&lt;br /&gt;
|-&lt;br /&gt;
|B206mini&lt;br /&gt;
|0x0023&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VID is the same for all B2x0 variants, 0x2500.&lt;br /&gt;
&lt;br /&gt;
=Daughtercard IDs=&lt;br /&gt;
&lt;br /&gt;
Below is a comprehensive list of the daughtercard hex ID's.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Hex ID'''&lt;br /&gt;
|-&lt;br /&gt;
|Basic Tx		    &lt;br /&gt;
| 0x0000&lt;br /&gt;
|-&lt;br /&gt;
|Basic Rx   		    &lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|DBS Rx      		&lt;br /&gt;
| 0x0002&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx       		&lt;br /&gt;
| 0x0003&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Rx			&lt;br /&gt;
| 0x0004&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Rx			&lt;br /&gt;
| 0x0005&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Rx		&lt;br /&gt;
| 0x0006&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Rx		&lt;br /&gt;
| 0x0007&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Tx			&lt;br /&gt;
| 0x0008&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Tx			&lt;br /&gt;
| 0x0009&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Tx		&lt;br /&gt;
| 0x000a&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Tx		&lt;br /&gt;
| 0x000b&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 2			&lt;br /&gt;
| 0x000c&lt;br /&gt;
|-&lt;br /&gt;
|DBS Rx ClkMod		&lt;br /&gt;
| 0x000d&lt;br /&gt;
|-&lt;br /&gt;
|LF Tx				&lt;br /&gt;
| 0x000e&lt;br /&gt;
|-&lt;br /&gt;
|LF Rx				&lt;br /&gt;
| 0x000f&lt;br /&gt;
|-&lt;br /&gt;
|DBSRX2				&lt;br /&gt;
| 0x012&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Rx MIMO A	&lt;br /&gt;
| 0x0014&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Rx MIMO A	&lt;br /&gt;
| 0x0015&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Rx MIMO A &lt;br /&gt;
| 0x0016&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Rx MIMO A &lt;br /&gt;
| 0x0017&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Tx MIMO A  &lt;br /&gt;
| 0x0018&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Tx MIMO A	&lt;br /&gt;
| 0x0019&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Tx MIMO A &lt;br /&gt;
| 0x001a&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Tx MIMO A &lt;br /&gt;
| 0x001b&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Rx MIMO B	&lt;br /&gt;
| 0x0024&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Rx MIMO B  &lt;br /&gt;
| 0x0025&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Rx MIMO B &lt;br /&gt;
| 0x0026&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Rx MIMO B &lt;br /&gt;
| 0x0027&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Tx MIMO B	&lt;br /&gt;
| 0x0028&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Tx MIMO B	&lt;br /&gt;
| 0x0029&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Tx MIMO B	&lt;br /&gt;
| 0x002a&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Tx MIMO B &lt;br /&gt;
| 0x002b&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2200 Rx MIMO B &lt;br /&gt;
| 0x002c&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2200 Tx MIMO B	&lt;br /&gt;
| 0x002d&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Rx		&lt;br /&gt;
| 0x0030&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Tx		&lt;br /&gt;
| 0x0031&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Rx MIMO A	&lt;br /&gt;
| 0x0032&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Tx MIMO A	&lt;br /&gt;
| 0x0033&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Rx MIMO B &lt;br /&gt;
| 0x0034&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Tx MIMO B &lt;br /&gt;
| 0x0035&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 3			&lt;br /&gt;
| 0x0040&lt;br /&gt;
|-&lt;br /&gt;
|DTT754				&lt;br /&gt;
| 0x0041&lt;br /&gt;
|-&lt;br /&gt;
|DTT768				&lt;br /&gt;
| 0x0042&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx MIMO			&lt;br /&gt;
| 0x0043&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 2 MIMO	&lt;br /&gt;
| 0x0044&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 3 MIMO	&lt;br /&gt;
| 0x0045&lt;br /&gt;
|-&lt;br /&gt;
|TVRX2				&lt;br /&gt;
| 0x0046&lt;br /&gt;
|-&lt;br /&gt;
|WCDMA US			&lt;br /&gt;
| 0x004d&lt;br /&gt;
|-&lt;br /&gt;
|WCDMA EU			&lt;br /&gt;
| 0x004e&lt;br /&gt;
|-&lt;br /&gt;
|SIMPLE GDB			&lt;br /&gt;
| 0x004f&lt;br /&gt;
|-&lt;br /&gt;
|WBX LO TX			&lt;br /&gt;
| 0x0050&lt;br /&gt;
|-&lt;br /&gt;
|WBX LO RX			&lt;br /&gt;
| 0x0051&lt;br /&gt;
|-&lt;br /&gt;
|WBX NG TX			&lt;br /&gt;
| 0x0052&lt;br /&gt;
|-&lt;br /&gt;
|WBX NG RX			&lt;br /&gt;
| 0x0053&lt;br /&gt;
|-&lt;br /&gt;
|SBX v3 RX			&lt;br /&gt;
| 0x0054&lt;br /&gt;
|-&lt;br /&gt;
|SBX v3 TX			&lt;br /&gt;
| 0x0055&lt;br /&gt;
|-&lt;br /&gt;
|WBX v3 TX			&lt;br /&gt;
| 0x0056&lt;br /&gt;
|-&lt;br /&gt;
|WBX v3 RX			&lt;br /&gt;
| 0x0057&lt;br /&gt;
|-&lt;br /&gt;
|XCVR2450 - No Div	&lt;br /&gt;
| 0x0059&lt;br /&gt;
|-&lt;br /&gt;
|XCVR2450 TX			&lt;br /&gt;
| 0x0060&lt;br /&gt;
|-&lt;br /&gt;
|XCVR2450 RX			&lt;br /&gt;
| 0x0061&lt;br /&gt;
|-&lt;br /&gt;
|WBX v4 TX			&lt;br /&gt;
| 0x0062&lt;br /&gt;
|-&lt;br /&gt;
|WBX v4 RX			&lt;br /&gt;
| 0x0063&lt;br /&gt;
|-&lt;br /&gt;
|SBX v4 TX			&lt;br /&gt;
| 0x0064&lt;br /&gt;
|-&lt;br /&gt;
|SBX v4 RX			&lt;br /&gt;
| 0x0065&lt;br /&gt;
|-&lt;br /&gt;
|CBX v1 TX			&lt;br /&gt;
| 0x0066&lt;br /&gt;
|-&lt;br /&gt;
|CBX v1 RX			&lt;br /&gt;
| 0x0067&lt;br /&gt;
|-&lt;br /&gt;
|SBX v5 TX			&lt;br /&gt;
| 0x0068&lt;br /&gt;
|-&lt;br /&gt;
|SBX v5 RX			&lt;br /&gt;
| 0x0069&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v3 TX	&lt;br /&gt;
| 0x0073&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v3 RX &lt;br /&gt;
| 0x0074&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v4 TX &lt;br /&gt;
| 0x0075&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v4 RX &lt;br /&gt;
| 0x0076&lt;br /&gt;
|-&lt;br /&gt;
|UBX v1 TX			&lt;br /&gt;
| 0x0077&lt;br /&gt;
|-&lt;br /&gt;
|UBX v1 RX			&lt;br /&gt;
| 0x0078&lt;br /&gt;
|-&lt;br /&gt;
|UBX-160 v1 TX		&lt;br /&gt;
| 0x0079&lt;br /&gt;
|-&lt;br /&gt;
|UBX-160 v1 RX		&lt;br /&gt;
| 0x007a&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|UBX-40 v2 TX		&lt;br /&gt;
| 0x007b&lt;br /&gt;
|-&lt;br /&gt;
|UBX-40 v2 RX		&lt;br /&gt;
| 0x007c&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|UBX-160 v2 TX		&lt;br /&gt;
| 0x007d&lt;br /&gt;
|-&lt;br /&gt;
|UBX-160 v2 RX		&lt;br /&gt;
| 0x007e&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Bitshark RX			&lt;br /&gt;
| 0x0070&lt;br /&gt;
|-&lt;br /&gt;
|B150 v1 TX			&lt;br /&gt;
| 0x0071&lt;br /&gt;
|-&lt;br /&gt;
|B150 v1 RX			&lt;br /&gt;
| 0x0072&lt;br /&gt;
|-&lt;br /&gt;
|WBX-120 v1 TX		&lt;br /&gt;
| 0x0080&lt;br /&gt;
|-&lt;br /&gt;
|WBX-120 v1 RX		&lt;br /&gt;
| 0x0081&lt;br /&gt;
|-&lt;br /&gt;
|SBX-120 v1 TX		&lt;br /&gt;
| 0x0082&lt;br /&gt;
|-&lt;br /&gt;
|SBX-120 v1 RX		&lt;br /&gt;
| 0x0083&lt;br /&gt;
|-&lt;br /&gt;
|CBX-120 v1 TX		&lt;br /&gt;
| 0x0084&lt;br /&gt;
|-&lt;br /&gt;
|CBX-120 v1 RX		&lt;br /&gt;
| 0x0085&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev A TX		&lt;br /&gt;
| 0x0090&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev A RX 		&lt;br /&gt;
| 0x0091&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev B TX		&lt;br /&gt;
| 0x0092&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev B RX 		&lt;br /&gt;
| 0x0093&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev C TX 	&lt;br /&gt;
| 0x0094&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev C RX&lt;br /&gt;
| 0x0095&lt;br /&gt;
|-&lt;br /&gt;
|E300 AD3964 DB RevB	&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
|E310 AD9361 DB RevB	&lt;br /&gt;
| 0x0110&lt;br /&gt;
|-&lt;br /&gt;
|E300 AD9364 DB RevC	&lt;br /&gt;
| 0x0101&lt;br /&gt;
|-&lt;br /&gt;
|E310 AD9361 DB RevC	&lt;br /&gt;
| 0x0111&lt;br /&gt;
|-&lt;br /&gt;
|Unknown Tx			&lt;br /&gt;
| 0xfff0&lt;br /&gt;
|-&lt;br /&gt;
|Unknown Rx			&lt;br /&gt;
| 0xfff1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Motherboard IDs=&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Hex ID'''&lt;br /&gt;
|-&lt;br /&gt;
|B200&lt;br /&gt;
|0x7737&lt;br /&gt;
|-&lt;br /&gt;
|B210&lt;br /&gt;
|0x7738&lt;br /&gt;
|-&lt;br /&gt;
|B200mini&lt;br /&gt;
|0x7739&lt;br /&gt;
|-&lt;br /&gt;
|B205mini&lt;br /&gt;
|0x773a&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=About_the_Motherboard_and_Daughtercard_EEPROM_on_USRP_Devices&amp;diff=6136</id>
		<title>About the Motherboard and Daughtercard EEPROM on USRP Devices</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=About_the_Motherboard_and_Daughtercard_EEPROM_on_USRP_Devices&amp;diff=6136"/>
				<updated>2025-07-14T07:47:50Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* EEPROM Product ID */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number and Authors ==&lt;br /&gt;
'''AN-309''' by Trip Humphries and Michael Dickens&lt;br /&gt;
&amp;lt;!-- Internal use only: please do keep this updated!&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-05-16  &lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Trip Humphries&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2020-08-05  &lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Michael Dickens&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Add 2945 and 2955 info&lt;br /&gt;
|}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=USRP EEPROM Settings &amp;amp; Recovery Guide=&lt;br /&gt;
&lt;br /&gt;
Some USRP products contain an EEPROM on the motherboard which is used to store information about the USRP. Currently, the N200/210, X300/310, B200/210, and E100 contain an on-board EEPROM. The EEPROM contains information about each USRP such as product code, revision number, USRP name, and IP address. The specific information stores on each USRP EEPROM is dependent on the USRP model.&lt;br /&gt;
&lt;br /&gt;
Daughter boards also contain an EEPROM that contains identification information about the daughter board. UHD reads the daughter board ID to determine the model and revision (if applicable) of the daughter board. This information is used to properly configure the USRP and daughter board for proper function.&lt;br /&gt;
&lt;br /&gt;
==EEPROM Burn Utility==&lt;br /&gt;
&lt;br /&gt;
'''Disclaimer: Ettus Research accepts no liability for misuse of this utility. It can very easily cause irreversible damage if used incorrectly! Please contact Ettus support at [mailto:support@ettus.com support@ettus.com] if you are unsure how to proceed.'''&lt;br /&gt;
&lt;br /&gt;
A utility, usrp_burn_mb_eeprom, is included with UHD to read/write values on the various motherboards that contain an EEPROM. The utility is located in the UHD install directory. The default folder is:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/lib/uhd/utils/&lt;br /&gt;
&lt;br /&gt;
The utility can be used with the USRP X300/310, N200/210, B200/210, and E100. In some cases, it is necessary to use the utility to write custom user settings to the USRP, such as USRP name or IP address. In other cases, some EEPROM settings set by the factory may become corrupted and need to be restored. This section will cover basic usage of the usrp_burn_mb_eeprom utility, with USRP specific instructions covered in the sections below.&lt;br /&gt;
&lt;br /&gt;
EEPROM settings can be read using the usrp_burn_mb_eeprom utility. All the EEPROM settings can be read at once using the 'read all' option:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;lt;optional device args&amp;gt; --read-all&lt;br /&gt;
&lt;br /&gt;
This will return the current contents in the EEPROM for the specified USRP. For example, if you want to read all the EEPROM contents for a USRP B210, the command would look like:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;type=b200&amp;quot; --read-all &lt;br /&gt;
&lt;br /&gt;
The EEPROM settings vary based on the specific USRP in use. The following sections document the EEPROM settings available for each USRP. Examples for each USRP with an EEPROM are also given.&lt;br /&gt;
&lt;br /&gt;
=X300/310 EEPROM=&lt;br /&gt;
The EEPROM on the X300/310 stores useful information about the USRP so that UHD can set the proper settings based on model and revision. Some of these settings are user customizable. The table below outlines the values stored in the X300/310 EEPROM. Any entry that is designated &amp;quot;User Customizable?=No&amp;quot; can cause irreversible damage to the USRP and should only be altered by proper guidance from Ettus Support. For example, certain settings in the EEPROM could become corrupted and can be restored with the proper commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''X300/310 EEPROM Setting:'''&lt;br /&gt;
|'''User Customizable?'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|revision&lt;br /&gt;
|No&lt;br /&gt;
|Hardware Number&lt;br /&gt;
|-&lt;br /&gt;
|revision_compat&lt;br /&gt;
|No&lt;br /&gt;
|Revision Number&lt;br /&gt;
|-&lt;br /&gt;
|product&lt;br /&gt;
|No&lt;br /&gt;
|Product Code&lt;br /&gt;
|-&lt;br /&gt;
|serial&lt;br /&gt;
|No&lt;br /&gt;
|Unique USRP Serial Number&lt;br /&gt;
|-&lt;br /&gt;
|mac-addr0&lt;br /&gt;
|No&lt;br /&gt;
|MAC Address (Port 0)&lt;br /&gt;
|-&lt;br /&gt;
|mac-addr1&lt;br /&gt;
|No&lt;br /&gt;
|MAC Address (Port 1)&lt;br /&gt;
|-&lt;br /&gt;
|gateway&lt;br /&gt;
|Yes&lt;br /&gt;
|Network Gateway&lt;br /&gt;
|-&lt;br /&gt;
|subnet0&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|subnet1&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|subnet2&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|subnet3&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr0&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr1&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr2&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr3&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|name&lt;br /&gt;
|Yes&lt;br /&gt;
|Custom USRP Name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As an example, the EEPROM settings of an X310 with IP address 192.168.10.2 could be read-back with the following command:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;addr=192.168.10.2,type=x300&amp;quot; --read-all&lt;br /&gt;
&lt;br /&gt;
and the output would look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fetching current settings from EEPROM...&lt;br /&gt;
	EEPROM [&amp;quot;revision&amp;quot;] is &amp;quot;4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;revision_compat&amp;quot;] is &amp;quot;2&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;product&amp;quot;] is &amp;quot;30AD2D4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;mac-addr0&amp;quot;] is &amp;quot;xx:xx:xx:xx:xx:xx&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;mac-addr1&amp;quot;] is &amp;quot;xx:xx:xx:xx:xx:xx&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;gateway&amp;quot;] is &amp;quot;192.168.10.1&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr0&amp;quot;] is &amp;quot;192.168.10.2&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet0&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr1&amp;quot;] is &amp;quot;192.168.20.2&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet1&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr2&amp;quot;] is &amp;quot;192.168.10.3&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet2&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr3&amp;quot;] is &amp;quot;192.168.40.2&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet3&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;serial&amp;quot;] is &amp;quot;30AF217&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;name&amp;quot;] is &amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Determining X300/X310 Revision Number==&lt;br /&gt;
It is useful in many cases to determine the revision number of your X300/X310. A part number sticker is located on the X300/310 motherboard. This sticker is located near the AUX-I/O connector and has the format 123456\&amp;lt;R&amp;gt;-\&amp;lt;XXX&amp;gt; where \&amp;lt;R&amp;gt; is a letter code that corresponds to the revision number. The photograph below highlights the location of the sticker:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:an-309-x3x0-rev-id.png|thumb|500px|center|The USRP X300/310 motherboard has a sticker that identifies the product and revision. The sticker is outlined in red.]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the letter code has been determined use the table below to map the letter code to a revision number:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Letter'''&lt;br /&gt;
|'''Revision #'''&lt;br /&gt;
|-&lt;br /&gt;
|C&lt;br /&gt;
|3&lt;br /&gt;
|-&lt;br /&gt;
|D&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
|E&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|F&lt;br /&gt;
|6&lt;br /&gt;
|-&lt;br /&gt;
|G&lt;br /&gt;
|7&lt;br /&gt;
|-&lt;br /&gt;
|H&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|I&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|J&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|K&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Restore X300/310 EEPROM Revision Code==&lt;br /&gt;
&lt;br /&gt;
A corrupted or missing revision code in the X300/310 EEPROM will be indicated by a UHD runtime error:&lt;br /&gt;
&lt;br /&gt;
 Error: RuntimeError: No revision compat detected. MB EEPROM must be reprogrammed!&lt;br /&gt;
&lt;br /&gt;
If this problem is encountered, the usrp_burn_mb_eeprom utility can be used to restore the X300/310 revision code in the EEPROM. First, the X300/X310 revision number must be determined. Once the revision number for your X300/310 is known, the usrp_burn_mb_eeprom utility can be used to restore the revision code to the EEPROM. The syntax is as follows:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom&amp;quot; --values=&amp;quot;revision=&amp;lt;#&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;#&amp;gt; is the revision number of your X300/310 to be written to the EEPROM. For example, to restore the revision number in EEPROM for a Rev. 6 X300 with an IP address of 192.168.10.2, the command would be:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom,addr=192.168.10.2&amp;quot; --values=&amp;quot;revision=6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After the utility has been run, power cycle the USRP and then run uhd_usrp_probe to ensure that the new revision number has been written to the EEPROM correctly. If you are unsure of how to accomplish these steps, please feel free to contact Ettus Support at [mailto:support@ettus.com support@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Restore X300/310 EEPROM Product Code==&lt;br /&gt;
&lt;br /&gt;
A corrupted product code in the X300/310 EEPROM will be indicated by a UHD warning:&lt;br /&gt;
&lt;br /&gt;
 UHD Warning: X300/X310 unknown product code in EEPROM: &amp;lt;###&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;###&amp;gt; is some numbered code that is unknown by UHD. If this problem is encountered, the usrp_burn_mb_eeprom utility can be used to write a new product code to the EEPROM. First, the X300/X310 revision number must be determined. Once the revision number has been determined, refer to the table below to find the product code for the X300/310:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''USRP'''&lt;br /&gt;
|'''Rev. 0-6'''&lt;br /&gt;
|'''Rev. 7-8'''&lt;br /&gt;
|-&lt;br /&gt;
|X300&lt;br /&gt;
|30518 (0x7736)&lt;br /&gt;
|30817 (0x7861)&lt;br /&gt;
|-&lt;br /&gt;
|X310&lt;br /&gt;
|30410 (0x76CA)&lt;br /&gt;
|30818 (0x7862)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the correct product code has been determined base on the X3x0 model and revision, the usrp_burn_mb_eeprom utility can be used to write the correct product code to the EEPROM. They syntax is as follows:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom&amp;quot; --values=&amp;quot;product=&amp;lt;###&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;###&amp;gt; is the product code to be written to the EEPROM. For example, on a Rev. 7 X300 with an IP address of 191.168.10.2, the command would be:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom,addr=192.168.10.2&amp;quot; --values=&amp;quot;product=30817&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After the utility has been run, power cycle the USRP and then run uhd_usrp_probe to ensure that the new revision number has been written to the EEPROM correctly. If you are unsure of how to accomplish these steps, please feel free to contact Ettus Support at [mailto:support@ettus.com support@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==National Instruments USRP RIO==&lt;br /&gt;
&lt;br /&gt;
The National Instruments branded X300/310 have unique product codes to identify the motherboard revision as well as the daughter-cards in the USRP. The product codes are listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Model (DB, BW, Rev.)'''&lt;br /&gt;
|'''Hex ID'''&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 40 MHz BW, Rev. 0-6)       &lt;br /&gt;
|0x772B&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 40 MHz BW, Rev. 7+)        &lt;br /&gt;
|0x7853&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 120 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x77FB&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 120 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x785B&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 40 MHz BW, Rev. 0-6)       &lt;br /&gt;
|0x772C&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 40 MHz BW, Rev. 7+)        &lt;br /&gt;
|0x7854&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 120 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x77FC&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 120 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x785C&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 40 MHz BW, Rev. 0-6)       &lt;br /&gt;
|0x772D&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 40 MHz BW, Rev. 7+)        &lt;br /&gt;
|0x7855&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 120 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x77FD&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 120 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x785D&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2944R (UBX, 160 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x772E&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2944R (UBX, 160 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x7856&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2945R (TwinRX, 80 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x78EF&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 40 MHz BW, Rev. 0-6)  &lt;br /&gt;
|0x772F&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 40 MHz BW, Rev. 7+)   &lt;br /&gt;
|0x7857&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 120 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x77FE&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 120 MHz BW, Rev. 7+   &lt;br /&gt;
|0x785E&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 40 MHz BW, Rev. 0-6)  &lt;br /&gt;
|0x7730&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 40 MHz BW, Rev. 7+)   &lt;br /&gt;
|0x7858&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 120 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x77FF&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 120 MHz BW, Rev. 7+   &lt;br /&gt;
|0x785F&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 40 MHz BW, Rev. 0-6)  &lt;br /&gt;
|0x7731&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 40 MHz BW, Rev. 7+)   &lt;br /&gt;
|0x7859&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 120 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x7800&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 120 MHz BW, Rev. 7+)  &lt;br /&gt;
|0x7860&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2954R (GPS, UBX, 160 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x7732&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2954R (GPS, UBX, 160 MHz BW, Rev. 7+)  &lt;br /&gt;
|0x785A&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2955R (TwinRX, 80 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x78F0&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=N200/210 EEPROM=&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''N200/210 EEPROM Setting'''&lt;br /&gt;
|'''User Customizable?'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|hardware&lt;br /&gt;
|No&lt;br /&gt;
|Hardware Number&lt;br /&gt;
|-&lt;br /&gt;
|revision&lt;br /&gt;
|No&lt;br /&gt;
|Revision Number&lt;br /&gt;
|-&lt;br /&gt;
|product&lt;br /&gt;
|No&lt;br /&gt;
|Product Code&lt;br /&gt;
|-&lt;br /&gt;
|mac-addr&lt;br /&gt;
|No&lt;br /&gt;
|MAC Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|subnet&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnetwork&lt;br /&gt;
|-&lt;br /&gt;
|gateway&lt;br /&gt;
|Yes&lt;br /&gt;
|Network Gateway&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The N200/210 do not store the product codes in the motherboard EEPROM. The &amp;quot;hardware&amp;quot; field is programmed at the factory but is not referenced by UHD. Instead, the revision field is used to determine the N200/210 hardware in use. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''USRP'''&lt;br /&gt;
|'''Motherboard Product ID'''&lt;br /&gt;
|-&lt;br /&gt;
|N200&lt;br /&gt;
|0x0A00&lt;br /&gt;
|-&lt;br /&gt;
|N210&lt;br /&gt;
|0x0A01&lt;br /&gt;
|-&lt;br /&gt;
|N200 - R4&lt;br /&gt;
|0x0A10&lt;br /&gt;
|-&lt;br /&gt;
|N210 - R4&lt;br /&gt;
|0x0A11&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=B200/210 and B200mini EEPROM=&lt;br /&gt;
&lt;br /&gt;
The USRP B200 and B210 EEPROM is used to store certain information about each board. The USB PID (Product ID) and VID (Vendor ID) are stored in the EEPROM as well as serial number, product code, hardware revision, and USRP name for each B200/210. A table of these settings and whether or not the setting is user customizable is given below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''B200/210 EEPROM Setting'''&lt;br /&gt;
|'''User Customizable?'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|revision&lt;br /&gt;
|No&lt;br /&gt;
|Revision Number&lt;br /&gt;
|-&lt;br /&gt;
|product&lt;br /&gt;
|No&lt;br /&gt;
|Product Code&lt;br /&gt;
|-&lt;br /&gt;
|serial&lt;br /&gt;
|No&lt;br /&gt;
|Unique Serial Number&lt;br /&gt;
|-&lt;br /&gt;
|name&lt;br /&gt;
|Yes&lt;br /&gt;
|Custom USRP Name&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To read the current EEPROM values from the USRP, use the usrp_burn_mb_eeprom utility:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;type=b200&amp;quot; --read-all&lt;br /&gt;
&lt;br /&gt;
This will read the settings and print them to the terminal. A sample output is shown below for a USRP B210:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fetching current settings from EEPROM...&lt;br /&gt;
	EEPROM [&amp;quot;revision&amp;quot;] is &amp;quot;4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;product&amp;quot;] is &amp;quot;2&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;serial&amp;quot;] is &amp;quot;30AD2D4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;name&amp;quot;] is &amp;quot;MyB210&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If desired, a B200/210 could be given a custom name with the following command:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;type=b200&amp;quot; --values=&amp;quot;name=Lab_B210&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After the command has been run, the device must be power-cycled for the new EEPROM setting to take effect. Reading the updated EEPROM values yields:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fetching current settings from EEPROM...&lt;br /&gt;
	EEPROM [&amp;quot;revision&amp;quot;] is &amp;quot;4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;product&amp;quot;] is &amp;quot;2&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;serial&amp;quot;] is &amp;quot;30AD2D4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;name&amp;quot;] is &amp;quot;Lab_B210&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EEPROM Product ID==&lt;br /&gt;
&lt;br /&gt;
The product code and the product revision stored in the EEPROM of the USRP&lt;br /&gt;
B200/B210 devices are used to identify the specific model and revision of the&lt;br /&gt;
device. The product code is a unique identifier that corresponds to the&lt;br /&gt;
specific hardware design, while the product revision indicates the version of&lt;br /&gt;
that design.&lt;br /&gt;
&lt;br /&gt;
In case of EEPROM corruption, the following table can help identify the correct&lt;br /&gt;
revision and product code that is written into the EEPROM during the manufacturing&lt;br /&gt;
process, by comparing to the USRP Type and NI Part Number, which can be found&lt;br /&gt;
on the blue sticker on the PCB. The &amp;quot;Letter Revision&amp;quot; is the last letter of&lt;br /&gt;
the NI Part Number.&lt;br /&gt;
&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  |'''USRP Type'''&lt;br /&gt;
  |'''NI PN'''&lt;br /&gt;
  |'''Letter Revision'''&lt;br /&gt;
  |'''EEPROM Product Code (Ettus Branding)'''&lt;br /&gt;
  |'''EEPROM Product Code (NI Branding)'''&lt;br /&gt;
  |'''EEPROM Revision No'''&lt;br /&gt;
  |'''Comments'''&lt;br /&gt;
  |-&lt;br /&gt;
  |B210&lt;br /&gt;
  |156229A-01L, 156229B-01L&lt;br /&gt;
  |A, B&lt;br /&gt;
  |2&lt;br /&gt;
  |0x7738, 0x7814&lt;br /&gt;
  |4&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200&lt;br /&gt;
  |156229A-02L, 156229B-02L&lt;br /&gt;
  |A, B&lt;br /&gt;
  |1&lt;br /&gt;
  |0x7737, 0x7813&lt;br /&gt;
  |4&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200&lt;br /&gt;
  |156229C-02L, 156229D-02L&lt;br /&gt;
  |C, D&lt;br /&gt;
  |1&lt;br /&gt;
  |0x7737, 0x7813&lt;br /&gt;
  |5&lt;br /&gt;
  |This revision switched from AD9361 to AD9634, and thus had to switch the RF side.&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034A-01L, 159034A-02L, 159034A-03L&lt;br /&gt;
  |A&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |1&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034B-01L, 159034B-02L, 159034B-03L&lt;br /&gt;
  |B&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |2&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034C-01L, 159034C-02L, 159034C-03L&lt;br /&gt;
  |C&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |3&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034D-01L, 159034D-02L, 159034D-03L&lt;br /&gt;
  |D&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |4&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034E-01L, 159034E-02L, 159034E-03L&lt;br /&gt;
  |E&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |5&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034{F,G}-01L, 159034{F,G}-02L, 159034{F,G}-03L&lt;br /&gt;
  |{F,G}&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |6&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B206mini&lt;br /&gt;
  |117434A-01L&lt;br /&gt;
  |A&lt;br /&gt;
  |0x0005&lt;br /&gt;
  |0x773b&lt;br /&gt;
  |1&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B206mini&lt;br /&gt;
  |117434B-01L&lt;br /&gt;
  |B&lt;br /&gt;
  |0x0005&lt;br /&gt;
  |0x773b&lt;br /&gt;
  |2&lt;br /&gt;
  |&lt;br /&gt;
  |- &lt;br /&gt;
  |}&lt;br /&gt;
&lt;br /&gt;
==USB VID/PID==&lt;br /&gt;
&lt;br /&gt;
The USB vendor identification (VID) and product identification (PID) numbers can be written to the USRP B200/210 using the &amp;quot;b2xx_fx3_utils&amp;quot; utility that is included with UHD. To reset the VID and PID, the command would be:&lt;br /&gt;
&lt;br /&gt;
 ./b2xx_fx3_utils --init-device --write-vid 0x2500 --write-pid -0x0020&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''USRP'''&lt;br /&gt;
|'''USB PID'''&lt;br /&gt;
|-&lt;br /&gt;
|B200&lt;br /&gt;
|0x0020&lt;br /&gt;
|-&lt;br /&gt;
|B210&lt;br /&gt;
|0x0020&lt;br /&gt;
|-&lt;br /&gt;
|B200 (NI)&lt;br /&gt;
|0x7813&lt;br /&gt;
|-&lt;br /&gt;
|B210 (NI)&lt;br /&gt;
|0x7814&lt;br /&gt;
|-&lt;br /&gt;
|B200mini&lt;br /&gt;
|0x0021&lt;br /&gt;
|-&lt;br /&gt;
|B205mini&lt;br /&gt;
|0x0022&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VID is the same for all B2x0 variants, 0x2500.&lt;br /&gt;
&lt;br /&gt;
=Daughtercard IDs=&lt;br /&gt;
&lt;br /&gt;
Below is a comprehensive list of the daughtercard hex ID's.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Hex ID'''&lt;br /&gt;
|-&lt;br /&gt;
|Basic Tx		    &lt;br /&gt;
| 0x0000&lt;br /&gt;
|-&lt;br /&gt;
|Basic Rx   		    &lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|DBS Rx      		&lt;br /&gt;
| 0x0002&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx       		&lt;br /&gt;
| 0x0003&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Rx			&lt;br /&gt;
| 0x0004&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Rx			&lt;br /&gt;
| 0x0005&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Rx		&lt;br /&gt;
| 0x0006&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Rx		&lt;br /&gt;
| 0x0007&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Tx			&lt;br /&gt;
| 0x0008&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Tx			&lt;br /&gt;
| 0x0009&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Tx		&lt;br /&gt;
| 0x000a&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Tx		&lt;br /&gt;
| 0x000b&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 2			&lt;br /&gt;
| 0x000c&lt;br /&gt;
|-&lt;br /&gt;
|DBS Rx ClkMod		&lt;br /&gt;
| 0x000d&lt;br /&gt;
|-&lt;br /&gt;
|LF Tx				&lt;br /&gt;
| 0x000e&lt;br /&gt;
|-&lt;br /&gt;
|LF Rx				&lt;br /&gt;
| 0x000f&lt;br /&gt;
|-&lt;br /&gt;
|DBSRX2				&lt;br /&gt;
| 0x012&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Rx MIMO A	&lt;br /&gt;
| 0x0014&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Rx MIMO A	&lt;br /&gt;
| 0x0015&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Rx MIMO A &lt;br /&gt;
| 0x0016&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Rx MIMO A &lt;br /&gt;
| 0x0017&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Tx MIMO A  &lt;br /&gt;
| 0x0018&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Tx MIMO A	&lt;br /&gt;
| 0x0019&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Tx MIMO A &lt;br /&gt;
| 0x001a&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Tx MIMO A &lt;br /&gt;
| 0x001b&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Rx MIMO B	&lt;br /&gt;
| 0x0024&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Rx MIMO B  &lt;br /&gt;
| 0x0025&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Rx MIMO B &lt;br /&gt;
| 0x0026&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Rx MIMO B &lt;br /&gt;
| 0x0027&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Tx MIMO B	&lt;br /&gt;
| 0x0028&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Tx MIMO B	&lt;br /&gt;
| 0x0029&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Tx MIMO B	&lt;br /&gt;
| 0x002a&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Tx MIMO B &lt;br /&gt;
| 0x002b&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2200 Rx MIMO B &lt;br /&gt;
| 0x002c&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2200 Tx MIMO B	&lt;br /&gt;
| 0x002d&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Rx		&lt;br /&gt;
| 0x0030&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Tx		&lt;br /&gt;
| 0x0031&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Rx MIMO A	&lt;br /&gt;
| 0x0032&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Tx MIMO A	&lt;br /&gt;
| 0x0033&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Rx MIMO B &lt;br /&gt;
| 0x0034&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Tx MIMO B &lt;br /&gt;
| 0x0035&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 3			&lt;br /&gt;
| 0x0040&lt;br /&gt;
|-&lt;br /&gt;
|DTT754				&lt;br /&gt;
| 0x0041&lt;br /&gt;
|-&lt;br /&gt;
|DTT768				&lt;br /&gt;
| 0x0042&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx MIMO			&lt;br /&gt;
| 0x0043&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 2 MIMO	&lt;br /&gt;
| 0x0044&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 3 MIMO	&lt;br /&gt;
| 0x0045&lt;br /&gt;
|-&lt;br /&gt;
|TVRX2				&lt;br /&gt;
| 0x0046&lt;br /&gt;
|-&lt;br /&gt;
|WCDMA US			&lt;br /&gt;
| 0x004d&lt;br /&gt;
|-&lt;br /&gt;
|WCDMA EU			&lt;br /&gt;
| 0x004e&lt;br /&gt;
|-&lt;br /&gt;
|SIMPLE GDB			&lt;br /&gt;
| 0x004f&lt;br /&gt;
|-&lt;br /&gt;
|WBX LO TX			&lt;br /&gt;
| 0x0050&lt;br /&gt;
|-&lt;br /&gt;
|WBX LO RX			&lt;br /&gt;
| 0x0051&lt;br /&gt;
|-&lt;br /&gt;
|WBX NG TX			&lt;br /&gt;
| 0x0052&lt;br /&gt;
|-&lt;br /&gt;
|WBX NG RX			&lt;br /&gt;
| 0x0053&lt;br /&gt;
|-&lt;br /&gt;
|SBX v3 RX			&lt;br /&gt;
| 0x0054&lt;br /&gt;
|-&lt;br /&gt;
|SBX v3 TX			&lt;br /&gt;
| 0x0055&lt;br /&gt;
|-&lt;br /&gt;
|WBX v3 TX			&lt;br /&gt;
| 0x0056&lt;br /&gt;
|-&lt;br /&gt;
|WBX v3 RX			&lt;br /&gt;
| 0x0057&lt;br /&gt;
|-&lt;br /&gt;
|XCVR2450 - No Div	&lt;br /&gt;
| 0x0059&lt;br /&gt;
|-&lt;br /&gt;
|XCVR2450 TX			&lt;br /&gt;
| 0x0060&lt;br /&gt;
|-&lt;br /&gt;
|XCVR2450 RX			&lt;br /&gt;
| 0x0061&lt;br /&gt;
|-&lt;br /&gt;
|WBX v4 TX			&lt;br /&gt;
| 0x0062&lt;br /&gt;
|-&lt;br /&gt;
|WBX v4 RX			&lt;br /&gt;
| 0x0063&lt;br /&gt;
|-&lt;br /&gt;
|SBX v4 TX			&lt;br /&gt;
| 0x0064&lt;br /&gt;
|-&lt;br /&gt;
|SBX v4 RX			&lt;br /&gt;
| 0x0065&lt;br /&gt;
|-&lt;br /&gt;
|CBX v1 TX			&lt;br /&gt;
| 0x0066&lt;br /&gt;
|-&lt;br /&gt;
|CBX v1 RX			&lt;br /&gt;
| 0x0067&lt;br /&gt;
|-&lt;br /&gt;
|SBX v5 TX			&lt;br /&gt;
| 0x0068&lt;br /&gt;
|-&lt;br /&gt;
|SBX v5 RX			&lt;br /&gt;
| 0x0069&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v3 TX	&lt;br /&gt;
| 0x0073&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v3 RX &lt;br /&gt;
| 0x0074&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v4 TX &lt;br /&gt;
| 0x0075&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v4 RX &lt;br /&gt;
| 0x0076&lt;br /&gt;
|-&lt;br /&gt;
|UBX v1 TX			&lt;br /&gt;
| 0x0077&lt;br /&gt;
|-&lt;br /&gt;
|UBX v1 RX			&lt;br /&gt;
| 0x0078&lt;br /&gt;
|-&lt;br /&gt;
|UBX-160 v1 TX		&lt;br /&gt;
| 0x0079&lt;br /&gt;
|-&lt;br /&gt;
|UBX-160 v1 RX		&lt;br /&gt;
| 0x007a&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|UBX-40 v2 TX		&lt;br /&gt;
| 0x007b&lt;br /&gt;
|-&lt;br /&gt;
|UBX-40 v2 RX		&lt;br /&gt;
| 0x007c&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|UBX-160 v2 TX		&lt;br /&gt;
| 0x007d&lt;br /&gt;
|-&lt;br /&gt;
|UBX-160 v2 RX		&lt;br /&gt;
| 0x007e&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Bitshark RX			&lt;br /&gt;
| 0x0070&lt;br /&gt;
|-&lt;br /&gt;
|B150 v1 TX			&lt;br /&gt;
| 0x0071&lt;br /&gt;
|-&lt;br /&gt;
|B150 v1 RX			&lt;br /&gt;
| 0x0072&lt;br /&gt;
|-&lt;br /&gt;
|WBX-120 v1 TX		&lt;br /&gt;
| 0x0080&lt;br /&gt;
|-&lt;br /&gt;
|WBX-120 v1 RX		&lt;br /&gt;
| 0x0081&lt;br /&gt;
|-&lt;br /&gt;
|SBX-120 v1 TX		&lt;br /&gt;
| 0x0082&lt;br /&gt;
|-&lt;br /&gt;
|SBX-120 v1 RX		&lt;br /&gt;
| 0x0083&lt;br /&gt;
|-&lt;br /&gt;
|CBX-120 v1 TX		&lt;br /&gt;
| 0x0084&lt;br /&gt;
|-&lt;br /&gt;
|CBX-120 v1 RX		&lt;br /&gt;
| 0x0085&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev A TX		&lt;br /&gt;
| 0x0090&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev A RX 		&lt;br /&gt;
| 0x0091&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev B TX		&lt;br /&gt;
| 0x0092&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev B RX 		&lt;br /&gt;
| 0x0093&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev C TX 	&lt;br /&gt;
| 0x0094&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev C RX&lt;br /&gt;
| 0x0095&lt;br /&gt;
|-&lt;br /&gt;
|E300 AD3964 DB RevB	&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
|E310 AD9361 DB RevB	&lt;br /&gt;
| 0x0110&lt;br /&gt;
|-&lt;br /&gt;
|E300 AD9364 DB RevC	&lt;br /&gt;
| 0x0101&lt;br /&gt;
|-&lt;br /&gt;
|E310 AD9361 DB RevC	&lt;br /&gt;
| 0x0111&lt;br /&gt;
|-&lt;br /&gt;
|Unknown Tx			&lt;br /&gt;
| 0xfff0&lt;br /&gt;
|-&lt;br /&gt;
|Unknown Rx			&lt;br /&gt;
| 0xfff1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Motherboard IDs=&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Hex ID'''&lt;br /&gt;
|-&lt;br /&gt;
|B200&lt;br /&gt;
|0x7737&lt;br /&gt;
|-&lt;br /&gt;
|B210&lt;br /&gt;
|0x7738&lt;br /&gt;
|-&lt;br /&gt;
|B200mini&lt;br /&gt;
|0x7739&lt;br /&gt;
|-&lt;br /&gt;
|B205mini&lt;br /&gt;
|0x773a&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=About_the_Motherboard_and_Daughtercard_EEPROM_on_USRP_Devices&amp;diff=6135</id>
		<title>About the Motherboard and Daughtercard EEPROM on USRP Devices</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=About_the_Motherboard_and_Daughtercard_EEPROM_on_USRP_Devices&amp;diff=6135"/>
				<updated>2025-07-11T13:08:17Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* B200/210 and B200mini EEPROM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number and Authors ==&lt;br /&gt;
'''AN-309''' by Trip Humphries and Michael Dickens&lt;br /&gt;
&amp;lt;!-- Internal use only: please do keep this updated!&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-05-16  &lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Trip Humphries&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2020-08-05  &lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Michael Dickens&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Add 2945 and 2955 info&lt;br /&gt;
|}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=USRP EEPROM Settings &amp;amp; Recovery Guide=&lt;br /&gt;
&lt;br /&gt;
Some USRP products contain an EEPROM on the motherboard which is used to store information about the USRP. Currently, the N200/210, X300/310, B200/210, and E100 contain an on-board EEPROM. The EEPROM contains information about each USRP such as product code, revision number, USRP name, and IP address. The specific information stores on each USRP EEPROM is dependent on the USRP model.&lt;br /&gt;
&lt;br /&gt;
Daughter boards also contain an EEPROM that contains identification information about the daughter board. UHD reads the daughter board ID to determine the model and revision (if applicable) of the daughter board. This information is used to properly configure the USRP and daughter board for proper function.&lt;br /&gt;
&lt;br /&gt;
==EEPROM Burn Utility==&lt;br /&gt;
&lt;br /&gt;
'''Disclaimer: Ettus Research accepts no liability for misuse of this utility. It can very easily cause irreversible damage if used incorrectly! Please contact Ettus support at [mailto:support@ettus.com support@ettus.com] if you are unsure how to proceed.'''&lt;br /&gt;
&lt;br /&gt;
A utility, usrp_burn_mb_eeprom, is included with UHD to read/write values on the various motherboards that contain an EEPROM. The utility is located in the UHD install directory. The default folder is:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/lib/uhd/utils/&lt;br /&gt;
&lt;br /&gt;
The utility can be used with the USRP X300/310, N200/210, B200/210, and E100. In some cases, it is necessary to use the utility to write custom user settings to the USRP, such as USRP name or IP address. In other cases, some EEPROM settings set by the factory may become corrupted and need to be restored. This section will cover basic usage of the usrp_burn_mb_eeprom utility, with USRP specific instructions covered in the sections below.&lt;br /&gt;
&lt;br /&gt;
EEPROM settings can be read using the usrp_burn_mb_eeprom utility. All the EEPROM settings can be read at once using the 'read all' option:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;lt;optional device args&amp;gt; --read-all&lt;br /&gt;
&lt;br /&gt;
This will return the current contents in the EEPROM for the specified USRP. For example, if you want to read all the EEPROM contents for a USRP B210, the command would look like:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;type=b200&amp;quot; --read-all &lt;br /&gt;
&lt;br /&gt;
The EEPROM settings vary based on the specific USRP in use. The following sections document the EEPROM settings available for each USRP. Examples for each USRP with an EEPROM are also given.&lt;br /&gt;
&lt;br /&gt;
=X300/310 EEPROM=&lt;br /&gt;
The EEPROM on the X300/310 stores useful information about the USRP so that UHD can set the proper settings based on model and revision. Some of these settings are user customizable. The table below outlines the values stored in the X300/310 EEPROM. Any entry that is designated &amp;quot;User Customizable?=No&amp;quot; can cause irreversible damage to the USRP and should only be altered by proper guidance from Ettus Support. For example, certain settings in the EEPROM could become corrupted and can be restored with the proper commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''X300/310 EEPROM Setting:'''&lt;br /&gt;
|'''User Customizable?'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|revision&lt;br /&gt;
|No&lt;br /&gt;
|Hardware Number&lt;br /&gt;
|-&lt;br /&gt;
|revision_compat&lt;br /&gt;
|No&lt;br /&gt;
|Revision Number&lt;br /&gt;
|-&lt;br /&gt;
|product&lt;br /&gt;
|No&lt;br /&gt;
|Product Code&lt;br /&gt;
|-&lt;br /&gt;
|serial&lt;br /&gt;
|No&lt;br /&gt;
|Unique USRP Serial Number&lt;br /&gt;
|-&lt;br /&gt;
|mac-addr0&lt;br /&gt;
|No&lt;br /&gt;
|MAC Address (Port 0)&lt;br /&gt;
|-&lt;br /&gt;
|mac-addr1&lt;br /&gt;
|No&lt;br /&gt;
|MAC Address (Port 1)&lt;br /&gt;
|-&lt;br /&gt;
|gateway&lt;br /&gt;
|Yes&lt;br /&gt;
|Network Gateway&lt;br /&gt;
|-&lt;br /&gt;
|subnet0&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|subnet1&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|subnet2&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|subnet3&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnet Mask&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr0&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr1&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr2&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr3&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|name&lt;br /&gt;
|Yes&lt;br /&gt;
|Custom USRP Name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As an example, the EEPROM settings of an X310 with IP address 192.168.10.2 could be read-back with the following command:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;addr=192.168.10.2,type=x300&amp;quot; --read-all&lt;br /&gt;
&lt;br /&gt;
and the output would look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fetching current settings from EEPROM...&lt;br /&gt;
	EEPROM [&amp;quot;revision&amp;quot;] is &amp;quot;4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;revision_compat&amp;quot;] is &amp;quot;2&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;product&amp;quot;] is &amp;quot;30AD2D4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;mac-addr0&amp;quot;] is &amp;quot;xx:xx:xx:xx:xx:xx&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;mac-addr1&amp;quot;] is &amp;quot;xx:xx:xx:xx:xx:xx&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;gateway&amp;quot;] is &amp;quot;192.168.10.1&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr0&amp;quot;] is &amp;quot;192.168.10.2&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet0&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr1&amp;quot;] is &amp;quot;192.168.20.2&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet1&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr2&amp;quot;] is &amp;quot;192.168.10.3&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet2&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;ip-addr3&amp;quot;] is &amp;quot;192.168.40.2&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;subnet3&amp;quot;] is &amp;quot;255.255.255.0&amp;quot;&lt;br /&gt;
	EEPROM [&amp;quot;serial&amp;quot;] is &amp;quot;30AF217&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;name&amp;quot;] is &amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Determining X300/X310 Revision Number==&lt;br /&gt;
It is useful in many cases to determine the revision number of your X300/X310. A part number sticker is located on the X300/310 motherboard. This sticker is located near the AUX-I/O connector and has the format 123456\&amp;lt;R&amp;gt;-\&amp;lt;XXX&amp;gt; where \&amp;lt;R&amp;gt; is a letter code that corresponds to the revision number. The photograph below highlights the location of the sticker:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:an-309-x3x0-rev-id.png|thumb|500px|center|The USRP X300/310 motherboard has a sticker that identifies the product and revision. The sticker is outlined in red.]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the letter code has been determined use the table below to map the letter code to a revision number:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Letter'''&lt;br /&gt;
|'''Revision #'''&lt;br /&gt;
|-&lt;br /&gt;
|C&lt;br /&gt;
|3&lt;br /&gt;
|-&lt;br /&gt;
|D&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
|E&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|F&lt;br /&gt;
|6&lt;br /&gt;
|-&lt;br /&gt;
|G&lt;br /&gt;
|7&lt;br /&gt;
|-&lt;br /&gt;
|H&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|I&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|J&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|K&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Restore X300/310 EEPROM Revision Code==&lt;br /&gt;
&lt;br /&gt;
A corrupted or missing revision code in the X300/310 EEPROM will be indicated by a UHD runtime error:&lt;br /&gt;
&lt;br /&gt;
 Error: RuntimeError: No revision compat detected. MB EEPROM must be reprogrammed!&lt;br /&gt;
&lt;br /&gt;
If this problem is encountered, the usrp_burn_mb_eeprom utility can be used to restore the X300/310 revision code in the EEPROM. First, the X300/X310 revision number must be determined. Once the revision number for your X300/310 is known, the usrp_burn_mb_eeprom utility can be used to restore the revision code to the EEPROM. The syntax is as follows:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom&amp;quot; --values=&amp;quot;revision=&amp;lt;#&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;#&amp;gt; is the revision number of your X300/310 to be written to the EEPROM. For example, to restore the revision number in EEPROM for a Rev. 6 X300 with an IP address of 192.168.10.2, the command would be:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom,addr=192.168.10.2&amp;quot; --values=&amp;quot;revision=6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After the utility has been run, power cycle the USRP and then run uhd_usrp_probe to ensure that the new revision number has been written to the EEPROM correctly. If you are unsure of how to accomplish these steps, please feel free to contact Ettus Support at [mailto:support@ettus.com support@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Restore X300/310 EEPROM Product Code==&lt;br /&gt;
&lt;br /&gt;
A corrupted product code in the X300/310 EEPROM will be indicated by a UHD warning:&lt;br /&gt;
&lt;br /&gt;
 UHD Warning: X300/X310 unknown product code in EEPROM: &amp;lt;###&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;###&amp;gt; is some numbered code that is unknown by UHD. If this problem is encountered, the usrp_burn_mb_eeprom utility can be used to write a new product code to the EEPROM. First, the X300/X310 revision number must be determined. Once the revision number has been determined, refer to the table below to find the product code for the X300/310:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''USRP'''&lt;br /&gt;
|'''Rev. 0-6'''&lt;br /&gt;
|'''Rev. 7-8'''&lt;br /&gt;
|-&lt;br /&gt;
|X300&lt;br /&gt;
|30518 (0x7736)&lt;br /&gt;
|30817 (0x7861)&lt;br /&gt;
|-&lt;br /&gt;
|X310&lt;br /&gt;
|30410 (0x76CA)&lt;br /&gt;
|30818 (0x7862)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the correct product code has been determined base on the X3x0 model and revision, the usrp_burn_mb_eeprom utility can be used to write the correct product code to the EEPROM. They syntax is as follows:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom&amp;quot; --values=&amp;quot;product=&amp;lt;###&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;###&amp;gt; is the product code to be written to the EEPROM. For example, on a Rev. 7 X300 with an IP address of 191.168.10.2, the command would be:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;recover_mb_eeprom,addr=192.168.10.2&amp;quot; --values=&amp;quot;product=30817&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After the utility has been run, power cycle the USRP and then run uhd_usrp_probe to ensure that the new revision number has been written to the EEPROM correctly. If you are unsure of how to accomplish these steps, please feel free to contact Ettus Support at [mailto:support@ettus.com support@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==National Instruments USRP RIO==&lt;br /&gt;
&lt;br /&gt;
The National Instruments branded X300/310 have unique product codes to identify the motherboard revision as well as the daughter-cards in the USRP. The product codes are listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Model (DB, BW, Rev.)'''&lt;br /&gt;
|'''Hex ID'''&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 40 MHz BW, Rev. 0-6)       &lt;br /&gt;
|0x772B&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 40 MHz BW, Rev. 7+)        &lt;br /&gt;
|0x7853&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 120 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x77FB&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2940R (WBX, 120 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x785B&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 40 MHz BW, Rev. 0-6)       &lt;br /&gt;
|0x772C&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 40 MHz BW, Rev. 7+)        &lt;br /&gt;
|0x7854&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 120 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x77FC&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2942R (SBX, 120 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x785C&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 40 MHz BW, Rev. 0-6)       &lt;br /&gt;
|0x772D&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 40 MHz BW, Rev. 7+)        &lt;br /&gt;
|0x7855&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 120 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x77FD&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2943R (CBX, 120 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x785D&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2944R (UBX, 160 MHz BW, Rev. 0-6)      &lt;br /&gt;
|0x772E&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2944R (UBX, 160 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x7856&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2945R (TwinRX, 80 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x78EF&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 40 MHz BW, Rev. 0-6)  &lt;br /&gt;
|0x772F&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 40 MHz BW, Rev. 7+)   &lt;br /&gt;
|0x7857&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 120 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x77FE&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2950R (GPS, WBX, 120 MHz BW, Rev. 7+   &lt;br /&gt;
|0x785E&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 40 MHz BW, Rev. 0-6)  &lt;br /&gt;
|0x7730&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 40 MHz BW, Rev. 7+)   &lt;br /&gt;
|0x7858&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 120 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x77FF&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2952R (GPS, SBX, 120 MHz BW, Rev. 7+   &lt;br /&gt;
|0x785F&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 40 MHz BW, Rev. 0-6)  &lt;br /&gt;
|0x7731&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 40 MHz BW, Rev. 7+)   &lt;br /&gt;
|0x7859&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 120 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x7800&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2953R (GPS, CBX, 120 MHz BW, Rev. 7+)  &lt;br /&gt;
|0x7860&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2954R (GPS, UBX, 160 MHz BW, Rev. 0-6) &lt;br /&gt;
|0x7732&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2954R (GPS, UBX, 160 MHz BW, Rev. 7+)  &lt;br /&gt;
|0x785A&lt;br /&gt;
|-&lt;br /&gt;
|USRP-2955R (TwinRX, 80 MHz BW, Rev. 7+)       &lt;br /&gt;
|0x78F0&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=N200/210 EEPROM=&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''N200/210 EEPROM Setting'''&lt;br /&gt;
|'''User Customizable?'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|hardware&lt;br /&gt;
|No&lt;br /&gt;
|Hardware Number&lt;br /&gt;
|-&lt;br /&gt;
|revision&lt;br /&gt;
|No&lt;br /&gt;
|Revision Number&lt;br /&gt;
|-&lt;br /&gt;
|product&lt;br /&gt;
|No&lt;br /&gt;
|Product Code&lt;br /&gt;
|-&lt;br /&gt;
|mac-addr&lt;br /&gt;
|No&lt;br /&gt;
|MAC Address&lt;br /&gt;
|-&lt;br /&gt;
|ip-addr&lt;br /&gt;
|Yes&lt;br /&gt;
|IP Address&lt;br /&gt;
|-&lt;br /&gt;
|subnet&lt;br /&gt;
|Yes&lt;br /&gt;
|Subnetwork&lt;br /&gt;
|-&lt;br /&gt;
|gateway&lt;br /&gt;
|Yes&lt;br /&gt;
|Network Gateway&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The N200/210 do not store the product codes in the motherboard EEPROM. The &amp;quot;hardware&amp;quot; field is programmed at the factory but is not referenced by UHD. Instead, the revision field is used to determine the N200/210 hardware in use. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''USRP'''&lt;br /&gt;
|'''Motherboard Product ID'''&lt;br /&gt;
|-&lt;br /&gt;
|N200&lt;br /&gt;
|0x0A00&lt;br /&gt;
|-&lt;br /&gt;
|N210&lt;br /&gt;
|0x0A01&lt;br /&gt;
|-&lt;br /&gt;
|N200 - R4&lt;br /&gt;
|0x0A10&lt;br /&gt;
|-&lt;br /&gt;
|N210 - R4&lt;br /&gt;
|0x0A11&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=B200/210 and B200mini EEPROM=&lt;br /&gt;
&lt;br /&gt;
The USRP B200 and B210 EEPROM is used to store certain information about each board. The USB PID (Product ID) and VID (Vendor ID) are stored in the EEPROM as well as serial number, product code, hardware revision, and USRP name for each B200/210. A table of these settings and whether or not the setting is user customizable is given below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''B200/210 EEPROM Setting'''&lt;br /&gt;
|'''User Customizable?'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|revision&lt;br /&gt;
|No&lt;br /&gt;
|Revision Number&lt;br /&gt;
|-&lt;br /&gt;
|product&lt;br /&gt;
|No&lt;br /&gt;
|Product Code&lt;br /&gt;
|-&lt;br /&gt;
|serial&lt;br /&gt;
|No&lt;br /&gt;
|Unique Serial Number&lt;br /&gt;
|-&lt;br /&gt;
|name&lt;br /&gt;
|Yes&lt;br /&gt;
|Custom USRP Name&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To read the current EEPROM values from the USRP, use the usrp_burn_mb_eeprom utility:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;type=b200&amp;quot; --read-all&lt;br /&gt;
&lt;br /&gt;
This will read the settings and print them to the terminal. A sample output is shown below for a USRP B210:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fetching current settings from EEPROM...&lt;br /&gt;
	EEPROM [&amp;quot;revision&amp;quot;] is &amp;quot;4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;product&amp;quot;] is &amp;quot;2&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;serial&amp;quot;] is &amp;quot;30AD2D4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;name&amp;quot;] is &amp;quot;MyB210&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If desired, a B200/210 could be given a custom name with the following command:&lt;br /&gt;
&lt;br /&gt;
 ./usrp_burn_mb_eeprom --args=&amp;quot;type=b200&amp;quot; --values=&amp;quot;name=Lab_B210&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After the command has been run, the device must be power-cycled for the new EEPROM setting to take effect. Reading the updated EEPROM values yields:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fetching current settings from EEPROM...&lt;br /&gt;
	EEPROM [&amp;quot;revision&amp;quot;] is &amp;quot;4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;product&amp;quot;] is &amp;quot;2&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;serial&amp;quot;] is &amp;quot;30AD2D4&amp;quot;&lt;br /&gt;
    	EEPROM [&amp;quot;name&amp;quot;] is &amp;quot;Lab_B210&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EEPROM Product ID==&lt;br /&gt;
&lt;br /&gt;
The product code and the product revision stored in the EEPROM of the USRP&lt;br /&gt;
B200/B210 devices are used to identify the specific model and revision of the&lt;br /&gt;
device. The product code is a unique identifier that corresponds to the&lt;br /&gt;
specific hardware design, while the product revision indicates the version of&lt;br /&gt;
that design.&lt;br /&gt;
&lt;br /&gt;
In case of EEPROM corruption, the following table can help identify the correct&lt;br /&gt;
revision and product code that is written into the EEPROM during the manufacturing&lt;br /&gt;
process, by comparing to the USRP Type and NI Part Number, which can be found&lt;br /&gt;
on the blue sticker on the PCB. The &amp;quot;Letter Revision&amp;quot; is the last letter of&lt;br /&gt;
the NI Part Number.&lt;br /&gt;
&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  |'''USRP Type'''&lt;br /&gt;
  |'''NI PN'''&lt;br /&gt;
  |'''Letter Revision'''&lt;br /&gt;
  |'''EEPROM Product Code (Ettus Branding)'''&lt;br /&gt;
  |'''EEPROM Product Code (NI Branding)'''&lt;br /&gt;
  |'''EEPROM Revision No'''&lt;br /&gt;
  |'''Comments'''&lt;br /&gt;
  |-&lt;br /&gt;
  |B210&lt;br /&gt;
  |156229A-01L, 156229B-01L&lt;br /&gt;
  |A, B&lt;br /&gt;
  |2&lt;br /&gt;
  |0x7738, 0x7814&lt;br /&gt;
  |4&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200&lt;br /&gt;
  |156229A-02L, 156229B-02L&lt;br /&gt;
  |A, B&lt;br /&gt;
  |1&lt;br /&gt;
  |0x7737, 0x7813&lt;br /&gt;
  |4&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200&lt;br /&gt;
  |156229C-02L, 156229D-02L&lt;br /&gt;
  |C, D&lt;br /&gt;
  |1&lt;br /&gt;
  |0x7737, 0x7813&lt;br /&gt;
  |5&lt;br /&gt;
  |This revision switched from AD9361 to AD9634, and thus had to switch the RF side.&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034A-01L, 159034A-02L, 159034A-03L&lt;br /&gt;
  |A&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |1&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034B-01L, 159034B-02L, 159034B-03L&lt;br /&gt;
  |B&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |2&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034C-01L, 159034C-02L, 159034C-03L&lt;br /&gt;
  |C&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |3&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034D-01L, 159034D-02L, 159034D-03L&lt;br /&gt;
  |D&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |4&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034E-01L, 159034E-02L, 159034E-03L&lt;br /&gt;
  |E&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |5&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B200mini (I-grade) &amp;amp; B205mini (I-grade)&lt;br /&gt;
  |159034{F,G}-01L, 159034{F,G}-02L, 159034{F,G}-03L&lt;br /&gt;
  |{F,G}&lt;br /&gt;
  |0x0003, 0x0004&lt;br /&gt;
  |0x7739, 0x773a&lt;br /&gt;
  |6&lt;br /&gt;
  |&lt;br /&gt;
  |-&lt;br /&gt;
  |B206mini&lt;br /&gt;
  |117434A-01L, 117434B-01L&lt;br /&gt;
  |A, B&lt;br /&gt;
  |0x0005&lt;br /&gt;
  |0x773b&lt;br /&gt;
  |1&lt;br /&gt;
  |&lt;br /&gt;
  |- &lt;br /&gt;
  |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==USB VID/PID==&lt;br /&gt;
&lt;br /&gt;
The USB vendor identification (VID) and product identification (PID) numbers can be written to the USRP B200/210 using the &amp;quot;b2xx_fx3_utils&amp;quot; utility that is included with UHD. To reset the VID and PID, the command would be:&lt;br /&gt;
&lt;br /&gt;
 ./b2xx_fx3_utils --init-device --write-vid 0x2500 --write-pid -0x0020&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''USRP'''&lt;br /&gt;
|'''USB PID'''&lt;br /&gt;
|-&lt;br /&gt;
|B200&lt;br /&gt;
|0x0020&lt;br /&gt;
|-&lt;br /&gt;
|B210&lt;br /&gt;
|0x0020&lt;br /&gt;
|-&lt;br /&gt;
|B200 (NI)&lt;br /&gt;
|0x7813&lt;br /&gt;
|-&lt;br /&gt;
|B210 (NI)&lt;br /&gt;
|0x7814&lt;br /&gt;
|-&lt;br /&gt;
|B200mini&lt;br /&gt;
|0x0021&lt;br /&gt;
|-&lt;br /&gt;
|B205mini&lt;br /&gt;
|0x0022&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VID is the same for all B2x0 variants, 0x2500.&lt;br /&gt;
&lt;br /&gt;
=Daughtercard IDs=&lt;br /&gt;
&lt;br /&gt;
Below is a comprehensive list of the daughtercard hex ID's.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Hex ID'''&lt;br /&gt;
|-&lt;br /&gt;
|Basic Tx		    &lt;br /&gt;
| 0x0000&lt;br /&gt;
|-&lt;br /&gt;
|Basic Rx   		    &lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|DBS Rx      		&lt;br /&gt;
| 0x0002&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx       		&lt;br /&gt;
| 0x0003&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Rx			&lt;br /&gt;
| 0x0004&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Rx			&lt;br /&gt;
| 0x0005&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Rx		&lt;br /&gt;
| 0x0006&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Rx		&lt;br /&gt;
| 0x0007&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Tx			&lt;br /&gt;
| 0x0008&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Tx			&lt;br /&gt;
| 0x0009&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Tx		&lt;br /&gt;
| 0x000a&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Tx		&lt;br /&gt;
| 0x000b&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 2			&lt;br /&gt;
| 0x000c&lt;br /&gt;
|-&lt;br /&gt;
|DBS Rx ClkMod		&lt;br /&gt;
| 0x000d&lt;br /&gt;
|-&lt;br /&gt;
|LF Tx				&lt;br /&gt;
| 0x000e&lt;br /&gt;
|-&lt;br /&gt;
|LF Rx				&lt;br /&gt;
| 0x000f&lt;br /&gt;
|-&lt;br /&gt;
|DBSRX2				&lt;br /&gt;
| 0x012&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Rx MIMO A	&lt;br /&gt;
| 0x0014&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Rx MIMO A	&lt;br /&gt;
| 0x0015&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Rx MIMO A &lt;br /&gt;
| 0x0016&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Rx MIMO A &lt;br /&gt;
| 0x0017&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Tx MIMO A  &lt;br /&gt;
| 0x0018&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Tx MIMO A	&lt;br /&gt;
| 0x0019&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Tx MIMO A &lt;br /&gt;
| 0x001a&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Tx MIMO A &lt;br /&gt;
| 0x001b&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Rx MIMO B	&lt;br /&gt;
| 0x0024&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Rx MIMO B  &lt;br /&gt;
| 0x0025&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Rx MIMO B &lt;br /&gt;
| 0x0026&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Rx MIMO B &lt;br /&gt;
| 0x0027&lt;br /&gt;
|-&lt;br /&gt;
|Flex 400 Tx MIMO B	&lt;br /&gt;
| 0x0028&lt;br /&gt;
|-&lt;br /&gt;
|Flex 900 Tx MIMO B	&lt;br /&gt;
| 0x0029&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1200 Tx MIMO B	&lt;br /&gt;
| 0x002a&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2400 Tx MIMO B &lt;br /&gt;
| 0x002b&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2200 Rx MIMO B &lt;br /&gt;
| 0x002c&lt;br /&gt;
|-&lt;br /&gt;
|Flex 2200 Tx MIMO B	&lt;br /&gt;
| 0x002d&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Rx		&lt;br /&gt;
| 0x0030&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Tx		&lt;br /&gt;
| 0x0031&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Rx MIMO A	&lt;br /&gt;
| 0x0032&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Tx MIMO A	&lt;br /&gt;
| 0x0033&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Rx MIMO B &lt;br /&gt;
| 0x0034&lt;br /&gt;
|-&lt;br /&gt;
|Flex 1800 Tx MIMO B &lt;br /&gt;
| 0x0035&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 3			&lt;br /&gt;
| 0x0040&lt;br /&gt;
|-&lt;br /&gt;
|DTT754				&lt;br /&gt;
| 0x0041&lt;br /&gt;
|-&lt;br /&gt;
|DTT768				&lt;br /&gt;
| 0x0042&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx MIMO			&lt;br /&gt;
| 0x0043&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 2 MIMO	&lt;br /&gt;
| 0x0044&lt;br /&gt;
|-&lt;br /&gt;
|TV Rx Rev 3 MIMO	&lt;br /&gt;
| 0x0045&lt;br /&gt;
|-&lt;br /&gt;
|TVRX2				&lt;br /&gt;
| 0x0046&lt;br /&gt;
|-&lt;br /&gt;
|WCDMA US			&lt;br /&gt;
| 0x004d&lt;br /&gt;
|-&lt;br /&gt;
|WCDMA EU			&lt;br /&gt;
| 0x004e&lt;br /&gt;
|-&lt;br /&gt;
|SIMPLE GDB			&lt;br /&gt;
| 0x004f&lt;br /&gt;
|-&lt;br /&gt;
|WBX LO TX			&lt;br /&gt;
| 0x0050&lt;br /&gt;
|-&lt;br /&gt;
|WBX LO RX			&lt;br /&gt;
| 0x0051&lt;br /&gt;
|-&lt;br /&gt;
|WBX NG TX			&lt;br /&gt;
| 0x0052&lt;br /&gt;
|-&lt;br /&gt;
|WBX NG RX			&lt;br /&gt;
| 0x0053&lt;br /&gt;
|-&lt;br /&gt;
|SBX v3 RX			&lt;br /&gt;
| 0x0054&lt;br /&gt;
|-&lt;br /&gt;
|SBX v3 TX			&lt;br /&gt;
| 0x0055&lt;br /&gt;
|-&lt;br /&gt;
|WBX v3 TX			&lt;br /&gt;
| 0x0056&lt;br /&gt;
|-&lt;br /&gt;
|WBX v3 RX			&lt;br /&gt;
| 0x0057&lt;br /&gt;
|-&lt;br /&gt;
|XCVR2450 - No Div	&lt;br /&gt;
| 0x0059&lt;br /&gt;
|-&lt;br /&gt;
|XCVR2450 TX			&lt;br /&gt;
| 0x0060&lt;br /&gt;
|-&lt;br /&gt;
|XCVR2450 RX			&lt;br /&gt;
| 0x0061&lt;br /&gt;
|-&lt;br /&gt;
|WBX v4 TX			&lt;br /&gt;
| 0x0062&lt;br /&gt;
|-&lt;br /&gt;
|WBX v4 RX			&lt;br /&gt;
| 0x0063&lt;br /&gt;
|-&lt;br /&gt;
|SBX v4 TX			&lt;br /&gt;
| 0x0064&lt;br /&gt;
|-&lt;br /&gt;
|SBX v4 RX			&lt;br /&gt;
| 0x0065&lt;br /&gt;
|-&lt;br /&gt;
|CBX v1 TX			&lt;br /&gt;
| 0x0066&lt;br /&gt;
|-&lt;br /&gt;
|CBX v1 RX			&lt;br /&gt;
| 0x0067&lt;br /&gt;
|-&lt;br /&gt;
|SBX v5 TX			&lt;br /&gt;
| 0x0068&lt;br /&gt;
|-&lt;br /&gt;
|SBX v5 RX			&lt;br /&gt;
| 0x0069&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v3 TX	&lt;br /&gt;
| 0x0073&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v3 RX &lt;br /&gt;
| 0x0074&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v4 TX &lt;br /&gt;
| 0x0075&lt;br /&gt;
|-&lt;br /&gt;
|UBX-Prototype v4 RX &lt;br /&gt;
| 0x0076&lt;br /&gt;
|-&lt;br /&gt;
|UBX v1 TX			&lt;br /&gt;
| 0x0077&lt;br /&gt;
|-&lt;br /&gt;
|UBX v1 RX			&lt;br /&gt;
| 0x0078&lt;br /&gt;
|-&lt;br /&gt;
|UBX-160 v1 TX		&lt;br /&gt;
| 0x0079&lt;br /&gt;
|-&lt;br /&gt;
|UBX-160 v1 RX		&lt;br /&gt;
| 0x007a&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|UBX-40 v2 TX		&lt;br /&gt;
| 0x007b&lt;br /&gt;
|-&lt;br /&gt;
|UBX-40 v2 RX		&lt;br /&gt;
| 0x007c&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|UBX-160 v2 TX		&lt;br /&gt;
| 0x007d&lt;br /&gt;
|-&lt;br /&gt;
|UBX-160 v2 RX		&lt;br /&gt;
| 0x007e&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Bitshark RX			&lt;br /&gt;
| 0x0070&lt;br /&gt;
|-&lt;br /&gt;
|B150 v1 TX			&lt;br /&gt;
| 0x0071&lt;br /&gt;
|-&lt;br /&gt;
|B150 v1 RX			&lt;br /&gt;
| 0x0072&lt;br /&gt;
|-&lt;br /&gt;
|WBX-120 v1 TX		&lt;br /&gt;
| 0x0080&lt;br /&gt;
|-&lt;br /&gt;
|WBX-120 v1 RX		&lt;br /&gt;
| 0x0081&lt;br /&gt;
|-&lt;br /&gt;
|SBX-120 v1 TX		&lt;br /&gt;
| 0x0082&lt;br /&gt;
|-&lt;br /&gt;
|SBX-120 v1 RX		&lt;br /&gt;
| 0x0083&lt;br /&gt;
|-&lt;br /&gt;
|CBX-120 v1 TX		&lt;br /&gt;
| 0x0084&lt;br /&gt;
|-&lt;br /&gt;
|CBX-120 v1 RX		&lt;br /&gt;
| 0x0085&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev A TX		&lt;br /&gt;
| 0x0090&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev A RX 		&lt;br /&gt;
| 0x0091&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev B TX		&lt;br /&gt;
| 0x0092&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev B RX 		&lt;br /&gt;
| 0x0093&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev C TX 	&lt;br /&gt;
| 0x0094&lt;br /&gt;
|-&lt;br /&gt;
|TwinRX Rev C RX&lt;br /&gt;
| 0x0095&lt;br /&gt;
|-&lt;br /&gt;
|E300 AD3964 DB RevB	&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
|E310 AD9361 DB RevB	&lt;br /&gt;
| 0x0110&lt;br /&gt;
|-&lt;br /&gt;
|E300 AD9364 DB RevC	&lt;br /&gt;
| 0x0101&lt;br /&gt;
|-&lt;br /&gt;
|E310 AD9361 DB RevC	&lt;br /&gt;
| 0x0111&lt;br /&gt;
|-&lt;br /&gt;
|Unknown Tx			&lt;br /&gt;
| 0xfff0&lt;br /&gt;
|-&lt;br /&gt;
|Unknown Rx			&lt;br /&gt;
| 0xfff1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Motherboard IDs=&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Hex ID'''&lt;br /&gt;
|-&lt;br /&gt;
|B200&lt;br /&gt;
|0x7737&lt;br /&gt;
|-&lt;br /&gt;
|B210&lt;br /&gt;
|0x7738&lt;br /&gt;
|-&lt;br /&gt;
|B200mini&lt;br /&gt;
|0x7739&lt;br /&gt;
|-&lt;br /&gt;
|B205mini&lt;br /&gt;
|0x773a&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_in_UHD_4.0&amp;diff=6128</id>
		<title>Getting Started with RFNoC in UHD 4.0</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_in_UHD_4.0&amp;diff=6128"/>
				<updated>2025-06-23T08:00:09Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number and Authors==&lt;br /&gt;
'''AN-400''' by Sugandha Gupta, Brent Stapleton, Wade Fife, and Michael Dickens&lt;br /&gt;
&amp;lt;!-- Internal use only: please do keep this updated!&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2020-02-14&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Sugandha Gupta&amp;lt;br&amp;gt;Brent Stapleton&amp;lt;br&amp;gt;Wade Fife&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;| Initial creation&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2020-09-14&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Wade Fife&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;| Added introduction to RFNoC&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2021-02-18&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Michael Dickens&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;| Minor but critical tweak of `srcport` per https://github.com/EttusResearch/uhd/issues/416&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2021-03-02&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Michael Dickens&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;| re-tweak `srcport` per certain USRPs as noted&lt;br /&gt;
|}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WARNING==&lt;br /&gt;
&lt;br /&gt;
'''Parts of this AN are outdated! We are currently working on updating this article.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This guide describes how to get started with FPGA and Software development for RF Network-on-Chip (RFNoC™). It gives a brief introduction to RFNoC and explains the steps needed to generate, build, and use custom RFNoC images and introduces the process for creating and integrating new RFNoC IP blocks.&lt;br /&gt;
&amp;lt;!-- A guide to migrating a block created in earlier versions of RFNoC (UHD 3) to RFNoC in UHD 4 can be found in the RFNoC Migration Guide. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Intended Audience==&lt;br /&gt;
This guide is written for hardware and software engineers who want to use the RF Network-on-Chip (RFNoC™) architecture or want to develop intellectual property (IP) using the RFNoC architecture. For more details on the architecture please refer to the [https://files.ettus.com/app_notes/RFNoC_Specification.pdf RFNoC Specification].&lt;br /&gt;
&lt;br /&gt;
This guide assumes that you have some basic familiarity with USRPs, such as connecting them, configuring your network interfaces, etc., so that your USRP is ready for use. See the [https://kb.ettus.com/Getting_Started_Guides Getting Started Guide] for your USRP if you are just getting started with USRPs.&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
The RFNoC code base is open source, including code that executes on the host, as well as code targeted to the USRP hardware (FPGA and microcontroller firmware). RFNoC is available under the open-source GNU Lesser General Public License (LGPL). For more information on our licensing policy, please contact [mailto:info@ettus.com info@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
RFNoC is currently supported on the USRP X410 series, and all the Generation-3 USRPs in the X series (X3xx), E series (E3xx) and  N series (N3xx). For details on the hardware, software, and process required to build custom USRP FPGA images that include RFNoC blocks, see the [http://files.ettus.com/manual/md_usrp3_build_instructions.html USRP Build Documentation] in the UHD and USRP Manual.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you learn how to build an FPGA image for your USRP and download it to the device before starting this guide if you have never done so before. This will ensure you have all the necessary software installed.&lt;br /&gt;
&lt;br /&gt;
==Introduction to RFNoC==&lt;br /&gt;
&lt;br /&gt;
===What is RFNoC?===&lt;br /&gt;
&lt;br /&gt;
RFNoC™ is a heterogeneous processing framework used to implement high-throughput DSP in the FPGA for Software Defined Radio (SDR) systems in an easy-to-use and flexible way. It provides all the infrastructure required to insert signal-processing IP into the FPGA logic and communicate with it through software. It also provides highly-optimized software and FPGA code to enable high-performance streaming to and from IP blocks on the USRP device.&lt;br /&gt;
&lt;br /&gt;
The IP blocks in RFNoC are called ''RFNoC blocks''. The RFNoC blocks wrap the IP and provide a custom interface to the RFNoC infrastructure through a tool-generated interface called the ''NoC Shell''. Many standard blocks are included in UHD 4.0. These blocks enable typical operation of the USRP and allow RFNoC to connect to the different hardware components of the USRP. Several of the included blocks are described in the section [[#Available RFNoC Blocks|Available RFNoC Blocks]]. You can mix the available blocks for your application, or develop your own custom RFNoC blocks with your own IP to open up new applications. The NoC Shell hides the complexity of RFNoC from your block, making it easy to plug your IP into the USRP.&lt;br /&gt;
&lt;br /&gt;
RFNoC is used on all Generation-3 USRPs and is installed with UHD 4.0. USRPs ship with a default RFNoC image that can be used as is, or can be modified and/or customized to suite your application. So if you're using a modern USRP, it's running RFNoC under the hood even if you haven't customized anything.&lt;br /&gt;
&lt;br /&gt;
===Example RFNoC Image===&lt;br /&gt;
&lt;br /&gt;
The diagram below shows a simplified view of an RFNoC FPGA image that is similar to the default images available on USRPs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:simplified_rfnoc_image_uhd_4.png|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that an RFNoC FPGA is made up of several components. A description of each one is provided below.&lt;br /&gt;
&lt;br /&gt;
* '''RFNoC Image Core'''&amp;lt;br&amp;gt;This is the main block of the RFNoC framework and instantiates the components that make up RFNoC. The contents of the image core are described by an RFNoC image core YAML file, and the Verilog code that represents this block is automatically generated by the RFNoC Image Builder tool based on the YAML description. In other words, you provide a description of what you want to be included in RFNoC and the tools generate the code to implement that description.&lt;br /&gt;
* '''Transport Adapter'''&amp;lt;br&amp;gt;The transport adapter is a component of the USRP that allows communication with an outside interface. These vary depending on the USRP model in use. For example, this could be a 10 Gbps Ethernet link for SFP+ port of the USRP, or a cabled PCIe interface. As of UHD 4.7, the USRP X4xx series puts the transport adapters inside the image core for higher flexibility.&lt;br /&gt;
* '''CHDR Crossbar'''&amp;lt;br&amp;gt;The CHDR crossbar is a dynamic router for RFNoC traffic. This is a high-throughput crossbar designed for RF streaming applications. It is reconfigurable at run time via software and can be used to configure routes between stream endpoints and transport adapters. The number of ports available is configurable by changing the RFNoC image core YAML file. CHDR (Condensed Hierarchical Datagram for RFNoC) refers to the network protocol that is used for RFNoC.&lt;br /&gt;
* '''Stream Endpoint (SEP)'''&amp;lt;br&amp;gt;The stream endpoint (SEP) provides the high-level flow control for traffic over the network. It also separates control traffic from data traffic to create a separate AXIS-Ctrl network for control traffic. Control traffic refers to things like register reads and writes for configuring and monitoring RFNoC blocks.&lt;br /&gt;
* '''Control Crossbar'''&amp;lt;br&amp;gt;The control crossbar is similar to the CHDR Crossbar, but is only for control traffic. It has a much lower throughput and has been optimized for control-traffic, making it much less resource intensive than the CHDR crossbar.&lt;br /&gt;
* '''Other Blocks'''&amp;lt;br&amp;gt;The DDC (digital down converter), DUC (digital up converter), and Radio in this example are RFNoC blocks that are included with UHD. These are standard components included the default USRP images and enable typical RF applications. Most blocks only communicate with the RFNoC network, but some blocks require access to external hardware interfaces, such as the radio or DRAM. In this example, the radio blocks connect to the radio hardware on the USRP.&lt;br /&gt;
&lt;br /&gt;
===Static vs. Dynamic Routing===&lt;br /&gt;
&lt;br /&gt;
The routes between blocks that go through the crossbar are ''dynamic''. That is, the routes can be changed at run time and are controlled by software. The CHDR crossbar is very powerful in that it allows any of its ports to communicate with each other. It allows for streaming between blocks on the same FPGA, between RFNoC blocks and a host computer, or between blocks on different USRPs. New signal processing chains can be added to this crossbar, as needed, for the application.&lt;br /&gt;
&lt;br /&gt;
Similarly, the control crossbar supports dynamic routing, allowing any RFNoC block to send control traffic to any other RFNoC block, even to blocks on a different USRP. Control traffic can also be sent from the host computer to the RFNoC blocks, for example to read/write registers. Additionally, RFNoC blocks can send control to the host computer. In this example, the Radio block sends control traffic to the computer to report specific events, such as overflow or underflow in the radio.&lt;br /&gt;
&lt;br /&gt;
The block connections that don't go through a crossbar (e.g., the connection from the radio to the DDC, and the DDC to the stream endpoint, etc.) are ''static'' connections. That is, they cannot be changed at run time. Making a connection static has the advantage that it does not require additional ports on the crossbar and that the connection can be made much simpler because the high-level network flow-control protocol used by CHDR is not required. This reduces latency between blocks and leads to FPGA resource savings, allowing more logic be included in a single FPGA image. The static connections are described by the RFNoC image core YAML file. In order to change the static connections, the YAML description needs to be updated and the FPGA image needs to be rebuilt.&lt;br /&gt;
&lt;br /&gt;
===RFNoC Customization===&lt;br /&gt;
&lt;br /&gt;
The RFNoC framework makes it easy to customize the RFNoC image and add your own IP blocks. Later on in this guide, we'll explore how you can customize the RFNoC image to add or remove blocks, as well as create your own RFNoC blocks and include them in your FPGA builds. This allows you to create highly-customized and high-performance FPGA images for your USRP.&lt;br /&gt;
&lt;br /&gt;
==Setting Up==&lt;br /&gt;
To use RFNoC in UHD 4.0 you need to perform the following:&lt;br /&gt;
&lt;br /&gt;
* Clone the UHD repository&lt;br /&gt;
* Install UHD&lt;br /&gt;
* Update your device's filesystem and FPGA image&lt;br /&gt;
&lt;br /&gt;
Building custom RFNoC images requires the FPGA source code and build system. These are included in the UHD repository, located in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;&amp;lt;/code&amp;gt; refers to the location where you cloned the UHD repository.&lt;br /&gt;
&lt;br /&gt;
Please see the [http://files.ettus.com/manual/page_install.html Binary Installation] for UHD installation documentation or [https://files.ettus.com/manual/page_build_guide.html Building and Installing] instructions to build and install UHD from source. Additionally, [[Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux|AN-445]] provides step-by step instructions for cloning the repository and installing UHD from source.&lt;br /&gt;
&lt;br /&gt;
Starting with UHD 3.15, RFNoC is enabled by default, and starting with UHD 4.0, it can no longer be disabled, so no additional instructions are necessary to install support for RFNoC in UHD.&lt;br /&gt;
&lt;br /&gt;
Many of the UHD utilities we will use in this guide are based on Python. Please ensure that your &amp;lt;code&amp;gt;PYTHONPATH&amp;lt;/code&amp;gt; is set correctly. If not set correctly, you will see errors indicating that Python could not find the &amp;lt;code&amp;gt;uhd&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;image_builder&amp;lt;/code&amp;gt; libraries. The correct setting may depend on where you installed UHD and which Linux distribution you are using. If you installed UHD from source to the default location on Ubuntu, you may need to add &amp;lt;code&amp;gt;/usr/local/lib/python3/dist-packages&amp;lt;/code&amp;gt; to your &amp;lt;code&amp;gt;PYTHONPATH&amp;lt;/code&amp;gt; variable. For example:&lt;br /&gt;
&lt;br /&gt;
    $ export PYTHONPATH=/usr/local/lib/python3/dist-packages&lt;br /&gt;
&lt;br /&gt;
Instructions for updating your device's filesystem (applicable to E3xx and N3xx) and FPGA image can be found in that device's [https://kb.ettus.com/Getting_Started_Guides Getting Started Guide]. If your filesystem is already up to date, or your device does not use a filesystem (e.g., X3xx), then instructions on flashing an FPGA image to a device can be found in the following locations:&lt;br /&gt;
&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs X3xx series]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_e3xx.html#e3xx_getting_started_fpga_update E3xx series]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_n3xx.html#n3xx_getting_started_fpga_update N3xx series]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device, NOT the USRP series. For example, a USRP X300 FPGA image will NOT work on a USRP X310 and vice versa. Loading an image that does not correspond to your USRP device will likely lead to an error message but can brick the device under some circumstances.&lt;br /&gt;
&lt;br /&gt;
===Configure the Default Shell===&lt;br /&gt;
&lt;br /&gt;
Make sure you are using the &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt; shell. Many of the build scripts used by RFNoC are written for &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt;. See [[Software_Development_on_the_E3xx_USRP_-_Building_RFNoC_UHD_/_GNU_Radio_/_gr-ettus_from_Source#Reconfigure_Default_Shell|Reconfigure Default Shell]] in AN-315 for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
==Testing the Default FPGA Image==&lt;br /&gt;
&lt;br /&gt;
Before continuing, please verify that you have downloaded and flashed the latest FPGA image for your version of UHD. All FPGA images for Generation-3 and above devices are RFNoC images, so there is no requirement to download a special image for RFNoC.&lt;br /&gt;
&lt;br /&gt;
===Inspect the Default Image===&lt;br /&gt;
&lt;br /&gt;
Before we start customizing our FPGA, let's get familiar with the default FPGA image, which is pre-built with a set of RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
Run the following command, with your USRP connected to your PC, to see what is available on the device.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe --args type=x300&lt;br /&gt;
&lt;br /&gt;
Note that your &amp;lt;code&amp;gt;args&amp;lt;/code&amp;gt; may be different, depending on the USRP device you're using. The example here works for X300/X310. Refer to the manual page on [https://files.ettus.com/manual/page_identification.html Identifying USRP Devices] for more details. If an RFNoC image was successfully loaded onto the USRP, the output will show something like the following:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;  _____________________________________________________&lt;br /&gt;
 /&lt;br /&gt;
|       Device: X-Series Device&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       Mboard: X310&lt;br /&gt;
|   |   revision: 11&lt;br /&gt;
|   |   revision_compat: 7&lt;br /&gt;
|   |   product: 30818&lt;br /&gt;
|   |   mac-addr0: 00:80:2f:17:40:6d&lt;br /&gt;
|   |   mac-addr1: 00:80:2f:17:40:6e&lt;br /&gt;
|   |   gateway: 192.168.10.1&lt;br /&gt;
|   |   ip-addr0: 192.168.10.2&lt;br /&gt;
|   |   subnet0: 255.255.255.0&lt;br /&gt;
|   |   ip-addr1: 192.168.20.2&lt;br /&gt;
|   |   subnet1: 255.255.255.0&lt;br /&gt;
|   |   ip-addr2: 192.168.30.2&lt;br /&gt;
|   |   subnet2: 255.255.255.0&lt;br /&gt;
|   |   ip-addr3: 192.168.40.2&lt;br /&gt;
|   |   subnet3: 255.255.255.0&lt;br /&gt;
|   |   serial: 311EF81&lt;br /&gt;
|   |   FW Version: 6.0&lt;br /&gt;
|   |   FPGA Version: 38.0&lt;br /&gt;
|   |   FPGA git hash: be53058&lt;br /&gt;
|   |&lt;br /&gt;
|   |   Time sources:  internal, external, gpsdo&lt;br /&gt;
|   |   Clock sources: internal, external, gpsdo&lt;br /&gt;
|   |   Sensors: ref_locked&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       RFNoC blocks on this device:&lt;br /&gt;
|   |&lt;br /&gt;
|   |   * 0/DDC#0&lt;br /&gt;
|   |   * 0/DDC#1&lt;br /&gt;
|   |   * 0/DUC#0&lt;br /&gt;
|   |   * 0/DUC#1&lt;br /&gt;
|   |   * 0/Radio#0&lt;br /&gt;
|   |   * 0/Radio#1&lt;br /&gt;
|   |   * 0/Replay#0&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       Static connections on this device:&lt;br /&gt;
|   |&lt;br /&gt;
|   |   * 0/SEP#0:0==&amp;gt;0/DUC#0:0&lt;br /&gt;
|   |   * 0/DUC#0:0==&amp;gt;0/Radio#0:0&lt;br /&gt;
|   |   * 0/Radio#0:0==&amp;gt;0/DDC#0:0&lt;br /&gt;
|   |   * 0/DDC#0:0==&amp;gt;0/SEP#0:0&lt;br /&gt;
|   |   * 0/Radio#0:1==&amp;gt;0/DDC#0:1&lt;br /&gt;
|   |   * 0/DDC#0:1==&amp;gt;0/SEP#1:0&lt;br /&gt;
|   |   * 0/SEP#2:0==&amp;gt;0/DUC#1:0&lt;br /&gt;
|   |   * 0/DUC#1:0==&amp;gt;0/Radio#1:0&lt;br /&gt;
|   |   * 0/Radio#1:0==&amp;gt;0/DDC#1:0&lt;br /&gt;
|   |   * 0/DDC#1:0==&amp;gt;0/SEP#2:0&lt;br /&gt;
|   |   * 0/Radio#1:1==&amp;gt;0/DDC#1:1&lt;br /&gt;
|   |   * 0/DDC#1:1==&amp;gt;0/SEP#3:0&lt;br /&gt;
|   |   * 0/SEP#4:0==&amp;gt;0/Replay#0:0&lt;br /&gt;
|   |   * 0/Replay#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
|   |   * 0/SEP#5:0==&amp;gt;0/Replay#0:1&lt;br /&gt;
|   |   * 0/Replay#0:1==&amp;gt;0/SEP#5:0&lt;br /&gt;
...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More than this will likely be shown. The specifics of the output depend on the UHD version and which device you're running on. However, we're interested in the following sections:&lt;br /&gt;
&lt;br /&gt;
* '''Device description'''. At the top, there is a section with basic information about your device, such as serial number, revision, etc. You can use this information to verify that you are indeed communicating with the correct device, and that the device has been updated. The FPGA git hash identifies the commit from which the FPGA image was built.&lt;br /&gt;
* '''RFNoC blocks on this device'''. This section lists all the RFNoC blocks in the loaded FPGA image. The blocks are listed by their block IDs. For example, &amp;lt;code&amp;gt;0/Radio#0&amp;lt;/code&amp;gt; means that we're on device zero (&amp;lt;code&amp;gt;0/&amp;lt;/code&amp;gt;), and we're talking about the first radio (with index &amp;lt;code&amp;gt;#0&amp;lt;/code&amp;gt;). Unless you probe multiple devices at once by specifying multiple addresses in the &amp;lt;code&amp;gt;--args&amp;lt;/code&amp;gt; argument, the device number will always be zero, but the block index will change depending on the number of blocks of that type. For example, on X310, &amp;lt;code&amp;gt;Radio#0&amp;lt;/code&amp;gt; corresponds to RF A and &amp;lt;code&amp;gt;Radio#1&amp;lt;/code&amp;gt; corresponds to RF B.&lt;br /&gt;
* '''Static connections on this device'''. This section lists how the blocks are pre-connected in the FPGA image. For example, the line &amp;lt;code&amp;gt;0/Radio#0:0==&amp;gt;0/DDC#0:0&amp;lt;/code&amp;gt; means that radio zero, port zero (&amp;lt;code&amp;gt;:0&amp;lt;/code&amp;gt;), is connected statically to DDC zero, port zero. Static connections can only be changed at compile time when building the FPGA image.&lt;br /&gt;
&lt;br /&gt;
The connection endpoints labeled &amp;lt;code&amp;gt;SEP&amp;lt;/code&amp;gt; are not RFNoC blocks. They are Stream Endpoints (SEPs). SEPs can send data packets to one another, or to streamers in software, using the CHDR crossbar, which is a dynamic router on the FPGA.&lt;br /&gt;
&lt;br /&gt;
===Available RFNoC Blocks===&lt;br /&gt;
&lt;br /&gt;
Many RFNoC blocks come with UHD. The HDL source code for these blocks resides in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/lib/rfnoc/blocks/&amp;lt;/code&amp;gt;. Several of the blocks are described below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Block Name&lt;br /&gt;
!HDL Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|AddSub&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_addsub&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add/Subtract Verilog/VHDL/HLS Example&lt;br /&gt;
|-&lt;br /&gt;
|DmaFIFO&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_axi_ram_fifo&amp;lt;/code&amp;gt;&lt;br /&gt;
|FIFO that uses an AXI4 memory-mapped interface for storage. For use with external DRAM or on-chip SRAM.&lt;br /&gt;
|-&lt;br /&gt;
|DDC&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_ddc&amp;lt;/code&amp;gt;&lt;br /&gt;
|Digital Down Converter&lt;br /&gt;
|-&lt;br /&gt;
|DUC&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_duc&amp;lt;/code&amp;gt;&lt;br /&gt;
|Digital Up Converter&lt;br /&gt;
|-&lt;br /&gt;
|FFT&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_fft&amp;lt;/code&amp;gt;&lt;br /&gt;
|Fast Fourier Transform&lt;br /&gt;
|-&lt;br /&gt;
|FIR&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_fir_filter&amp;lt;/code&amp;gt;&lt;br /&gt;
|Finite Impulse Response Filter&lt;br /&gt;
|-&lt;br /&gt;
|Fosphor&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_fosphor&amp;lt;/code&amp;gt;&lt;br /&gt;
|FFT and waterfall display tool&lt;br /&gt;
|-&lt;br /&gt;
|KeepOneInN&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_keep_one_in_n&amp;lt;/code&amp;gt;&lt;br /&gt;
|Keep one sample/packet in N&lt;br /&gt;
|-&lt;br /&gt;
|LogPwr&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_logpwr&amp;lt;/code&amp;gt;&lt;br /&gt;
|Computes an estimate of log2(i^2+q^2)&lt;br /&gt;
|-&lt;br /&gt;
|MovingAverage&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_moving_avg&amp;lt;/code&amp;gt;&lt;br /&gt;
|Outputs the running average of the N most recent inputs of data stream&lt;br /&gt;
|-&lt;br /&gt;
|NullSrcSink&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_null_src_sink&amp;lt;/code&amp;gt;&lt;br /&gt;
|Data source generator, sink, and loopback for testing&lt;br /&gt;
|-&lt;br /&gt;
|Radio&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_radio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Radio Interface&lt;br /&gt;
|-&lt;br /&gt;
|Replay&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_replay&amp;lt;/code&amp;gt;&lt;br /&gt;
|Record/Playblack using AXI4 memory-mapped interface. For use with external DRAM or on-chip SRAM.&lt;br /&gt;
|-&lt;br /&gt;
|SigGen&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
|Signal Generator. Supports sinusoidal, constant, and random outputs, with configurable gain.&lt;br /&gt;
|-&lt;br /&gt;
|SplitStream&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_split_stream&amp;lt;/code&amp;gt;&lt;br /&gt;
|Splits a single data stream into two&lt;br /&gt;
|-&lt;br /&gt;
|Switchboard&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_switchboard&amp;lt;/code&amp;gt;&lt;br /&gt;
|A configurable RFNoC datapath switch for testing&lt;br /&gt;
|-&lt;br /&gt;
|VectorIIR&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_vector_iir&amp;lt;/code&amp;gt;&lt;br /&gt;
|Implements an IIR filter with variable length delay line&lt;br /&gt;
|-&lt;br /&gt;
|Window&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_window&amp;lt;/code&amp;gt;&lt;br /&gt;
|Windowing module for use with FFT block&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Streaming Example===&lt;br /&gt;
&lt;br /&gt;
In the UHD installation directory, you'll find example applications (e.g., in &amp;lt;code&amp;gt;/usr/lib/uhd/examples/&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/usr/local/lib/uhd/examples/&amp;lt;/code&amp;gt;). We'll look at &amp;lt;code&amp;gt;rfnoc_rx_to_file&amp;lt;/code&amp;gt; to familiarize ourselves with the RFNoC API.&lt;br /&gt;
&lt;br /&gt;
If we look at the source code for this example (located at &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/host/examples/rfnoc_rx_to_file.cpp&amp;lt;/code&amp;gt;), we can see the components necessary in an RFNoC application. In the &amp;lt;code&amp;gt;UHD_SAFE_MAIN&amp;lt;/code&amp;gt; function, we create a few crucial objects, such as an RFNoC graph, a radio block controller, a DDC block controller, and an RX streamer.&lt;br /&gt;
&lt;br /&gt;
    auto graph = uhd::rfnoc::rfnoc_graph::make(args);&lt;br /&gt;
    // ...&lt;br /&gt;
    auto radio_ctrl = graph-&amp;gt;get_block&amp;lt;uhd::rfnoc::radio_control&amp;gt;(radio_ctrl_id);&lt;br /&gt;
    // ...&lt;br /&gt;
    uhd::rfnoc::ddc_block_control::sptr ddc_ctrl;&lt;br /&gt;
    // ...&lt;br /&gt;
    auto rx_stream = graph-&amp;gt;create_rx_streamer(1, stream_args);&lt;br /&gt;
&lt;br /&gt;
We also make connections in our graph and configure our blocks.&lt;br /&gt;
&lt;br /&gt;
    // Connect blocks and commit the graph&lt;br /&gt;
    for (auto&amp;amp; edge : chain) {&lt;br /&gt;
        if (uhd::rfnoc::block_id_t(edge.dst_blockid).match(uhd::rfnoc::NODE_ID_SEP)) {&lt;br /&gt;
            graph-&amp;gt;connect(edge.src_blockid, edge.src_port, rx_stream, 0);&lt;br /&gt;
        } else {&lt;br /&gt;
            graph-&amp;gt;connect(&lt;br /&gt;
                edge.src_blockid, edge.src_port, edge.dst_blockid, edge.dst_port);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    ...&lt;br /&gt;
    rate = radio_ctrl-&amp;gt;set_rate(rate);&lt;br /&gt;
    ...&lt;br /&gt;
    radio_ctrl-&amp;gt;set_rx_frequency(freq, radio_chan);&lt;br /&gt;
&lt;br /&gt;
Once our graph and blocks are configured, we use the &amp;lt;code&amp;gt;recv_to_file&amp;lt;/code&amp;gt; function to receive data from our device and write it to a file on our host computer. Running this example with the &amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; argument shows the available options. For example, to receive 3 seconds of data at a specific frequency and sample rate, we can run:&lt;br /&gt;
&lt;br /&gt;
    rfnoc_rx_to_file --args type=x300 --freq 2.4e9 --rate 10e6 --duration 3&lt;br /&gt;
&lt;br /&gt;
Now you are ready to move to the next step and build your own blocks and FPGA images.&lt;br /&gt;
&lt;br /&gt;
==RFNoC Image Builder==&lt;br /&gt;
&lt;br /&gt;
UHD provides tooling to help develop custom RFNoC images. In this guide we will demonstrate how to use the RFNoC Image Builder, which will allow you to change which blocks are included and the connections between blocks. Let's go over common decisions you'll have to make with this tool.&lt;br /&gt;
&lt;br /&gt;
* '''Blocks Included'''&amp;lt;br&amp;gt;The particular blocks to be included in the image is the most impactful decision you'll make in the image building process, both in terms of image functionality and FPGA resource utilization. Adding more blocks means more processing in the image, but it also means longer FPGA build times and less space in the FPGA.&lt;br /&gt;
* '''Static Connections'''&amp;lt;br&amp;gt;Recall that blocks can be statically connected, as opposed to connecting every block to the CHDR crossbar (dynamically connected). The number of dynamic connections has a large impact on the size of the CHDR crossbar, so static connections are used to lower resource utilization. However, once a block is statically connected in a chain of blocks, data cannot be sent between arbitrary blocks; it must traverse and be processed by each block in the order defined by the static connections.&lt;br /&gt;
* '''Hardware Connections'''&amp;lt;br&amp;gt;All blocks share some connections defined by the [https://files.ettus.com/app_notes/RFNoC_Specification.pdf RFNoC Specification]. These connections are made automatically and cannot be changed. Many blocks require additional connections, such as clocks for the internal DSP or external DRAM interfaces. These connections must also be specified.&lt;br /&gt;
&lt;br /&gt;
Now that we've gone over some of the considerations, let's look at how to actually build a custom RFNoC image. This begins with the RFNoC image core YAML description.&amp;lt;!-- TODO: Originally, I think we were also going to describe how to use GNU Radio to create/build an FPGA image. That would be cool. Maybe that should be in a separate KB? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Understanding the RFNoC Image YAML File===&lt;br /&gt;
&lt;br /&gt;
The image YAML file defines RFNoC blocks in the FPGA image. It is designed to be both human-readable and machine-parseable, which allows us to make edits quickly and easily. Each device type has a default YAML image file, which is named &amp;lt;code&amp;gt;&amp;lt;DEVICE&amp;gt;_rfnoc_image_core.yml&amp;lt;/code&amp;gt; (e.g., &amp;lt;code&amp;gt;x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;). Take a look at the RFNoC image core YAML file for the X310 by opening &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;. Notice that it has the following sections.&lt;br /&gt;
&lt;br /&gt;
* '''General Parameters'''&amp;lt;br&amp;gt;Here we define the device, the bit width of our CHDR connections, as well as some versioning and licensing.&lt;br /&gt;
* '''Stream Endpoints'''&amp;lt;br&amp;gt;In the &amp;lt;code&amp;gt;stream_endpoints&amp;lt;/code&amp;gt; section we list each stream endpoint (SEP) that we wish to instantiate. These will be directly connected to the CHDR crossbar and will allow us to make dynamic connections within the CHDR crossbar. Typically you will have one SEP that forms the start and end of a single DSP chain of RFNoC blocks.&amp;lt;br&amp;gt;You can also add some per-stream-endpoint configuration here, such as the ingress buffer size, which affects streaming performance from your computer to that SEP. For example, if we know that one SEP will be receiving data transferred from your computer to the USRP then a data buffer is needed to accept those incoming packets, in which case we specify the buffer size by setting the &amp;lt;code&amp;gt;buff_size&amp;lt;/code&amp;gt; option on that SEP. Alternatively, if we know that a particular SEP only sends data from the USRP to the computer, then we won't need the ingress data buffer and we can set &amp;lt;code&amp;gt;buff-size&amp;lt;/code&amp;gt; to 0, thus saving FPGA resources.&amp;lt;br&amp;gt;Each SEP can have an AXIS-Ctrl and an AXIS-CHDR port, as indicated by the &amp;lt;code&amp;gt;ctrl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; options. At least one AXIS-Ctrl port is required to communicate with the RFNoC blocks, so &amp;lt;code&amp;gt;ctrl&amp;lt;/code&amp;gt; typically enabled on just the first SEP. Every SEP will usually have AXIS-CHDR connections to one or more RFNoC blocks, so &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; is usually enabled on all SEPs.&lt;br /&gt;
* '''NoC Blocks'''&amp;lt;br&amp;gt;In the &amp;lt;code&amp;gt;noc_blocks&amp;lt;/code&amp;gt; section we specify all the RFNoC blocks to include in the FPGA image. We'll need to give each block a unique name and reference a block definition YAML file (which we'll discuss in a later section). The blocks chosen have the greatest impact on the functionality of the image, as well as providing very coarse control over the FPGA resource utilization. We'll look at how to change the blocks included in the image as part of our example below.&lt;br /&gt;
*'''Static Connections'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;connections&amp;lt;/code&amp;gt; section defines static connections between blocks, stream endpoints, and various hardware interfaces on the USRP. Statically connected chains of blocks will usually start and end at a stream endpoint (SEP). SEPs are automatically connected to the CHDR crossbar by the RFNoC infrastructure. Remember that data must be passed through the entire statically connected chain; dynamic connections cannot be made to the statically connected blocks in the middle of the chain. Other hardware connections, such as to the external DRAM, would also be specified here. We'll take a closer look at making connections as part of our example below.&lt;br /&gt;
* '''Clock Domains'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;clk_domains&amp;lt;/code&amp;gt; section defines which clocks to connect to each block's clock inputs. Some blocks do not need any clock connections beyond the base clocks required by RFNoC. These required connections are not listed here, since they are always the same for each block. Other blocks may require additional clocks. For example, the radio blocks should be connected to the &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; clock. Many other blocks require a &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; (Compute Engine) clock, which is used for the block's internal DSP.&lt;br /&gt;
&lt;br /&gt;
===Running the Image Builder===&lt;br /&gt;
&lt;br /&gt;
Before we look at editing the image core YAML file, let's go over how to use the RFNoC image builder to generate a bitstream from that YAML file. Additional details on how to run the image builder can be found with the &amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; option:&lt;br /&gt;
&lt;br /&gt;
    $ rfnoc_image_builder --help&lt;br /&gt;
&lt;br /&gt;
Here are some of the options provided:&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-y&amp;lt;/code&amp;gt;''': Path to the RFNoC image core YAML file&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-t&amp;lt;/code&amp;gt;''': The image target you would like to build. These are the same targets that are used in the FPGA &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; process. More details on these can be found in the [https://files.ettus.com/manual/md_usrp3_build_instructions.html Generation 3 USRP Build Documentation] of the UHD and USRP Manual. If not specified, the default specified in the image core YAML file will be used.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-l debug&amp;lt;/code&amp;gt;''': Use the &amp;lt;code&amp;gt;debug&amp;lt;/code&amp;gt; log level. This prints more information about the FPGA connections and available port names, which can be useful for debugging connection errors in the YAML file.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;--generate-only&amp;lt;/code&amp;gt;''': Generate the HDL files required, but do not build the FPGA. Users can then build the FPGA later using &amp;lt;code&amp;gt;make &amp;lt;target&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt;''': Path to the directory containing out-of-tree block YAML descriptions (the YAML files installed with UHD are included by default). This option is only needed if using an out-of-tree RFNoC block.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-F&amp;lt;/code&amp;gt;''': Path to the FPGA source code (e.g., &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga&amp;lt;/code&amp;gt;). This path is only required if the current working directory is not within the UHD repository.&lt;br /&gt;
&lt;br /&gt;
For example, to build the default RFNoC image for X310, you might use the following command:&lt;br /&gt;
&lt;br /&gt;
    $ cd &amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/&lt;br /&gt;
    $ rfnoc_image_builder -y ./x310_rfnoc_image_core.yml -t X310_XG&lt;br /&gt;
&lt;br /&gt;
In this example &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;&amp;lt;/code&amp;gt; refers to the location where you cloned the UHD repository and should be replaced by the location you used. &amp;lt;code&amp;gt;x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt; is the default RFNoC image core YAML file for the X310, which is in the x300 project directory. &amp;lt;code&amp;gt;X310_XG&amp;lt;/code&amp;gt; is the make target to use for the build. &amp;lt;code&amp;gt;XG&amp;lt;/code&amp;gt; in this case refers to dual 10 Gbps Ethernet. As of UHD 4.9, &amp;lt;code&amp;gt;rfnoc_image_builder -h&amp;lt;/code&amp;gt; will list valid targets.&lt;br /&gt;
&lt;br /&gt;
For an out-of-tree RFNoC block, you will also need to specify the location of the block information. For example:&lt;br /&gt;
&lt;br /&gt;
    $ rfnoc_image_builder -F &amp;lt;repo&amp;gt;/fpga -I &amp;lt;repo&amp;gt;/host/examples/rfnoc-example -y &amp;lt;repo&amp;gt;/host/examples/rfnoc-example/icores/x310_rfnoc_image_core.yml -t X310_XG &lt;br /&gt;
&lt;br /&gt;
This example shows how to build an FPGA with the Gain example out-of-tree RFNoC block, which is located in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/host/examples/rfnoc-example/&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;-F&amp;lt;/code&amp;gt; option is added to specify the location of the FPGA source, and &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; specifies the location of the out-of-tree block YAML.&lt;br /&gt;
&lt;br /&gt;
The image builder performs several steps in order to build the FPGA image from the image coure YAML:&lt;br /&gt;
&lt;br /&gt;
# It generates the &amp;lt;code&amp;gt;&amp;lt;device&amp;gt;_rfnoc_image_core.v&amp;lt;/code&amp;gt; file. This file includes the Verilog code described by the YAML image core file. A &amp;lt;code&amp;gt;&amp;lt;device&amp;gt;_static_router.hex&amp;lt;/code&amp;gt; file is also generated. This file describes the static connections that should be made by the Verilog code. In the case of the X310 examples above, the output files would be named &amp;lt;code&amp;gt;x310_rfnoc_image_core.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;x310_static_router.hex&amp;lt;/code&amp;gt;, and would be placed in the project directory for the X310 (&amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/&amp;lt;/code&amp;gt;).&lt;br /&gt;
# The image builder will configure the environment for building the FPGA. This is equivalent to sourcing the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script for the device type being built. For example, in our example above, it would run &amp;lt;code&amp;gt;source &amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/setupenv.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# The image builder runs &amp;lt;code&amp;gt;make &amp;lt;target&amp;gt;&amp;lt;/code&amp;gt; to build the IP and the FPGA bitstream for the indicated target. The generated Verilog files are automatically pulled into this build.&lt;br /&gt;
&lt;br /&gt;
===Example: Adding an FFT Block===&lt;br /&gt;
&lt;br /&gt;
As an example, let's run through how to modify the YAML file to modify the RFNoC image. Suppose we have an application that we'd like to run on a USRP X310 and we would like to offload the FFT processing to the FPGA. UHD provides an FFT RFNoC block, and the default X310 image has some extra space in it, so we should be able to add this block. First, we copy the default X310 image core file, named &amp;lt;code&amp;gt;x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
    $ cd &amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/&lt;br /&gt;
    $ cp x310_rfnoc_image_core.yml x310_with_fft.yml&lt;br /&gt;
&lt;br /&gt;
Now open &amp;lt;code&amp;gt;x310_with_fft.yml&amp;lt;/code&amp;gt; in your favorite text editor. We'll start by making some room for our new block. The default images use very large ingress FIFO buffers for the main SEPs to maximize streaming performance. But we want to make sure we have enough memory buffer space for our new blocks. So Start by reducing the &amp;lt;code&amp;gt;buf_size&amp;lt;/code&amp;gt; parameters for &amp;lt;code&amp;gt;ep0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ep2&amp;lt;/code&amp;gt; from 65536 to 32768. If using a device other than X310, the numbers may be different, but you can similarly reduce the &amp;lt;code&amp;gt;buff_size&amp;lt;/code&amp;gt; parameter by half. On smaller devices, it may be necessary to remove the Replay block to make room for the FFT blocks. After making the changes on X310, the result should look like the following:&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      ep0:                       # Stream endpoint name&lt;br /&gt;
        ctrl: True                      # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 32768                # Ingress buffer size for data&lt;br /&gt;
      ...&lt;br /&gt;
      ep2:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 32768                # Ingress buffer size for data&lt;br /&gt;
&lt;br /&gt;
Now we can add our FFT block. We'll put it on its own stream endpoint, so we first need to add a new stream endpoint. Add the following to the &amp;lt;code&amp;gt;stream_endpoints&amp;lt;/code&amp;gt; section:&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      ...&lt;br /&gt;
      ep_fft:                # The name can be incremented from previous SEP&lt;br /&gt;
        ctrl: False          # Only the first SEP needs control traffic&lt;br /&gt;
        data: True           # We do want to pass data through this SEP&lt;br /&gt;
        buff_size: 32768     # Ingress buffer size for data&lt;br /&gt;
&lt;br /&gt;
In this example, we've named the SEP &amp;lt;code&amp;gt;ep_fft&amp;lt;/code&amp;gt;. Other names could be given, as long as the name is unique (it does not have to be numbered). Now that we've allocated an SEP for our block, we need to instantiate the actual block. In the next section, add the following:&lt;br /&gt;
&lt;br /&gt;
Now let's add the FFT block. Note that the .yml file name and the parameters differ depending on the UHD version.&lt;br /&gt;
&lt;br /&gt;
Starting from UHD 4.8:&lt;br /&gt;
&lt;br /&gt;
* In this example, we're setting &amp;lt;code&amp;gt;MAX_FFT_SIZE_LOG2&amp;lt;/code&amp;gt; parameter to 10, which sets the max FFT-size to 1024.&lt;br /&gt;
&lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      ...&lt;br /&gt;
      fft0:                         # FFT block name&lt;br /&gt;
        block_desc: 'fft.yml'       # Block YAML descriptor file&lt;br /&gt;
        parameters:                 # Specify any Verilog module parameters (optional)&lt;br /&gt;
            MAX_FFT_SIZE_LOG2: 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From UHD 4.0 until UHD 4.7:&lt;br /&gt;
&lt;br /&gt;
* In this example, we're setting &amp;lt;code&amp;gt;EN_FFT_SHIFT&amp;lt;/code&amp;gt; parameter to 1, which causes the FFT block to center the zero frequency bin.&lt;br /&gt;
&lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      ...&lt;br /&gt;
      fft0:                          # FFT block name&lt;br /&gt;
        block_desc: 'fft_1x64.yml'   # Block YAML descriptor file&lt;br /&gt;
        parameters:                  # Specify any Verilog module parameters (optional)&lt;br /&gt;
          EN_FFT_SHIFT: 1&lt;br /&gt;
&lt;br /&gt;
Again, the name &amp;lt;code&amp;gt;fft0&amp;lt;/code&amp;gt; is arbitrary, but the name must be unique. In some cases, there will also be block parameters you'll want to pass, such as the data format of the FFT output data. &lt;br /&gt;
&lt;br /&gt;
Now that we've added our FFT block, we need to connect it to the stream endpoint. In the next section of the YAML file, we add the static connections:&lt;br /&gt;
&lt;br /&gt;
    connections:&lt;br /&gt;
      ...&lt;br /&gt;
      - { srcblk: ep_fft, srcport: out0,  dstblk: fft0,   dstport: in_0 }&lt;br /&gt;
      - { srcblk: fft0,   srcport: out_0, dstblk: ep_fft, dstport: in0  }&lt;br /&gt;
&lt;br /&gt;
This connects the output of SEP &amp;lt;code&amp;gt;ep_fft&amp;lt;/code&amp;gt; to the input of block &amp;lt;code&amp;gt;fft0&amp;lt;/code&amp;gt;, and the output of &amp;lt;code&amp;gt;fft0&amp;lt;/code&amp;gt; to the input of &amp;lt;code&amp;gt;ep_fft&amp;lt;/code&amp;gt;. Since we're placing the FFT block on its own SEP, the only connections we need to make are between the SEP and the FFT. All SEPs are automatically connected to the CHDR crossbar, so this effectively connects the FFT block to the crossbar, allowing it to communicate with anything on the RFNoC network.&lt;br /&gt;
&lt;br /&gt;
The names of block ports are defined in the YAML descriptions for the blocks. Blocks can use any names for their ports, and they don't have to be numbered (unless the number of ports is parameterized). Generally, the block ports are named &amp;lt;code&amp;gt;in_N&amp;lt;/code&amp;gt; for inputs to the block and &amp;lt;code&amp;gt;out_N&amp;lt;/code&amp;gt; for outputs. SEP ports are named &amp;lt;code&amp;gt;in0&amp;lt;/code&amp;gt; for the input &amp;lt;code&amp;gt;out0&amp;lt;/code&amp;gt; for the output.&lt;br /&gt;
&lt;br /&gt;
If you are having trouble connecting a block due to an unresolved connection, running &amp;lt;code&amp;gt;rfnoc_image_builder&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;-l debug&amp;lt;/code&amp;gt; option will list all available block ports.&lt;br /&gt;
&lt;br /&gt;
Finally, the FFT block has an additional clock input port named &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; that is used for the FFT signal processing. We need to connect it to a clock domain. Any clock that's at least as fast as the incoming data rate should be sufficient. For example, X3xx devices have a &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; clock (214.286 MHz) that is usually a good choice, but &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock (200 MHz) should also work for this example. For N31x and E3xx devices, &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock is a good choice (200 MHz on N31x and 100 MHz on E3xx). For N32x, &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; clock (250 MHz) is a good choice. For example, this is how you would connect the X310's &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; clock to the &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; port of the FFT block:&lt;br /&gt;
&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      ...&lt;br /&gt;
      - { srcblk: _device_, srcport: ce, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
And this is how you would connect &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock to the &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; port:&lt;br /&gt;
&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      ...&lt;br /&gt;
      - { srcblk: _device_, srcport: rfnoc_chdr, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
And finally, this is how you would connect &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; clock:&lt;br /&gt;
&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      ...&lt;br /&gt;
      - { srcblk: _device_, srcport: radio, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
The source block name &amp;lt;code&amp;gt;_device_&amp;lt;/code&amp;gt; is special and refers to the USRP device itself. Choose a clock that's apprpriate for your device and connect it as shown above.&lt;br /&gt;
&lt;br /&gt;
And that's it! The next step will be to run the image builder on our modified YAML file. Once that's done, and the bitstream has been created, you can load it onto your USRP X310 device, and verify the blocks, as we did in the [[#Inspect_the_Default_Image|Inspect the Default Image]] section.&lt;br /&gt;
&lt;br /&gt;
For example, from the X300 directory, you would run the following command to run the image builder:&lt;br /&gt;
&lt;br /&gt;
    $ rfnoc_image_builder -y x310_with_fft.yml -t X310_XG&lt;br /&gt;
&lt;br /&gt;
To download the FPGA bitstream to the X310, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args &amp;quot;type=x300,addr=192.168.30.2&amp;quot; --fpga-path ./build/usrp_x310_fpga_XG.bin&lt;br /&gt;
&lt;br /&gt;
You may need to change the IP address to match your device, depending on your configuration. After completing the flash update and power-cycling the USRP, run &amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt; to confirm that the FFT block was recognized.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe --args &amp;quot;type=x300,addr=192.168.30.2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Take a look at the RFNoC blocks and the static connections on the device. You should see the following new blocks and connections:&lt;br /&gt;
&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    ...&lt;br /&gt;
    |   |   * 0/FFT#0&lt;br /&gt;
    ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    ...&lt;br /&gt;
    |   |   * 0/SEP#6:0==&amp;gt;0/FFT#0:0&lt;br /&gt;
    |   |   * 0/FFT#0:0==&amp;gt;0/SEP#6:0&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;!-- TODO: At this point were were supposed to have a description of how to&lt;br /&gt;
test the FFT block. We might want to use a Python example, to keep it simple, but here's what was originally in the document.&lt;br /&gt;
&lt;br /&gt;
Since we put the FFT block on its own SEP, verifying that it is operating correctly will be simple. We can start by running some test vectors through the block by making an RFNoC application that creates only the RFNoC graph, the FFT block controller, and both an RX and a TX streamer.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;b&amp;gt;**************TODO**************&amp;lt;/b&amp;gt;&lt;br /&gt;
    // Make our controllers&lt;br /&gt;
    rfnoc_graph graph = graph(&amp;quot;&amp;quot;);&lt;br /&gt;
    auto fft_ctrl = graph-&amp;gt;get_block&amp;lt;fft_block_ctrl&amp;gt;(&amp;quot;0/FFT#0&amp;quot;);&lt;br /&gt;
    auto rx_streamer = graph-&amp;gt;get_rx_streamer();&lt;br /&gt;
    auto tx_streamer = graph-&amp;gt;get_tx_streamer();&lt;br /&gt;
     &lt;br /&gt;
    // Make connections&lt;br /&gt;
    graph-&amp;gt;connect(tx_streamer, fft);&lt;br /&gt;
    graph-&amp;gt;connect(fft, rx_streamer);&lt;br /&gt;
     &lt;br /&gt;
    // Make a test vector&lt;br /&gt;
    vec data = {0, 0.5, 1.};&lt;br /&gt;
    vec result(256);&lt;br /&gt;
     &lt;br /&gt;
    // Transmit to block&lt;br /&gt;
    tx_streamer.send(data);&lt;br /&gt;
    this_thread::sleep(10ms)&lt;br /&gt;
    rx_streamer.recv(result);&lt;br /&gt;
    // Verify&lt;br /&gt;
    // Check that each member in the result is as expected&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Adding an FFT Block to the Receive Chain===&lt;br /&gt;
&lt;br /&gt;
Now that we've added the FFT block and verified that it is operating as expected, let's see if we can modify it a little. Let's say that we're sure that we always want to receive the FFT bins from our device, and we don't want to see the raw samples. In order to save some FPGA resources, we can move our FFT block to be between the DDC and the SEP, on the RX data path. Instead of the previous modifications to our YAML file, we want the following:&lt;br /&gt;
&lt;br /&gt;
Starting from UHD 4.8:&lt;br /&gt;
&lt;br /&gt;
      stream_endpoints:&lt;br /&gt;
      ...&lt;br /&gt;
      # Unchanged from the default image core (no need for ep_fft).&lt;br /&gt;
    &lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      ...&lt;br /&gt;
      fft0:                          # FFT block name&lt;br /&gt;
        block_desc: 'fft.yml'   # Block YAML descriptor file&lt;br /&gt;
        parameters:                  # Specify any Verilog module parameters (optional)&lt;br /&gt;
          MAX_FFT_SIZE_LOG2: 10&lt;br /&gt;
    &lt;br /&gt;
    connections:&lt;br /&gt;
      ...&lt;br /&gt;
      # Change this line:&lt;br /&gt;
      # - { srcblk: ddc0, srcport: out_0, dstblk: ep0, dstport: in0  }&lt;br /&gt;
      # Change it to the following to add fft0 between ddc0 and ep0:&lt;br /&gt;
      - { srcblk: ddc0, srcport: out_0, dstblk: fft0, dstport: in_0 }&lt;br /&gt;
      - { srcblk: fft0, srcport: out_0, dstblk: ep0,  dstport: in0 }&lt;br /&gt;
&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      ...&lt;br /&gt;
      # As before, we still connect our FFT block to the clock domain&lt;br /&gt;
      - { srcblk: _device_, srcport: rfnoc_chdr, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
From UHD 4.0 until UHD 4.7:&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      ...&lt;br /&gt;
      # Unchanged from the default image core (no need for ep_fft).&lt;br /&gt;
    &lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      ...&lt;br /&gt;
      fft0:                          # FFT block name&lt;br /&gt;
        block_desc: 'fft_1x64.yml'   # Block YAML descriptor file&lt;br /&gt;
        parameters:                  # Specify any Verilog module parameters (optional)&lt;br /&gt;
          EN_FFT_SHIFT: 1&lt;br /&gt;
    &lt;br /&gt;
    connections:&lt;br /&gt;
      ...&lt;br /&gt;
      # Change this line:&lt;br /&gt;
      # - { srcblk: ddc0, srcport: out_0, dstblk: ep0, dstport: in0  }&lt;br /&gt;
      # Change it to the following to add fft0 between ddc0 and ep0:&lt;br /&gt;
      - { srcblk: ddc0, srcport: out_0, dstblk: fft0, dstport: in_0 }&lt;br /&gt;
      - { srcblk: fft0, srcport: out_0, dstblk: ep0,  dstport: in0 }&lt;br /&gt;
&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      ...&lt;br /&gt;
      # As before, we still connect our FFT block to the clock domain&lt;br /&gt;
      - { srcblk: _device_, srcport: rfnoc_chdr, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
This last line is valid for E310/E320; for X300/X310/N300/N310/N320/N321 use the following:&lt;br /&gt;
&lt;br /&gt;
      - { srcblk: _device_, srcport: ce, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
And as simply as that, we have added the FFT block to our RX block chain. Remember that this is a static connection, so when the resulting FPGA image is loaded onto your device, you will no longer be able to receive samples from the DDC directly; all samples on that chain will be processed by the FFT block, and you will only receive FFT bins from this radio chain.&lt;br /&gt;
&lt;br /&gt;
==Out-of-tree Modules==&lt;br /&gt;
&lt;br /&gt;
===OOT Overview===&lt;br /&gt;
&lt;br /&gt;
Now that we've gone over what is provided by UHD, let's start to look at custom RFNoC development. It's recommended that custom RFNoC development be kept separate from the in-tree UHD RFNoC infrastructure and examples, in order to simplify version control and licensing. Modules located outside of the repository are called ''out-of-tree'' (OOT).&lt;br /&gt;
&lt;br /&gt;
In order to understand how OOT modules for RFNoC are created, let's take a look at the example that's provided with UHD. You can find the example located in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/host/examples/rfnoc-example/&amp;lt;/code&amp;gt;. This example includes a simple Gain RFNoC block that we can use as a reference for creating our own OOT blocks.&lt;br /&gt;
&lt;br /&gt;
===OOT Subdirectories===&lt;br /&gt;
&lt;br /&gt;
Take a look at the &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; directory structure. An OOT module is a collection of block implementations, the software controllers for those blocks, and sometimes applications to demonstrate their functionality. These different components within the OOT module are organized into the directories described below.&lt;br /&gt;
&lt;br /&gt;
* HDL and Image Resources&lt;br /&gt;
** &amp;lt;code&amp;gt;fpga/&amp;lt;/code&amp;gt;: Contains the HDL (e.g., Verilog) required for the module. Each RFNoC block should have its own subdirectory here, such as &amp;lt;code&amp;gt;rfnoc_block_gain&amp;lt;/code&amp;gt;, for the Gain block.&lt;br /&gt;
** &amp;lt;code&amp;gt;rfnoc/blocks/&amp;lt;/code&amp;gt;: Contains the YAML RFNoC block definition files. These describe the block's interfaces and are used by the image builder. We'll go into more detail with regards to what goes into these YAML files in the [[#Creating_Your_Own_RFNoC_Block|Creating Your Own RFNoC Block]] section.&lt;br /&gt;
** &amp;lt;code&amp;gt;icores/&amp;lt;/code&amp;gt;: Contains example FPGA image core YAML files, to demonstrate how to create an FPGA image using your custom blocks. These image core files may demonstrate important parameters or show recommended configurations for chains of blocks.&lt;br /&gt;
* Block Controller and Example Software&lt;br /&gt;
** &amp;lt;code&amp;gt;include/&amp;lt;/code&amp;gt;: Contains the headers for the block controller software. Once installed, these headers will be used by UHD and other applications to interface with and control your custom RFNoC blocks.&lt;br /&gt;
** &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt;: Contains the block controller implementations. The files here should implement the features outlined in the headers located in the &amp;lt;code&amp;gt;include/&amp;lt;/code&amp;gt; directory. All unit test code should also be located here.&lt;br /&gt;
** &amp;lt;code&amp;gt;apps/&amp;lt;/code&amp;gt;: Contains example applications for your custom blocks. These applications may demonstrate how to use the block controllers, common configurations, or how to process data from your blocks.&lt;br /&gt;
* Infrastructure&lt;br /&gt;
** &amp;lt;code&amp;gt;cmake/&amp;lt;/code&amp;gt;: Contains any custom CMake commands the module may need. In general, simple modules will not need to modify this directory at all. More complicated modules with additional external dependencies may need to modify this.&lt;br /&gt;
&lt;br /&gt;
Take some time to explore the files in the &amp;lt;code&amp;gt;rfnoc-gain&amp;lt;/code&amp;gt;. Note the following files and directories related to the Gain example:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-gain/fpga/rfnoc_block_gain/&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;This is the HDL for the Gain RFNoC block.&lt;br /&gt;
** &amp;lt;code&amp;gt;rfnoc_block_gain.v&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The top-level synthesizable file for the Gain block&lt;br /&gt;
** &amp;lt;code&amp;gt;noc_shell_gain.v&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The NoC Shell for the Gain block&lt;br /&gt;
** &amp;lt;code&amp;gt;rfnoc_block_gain_tb.sv&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The simulation testbench&lt;br /&gt;
** &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The simulation Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-gain/blocks/gain.yml&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The YAML block definition file for the Gain block&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-gain/icores/x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;An example RFNoC image core YAML description showing how to connect the Gain block&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-gain/include/rfnoc/example/gain_block_control.hpp&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The software block controller header&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-gain/lib/gain_block_control.cpp&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The software block controller implementation&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-gain/apps/init_gain_block.cpp&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;An example showing how to find and initialize the Gain block&lt;br /&gt;
&amp;lt;!-- We should have an example that streams data that the customers can run using the Gain block --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Creating Your Own OOT Module===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This section is outdated, use rfnoc_modtool instead!'''&lt;br /&gt;
&lt;br /&gt;
To create your own OOT module, make a copy of the &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; directory. This will contain all the subdirectories and infrastructure files that you need to create your custom module. The directory name for your copy should be renamed to your desired name; we recommend something like &amp;lt;code&amp;gt;rfnoc-foo&amp;lt;/code&amp;gt;, for example, where &amp;lt;code&amp;gt;foo&amp;lt;/code&amp;gt; is the name for your OOT module. You'll also need to change &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; within the module's &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt; files to your module's name.&lt;br /&gt;
&lt;br /&gt;
Let's start by creating our own copy of the &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; to work with. We'll call our module &amp;lt;code&amp;gt;demo&amp;lt;/code&amp;gt;. You can put the copy wherever you like, but for this example we'll put it in our home directory. &lt;br /&gt;
&lt;br /&gt;
    $ cp -r &amp;lt;repo&amp;gt;/host/examples/rfnoc-example ~/&lt;br /&gt;
    $ mv ~/rfnoc-example ~/rfnoc-demo&lt;br /&gt;
&lt;br /&gt;
Now we need to edit our &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt; files to rename our module. Edit the following files and change all instances of &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;rfnoc-demo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
    ~/rfnoc-demo/CMakeLists.txt&lt;br /&gt;
    ~/rfnoc-demo/lib/CMakeLists.txt&lt;br /&gt;
&lt;br /&gt;
===Building and Installing an OOT Module===&lt;br /&gt;
The OOT module will need to be built and installed in order to use its RFNoC blocks. To build and install the OOT module we just created, do the following:&lt;br /&gt;
&lt;br /&gt;
    $ mkdir ~/rfnoc-demo/build&lt;br /&gt;
    $ cd ~/rfnoc-demo/build&lt;br /&gt;
    $ cmake -DUHD_FPGA_DIR=&amp;lt;repo&amp;gt;/fpga/ ../&lt;br /&gt;
&lt;br /&gt;
This configures the project to be installed in the default location. You may want to provide a different install directory to CMake using the &amp;lt;code&amp;gt;-DCMAKE_INSTALL_PREFIX&amp;lt;/code&amp;gt;. Please refer to the [https://files.ettus.com/manual/page_build_guide.html UHD Installation Guide] or the installation guide for other CMake-based projects for instructions on configuring CMake.&lt;br /&gt;
&lt;br /&gt;
Note that we specify the location of the FPGA source code using the &amp;lt;code&amp;gt;-DUHD_FPGA_DIR&amp;lt;/code&amp;gt; option. This allows you to run the FPGA testbenches and to build the example FPGA image provided with the OOT example.&lt;br /&gt;
&lt;br /&gt;
At this point, you can run &amp;lt;code&amp;gt;make help&amp;lt;/code&amp;gt; to see what options are available. A few of the available make targets are described below:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make rfnoc-demo&amp;lt;/code&amp;gt;: Build the block controllers for the RFNoC blocks&lt;br /&gt;
* &amp;lt;code&amp;gt;make testbenches&amp;lt;/code&amp;gt;: Run the testbenches for the RFNoC blocks&lt;br /&gt;
* &amp;lt;code&amp;gt;make x310_rfnoc_image_core&amp;lt;/code&amp;gt;: Build the FPGA example image&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;: Install the module&lt;br /&gt;
&lt;br /&gt;
To build and install the block, perform the following steps.&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/rfnoc-demo/build&lt;br /&gt;
    $ make&lt;br /&gt;
    $ make install&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; may be required depending on the install location.&lt;br /&gt;
&lt;br /&gt;
===Building an FPGA Image with OOT Blocks===&lt;br /&gt;
&lt;br /&gt;
At this point you can build the example FPGA that's included in the &amp;lt;code&amp;gt;icores&amp;lt;/code&amp;gt; directory. Take a look at &amp;lt;code&amp;gt;~/rfnoc-demo/icores/x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;. Note that the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block is added in exactly the same way that the FFT block was in [[#Example:_Adding_an_FFT_Block|Example: Adding an FFT Block]]. You can build this example FPGA for the X310 using the following steps:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/rfnoc-demo/build&lt;br /&gt;
    $ make x310_rfnoc_image_core&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can call &amp;lt;code&amp;gt;rfnoc_image_builder&amp;lt;/code&amp;gt; directly. In order to get the image builder to find your custom blocks, you may need to supply some additional arguments to find the OOT module, as shown in the following example:&lt;br /&gt;
&lt;br /&gt;
    $ rfnoc_image_builder -F &amp;lt;repo&amp;gt;/fpga –I ~/rfnoc-demo/include/rfnoc -y ~/rfnoc-demo/icores/x310_rfnoc_image_core.yml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; option is only required if the OOT module has not been installed on the system. &amp;lt;!-- I think this is supposed to be the case, but it's not working right now, so we will see. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have an X310, you can build and use the provided example to test the Gain block. If you have a different USRP, you can use its default &amp;lt;code&amp;gt;rfnoc_image_core.yml&amp;lt;/code&amp;gt; as a starting point and follow the same steps that we followed for the FFT block in [[#Example:_Adding_an_FFT_Block|Example: Adding an FFT Block]], then build it using the process described above.&lt;br /&gt;
&lt;br /&gt;
===Testing the Gain Example===&lt;br /&gt;
&lt;br /&gt;
After building an FPGA image for your USRP and downloading it to your device, the Gain block should be available. Test this by running &amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
   $ uhd_usrp_probe --args &amp;quot;type=x300,addr=192.168.30.2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Again, note that your &amp;lt;code&amp;gt;args&amp;lt;/code&amp;gt; may be different or may not be required if you only have a single USRP connected.&lt;br /&gt;
&lt;br /&gt;
Take a look at the RFNoC blocks and the static connections on the device. You should see the following new blocks and connections:&lt;br /&gt;
&amp;lt;!-- TODO: It should show &amp;quot;0/Gain#0&amp;quot; here --&amp;gt;&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    ...&lt;br /&gt;
    |   |   * 0/Block#0&lt;br /&gt;
    ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    ...&lt;br /&gt;
    |   |   * 0/SEP#4:0==&amp;gt;0/Block#0:0&lt;br /&gt;
    |   |   * 0/Block#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;!-- TODO:&lt;br /&gt;
Next, let's run the provided &amp;lt;code&amp;gt;init_gain_block&amp;lt;/code&amp;gt; application example.&lt;br /&gt;
&lt;br /&gt;
    $ ~/rfnoc-demo/build/apps/init_gain_block&lt;br /&gt;
    ...&lt;br /&gt;
    Gain value read/write loopback successful!&lt;br /&gt;
    $ &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
==Creating Your Own RFNoC Block==&lt;br /&gt;
&lt;br /&gt;
The Gain block is a useful example and could even be used as the starting point for a new block, but rather than trying to copy and edit the Gain block, it is best to use the RFNoC ModTool to create a new block template. This is also required if you want to change the interfaces provided to your IP that are exposed by the NoC Shell.&lt;br /&gt;
&lt;br /&gt;
===Understanding the Block Definition YAML===&lt;br /&gt;
&lt;br /&gt;
The first step in creating a new block is to write a YAML description for the block that you want to create. The options available are described [https://files.ettus.com/app_notes/RFNoC_Specification.pdf RFNoC Specification]. You can also look at the blocks available in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/host/include/uhd/rfnoc/blocks/&amp;lt;/code&amp;gt; for examples. We'll provide a brief overview here.&lt;br /&gt;
&lt;br /&gt;
Open up and take a look at the Gain block definition located in &amp;lt;code&amp;gt;~/rfnoc-demo/blocks/gain.yml&amp;lt;/code&amp;gt;. Notice the different sections, which are described below:&lt;br /&gt;
&lt;br /&gt;
* '''General Parameters'''&amp;lt;br&amp;gt;In this section we give our block a name (&amp;lt;code&amp;gt;module_name&amp;lt;/code&amp;gt;) and a unique block ID (&amp;lt;code&amp;gt;noc_id&amp;lt;/code&amp;gt;). The NoC ID is an arbitrary 32-bit number that will be used by the software to identify the block during system discovery. You can also specify the CHDR bus width, which should be 64 for Generation-3 USRPs.&lt;br /&gt;
* '''Clocks'''&amp;lt;br&amp;gt;In the &amp;lt;code&amp;gt;clocks&amp;lt;/code&amp;gt; section, we define the clocks that will be used by the block. The &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rfnoc_ctrl&amp;lt;/code&amp;gt; clocks are required. Many blocks also have a &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; clock for internal DSP.&lt;br /&gt;
* '''Control Interface'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;control&amp;lt;/code&amp;gt; section defines what type of control interface to make available to your block. The control interface is used for register reads and writes. Most blocks do not need to modify this section and will use the &amp;lt;code&amp;gt;ctrlport&amp;lt;/code&amp;gt; interface type. Control Port is the standard register interface used by RFNoC. The &amp;lt;code&amp;gt;clk_domain&amp;lt;/code&amp;gt; parameter allows you to specify which clock domain to use for the register interface exposed to your block. Typically this is the same clock that is used for the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; interface, to avoid clock crossings.&lt;br /&gt;
* '''Data Interface'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; section defines what type of data interface to make available to your block and describes the ports. Most blocks use either the &amp;lt;code&amp;gt;axis_pyld_ctxt&amp;lt;/code&amp;gt; or the &amp;lt;code&amp;gt;axis_data&amp;lt;/code&amp;gt; interface types.&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;clk_domain&amp;lt;/code&amp;gt; parameter allows you to specify which clock domain to use for the data interfaces exposed to your block. Typically this is the same clock that is used for the &amp;lt;code&amp;gt;control&amp;lt;/code&amp;gt; interface, to avoid clock crossings.&amp;lt;br&amp;gt;Under the &amp;lt;code&amp;gt;inputs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;outputs&amp;lt;/code&amp;gt; sections you can describe the input and output ports.&lt;br /&gt;
* '''IO Ports'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;io_ports&amp;lt;/code&amp;gt; section is used to describe other device-specific ports to which your block needs to connect (such as the DRAM or radio interfaces). For most blocks, this section is not used.&lt;br /&gt;
&lt;br /&gt;
A few other sections might be present in the YAML file (e.g., &amp;lt;code&amp;gt;registers&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;properties&amp;lt;/code&amp;gt;). These sections are reserved for future use and can be left empty.&lt;br /&gt;
&lt;br /&gt;
===Starting Your Own Block Definition===&lt;br /&gt;
&lt;br /&gt;
Let's start by making a copy of the Gain block YAML for our use case. &lt;br /&gt;
&lt;br /&gt;
    $ cp ~/rfnoc-demo/blocks/gain.yml ~/rfnoc-demo/blocks/demo.yml&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;lt;code&amp;gt;demo.yml&amp;lt;/code&amp;gt; file you just created and make the following changes:&lt;br /&gt;
&lt;br /&gt;
# Change the name of the block from &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;demo&amp;lt;/code&amp;gt;&lt;br /&gt;
# Change the &amp;lt;code&amp;gt;noc_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;0x0000DE30&amp;lt;/code&amp;gt;&lt;br /&gt;
# Change the &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; for the &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;out&amp;lt;/code&amp;gt; ports from &amp;lt;code&amp;gt;int32&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This YAML file now describes a block with the following features:&lt;br /&gt;
&lt;br /&gt;
* The block named &amp;quot;demo&amp;quot;&lt;br /&gt;
* NoC ID of 0xDE30&lt;br /&gt;
* CtrlPort register interface on the &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock domain&lt;br /&gt;
* A single 32-bit input port named &amp;quot;In&amp;quot; on the &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock domain that will provide sc16 samples to your IP&lt;br /&gt;
* A single 32-bit output port named &amp;quot;Out&amp;quot; on the &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock domain that will receive sc16 samples from your IP&lt;br /&gt;
&lt;br /&gt;
===Generating Your Block Using the ModTool===&lt;br /&gt;
&lt;br /&gt;
Now that we have a block definition YAML file, we can generate the source code templates and NoC Shell for our block. To do so, run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ python3 &amp;lt;repo&amp;gt;/host/utils/rfnoc_blocktool/rfnoc_create_verilog.py -c ~/rfnoc-demo/blocks/demo.yml -d ~/rfnoc-demo/fpga/rfnoc_block_demo&lt;br /&gt;
&lt;br /&gt;
This will create a folder named &amp;lt;code&amp;gt;~/rfnoc-demo/fpga/rfnoc_block_demo&amp;lt;/code&amp;gt; with an RFNoC block template for you to use. Explore the folder that was created. You should see the following files:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;''': This is the Makefile for the simulation testbench. See [https://files.ettus.com/manual/md_usrp3_sim_running_testbenches.html Running a Testbench] in the UHD and USRP Manual for instructions on how to run a testbench.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt;''': This is another makefile that identifies the HDL source code that makes up your RFNoC block. &lt;br /&gt;
* '''&amp;lt;code&amp;gt;noc_shell_demo.v&amp;lt;/code&amp;gt;''': This is the NoC Shell that was generated for your block. It provides the interfaces described in the block definition YAML.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;rfnoc_block_demo.v&amp;lt;/code&amp;gt;''': This is a template for your RFNoC block. It includes all the top-level ports required by RFNoC and instantiates the NoC Shell.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;rfnoc_block_demo_tb.sv&amp;lt;/code&amp;gt;''': This is a testbench template for your RFNoC block. It instantiates your RFNoC block and the bus functional models (BFMs) needed to communicate with your block in simulation.&lt;br /&gt;
&lt;br /&gt;
Take a moment to look at the &amp;lt;code&amp;gt;rfnoc_block_demo.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rfnoc_block_demo_tb.sv&amp;lt;/code&amp;gt; files that were generated for your block. Notice the &amp;quot;User Logic&amp;quot; section towards the end of the &amp;lt;code&amp;gt;rfnoc_block_demo&amp;lt;/code&amp;gt; module. This is the location where you can insert your own IP.&lt;br /&gt;
&lt;br /&gt;
The input data samples come in on the &amp;lt;code&amp;gt;m_in_payload&amp;lt;/code&amp;gt; AXI4-Stream bus. The output data samples go out on the &amp;lt;code&amp;gt;s_out_payload&amp;lt;/code&amp;gt; AXI4-Stream data bus. &lt;br /&gt;
&lt;br /&gt;
If your input packets are the same size as your output packets (i.e., for every sample in you generate one sample out) then the &amp;lt;code&amp;gt;m_in_context&amp;lt;/code&amp;gt; data bus can be used to drive &amp;lt;code&amp;gt;s_out_context&amp;lt;/code&amp;gt;. The context bus is described in detail in the [https://files.ettus.com/app_notes/RFNoC_Specification.pdf RFNoC Specification].&lt;br /&gt;
&lt;br /&gt;
Similarly, the testbench has a section where you can add your own test sequences to the test bench.&lt;br /&gt;
&lt;br /&gt;
If you decide you need to change the RFNoC interfaces for your block (e.g., add ports, or change the interface type), then it is recommended to update the block definition YAML then regenerate the block. Please take care to not overwrite any code you have written when regenerating the files for your block! Rerunning the tool will cause new files to be generated, with a new NoC Shell, and will demonstrate how to update your code for the new interfaces.&lt;br /&gt;
&lt;br /&gt;
Refer to the Gain example and other RFNoC blocks for examples of how to complete your RFNoC block logic and testbenches.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
In this guide we have given a brief introduction on how to develop for RFNoC in UHD 4.0. There's a lot more you can do than is described here, but this will hopefully get you started. Happy coding!&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=RFNoC_Frequently_Asked_Questions&amp;diff=6039</id>
		<title>RFNoC Frequently Asked Questions</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=RFNoC_Frequently_Asked_Questions&amp;diff=6039"/>
				<updated>2024-06-26T09:33:25Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* How do I add a clock with a different frequency? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Configuring the Stream Endpoint Buffer Size in RFNoC ==&lt;br /&gt;
&lt;br /&gt;
=== What is the SEP buffer size? ===&lt;br /&gt;
&lt;br /&gt;
Each stream endpoint (SEP) has an ingress buffer to store data received from others stream endpoints. This size of this buffer affects the data transfer rate that can be achieved when streaming to that endpoint. A larger ingress buffer in the stream endpoint means that there is more space to put data, minimizing idle time on the network. Additionally, streamers can queue up data before it is needed, reducing the chance of a buffer underflow.&lt;br /&gt;
&lt;br /&gt;
=== How do I set the SEP buffer size? ===&lt;br /&gt;
&lt;br /&gt;
The stream endpoint buffer size is set by adding a parameter under the endpoint you want to configure in the RFNoC image core YAML file. There are two parameters you can use to set the stream endpoint ingress buffer size in your RFNoC image core YAML file.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;buff_size&amp;lt;/code&amp;gt;: Buffer size in CHDR words. The size in bytes depends on the CHDR width. For example, if the &amp;lt;code&amp;gt;chdr_width&amp;lt;/code&amp;gt; parameter for the device is 64, then each CHDR word is 8 bytes. So a buff size of 32768 would be 262,144 bytes or 256 KiB. See [https://github.com/EttusResearch/uhd/blob/197cdc4f665cbd4e6394a7eeb44b405f67ab10b1/fpga/usrp3/top/x300/x310_rfnoc_image_core.yml#L20 here] for an example.&lt;br /&gt;
* &amp;lt;code&amp;gt;buff_size_bytes&amp;lt;/code&amp;gt;:  Buffer size in bytes. See [https://github.com/EttusResearch/uhd/blob/197cdc4f665cbd4e6394a7eeb44b405f67ab10b1/fpga/usrp3/top/x400/x410_200_rfnoc_image_core.yml#L21 here] for an example.&lt;br /&gt;
&lt;br /&gt;
=== To what value should I set the SEP buffer size? ===&lt;br /&gt;
&lt;br /&gt;
The buffer size should be a power of two in size to make optimal use of FPGA RAM resources. The default FPGA bitstreams typically set them to the largest size the FPGA can fit in order to maximize performance. Here are some general recommendations:&lt;br /&gt;
&lt;br /&gt;
* Set to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; if you don't need to send data to that SEP.&lt;br /&gt;
* Set to &amp;lt;code&amp;gt;8192&amp;lt;/code&amp;gt; bytes (8 KiB = 1 MTU) minimum in order to stream data packets.&lt;br /&gt;
* Set to &amp;lt;code&amp;gt;32768&amp;lt;/code&amp;gt; bytes (32 KiB = 4 MTU) in order to stream at maximum rates between SEPs on the same FPGA.&lt;br /&gt;
* Set to &amp;lt;code&amp;gt;262144&amp;lt;/code&amp;gt; bytes (256 KiB = 32 MTU) or lager for high performance streaming between a host computer and the FPGA.&lt;br /&gt;
&lt;br /&gt;
Note that the requirements are application-dependent, so optimal sizes for your application may be different. MTU refers to the maximum transmission unit, which is the largest CHDR packet supported by the FPGA.&lt;br /&gt;
&lt;br /&gt;
If you need to free up FPGA resources (particularly block RAM) for your application, you can reduce the SEP buffer sizes. Just keep in mind that the maximum streaming rate may be affected.&lt;br /&gt;
&lt;br /&gt;
== USRP DRAM ==&lt;br /&gt;
&lt;br /&gt;
=== How much and what speed DRAM is available on each USRP? ===&lt;br /&gt;
&lt;br /&gt;
The table below summarizes the DRAM that is connected to the USRP for use by RFNoC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ USRP DRAM Summary&lt;br /&gt;
|-&lt;br /&gt;
! USRP Model !! DRAM Size !! Default DRAM Speed !! Default User Interface&lt;br /&gt;
|-&lt;br /&gt;
| E31x || 512 MiB || 16-bit @ 800 MT/s (1.6 GB/s) || 2 ch x 64-bit @ 100 MHz&lt;br /&gt;
|-&lt;br /&gt;
| E320 || 2 GiB || 32-bit @ 1333 MT/s (5.33 GB/s) || 4 ch x 64-bit @ 300 MHz&lt;br /&gt;
|-&lt;br /&gt;
| N3xx || 2 GiB || 32-bit @ 1300 MT/s (5.2 GB/s) || 4 ch x 64-bit @ 303.819 MHz&lt;br /&gt;
|-&lt;br /&gt;
| X3xx || 1 GiB || 32-bit @ 1200 MT/s (4.8 GB/s) || 2 ch x 64-bit @ 300 MHz&lt;br /&gt;
|-&lt;br /&gt;
| X410 (100 and 200 MHz BW) || 4 GiB || 64-bit @ 2.0 GT/s (16.0 GB/s) || 4 x 64-bit @ 250 MHz&lt;br /&gt;
|-&lt;br /&gt;
| X410 (400 MHz BW) || 4 GiB per bank&amp;lt;br&amp;gt;(8 GiB total) || 64-bit @ 2.0 GT/s (16.0 GB/s) per bank&amp;lt;br&amp;gt;(32.0 GB/s total) || 4 x 128-bit @ 250 MHz (using 2 banks)&lt;br /&gt;
|-&lt;br /&gt;
| X440 (400 MHz BW) || 4 GiB per bank&amp;lt;br&amp;gt;(8 GiB total) || 64-bit @ 2.4 GT/s (19.2 GB/s) per bank&amp;lt;br&amp;gt;(38.4 GB/s total) || 8 x 128-bit @ 300 MHz (using 2 banks)&lt;br /&gt;
|-&lt;br /&gt;
| X440 (1600 MHz BW) || 4 GiB per bank&amp;lt;br&amp;gt;(8 GiB total) || 64-bit @ 2.4 GT/s (19.2 GB/s) per bank&amp;lt;br&amp;gt;(38.4 GB/s total) || 2 x 512-bit @ 300 MHz (using 2 banks)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== What DRAM data rates can I expect on each USRP? ===&lt;br /&gt;
&lt;br /&gt;
DRAM performance is highly application-specific. For example, reading vs. reading and writing simultaneously, one data stream vs. multiple data streams, random access vs. sequential access, etc., can give dramatically different performance. Below are some measurements taken on different USRPs where a Null-Source-Sink RFNoC block is directly connected to a DMA FIFO block to test maximum streaming rates through the DRAM. The DRAM is shared between channels, so throughput goes down as the number of channels going through the DRAM is increased.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Example DRAM Throughput (Per Channel)&lt;br /&gt;
|-&lt;br /&gt;
! USRP Model !! BIST (MB/s) !! 1 Ch (MS/s) !! 2 Ch (MS/s) !! 3 Ch (MS/s) !! 4 Ch (MS/s)&lt;br /&gt;
|-&lt;br /&gt;
| E31x || 666 || 166 || 91 || N/A || N/A&lt;br /&gt;
|-&lt;br /&gt;
| E320 || 1361 || 340 || 299 || 191 || 148&lt;br /&gt;
|-&lt;br /&gt;
| N3xx || 1368 || 341 || 295 || 191 || 144&lt;br /&gt;
|-&lt;br /&gt;
| X3xx || 1347 || 336 || 274 || N/A || N/A&lt;br /&gt;
|-&lt;br /&gt;
| X410 (100 and 200 MHz BW) || 1288 || 321|| 316|| 314 || 303&lt;br /&gt;
|-&lt;br /&gt;
| X410 (400 MHz BW) || 2801 || 697 || 672 || 672 || 672&lt;br /&gt;
|-&lt;br /&gt;
| X440 (400 MHz BW) || 3360 || 798 || 784 || 616 || 461&lt;br /&gt;
|-&lt;br /&gt;
| X440 (1600 MHz BW) || 8118 || 2007 || 2007 || N/A || N/A&lt;br /&gt;
|}&lt;br /&gt;
Notes:&lt;br /&gt;
# E31x, N3xx, and X410 were tested using UHD 4.2. E320 and X3xx were tested using UHD 4.3.&lt;br /&gt;
# BIST refers to the built-in self test, which gives a measure of raw data throughput for a single channel.&lt;br /&gt;
# For MS/s, we assume 4 bytes per sample (sc16).&lt;br /&gt;
# X410 with 400 MHz bandwidth uses two independent memory banks, with channels 0-1 on Bank 0, and channels 2-3 on Bank 1 by default. The traffic flows on Bank 0 and Bank 1 are independent and do not affect each other. Therefore, a 4-channel configuration has the same performance as a 2-channel configuration.&lt;br /&gt;
# X440 uses two independent memory banks. For 400 MHz, channels 0-3 are on Bank 0 and channels 4-7 are on Bank 1 by default. For 1600 MHz, channel 0 is on Bank 0 and channel 1 is on bank 1 by default. The traffic flows on Bank 0 and Bank 1 are independent and do not affect each other. Therefore, a 2-channel configuration has the same performance as a 1-channel configuration.&lt;br /&gt;
&lt;br /&gt;
=== What can the DRAM be used for? ===&lt;br /&gt;
&lt;br /&gt;
* '''DMA FIFO Block:''' The DMA FIFO block is used in situations where you need a large buffer to store samples.&lt;br /&gt;
&lt;br /&gt;
* '''Replay Block:''' The Replay block is used to record and play back RF data. For example, you can record data from a host computer, then play it back over the radio. Or, record data from the radio, then play it back later to the host for analysis, or play it back to a radio at a specific timestamp. See [[Using the RFNoC Replay Block in UHD 4]] for additional information. The Replay block also has a FIFO capability for situations in which the DMA FIFO block is not available in your FPGA image.&lt;br /&gt;
&lt;br /&gt;
* '''Custom Blocks:''' You can also create your own RFNoC block that uses DRAM. Refer to the DMA FIFO and/or Replay blocks as examples.&lt;br /&gt;
&lt;br /&gt;
=== How do I add the Replay/DMA FIFO block to my FPGA image? ===&lt;br /&gt;
&lt;br /&gt;
If the block you want is not included by default in the FPGA image you are using, you can add it to the RFNoC image core YAML file and rebuild the FPGA image using Vivado. See [[Getting Started with RFNoC in UHD 4.0]] for additional information on customizing an RFNoC image.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' DRAM is not enabled by default on E31x FPGA builds because the FPGA is not large enough to fit the default image with DRAM. You will need to remove components from your RFNoC image's YAML file to make room, then build the E31x image with the variable DRAM=1 set, or modify the E31x Makefile to enable DRAM by default.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The default DRAM configuration used for X410 and X440 changes depending on the configured bandwidth. The default parameters to use for each image type is shown in the table below.&lt;br /&gt;
&lt;br /&gt;
When adding the blocks to your RFNoC image core YAML file, the parameters must be set correctly for the type of USRP you intend to use. The memory data width (&amp;lt;code&amp;gt;MEM_DATA_W&amp;lt;/code&amp;gt;) and address width (&amp;lt;code&amp;gt;MEM_ADDR_W&amp;lt;/code&amp;gt;) must match exactly. The number of ports (&amp;lt;code&amp;gt;NUM_PORTS&amp;lt;/code&amp;gt;) must not exceed the maximum number available. You can use fewer ports to save resources if you don't need all the DRAM ports.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ RFNoC Block Memory Parameters&lt;br /&gt;
|-&lt;br /&gt;
! USRP Model !! MEM_DATA_W !! MEM_ADDR_W !! NUM_PORTS (Max)&lt;br /&gt;
|-&lt;br /&gt;
| E31x || 64 || 29 || 2&lt;br /&gt;
|-&lt;br /&gt;
| E320 || 64 || 31 || 4&lt;br /&gt;
|-&lt;br /&gt;
| N3xx || 64 || 31 || 4&lt;br /&gt;
|-&lt;br /&gt;
| X3xx || 64 || 30 || 2&lt;br /&gt;
|-&lt;br /&gt;
| X410 (100 and 200 MHz BW) || 64 || 32 || 4&lt;br /&gt;
|-&lt;br /&gt;
| X410 (400 MHz BW) || 128 || 32 || 4&lt;br /&gt;
|-&lt;br /&gt;
| X440 (400 MHz BW) || 128 || 32 || 8&lt;br /&gt;
|-&lt;br /&gt;
| X440 (1600 MHz BW) || 512 || 32 || 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The DMA FIFO has a few additional parameters that should be provided. The clock rate (&amp;lt;code&amp;gt;MEM_CLK_RATE&amp;lt;/code&amp;gt;) must match the value below for the built-in self test (BIST) to work correctly. The base address (&amp;lt;code&amp;gt;FIFO_ADDR_BASE&amp;lt;/code&amp;gt;) and address mask (&amp;lt;code&amp;gt;FIFO_ADDR_MASK&amp;lt;/code&amp;gt;) are written as Verilog constants and can be changed depending on your application. The &amp;lt;code&amp;gt;FIFO_ADDR_BASE&amp;lt;/code&amp;gt; parameter contains the byte address for the first byte of the memory region to use for each port. The &amp;lt;code&amp;gt;FIFO_ADDR_MASK&amp;lt;/code&amp;gt; parameter contains the address mask for each port, which tells the FIFO how much memory to use for each port. For example, an address mask of &amp;lt;code&amp;gt;30'h1FFFFFFF&amp;lt;/code&amp;gt; means that 0x1FFFFFFF+1 bytes (i.e., 0x20000000 bytes or 512 MiB) will be used by the corresponding port. The address mask must be 1 less than a power of 2.&lt;br /&gt;
&lt;br /&gt;
The example values in the table below use the entire memory and divide it evenly between all available ports. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ DMA FIFO Parameters&lt;br /&gt;
|-&lt;br /&gt;
! USRP Model !! MEM_CLK_RATE !! FIFO_ADDR_BASE !! FIFO_ADDR_MASK&lt;br /&gt;
|-&lt;br /&gt;
| E31x || &amp;quot;200e6&amp;quot; || &amp;quot;{29'h10000000, 29'h00000000}&amp;quot; || &amp;quot;{29'h0FFFFFFF, 29'h0FFFFFFF}&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| E320 || &amp;quot;300e6&amp;quot; || &amp;quot;{31'h60000000, 31'h40000000, 31'h20000000, 31'h00000000}&amp;quot; || &amp;quot;{31'h1FFFFFFF, 31'h1FFFFFFF, 31'h1FFFFFFF, 31'h1FFFFFFF}&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| N3xx || &amp;quot;303819444&amp;quot; || &amp;quot;{31'h60000000, 31'h40000000, 31'h20000000, 31'h00000000}&amp;quot; || &amp;quot;{31'h1FFFFFFF, 31'h1FFFFFFF, 31'h1FFFFFFF, 31'h1FFFFFFF}&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| X3xx || &amp;quot;300e6&amp;quot; || &amp;quot;{30'h20000000, 30'h00000000}&amp;quot; || &amp;quot;{30'h1FFFFFFF, 30'h1FFFFFFF}&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| X410 (100 and 200 MHz BW) || &amp;quot;250e6&amp;quot; || &amp;quot;{32'hC0000000, 32'h80000000, 32'h40000000, 32'h00000000}&amp;quot; || &amp;quot;{32'h3FFFFFFF, 32'h3FFFFFFF, 32'h3FFFFFFF, 32'h3FFFFFFF}&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| X410 (400 MHz BW) || &amp;quot;250e6&amp;quot; || &amp;quot;{32'h80000000, 32'h00000000, 32'h80000000, 32'h00000000}&amp;quot; || &amp;quot;{32'h7FFFFFFF, 32'h7FFFFFFF, 32'h7FFFFFFF, 32'h7FFFFFFF}&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| X440 (400 MHz BW) || &amp;quot;300e6&amp;quot; || &amp;quot;{32'hC0000000, 32'h80000000, 32'h40000000, 32'h00000000, 32'hC0000000, 32'h80000000, 32'h40000000, 32'h00000000}&amp;quot; || &amp;quot;{32'h3FFFFFFF, 32'h3FFFFFFF, 32'h3FFFFFFF, 32'h3FFFFFFF, 32'h3FFFFFFF, 32'h3FFFFFFF, 32'h3FFFFFFF, 32'h3FFFFFFF}&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| X440 (1600 MHz BW) || &amp;quot;300e6&amp;quot; || &amp;quot;{32'h00000000, 32'h00000000}&amp;quot; || &amp;quot;{32'hFFFFFFFF, 32'hFFFFFFFF}&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Replay Example ====&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/EttusResearch/uhd/blob/197cdc4f665cbd4e6394a7eeb44b405f67ab10b1/fpga/usrp3/top/x300/x310_rfnoc_image_core.yml#L69 x310_rfnoc_image_core.yml] for an example of how to instantiate the Replay block in the RFNoC image core YAML description. The following is a generic example that can be used for any USRP:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
noc_blocks:&lt;br /&gt;
  # Instantiate the replay block&lt;br /&gt;
  replay0:&lt;br /&gt;
    block_desc: 'replay.yml'&lt;br /&gt;
    parameters:&lt;br /&gt;
      NUM_PORTS: &amp;lt;see table&amp;gt;&lt;br /&gt;
      MEM_DATA_W: &amp;lt;see table&amp;gt;&lt;br /&gt;
      MEM_ADDR_W: &amp;lt;see table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
connections:&lt;br /&gt;
  # Connect each port of the replay block to a stream endpoint&lt;br /&gt;
  - { srcblk: &amp;lt;epN&amp;gt;,   srcport: out0,  dstblk: replay0, dstport: in_0 }&lt;br /&gt;
  - { srcblk: replay0, srcport: out_0, dstblk: &amp;lt;epN&amp;gt;,   dstport: in0  }&lt;br /&gt;
  - { srcblk: &amp;lt;epN+1&amp;gt;, srcport: out0,  dstblk: replay0, dstport: in_1 }&lt;br /&gt;
  - { srcblk: replay0, srcport: out_1, dstblk: &amp;lt;epN+1&amp;gt;, dstport: in0  }&lt;br /&gt;
  ... repeat for each remaining Replay port&lt;br /&gt;
  # Connect the replay block memory interface to the USRP DRAM&lt;br /&gt;
  - { srcblk: replay0, srcport: axi_ram, dstblk: _device_, dstport: dram }&lt;br /&gt;
&lt;br /&gt;
Connect the DRAM clock to the block:&lt;br /&gt;
clk_domains:&lt;br /&gt;
  # Connect the DRAM clock to the replay block&lt;br /&gt;
  - { srcblk: _device_, srcport: dram, dstblk: replay0, dstport: mem }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== DMA FIFO Example ====&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/EttusResearch/uhd/blob/197cdc4f665cbd4e6394a7eeb44b405f67ab10b1/fpga/usrp3/top/e320/e320_rfnoc_image_core.yml#L49 e320_rfnoc_image_core.yml] for an example of how to instantiate the DMA FIFO block in the RFNoC image core YAML description. The following is a generic example that can be used for any USRP:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
noc_blocks:&lt;br /&gt;
  # Instantiate the DMA FIFO block&lt;br /&gt;
  fifo0:&lt;br /&gt;
    block_desc: 'axi_ram_fifo.yml'&lt;br /&gt;
    parameters:&lt;br /&gt;
      NUM_PORTS: &amp;lt;see table&amp;gt;&lt;br /&gt;
      MEM_DATA_W: &amp;lt;see table&amp;gt;&lt;br /&gt;
      MEM_ADDR_W: &amp;lt;see table&amp;gt;&lt;br /&gt;
      FIFO_ADDR_BASE: &amp;lt;see table&amp;gt;&lt;br /&gt;
      FIFO_ADDR_MASK: &amp;lt;see table&amp;gt;&lt;br /&gt;
      MEM_CLK_RATE: &amp;lt;see table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
connections:&lt;br /&gt;
  # Connect each port of the DMA FIFO block to a stream endpoint, or insert it&lt;br /&gt;
  # into the data path where desired. This examples uses stream endpoints.&lt;br /&gt;
  - { srcblk: &amp;lt;epN&amp;gt;,   srcport: out0,  dstblk: fifo0,   dstport: in_0 }&lt;br /&gt;
  - { srcblk: replay0, srcport: out_0, dstblk: &amp;lt;epN&amp;gt;,   dstport: in0  }&lt;br /&gt;
  - { srcblk: &amp;lt;epN+1&amp;gt;, srcport: out0,  dstblk: fifo0,   dstport: in_1 }&lt;br /&gt;
  - { srcblk: fifo0,   srcport: out_1, dstblk: &amp;lt;epN+1&amp;gt;, dstport: in0  }&lt;br /&gt;
  ... repeat for each remaining FIFO port&lt;br /&gt;
  # Connect the DMA FIFO block memory interface to the USRP DRAM&lt;br /&gt;
  - { srcblk: fifo0, srcport: axi_ram, dstblk: _device_, dstport: dram }&lt;br /&gt;
&lt;br /&gt;
clk_domains:&lt;br /&gt;
  # Connect the DRAM clock to the replay block&lt;br /&gt;
  - { srcblk: _device_, srcport: dram, dstblk: fifo0,  dstport: mem }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RFNoC Clocks ==&lt;br /&gt;
&lt;br /&gt;
=== What clocks are available for me to use? ===&lt;br /&gt;
&lt;br /&gt;
Each device has different clocks available. See below for a list of clocks exposed to RFNoC. Although they have intended purposes, you can use any of these clocks for any purpose. The &amp;lt;code&amp;gt;rfnoc_chdr_clock&amp;lt;/code&amp;gt; is a good default choice. This clock is always available in your block, even if it is not explicitly connected in the RFNoC image YAML description.&lt;br /&gt;
&lt;br /&gt;
=== What are the clock frequencies? ===&lt;br /&gt;
&lt;br /&gt;
See the table below for the clock rates. The radio clock rate depends on the master clock rate.&lt;br /&gt;
&lt;br /&gt;
====E31x====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Clock Name !! Description !! Frequency&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; || RFNoC CHDR clock || 100 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_ctrl&amp;lt;/code&amp;gt; || RFNoC Control clock || 40 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;dram&amp;lt;/code&amp;gt; || DRAM interface clock || 100 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; || Radio interface clock || Same as master clock rate&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====E320====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Clock Name !! Description !! Frequency&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; || RFNoC CHDR clock || 200 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_ctrl&amp;lt;/code&amp;gt; || RFNoC Control clock || 40 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;dram&amp;lt;/code&amp;gt; || DRAM interface clock || 166.667 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; || Radio interface clock || Same as master clock rate (200 kHz to 61.44 MHz)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====N300/N310====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Clock Name !! Description !! Frequency&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; || RFNoC CHDR clock || 200 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_ctrl&amp;lt;/code&amp;gt; || RFNoC Control clock || 40 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;dram&amp;lt;/code&amp;gt; || DRAM interface clock || 303.819 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; || Radio interface clock || Same as master clock rate (122.88 MHz, 125.0 MHz, or 153.6 MHz)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====N32x====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Clock Name !! Description !! Frequency&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; || RFNoC CHDR clock || 200 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_ctrl&amp;lt;/code&amp;gt; || RFNoC Control clock || 40 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;dram&amp;lt;/code&amp;gt; || DRAM interface clock || 303.819 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; || Radio interface clock || Same as master clock rate (200 MHz, 245.76 MHz, or 250 MHz)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====X3xx====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Clock Name !! Description !! Frequency&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; || RFNoC CHDR clock || 187.5 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_ctrl&amp;lt;/code&amp;gt; || RFNoC Control clock || 93.75 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; || Compute Engine clock || 214.286 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;dram&amp;lt;/code&amp;gt; || DRAM interface clock || 300 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; || Radio interface clock || Same as master clock rate (184.32 MHz or 200 MHz)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====X410====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Clock Name !! Description !! Frequency&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; || RFNoC CHDR clock || 200 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_ctrl&amp;lt;/code&amp;gt; || RFNoC Control clock || 40 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;dram&amp;lt;/code&amp;gt; || DRAM interface clock || 250 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; || Radio interface clock || 122.88 MHz when master clock rate is 122.88, 245.76, or 491.52 MHz&amp;lt;br&amp;gt;125 MHz when master clock rate is 125, 250, or 500 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;radio_2x&amp;lt;/code&amp;gt; || Radio interface clock 2x || Twice the frequency of &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====X440====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Clock Name !! Description !! Frequency&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; || RFNoC CHDR clock || 200 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rfnoc_ctrl&amp;lt;/code&amp;gt; || RFNoC Control clock || 40 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;dram&amp;lt;/code&amp;gt; || DRAM interface clock || 300 MHz&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;radio0&amp;lt;/code&amp;gt; || Radio interface clock for daughterboard 0 || Daughterboard 0 master clock rate divided by 8 (e.g., 62.5 MHz if master clock rate is 500 MHz)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;radio1&amp;lt;/code&amp;gt; || Radio interface clock for daughterboard 1 || Daughterboard 1 master clock rate divided by 8&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;radio0_2x&amp;lt;/code&amp;gt; || Radio interface clock 2x for daughterboard 0 || Twice the frequency of &amp;lt;code&amp;gt;radio0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;radio1_2x&amp;lt;/code&amp;gt; || Radio interface clock 2x for daughterboard 1 || Twice the frequency of &amp;lt;code&amp;gt;radio1&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How do I add a clock with a different frequency? ===&lt;br /&gt;
&lt;br /&gt;
If you only need the clock within your own RFNoC block, you can modify the HDL for your block to generate the clock that you need from one of the available clocks. To do this, add a new clock to your block's YAML description, connect the available clock to your block in the YAML description of your RFNoC image, then add a Xilinx MMCM IP instance to your block's HDL and connect the available clock to its input.&lt;br /&gt;
&lt;br /&gt;
Starting with UHD 4.7, you can add clock generation modules that create new clocks based on the existing clocks. Note that you must create such a module as an HDL module: Describing clocks in the YAML files will not cause them to be generated for you.&lt;br /&gt;
&lt;br /&gt;
Assuming you have such a module, describe the clocks in the module's YAML files as such:&lt;br /&gt;
&lt;br /&gt;
 clocks:&lt;br /&gt;
    - name: ce&lt;br /&gt;
      direction: in&lt;br /&gt;
    - name: my_clk&lt;br /&gt;
      direction: out&lt;br /&gt;
&lt;br /&gt;
Now you will have a new clock called &amp;lt;code&amp;gt;my_clk&amp;lt;/code&amp;gt;, which is derived from the &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; clock.&lt;br /&gt;
&lt;br /&gt;
In older versions of UHD, adding custom clocks is not directly supported. If you can't use any of the available clocks, you can modify the HDL code to generate a clock.&lt;br /&gt;
&lt;br /&gt;
If the clock is needed by multiple RFNoC blocks, or if you want to change an existing clock, you can modify the HDL for the USRP you are using to add or change a clock. If you add a new clock to the RFNoC image core, you must also update the BSP YAML file (located in [https://github.com/EttusResearch/uhd/tree/master/host/include/uhd/rfnoc/core &amp;lt;repo&amp;gt;/host/include/uhd/rfnoc/core]) so that the &amp;lt;code&amp;gt;rfnoc_image_builder&amp;lt;/code&amp;gt; knows that the clock exists. How and where the clocks are generated varies between USRPs. Please refer to the source code for that USRP ([https://github.com/EttusResearch/uhd/tree/master/fpga/usrp3/top &amp;lt;repo&amp;gt;/fpga/usrp3/top]).&lt;br /&gt;
&lt;br /&gt;
== Xilinx Vivado ==&lt;br /&gt;
&lt;br /&gt;
=== Do I need a Vivado license to build custom RFNoC FPGA images? ===&lt;br /&gt;
&lt;br /&gt;
All RFNoC-capable USRPs use Xilinx FPGAs that require a license to use Vivado, except for E31x USRPs, which can use the free Vivado HL WebPACK Edition. Vivado is required to build FPGAs for RFNoC. &lt;br /&gt;
&lt;br /&gt;
=== Which version and edition of Vivado do I need? ===&lt;br /&gt;
&lt;br /&gt;
See the [https://files.ettus.com/manual/md_usrp3_build_instructions.html UHD User Manual] for the latest Vivado version requirements. UHD versions 4.0 through 4.2 require Vivado 2019.1.&lt;br /&gt;
&lt;br /&gt;
For E31x devices, you can use the free Vivado HL Webpack. For all other USRPs, you can use Design Edition or System Edition. We recommend Design Edition, unless you plan to use System Generator for DSP. System Generator is not required by RFNoC.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a different Vivado version from the one required by my UHD version? ===&lt;br /&gt;
&lt;br /&gt;
This is technically possible, but it can be a lot of work to convert and adapt all of the IP to a new Vivado version, and your custom combination of UHD and Vivado versions will not have been tested or validated by Ettus Research. Therefore, this is not recommended or supported.&lt;br /&gt;
&lt;br /&gt;
=== Do I need to install all components of Vivado? ===&lt;br /&gt;
&lt;br /&gt;
No. You only need to install device support for the FPGA you intend to build. Other devices can be unchecked to save disk space. The following FPGA types are used by USRPs:&lt;br /&gt;
&lt;br /&gt;
* '''SoCs &amp;gt; Zynq-7000:''' E31x, E320, N3xx&lt;br /&gt;
* '''SOCs &amp;gt; Zynq UltraScale+ RFSoC:''' X410&lt;br /&gt;
* '''7 Series &amp;gt; Kintex-7''': X3xx&lt;br /&gt;
&lt;br /&gt;
The Software Development Kit (SDK) is typically not required, but can be installed if desired.&lt;br /&gt;
&lt;br /&gt;
The Cable Drivers are needed if you plan to do JTAG download or debug. Note that on Linux, the cable drivers are copied to the install folder, but are not installed onto your system automatically. See Xilinx UG973 for instructions on installing the cable drivers on Linux.&lt;br /&gt;
&lt;br /&gt;
== Building FPGA Images ==&lt;br /&gt;
&lt;br /&gt;
=== Why did my FPGA build fail to meet timing constraints? ===&lt;br /&gt;
&lt;br /&gt;
FPGAs have clocks that trigger the transfer of data between internal registers. The Vivado tool does a timing check near the end of the build to ensure that the paths from each driving register or port to each receiving register or port are not too long for the specified clock period or delay constraints. When it says &amp;quot;The design did not satisfy timing constraints&amp;quot; it means that Vivado couldn't arrange the logic on the chip in a way that meets all requirements. There are several reasons this might happen:&lt;br /&gt;
&lt;br /&gt;
* You added new logic to the design with too much logic between registers. In this case, you should modify your design to make meeting timing easier.&lt;br /&gt;
* You added new logic, but made a mistake in which you're trying to use the wrong clock or reset, which makes it difficult to meet timing. In this case you need to correct the mistake in your design.&lt;br /&gt;
* The design has become too crowded, making it difficult for the tools to meet the timing requirements. In this case you need to remove something to make more room.&lt;br /&gt;
* Bad luck. The tools use pseudorandom algorithms to find solutions to really hard problems, and sometimes it doesn't find a good solution even when one is possible. In this case you can make a minor change to the design and build again to see if it does better the second time. If you don't change anything, Vivado will normally give you identical results for each build. In UHD 4.4 and later you can add the &amp;lt;code&amp;gt;BUILD_SEED=1&amp;lt;/code&amp;gt; option to the &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; arguments to change a build seed that will affect the build results. Using a different seed number for each build will ensure that you get a unique build result each time. 0 is the default seed if not specified. Random build failures occur occasionally for some FPGA targets, in which case you should retry the build with a different seed.&lt;br /&gt;
&lt;br /&gt;
The FPGA tools produce a timing report that says exactly which path failed to meet timing. Sometimes that can point you in the right direction. But sometimes the path indicated only failed because of another path that's even more difficult. Open &amp;lt;code&amp;gt;post_route_timing_summary.rpt&amp;lt;/code&amp;gt; in the build output folder and search for &amp;quot;(VIOLATED)&amp;quot; to find the path(s) that failed.&lt;br /&gt;
&lt;br /&gt;
=== My design doesn't fit in the FPGA. What can I do to reduce the size? ===&lt;br /&gt;
&lt;br /&gt;
Read the &amp;lt;code&amp;gt;post_synth_util.rpt&amp;lt;/code&amp;gt; to determine what resource(s) you are running out of in order to know what kinds of changes are needed. Below are several easy ways to reduce the resource utilization of the FPGA.&lt;br /&gt;
&lt;br /&gt;
* If you are not using all RF channels of your device, modify the FPGA YAML file to remove the DDC, DUC, and Radio blocks for the unused channels, then regenerate the FPGA code using &amp;lt;code&amp;gt;rfnoc_image_builder&amp;lt;/code&amp;gt;. Note that you may need at least one Radio block for RFNoC to work properly. You may also remove the DDC and/or the DUC if your application uses full bandwidth for one or more channels and therefore doesn't require up or down conversion.&lt;br /&gt;
* If you are not using DRAM, remove the Replay or DMA FIFO blocks. Also, on X4xx, change the &amp;lt;code&amp;gt;DRAM_CH&amp;lt;/code&amp;gt; variable to 0 in the Makefile for the FPGA target you are building.&lt;br /&gt;
* If you do not need all SFP ports, use a build target that matches your needs. For example, on X4xx, the &amp;quot;X1&amp;quot; option (one 10 Gbps lane) uses the least resources whereas &amp;quot;X4&amp;quot; (four 10 Gbps lanes) uses a lot more, and the &amp;quot;CG&amp;quot; option (four 25 Gbps lanes) uses the most.&lt;br /&gt;
* If you do not need the full bandwidth of the device, use a smaller bandwidth option. For example, on X410, the &amp;quot;_100&amp;quot; option (100 MHz bandwidth) uses less resources than the &amp;quot;_200&amp;quot; option (200 MHz bandwidth).&lt;br /&gt;
* Add the &amp;lt;code&amp;gt;crossbar_routes&amp;lt;/code&amp;gt; definition to the FPGA YAML file to include only the crossbar paths required for your application. This is an advanced feature in UHD 4.5 and later. This must be done carefully to avoid removing essential paths. See the X440 YAML files for examples.&lt;br /&gt;
&lt;br /&gt;
Other reductions are possible but require advanced knowledge of UHD and/or RFNoC to avoid breaking key functionality of the device.&lt;br /&gt;
&lt;br /&gt;
=== How do I create a Vivado project for my FPGA build? ===&lt;br /&gt;
&lt;br /&gt;
Vivado supports two modes of operation known as &amp;quot;project mode&amp;quot; and &amp;quot;non-project mode&amp;quot;. Project mode is more user-friendly because it creates a project file that is managed by Vivado and works natively in the Vivado GUI. Non-project mode is generally used by more advanced users who want full control over the Vivado build process and is typically used in fully scripted or automated build flows. The USRP build flow in UHD uses non-project mode. As a result, there is no Vivado project file by default.&lt;br /&gt;
&lt;br /&gt;
It is possible to create a project file from the USRP build flow with the following steps:&lt;br /&gt;
&lt;br /&gt;
# Start the USRP FPGA build in the GUI by adding &amp;lt;code&amp;gt;GUI=1&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; arguments. Example:&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;make X410_X4_200 GUI=1&amp;lt;/code&amp;gt;&lt;br /&gt;
# After the build completes, run the following command in the TCL Console of Vivado to create the project file and switch to project mode:&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;save_project_as project_name project_dir&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;In this example, &amp;quot;project_name&amp;quot; is the name you want to give the project file and &amp;quot;project_dir&amp;quot; is the directory in which you want to put the project.&lt;br /&gt;
# Set the compile order to automatic: &amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;set_property source_mgmt_mode All [current_project]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project file can now be used independently of the normal FPGA build flow in UHD. It is up to the user to update this project file as the design changes since it will not be managed by the normal build flow in UHD.&lt;br /&gt;
&lt;br /&gt;
=== My FPGA takes a long time to build. What can I do to make builds faster? ===&lt;br /&gt;
&lt;br /&gt;
High-performance computers are recommended for FPGA builds since an FPGA build can take several hours.&lt;br /&gt;
&lt;br /&gt;
The build process is divided into two steps, IP generation and the FPGA build.&lt;br /&gt;
&lt;br /&gt;
==== IP Generation ====&lt;br /&gt;
&lt;br /&gt;
This process can take several hours by default and is run automatically, if needed, when you build an FPGA target. Fortunately, this only needs to be done once for each USRP type and won't run again unless IP is changed.&lt;br /&gt;
&lt;br /&gt;
You can speed up the IP generation by running this step with multiple jobs. For example:&lt;br /&gt;
&lt;br /&gt;
    $ make -j 4 X410_IP&lt;br /&gt;
&lt;br /&gt;
This example will build four IP cores at a time. Note that this generally requires 4 times as much memory and needs at least 4 CPU cores. You can adjust the number of parallel jobs based on the amount of system memory and/or CPU cores you have available.&lt;br /&gt;
&lt;br /&gt;
==== FPGA Build ====&lt;br /&gt;
&lt;br /&gt;
Unfortunately, increasing the number of jobs does not speed up FPGA performance because there is only one Vivado instance for the FPGA build. Vivado, by default, will use multiple CPU cores, where possible, but this does not significantly improve build performance since many parts of the build are not easily parallelizable.&lt;br /&gt;
&lt;br /&gt;
One way to shorten the build time is to reduce the size of the design. See above on how to reduce the size of your design.&lt;br /&gt;
&lt;br /&gt;
In the case where you need to build multiple FPGA types, you can use the jobs option with &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; to build multiple FPGAs simultaneously, which can dramatically reduce the time required per build. Note that this requires a significant amount of memory and CPU cores and therefore is only recommended for systems that can handle such loads. An example is shown below for building two FPGA images in parallel:&lt;br /&gt;
&lt;br /&gt;
    $ make -j 2 X410_X4_200 X410_CG_400&lt;br /&gt;
&lt;br /&gt;
It is also possible to open separate terminal instances and run one build in each instance to get the same effect. Do not build the same FPGA target in multiple instances, since multiple builds for the same target would conflict as they try to access and update the same files.&lt;br /&gt;
&lt;br /&gt;
=== My FPGA build failed with a cryptic message or no message at all. How do I debug this? ===&lt;br /&gt;
&lt;br /&gt;
When you build an FPGA target, a build directory is created in the FPGA's top directory that contains all the build outputs. Here you'll find the &amp;lt;code&amp;gt;build.log&amp;lt;/code&amp;gt; file as well as report files and checkpoints. Not all log information is printed to the console during build, so make sure you check the &amp;lt;code&amp;gt;build.log&amp;lt;/code&amp;gt; file for details. It may contain a useful error message that was not printed to the console.&lt;br /&gt;
&lt;br /&gt;
Builds often fail when Vivado encounters an internal error or runs out of memory. For internal errors, the error message is typically not very helpful and is often due to a bug in Vivado. When Vivado runs out of memory, it may immediately terminate without giving any error message at all. Consider monitoring the memory usage during the FPGA build to see if you are approaching your system's limit.&lt;br /&gt;
&lt;br /&gt;
If you have made changes to the design, try building an unmodified FPGA image from scratch to ensure the build process is working properly on your system. If this works, try adding your changes incrementally until the section of code causing the problem is identified.&lt;br /&gt;
&lt;br /&gt;
Note that such errors are often beyond the control of Ettus Research and reaching out to Xilinx support is a better option if it is truly a Vivado issue.&lt;br /&gt;
&lt;br /&gt;
=== I get a warning saying that an IP is locked, which results in errors later in the IP generation process. How do I resolve this? ===&lt;br /&gt;
&lt;br /&gt;
Vivado &amp;quot;locks&amp;quot; IP, for example, when it needs to be updated for the running version of Vivado or FPGA device type. This is intended to force the user to fix the issue and to avoid building incompatible IP. Build failures related to IP being locked should never occur during a normal build. The IP version in the UHD repo always matches the Vivado version required for that release of UHD.&lt;br /&gt;
&lt;br /&gt;
This can happen if you have used the wrong version of Vivado or do not have the correct Vivado patches installed. Refer to the &amp;lt;code&amp;gt;Generation 3 USRP Build Documentation&amp;lt;/code&amp;gt; section of the [[UHD and USRP User Manual|UHD Manual] for the required version and patches. When you run the `source setenv.sh` step to setup your environment, the script will check to make sure you are using the correct version.&lt;br /&gt;
&lt;br /&gt;
In some cases, reinstalling Vivado might be required.&lt;br /&gt;
&lt;br /&gt;
Once the correct Vivado version and patches are installed, you will need to remove all build products (to remove any locked IP that was generated) and retry the build. For example:&lt;br /&gt;
&lt;br /&gt;
    $ source setupenv.sh     # Setup environment and check the Vivado version&lt;br /&gt;
    $ make cleanall          # Remove any bad IP that was generated&lt;br /&gt;
    $ make X410_X4_200       # Start the build process again&lt;br /&gt;
&lt;br /&gt;
=== I see a &amp;quot;CRITICAL WARNING&amp;quot; in the build log. Is this expected? ===&lt;br /&gt;
&lt;br /&gt;
There are many critical warnings that appear during the build process that can be safely ignored. For example, you may see the following:&lt;br /&gt;
&lt;br /&gt;
    CRITICAL WARNING: [Vivado 12-1790] Evaluation License Warning: This design contains one or more IP cores that use separately licensed features. If the design has been configured to make use of evaluation features, please note that these features will cease to function after a certain period of time. Please consult the core datasheet to determine whether the core which you have configured will be affected. Evaluation features should NOT be used in production systems.&lt;br /&gt;
&lt;br /&gt;
The FPGA builds include IP for which the licenses are included with Vivado, but Vivado prints the warnings anyway. As long as you have a Vivado license and a bitstream was successfully generated, the IP should work as expected.&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_DPDK_and_UHD&amp;diff=5819</id>
		<title>Getting Started with DPDK and UHD</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_DPDK_and_UHD&amp;diff=5819"/>
				<updated>2023-07-17T12:34:40Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* Full Rate Streaming */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Application Note Number and Authors ==&lt;br /&gt;
&lt;br /&gt;
'''AN-500''' by Nate Temple, Alex Williams, Wade Fife, and Matt Prost&lt;br /&gt;
&amp;lt;!-- Internal use only: please do keep this updated!&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2020-01-08&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Nate Temple &amp;amp; Alex Williams&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2021-02-25&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Wade Fife&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Added corrections specific to UHD 4.0 and Mellanox card use.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2022-02-08&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Matt Prost (via Michael Dickens)&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Tweak Tuning Notes and add Known Issues&lt;br /&gt;
|}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
This application note walks through the process to get started with the Data Plane Development Kit (DPDK) driver within UHD. &lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Up until now, UHD's only support for networked devices was backed by the kernel's sockets implementation. Every call to &amp;lt;code&amp;gt;send()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;recv()&amp;lt;/code&amp;gt; would cause a context switch and invite the kernel's scheduler to replace our thread with something else. Because the typical scheduler is optimized to distribute CPU time fairly across multiple loads, the timing-critical threads might sporadically be hit with sleeping time, and the thread might be migrated off its current CPU and forced to run on another. The overhead and random latency spikes make it difficult to enable reliable real-time streaming at higher rates.&lt;br /&gt;
&lt;br /&gt;
DPDK is a high-speed packet processing framework that enables a kernel bypass for network drivers. By putting the entire driver in user space, avoiding context switches, and pinning I/O threads to cores, UHD and DPDK combine to largely prevent the latency spikes induced by the scheduler. In addition, the overall overhead for packet processing lowers. &lt;br /&gt;
&lt;br /&gt;
== Supported Devices ==&lt;br /&gt;
&lt;br /&gt;
===USRPs===&lt;br /&gt;
&lt;br /&gt;
DPDK is supported on the following USRP devices:&lt;br /&gt;
&lt;br /&gt;
* N300 / N310&lt;br /&gt;
* N320 / N321&lt;br /&gt;
* X300 / X310 &lt;br /&gt;
* E320&lt;br /&gt;
&lt;br /&gt;
=== Host Network Cards ===&lt;br /&gt;
&lt;br /&gt;
DPDK is supported on many Intel and Mellanox based 10Gb NICs. Below is a list of NICs Ettus Research has tested. For a full list of NICs supported by DPDK, please see the DPDK manual.&lt;br /&gt;
&lt;br /&gt;
* Intel X520-DA1&lt;br /&gt;
* Intel X520-DA2&lt;br /&gt;
* Intel X710-DA2&lt;br /&gt;
* Intel X710-DA4&lt;br /&gt;
* Intel XL710 &lt;br /&gt;
* Mellanox MCX4121A-ACAT ConnectX-4 Lx &lt;br /&gt;
* Mellanox MCX516A-CCAT ConnectX-5&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* DPDK: https://www.dpdk.org/&lt;br /&gt;
** https://doc.dpdk.org/guides-17.11&lt;br /&gt;
** https://doc.dpdk.org/guides-18.11&lt;br /&gt;
* UHD Manual: https://files.ettus.com/manual/page_dpdk.html&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
* UHD 3.x requires DPDK 17.11, which is included in the default repos of Ubuntu 18.04.x&lt;br /&gt;
&lt;br /&gt;
* UHD 4.0 requires DPDK 18.11&lt;br /&gt;
&lt;br /&gt;
* DPDK support was added for the N3xx/E320 USRPs with UHD 3.13.x.x &lt;br /&gt;
&lt;br /&gt;
* DPDK support was added for the X3xx with UHD 3.14.1.0&lt;br /&gt;
&lt;br /&gt;
== Installing DPDK == &lt;br /&gt;
&lt;br /&gt;
On Ubuntu 18.04.x, it is possible to install DPDK 17.11 via &amp;lt;code&amp;gt;apt&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
    sudo apt install dpdk dpdk-dev&lt;br /&gt;
&lt;br /&gt;
For DPDK 18.11, follow the instructions on the DPDK website to download, configure, and build DPDK (https://doc.dpdk.org/guides-18.11/linux_gsg/build_dpdk.html).&lt;br /&gt;
&lt;br /&gt;
== Installing UHD == &lt;br /&gt;
&lt;br /&gt;
Once the &amp;lt;code&amp;gt;dpdk&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;dpdk-dev&amp;lt;/code&amp;gt; packages are installed, UHD will locate them during a build and you should see DPDK in the enabled components lists when running cmake.&lt;br /&gt;
&lt;br /&gt;
== Enable hugepages ==&lt;br /&gt;
&lt;br /&gt;
Edit your grub configuration file, &amp;lt;code&amp;gt;/etc/default/grub&amp;lt;/code&amp;gt;,  and add the follow parameters to &amp;lt;code&amp;gt;GRUB_CMDLINE_LINUX_DEFAULT&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
    iommu=pt intel_iommu=on hugepages=2048&lt;br /&gt;
&lt;br /&gt;
On a vanilla Ubuntu system it should look like this:&lt;br /&gt;
&lt;br /&gt;
    GRUB_CMDLINE_LINUX_DEFAULT=&amp;quot;quiet splash iommu=pt intel_iommu=on hugepages=2048&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Close &amp;lt;code&amp;gt;/etc/default/grub&amp;lt;/code&amp;gt; and at the command prompt, update your grub configuration with the command:&lt;br /&gt;
&lt;br /&gt;
    sudo update-grub&lt;br /&gt;
&lt;br /&gt;
For these settings to take effect, reboot your host machine.&lt;br /&gt;
&lt;br /&gt;
== Preparing your UHD Configuration File ==&lt;br /&gt;
&lt;br /&gt;
You should note the MAC addresses for your 10Gb NICs before proceeding.&lt;br /&gt;
&lt;br /&gt;
The MAC addresses for your NICs can be found by running the command:&lt;br /&gt;
&lt;br /&gt;
    ip a&lt;br /&gt;
&lt;br /&gt;
You should then create a UHD configuration file at the location &amp;lt;code&amp;gt;/root/.uhd/uhd.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
    sudo su&lt;br /&gt;
    mkdir -p /root/.uhd&lt;br /&gt;
    nano /root/.uhd/uhd.conf&lt;br /&gt;
&lt;br /&gt;
=== UHD 3.x ===&lt;br /&gt;
&lt;br /&gt;
An example &amp;lt;code&amp;gt;uhd.conf&amp;lt;/code&amp;gt; file is listed below. Note that field names in UHD 3.x are slightly different from UHD 4.0.&lt;br /&gt;
&lt;br /&gt;
You should update the following fields for your configuration from this example:&lt;br /&gt;
&lt;br /&gt;
* Update the MAC address variables, &amp;lt;code&amp;gt;dpdk-mac&amp;lt;/code&amp;gt;, to match your NIC&lt;br /&gt;
&lt;br /&gt;
* Update the &amp;lt;code&amp;gt;dpdk-driver&amp;lt;/code&amp;gt; if the location is different on your system. &amp;lt;code&amp;gt;/usr/lib/x86_64-linux-gnu/dpdk-17.11-drivers/&amp;lt;/code&amp;gt; is the default location on Ubuntu 18.04.x when &amp;lt;code&amp;gt;dpdk&amp;lt;/code&amp;gt; is installed via &amp;lt;code&amp;gt;apt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Update the &amp;lt;code&amp;gt;dpdk-corelist&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;dpdk-io-cpu&amp;lt;/code&amp;gt; fields. In this example, a two port NIC is used. There should be one core for the main &amp;lt;code&amp;gt;dpdk&amp;lt;/code&amp;gt; thread (in this example &amp;lt;code&amp;gt;core #2&amp;lt;/code&amp;gt;), and then separate cores assigned to each NIC (in this example &amp;lt;code&amp;gt;core #3&amp;lt;/code&amp;gt; for the first port on the NIC, &amp;lt;code&amp;gt;core #4&amp;lt;/code&amp;gt; for the second port on the NIC)&lt;br /&gt;
&lt;br /&gt;
* Update the &amp;lt;code&amp;gt;dpdk-ipv4&amp;lt;/code&amp;gt; fields to your desired IP range.&lt;br /&gt;
** &amp;lt;code&amp;gt;192.168.30.2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;192.168.40.2&amp;lt;/code&amp;gt; on a default X3xx system&lt;br /&gt;
** &amp;lt;code&amp;gt;192.168.10.2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;192.168.20.2&amp;lt;/code&amp;gt; on a default N3xx system&lt;br /&gt;
** &amp;lt;code&amp;gt;192.168.10.2&amp;lt;/code&amp;gt; on a default E320 system&lt;br /&gt;
&lt;br /&gt;
    [use_dpdk=1]&lt;br /&gt;
    dpdk-mtu=9000&lt;br /&gt;
    dpdk-driver=/usr/lib/x86_64-linux-gnu/dpdk-17.11-drivers/&lt;br /&gt;
    dpdk-corelist=2,3,4&lt;br /&gt;
    dpdk-num-mbufs=4095&lt;br /&gt;
    dpdk-mbufs-cache-size=315&lt;br /&gt;
    &lt;br /&gt;
    [dpdk-mac=aa:bb:cc:dd:ee:f1]&lt;br /&gt;
    dpdk-io-cpu = 3&lt;br /&gt;
    dpdk-ipv4 = 192.168.10.1/24&lt;br /&gt;
    &lt;br /&gt;
    [dpdk-mac=aa:bb:cc:dd:ee:f2]&lt;br /&gt;
    dpdk-io-cpu = 4&lt;br /&gt;
    dpdk-ipv4 = 192.168.20.1/24&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Additional information on the UHD configuration file can be found here: https://files.ettus.com/manual_archive/v3.15.0.0/html/page_dpdk.html#dpdk_nic_config&lt;br /&gt;
&lt;br /&gt;
=== UHD 4.0 ===&lt;br /&gt;
&lt;br /&gt;
An example &amp;lt;code&amp;gt;uhd.conf&amp;lt;/code&amp;gt; file is listed below. Note that the field names in UHD 4.0 are slightly different from UHD 3.x.&lt;br /&gt;
&lt;br /&gt;
You should update the following fields for your configuration from this example:&lt;br /&gt;
&lt;br /&gt;
* Update the MAC address variables, &amp;lt;code&amp;gt;dpdk_mac&amp;lt;/code&amp;gt;, to match your NIC&lt;br /&gt;
&lt;br /&gt;
* Update the &amp;lt;code&amp;gt;dpdk_driver&amp;lt;/code&amp;gt; if the location is different on your system. &amp;lt;code&amp;gt;/usr/local/lib/&amp;lt;/code&amp;gt; is the default location on Ubuntu 18.04.x when DPDK 18.11 is manually built and installed.&lt;br /&gt;
&lt;br /&gt;
* Update the &amp;lt;code&amp;gt;dpdk_corelist&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;dpdk_lcore&amp;lt;/code&amp;gt; fields. In this example, a two port NIC is used. There should be one core for the main &amp;lt;code&amp;gt;dpdk&amp;lt;/code&amp;gt; thread (in this example &amp;lt;code&amp;gt;core #2&amp;lt;/code&amp;gt;), and then separate cores assigned to each NIC (in this example &amp;lt;code&amp;gt;core #3&amp;lt;/code&amp;gt; for the first port on the NIC, &amp;lt;code&amp;gt;core #4&amp;lt;/code&amp;gt; for the second port on the NIC)&lt;br /&gt;
&lt;br /&gt;
* Update the &amp;lt;code&amp;gt;dpdk_ipv4&amp;lt;/code&amp;gt; fields to your desired IP range.&lt;br /&gt;
** &amp;lt;code&amp;gt;192.168.30.2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;192.168.40.2&amp;lt;/code&amp;gt; on a default X3xx system&lt;br /&gt;
** &amp;lt;code&amp;gt;192.168.10.2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;192.168.20.2&amp;lt;/code&amp;gt; on a default N3xx system&lt;br /&gt;
** &amp;lt;code&amp;gt;192.168.10.2&amp;lt;/code&amp;gt; on a default E320 system&lt;br /&gt;
&lt;br /&gt;
    [use_dpdk=1]&lt;br /&gt;
    dpdk_mtu=9000&lt;br /&gt;
    dpdk_driver=/usr/local/lib/&lt;br /&gt;
    dpdk_corelist=2,3,4&lt;br /&gt;
    dpdk_num_mbufs=4095&lt;br /&gt;
    dpdk_mbuf_cache_size=315&lt;br /&gt;
    &lt;br /&gt;
    [dpdk_mac=aa:bb:cc:dd:ee:f1]&lt;br /&gt;
    dpdk_lcore = 3&lt;br /&gt;
    dpdk_ipv4 = 192.168.10.1/24&lt;br /&gt;
    &lt;br /&gt;
    [dpdk_mac=aa:bb:cc:dd:ee:f2]&lt;br /&gt;
    dpdk_lcore = 4&lt;br /&gt;
    dpdk_ipv4 = 192.168.20.1/24&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Additional information on the UHD configuration file can be found here: https://files.ettus.com/manual/page_dpdk.html#dpdk_nic_config&lt;br /&gt;
&lt;br /&gt;
== Additional Host Configuration for NIC Vendors ==&lt;br /&gt;
&lt;br /&gt;
The process for this step is different for Intel and Mellanox NICs and is detailed in individual sections below.&lt;br /&gt;
&lt;br /&gt;
=== Intel X520 / X710 ===&lt;br /&gt;
&lt;br /&gt;
The Intel based NICs will use the &amp;lt;code&amp;gt;vfio-pci&amp;lt;/code&amp;gt; driver which must be loaded:&lt;br /&gt;
&lt;br /&gt;
    sudo modprobe vfio-pci&lt;br /&gt;
&lt;br /&gt;
Next, you will need to rebind the NIC to the &amp;lt;code&amp;gt;vfio-pci&amp;lt;/code&amp;gt; drivers. &lt;br /&gt;
&lt;br /&gt;
First, identify the PCI address your NIC is at:&lt;br /&gt;
&lt;br /&gt;
    dpdk-devbind --status&lt;br /&gt;
&lt;br /&gt;
Note the PCI address that your NIC is connected to for the next step.&lt;br /&gt;
&lt;br /&gt;
Before the next step, you will need to turn off the NIC first before doing the rebind. &lt;br /&gt;
&lt;br /&gt;
In Ubuntu under &amp;lt;code&amp;gt;System&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;Network&amp;lt;/code&amp;gt; -&amp;gt; click the switches to &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt; for the 10Gb ports, then run the &amp;lt;code&amp;gt;dpdk-devbind&amp;lt;/code&amp;gt; commands:&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Your PCI address will likely be different than &amp;lt;code&amp;gt;02:00.0&amp;lt;/code&amp;gt; as shown in the example below.&lt;br /&gt;
&lt;br /&gt;
    sudo dpdk-devbind --bind=vfio-pci 02:00.0&lt;br /&gt;
    sudo dpdk-devbind --bind=vfio-pci 02:00.1&lt;br /&gt;
&lt;br /&gt;
Now if you run &amp;lt;code&amp;gt;dpdk-devbind --status&amp;lt;/code&amp;gt; again, you should see the NICs listed under DPDK devices&lt;br /&gt;
&lt;br /&gt;
    # dpdk-devbind --status&lt;br /&gt;
    &lt;br /&gt;
    Network devices using DPDK-compatible driver&lt;br /&gt;
    ============================================&lt;br /&gt;
    0000:02:00.0 '82599ES 10-Gigabit SFI/SFP+ Network Connection 10fb' drv=vfio-pci unused=ixgbe&lt;br /&gt;
    0000:02:00.1 '82599ES 10-Gigabit SFI/SFP+ Network Connection 10fb' drv=vfio-pci unused=ixgbe&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' More info can be found here on the rebinding process:  https://doc.dpdk.org/guides-17.11/linux_gsg/linux_drivers.html#binding-and-unbinding-network-ports-to-from-the-kernel-modules&lt;br /&gt;
&lt;br /&gt;
=== Mellanox NICs ===&lt;br /&gt;
&lt;br /&gt;
The Mellanox NICs do not require rebinding using the &amp;lt;code&amp;gt;vfio-pci&amp;lt;/code&amp;gt; driver. Mellanox provides additional drivers for DPDK.&lt;br /&gt;
&lt;br /&gt;
Install and activate the Mellanox drivers:&lt;br /&gt;
&lt;br /&gt;
    sudo apt install librte-pmd-mlx5-17.11&lt;br /&gt;
    sudo modprobe -a ib_uverbs mlx5_core mlx5_ib&lt;br /&gt;
&lt;br /&gt;
For 18.11 you can download and install the latest Mellanox drivers from the mellanox website (https://www.mellanox.com/products/infiniband-drivers/linux/mlnx_ofed).&lt;br /&gt;
&lt;br /&gt;
The MLX5 poll mode driver library (librte_pmd_mlx5) in DPDK provides support for Mellanox ConnextX-4 and ConnectX-5 cards. This driver must be enabled manually with the build option &amp;lt;code&amp;gt;CONFIG_RTE_LIBRTE_MLX5_PMD=y&amp;lt;/code&amp;gt; when building DPDK.&lt;br /&gt;
&lt;br /&gt;
=== Running UHD Applications with DPDK ===&lt;br /&gt;
&lt;br /&gt;
UHD based application (including GNU Radio flowgraphs) can now be ran using a DPDK transport by passing in the Device Argument: &amp;lt;code&amp;gt;use_dpdk=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Important Note:''' In order for UHD to use DPDK, the UHD application *must* be ran as the &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. Using &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; will not work, you should switch to the &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user by running &amp;lt;code&amp;gt;sudo su&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, running the &amp;lt;code&amp;gt;benchmark_rate&amp;lt;/code&amp;gt; utility:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /usr/local/lib/uhd/examples&lt;br /&gt;
&lt;br /&gt;
# ./benchmark_rate --rx_rate 125e6 --rx_subdev &amp;quot;A:0 B:0&amp;quot; --rx_channels 0,1 --tx_rate 125e6 --tx_subdev &amp;quot;A:0 B:0&amp;quot; --tx_channels 0,1 --args &amp;quot;addr=192.168.10.2,second_addr=192.168.20.2,mgmt_addr=10.2.1.19,master_clock_rate=125e6,use_dpdk=1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[INFO] [UHD] linux; GNU C++ version 7.3.0; Boost_106501; UHD_3.14.0.HEAD-0-gabf0db4e&lt;br /&gt;
EAL: Detected 8 lcore(s)&lt;br /&gt;
EAL: Some devices want iova as va but pa will be used because.. EAL: IOMMU does not support IOVA as VA&lt;br /&gt;
EAL: No free hugepages reported in hugepages-1048576kB&lt;br /&gt;
EAL: Probing VFIO support...&lt;br /&gt;
EAL: VFIO support initialized&lt;br /&gt;
EAL: PCI device 0000:02:00.0 on NUMA socket -1&lt;br /&gt;
EAL:   Invalid NUMA socket, default to 0&lt;br /&gt;
EAL:   probe driver: 8086:10fb net_ixgbe&lt;br /&gt;
EAL:   using IOMMU type 1 (Type 1)&lt;br /&gt;
EAL: Ignore mapping IO port bar(2)&lt;br /&gt;
EAL: PCI device 0000:02:00.1 on NUMA socket -1&lt;br /&gt;
EAL:   Invalid NUMA socket, default to 0&lt;br /&gt;
EAL:   probe driver: 8086:10fb net_ixgbe&lt;br /&gt;
EAL: Ignore mapping IO port bar(2)&lt;br /&gt;
PMD: ixgbe_dev_link_status_print():  Port 0: Link Down&lt;br /&gt;
EAL: Port 0 MAC: aa bb cc dd ee f1&lt;br /&gt;
EAL: Port 0 UP: 1&lt;br /&gt;
PMD: ixgbe_dev_link_status_print():  Port 1: Link Down&lt;br /&gt;
EAL: Port 1 MAC: aa bb cc dd ee f2&lt;br /&gt;
EAL: Port 1 UP: 1&lt;br /&gt;
EAL: Init DONE!&lt;br /&gt;
EAL: Starting I/O threads!&lt;br /&gt;
USER2: Thread 1 started&lt;br /&gt;
[00:00:00.000003] Creating the usrp device with: addr=192.168.10.2,second_addr=192.168.20.2,mgmt_addr=10.2.1.19,master_clock_rate=125e6,use_dpdk=1...&lt;br /&gt;
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=10.2.1.19,type=n3xx,product=n310,serial=313ABDA,claimed=False,addr=192.168.10.2,second_addr=192.168.20.2,master_clock_rate=125e6,use_dpdk=1&lt;br /&gt;
[INFO] [MPM.PeriphManager] init() called with device args 'product=n310,time_source=internal,master_clock_rate=125e6,clock_source=internal,use_dpdk=1,second_addr=192.168.20.2,mgmt_addr=10.2.1.19'.&lt;br /&gt;
[INFO] [0/DmaFIFO_0] Initializing block control (NOC ID: 0xF1F0D00000000004)&lt;br /&gt;
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1344 MB/s)&lt;br /&gt;
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1341 MB/s)&lt;br /&gt;
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1348 MB/s)&lt;br /&gt;
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1347 MB/s)&lt;br /&gt;
[INFO] [0/Radio_0] Initializing block control (NOC ID: 0x12AD100000011312)&lt;br /&gt;
[INFO] [0/Radio_1] Initializing block control (NOC ID: 0x12AD100000011312)&lt;br /&gt;
[INFO] [0/DDC_0] Initializing block control (NOC ID: 0xDDC0000000000000)&lt;br /&gt;
[INFO] [0/DDC_1] Initializing block control (NOC ID: 0xDDC0000000000000)&lt;br /&gt;
[INFO] [0/DUC_0] Initializing block control (NOC ID: 0xD0C0000000000002)&lt;br /&gt;
[INFO] [0/DUC_1] Initializing block control (NOC ID: 0xD0C0000000000002)&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: N300-Series Device&lt;br /&gt;
  Mboard 0: ni-n3xx-313ABDA&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: Magnesium&lt;br /&gt;
  RX Channel: 1&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: B&lt;br /&gt;
    RX Subdev: Magnesium&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: Magnesium&lt;br /&gt;
  TX Channel: 1&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: B&lt;br /&gt;
    TX Subdev: Magnesium&lt;br /&gt;
&lt;br /&gt;
[00:00:03.728707] Setting device timestamp to 0...&lt;br /&gt;
[INFO] [MULTI_USRP]     1) catch time transition at pps edge&lt;br /&gt;
[INFO] [MULTI_USRP]     2) set times next pps (synchronously)&lt;br /&gt;
[00:00:05.331920] Testing receive rate 125.000000 Msps on 2 channels&lt;br /&gt;
[00:00:05.610789] Testing transmit rate 125.000000 Msps on 2 channels&lt;br /&gt;
[00:00:15.878071] Benchmark complete.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Benchmark rate summary:&lt;br /&gt;
  Num received samples:     2557247854&lt;br /&gt;
  Num dropped samples:      0&lt;br /&gt;
  Num overruns detected:    0&lt;br /&gt;
  Num transmitted samples:  2504266704&lt;br /&gt;
  Num sequence errors (Tx): 0&lt;br /&gt;
  Num sequence errors (Rx): 0&lt;br /&gt;
  Num underruns detected:   0&lt;br /&gt;
  Num late commands:        0&lt;br /&gt;
  Num timeouts (Tx):        0&lt;br /&gt;
  Num timeouts (Rx):        0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tuning Notes ===&lt;br /&gt;
&lt;br /&gt;
==== General Host Performance Tuning App Note ====&lt;br /&gt;
&lt;br /&gt;
The Application Note linked below covers general performance tuning tips that should be applied:&lt;br /&gt;
&lt;br /&gt;
* https://kb.ettus.com/USRP_Host_Performance_Tuning_Tips_and_Tricks&lt;br /&gt;
&lt;br /&gt;
==== Increasing num_recv_frames ====&lt;br /&gt;
&lt;br /&gt;
If you experience &amp;lt;code&amp;gt;Overflows&amp;lt;/code&amp;gt; at higher data rates, adding the device argument &amp;lt;code&amp;gt;num_recv_frames=512&amp;lt;/code&amp;gt; can help.&lt;br /&gt;
&lt;br /&gt;
==== Full Rate Streaming (UHD 3.x only) ====&lt;br /&gt;
&lt;br /&gt;
If you're streaming data at the full master clock rate, and there is no interpolation or decimation being performed on the FPGA, you can skip the DUC and DDC blocks within the FPGA with the following parameters:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;skip_ddc=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;skip_duc=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Full Rate on X3xx ====&lt;br /&gt;
&lt;br /&gt;
If you're streaming two transmit channels at full rate (200e6) on the X3xx platform, you should additionally set the device arg:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;enable_tx_dual_eth=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Isolate CPUs ====&lt;br /&gt;
&lt;br /&gt;
Isolating the CPUs that are used for DPDK can improve performance. This can be done by adding the &amp;lt;code&amp;gt;isolcpus&amp;lt;/code&amp;gt; parameter to your &amp;lt;code&amp;gt;GRUB_CONFIG&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    isolcpus=2,3,4&lt;br /&gt;
&lt;br /&gt;
==== Disable System Interrupts ====&lt;br /&gt;
&lt;br /&gt;
Disabling system interrupts can improve the jitter and performance generally by 1-3%. This can be done by adding the parameters below to your &amp;lt;code&amp;gt;GRUB_CONFIG&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    nohz_full=2,3,4 rcu_nocbs=2,3,4&lt;br /&gt;
&lt;br /&gt;
==== Disable Hyper-threading ====&lt;br /&gt;
&lt;br /&gt;
In some applications which require the highest possible CPU performance per core, disabling hyper-threading can provide roughly a 10% increase in core performance, at the cost of having less core threads. Hyper-threading can be disabled within the BIOs and varies by manufacturer.&lt;br /&gt;
&lt;br /&gt;
==== Streaming on Multiple Channels ====&lt;br /&gt;
&lt;br /&gt;
If you're streaming on multiple channels simultaneously, you can create multiple streamer objects on separate threads. This can be accomplished with the `benchmark_rate` example by using the parameter `--multi_streamer`.&lt;br /&gt;
&lt;br /&gt;
==== Elevated Streaming Thread Priority ====&lt;br /&gt;
&lt;br /&gt;
In UHD 4, streaming thread priorities can be elevated with the `uhd::set_thread_priority_safe()` function call. This can be accomplished with the benchmark_rate example by using parameter `--priority high`.&lt;br /&gt;
&lt;br /&gt;
==== Additional Tuning Notes from Intel ====&lt;br /&gt;
&lt;br /&gt;
* Performance report from Intel on DPDK 17.11: https://fast.dpdk.org/doc/perf/DPDK_17_11_Intel_NIC_performance_report.pdf&lt;br /&gt;
* How to get best performance with NICs on Intel platforms: https://doc.dpdk.org/guides/linux_gsg/nic_perf_intel_platform.html&lt;br /&gt;
&lt;br /&gt;
== Known Issues / Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Underruns Every Second with DPDK + Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
With Linux kernels 5.10 and beyond, we have observed periodic underruns on systems that otherwise have no issues. These Linux kernel versions are the default for Ubuntu 20.04.3 LTS and later. The underrun issue is due to the &amp;lt;code&amp;gt;RT_RUNTIME_SHARE&amp;lt;/code&amp;gt; feature being disabled by default in these versions of the Linux kernel (shown as &amp;lt;code&amp;gt;NO_RT_RUNTIME_SHARE&amp;lt;/code&amp;gt;). The following procedure can be used to enable this feature. This process was tested on Linux kernel version 5.13; the procedure may be slightly different on other kernel versions. To determine the Linux kernel version of your system, in a terminal issue the command &amp;lt;code&amp;gt;uname -r&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo -s&lt;br /&gt;
$ cd /sys/kernel/debug/sched&lt;br /&gt;
$ cat features&lt;br /&gt;
&lt;br /&gt;
GENTLE_FAIR_SLEEPERS START_DEBIT NO_NEXT_BUDDY LAST_BUDDY CACHE_HOT_BUDDY WAKEUP_PREEMPTION NO_HRTICK NO_HRTICK_DL NO_DOUBLE_TICK NONTASK_CAPACITY TTWU_QUEUE SIS_PROP NO_WARN_DOUBLE_CLOCK RT_PUSH_IPI '''NO_RT_RUNTIME_SHARE''' NO_LB_MIN ATTACH_AGE_LOAD WA_IDLE WA_WEIGHT WA_BIAS UTIL_EST UTIL_EST_FASTUP NO_LATENCY_WARN ALT_PERIOD BASE_SLICE&lt;br /&gt;
&lt;br /&gt;
$ echo RT_RUNTIME_SHARE &amp;gt; features&lt;br /&gt;
$ cat features&lt;br /&gt;
&lt;br /&gt;
GENTLE_FAIR_SLEEPERS START_DEBIT NO_NEXT_BUDDY LAST_BUDDY CACHE_HOT_BUDDY WAKEUP_PREEMPTION NO_HRTICK NO_HRTICK_DL NO_DOUBLE_TICK NONTASK_CAPACITY TTWU_QUEUE SIS_PROP NO_WARN_DOUBLE_CLOCK RT_PUSH_IPI '''RT_RUNTIME_SHARE''' NO_LB_MIN ATTACH_AGE_LOAD WA_IDLE WA_WEIGHT WA_BIAS UTIL_EST UTIL_EST_FASTUP NO_LATENCY_WARN ALT_PERIOD BASE_SLICE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=X300/X310&amp;diff=5421</id>
		<title>X300/X310</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=X300/X310&amp;diff=5421"/>
				<updated>2022-07-13T16:03:38Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* FPGA */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Device Overview ==&lt;br /&gt;
The Ettus Research USRP X310 is a high-performance, scalable software defined radio (SDR) platform for designing and deploying next generation wireless communications systems. The hardware architecture combines two extended-bandwidth daughterboard slots covering DC – 6 GHz with up to 160 MHz of baseband bandwidth, multiple high-speed interface options (PCIe, dual 10 GigE, dual 1 GigE), and a large user-programmable Kintex-7 FPGA in a convenient desktop or rack-mountable half-wide 1U form factor.&lt;br /&gt;
&lt;br /&gt;
== Key Features==&lt;br /&gt;
===X300===&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot;|&lt;br /&gt;
* Xilinx Kintex-7 XC7K325T FPGA&lt;br /&gt;
* 14 bit 200 MS/s ADC&lt;br /&gt;
* 16 bit 800 MS/s DAC&lt;br /&gt;
* Frequency range: DC - 6 GHz with suitable daughterboard&lt;br /&gt;
* Up 160MHz bandwidth per channel&lt;br /&gt;
* Two wide-bandwidth RF daughterboard slots&lt;br /&gt;
* Optional GPSDO&lt;br /&gt;
* Multiple high-speed interfaces (Dual 10G, PCIe Express, ExpressCard, Dual 1G)&lt;br /&gt;
|[[File:Product x300.jpg|250px|center]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===X310===&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot;|&lt;br /&gt;
* Xilinx Kintex-7 XC7K410T FPGA&lt;br /&gt;
* 14 bit 200 MS/s ADC&lt;br /&gt;
* 16 bit 800 MS/s DAC&lt;br /&gt;
* Frequency range: DC - 6 GHz with suitable daughterboard&lt;br /&gt;
* Up 160MHz bandwidth per channel&lt;br /&gt;
* Two wide-bandwidth RF daughterboard slots&lt;br /&gt;
* Optional GPSDO&lt;br /&gt;
* Multiple high-speed interfaces (Dual 10G, PCIe Express, ExpressCard, Dual 1G)&lt;br /&gt;
|[[File:Product x310.jpg|250px|center]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Compatible Daughterboards==&lt;br /&gt;
* WBX-120 / WBX-40&lt;br /&gt;
* SBX-120 / SBX-40&lt;br /&gt;
* CBX-120 / CBX-40&lt;br /&gt;
* UBX-160 / UBX-40&lt;br /&gt;
* BasicTX / BasicRX&lt;br /&gt;
* LFRX / LFTX&lt;br /&gt;
* TwinRX&lt;br /&gt;
* DBSRX2 (EOL)&lt;br /&gt;
* RFX Series (EOL)&lt;br /&gt;
* TVRX2 (EOL)&lt;br /&gt;
&lt;br /&gt;
==RF Specifications==&lt;br /&gt;
===RF Performance Data (with SBX-120)===&lt;br /&gt;
* SSB/LO Suppression -35/50 dBc&lt;br /&gt;
* Phase Noise 3.5 GHz 1.0 deg RMS&lt;br /&gt;
* Phase Noise 6 GHz 1.5 deg RMS&lt;br /&gt;
* Power Output &amp;gt;10dBm&lt;br /&gt;
* IIP3 (@ typ NF) 0dBm&lt;br /&gt;
* Typical Noise Figure 8dB&lt;br /&gt;
&lt;br /&gt;
==Hardware Specifications==&lt;br /&gt;
* Ettus Research recommends to always use the latest stable version of UHD&lt;br /&gt;
&lt;br /&gt;
===X300===&lt;br /&gt;
* Current Hardware Revision: 8&lt;br /&gt;
* Minimum version of UHD required: 3.9.0&lt;br /&gt;
&lt;br /&gt;
===X310===&lt;br /&gt;
* Current Hardware Revision: 8&lt;br /&gt;
* Minimum version of UHD required: 3.9.0&lt;br /&gt;
&lt;br /&gt;
===Clocking and Sampling Rates===&lt;br /&gt;
There are two master clock rates (MCR) supported on the X300 and X310: 200.0 MHz and 184.32 MHz.&lt;br /&gt;
&lt;br /&gt;
The sampling rate must be an integer decimation rate of the MCR. Ideally, this decimation factor should be an even number. An odd decimation factor will result in additional unwanted attenuation (roll-off from the CIC filter in the DUC and DDC blocks in the FPGA). The valid decimation rates are between 1 and 1024.&lt;br /&gt;
&lt;br /&gt;
For the MCR of 200.0 MHz, the achievable sampling rates using an even decimation factor are 200.0, 100.0, 50.0, 33.33, 25.0, 20.0, 16.67, 14.286 Msps, ... 195.31 Ksps.&lt;br /&gt;
&lt;br /&gt;
For the MCR of 184.32 MHz, the achievable sampling rates using an even decimation factor are 184.32, 92.16, 46.08, 30.72, 23.04, 18.432, 15.36, 13.166 Msps, ... 180.0 Ksps.&lt;br /&gt;
&lt;br /&gt;
If the desired sampling rate is not directly supported by the hardware, then it will be necessary to re-sample in software. This can be done in C++ using libraries such as Liquid DSP [https://github.com/jgaeddert/liquid-dsp], or can be done in GNU Radio, in which there are three blocks that perform sampling rate conversion.&lt;br /&gt;
&lt;br /&gt;
==Physical Specifications==&lt;br /&gt;
&lt;br /&gt;
===Dimensions===&lt;br /&gt;
27.7 x 21.8 x 3.9 cm&lt;br /&gt;
&lt;br /&gt;
===Weight===&lt;br /&gt;
With 2x SBX-120: 1.7kg&lt;br /&gt;
&lt;br /&gt;
===Drawings===&lt;br /&gt;
* [[Media:cu ettus-x3xx.pdf| Enclosure]]&lt;br /&gt;
* [[Media:cu x3xx motherboard cca.pdf| Motherboard]]&lt;br /&gt;
* [[Media:cu Rackmount Ettus-X3xx.pdf| Rackmount kit]]&lt;br /&gt;
&lt;br /&gt;
===CAD/STP Models===&lt;br /&gt;
====X3xx====&lt;br /&gt;
* [[Media:cu x3xx motherboard cca.stp.gz| Motherboard]]&lt;br /&gt;
&lt;br /&gt;
====X3xx Enclosure====&lt;br /&gt;
* [[Media:cu ettus x3xx.stp.gz|Enclosure]]&lt;br /&gt;
&lt;br /&gt;
==Environmental Specifications==&lt;br /&gt;
===Operating Temperature Range===&lt;br /&gt;
* X300/X310: 25 °C&lt;br /&gt;
&lt;br /&gt;
===Operating Humidity Range===&lt;br /&gt;
* 10% to 90% non-condensing&lt;br /&gt;
&lt;br /&gt;
==Schematics==&lt;br /&gt;
===X300/X310===&lt;br /&gt;
[http://files.ettus.com/schematics/x300/x3xx.pdf X300/X310 Schematics]&lt;br /&gt;
&lt;br /&gt;
==Key Component Datasheets==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width:80%&amp;quot;&lt;br /&gt;
!Part Number&lt;br /&gt;
!Description&lt;br /&gt;
!Schematic ID (Page)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[http://www.xilinx.com/support/documentation/data_sheets/ds180_7Series_Overview.pdf XC7K325T] / [http://www.xilinx.com/support/documentation/data_sheets/ds180_7Series_Overview.pdf XC7K410T]&lt;br /&gt;
|FPGA&lt;br /&gt;
|U23 (3,5,8,9,10,18)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[http://www.analog.com/media/en/technical-documentation/data-sheets/AD9146.PDF AD9146]&lt;br /&gt;
|Dual Channel, 16-Bit, 1230 MSPS DAC&lt;br /&gt;
|U12, U36 (7)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[http://www.ti.com/lit/ds/slas635b/slas635b.pdf ADS62P48]&lt;br /&gt;
|Dual Channel, 14-Bit 210 MSPS ADC&lt;br /&gt;
|U11, U35 (6)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[https://www.fairchildsemi.com/datasheets/FI/FIN1002.pdf FIN1002]&lt;br /&gt;
|High Speed Differential Receiver&lt;br /&gt;
|U3, U5, U31, U32 (4)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[http://ww1.microchip.com/downloads/en/DeviceDoc/20001203U.pdf 24LC256T]&lt;br /&gt;
|EEPROM&lt;br /&gt;
|U530 (11)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[http://www.ti.com/lit/ds/symlink/lmk04816.pdf LMK04816BISQ/NOPB_1/3]&lt;br /&gt;
|Jitter Cleaner With Dual Loop PLLs&lt;br /&gt;
|U531 (11)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[http://www.micrel.com/_PDF/HBW/sy89547l.pdf SY89547LMGTR]&lt;br /&gt;
|Multiplexer&lt;br /&gt;
|U506 (12)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[http://www.ti.com/lit/ds/symlink/sn74aup1t17.pdf SN74AUP1T17]&lt;br /&gt;
|Single Schmitt-Trigger Buffer Gate&lt;br /&gt;
|U6, U519 (12)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[http://www.ti.com/lit/ds/symlink/tps54620.pdf TPS54620RGYT]&lt;br /&gt;
|Synchronous Step Down SWIFT™ Converter&lt;br /&gt;
|U515 (21); U516 (26)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[http://cds.linear.com/docs/en/datasheet/1764fb.pdf LT1764EQ-3.3]&lt;br /&gt;
|Voltage Regulator&lt;br /&gt;
|U27 (21); U516 (26)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[http://www.ti.com/lit/ds/symlink/tps7a47.pdf TPS7A47]&lt;br /&gt;
|Voltage Regulator&lt;br /&gt;
|U28, U532 (21)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[http://cds.linear.com/docs/en/datasheet/3603fc.pdf LTC3603EUF_TRPBF]&lt;br /&gt;
|Monolithic Synchronous Step-Down Regulator&lt;br /&gt;
|U517 (23); U500 (25); U514, U513 (27)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[http://www.ti.com/lit/ds/symlink/tps77625.pdf TPS77625_SM]&lt;br /&gt;
|Low-Dropout Voltage Regulators&lt;br /&gt;
|U30 (23)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[http://www.ti.com/lit/ds/symlink/tps79318-ep.pdf TPS79318_SM]&lt;br /&gt;
|Low-Dropout Voltage Regulators&lt;br /&gt;
|U510 (27)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|[[Media:agile9598503.pdf|OSC-96MHZ-724821-01]]&lt;br /&gt;
|Voltage Controlled Crystal Oscillator&lt;br /&gt;
|U25 (11)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==GPSDO==&lt;br /&gt;
* Support GPSDO NMEA Strings&lt;br /&gt;
* [http://www.jackson-labs.com/assets/uploads/main/LC_XO_specsheet.pdf JacksonLabs LC_XO]&lt;br /&gt;
&lt;br /&gt;
===Sensors===&lt;br /&gt;
You can query the lock status with the &amp;lt;code&amp;gt;gps_locked&amp;lt;/code&amp;gt; sensor, as well as obtain raw NMEA sentences using the &amp;lt;code&amp;gt;gps_gprmc&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;gps_gpgga&amp;lt;/code&amp;gt; sensors. Location information can be parsed out of the &amp;lt;code&amp;gt;gps_gpgga&amp;lt;/code&amp;gt; sensor by using &amp;lt;code&amp;gt;gpsd&amp;lt;/code&amp;gt; or another NMEA parser.&lt;br /&gt;
&lt;br /&gt;
==FPGA==&lt;br /&gt;
* Utilization statistics are subject to change between UHD releases. This information is current as of UHD 3.9.4 and was taken directly from Xilinx Vivado 2014.4.&lt;br /&gt;
&lt;br /&gt;
===X300===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1. Slice Logic&lt;br /&gt;
--------------&lt;br /&gt;
&lt;br /&gt;
+----------------------------+-------+-----------+-------+&lt;br /&gt;
|          Site Type         |  Used | Available | Util% |&lt;br /&gt;
+----------------------------+-------+-----------+-------+&lt;br /&gt;
| Slice LUTs                 | 61622 |    203800 | 30.23 |&lt;br /&gt;
|   LUT as Logic             | 52887 |    203800 | 25.95 |&lt;br /&gt;
|   LUT as Memory            |  8735 |     64000 | 13.64 |&lt;br /&gt;
|     LUT as Distributed RAM |  1878 |           |       |&lt;br /&gt;
|     LUT as Shift Register  |  6857 |           |       |&lt;br /&gt;
| Slice Registers            | 62961 |    407600 | 15.44 |&lt;br /&gt;
|   Register as Flip Flop    | 62961 |    407600 | 15.44 |&lt;br /&gt;
|   Register as Latch        |     0 |    407600 |  0.00 |&lt;br /&gt;
| F7 Muxes                   |  1209 |    101900 |  1.18 |&lt;br /&gt;
| F8 Muxes                   |   150 |     50950 |  0.29 |&lt;br /&gt;
+----------------------------+-------+-----------+-------+&lt;br /&gt;
&lt;br /&gt;
3. Memory&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
+-------------------+------+-----------+-------+&lt;br /&gt;
|     Site Type     | Used | Available | Util% |&lt;br /&gt;
+-------------------+------+-----------+-------+&lt;br /&gt;
| Block RAM Tile    |  409 |       445 | 91.91 |&lt;br /&gt;
|   RAMB36/FIFO*    |  398 |       445 | 89.43 |&lt;br /&gt;
|     RAMB36E1 only |  398 |           |       |&lt;br /&gt;
|   RAMB18          |   22 |       890 |  2.47 |&lt;br /&gt;
|     RAMB18E1 only |   22 |           |       |&lt;br /&gt;
+-------------------+------+-----------+-------+&lt;br /&gt;
* Note: Each Block RAM Tile only has one FIFO logic available and therefore can accommodate only one FIFO36E1 or one FIFO18E1. However, if a FIFO18E1 occupies a Block RAM Tile, that tile can still accommodate a RAMB18E1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. DSP&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
+----------------+------+-----------+-------+&lt;br /&gt;
|    Site Type   | Used | Available | Util% |&lt;br /&gt;
+----------------+------+-----------+-------+&lt;br /&gt;
| DSPs           |  123 |       840 | 14.64 |&lt;br /&gt;
|   DSP48E1 only |  123 |           |       |&lt;br /&gt;
+----------------+------+-----------+-------+&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===X310===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1. Slice Logic&lt;br /&gt;
--------------&lt;br /&gt;
&lt;br /&gt;
+----------------------------+-------+-----------+-------+&lt;br /&gt;
|          Site Type         |  Used | Available | Util% |&lt;br /&gt;
+----------------------------+-------+-----------+-------+&lt;br /&gt;
| Slice LUTs                 | 61616 |    254200 | 24.23 |&lt;br /&gt;
|   LUT as Logic             | 52885 |    254200 | 20.80 |&lt;br /&gt;
|   LUT as Memory            |  8731 |     90600 |  9.63 |&lt;br /&gt;
|     LUT as Distributed RAM |  1878 |           |       |&lt;br /&gt;
|     LUT as Shift Register  |  6853 |           |       |&lt;br /&gt;
| Slice Registers            | 62958 |    508400 | 12.38 |&lt;br /&gt;
|   Register as Flip Flop    | 62958 |    508400 | 12.38 |&lt;br /&gt;
|   Register as Latch        |     0 |    508400 |  0.00 |&lt;br /&gt;
| F7 Muxes                   |  1209 |    127100 |  0.95 |&lt;br /&gt;
| F8 Muxes                   |   150 |     63550 |  0.23 |&lt;br /&gt;
+----------------------------+-------+-----------+-------+&lt;br /&gt;
&lt;br /&gt;
3. Memory&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
+-------------------+------+-----------+-------+&lt;br /&gt;
|     Site Type     | Used | Available | Util% |&lt;br /&gt;
+-------------------+------+-----------+-------+&lt;br /&gt;
| Block RAM Tile    |  409 |       795 | 51.44 |&lt;br /&gt;
|   RAMB36/FIFO*    |  398 |       795 | 50.06 |&lt;br /&gt;
|     RAMB36E1 only |  398 |           |       |&lt;br /&gt;
|   RAMB18          |   22 |      1590 |  1.38 |&lt;br /&gt;
|     RAMB18E1 only |   22 |           |       |&lt;br /&gt;
+-------------------+------+-----------+-------+&lt;br /&gt;
* Note: Each Block RAM Tile only has one FIFO logic available and therefore can accommodate only one FIFO36E1 or one FIFO18E1. However, if a FIFO18E1 occupies a Block RAM Tile, that tile can still accommodate a RAMB18E1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. DSP&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
+----------------+------+-----------+-------+&lt;br /&gt;
|    Site Type   | Used | Available | Util% |&lt;br /&gt;
+----------------+------+-----------+-------+&lt;br /&gt;
| DSPs           |  123 |      1540 |  7.98 |&lt;br /&gt;
|   DSP48E1 only |  123 |           |       |&lt;br /&gt;
+----------------+------+-----------+-------+&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===FPGA User Modifications===&lt;br /&gt;
The Verilog code for the FPGA in the USRP X300 and USRP X310 is open-source, and users are free to modify and customize it for their needs. However, certain modifications may result in either bricking the device, or even in physical damage to the unit. Specifically, changing the I/O interface of the FPGA in any way (do not remove any of the I/O for the PCIe interface, such as &amp;lt;code&amp;gt;x300_pcie_int&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;LvFpga_Chinch_Interface&amp;lt;/code&amp;gt;), or modifying the pin and timing constraint files, could result in physical damage to other components on the motherboard, external to the FPGA, and doing this will void the warranty. Also, even if the PCIe interface is not being used, you cannot remove or reassign these pins in the constraint file. The constraint files should not be modified. Please note that modifications to the FPGA are made at the risk of the user, and may not be covered by the warranty of the device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Firmware==&lt;br /&gt;
&lt;br /&gt;
The USRP X300 series runs a small amount of software within the FPGA, within a ZPU soft processor. Its main responsibility is to provide access to some registers, handle the networking stacks, and monitor the USRP status.&lt;br /&gt;
&lt;br /&gt;
The source code for the ZPU is stored in &amp;lt;code&amp;gt;firmware/usrp3/&amp;lt;/code&amp;gt; in the UHD repository. To modify the firmware, you need to download a recent ZPU compiler (e.g. from https://github.com/zylin/zpugcc/tree/master/releases/20150428). Unpack the tarball (e.g., into &amp;lt;code&amp;gt;/usr/local&amp;lt;/code&amp;gt;) and make sure the &amp;lt;code&amp;gt;zpu-elf-gcc&amp;lt;/code&amp;gt; binary is in your path. Then, execute the following steps:&lt;br /&gt;
* Create and enter a build directory: &amp;lt;code&amp;gt;mkdir build &amp;amp;&amp;amp; cd build&amp;lt;/code&amp;gt;&lt;br /&gt;
* Run cmake: &amp;lt;code&amp;gt;cmake /path/to/firmware/usrp3/&amp;lt;/code&amp;gt;&lt;br /&gt;
** If all is correctly configured, and the ZPU compiler can be found, this will pass without errors.&lt;br /&gt;
* Build the firmware: &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;&lt;br /&gt;
** This should yield output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scanning dependencies of target x300&lt;br /&gt;
[ 79%] Generating x300_main.map&lt;br /&gt;
[ 83%] Generating x300_main.bin&lt;br /&gt;
[ 87%] Generating x300_main.ihx&lt;br /&gt;
[ 91%] Generating x300_main.dump&lt;br /&gt;
[ 95%] Generating x300_main.rom&lt;br /&gt;
[100%] Generating x300_main.coe&lt;br /&gt;
[100%] Built target x300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* These files will be copied into the &amp;lt;code&amp;gt;build/x310&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
* To non-persistently load the newly built firmware image into the running FPGA image, simply launch a UHD session with the &amp;lt;code&amp;gt;fw&amp;lt;/code&amp;gt; parameter. The binary must be within UHD's image dir, e.g. by copying x300_main.bin to the default image directory (e.g., &amp;lt;code&amp;gt;/usr/local/share/uhd/images&amp;lt;/code&amp;gt;) or by temporarily setting the &amp;lt;code&amp;gt;UHD_IMAGES_DIR&amp;lt;/code&amp;gt; variable:&lt;br /&gt;
&lt;br /&gt;
 UHD_IMAGES_DIR=/path/to/build/x300 uhd_usrp_probe --args type=x300,fw=x300_main.bin&lt;br /&gt;
&lt;br /&gt;
* To permanently bake the firmware image into the FPGA bitfile, copy the file &amp;lt;code&amp;gt;x300_main.coe&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;fpga/usrp3/top/x300/ip/bootram/bootram.coe&amp;lt;/code&amp;gt; and rebuild the bitfile.&lt;br /&gt;
&lt;br /&gt;
==Interfaces and Connectivity==&lt;br /&gt;
Follow the links below for additional information on configuring each interface for the USRP X300 or X310 SDRs.&lt;br /&gt;
&lt;br /&gt;
*[http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_hw_10gige Dual 10 Gigabit Ethernet] - 200 MS/s Full Duplex @ 16-bit&lt;br /&gt;
*[http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_hw_pcie PCIe Express (Desktop)] - 200 MS/s Full Duplex @ 16-bit&lt;br /&gt;
*[http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_hw_pcie_laptop ExpressCard (Laptop)] - 50 MS/s Full Duplex @ 16-bit&lt;br /&gt;
*[http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_hw_1gige Dual 1 Gigabit Ethernet] - 25 MS/s Full Duplex @ 16-bit&lt;br /&gt;
&lt;br /&gt;
===Front Panel===&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
* '''JTAG''': USB connector for the on-board USB-JTAG programmer&lt;br /&gt;
* '''RF A Group'''&lt;br /&gt;
** '''TX/RX LED''': Indicates that data is streaming on the TX/RX channel on daughterboard A&lt;br /&gt;
** '''RX2 LED''': Indicates that data is streaming on the RX2 channel on daughterboard A&lt;br /&gt;
* '''REF''': Indicates that the external Reference Clock is locked&lt;br /&gt;
* '''PPS''': Indicates a valid PPS signal by pulsing once per second&lt;br /&gt;
* '''AUX I/O''': Front panel GPIO connector.&lt;br /&gt;
* '''GPS''': Indicates that GPS reference is locked&lt;br /&gt;
* '''LINK''': Indicates that the host computer is communicating with the device (Activity)&lt;br /&gt;
* '''RF B Group'''&lt;br /&gt;
** '''TX/RX LED''': Indicates that data is streaming on the TX/RX channel on daughterboard B&lt;br /&gt;
** '''RX2 LED''': Indicates that data is streaming on the RX2 channel on daughterboard B&lt;br /&gt;
* '''PWR''': Power switch&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; | [[File:x3x0 fp overlay.png]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Rear Panel===&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
* '''PWR''': Connector for the USRP-X Series power supply&lt;br /&gt;
* '''1G/10G ETH''': SFP+ ports for Ethernet interfaces&lt;br /&gt;
* '''REF OUT''': Output port for the exported reference clock&lt;br /&gt;
* '''REF IN''': Reference clock input&lt;br /&gt;
* '''PCIe x4''': Connector for Cabled PCI Express link&lt;br /&gt;
* '''PPS/TRIG OUT''': Output port for the PPS signal&lt;br /&gt;
* '''PPS/TRIG IN''': Input port for the PPS signal&lt;br /&gt;
* '''GPS''': Connection for the GPS antenna&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; | [[File:x3x0 rp overlay.png]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Ref Clock - 10 MHz===&lt;br /&gt;
Using an external 10 MHz reference clock, a square wave will offer the best phase noise performance, but a sinusoid is acceptable. The power level of the reference clock cannot exceed +15 dBm.&lt;br /&gt;
&lt;br /&gt;
===PPS - Pulse Per Second===&lt;br /&gt;
Using a PPS signal for timestamp synchronization requires a square wave signal with the following a 5Vpp amplitude.&lt;br /&gt;
&lt;br /&gt;
To test the PPS input, you can use the following tool from the UHD examples:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;args&amp;gt;&amp;lt;/code&amp;gt; are device address arguments (optional if only one USRP device is on your machine)&lt;br /&gt;
&lt;br /&gt;
    cd &amp;lt;install-path&amp;gt;/lib/uhd/examples ./test_pps_input –args=&amp;lt;args&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Front Panel GPIO===&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
The GPIO port is not meant to drive big loads. You should not try to source more than 5mA per pin.&lt;br /&gt;
&lt;br /&gt;
The +3.3V is for ESD clamping purposes only and not designed to deliver high currents.&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; | [[File:x3x0 gpio conn.png]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Power on state====&lt;br /&gt;
The hardware power on state and UHD initial state for the front-panel GPIOs is high-Z. For the X3xx, there are no external pull-ups/pull-downs for the GPIO pins, but the FPGAs do have them and they are configured as follows: X3xx: pull-down.&lt;br /&gt;
&lt;br /&gt;
====Pin Mapping====&lt;br /&gt;
* Pin 1: +3.3V&lt;br /&gt;
* Pin 2: Data[0]&lt;br /&gt;
* Pin 3: Data[1]&lt;br /&gt;
* Pin 4: Data[2]&lt;br /&gt;
* Pin 5: Data[3]&lt;br /&gt;
* Pin 6: Data[4]&lt;br /&gt;
* Pin 7: Data[5]&lt;br /&gt;
* Pin 8: Data[6]&lt;br /&gt;
* Pin 9: Data[7]&lt;br /&gt;
* Pin 10: Data[8]&lt;br /&gt;
* Pin 11: Data[9]&lt;br /&gt;
* Pin 12: Data[10]&lt;br /&gt;
* Pin 13: Data[11]&lt;br /&gt;
* Pin 14: 0V&lt;br /&gt;
* Pin 15: 0V&lt;br /&gt;
&lt;br /&gt;
'''Note''': Please see the [http://files.ettus.com/manual/page_gpio_api.html E3x0/X3x0 GPIO API] for information on configuring and using the GPIO bus.&lt;br /&gt;
&lt;br /&gt;
===On-Board LEDs===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!LED &lt;br /&gt;
!Detail&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS1 &lt;br /&gt;
| 1.2V &lt;br /&gt;
| Power &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS2 &lt;br /&gt;
| TXRX1 &lt;br /&gt;
| Red: TX, Green: RX &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS3 &lt;br /&gt;
| RX1 &lt;br /&gt;
| Green: RX &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS4 &lt;br /&gt;
| REF &lt;br /&gt;
| Reference Lock &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS5 &lt;br /&gt;
| PPS &lt;br /&gt;
| Flashes on Edge &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS6 &lt;br /&gt;
| GPS &lt;br /&gt;
| GPS Lock &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS7 &lt;br /&gt;
| SFP0 &lt;br /&gt;
| Link, Right, Green&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS8 &lt;br /&gt;
| SFP0 &lt;br /&gt;
| Link Activity, Left, Yellow&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS10 &lt;br /&gt;
| TXRX2 &lt;br /&gt;
| Red: TX Green: RX &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS11 &lt;br /&gt;
| RX2 &lt;br /&gt;
| Green: RX &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS12 &lt;br /&gt;
| 6V &lt;br /&gt;
| Daughterboard Power &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS13 &lt;br /&gt;
| 3.8V &lt;br /&gt;
| Power &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS14 &lt;br /&gt;
| 3.3V &lt;br /&gt;
| Management Power &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS15 &lt;br /&gt;
| 3.3V &lt;br /&gt;
| Auxiliary Management Power &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS16 &lt;br /&gt;
| 3.3V &lt;br /&gt;
| FPGA Power &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS19 &lt;br /&gt;
| SFP1 &lt;br /&gt;
| Link Active, Left, Yellow&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS20 &lt;br /&gt;
| SFP1 &lt;br /&gt;
| Link, Right, Green&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| DS21 &lt;br /&gt;
| LINK &lt;br /&gt;
| Link Activity &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Power Connector===&lt;br /&gt;
Model: PDP-40 by CUI Inc.&lt;br /&gt;
&lt;br /&gt;
Power plug connectors for custom power harnesses can be purchased here: https://www.digikey.com/products/en?KeyWords=CP-7340-ND&amp;amp;WT.z_cid=sp_102_buynow&lt;br /&gt;
&lt;br /&gt;
Assembly instructions: [[Media:pdp-40.pdf]]&lt;br /&gt;
&lt;br /&gt;
====Pin Detail====&lt;br /&gt;
* Pins #1 / #2: 12v&lt;br /&gt;
* Pins #3 / #4: Ground&lt;br /&gt;
&lt;br /&gt;
[[File:pdp 40 power detail.png]]&lt;br /&gt;
&lt;br /&gt;
==Certifications==&lt;br /&gt;
===RoHS===&lt;br /&gt;
As of December 1st, 2010 all Ettus Research products are RoHS compliant unless otherwise noted. More information can be found at [http://ettus.com/legal/rohs-information http://ettus.com/legal/rohs-information]&lt;br /&gt;
&lt;br /&gt;
===China RoHS=== &lt;br /&gt;
'''Management Methods for Controlling Pollution Caused by Electronic Information Products Regulation'''&lt;br /&gt;
&lt;br /&gt;
'''Chinese Customers''' &lt;br /&gt;
&lt;br /&gt;
National Instruments is in compliance with the Chinese policy on the Restriction of Hazardous Substances (RoHS) used in Electronic Information Products. For more information about the National Instruments China RoHS compliance, visit [http://www.ni.com/environment/rohs_china ni.com/environment/rohs_china].&lt;br /&gt;
&lt;br /&gt;
==Certificate of Volatility==&lt;br /&gt;
===X300/X310===&lt;br /&gt;
* [[Media:volatility USRP X300 X310 r1.pdf]]&lt;br /&gt;
&lt;br /&gt;
==Downloads==&lt;br /&gt;
[http://files.ettus.com/manual/md_fpga.html FPGA Resources]&lt;br /&gt;
&lt;br /&gt;
[http://files.ettus.com/binaries/uhd_stable/ UHD Stable Binaries]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/EttusResearch/uhd UHD Source Code on Github]&lt;br /&gt;
&lt;br /&gt;
==Choosing USRP X310 vs USRP X300==&lt;br /&gt;
In terms of host bandwidth, interface options, and all other hardware features the USRP X300 and USRP 310 are identical. However, the USRP X310 provides a larger FPGA, a Xilinx XC7K410T, as opposed to XC7K325T.  While both options provide a significant amount of free resources for custom FPGA development, the XC7K410T provides additional design margin, which translates to ease of development and future expandability.   Most users choose the USRP X310 for their development.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|USRP X300 and X310 FPGA Resource Summary&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Resource Type&lt;br /&gt;
|USRP X300 (XC7K325T)&lt;br /&gt;
|USRP X310 (XC7K410T)&lt;br /&gt;
|-&lt;br /&gt;
|Count&lt;br /&gt;
|Count&lt;br /&gt;
|-&lt;br /&gt;
|DSP48 Blocks&lt;br /&gt;
|840&lt;br /&gt;
|1540&lt;br /&gt;
|-&lt;br /&gt;
|Block Rams (18kB)&lt;br /&gt;
|890&lt;br /&gt;
|1590&lt;br /&gt;
|-&lt;br /&gt;
|Logic Cells&lt;br /&gt;
|326,080&lt;br /&gt;
|406,720&lt;br /&gt;
|-&lt;br /&gt;
|Slices (logic)&lt;br /&gt;
|50,950&lt;br /&gt;
|63,550&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For up-to-date information on FPGA resource utilization in the stock FPGA design, please see &amp;quot;USRP 300/X310 FPGA Resources&amp;quot; in the Ettus Research knowledge base (https://kb.ettus.com).&lt;br /&gt;
&lt;br /&gt;
==Choosing an RF Daughterboard==&lt;br /&gt;
With the increased sample rates used by the USRP X300 and USRP X310, these new device can support extended-bandwidth daughterboards.  The WBX-120, SBX-120, and CBX-120 are recommended to take advantage of the full bandwidth capability of the USRP X300 and X310.  The WBX-120, SBX-120, and CBX-120 have been upgraded from their predecessors (40 MHz) to use 120 MHz baseband filters.  You can select your daughterboard based on the center frequency of your primary application.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
!Daughterboard&lt;br /&gt;
!Frequency Range&lt;br /&gt;
!Bandwidth&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|WBX-120&lt;br /&gt;
|50 MHz - 2200 MHz&lt;br /&gt;
|120 MHz&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|SBX-120&lt;br /&gt;
|400 MHz - 4400 MHz&lt;br /&gt;
|120 MHz&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|CBX-120&lt;br /&gt;
|1200 MHz - 6000 MHz&lt;br /&gt;
|120 MHz&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|UBX-160&lt;br /&gt;
|10 MHz - 6000 MHz&lt;br /&gt;
|160 MHz&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|TwinRX&lt;br /&gt;
|10 MHz - 6000 MHz&lt;br /&gt;
|80 MHz per channel, 160 MHz total&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your application is in the HF frequency range, the LFRX and LFTX are recommended for up to 30 MHz of bandwidth per channel.  The BasicRX and BasicTX are ideal for configurations that use an external frontend for tuning and filtering with either an IF or baseband interface.&lt;br /&gt;
&lt;br /&gt;
The USRP X300 and X310 are backward compatible with legacy daughterboards except for the RFX Series and XCVR2450.  Please note, while there are two daughterboard slots, the USRP X300/X310 can only support a single TVRX2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you plan to transmit or receive over the air, you should also purchase an antenna.&lt;br /&gt;
&lt;br /&gt;
==Choosing a Host Interface==&lt;br /&gt;
&lt;br /&gt;
The USRP X300/X310 provide three interface options – 1 Gigabit Ethernet (1 GigE), 10 Gigabit Ethernet (10 GigE), and PCI-Express (PCIe). The PCIe interface is always available regardless of what FPGA image is loaded. Ettus ships two FPGA image variants, the HG or HGS image which has one 1 GigE interfaces and one 10 GigE interfaces, and the XG image which has two 10 GigE interfaces. Generally, Ettus Research recommends using 10 GigE to achieve the maximum throughput available from the USRP X300/X310.  PCIe is recommended for applications that require the lowest possible latency, which is a desirable characteristic for PHY/MAC research.  If your application does not require the full bandwidth of the USRP ™ X300 and X310, the 1 GigE interface serves as a cost-effective fall-back option.  Ettus Research provides a complete interface kit for each of these options, which is also shown in Table 3.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|Table 3 - Interface Performance Summary&lt;br /&gt;
|-&lt;br /&gt;
!Interface&lt;br /&gt;
!Throughput (MS/s @ 16-bit)&lt;br /&gt;
!Target&lt;br /&gt;
!Recommended Kit&lt;br /&gt;
|-&lt;br /&gt;
|1 Gigabit&lt;br /&gt;
|25 MS/s&lt;br /&gt;
|Desktop/Laptop&lt;br /&gt;
|Components provided with USRP X300/X310 kit.&lt;br /&gt;
For additional connections, purchase the following:&lt;br /&gt;
[https://www.ettus.com/product/details/1GIGE-KIT SFP Adapter + GigE Cable]&lt;br /&gt;
|-&lt;br /&gt;
|10 Gigabit&lt;br /&gt;
|200 MS/s&lt;br /&gt;
|Desktop&lt;br /&gt;
|[https://www.ettus.com/product/details/10GIGE-KIT 10 GigE Interface Kit]&lt;br /&gt;
|-&lt;br /&gt;
|PCI-Express &lt;br /&gt;
(PCIe, 4 lane)&lt;br /&gt;
|200 MS/S&lt;br /&gt;
|Desktop&lt;br /&gt;
|[https://www.ettus.com/product/details/PCIE-KIT PCI-Express Desktop Kit]&lt;br /&gt;
|-&lt;br /&gt;
|Express Card&lt;br /&gt;
(PCIe, 1 lane)&lt;br /&gt;
|50 MS/s&lt;br /&gt;
|Laptop&lt;br /&gt;
|[https://www.ettus.com/product/details/ECARD-KIT ExpressCard Kit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Connectivity 2.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Figure 2 - Host Interface Options&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===10 Gigabit Ethernet===&lt;br /&gt;
See [https://kb.ettus.com/Using_Dual_10_Gigabit_Ethernet_on_the_USRP_X300/X310 this app note] for how to use the X3x0 with dual 10 GbE links.&lt;br /&gt;
&lt;br /&gt;
'''Recommended 10 Gigabit Ethernet Cards'''&lt;br /&gt;
* Intel X520-DA2&lt;br /&gt;
** [http://ark.intel.com/products/39776/Intel-Ethernet-Converged-Network-Adapter-X520-DA2 Intel® Ethernet Converged Network Adapter X520-DA2]&lt;br /&gt;
* Intel X520-DA1&lt;br /&gt;
** [http://ark.intel.com/products/68669/Intel-Ethernet-Converged-Network-Adapter-X520-DA1 Intel® Ethernet Converged Network Adapter X520-DA1 ]&lt;br /&gt;
* Intel X710-DA2&lt;br /&gt;
** [http://ark.intel.com/products/83964/Intel-Ethernet-Converged-Network-Adapter-X710-DA2 Intel® Ethernet Converged Network Adapter X710-DA2 ]&lt;br /&gt;
* Intel X710-DA4&lt;br /&gt;
** [http://ark.intel.com/products/83965/Intel-Ethernet-Converged-Network-Adapter-X710-DA4 Intel® Ethernet Converged Network Adapter X710-DA4 ]&lt;br /&gt;
* Mellanox MCX4121A-ACAT&lt;br /&gt;
** [https://store.mellanox.com/products/mellanox-mcx4121a-acat-connectx-4-lx-en-network-interface-card-25gbe-dual-port-sfp28-pcie3-0-x8-rohs-r6.html Mellanox MCX4121A-ACAT ]&lt;br /&gt;
&lt;br /&gt;
==International Power Supply Options==&lt;br /&gt;
The power supply provided with the USRP X300/X310 kit is packaged with a power cord that is compatible with power outlets in the US/Japan.  If you are not using the USRP X300/X310 in the US/Japan, we recommend purchasing the International USRP X300/X310 Power Cord set.  &lt;br /&gt;
&lt;br /&gt;
==Option: GPS Disciplined, Oven-Controlled Oscillator (GPSDO)==&lt;br /&gt;
The USRP X300 and USRP X310 provide the option to integrate a high-accuracy GPS-disciplined oscillator (GPSDO).  The GPSDO improves the accuracy of the internal frequency reference to 20 ppb, or 0.1 ppb if the GPS is synchronized to the GPS constellation.  When synchronized to the GPS constellation, all USRP ™ devices will also be synchronized in time within 50 ns.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
!Internal TCXO&lt;br /&gt;
!GPS-Disciplined Clock&lt;br /&gt;
|-&lt;br /&gt;
|Frequency Reference&lt;br /&gt;
|TCXO&lt;br /&gt;
|OCXO&lt;br /&gt;
|-&lt;br /&gt;
|Frequency Accuracy (unlocked)&lt;br /&gt;
|± 2.5ppm&lt;br /&gt;
± 2,500 Hz @ 1 GHz&lt;br /&gt;
|± 25 ppb&lt;br /&gt;
± 25 Hz @ 1 GHz&lt;br /&gt;
|-&lt;br /&gt;
|Frequency Accuracy&lt;br /&gt;
|&lt;br /&gt;
|± 0.01ppb&lt;br /&gt;
|-&lt;br /&gt;
|(GPS-Disciplined)&lt;br /&gt;
|&lt;br /&gt;
|~ ± 0.01 Hz @ 1 GHz&lt;br /&gt;
|-&lt;br /&gt;
|GPS Time Sync Accuracy&lt;br /&gt;
|&lt;br /&gt;
|±50ns to UTC Time**&lt;br /&gt;
|-&lt;br /&gt;
|10 MHz Reference Phase Drift with GPS Sync&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;±20ns After 1 Hour**&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Option: Antenna Kit for GPSDO==&lt;br /&gt;
The GPSDO Mini Kit will improve the accuracy of the USRP reference clock, even if it does not receive signals from the GPS Constellation.  However, to achieve the best accuracy possible, and to achieve global timing alignment across multiple USRPs, Ettus Research recommends the GPSDO Mini Antenna Kit.&lt;br /&gt;
&lt;br /&gt;
==Option: General Purpose Input/Output (GPIO) Kit==&lt;br /&gt;
The USRP X300 and X310 include a DB15 connector on the front panel that provides convenient access to GPIO signals.  Each pin can be configured as an input or output, uses 3.3V-level logic, and is protected with basic anti-static circuitry.  These pins can be used to control external devices like RF switches and amplifiers, trigger software events on the host, or even provide basic debugging functionality.  The USRP GPIO Kit is an affordable option that provides access to these signals with a DB15 cable and a breakout board.  The breakout board allows the user to connect external devices through a terminal block.  The user can also solder wires and components into the dedicated prototyping area.&lt;br /&gt;
&lt;br /&gt;
==Option: Cables for MIMO Expansion==&lt;br /&gt;
Multiple USRP X300/X310s can be synchronized for coherent operation by sharing a common 10 MHz and 1 PPS signal.  We recommend using a star-distribution topology with an OctoClock or OctoClock-G, as seen in Figure 4.  This requires matched length cables to be used for both 10 MHz and 1 PPS.&lt;br /&gt;
&lt;br /&gt;
For more information about MIMO operation, please see the MIMO and Synchronization Application Note.&lt;br /&gt;
[[File:8mimo.png|700px|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;Figure 4 - Star-Distribution of 10 MHz/PPS Signals with OctoClock&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Option: USRP X300/X310 Rackmount==&lt;br /&gt;
&lt;br /&gt;
The USRP X300 and X310 were designed to be used with a [https://www.ettus.com/all-products/rackmount-1u/ 1U Rackmount Assembly] for building high-density MIMO systems in a compact and well-organized setup. This mount supports one or two compatible USRPs, and if two are mounted then there are rubber standoffs between the USRPs to avoid both direct contact and surface scratching. If the user will be developing in a laboratory environment or building a high-channel count USRP system, then a 1U Rackmount Assembly is highly recommended. This specific mount is compatible with only the USRP X300 and X310, and allows the integration of up to four bidirectional -- or eight receive-only -- RF channels per 1U.&lt;br /&gt;
&lt;br /&gt;
==Guidance on SFP+ Adapters for Fiber Connectivity on USRP X300/X310==&lt;br /&gt;
&lt;br /&gt;
Ettus Research currently offers direct-connect, copper cabling accessories for the USRP X300 and USRP X310. However, it is also possible to use multi-mode fiber instead of copper connections for these devices. &lt;br /&gt;
&lt;br /&gt;
The USRP X Series is compatible with most brands of SFP+ fiber adapters. In some cases, other equipment in the systems such as 1/10 Gigabith Ethernet switches are only compatible with specific brands of SFP+ adapters and cables. As a general rule, we recommend checking compatibility with the switches and network cards in your system before purchasing an adapter.&lt;br /&gt;
&lt;br /&gt;
Ettus Research does test the USRP X Series devices with our [https://www.ettus.com/product/details/10GIGE-KIT 10 Gigabit Ethernet Connectivity Kit] and a Blade Networks G8124 1/10 GigE switch. Here are is a list of known-good cables and adapters.&lt;br /&gt;
&lt;br /&gt;
Ettus Research has only tested multi-mode fiber accessories.&lt;br /&gt;
&lt;br /&gt;
===Known-Good Adapters===&lt;br /&gt;
* [https://approvedoptics.com/blade-networks-bn-ckm-sp-sr/ Approved Optics Blade Networks BN-CKM-SP-SR-A]&lt;br /&gt;
&lt;br /&gt;
===Known-Good Cables===&lt;br /&gt;
* [https://www.colfaxdirect.com/store/pc/viewPrd.asp?idproduct=995&amp;amp;idcategory=2 Myricom Fiber Cables for 10GBase-SR, 3 Meters 10G-SR-3M]&lt;br /&gt;
&lt;br /&gt;
==Guidance on 10Gb SFP+ to RJ45 Adapters==&lt;br /&gt;
&lt;br /&gt;
Many new motherboards come equipped with an onboard 10Gb RJ45 NIC. It is possible to use a SFP+ to RJ45 adapter and operate at 10Gb speeds using a Cat6/7 Ethernet cables.&lt;br /&gt;
&lt;br /&gt;
Ettus Research has tested the adapters linked below.&lt;br /&gt;
&lt;br /&gt;
===Known-Good Adapters===&lt;br /&gt;
* [https://www.amazon.com/10Gtek-SFP-10G-T-S-Compatible-10GBase-T-Transceiver/dp/B01KFBFL16/ 10Gtek SFP+ to RJ45 Copper Module]&lt;br /&gt;
* [https://www.prolabs.com/products/transceivers/brocade/sfpplus/100-1000-10000base/10g-sfpp-t-c ProLabs 10G-SFPP-T-C]&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
USRP™ X300 and USRP™ X310 SDRs Frequently Asked Questions&lt;br /&gt;
&lt;br /&gt;
* '''What is the bandwidth of the USRP X300/X310'''&lt;br /&gt;
&lt;br /&gt;
The ADC rate on each analog RX channel is 200 MS/s quadrature, which provides a theoretical analog bandwidth of approximately 80% of the Nyquist bandwidth of +/- 100 MHz (+/- 80 MHz around the center frequency).  The resulting maximum theoretical analog bandwidth is 160 MHz.  The actual analog bandwidth may be reduced due the RF daughterboard selected.&lt;br /&gt;
&lt;br /&gt;
RF Daughterboard Bandwidths: See the daughterboard specifications [link]&lt;br /&gt;
&lt;br /&gt;
FPGA Processing Bandwidth: Up to 200 MS/s quadrature.&lt;br /&gt;
&lt;br /&gt;
Host Bandwidth:  Up to 200 MS/s quadrature, dependent on selected interface&lt;br /&gt;
&lt;br /&gt;
For more information about achieving the maximum bandwidth with a USRP X300/X310, please see the &amp;quot;USRP X300/X310 Configuration Guide&amp;quot; or the &amp;quot;USRP System Bandwidth&amp;quot; application note.&lt;br /&gt;
&lt;br /&gt;
* '''How can I program the USRP X300/X310'''&lt;br /&gt;
&lt;br /&gt;
Like all other USRP models, the USRP X300 and X310 are compatible with the USRP Hardware Driver™ (UHD) architecture.  The UHD architecture is a common driver that allows users to develop and execute applications on a host-PC.  UHD provides a direct C++ API to control and stream to/from the USRP  X300/X310.  It also provides compatibility with a variety of third-party software frameworks including GNU Radio, LabVIEW, and Matlab.  You may also customize the FPGA image provided with UHD to integrate your own signal processing. For more information about UHD, and supported software frameworks, please see:&lt;br /&gt;
&lt;br /&gt;
http://files.ettus.com/manual/&lt;br /&gt;
&lt;br /&gt;
* '''How do I update the FPGA images and firmware with the latest from UHD'''&lt;br /&gt;
&lt;br /&gt;
You can find more information about updating the FPGA image through PCIe, 1/10 GigE, and JTAG here.&lt;br /&gt;
&lt;br /&gt;
* '''How can I modify the FPGA of the USRP X300/X310'''&lt;br /&gt;
&lt;br /&gt;
The source code (Verilog) for the USRP X300/X310 is available in the UHD repository. The build process leverages the existing CMAKE build system used to compile the host-side driver.  A Linux-based setup will provide the best results.&lt;br /&gt;
&lt;br /&gt;
Which FPGA toolchain required to build the FPGA images will depend upon your version of UHD. For more details please see the [[UHD]] Software Resource page.&lt;br /&gt;
&lt;br /&gt;
* '''How much free space is available in the USRP X300/X310 FPGA'''&lt;br /&gt;
&lt;br /&gt;
Please see the USRP X300/X310 FPGA resources page for more information.&lt;br /&gt;
&lt;br /&gt;
* '''What type of PC setup is recommended for use with the USRP X300/X310'''&lt;br /&gt;
&lt;br /&gt;
The type of PC required depends heavily on the complexity and bandwidth of the application.  To demonstrate the USRP X300/X310, we typically use a desktop computer with a quadcore i7, 8+ GB of DDR3, and install the PCIe interface card that is also provide with the 10 GigE, PCIe, and ExpressCard interface kits.&lt;br /&gt;
&lt;br /&gt;
* '''What frequency range does the USRP X300/X310 cover'''&lt;br /&gt;
&lt;br /&gt;
The frequency range depends on the daughterboard select by the users.  For more information, please see the USRP X300/X310 Configuration Guide.&lt;br /&gt;
&lt;br /&gt;
* '''What components do I need to purchase for a complete USRP X300/X310 system'''&lt;br /&gt;
&lt;br /&gt;
For a more comprehensive guide, please see the USRP X300/X310 Configuration Guide.&lt;br /&gt;
&lt;br /&gt;
* '''What is the difference between the USRP X300/X310'''&lt;br /&gt;
&lt;br /&gt;
The USRP X310 includes a larger Kintex-7 series FPGA (XC7K410T) with additional development resources for more complex designs.  The USRP X300 includes the smaller XC7K325T FPGA.&lt;br /&gt;
&lt;br /&gt;
* '''What is the part number of the X3xx power connector'''&lt;br /&gt;
Model: PDP-40 by CUI Inc.&lt;br /&gt;
Power plug connectors for custom power harnesses can be purchased here: https://www.digikey.com/products/en?KeyWords=CP-7340-ND&amp;amp;WT.z_cid=sp_102_buynow&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware Resources]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=USRP_N300/N310/N320/N321_Getting_Started_Guide&amp;diff=5303</id>
		<title>USRP N300/N310/N320/N321 Getting Started Guide</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=USRP_N300/N310/N320/N321_Getting_Started_Guide&amp;diff=5303"/>
				<updated>2022-03-28T10:19:44Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* Updating the Network Configurations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Kit Contents==&lt;br /&gt;
===N300===&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot;|&lt;br /&gt;
* USRP N300&lt;br /&gt;
* DC Power Supply (12V, 7A)&lt;br /&gt;
* 1 RJ45 – SFP+ Adapter&lt;br /&gt;
* 1 Gigabit Ethernet Cat-5e Cable (3m)&lt;br /&gt;
* USB-A to Micro USB-B Cable (1m)&lt;br /&gt;
* Getting Started Guide&lt;br /&gt;
* Ettus Research Sticker&lt;br /&gt;
||[[File:n300 kit.png|450px|center]]&lt;br /&gt;
|}&lt;br /&gt;
===N310===&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot;|&lt;br /&gt;
* USRP N310&lt;br /&gt;
* DC Power Supply (12V, 7A)&lt;br /&gt;
* 1 RJ45 – SFP+ Adapter&lt;br /&gt;
* 1 Gigabit Ethernet Cat-5e Cable (3m)&lt;br /&gt;
* USB-A to Micro USB-B Cable (1m)&lt;br /&gt;
* Getting Started Guide&lt;br /&gt;
* Ettus Research Sticker&lt;br /&gt;
||[[File:n310 kit.png|500px|center]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===N320===&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot;|&lt;br /&gt;
* USRP N320&lt;br /&gt;
* DC Power Supply (12V, 7A)&lt;br /&gt;
* 1 RJ45 – SFP+ Adapter&lt;br /&gt;
* 1 Gigabit Ethernet Cat-5e Cable (3m)&lt;br /&gt;
* USB-A to Micro USB-B Cable (1m)&lt;br /&gt;
* Getting Started Guide&lt;br /&gt;
* Ettus Research Sticker&lt;br /&gt;
|[[File:n320 kit.png|500px|center]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===N321===&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot;|&lt;br /&gt;
* USRP N321&lt;br /&gt;
* DC Power Supply (12V, 7A)&lt;br /&gt;
* 1 RJ45 – SFP+ Adapter&lt;br /&gt;
* 1 Gigabit Ethernet Cat-5e Cable (3m)&lt;br /&gt;
* USB-A to Micro USB-B Cable (1m)&lt;br /&gt;
* Getting Started Guide&lt;br /&gt;
* Ettus Research Sticker&lt;br /&gt;
||[[File:n321 kit.png|500px|center]] &lt;br /&gt;
|}&lt;br /&gt;
==Verify the Contents of Your Kit==&lt;br /&gt;
Ensure that your kit contains all the items listed above. If any items are missing, please contact sales@ettus.com​ immediately.&lt;br /&gt;
&lt;br /&gt;
==You Will Need==&lt;br /&gt;
* microSD Card Writer&lt;br /&gt;
&lt;br /&gt;
* For Network Mode: A host computer with an available 1 or 10 Gigabit Ethernet interface for sample streaming. In addition to the Ethernet interface used for sampling streaming, your host computer will require a separate 1 Gigabit Ethernet interface for command and control streaming.&lt;br /&gt;
 &lt;br /&gt;
* For Stand-Alone Embedded Mode: A host computer with an available 1 Gigabit Ethernet port or a USB 2.0 port to remotely access the embedded Linux operating system running on ARM CPU.&lt;br /&gt;
&lt;br /&gt;
==Proper Care and Handling==&lt;br /&gt;
All Ettus Research products are individually tested before shipment. The USRP is guaranteed to be functional at the time it is received by the customer. Improper use or handling of the USRP can cause the device to become non-functional. Take the following precautions to prevent damage to the unit.&lt;br /&gt;
&lt;br /&gt;
* Never allow metal objects to touch the circuit board while powered.&lt;br /&gt;
* Always properly terminate the transmit port with an antenna or 50Ω load.&lt;br /&gt;
* Always handle the board with proper anti-static methods.&lt;br /&gt;
* Never allow the board to directly or indirectly come into contact with any voltage spikes.&lt;br /&gt;
* Never allow any water or condensing moisture to come into contact with the device.&lt;br /&gt;
* Always use caution with FPGA, firmware, or software modifications.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |[[File:Caution.png|24px|center]]&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |Never apply more than -15 dBm of power into any RF input.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |[[File:Caution.png|24px|center]]&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |Always use at least 30dB attenuation if operating in loopback configuration&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Install and Setup the Software Tools on Your Host Computer==&lt;br /&gt;
In order to use your Universal Software Radio Peripheral (USRP™), you must have the software tools correctly installed and configured on your host computer. A step-by-step guide for doing this is available at the Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on [[Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on Linux|Linux]], [[Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on OS X|OS X]] and [[Building and Installing the USRP Open Source Toolchain (UHD and GNU Radio) on Windows|Windows]] Application Notes.&lt;br /&gt;
&lt;br /&gt;
To find the latest release of UHD, see the UHD repository at https://github.com/EttusResearch/uhd.&lt;br /&gt;
&lt;br /&gt;
The USRP N310 requires UHD version 3.11.0.0 or later. &lt;br /&gt;
&lt;br /&gt;
The USRP N300 requires UHD version 3.12.0.0 or later.&lt;br /&gt;
&lt;br /&gt;
The USRP N320/N321 requires UHD version 3.14.0.0 or later. &lt;br /&gt;
&lt;br /&gt;
White Rabbit Ethernet-Based Synchronization of the N3xx USRP requires UHD version 3.12.0.0 or later. For additional details on White Rabbit Ethernet-Based Synchronization, please see the application note, [[Using Ethernet-Based Synchronization on the USRP™ N3xx Devices]].&lt;br /&gt;
&lt;br /&gt;
'''When you receive a brand-new device, it is strongly recommended that you download the most recent filesystem image from the Ettus Research website and write it to the SD card that comes with the unit. It is not recommended that you use the SD card from the factory as-is. Instructions on downloading the latest filesystem image and writing it to the SD card are listed below.'''&lt;br /&gt;
&lt;br /&gt;
'''Note that if you are operating the device in Network Mode, the version of UHD running on the host computer and the USRP N3xx must match.'''&lt;br /&gt;
&lt;br /&gt;
==Connecting the Device==&lt;br /&gt;
===Interfaces Overview===&lt;br /&gt;
Listed below are the interfaces to connect to the USRP N3xx. Each interface has specific functionality, limitations and purpose. &lt;br /&gt;
&lt;br /&gt;
'''Serial Console'''&lt;br /&gt;
&lt;br /&gt;
The Serial Console provides a low level interface to the device typically used for debugging.&lt;br /&gt;
&lt;br /&gt;
'''1 Gigabit RJ45 Connection'''&lt;br /&gt;
&lt;br /&gt;
The 1 Gigabit RJ45 Connection interfaces with the on-board ARM CPU. When operated in &amp;quot;Network mode&amp;quot;, this interface can optionally be used for UHD management traffic. Regardless of the operation mode (Network vs Embedded) this interface can be used to connect to the ARM via SSH. By default, the 1Gb RJ45 connection is configured to use a DHCP assigned IP address.&lt;br /&gt;
&lt;br /&gt;
'''Dual SFP+ Connections'''&lt;br /&gt;
&lt;br /&gt;
The Dual SFP+ Connections support multiple configurations for streaming high-speed, low-latency data, depending upon the FPGA image which is loaded.&lt;br /&gt;
&lt;br /&gt;
'''QSFP+ Connection (N320/ N321 Only)'''&lt;br /&gt;
&lt;br /&gt;
The QSFP+ Connection supports 2 x 10Gb lanes for streaming high-speed, low-latency data, while the onboard SFP0 connection is used for White Rabbit Ethernet-Based Synchronization.&lt;br /&gt;
&lt;br /&gt;
===Setting up a Serial Console Connection===&lt;br /&gt;
It is possible to gain shell access to the device using a serial terminal emulator via the Serial Console port. Most Linux, OSX, or other Unix based operating systems have a tool called &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; which can be used for this purpose. &lt;br /&gt;
&lt;br /&gt;
If you do not have &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; installed, it can be installed via your package manager. For Ubuntu/Debian based operating systems it can be installed with &amp;lt;code&amp;gt;apt&amp;lt;/code&amp;gt; such as:&lt;br /&gt;
&lt;br /&gt;
    sudo apt install screen&lt;br /&gt;
&lt;br /&gt;
The default Baud Rate for the Serial Console is: &amp;lt;code&amp;gt;115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The exact device node you should attach to depends on your operating system's driver and other USB devices that might already be connected. Modern Linux systems offer alternatives to simply trying device nodes; instead, the OS might have a directory of symlinks under &amp;lt;code&amp;gt;/dev/serial/by-id&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
    $ ls /dev/serial/by-id&lt;br /&gt;
    usb-Digilent_Digilent_USB_Device_25163511FE00-if00-port0&lt;br /&gt;
    usb-Digilent_Digilent_USB_Device_25163511FE00-if01-port0&lt;br /&gt;
    usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_007F6CB5-if00-port0&lt;br /&gt;
    usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_007F6CB5-if01-port0&lt;br /&gt;
&lt;br /&gt;
NOTE: Exact names depend on the host operating system version and may differ.&lt;br /&gt;
&lt;br /&gt;
Every N3XX series device connected to USB will by default show up as four different devices. The devices labeled &amp;lt;code&amp;gt;&amp;quot;USB_to_UART_Bridge_Controller&amp;quot;&amp;lt;/code&amp;gt; are the devices that offer a serial prompt. The first (with the &amp;lt;code&amp;gt;if00&amp;lt;/code&amp;gt; suffix) connects to the &amp;lt;code&amp;gt;ARM CPU&amp;lt;/code&amp;gt;, whereas the second connects to the &amp;lt;code&amp;gt;STM32 Microcontroller&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
If you have multiple N3xx Serial Consoles connected to a single host, you may have to empirically test nodes. &lt;br /&gt;
&lt;br /&gt;
Connecting to the ARM CPU can be performed with the command:&lt;br /&gt;
&lt;br /&gt;
    $ sudo screen /dev/serial/by-id/usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_007F6CB5-if00-port0 115200&lt;br /&gt;
&lt;br /&gt;
Upon starting the USRP N3xx, boot messages will appear and rapidly update. Once the boot process successfully completes, a login prompt like the following should appear:&lt;br /&gt;
&lt;br /&gt;
    OpenEmbedded test ni-n3xx-313ABDA ttyPS0&lt;br /&gt;
    &lt;br /&gt;
    ni-n3xx-313ABDA login: &lt;br /&gt;
&lt;br /&gt;
Enter the username: ​&amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt;​ &lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user's password is left blank. Press the &amp;lt;code&amp;gt;Enter&amp;lt;/code&amp;gt; key when prompted for a password.&lt;br /&gt;
&lt;br /&gt;
You should now be presented with a shell prompt similar to the following:&lt;br /&gt;
&lt;br /&gt;
    root@ni-n3xx-&amp;lt;motherboard serial #&amp;gt;:~#&lt;br /&gt;
&lt;br /&gt;
Using the default configuration, the serial console will show all kernel log messages (which are not available when using SSH), and give access to the boot loader (U-boot prompt). This can be used to debug kernel or boot-loader issues more efficiently than when logged in via SSH.&lt;br /&gt;
&lt;br /&gt;
====Connecting to the microcontroller====&lt;br /&gt;
&lt;br /&gt;
Using the Serial Console interface, it is possible to connect to the STM32 microcontroller with the command below. The STM32 controls the power sequencing and several other low level device operations.&lt;br /&gt;
&lt;br /&gt;
    $ sudo screen /dev/serial/by-id/usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_007F6CB5-if01-port0 115200&lt;br /&gt;
&lt;br /&gt;
The STM32 interface provides a very simple prompt. The command &amp;lt;code&amp;gt;help&amp;lt;/code&amp;gt; will list all available commands. A direct connection to the microcontroller can be used to hard-reset the device without physically accessing it (i.e., emulating a power button press) and other low-level diagnostics.&lt;br /&gt;
&lt;br /&gt;
===Connecting to the ARM via SSH===&lt;br /&gt;
By default, the RJ45 1Gb management interface is configured to be assigned a DHCP IP address. &lt;br /&gt;
&lt;br /&gt;
If you have access to a network which provides a DHCP server (such as a common router's LAN), attach the RJ45 1Gb port to this network. Details vary by vendor, however, most router management interfaces will provide a list of attached devices to the LAN including their IP address.&lt;br /&gt;
&lt;br /&gt;
Without access to a router management interface, you can identify the IP address by connecting to the ARM CPU via Serial Console as detailed in the section above and running the command &amp;lt;code&amp;gt;ip a&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Example Output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ip a&lt;br /&gt;
1: lo: &amp;lt;LOOPBACK,UP,LOWER_UP&amp;gt; mtu 65536 qdisc noqueue qlen 1000&lt;br /&gt;
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00&lt;br /&gt;
    inet 127.0.0.1/8 scope host lo&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
2: eth0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet 192.168.1.151/24 brd 192.168.1.255 scope global dynamic eth0&lt;br /&gt;
       valid_lft 42865sec preferred_lft 42865sec&lt;br /&gt;
3: sfp0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 9000 qdisc pfifo_fast qlen 1000&lt;br /&gt;
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet 192.168.10.2/24 brd 192.168.10.255 scope global sfp0&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
4: sfp1: &amp;lt;NO-CARRIER,BROADCAST,MULTICAST,UP&amp;gt; mtu 9000 qdisc pfifo_fast qlen 1000&lt;br /&gt;
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you do not have access to a network with a DHCP server, you can create one using the Linux utility &amp;lt;code&amp;gt;dnsmasq&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
    $ sudo dnsmasq -i &amp;lt;ETHERNET_ADAPTER_NAME&amp;gt; --dhcp-range=192.168.1.151,192.168.1.254 --except-interface=lo --bind-dynamic --no-daemon&lt;br /&gt;
&lt;br /&gt;
NOTE: Modify the value &amp;lt;code&amp;gt;&amp;lt;ETHERNET_ADAPTER_NAME&amp;gt;&amp;lt;/code&amp;gt; to match the interface you would like to create a DHCP server on.&lt;br /&gt;
&lt;br /&gt;
After the device has obtained an IP address, you can remotely log into it from a Linux or macOS system with SSH, as shown below:&lt;br /&gt;
&lt;br /&gt;
    $ ssh root@192.168.1.151&lt;br /&gt;
&lt;br /&gt;
NOTE: The IP address may vary depending on your network setup.&lt;br /&gt;
&lt;br /&gt;
NOTE: The &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; password default password is empty/blank.&lt;br /&gt;
&lt;br /&gt;
On Microsoft Windows, the SSH connection can be established using the third-party program ​Putty​. &lt;br /&gt;
&lt;br /&gt;
After logging in, you should be presented with a shell like the following:&lt;br /&gt;
&lt;br /&gt;
    root@ni-n3xx-&amp;lt;motherboard serial #&amp;gt;:~#&lt;br /&gt;
&lt;br /&gt;
==Updating the Linux File System==&lt;br /&gt;
Before operating the device, it is​ ​strongly​ recommended to update to the latest version of the Embedded Linux file system. If you are operating the device in Network Mode, the version of UHD running on the host machine and N3xx USRP must match. &lt;br /&gt;
&lt;br /&gt;
There is two ways to update the file system for the N3xx USRP: &lt;br /&gt;
&lt;br /&gt;
1. Mender&lt;br /&gt;
&lt;br /&gt;
2. Physically remove microSD card from device and write a new file system to the microSD card. &lt;br /&gt;
&lt;br /&gt;
===File System Partition Layout===&lt;br /&gt;
The SD Card is divided into four partitions. There is two root file system partitions, a boot partition and a data partition. &lt;br /&gt;
&lt;br /&gt;
Any data you would like to preserve through Mender updates should be saved to the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; partition, which is mounted at &amp;lt;code&amp;gt;/data&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Updating the file system with Mender===&lt;br /&gt;
Mender is third-party software that enables remote updating of the root file system without physically accessing the device (see also the Mender website https://mender.io). Mender can be executed locally on the device, or a Mender server can be set up which can be used to remotely update an arbitrary number of USRP devices. Users can host their own local Mender server, or use servers hosted by Mender as a paid service; contact Mender for more information. &lt;br /&gt;
&lt;br /&gt;
====Mender Update Process====&lt;br /&gt;
When updating the file system using Mender, the tool will overwrite the root file system partition that is not currently mounted. Any data stored in the root partitions will be permanently lost with a Mender update.&lt;br /&gt;
&lt;br /&gt;
After updating a partition with Mender, it will reboot into the newly updated partition. Only if the update is confirmed by the user, the update will be made permanent. This means that if an update fails, the device will be always able to reboot into the partition from which the update was originally launched, which presumably is in a working state. Another update can be launched now to correct the previous, failed update, until it works.&lt;br /&gt;
&lt;br /&gt;
To obtain the file system Mender image (these are files with a &amp;lt;code&amp;gt;.mender&amp;lt;/code&amp;gt; suffix), run the following command on the host computer with Internet access:&lt;br /&gt;
&lt;br /&gt;
    $ sudo uhd_images_downloader -t mender -t n3xx --yes&lt;br /&gt;
&lt;br /&gt;
Example Output:    &lt;br /&gt;
    [INFO] Images destination: /usr/local/share/uhd/images&lt;br /&gt;
    451639 kB / 451639 kB (100%) n3xx_common_mender_default-v3.14.0.0.zip&lt;br /&gt;
    [INFO] Images download complete.&lt;br /&gt;
&lt;br /&gt;
NOTE: In the output of the command, the folder destination where the images are saved is printed out.&lt;br /&gt;
&lt;br /&gt;
Next, you will need to copy this Mender file system image to the USRP N3xx. This can be done with the Linux utility &amp;lt;code&amp;gt;scp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
    $ scp /usr/local/share/uhd/images/usrp_n3xx_fs.mender root@192.168.1.51:~/. &lt;br /&gt;
&lt;br /&gt;
Note: The path and IP may different for your configuration, the command above assumes you're using the default installation path of &amp;lt;code&amp;gt;/usr/local&amp;lt;/code&amp;gt; and that the N3xx's IP is &amp;lt;code&amp;gt;192.168.1.51&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After copying the Mender file system image to the N3xx, connect to the N3xx using either the Serial Console, or via SSH to gain shell access.&lt;br /&gt;
&lt;br /&gt;
On the N3xx, run &amp;lt;code&amp;gt;mender install /path/to/latest.mender&amp;lt;/code&amp;gt; to update the file system:&lt;br /&gt;
&lt;br /&gt;
    $ mender install /home/root/usrp_n3xx_fs.mender&lt;br /&gt;
&lt;br /&gt;
The artifact can also be stored on a remote server:&lt;br /&gt;
    $ mender install &amp;lt;nowiki&amp;gt;http://server.name/path/to/latest.mender&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure will take a few minutes to complete. After mender has logged a successful update, reboot the device:&lt;br /&gt;
    $ reboot&lt;br /&gt;
&lt;br /&gt;
If the reboot worked, and the device seems functional, commit the changes so that the boot loader knows to permanently boot into this partition:&lt;br /&gt;
    $ mender -commit&lt;br /&gt;
&lt;br /&gt;
To identify the currently installed Mender artifact from the command line, the following file can be queried on the N3xx:&lt;br /&gt;
    $ cat /etc/mender/artifact_info&lt;br /&gt;
&lt;br /&gt;
If you are using a Mender server, the updates can be initiated from a web dashboard. From there, you can start the updates without having to log into the device, and you can update groups of USRPs with a few clicks in a web GUI. The dashboard can also be used to inspect the state of USRPs. This is a simple way to update groups of rack-mounted USRPs with custom file systems.&lt;br /&gt;
&lt;br /&gt;
For more information on updating the file-system, refer to the UHD Manual at ​https://uhd.ettus.com​.&lt;br /&gt;
&lt;br /&gt;
===Updating the files system by writing the disk image===&lt;br /&gt;
Please see the separate application note, [[Writing the USRP File System Disk Image to a SD Card]], for step-by-step instructions on writing the file system image to the SD card.&lt;br /&gt;
&lt;br /&gt;
==Updating the Network Configurations==&lt;br /&gt;
The USRP N3xx systemd network configuration files are located at: &amp;lt;code&amp;gt;/data/network/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    # ls /data/network/&lt;br /&gt;
    eth0.network  int0.network  sfp0.network  sfp1.network&lt;br /&gt;
&lt;br /&gt;
or for older version of the file system: &amp;lt;code&amp;gt;/data/network/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    # ls /etc/systemd/network/&lt;br /&gt;
    eth0.network  sfp0.network  sfp1.network&lt;br /&gt;
&lt;br /&gt;
For details on configuration please refer to the [https://www.freedesktop.org/software/systemd/man/systemd.network.html systemd-networkd manual pages].&lt;br /&gt;
&lt;br /&gt;
The factory settings are as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
eth0 (DHCP):&lt;br /&gt;
&lt;br /&gt;
    [Match]&lt;br /&gt;
    Name=eth0&lt;br /&gt;
&lt;br /&gt;
    [Network]&lt;br /&gt;
    DHCP=ipv4&lt;br /&gt;
&lt;br /&gt;
    [DHCP]&lt;br /&gt;
    UseHostname=false&lt;br /&gt;
&lt;br /&gt;
sfp0 (static):&lt;br /&gt;
&lt;br /&gt;
    [Match]&lt;br /&gt;
    Name=sfp0&lt;br /&gt;
&lt;br /&gt;
    [Network]&lt;br /&gt;
    Address=192.168.10.2/24&lt;br /&gt;
&lt;br /&gt;
    [Link]&lt;br /&gt;
    MTUBytes=9000&lt;br /&gt;
&lt;br /&gt;
sfp1 (static):&lt;br /&gt;
&lt;br /&gt;
    [Match]&lt;br /&gt;
    Name=sfp1&lt;br /&gt;
&lt;br /&gt;
    [Network]&lt;br /&gt;
    Address=192.168.20.2/24&lt;br /&gt;
&lt;br /&gt;
    [Link]&lt;br /&gt;
    MTUBytes=9000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additional notes on networking:&lt;br /&gt;
&lt;br /&gt;
* Care needs to be taken when editing these files on the device, since &amp;lt;code&amp;gt;vi&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;vim&amp;lt;/code&amp;gt; sometimes generates undo files (e.g. &amp;lt;code&amp;gt;/etc/systemd/network/sfp0.network~&amp;lt;/code&amp;gt;), that &amp;lt;code&amp;gt;systemd-networkd&amp;lt;/code&amp;gt; might accidentally pick up.&lt;br /&gt;
* Temporarily setting the IP addresses or MTU sizes via &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; or other command line tools will only change the value until the next reboot or reload of the FPGA image.&lt;br /&gt;
* If the MTU of the device and host computers differ, streaming issues can occur.&lt;br /&gt;
* Streaming via SFP0 at 1 Gb rates requires a MTU of &amp;lt;code&amp;gt;1500&amp;lt;/code&amp;gt;&lt;br /&gt;
* Streaming via SFP0 at 10 Gb rates requires a MTU of &amp;lt;code&amp;gt;9000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For addition details on network configuration here: https://files.ettus.com/manual/page_usrp_n3xx.html#n3xx_network_configuration&lt;br /&gt;
&lt;br /&gt;
==Updating the FPGA Image==&lt;br /&gt;
&lt;br /&gt;
===Network Mode FPGA Image Update===&lt;br /&gt;
The FPGA image should match the version of UHD installed on the host computer, when operated in Network mode. Connect the device to the host computer using either the RJ45 or SFP+ port, refer to the section above for detailed instructions. &lt;br /&gt;
&lt;br /&gt;
To obtain all the FPGA images for a specific version of UHD, run the following command on the host computer with internet access:&lt;br /&gt;
&lt;br /&gt;
    $ sudo uhd_images_downloader&lt;br /&gt;
&lt;br /&gt;
Example Output:&lt;br /&gt;
&lt;br /&gt;
    $ sudo uhd_images_downloader&lt;br /&gt;
    [INFO] Images destination: /usr/local/share/uhd/images&lt;br /&gt;
    00006 kB / 00006 kB (100%) usrp1_b100_fw_default-g6bea23d.zip&lt;br /&gt;
    19810 kB / 19810 kB (100%) x3xx_x310_fpga_default-gf1ba32fe.zip&lt;br /&gt;
    02757 kB / 02757 kB (100%) usrp2_n210_fpga_default-g6bea23d.zip&lt;br /&gt;
    02123 kB / 02123 kB (100%) n230_n230_fpga_default-ge57dfe0.zip&lt;br /&gt;
    00522 kB / 00522 kB (100%) usrp1_b100_fpga_default-g6bea23d.zip&lt;br /&gt;
    00491 kB / 00491 kB (100%) b2xx_b200_fpga_default-ge57dfe0.zip&lt;br /&gt;
    02415 kB / 02415 kB (100%) usrp2_n200_fpga_default-g6bea23d.zip&lt;br /&gt;
    08988 kB / 08988 kB (100%) e3xx_e320_fpga_default-g3de8954a.zip&lt;br /&gt;
    23045 kB / 23045 kB (100%) n3xx_n310_fpga_default-g3de8954a.zip&lt;br /&gt;
    00523 kB / 00523 kB (100%) b2xx_b205mini_fpga_default-ge57dfe0.zip&lt;br /&gt;
    18937 kB / 18937 kB (100%) x3xx_x300_fpga_default-gf1ba32fe.zip&lt;br /&gt;
    00017 kB / 00017 kB (100%) octoclock_octoclock_fw_default-g14000041.zip&lt;br /&gt;
    00007 kB / 00007 kB (100%) usrp2_usrp2_fw_default-g6bea23d.zip&lt;br /&gt;
    00009 kB / 00009 kB (100%) usrp2_n200_fw_default-g6bea23d.zip&lt;br /&gt;
    00450 kB / 00450 kB (100%) usrp2_usrp2_fpga_default-g6bea23d.zip&lt;br /&gt;
    00144 kB / 00144 kB (100%) b2xx_common_fw_default-ga69ab0c.zip&lt;br /&gt;
    25107 kB / 25107 kB (100%) n3xx_n320_fpga_default-g3de8954a.zip&lt;br /&gt;
    00464 kB / 00464 kB (100%) b2xx_b200mini_fpga_default-ge57dfe0.zip&lt;br /&gt;
    00319 kB / 00319 kB (100%) usrp1_usrp1_fpga_default-g6bea23d.zip&lt;br /&gt;
    04839 kB / 04839 kB (100%) usb_common_windrv_default-g14000041.zip&lt;br /&gt;
    00009 kB / 00009 kB (100%) usrp2_n210_fw_default-g6bea23d.zip&lt;br /&gt;
    16065 kB / 16065 kB (100%) n3xx_n300_fpga_default-g3de8954a.zip&lt;br /&gt;
    05578 kB / 05578 kB (100%) e3xx_e310_fpga_default-g4bc2c6f.zip&lt;br /&gt;
    00885 kB / 00885 kB (100%) b2xx_b210_fpga_default-ge57dfe0.zip&lt;br /&gt;
    [INFO] Images download complete.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE: In the above example output, the Images Destination folder is printed:&lt;br /&gt;
&lt;br /&gt;
    [INFO] Images destination: /usr/local/share/uhd/images&lt;br /&gt;
&lt;br /&gt;
To list the N3xx FPGA images with a full path, run the command:&lt;br /&gt;
&lt;br /&gt;
    $ ls -w 1 /usr/local/share/uhd/images/usrp_n3*.bit&lt;br /&gt;
    &lt;br /&gt;
    /usr/local/share/uhd/images/usrp_n300_fpga_AA.bit&lt;br /&gt;
    /usr/local/share/uhd/images/usrp_n300_fpga_HG.bit&lt;br /&gt;
    /usr/local/share/uhd/images/usrp_n300_fpga_WX.bit&lt;br /&gt;
    /usr/local/share/uhd/images/usrp_n300_fpga_XG.bit&lt;br /&gt;
    /usr/local/share/uhd/images/usrp_n310_fpga_AA.bit&lt;br /&gt;
    /usr/local/share/uhd/images/usrp_n310_fpga_HG.bit&lt;br /&gt;
    /usr/local/share/uhd/images/usrp_n310_fpga_WX.bit&lt;br /&gt;
    /usr/local/share/uhd/images/usrp_n310_fpga_XG.bit&lt;br /&gt;
    /usr/local/share/uhd/images/usrp_n320_fpga_AQ.bit&lt;br /&gt;
    /usr/local/share/uhd/images/usrp_n320_fpga_HG.bit&lt;br /&gt;
    /usr/local/share/uhd/images/usrp_n320_fpga_WX.bit&lt;br /&gt;
    /usr/local/share/uhd/images/usrp_n320_fpga_XG.bit&lt;br /&gt;
    /usr/local/share/uhd/images/usrp_n320_fpga_XQ.bit&lt;br /&gt;
&lt;br /&gt;
To update the default &amp;lt;code&amp;gt;HG&amp;lt;/code&amp;gt; variant of FPGA image, run the command:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args &amp;quot;type=n3xx,addr=&amp;lt;N3xx_IP_ADDR&amp;gt;,fpga=HG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example Output:&lt;br /&gt;
&lt;br /&gt;
    uhd_image_loader --args &amp;quot;type=n3xx,addr=192.168.1.151,fpga=HG&amp;quot;&lt;br /&gt;
    [INFO] [UHD] linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_3.11.1.HEAD-0-gad6b0935&lt;br /&gt;
    [INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=192.168.1.151,type=n3xx,product=n310,serial=313ABDA,claimed=False,skip_init=1&lt;br /&gt;
    [INFO] [MPM.main] Launching USRP/MPM, version: 3.11.1.0-gunknown&lt;br /&gt;
    [INFO] [MPM.main] Spawning RPC process...&lt;br /&gt;
    [INFO] [MPM.PeriphManager] Device serial number: 313ABDA&lt;br /&gt;
    [INFO] [MPM.PeriphManager] Found 2 daughterboard(s).&lt;br /&gt;
    [INFO] [MPM.PeriphManager.UDP] No CHDR interfaces found!&lt;br /&gt;
    [INFO] [MPM.PeriphManager.UDP] No CHDR interfaces found!&lt;br /&gt;
    [INFO] [MPM.RPCServer] RPC server ready!&lt;br /&gt;
    [INFO] [MPM.RPCServer] Spawning watchdog task...&lt;br /&gt;
    [INFO] [MPM.PeriphManager.UDP] No CHDR interfaces found!&lt;br /&gt;
    [INFO] [MPMD] Claimed device without full initialization.&lt;br /&gt;
    [INFO] [MPMD IMAGE LOADER] Starting update. This may take a while.&lt;br /&gt;
    [INFO] [MPM.PeriphManager] Updating component `fpga'&lt;br /&gt;
    [INFO] [MPM.PeriphManager] Updating component `dts'&lt;br /&gt;
    [INFO] [MPM.RPCServer] Resetting peripheral manager.&lt;br /&gt;
    [INFO] [MPM.PeriphManager] Device serial number: 313ABDA&lt;br /&gt;
    [INFO] [MPM.PeriphManager] Found 2 daughterboard(s).&lt;br /&gt;
    [INFO] [MPMD IMAGE LOADER] Update component function succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To load a different default FPGA image (i.e. &amp;lt;code&amp;gt;XG&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;WG&amp;lt;/code&amp;gt;), modify the device argument &amp;lt;code&amp;gt;fpga=&amp;lt;/code&amp;gt; to a value of &amp;lt;code&amp;gt;fpga=XG&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;fpga=WG&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To specify the path to a custom FPGA image, use the ​&amp;lt;code&amp;gt;--fpga-path&amp;lt;/code&amp;gt;​ argument. &lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args &amp;quot;type=n3xx,addr=&amp;lt;N3xx_IP_ADDR&amp;gt;&amp;quot; --fpga-path=/path/to/custom/fpga.bit&lt;br /&gt;
&lt;br /&gt;
The Verilog code for the FPGA in the USRP N3xx is open-source, and users are free to modify and customize it for their needs. However, certain modifications may result in either bricking the device, or even in physical damage to the unit. Please note that modifications to the FPGA are made at the risk of the user, and may not be covered by the warranty of the device.&lt;br /&gt;
&lt;br /&gt;
===Embedded Mode FPGA Image Update===&lt;br /&gt;
&lt;br /&gt;
It is possible to update the FPGA image when operated in Embedded mode. Connect to the ARM CPU via Serial Console or SSH as detailed in the section above. &lt;br /&gt;
&lt;br /&gt;
Updating the FPGA image from the ARM CPU is the same as detailed above for a Network mode update, except it is not required to provide an &amp;lt;code&amp;gt;addr&amp;lt;/code&amp;gt; device argument. &lt;br /&gt;
&lt;br /&gt;
    uhd_image_loader --args &amp;quot;type=n3xx,fpga=HG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@ni-n3xx-313ABDA:~# uhd_image_loader --args &amp;quot;type=n3xx,fpga=HG&amp;quot;&lt;br /&gt;
[INFO] [UHD] linux; GNU C++ version 7.2.0; Boost_106400; UHD_3.11.1.0-0-unknown&lt;br /&gt;
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=127.0.0.1,type=n3xx,product=n310,serial=313ABDA,claimed=False,skip_init=1&lt;br /&gt;
[INFO] [MPMD] Claimed device without full initialization.&lt;br /&gt;
[INFO] [MPMD IMAGE LOADER] Starting update. This may take a while.&lt;br /&gt;
[INFO] [MPM.PeriphManager] Updating component `fpga'&lt;br /&gt;
[INFO] [MPM.PeriphManager] Updating component `dts'&lt;br /&gt;
[INFO] [MPM.RPCServer] Resetting peripheral manager.&lt;br /&gt;
[INFO] [MPM.PeriphManager] Device serial number: 313ABDA&lt;br /&gt;
[INFO] [MPM.PeriphManager] Found 2 daughterboard(s).&lt;br /&gt;
[INFO] [MPMD IMAGE LOADER] Update component function succeeded.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information on updating the FPGA image, refer to the UHD Manual at http://uhd.ettus.com​ .&lt;br /&gt;
&lt;br /&gt;
==Setting Up a Streaming Connection==&lt;br /&gt;
The device supports multiple, high-speed, low-latency interfaces on the SFP+ ports for streaming samples to the host computer. &lt;br /&gt;
&lt;br /&gt;
===1Gb Streaming SFP Port 0===&lt;br /&gt;
Complete the steps below to set up a streaming connection over the 1 Gigabit Ethernet interface on &amp;lt;code&amp;gt;SFP Port 0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When streaming via SFP Port 0 at 1 Gb speeds, it is important that the connection is direct between the Host and USRP. Placing a switch or other network gear between the Host and USRP can reduce throughput of the transport link. It is also generally recommended to avoid using USB to Ethernet Adapters for the high speed streaming interface, as they may limit performance or cause periodic flow control errors. &lt;br /&gt;
&lt;br /&gt;
NOTE: The &amp;lt;code&amp;gt;HG&amp;lt;/code&amp;gt; FPGA image must be loaded for &amp;lt;code&amp;gt;SFP Port 0&amp;lt;/code&amp;gt; to operate at 1Gb speeds. If the &amp;lt;code&amp;gt;XG&amp;lt;/code&amp;gt; image is loaded, the port will be unresponsive at 1Gb speeds. &lt;br /&gt;
&lt;br /&gt;
1. Configure your Host's Ethernet adapter as shown below. This interface should be separate from the 1Gb NIC/network which is connected to the 1Gb RJ45 management interface.&lt;br /&gt;
&lt;br /&gt;
    IP Address: 192.168.10.1&lt;br /&gt;
    Subnet Mask: 255.255.255.0&lt;br /&gt;
    Gateway: 0.0.0.0&lt;br /&gt;
    MTU: 1500&lt;br /&gt;
&lt;br /&gt;
NOTE: When operating &amp;lt;code&amp;gt;SFP Port 0&amp;lt;/code&amp;gt; at 1Gb speeds, it is important to set a MTU of &amp;lt;code&amp;gt;1500&amp;lt;/code&amp;gt; and not a value of &amp;lt;code&amp;gt;automatic&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2. Insert the ​ RJ45 – SFP+ adapter ​into​ &amp;lt;code&amp;gt;SFP Port 0&amp;lt;/code&amp;gt;​ .&lt;br /&gt;
&lt;br /&gt;
3. Connect the adapter to a host computer using the Ethernet cable to SFP0.&lt;br /&gt;
&lt;br /&gt;
The ​ Green LED​ above ​&amp;lt;code&amp;gt;SFP Port 0&amp;lt;/code&amp;gt;​ should illuminate.&lt;br /&gt;
&lt;br /&gt;
4. To test the connection,​ ​&amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt;​ the device at address &amp;lt;code&amp;gt;192.168.10.2​&amp;lt;/code&amp;gt; from the host, as shown&lt;br /&gt;
below:&lt;br /&gt;
&lt;br /&gt;
    $ ping 192.168.10.2&lt;br /&gt;
    PING 192.168.10.2 (192.168.10.2) 56(84) bytes of data.&lt;br /&gt;
    64 bytes from 192.168.10.2: icmp_seq=1 ttl=64 time=1.06 ms&lt;br /&gt;
    ^C&lt;br /&gt;
    --- 192.168.10.2 ping statistics ---&lt;br /&gt;
    1 packets transmitted, 1 received, 0% packet loss, time 0ms&lt;br /&gt;
    rtt min/avg/max/mdev = 1.065/1.065/1.065/0.000 ms&lt;br /&gt;
    &lt;br /&gt;
Press &amp;lt;code&amp;gt;CTRL+C&amp;lt;/code&amp;gt; to stop the ping program. &lt;br /&gt;
&lt;br /&gt;
Proceed to the next section &amp;quot;Verifying Device Operation&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===10Gb Streaming SFP Port 1===&lt;br /&gt;
Complete the steps below to set up a streaming connection over the 10 Gigabit Ethernet interface on &amp;lt;code&amp;gt;SFP Port 1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
NOTE: Both the &amp;lt;code&amp;gt;HG&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;XG&amp;lt;/code&amp;gt; FPGA images support 10Gb speeds over SFP Port 1. &lt;br /&gt;
&lt;br /&gt;
1. Configure your Host's 10Gb Ethernet adapter as shown below. &lt;br /&gt;
&lt;br /&gt;
    IP Address: 192.168.20.1&lt;br /&gt;
    Subnet Mask: 255.255.255.0&lt;br /&gt;
    Gateway: 0.0.0.0&lt;br /&gt;
    MTU: 9000&lt;br /&gt;
&lt;br /&gt;
NOTE: When operating at 10Gb speeds, it is important to set a MTU of &amp;lt;code&amp;gt;9000&amp;lt;/code&amp;gt; and not a value of &amp;lt;code&amp;gt;automatic&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2. Connect the USRP to a host computer using either a 10Gb SFP or Fiber cable to &amp;lt;code&amp;gt;SFP Port 1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The ​ Green LED​ above ​&amp;lt;code&amp;gt;SFP Port 1&amp;lt;/code&amp;gt;​ should illuminate.&lt;br /&gt;
&lt;br /&gt;
3. To test the connection,​ ​&amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt;​ the device at address &amp;lt;code&amp;gt;192.168.20.2​&amp;lt;/code&amp;gt; from the host, as shown&lt;br /&gt;
below:&lt;br /&gt;
&lt;br /&gt;
    $ ping 192.168.20.2&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;code&amp;gt;CTRL+C&amp;lt;/code&amp;gt; to stop the ping program. &lt;br /&gt;
&lt;br /&gt;
Proceed to the next section &amp;quot;Verifying Device Operation&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Dual 10Gb Streaming SFP Ports 0/1===&lt;br /&gt;
Complete the steps below to set up a streaming connections over the Dual 10 Gigabit Ethernet interface on &amp;lt;code&amp;gt;SFP Ports 0/1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
NOTE: The &amp;lt;code&amp;gt;XG&amp;lt;/code&amp;gt; FPGA image must be loaded for &amp;lt;code&amp;gt;SFP Port 0&amp;lt;/code&amp;gt; to operate at 10 Gb speeds. If the &amp;lt;code&amp;gt;HG&amp;lt;/code&amp;gt; image is loaded, the port will be unresponsive at 10 Gb speeds. &lt;br /&gt;
&lt;br /&gt;
1. Configure your Host's #1 10Gb Ethernet adapter as shown below. &lt;br /&gt;
&lt;br /&gt;
    IP Address: 192.168.10.1&lt;br /&gt;
    Subnet Mask: 255.255.255.0&lt;br /&gt;
    Gateway: 0.0.0.0&lt;br /&gt;
    MTU: 9000&lt;br /&gt;
&lt;br /&gt;
2. Configure your Host's #2 10Gb Ethernet adapter as shown below. &lt;br /&gt;
&lt;br /&gt;
    IP Address: 192.168.20.1&lt;br /&gt;
    Subnet Mask: 255.255.255.0&lt;br /&gt;
    Gateway: 0.0.0.0&lt;br /&gt;
    MTU: 9000&lt;br /&gt;
&lt;br /&gt;
NOTE: When operating at 10Gb speeds, it is important to set a MTU of &amp;lt;code&amp;gt;9000&amp;lt;/code&amp;gt; and not a value of &amp;lt;code&amp;gt;automatic&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
3. Connect the USRP to a host computer using either a 10Gb SFP or Fiber cables to &amp;lt;code&amp;gt;SFP Ports 0/1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The ​Green LEDs​ above ​&amp;lt;code&amp;gt;SFP Ports 0/1&amp;lt;/code&amp;gt;​ should illuminate.&lt;br /&gt;
&lt;br /&gt;
4. To test the &amp;lt;code&amp;gt;SFP Port 0&amp;lt;/code&amp;gt; connection,​ ​&amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt;​ the device at address &amp;lt;code&amp;gt;192.168.10.2​&amp;lt;/code&amp;gt; from the host, as shown below:&lt;br /&gt;
&lt;br /&gt;
    $ ping 192.168.10.2&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;code&amp;gt;CTRL+C&amp;lt;/code&amp;gt; to stop the ping program. &lt;br /&gt;
&lt;br /&gt;
5. To test the &amp;lt;code&amp;gt;SFP Port 1&amp;lt;/code&amp;gt; connection,​ ​&amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt;​ the device at address &amp;lt;code&amp;gt;192.168.20.2​&amp;lt;/code&amp;gt; from the host, as shown below:&lt;br /&gt;
&lt;br /&gt;
    $ ping 192.168.20.2&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;code&amp;gt;CTRL+C&amp;lt;/code&amp;gt; to stop the ping program. &lt;br /&gt;
&lt;br /&gt;
Proceed to the next section &amp;quot;Verifying Device Operation&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For more details on Network Setup and Configuration, please see the “Interfaces and Connectivity” section on the [[N300/N310]] or [[N320/N321]] hardware resources pages.&lt;br /&gt;
&lt;br /&gt;
==Verifying Device Operation==&lt;br /&gt;
Once you have successfully setup a management interface and streaming interface, you can now verify the devices operation using the included UHD utilities.&lt;br /&gt;
&lt;br /&gt;
===Subdevice Specification Mapping===&lt;br /&gt;
====N300====&lt;br /&gt;
The USRP N300 contains 2 channels, each represented on the front panel as &amp;lt;code&amp;gt;RF0-1&amp;lt;/code&amp;gt;. Below is the &amp;lt;code&amp;gt;subdev&amp;lt;/code&amp;gt; mapping of RF Ports.&lt;br /&gt;
&lt;br /&gt;
* RF0 = A:0&lt;br /&gt;
* RF1 = A:1&lt;br /&gt;
&lt;br /&gt;
====N310====&lt;br /&gt;
The USRP N310 contains 4 channels, each represented on the front panel as &amp;lt;code&amp;gt;RF0-3&amp;lt;/code&amp;gt;. Below is the &amp;lt;code&amp;gt;subdev&amp;lt;/code&amp;gt; mapping of RF Ports.&lt;br /&gt;
&lt;br /&gt;
=====UHD 3.11.x.x - 3.12.x.x=====&lt;br /&gt;
* RF0 = A:0&lt;br /&gt;
* RF1 = B:0&lt;br /&gt;
* RF2 = C:0&lt;br /&gt;
* RF3 = D:0&lt;br /&gt;
&lt;br /&gt;
=====UHD 3.13.x.x+=====&lt;br /&gt;
* RF0 = A:0&lt;br /&gt;
* RF1 = A:1&lt;br /&gt;
* RF2 = B:0&lt;br /&gt;
* RF3 = B:1&lt;br /&gt;
&lt;br /&gt;
====N320====&lt;br /&gt;
The USRP N320 contains 2 channels, each represented on the front panel as &amp;lt;code&amp;gt;RF0-1&amp;lt;/code&amp;gt;. Below is the &amp;lt;code&amp;gt;subdev&amp;lt;/code&amp;gt; mapping of RF Ports.&lt;br /&gt;
&lt;br /&gt;
* RF0 = A:0&lt;br /&gt;
* RF1 = B:0&lt;br /&gt;
&lt;br /&gt;
====N321====&lt;br /&gt;
The USRP N321 contains 2 channels, each represented on the front panel as &amp;lt;code&amp;gt;RF0-1&amp;lt;/code&amp;gt;. Below is the &amp;lt;code&amp;gt;subdev&amp;lt;/code&amp;gt; mapping of RF Ports.&lt;br /&gt;
&lt;br /&gt;
* RF0 = A:0&lt;br /&gt;
* RF1 = B:0&lt;br /&gt;
&lt;br /&gt;
Additional details of UHD Subdevice Specifications can be found here in the UHD Manual: http://files.ettus.com/manual/page_configuration.html#config_subdev&lt;br /&gt;
&lt;br /&gt;
===Supported Sample Rates===&lt;br /&gt;
&lt;br /&gt;
The USRP N300/N310 supports the three fixed Master Clock Rates listed below. &lt;br /&gt;
&lt;br /&gt;
* 122.88 MHz&lt;br /&gt;
* 125.00 MHz&lt;br /&gt;
* 153.60 MHz&lt;br /&gt;
&lt;br /&gt;
The USRP N320/N321 supports the three fixed Master Clock Rates listed below. &lt;br /&gt;
&lt;br /&gt;
* 200.00 MHz&lt;br /&gt;
* 245.76 MHz&lt;br /&gt;
* 250.00 MHz&lt;br /&gt;
&lt;br /&gt;
Sample rates as delivered to/from the host computer for USRP devices are constrained to follow several important rules.&lt;br /&gt;
&lt;br /&gt;
It is important to understand that strictly-integer decimation and interpolation are used within USRP hardware to meet the requested sample rate requirements of the application at hand. That means that the desired sample rate must meet the requirement that master-clock-rate/desired-sample-rate be an integer ratio. Further, it is strongly desirable for that ratio to be even. This ratio is the decimation (down-conversion) or interpolation (up-conversion) factor. The decimation or interpolation factor may be between 1 and 1024. There are further constraints on the decimation or interpolation factor. If the decimation or interpolation factor exceeds 128, then it must be evenly divisible by 2. If the decimation or interpolation factor exceeds 256, then it must be evenly divisible by 4.&lt;br /&gt;
&lt;br /&gt;
====Example Sample Rates====&lt;br /&gt;
Listed below are common sample rates for the given master clock rates. This is not a complete listing of the supported sample rates.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Master Clock Rate&lt;br /&gt;
!colspan=&amp;quot;20&amp;quot;|Decimation / Interpolation Rate &amp;lt;br&amp;gt; Host Sample Rate [Msps]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 4&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 8&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 10&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 12&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 14&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 16&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 18&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 20&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 30&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 32&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 64&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 100&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 128&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 200&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 256&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 512&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1024&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 122.88e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 61.44e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 30.72e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 20.48e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 15.36e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 12.288e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 10.24e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 8.7771e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 7.68e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 6.8267e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 6.144e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 4.096e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 3.84e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1.92e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1.2288e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 960e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 614.4e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 480e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 240e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 120e3&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 125e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 62.5e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 31.25e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 20.833e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 15.625e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 12.5e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 10.417e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 8.9286e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 7.8125e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 6.9444e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 6.25e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 4.1667e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 3.90625e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1.953125e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1.25e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 976.5625e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 625e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 488.28125e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 244.14e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 122.07e3&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 153.6e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 76.8e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 38.4e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 25.6e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 19.2e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 15.36e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 12.8e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 10.971e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 9.6e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 8.5333e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 7.68e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 5.12e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 4.8e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2.4e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1.536e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1.2e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 768e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 600e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 300e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 150e3&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====N320/N321 Example Sample Rates====&lt;br /&gt;
Listed below are common sample rates for the given master clock rates. This is not a complete listing of the supported sample rates.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Master Clock Rate&lt;br /&gt;
!colspan=&amp;quot;20&amp;quot;|Decimation / Interpolation Rate &amp;lt;br&amp;gt; Host Sample Rate [Msps]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 4&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 8&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 10&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 12&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 14&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 16&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 18&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 20&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 30&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 32&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 64&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 100&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 128&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 200&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 256&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 512&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1024&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 200e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 100e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 50e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 33.33e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 25e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 20e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 16.66e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 14.2857e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 12.5e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 11.11e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 10e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 6.667e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 6.25e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 3.125e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1.5625e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 781.25e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 390.625e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 195.3125e3&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 245.76e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 122.88e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 61.44e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 30.72e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 20.48e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 15.36e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 12.288e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 10.24e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 8.7771e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 7.68e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 6.8267e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 6.144e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 4.096e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 3.84e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1.92e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1.2288e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 960e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 614.4e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 480e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 240e3&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 250e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 125e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 62.5e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 31.25e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 20.833e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 15.625e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 12.5e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 10.417e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 8.9286e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 7.8125e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 6.9444e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 6.25e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 4.1667e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 3.90625e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1.953125e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 1.25e6&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 976.5625e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 625e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 488.28125e3&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 244.14e3&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additional information on Sample Rates can be found here in the UHD Manual: http://files.ettus.com/manual/page_general.html#general_sampleratenotes&lt;br /&gt;
&lt;br /&gt;
===Probe the USRP===&lt;br /&gt;
&lt;br /&gt;
====N300/N310====&lt;br /&gt;
The UHD utility &amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt; provides detailed information of the USRP device.&lt;br /&gt;
&lt;br /&gt;
From your host computer, run the command &amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$  uhd_usrp_probe &lt;br /&gt;
[INFO] [UHD] linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_3.13.1.HEAD-0-ga0a71d10&lt;br /&gt;
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=192.168.10.2,type=n3xx,product=n310,serial=313ABDA,claimed=False,addr=192.168.10.2&lt;br /&gt;
[INFO] [MPM.main] Launching USRP/MPM, version: 3.13.1.0-gd3b7e90a&lt;br /&gt;
[INFO] [MPM.main] Spawning RPC process...&lt;br /&gt;
[INFO] [MPM.PeriphManager] Device serial number: 313ABDA&lt;br /&gt;
[INFO] [MPM.PeriphManager] Initialized 2 daughterboard(s).&lt;br /&gt;
[INFO] [MPM.PeriphManager] init() called with device args `time_source=internal,clock_source=internal'.&lt;br /&gt;
[INFO] [MPM.RPCServer] RPC server ready!&lt;br /&gt;
[INFO] [MPM.RPCServer] Spawning watchdog task...&lt;br /&gt;
[INFO] [0/DmaFIFO_0] Initializing block control (NOC ID: 0xF1F0D00000000004)&lt;br /&gt;
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1355 MB/s)&lt;br /&gt;
[INFO] [MPM.PeriphManager] init() called with device args `mgmt_addr=192.168.10.2,clock_source=internal,time_source=internal,product=n310'.&lt;br /&gt;
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1358 MB/s)&lt;br /&gt;
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1355 MB/s)&lt;br /&gt;
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1345 MB/s)&lt;br /&gt;
[INFO] [0/Radio_0] Initializing block control (NOC ID: 0x12AD100000011312)&lt;br /&gt;
[INFO] [0/Radio_1] Initializing block control (NOC ID: 0x12AD100000011312)&lt;br /&gt;
[INFO] [0/DDC_0] Initializing block control (NOC ID: 0xDDC0000000000000)&lt;br /&gt;
[INFO] [0/DDC_1] Initializing block control (NOC ID: 0xDDC0000000000000)&lt;br /&gt;
[INFO] [0/DUC_0] Initializing block control (NOC ID: 0xD0C0000000000002)&lt;br /&gt;
[INFO] [0/DUC_1] Initializing block control (NOC ID: 0xD0C0000000000002)&lt;br /&gt;
  _____________________________________________________&lt;br /&gt;
 /&lt;br /&gt;
|       Device: N300-Series Device&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       Mboard: ni-n3xx-313ABDA&lt;br /&gt;
|   |   eeprom_version: 1&lt;br /&gt;
|   |   mpm_version: 3.13.1.0-gd3b7e90a&lt;br /&gt;
|   |   pid: 16962&lt;br /&gt;
|   |   product: n310&lt;br /&gt;
|   |   rev: 3&lt;br /&gt;
|   |   rpc_connection: remote&lt;br /&gt;
|   |   serial: 313ABDA&lt;br /&gt;
|   |   type: n3xx&lt;br /&gt;
|   |   MPM Version: 1.2&lt;br /&gt;
|   |   FPGA Version: 5.2&lt;br /&gt;
|   |   RFNoC capable: Yes&lt;br /&gt;
|   |   &lt;br /&gt;
|   |   Time sources:  internal, external, gpsdo, sfp0&lt;br /&gt;
|   |   Clock sources: external, internal, gpsdo&lt;br /&gt;
|   |   Sensors: gps_tpv, ref_locked, gps_time, gps_locked, temp, gps_sky, fan&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX Dboard: A&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: Magnesium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, RX2, CAL, LOCAL&lt;br /&gt;
|   |   |   |   Sensors: lo_locked, ad9371_lo_locked, lowband_lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 75.0 step 0.5 dB&lt;br /&gt;
|   |   |   |   Gain range rfic: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range dsa: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range amp: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Frontend: 1&lt;br /&gt;
|   |   |   |   Name: Magnesium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, RX2, CAL, LOCAL&lt;br /&gt;
|   |   |   |   Sensors: lo_locked, ad9371_lo_locked, lowband_lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 75.0 step 0.5 dB&lt;br /&gt;
|   |   |   |   Gain range rfic: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range dsa: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range amp: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Codec: A&lt;br /&gt;
|   |   |   |   Name: AD9371 Dual ADC&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX Dboard: B&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: Magnesium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, RX2, CAL, LOCAL&lt;br /&gt;
|   |   |   |   Sensors: lo_locked, ad9371_lo_locked, lowband_lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 75.0 step 0.5 dB&lt;br /&gt;
|   |   |   |   Gain range rfic: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range dsa: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range amp: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Frontend: 1&lt;br /&gt;
|   |   |   |   Name: Magnesium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, RX2, CAL, LOCAL&lt;br /&gt;
|   |   |   |   Sensors: lo_locked, ad9371_lo_locked, lowband_lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 75.0 step 0.5 dB&lt;br /&gt;
|   |   |   |   Gain range rfic: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range dsa: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range amp: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Codec: B&lt;br /&gt;
|   |   |   |   Name: AD9371 Dual ADC&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX Dboard: A&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: Magnesium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX&lt;br /&gt;
|   |   |   |   Sensors: lo_locked, ad9371_lo_locked, lowband_lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 65.0 step 0.5 dB&lt;br /&gt;
|   |   |   |   Gain range rfic: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range dsa: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range amp: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Frontend: 1&lt;br /&gt;
|   |   |   |   Name: Magnesium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX&lt;br /&gt;
|   |   |   |   Sensors: lo_locked, ad9371_lo_locked, lowband_lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 65.0 step 0.5 dB&lt;br /&gt;
|   |   |   |   Gain range rfic: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range dsa: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range amp: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Codec: A&lt;br /&gt;
|   |   |   |   Name: AD9371 Dual DAC&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX Dboard: B&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: Magnesium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX&lt;br /&gt;
|   |   |   |   Sensors: lo_locked, ad9371_lo_locked, lowband_lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 65.0 step 0.5 dB&lt;br /&gt;
|   |   |   |   Gain range rfic: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range dsa: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range amp: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Frontend: 1&lt;br /&gt;
|   |   |   |   Name: Magnesium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX&lt;br /&gt;
|   |   |   |   Sensors: lo_locked, ad9371_lo_locked, lowband_lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 65.0 step 0.5 dB&lt;br /&gt;
|   |   |   |   Gain range rfic: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range dsa: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Gain range amp: 0.0 to 0.0 step 0.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Codec: B&lt;br /&gt;
|   |   |   |   Name: AD9371 Dual DAC&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RFNoC blocks on this device:&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   * DmaFIFO_0&lt;br /&gt;
|   |   |   * Radio_0&lt;br /&gt;
|   |   |   * Radio_1&lt;br /&gt;
|   |   |   * DDC_0&lt;br /&gt;
|   |   |   * DDC_1&lt;br /&gt;
|   |   |   * DUC_0&lt;br /&gt;
|   |   |   * DUC_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====N320====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$ uhd_usrp_probe &lt;br /&gt;
[INFO] [UHD] linux; GNU C++ version 7.3.0; Boost_106600; UHD_3.14.0.0-0-g6875d061&lt;br /&gt;
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=127.0.0.1,type=n3xx,product=n320,serial=3181FFA,claimed=False&lt;br /&gt;
[INFO] [MPM.main] Launching USRP/MPM, version: 3.14.0.0-g6875d061&lt;br /&gt;
[INFO] [MPM.main] Spawning RPC process...&lt;br /&gt;
[INFO] [MPM.PeriphManager] Device serial number: 3181FFA&lt;br /&gt;
[INFO] [MPM.Rhodium-0] Successfully loaded all peripherals!&lt;br /&gt;
[INFO] [MPM.Rhodium-1] Successfully loaded all peripherals!&lt;br /&gt;
[INFO] [MPM.PeriphManager] Initialized 2 daughterboard(s).&lt;br /&gt;
[INFO] [MPM.PeriphManager] No QSFP board detected: Assuming it is disabled in the device tree overlay (e.g., HG, XG images).&lt;br /&gt;
[INFO] [MPM.PeriphManager] init() called with device args `time_source=internal,clock_source=internal'.&lt;br /&gt;
[INFO] [MPM.Rhodium-0] init() called with args `time_source=internal,clock_source=internal'&lt;br /&gt;
[INFO] [MPM.Rhodium-1] init() called with args `time_source=internal,clock_source=internal'&lt;br /&gt;
[INFO] [MPM.Rhodium-0.init.LMK04828] LMK initialized and locked!&lt;br /&gt;
[INFO] [MPM.Rhodium-1.init.LMK04828] LMK initialized and locked!&lt;br /&gt;
[INFO] [MPM.Rhodium-1.DAC37J82] DAC PLL Locked!&lt;br /&gt;
[INFO] [MPM.Rhodium-1.AD9695] ADC PLL Locked!&lt;br /&gt;
[INFO] [MPM.Rhodium-1.init] JESD204B Link Initialization &amp;amp; Training Complete&lt;br /&gt;
[INFO] [MPM.Rhodium-0.DAC37J82] DAC PLL Locked!&lt;br /&gt;
[INFO] [MPM.Rhodium-0.AD9695] ADC PLL Locked!&lt;br /&gt;
[INFO] [MPM.Rhodium-0.init] JESD204B Link Initialization &amp;amp; Training Complete&lt;br /&gt;
[INFO] [MPM.RPCServer] RPC server ready!&lt;br /&gt;
[INFO] [MPM.RPCServer] Spawning watchdog task...&lt;br /&gt;
[INFO] [MPM.PeriphManager] init() called with device args `mgmt_addr=127.0.0.1,clock_source=internal,time_source=internal,product=n320'.&lt;br /&gt;
[INFO] [MPM.Rhodium-0] init() called with args `mgmt_addr=127.0.0.1,clock_source=internal,time_source=internal,product=n320'&lt;br /&gt;
[INFO] [MPM.Rhodium-1] init() called with args `mgmt_addr=127.0.0.1,clock_source=internal,time_source=internal,product=n320'&lt;br /&gt;
[INFO] [0/Replay_0] Initializing block control (NOC ID: 0x4E91A00000000004)&lt;br /&gt;
[INFO] [0/Radio_0] Initializing block control (NOC ID: 0x12AD100000000320)&lt;br /&gt;
[INFO] [0/Radio_1] Initializing block control (NOC ID: 0x12AD100000000320)&lt;br /&gt;
[INFO] [0/DDC_0] Initializing block control (NOC ID: 0xDDC0000000000001)&lt;br /&gt;
[INFO] [0/DDC_1] Initializing block control (NOC ID: 0xDDC0000000000001)&lt;br /&gt;
[INFO] [0/DUC_0] Initializing block control (NOC ID: 0xD0C0000000000000)&lt;br /&gt;
[INFO] [0/DUC_1] Initializing block control (NOC ID: 0xD0C0000000000000)&lt;br /&gt;
[INFO] [0/FIFO_0] Initializing block control (NOC ID: 0xF1F0000000000000)&lt;br /&gt;
[INFO] [0/FIFO_1] Initializing block control (NOC ID: 0xF1F0000000000000)&lt;br /&gt;
  _____________________________________________________&lt;br /&gt;
 /&lt;br /&gt;
|       Device: N300-Series Device&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       Mboard: ni-n3xx-3181FFA&lt;br /&gt;
|   |   eeprom_version: 2&lt;br /&gt;
|   |   mpm_version: 3.14.0.0-g6875d061&lt;br /&gt;
|   |   pid: 16962&lt;br /&gt;
|   |   product: n320&lt;br /&gt;
|   |   rev: 6&lt;br /&gt;
|   |   rpc_connection: local&lt;br /&gt;
|   |   serial: 3181FFA&lt;br /&gt;
|   |   type: n3xx&lt;br /&gt;
|   |   MPM Version: 1.2&lt;br /&gt;
|   |   FPGA Version: 5.3&lt;br /&gt;
|   |   FPGA git hash: 3de8954.clean&lt;br /&gt;
|   |   RFNoC capable: Yes&lt;br /&gt;
|   |   &lt;br /&gt;
|   |   Time sources:  internal, external, gpsdo, sfp0&lt;br /&gt;
|   |   Clock sources: external, internal, gpsdo&lt;br /&gt;
|   |   Sensors: gps_tpv, temp, gps_sky, fan, gps_time, gps_locked, ref_locked, gps_gpgga&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX Dboard: A&lt;br /&gt;
|   |   |   ID: Unknown (0x0152)&lt;br /&gt;
|   |   |   Serial: 3175A79&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: Rhodium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, RX2, CAL, TERM&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 60.0 step 1.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 250000000.0 to 250000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: &lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Codec: A&lt;br /&gt;
|   |   |   |   Name: ad9695-625&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX Dboard: B&lt;br /&gt;
|   |   |   ID: Unknown (0x0152)&lt;br /&gt;
|   |   |   Serial: 3175A67&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: Rhodium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, RX2, CAL, TERM&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 60.0 step 1.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 250000000.0 to 250000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: &lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Codec: B&lt;br /&gt;
|   |   |   |   Name: ad9695-625&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX Dboard: A&lt;br /&gt;
|   |   |   ID: Unknown (0x0152)&lt;br /&gt;
|   |   |   Serial: 3175A79&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: Rhodium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, CAL, TERM&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 60.0 step 1.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 250000000.0 to 250000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: &lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Codec: A&lt;br /&gt;
|   |   |   |   Name: dac37j82&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX Dboard: B&lt;br /&gt;
|   |   |   ID: Unknown (0x0152)&lt;br /&gt;
|   |   |   Serial: 3175A67&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: Rhodium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, CAL, TERM&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 60.0 step 1.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 250000000.0 to 250000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: &lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Codec: B&lt;br /&gt;
|   |   |   |   Name: dac37j82&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RFNoC blocks on this device:&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   * Replay_0&lt;br /&gt;
|   |   |   * Radio_0&lt;br /&gt;
|   |   |   * Radio_1&lt;br /&gt;
|   |   |   * DDC_0&lt;br /&gt;
|   |   |   * DDC_1&lt;br /&gt;
|   |   |   * DUC_0&lt;br /&gt;
|   |   |   * DUC_1&lt;br /&gt;
|   |   |   * FIFO_0&lt;br /&gt;
|   |   |   * FIFO_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====N321====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ uhd_usrp_probe&lt;br /&gt;
[INFO] [UHD] linux; GNU C++ version 7.3.1 20180712 (Red Hat 7.3.1-6); Boost_106400; UHD_3.14.0.0-0-g6875d061&lt;br /&gt;
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=192.168.20.2,type=n3xx,product=n320,serial=3166646,claimed=False,addr=192.168.20.2&lt;br /&gt;
[INFO] [MPM.PeriphManager] init() called with device args `time_source=internal,clock_source=internal,product=n320,mgmt_addr=192.168.20.2'.&lt;br /&gt;
[INFO] [MPM.Rhodium-0] init() called with args `time_source=internal,clock_source=internal,product=n320,mgmt_addr=192.168.20.2'&lt;br /&gt;
[INFO] [MPM.Rhodium-1] init() called with args `time_source=internal,clock_source=internal,product=n320,mgmt_addr=192.168.20.2'&lt;br /&gt;
[INFO] [0/Replay_0] Initializing block control (NOC ID: 0x4E91A00000000004)&lt;br /&gt;
[INFO] [0/Radio_0] Initializing block control (NOC ID: 0x12AD100000000320)&lt;br /&gt;
[INFO] [0/Radio_1] Initializing block control (NOC ID: 0x12AD100000000320)&lt;br /&gt;
[INFO] [0/DDC_0] Initializing block control (NOC ID: 0xDDC0000000000001)&lt;br /&gt;
[INFO] [0/DDC_1] Initializing block control (NOC ID: 0xDDC0000000000001)&lt;br /&gt;
[INFO] [0/DUC_0] Initializing block control (NOC ID: 0xD0C0000000000000)&lt;br /&gt;
[INFO] [0/DUC_1] Initializing block control (NOC ID: 0xD0C0000000000000)&lt;br /&gt;
[INFO] [0/FIFO_0] Initializing block control (NOC ID: 0xF1F0000000000000)&lt;br /&gt;
[INFO] [0/FIFO_1] Initializing block control (NOC ID: 0xF1F0000000000000)&lt;br /&gt;
  _____________________________________________________&lt;br /&gt;
 /&lt;br /&gt;
|       Device: N300-Series Device&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       Mboard: ni-n3xx-3166646&lt;br /&gt;
|   |   eeprom_version: 2&lt;br /&gt;
|   |   mpm_version: 3.14.0.0-g6875d061&lt;br /&gt;
|   |   pid: 16962&lt;br /&gt;
|   |   product: n320&lt;br /&gt;
|   |   rev: 6&lt;br /&gt;
|   |   rpc_connection: remote&lt;br /&gt;
|   |   serial: 3166646&lt;br /&gt;
|   |   type: n3xx&lt;br /&gt;
|   |   MPM Version: 1.2&lt;br /&gt;
|   |   FPGA Version: 5.3&lt;br /&gt;
|   |   FPGA git hash: 3de8954.clean&lt;br /&gt;
|   |   RFNoC capable: Yes&lt;br /&gt;
|   |   &lt;br /&gt;
|   |   Time sources:  internal, external, gpsdo, sfp0&lt;br /&gt;
|   |   Clock sources: external, internal, gpsdo&lt;br /&gt;
|   |   Sensors: gps_sky, gps_time, gps_gpgga, gps_locked, fan, gps_tpv, ref_locked, temp&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX Dboard: B&lt;br /&gt;
|   |   |   ID: Unknown (0x0152)&lt;br /&gt;
|   |   |   Serial: 316D814&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: Rhodium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, RX2, CAL, TERM&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 60.0 step 1.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 250000000.0 to 250000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: &lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Codec: B&lt;br /&gt;
|   |   |   |   Name: ad9695-625&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX Dboard: A&lt;br /&gt;
|   |   |   ID: Unknown (0x0152)&lt;br /&gt;
|   |   |   Serial: 316D810&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: Rhodium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, RX2, CAL, TERM&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 60.0 step 1.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 250000000.0 to 250000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: &lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Codec: A&lt;br /&gt;
|   |   |   |   Name: ad9695-625&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX Dboard: B&lt;br /&gt;
|   |   |   ID: Unknown (0x0152)&lt;br /&gt;
|   |   |   Serial: 316D814&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: Rhodium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, CAL, TERM&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 60.0 step 1.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 250000000.0 to 250000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: &lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Codec: B&lt;br /&gt;
|   |   |   |   Name: dac37j82&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX Dboard: A&lt;br /&gt;
|   |   |   ID: Unknown (0x0152)&lt;br /&gt;
|   |   |   Serial: 316D810&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: Rhodium&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, CAL, TERM&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 1.000 to 6000.000 MHz&lt;br /&gt;
|   |   |   |   Gain range all: 0.0 to 60.0 step 1.0 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 250000000.0 to 250000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: &lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Codec: A&lt;br /&gt;
|   |   |   |   Name: dac37j82&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RFNoC blocks on this device:&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   * Replay_0&lt;br /&gt;
|   |   |   * Radio_0&lt;br /&gt;
|   |   |   * Radio_1&lt;br /&gt;
|   |   |   * DDC_0&lt;br /&gt;
|   |   |   * DDC_1&lt;br /&gt;
|   |   |   * DUC_0&lt;br /&gt;
|   |   |   * DUC_1&lt;br /&gt;
|   |   |   * FIFO_0&lt;br /&gt;
|   |   |   * FIFO_1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see warnings such as:&lt;br /&gt;
&lt;br /&gt;
    [WARNING] [UDP] The recv buffer could not be resized sufficiently.&lt;br /&gt;
&lt;br /&gt;
You need to resize the socket buffers for your network interface card:&lt;br /&gt;
&lt;br /&gt;
    sudo sysctl -w net.core.rmem_max=288000&lt;br /&gt;
    sudo sysctl -w net.core.wmem_max=288000&lt;br /&gt;
    sudo sysctl -w net.core.rmem_max=33554432&lt;br /&gt;
&lt;br /&gt;
===ASCII Art Example===&lt;br /&gt;
The UHD driver includes several example programs, which may serve as test programs or the basis for your application program. The source code can be obtained from the UHD repository on github at: https://github.com/EttusResearch/uhd/tree/master/host/examples&lt;br /&gt;
&lt;br /&gt;
You can quickly verify the operation of your USRP N3xx by running the &amp;lt;code&amp;gt;rx_ascii_art_dft&amp;lt;/code&amp;gt; UHD example program. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;rx_ascii_art_dft&amp;lt;/code&amp;gt; utility is a simple console ­based, real-time FFT display tool. It is not graphical in nature, so it can be easily run over an SSH connection within a terminal window, and does not need any graphical capability, such as X Windows, to be installed. It can also be run over a serial console connection, although this is not recommended, as the formatting may not render correctly.&lt;br /&gt;
&lt;br /&gt;
You can run a simple test of the N3xx USRP by connecting an antenna and observing the spectrum of a commercial FM radio station in real-time, following the steps below:&lt;br /&gt;
&lt;br /&gt;
1. Attach an antenna to the &amp;lt;code&amp;gt;Ch0/RX2&amp;lt;/code&amp;gt;­ antenna port of the N3xx.&lt;br /&gt;
&lt;br /&gt;
2. From your host computer, run the command:&lt;br /&gt;
&lt;br /&gt;
'''N300/N310'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /usr/local/lib/uhd/examples/rx_ascii_art_dft --args &amp;quot;master_clock_rate=125e6,mgmt_addr=192.168.1.151,addr=192.168.10.2&amp;quot; --freq 98.5e6 --rate 2.5e6 --gain 50 --ref-lvl=&amp;quot;-50&amp;quot; --dyn-rng 90 --ant &amp;quot;RX2&amp;quot; --subdev &amp;quot;A:0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''N320/N321'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /usr/local/lib/uhd/examples/rx_ascii_art_dft --args &amp;quot;master_clock_rate=250e6,mgmt_addr=192.168.1.151,addr=192.168.10.2&amp;quot; --freq 98.5e6 --rate 2.5e6 --gain 50 --ref-lvl=&amp;quot;-50&amp;quot; --dyn-rng 90 --ant &amp;quot;RX2&amp;quot; --subdev &amp;quot;A:0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Modify the command­ line argument &amp;lt;code&amp;gt;freq&amp;lt;/code&amp;gt; ​above to specify a tuning frequency for a strong local FM radio station. You will also need to update the IP Address to match your device IP.&lt;br /&gt;
&lt;br /&gt;
3. You should see a real-time FFT display of 2.5 MHz of spectrum, centered at the specified tuning frequency.&lt;br /&gt;
&lt;br /&gt;
4. Type &amp;quot;&amp;lt;code&amp;gt;Q&amp;lt;/code&amp;gt;&amp;quot; or &amp;lt;code&amp;gt;Ctrl­-C&amp;lt;/code&amp;gt; to stop the program and to return to the Linux command line.&lt;br /&gt;
&lt;br /&gt;
5. You can run with the &amp;lt;code&amp;gt;​­­--help&amp;lt;/code&amp;gt; ​argument to see a description of all available command-line options.&lt;br /&gt;
&lt;br /&gt;
Example Output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /usr/local/lib/uhd/examples/rx_ascii_art_dft --args &amp;quot;master_clock_rate=125e6,mgmt_addr=192.168.1.151,addr=192.168.10.2&amp;quot; --freq 98.5e6 --rate 2.5e6 --gain 50 --ref-lvl=&amp;quot;-50&amp;quot; --dyn-rng 90 --ant &amp;quot;RX2&amp;quot; --subdev &amp;quot;A:0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: master_clock_rate=125e6,mgmt_addr=192.168.1.151,addr=192.168.10.2...&lt;br /&gt;
[INFO] [UHD] linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_3.11.1.HEAD-0-gad6b0935&lt;br /&gt;
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=192.168.1.151,type=n3xx,product=n310,serial=313ABDA,claimed=False,master_clock_rate=125e6,addr=192.168.10.2&lt;br /&gt;
[INFO] [MPM.main] Launching USRP/MPM, version: 3.11.1.0-gunknown&lt;br /&gt;
[INFO] [MPM.main] Spawning RPC process...&lt;br /&gt;
[INFO] [MPM.PeriphManager] Device serial number: 313ABDA&lt;br /&gt;
[INFO] [MPM.PeriphManager] Found 2 daughterboard(s).&lt;br /&gt;
[INFO] [MPM.RPCServer] RPC server ready!&lt;br /&gt;
[INFO] [MPM.RPCServer] Spawning watchdog task...&lt;br /&gt;
[INFO] [MPM.PeriphManager] init() called with device args `mgmt_addr=192.168.1.151,product=n310,master_clock_rate=125e6'.&lt;br /&gt;
[INFO] [0/DmaFIFO_0] Initializing block control (NOC ID: 0xF1F0D00000000004)&lt;br /&gt;
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1336 MB/s)&lt;br /&gt;
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1338 MB/s)&lt;br /&gt;
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1346 MB/s)&lt;br /&gt;
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1350 MB/s)&lt;br /&gt;
[INFO] [0/Radio_0] Initializing block control (NOC ID: 0x12AD100000000310)&lt;br /&gt;
[INFO] [0/Radio_1] Initializing block control (NOC ID: 0x12AD100000000310)&lt;br /&gt;
[INFO] [0/Radio_2] Initializing block control (NOC ID: 0x12AD100000000310)&lt;br /&gt;
[INFO] [0/Radio_3] Initializing block control (NOC ID: 0x12AD100000000310)&lt;br /&gt;
[INFO] [0/DDC_0] Initializing block control (NOC ID: 0xDDC0000000000001)&lt;br /&gt;
[INFO] [0/DDC_1] Initializing block control (NOC ID: 0xDDC0000000000001)&lt;br /&gt;
[INFO] [0/DDC_2] Initializing block control (NOC ID: 0xDDC0000000000001)&lt;br /&gt;
[INFO] [0/DDC_3] Initializing block control (NOC ID: 0xDDC0000000000001)&lt;br /&gt;
[INFO] [0/DUC_0] Initializing block control (NOC ID: 0xD0C0000000000000)&lt;br /&gt;
[INFO] [0/DUC_1] Initializing block control (NOC ID: 0xD0C0000000000000)&lt;br /&gt;
[INFO] [0/DUC_2] Initializing block control (NOC ID: 0xD0C0000000000000)&lt;br /&gt;
[INFO] [0/DUC_3] Initializing block control (NOC ID: 0xD0C0000000000000)&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: N300-Series Device&lt;br /&gt;
  Mboard 0: ni-n3xx-313ABDA&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: Magnesium&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: Magnesium&lt;br /&gt;
  TX Channel: 1&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: B&lt;br /&gt;
    TX Subdev: Magnesium&lt;br /&gt;
  TX Channel: 2&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: C&lt;br /&gt;
    TX Subdev: Magnesium&lt;br /&gt;
  TX Channel: 3&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: D&lt;br /&gt;
    TX Subdev: Magnesium&lt;br /&gt;
&lt;br /&gt;
Setting RX Rate: 2.500000 Msps...&lt;br /&gt;
Actual RX Rate: 2.500000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting RX Freq: 98.500000 MHz...&lt;br /&gt;
Actual RX Freq: 98.500000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting RX Gain: 50.000000 dB...&lt;br /&gt;
Actual RX Gain: 50.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Checking RX: all_los: locked ...&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Benchmarking your system===&lt;br /&gt;
Included with the UHD driver example programs is a utility, &amp;lt;code&amp;gt;benchmark_rate&amp;lt;/code&amp;gt; to benchmark the transport link of the system. &lt;br /&gt;
&lt;br /&gt;
A system's maximum performance is dependent upon many factors. &amp;lt;code&amp;gt;benchmark_rate&amp;lt;/code&amp;gt; will exercise the transport link and CPU of the system. &lt;br /&gt;
&lt;br /&gt;
====1 Gb Interface====&lt;br /&gt;
NOTE: This example requires the &amp;lt;code&amp;gt;HG&amp;lt;/code&amp;gt; FPGA image to be loaded.&lt;br /&gt;
&lt;br /&gt;
'''N300/N310'''&lt;br /&gt;
&lt;br /&gt;
This example will test one full-duplex stream using &amp;quot;RF0/A:0&amp;quot;, at a rate of 3.84 MS/s, for 60 seconds:&lt;br /&gt;
&lt;br /&gt;
    /usr/local/lib/uhd/examples/benchmark_rate  \&lt;br /&gt;
    --args &amp;quot;type=n3xx,mgmt_addr=192.168.1.151,addr=192.168.10.2,master_clock_rate=122.88e6&amp;quot; \&lt;br /&gt;
    --duration 60 \&lt;br /&gt;
    --channels &amp;quot;0&amp;quot; \&lt;br /&gt;
    --rx_rate 3.84e6 \&lt;br /&gt;
    --rx_subdev &amp;quot;A:0&amp;quot; \&lt;br /&gt;
    --tx_rate 3.84e6 \&lt;br /&gt;
    --tx_subdev &amp;quot;A:0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''N310'''&lt;br /&gt;
&lt;br /&gt;
This example will test four full-duplex streams at 1.25 MS/s, for 60 seconds:&lt;br /&gt;
&lt;br /&gt;
    /usr/local/lib/uhd/examples/benchmark_rate  \&lt;br /&gt;
    --args &amp;quot;type=n3xx,mgmt_addr=192.168.1.151,addr=192.168.10.2,master_clock_rate=125e6&amp;quot; \&lt;br /&gt;
    --duration 60 \&lt;br /&gt;
    --channels &amp;quot;0,1,2,3&amp;quot; \&lt;br /&gt;
    --rx_rate 1.25e6 \&lt;br /&gt;
    --rx_subdev &amp;quot;A:0 A:1 B:0 B:1&amp;quot; \&lt;br /&gt;
    --tx_rate 1.25e6 \&lt;br /&gt;
    --tx_subdev &amp;quot;A:0 A:1 B:0 B:1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''N320/N321'''&lt;br /&gt;
&lt;br /&gt;
This example will test one full-duplex stream using &amp;quot;RF0/A:0&amp;quot;, at a rate of 3.84 MS/s, for 60 seconds:&lt;br /&gt;
&lt;br /&gt;
    /usr/local/lib/uhd/examples/benchmark_rate  \&lt;br /&gt;
    --args &amp;quot;type=n3xx,mgmt_addr=192.168.1.151,addr=192.168.10.2,master_clock_rate=245.76e6&amp;quot; \&lt;br /&gt;
    --duration 60 \&lt;br /&gt;
    --channels &amp;quot;0&amp;quot; \&lt;br /&gt;
    --rx_rate 3.84e6 \&lt;br /&gt;
    --rx_subdev &amp;quot;A:0&amp;quot; \&lt;br /&gt;
    --tx_rate 3.84e6 \&lt;br /&gt;
    --tx_subdev &amp;quot;A:0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
When streaming samples over a 1 Gb transport link, the maximum accumulative rate for all channels is 25 MS/s with a &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt; OTW format. To achieve higher streaming rates, it is recommended to use the 10 Gb interfaces.&lt;br /&gt;
&lt;br /&gt;
====10 Gb Interface SFP 1====&lt;br /&gt;
NOTE: This example will work with either the &amp;lt;code&amp;gt;HG&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;XG&amp;lt;/code&amp;gt; FPGA image.&lt;br /&gt;
&lt;br /&gt;
'''N300/N310'''&lt;br /&gt;
&lt;br /&gt;
This example will test one full-duplex stream using &amp;quot;RF0/A:0&amp;quot;, at a rate of 31.25 MS/s, for 60 seconds:&lt;br /&gt;
&lt;br /&gt;
    /usr/local/lib/uhd/examples/benchmark_rate  \&lt;br /&gt;
    --args &amp;quot;type=n3xx,mgmt_addr=192.168.1.151,addr=192.168.20.2,master_clock_rate=125e6&amp;quot; \&lt;br /&gt;
    --duration 60 \&lt;br /&gt;
    --channels &amp;quot;0&amp;quot; \&lt;br /&gt;
    --rx_rate 31.25e6 \&lt;br /&gt;
    --rx_subdev &amp;quot;A:0&amp;quot; \&lt;br /&gt;
    --tx_rate 31.25e6 \&lt;br /&gt;
    --tx_subdev &amp;quot;A:0&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
'''N320/N321'''&lt;br /&gt;
&lt;br /&gt;
This example will test one full-duplex stream using &amp;quot;RF0/A:0&amp;quot;, at a rate of 31.25 MS/s, for 60 seconds:&lt;br /&gt;
&lt;br /&gt;
    /usr/local/lib/uhd/examples/benchmark_rate  \&lt;br /&gt;
    --args &amp;quot;type=n3xx,mgmt_addr=192.168.1.151,addr=192.168.20.2,master_clock_rate=250e6&amp;quot; \&lt;br /&gt;
    --duration 60 \&lt;br /&gt;
    --channels &amp;quot;0&amp;quot; \&lt;br /&gt;
    --rx_rate 31.25e6 \&lt;br /&gt;
    --rx_subdev &amp;quot;A:0&amp;quot; \&lt;br /&gt;
    --tx_rate 31.25e6 \&lt;br /&gt;
    --tx_subdev &amp;quot;A:0&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
'''N310'''&lt;br /&gt;
&lt;br /&gt;
This example will test four full-duplex streams at 30.72 MS/s, for 60 seconds:&lt;br /&gt;
&lt;br /&gt;
    /usr/local/lib/uhd/examples/benchmark_rate  \&lt;br /&gt;
    --args &amp;quot;type=n3xx,mgmt_addr=192.168.1.151,addr=192.168.20.2,master_clock_rate=122.88e6&amp;quot; \&lt;br /&gt;
    --duration 60 \&lt;br /&gt;
    --channels &amp;quot;0,1,2,3&amp;quot; \&lt;br /&gt;
    --rx_rate 30.72e6 \&lt;br /&gt;
    --rx_subdev &amp;quot;A:0 A:1 B:0 B:1&amp;quot; \&lt;br /&gt;
    --tx_rate 30.72e6 \&lt;br /&gt;
    --tx_subdev &amp;quot;A:0 A:1 B:0 B:1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''N320/N321'''&lt;br /&gt;
&lt;br /&gt;
This example will test two full-duplex streams at 30.72 MS/s, for 60 seconds:&lt;br /&gt;
&lt;br /&gt;
    /usr/local/lib/uhd/examples/benchmark_rate  \&lt;br /&gt;
    --args &amp;quot;type=n3xx,mgmt_addr=192.168.1.151,addr=192.168.20.2,master_clock_rate=245.76e6&amp;quot; \&lt;br /&gt;
    --duration 60 \&lt;br /&gt;
    --channels &amp;quot;0,1,2,3&amp;quot; \&lt;br /&gt;
    --rx_rate 30.72e6 \&lt;br /&gt;
    --rx_subdev &amp;quot;A:0 B:0&amp;quot; \&lt;br /&gt;
    --tx_rate 30.72e6 \&lt;br /&gt;
    --tx_subdev &amp;quot;A:0 B:0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Dual 10 Gb Interface====&lt;br /&gt;
NOTE: This example requires the &amp;lt;code&amp;gt;XG&amp;lt;/code&amp;gt; FPGA image to be loaded.&lt;br /&gt;
&lt;br /&gt;
'''N310'''&lt;br /&gt;
&lt;br /&gt;
This example will test four full-duplex streams at 62.5 MS/s, for 60 seconds:&lt;br /&gt;
&lt;br /&gt;
    /usr/local/lib/uhd/examples/benchmark_rate  \&lt;br /&gt;
    --args &amp;quot;type=n3xx,mgmt_addr=192.168.1.151,addr=192.168.10.2,second_addr=192.168.20.2,master_clock_rate=125e6&amp;quot; \&lt;br /&gt;
    --duration 60 \&lt;br /&gt;
    --channels &amp;quot;0,1,2,3&amp;quot; \&lt;br /&gt;
    --rx_rate 62.5e6 \&lt;br /&gt;
    --rx_subdev &amp;quot;A:0 A:1 B:0 B:1&amp;quot; \&lt;br /&gt;
    --tx_rate 62.5e6 \&lt;br /&gt;
    --tx_subdev &amp;quot;A:0 A:1 B:0 B:1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''N320/N321'''&lt;br /&gt;
&lt;br /&gt;
This example will test two full-duplex streams at 62.5 MS/s, for 60 seconds:&lt;br /&gt;
&lt;br /&gt;
    /usr/local/lib/uhd/examples/benchmark_rate  \&lt;br /&gt;
    --args &amp;quot;type=n3xx,mgmt_addr=192.168.1.151,addr=192.168.10.2,second_addr=192.168.20.2,master_clock_rate=250e6&amp;quot; \&lt;br /&gt;
    --duration 60 \&lt;br /&gt;
    --channels &amp;quot;0,1,2,3&amp;quot; \&lt;br /&gt;
    --rx_rate 62.5e6 \&lt;br /&gt;
    --rx_subdev &amp;quot;A:0 B:0&amp;quot; \&lt;br /&gt;
    --tx_rate 62.5e6 \&lt;br /&gt;
    --tx_subdev &amp;quot;A:0 B:0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==USRP N3xx Device Specific Operations==&lt;br /&gt;
&lt;br /&gt;
===White Rabbit Ethernet-Based Synchronization===&lt;br /&gt;
* [[Using Ethernet-Based Synchronization on the USRP™ N3xx Devices]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===N320/N321===&lt;br /&gt;
* [[USRP N320/N321 LO Distribution]]&lt;br /&gt;
* [[5G NR EVM Measurements with the USRP N320/N321]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Turning the Device Off/On===&lt;br /&gt;
To avoid damaging the file system and causing any corruption, do not turn the device off with the power button without first shutting down the system. Use this command to cleanly and properly shut the system down:&lt;br /&gt;
&lt;br /&gt;
    shutdown ­-h now&lt;br /&gt;
&lt;br /&gt;
===Enable Auto Booting===&lt;br /&gt;
Auto booting of the N3xx when power is applied can be configured by enabling the flag on the device's EEPROM with the following command:&lt;br /&gt;
&lt;br /&gt;
    eeprom-set-flags 0x1&lt;br /&gt;
&lt;br /&gt;
===Default Password===&lt;br /&gt;
The default user is &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password is empty (no password).&lt;br /&gt;
&lt;br /&gt;
It is recommended to update the &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; password, which can be done with the command &amp;lt;code&amp;gt;passwd&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Example Output:&lt;br /&gt;
&lt;br /&gt;
    root@ni-n3xx-serial:~# passwd&lt;br /&gt;
    Changing password for root&lt;br /&gt;
    New password: &lt;br /&gt;
    Re-enter new password: &lt;br /&gt;
    passwd: password changed.&lt;br /&gt;
&lt;br /&gt;
==Technical Support and Community Knowledge Base==&lt;br /&gt;
Technical support for USRP hardware is available through email only. If the product arrived in a non­functional state or you require technical assistance, please contact [mailto:support@ettus.com support@ettus.com]. Please allow 24 to 48 hours for response by email, depending on holidays and weekends, although we are often able to reply more quickly than that.&lt;br /&gt;
&lt;br /&gt;
We also recommend that you subscribe to the community mailing lists. The mailing lists have a responsive and knowledgeable community of hundreds of developers and technical users who are located around the world. When you join the community, you will be connected to this group of people who can help you learn about SDR and respond to your technical and specific questions. Often your question can be answered quickly on the mailing lists. Each mailing list also provides an archive of all past conversations and discussions going back many years. Your question or problem may have already been addressed before, and a relevant or helpful solution may already exist in the archive.&lt;br /&gt;
&lt;br /&gt;
Discussions involving the USRP hardware and the UHD software itself are best addressed through the '''u​srp­-users''' ​mailing list at [http://usrp-users.ettus.com http://usrp-users.ettus.com].&lt;br /&gt;
&lt;br /&gt;
Discussions involving the use of [http://gnuradio.org/ GNU Radio] with USRP hardware and UHD software are best addressed through the '''d​iscuss­-gnuradio'''​ mailing list at [https://lists.gnu.org/mailman/listinfo/discuss­gnuradio https://lists.gnu.org/mailman/listinfo/discuss­gnuradio]​.&lt;br /&gt;
&lt;br /&gt;
Discussions involving the use of [http://openbts.org/ OpenBTS®] with USRP hardware and UHD software are best addressed through the '''o​penbts­-discuss​''' mailing list at [https://lists.sourceforge.net/lists/listinfo/openbts­discuss​ https://lists.sourceforge.net/lists/listinfo/openbts­discuss​].​&lt;br /&gt;
&lt;br /&gt;
The support page on our website is located at [https://www.ettus.com/support https://www.ettus.com/support]​. The Knowledge Base is located at ​[https://kb.ettus.com https://kb.ettus.com]​.&lt;br /&gt;
&lt;br /&gt;
==Legal Considerations==&lt;br /&gt;
Every country has laws governing the transmission and reception of radio signals. Users are solely responsible for insuring they use their USRP system in compliance with all applicable laws and regulations. Before attempting to transmit and/or receive on any frequency, we recommend that you determine what licenses may be required and what restrictions may apply.&lt;br /&gt;
&lt;br /&gt;
*NOTE: This USRP product is a piece of test equipment.&lt;br /&gt;
&lt;br /&gt;
==Sales and Ordering Support==&lt;br /&gt;
If you have any non­-technical questions related to your order, then please contact us by email at [mailto:orders@ettus.com orders@ettus.com]​, or by phone at +1­408­610­6399 (Monday-Friday, 8 AM - 5 PM, Pacific Time). Please be sure to include your order number and the serial number of your USRP.&lt;br /&gt;
&lt;br /&gt;
==Terms and Conditions of Sale==&lt;br /&gt;
Terms and conditions of sale can be accessed online at the following link: http://www.ettus.com/legal/terms-and-conditions-of-sale&lt;br /&gt;
&lt;br /&gt;
[[Category:Getting Started Guides]]&lt;br /&gt;
[[Category:N300]]&lt;br /&gt;
[[Category:N310]]&lt;br /&gt;
&lt;br /&gt;
[[Category:N320]]&lt;br /&gt;
&lt;br /&gt;
[[Category:N321]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5291</id>
		<title>Using the RFNoC Replay Block in UHD 4</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5291"/>
				<updated>2022-03-01T16:10:08Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-642b'''&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
This application note guides a user through basic use of the RFNoC Replay block&lt;br /&gt;
in UHD 4.x and explains how to run the UHD Replay example. This example covers&lt;br /&gt;
the USRP X410, X310/X300, N300/N310/N320 and E320 devices. For UHD 3.x, please&lt;br /&gt;
refer to [[Using_the_RFNoC_Replay_Block|the UHD 3.x replay block Application Note]].&lt;br /&gt;
&lt;br /&gt;
An introduction to RFNoC with UHD 4.0 and above can be found [[Getting_Started_with_RFNoC_in_UHD_4.0|here]].&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
The Replay block is an RFNoC block that allows recording and playback of&lt;br /&gt;
arbitrary data using DRAM on the USRP hardware as a buffer. To use the Replay&lt;br /&gt;
block, it must be instantiated in the design and connected to the DRAM interface.&lt;br /&gt;
&lt;br /&gt;
The replay block is a standard feature of UHD and RFNoC, and a custom compile of&lt;br /&gt;
UHD is not required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs, so when using these images,&lt;br /&gt;
the following examples can be run without any manual builds of UHD or FPGA images.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
To follow this application note, you need a device with a replay block instantiated,&lt;br /&gt;
and a UHD version recent enough to have the full support for the replay block&lt;br /&gt;
(UHD 4.2 and beyond). To test for the replay block capabilities, connect and&lt;br /&gt;
enable your USRP device, and run the following command:&lt;br /&gt;
&lt;br /&gt;
    uhd_usrp_probe --args &amp;lt;device args&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert the appropriate device args for your device, e.g.&lt;br /&gt;
&lt;br /&gt;
    uhd_usrp_probe --args type=x4xx,addr=192.168.30.2&lt;br /&gt;
&lt;br /&gt;
Depending on your device, the output could look like this (truncated):&lt;br /&gt;
&lt;br /&gt;
     _____________________________________________________&lt;br /&gt;
    /&lt;br /&gt;
    |       Device: X400-Series Device&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Mboard: ni-x4xx-&amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   pid: 1040&lt;br /&gt;
    |   |   rev: 4&lt;br /&gt;
    |   |   rev_compat: 4&lt;br /&gt;
    |   |   serial: &amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   MPM Version: 4.0&lt;br /&gt;
    |   |   FPGA Version: 7.6&lt;br /&gt;
    |   |   FPGA git hash: &amp;lt;hash&amp;gt;.clean&lt;br /&gt;
    |   |   RFNoC capable: Yes&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   Time sources:  internal, external, qsfp0, gpsdo&lt;br /&gt;
    |   |   Clock sources: mboard, internal, external, nsync, gpsdo&lt;br /&gt;
    |   |   Sensors: ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/DDC#0&lt;br /&gt;
    |   |   * 0/DDC#1&lt;br /&gt;
    |   |   * 0/DUC#0&lt;br /&gt;
    |   |   * 0/DUC#1&lt;br /&gt;
    |   |   * 0/Radio#0&lt;br /&gt;
    |   |   * 0/Radio#1&lt;br /&gt;
    |   |   * 0/Replay#0&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/SEP#0:0==&amp;gt;0/DUC#0:0&lt;br /&gt;
    |   |   * 0/DUC#0:0==&amp;gt;0/Radio#0:0&lt;br /&gt;
    |   |   * 0/Radio#0:0==&amp;gt;0/DDC#0:0&lt;br /&gt;
    |   |   * 0/DDC#0:0==&amp;gt;0/SEP#0:0&lt;br /&gt;
    |   |   * 0/SEP#1:0==&amp;gt;0/DUC#0:1&lt;br /&gt;
    |   |   * 0/DUC#0:1==&amp;gt;0/Radio#0:1&lt;br /&gt;
    |   |   * 0/Radio#0:1==&amp;gt;0/DDC#0:1&lt;br /&gt;
    |   |   * 0/DDC#0:1==&amp;gt;0/SEP#1:0&lt;br /&gt;
    |   |   * 0/SEP#2:0==&amp;gt;0/DUC#1:0&lt;br /&gt;
    |   |   * 0/DUC#1:0==&amp;gt;0/Radio#1:0&lt;br /&gt;
    |   |   * 0/Radio#1:0==&amp;gt;0/DDC#1:0&lt;br /&gt;
    |   |   * 0/DDC#1:0==&amp;gt;0/SEP#2:0&lt;br /&gt;
    |   |   * 0/SEP#3:0==&amp;gt;0/DUC#1:1&lt;br /&gt;
    |   |   * 0/DUC#1:1==&amp;gt;0/Radio#1:1&lt;br /&gt;
    |   |   * 0/Radio#1:1==&amp;gt;0/DDC#1:1&lt;br /&gt;
    |   |   * 0/DDC#1:1==&amp;gt;0/SEP#3:0&lt;br /&gt;
    |   |   * 0/SEP#4:0==&amp;gt;0/Replay#0:0&lt;br /&gt;
    |   |   * 0/Replay#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
    |   |   * 0/SEP#5:0==&amp;gt;0/Replay#0:1&lt;br /&gt;
    |   |   * 0/Replay#0:1==&amp;gt;0/SEP#5:0&lt;br /&gt;
    |   |   * 0/SEP#6:0==&amp;gt;0/Replay#0:2&lt;br /&gt;
    |   |   * 0/Replay#0:2==&amp;gt;0/SEP#6:0&lt;br /&gt;
    |   |   * 0/SEP#7:0==&amp;gt;0/Replay#0:3&lt;br /&gt;
    |   |   * 0/Replay#0:3==&amp;gt;0/SEP#7:0&lt;br /&gt;
&lt;br /&gt;
The output tells us that this USRP has a Replay block instantiated (&amp;lt;code&amp;gt;0/Replay#0&amp;lt;/code&amp;gt;).&lt;br /&gt;
It has four static connections to stream endpoints, which also tells us that&lt;br /&gt;
this is a four-port replay block.&lt;br /&gt;
&lt;br /&gt;
If your device does not report a replay block, then you need to load&lt;br /&gt;
an FPGA image which includes this block. See [[#building_fpga|this section]] for instructions on how to do&lt;br /&gt;
this before you proceed. If it does report a block, you can move to the next&lt;br /&gt;
section.&lt;br /&gt;
&lt;br /&gt;
==Running the Example==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; example assumes that you have a&lt;br /&gt;
file containing the samples you wish to replay. This could be generated in&lt;br /&gt;
advance or recorded using &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt; or another method. For&lt;br /&gt;
this demonstration, we'll create a simple Python program (&amp;lt;code&amp;gt;sample_gen.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
to generate some samples to use:&lt;br /&gt;
&lt;br /&gt;
    import math&lt;br /&gt;
    import struct&lt;br /&gt;
    &lt;br /&gt;
    SAMPLE_RATE = 200.0e6        # Sample rate in Hz&lt;br /&gt;
    FREQUENCY   = 500.0e3        # Frequency of sinusoid to generate, in Hz&lt;br /&gt;
    NUM_SAMPLES = 16000          # Number of samples to generate&lt;br /&gt;
    AMPLITUDE   = 0.5            # Amplitude of the signal (from 0 to 1.0)&lt;br /&gt;
    FILE_NAME   = 'samples.dat'&lt;br /&gt;
    &lt;br /&gt;
    file = open(FILE_NAME, 'wb')&lt;br /&gt;
    &lt;br /&gt;
    for i in range(NUM_SAMPLES):&lt;br /&gt;
        I = int((2**15-1) * AMPLITUDE * math.cos(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        Q = int((2**15-1) * AMPLITUDE * math.sin(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        file.write(struct.pack('&amp;lt;2h', I, Q))&lt;br /&gt;
    &lt;br /&gt;
    file.close()&lt;br /&gt;
&lt;br /&gt;
This program generates a file named &amp;lt;code&amp;gt;samples.dat&amp;lt;/code&amp;gt; that contains 16000&lt;br /&gt;
samples (40 periods) of a 500&amp;amp;nbsp;kHz tone sampled at a rate of 200&amp;amp;nbsp;MHz.&lt;br /&gt;
Each sample is saved in &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt; format (signed complex with 16-bit real&lt;br /&gt;
and 16-bit imaginary components). We can run the program by invoking python from&lt;br /&gt;
the command line.&lt;br /&gt;
&lt;br /&gt;
    $ python ./sample_gen.py&lt;br /&gt;
&lt;br /&gt;
To run the UHD Replay example, enter a command like the following (the path to&lt;br /&gt;
the examples depends on your installation method, for a normal installation via&lt;br /&gt;
apt-get, examples will be located in &amp;lt;code&amp;gt;/usr/lib/uhd/examples&amp;lt;/code&amp;gt; or&lt;br /&gt;
&amp;lt;code&amp;gt;/usr/local/lib/uhd/examples&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
    $ cd /path/to/examples&lt;br /&gt;
    $ ./replay_samples_from_file --args &amp;lt;device args&amp;gt; --freq 915e6 --gain 10 --file samples.dat --rate 200e6&lt;br /&gt;
&lt;br /&gt;
This example would stream the samples from the file to the Replay block on the&lt;br /&gt;
FPGA, where they are recorded into the USRP's on-board DRAM. Then, the Replay block&lt;br /&gt;
will play the samples to the radio continuously with a base frequency of 915 MHz,&lt;br /&gt;
creating a tone at 915.5 MHz. Press &amp;lt;code&amp;gt;Ctrl+C&amp;lt;/code&amp;gt; to stop transmitting.&lt;br /&gt;
Alternatively, use the &amp;lt;code&amp;gt;--nsamps&amp;lt;/code&amp;gt; command line argument to transmit&lt;br /&gt;
a certain number of samples before returning to the command line. Use the&lt;br /&gt;
&amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; argument to see a full list of arguments.&lt;br /&gt;
&lt;br /&gt;
The advantage of this example compared to directly streaming the file to the&lt;br /&gt;
device is twofold:&lt;br /&gt;
&lt;br /&gt;
* The initial upload to DRAM can happen at any link rate. Even when using 1 GbE, this example will work.&lt;br /&gt;
* Once uploaded, the host computer is basically idle. The FPGA will handle the streaming to the radio front-end.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp source code]&lt;br /&gt;
for &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; may be considered an example&lt;br /&gt;
for best practices on how to use the replay block.&lt;br /&gt;
&lt;br /&gt;
==Using the Replay Block==&lt;br /&gt;
&lt;br /&gt;
This block works like a record and playback buffer that uses DRAM on the USRP to&lt;br /&gt;
store samples.&lt;br /&gt;
Data can be streamed to the block, like to any other RFNoC block.&lt;br /&gt;
&lt;br /&gt;
Refer the [https://files.ettus.com/manual/classuhd_1_1rfnoc_1_1replay__block__control.html manual of the replay block controller]&lt;br /&gt;
for a comprehensive description of its features and API calls.&lt;br /&gt;
&lt;br /&gt;
In the following, we shall use the C++ API to demonstrate the most important&lt;br /&gt;
API calls. We will assume there is a replay block controller called&lt;br /&gt;
&amp;lt;code&amp;gt;replay_ctrl&amp;lt;/code&amp;gt; available in the current context, and it is of type&lt;br /&gt;
&amp;lt;code&amp;gt;uhd::rfnoc::replay_block_control::sptr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Recording Data===&lt;br /&gt;
&lt;br /&gt;
Before streaming data to the replay block, it needs to be configured for recording:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record(buffer_start_byte_address, buffer_size_in_bytes, replay_chan);&lt;br /&gt;
&lt;br /&gt;
This tells the Replay block that it should start recording any data it receives&lt;br /&gt;
on port &amp;lt;code&amp;gt;port&amp;lt;/code&amp;gt; into the DRAM at byte offset &amp;lt;code&amp;gt;buffer_start_byte_address&amp;lt;/code&amp;gt;&lt;br /&gt;
and should use up to &amp;lt;code&amp;gt;buffer_size_in_bytes&amp;lt;/code&amp;gt; bytes. Once the buffer is&lt;br /&gt;
filled, recording automatically stops. Care should be taken to configure the&lt;br /&gt;
memory buffers so that they do not overlap if more than one Replay block or&lt;br /&gt;
buffer is being used simultaneously.&lt;br /&gt;
&lt;br /&gt;
Call this once for every port that you expect to stream data into.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Care should be taken to not transfer more data to the Replay block&lt;br /&gt;
than the size of the record buffer. Additional data is not accepted or dropped&lt;br /&gt;
by the replay block, but flow control will cause data to back up in the RF network on the FPGA.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The amount of memory available to the Replay block is limited by the&lt;br /&gt;
size of the DRAM on the USRP and how the memory interface is configured on the USRP.&lt;br /&gt;
By default, we expose the entire memory of the device, but it is possible to modify&lt;br /&gt;
&amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; if less memory should be made accessible.&lt;br /&gt;
&lt;br /&gt;
Devices have the following amount of memory:&lt;br /&gt;
{|&lt;br /&gt;
|E310&lt;br /&gt;
|512 MiB&lt;br /&gt;
|-&lt;br /&gt;
|E320&lt;br /&gt;
|2 GiB&lt;br /&gt;
|-&lt;br /&gt;
|N3xx&lt;br /&gt;
|2 GiB&lt;br /&gt;
|-&lt;br /&gt;
|X310&lt;br /&gt;
|1 GiB&lt;br /&gt;
|-&lt;br /&gt;
|X410&lt;br /&gt;
|4 GiB per bank (note: not all banks may be connected)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The currently available memory can be queried using the block controller and the &lt;br /&gt;
&amp;lt;code&amp;gt;get_mem_size()&amp;lt;/code&amp;gt; API call.&lt;br /&gt;
&lt;br /&gt;
To restart recording from the same offset, the following API call can be used:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record_restart(replay_chan);&lt;br /&gt;
&lt;br /&gt;
This resets the record pointer to point back to the beginning of the buffer and&lt;br /&gt;
it resets the internal counters that track how much data has been recorded. If&lt;br /&gt;
a previous recording has taken place then it is a good idea to ensure that&lt;br /&gt;
stale data was not queued up in the RF network on the FPGA from a previous run.&lt;br /&gt;
The &amp;lt;code&amp;gt;replay_samples_from_file&amp;lt;/code&amp;gt; example does this by calling&lt;br /&gt;
&amp;lt;code&amp;gt;record_restart()&amp;lt;/code&amp;gt; then waiting to see if any new data shows up&lt;br /&gt;
unexpectedly in the record buffer. If so, it restarts recording then waits&lt;br /&gt;
again to see if data continues to appear.&lt;br /&gt;
&lt;br /&gt;
You can determine when all data has been received by checking the status of the&lt;br /&gt;
record fullness.&lt;br /&gt;
&lt;br /&gt;
    // Wait for recording to complete&lt;br /&gt;
    while (replay_ctrl-&amp;gt;get_record_fullness(replay_chan) &amp;lt; num_bytes_expected)&lt;br /&gt;
        std::this_thread::sleep_for(100ms);&lt;br /&gt;
&lt;br /&gt;
===Playing Back Data===&lt;br /&gt;
&lt;br /&gt;
Prior to playing back recorded data, it is necessary to configure the base&lt;br /&gt;
address and size of the playback buffer. To play back previously recorded data,&lt;br /&gt;
set the start address to the same address that was used for the record buffer&lt;br /&gt;
and set the size of the playback buffer to the match the amount of data that&lt;br /&gt;
was recorded. Note that the record and playback buffers do not need to be the&lt;br /&gt;
same, allowing a single Replay block to both record and playback to different&lt;br /&gt;
regions of memory simultaneously.&lt;br /&gt;
&lt;br /&gt;
    // Configure the Replay block to play back everything that was recorded&lt;br /&gt;
    num_bytes_recorded = replay_ctrl-&amp;gt;get_record_fullness(replay_chan);&lt;br /&gt;
    replay_ctrl-&amp;gt;config_play(buffer_start_byte_address, num_bytes_recorded, replay_chan);&lt;br /&gt;
&lt;br /&gt;
To play back the data in the playback buffer, issue the appropriate UHD stream command.&lt;br /&gt;
Playback automatically wraps around to the start of the buffer if more data is&lt;br /&gt;
requested than the size of the playback buffer.&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;STREAM_MODE_START_CONTINUOUS&amp;lt;/code&amp;gt; causes playback to continue indefinitely&lt;br /&gt;
until explicitly stopped. &amp;lt;code&amp;gt;STREAM_MODE_NUM_SAMPS_AND_DONE&amp;lt;/code&amp;gt; causes only&lt;br /&gt;
the specified number of samples to be played once. Playback can be stopped by issuing&lt;br /&gt;
 a stop command.&lt;br /&gt;
&lt;br /&gt;
    stream_cmd.stream_mode = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd);&lt;br /&gt;
&lt;br /&gt;
This will stop playback at the end of the next DRAM read after the command is&lt;br /&gt;
received (DRAM reads are not aborted mid-transaction). As a result, some data&lt;br /&gt;
will continue to stream from the Replay block after the stop command is issued&lt;br /&gt;
while waiting for the DRAM read to complete and for all the internal buffers to&lt;br /&gt;
empty.&lt;br /&gt;
&lt;br /&gt;
When using the C++ API, the &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; API call is a useful shorthand&lt;br /&gt;
for configuring playback and submitting the stream command at the same time:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;play(buffer_start_byte_address, num_bytes_to_play, replay_chan, start_time, repeat);&lt;br /&gt;
&lt;br /&gt;
In either case, the start time is optional. When given, the first sample to leave&lt;br /&gt;
the block on playback is tagged with this timestamp.&lt;br /&gt;
&lt;br /&gt;
===Memory Alignment and Word Sizes===&lt;br /&gt;
&lt;br /&gt;
There are two memory alignment values that need to be considered when dealing&lt;br /&gt;
with the replay block. The first is the word size, which is the minimum number of&lt;br /&gt;
bytes per DRAM transaction. For most configurations, the word size is 64 bits,&lt;br /&gt;
which means that only even numbers of samples can be recorded or played back&lt;br /&gt;
when using 16-bit complex samples (at 4 bytes per sample). Use the &amp;lt;code&amp;gt;get_word_size()&amp;lt;/code&amp;gt;&lt;br /&gt;
API call to identify the correct word size. The word size can go up to 512 bits.&lt;br /&gt;
&lt;br /&gt;
The second alignment value is the memory's page boundaries. The start addresses&lt;br /&gt;
for record and replay should fall onto a 4 kiB memory boundary to ensure correct&lt;br /&gt;
alignment of data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;building_fpga&amp;quot;&amp;gt;&lt;br /&gt;
==Building Custom FPGA Images with a Replay Block==&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configure the Default Shell===&lt;br /&gt;
&lt;br /&gt;
Before you begin, make sure you are using the &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt; shell. See [[Software_Development_on_the_E3xx_USRP_-_Building_RFNoC_UHD_/_GNU_Radio_/_gr-ettus_from_Source#Reconfigure_Default_Shell|Reconfigure Default Shell]] in AN-315 for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
===Cloning the Repository===&lt;br /&gt;
&lt;br /&gt;
Note: Cloning the repository is only required when building custom FPGA images.&lt;br /&gt;
If the replay block is already built into the USRP's bit file, this is not&lt;br /&gt;
required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs.&lt;br /&gt;
&lt;br /&gt;
If you do require access to the source code, e.g. to build an FPGA image with a&lt;br /&gt;
custom replay block configuration, run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/EttusResearch/uhd.git&lt;br /&gt;
&lt;br /&gt;
For the rest of the Application Note, we assume the repository was cloned into&lt;br /&gt;
the location &amp;lt;code&amp;gt;~/src/uhd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Installing the FPGA Tools===&lt;br /&gt;
&lt;br /&gt;
In order to build the FPGA image for the intended USRP product, you will need&lt;br /&gt;
to have the Xilinx development tools installed. The specific version required&lt;br /&gt;
depends on the UHD version. Refer to the&lt;br /&gt;
[https://files.ettus.com/manual/md_usrp3_build_instructions.html manual] for the&lt;br /&gt;
correct version for your UHD version, and the installation instructions for&lt;br /&gt;
Vivado in order to install these tools. It is recommended that you use the&lt;br /&gt;
default install location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Building the FPGA===&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Most bitfiles already include the replay block! This section is&lt;br /&gt;
only relevant if you want to build your own bitfile, or the bitfile you're using&lt;br /&gt;
does not contain the replay block already.&lt;br /&gt;
&lt;br /&gt;
In order to use the Replay block, it must be built into the FPGA image for the&lt;br /&gt;
USRP you plan to use. This is currently a manual step. The instructions below&lt;br /&gt;
are for the X310, but similar instructions apply to other RFNoC-capable&lt;br /&gt;
devices.&lt;br /&gt;
&lt;br /&gt;
To create a custom FPGA image with a replay, you need to create an image core file.&lt;br /&gt;
The following lines are the relevant lines from the&lt;br /&gt;
[https://github.com/EttusResearch/uhd/blob/master/fpga/usrp3/top/x300/x310_rfnoc_image_core.yml X310 default image core file]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      # ... all the other stream endpoints...&lt;br /&gt;
      ep4:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
      ep5:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
    &lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      # ... all the other blocks...&lt;br /&gt;
      replay0:&lt;br /&gt;
        block_desc: 'replay.yml'&lt;br /&gt;
        parameters:&lt;br /&gt;
          NUM_PORTS: 2&lt;br /&gt;
          MEM_ADDR_W: 30&lt;br /&gt;
    &lt;br /&gt;
    connections:&lt;br /&gt;
      # ...connections for all the other blocks...&lt;br /&gt;
      # ep4 to replay0(0)&lt;br /&gt;
      - { srcblk: ep4,     srcport: out0,  dstblk: replay0, dstport: in_0 }&lt;br /&gt;
      # replay0(0) to ep4&lt;br /&gt;
      - { srcblk: replay0, srcport: out_0, dstblk: ep4,     dstport: in0  }&lt;br /&gt;
      # ep5 to replay0(1)&lt;br /&gt;
      - { srcblk: ep5,     srcport: out0,  dstblk: replay0, dstport: in_1 }&lt;br /&gt;
      # replay0(1) to ep5&lt;br /&gt;
      - { srcblk: replay0, srcport: out_1, dstblk: ep5,     dstport: in0  }&lt;br /&gt;
      # BSP Connections&lt;br /&gt;
      - { srcblk: replay0, srcport: axi_ram, dstblk: _device_, dstport: dram }&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      # ...all other clock domains...&lt;br /&gt;
      - { srcblk: _device_, srcport: dram,  dstblk: replay0, dstport: mem  }&lt;br /&gt;
&lt;br /&gt;
As you can see, the replay block requires configuration in up to four sections:&lt;br /&gt;
* For maximum flexibility, every port of the replay block will receive its own stream endpoint. This is not a requirement of the replay block, but allows its flexible use.&lt;br /&gt;
* Of course, the block needs to be declared in the &amp;lt;code&amp;gt;noc_blocks&amp;lt;/code&amp;gt; section. The blocks contain two parameters, NUM_PORTS, and MEM_ADDR_W. The former is the number of ports this RFNoC block may have. The latter is the width of the memory address word, i.e., it is log2(memory_size).&lt;br /&gt;
* It must be connected to the stream endpoints in the &amp;lt;code&amp;gt;connections&amp;lt;/code&amp;gt; section, as well as to the DRAM banks (BSP connection).&lt;br /&gt;
* Finally, the clock domain needs to be connected.&lt;br /&gt;
&lt;br /&gt;
All devices have limits regarding the number of ports and the memory size. The following values may not be exceeded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
E310:&lt;br /&gt;
    NUM_PORTS: 2&lt;br /&gt;
    MEM_ADDR_W: 29&lt;br /&gt;
E320:&lt;br /&gt;
    NUM_PORTS: 4&lt;br /&gt;
    MEM_ADDR_W: 31&lt;br /&gt;
N3xx:&lt;br /&gt;
    NUM_PORTS: 4&lt;br /&gt;
    MEM_ADDR_W: 31&lt;br /&gt;
X310:&lt;br /&gt;
    NUM_PORTS: 2&lt;br /&gt;
    MEM_ADDR_W: 30&lt;br /&gt;
X410:&lt;br /&gt;
    NUM_PORTS: 4&lt;br /&gt;
    MEM_ADDR_W: 32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the YAML image core file is complete, save it, e.g., as x310_replay_image_core.yml,&lt;br /&gt;
and pass it to the image builder:&lt;br /&gt;
&lt;br /&gt;
    rfnoc_image_builder -y x310_replay_image_core.yml [ --fpga-dir ~/usr/uhd/fpga ]&lt;br /&gt;
&lt;br /&gt;
This will create a bitfile that contains the replay block. It can be loaded onto&lt;br /&gt;
the device using the &amp;lt;code&amp;gt;uhd_image_loader&amp;lt;/code&amp;gt; tool:&lt;br /&gt;
&lt;br /&gt;
    uhd_image_loader --args type=x300,addr=&amp;lt;ip address&amp;gt; --fpga-path=/path/to/usrp_x310_fpga_HG.bit&lt;br /&gt;
&lt;br /&gt;
When this is complete, the replay block is ready to use.&lt;br /&gt;
&lt;br /&gt;
==Source files==&lt;br /&gt;
&lt;br /&gt;
For reference, the following files implement the replay block:&lt;br /&gt;
&lt;br /&gt;
* Verilog/HDL sources: https://github.com/EttusResearch/uhd/tree/master/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_replay&lt;br /&gt;
* C++ Block controller sources (header, block controller, Python bindings, unit tests):&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/include/uhd/rfnoc/replay_block_control.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control.cpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control_python.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/tests/rfnoc_block_tests/replay_block_test.cpp&lt;br /&gt;
* Example: https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5290</id>
		<title>Using the RFNoC Replay Block in UHD 4</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5290"/>
				<updated>2022-03-01T12:19:04Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-642b'''&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
This application note guides a user through basic use of the RFNoC Replay block&lt;br /&gt;
in UHD 4.x and explains how to run the UHD Replay example. This example covers&lt;br /&gt;
the USRP X410, X310/X300, N300/N310/N320 and E320 devices. For UHD 3.x, please&lt;br /&gt;
refer to [[Using_the_RFNoC_Replay_Block|the UHD 3.x replay block Application Note]].&lt;br /&gt;
&lt;br /&gt;
An introduction to RFNoC with UHD 4.0 and above can be found [[Getting_Started_with_RFNoC_in_UHD_4.0|here]].&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
The Replay block is an RFNoC block that allows recording and playback of&lt;br /&gt;
arbitrary data using DRAM on the USRP hardware as a buffer. To use the Replay&lt;br /&gt;
block, it must be instantiated in the design and connected to the DRAM interface.&lt;br /&gt;
&lt;br /&gt;
The replay block is a standard feature of UHD and RFNoC, and a custom compile of&lt;br /&gt;
UHD is not required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs, so when using these images,&lt;br /&gt;
the following examples can be run without any manual builds of UHD or FPGA images.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
To follow this application note, you need a device with a replay block instantiated,&lt;br /&gt;
and a UHD version recent enough to have the full support for the replay block&lt;br /&gt;
(UHD 4.2 and beyond). To test for the replay block capabilities, connect and&lt;br /&gt;
enable your USRP device, and run the following command:&lt;br /&gt;
&lt;br /&gt;
    uhd_usrp_probe --args &amp;lt;device args&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert the appropriate device args for your device, e.g.&lt;br /&gt;
&lt;br /&gt;
    uhd_usrp_probe --args type=x4xx,addr=192.168.30.2&lt;br /&gt;
&lt;br /&gt;
Depending on your device, the output could look like this (truncated):&lt;br /&gt;
&lt;br /&gt;
     _____________________________________________________&lt;br /&gt;
    /&lt;br /&gt;
    |       Device: X400-Series Device&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Mboard: ni-x4xx-&amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   pid: 1040&lt;br /&gt;
    |   |   rev: 4&lt;br /&gt;
    |   |   rev_compat: 4&lt;br /&gt;
    |   |   serial: &amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   MPM Version: 4.0&lt;br /&gt;
    |   |   FPGA Version: 7.6&lt;br /&gt;
    |   |   FPGA git hash: &amp;lt;hash&amp;gt;.clean&lt;br /&gt;
    |   |   RFNoC capable: Yes&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   Time sources:  internal, external, qsfp0, gpsdo&lt;br /&gt;
    |   |   Clock sources: mboard, internal, external, nsync, gpsdo&lt;br /&gt;
    |   |   Sensors: ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/DDC#0&lt;br /&gt;
    |   |   * 0/DDC#1&lt;br /&gt;
    |   |   * 0/DUC#0&lt;br /&gt;
    |   |   * 0/DUC#1&lt;br /&gt;
    |   |   * 0/Radio#0&lt;br /&gt;
    |   |   * 0/Radio#1&lt;br /&gt;
    |   |   * 0/Replay#0&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/SEP#0:0==&amp;gt;0/DUC#0:0&lt;br /&gt;
    |   |   * 0/DUC#0:0==&amp;gt;0/Radio#0:0&lt;br /&gt;
    |   |   * 0/Radio#0:0==&amp;gt;0/DDC#0:0&lt;br /&gt;
    |   |   * 0/DDC#0:0==&amp;gt;0/SEP#0:0&lt;br /&gt;
    |   |   * 0/SEP#1:0==&amp;gt;0/DUC#0:1&lt;br /&gt;
    |   |   * 0/DUC#0:1==&amp;gt;0/Radio#0:1&lt;br /&gt;
    |   |   * 0/Radio#0:1==&amp;gt;0/DDC#0:1&lt;br /&gt;
    |   |   * 0/DDC#0:1==&amp;gt;0/SEP#1:0&lt;br /&gt;
    |   |   * 0/SEP#2:0==&amp;gt;0/DUC#1:0&lt;br /&gt;
    |   |   * 0/DUC#1:0==&amp;gt;0/Radio#1:0&lt;br /&gt;
    |   |   * 0/Radio#1:0==&amp;gt;0/DDC#1:0&lt;br /&gt;
    |   |   * 0/DDC#1:0==&amp;gt;0/SEP#2:0&lt;br /&gt;
    |   |   * 0/SEP#3:0==&amp;gt;0/DUC#1:1&lt;br /&gt;
    |   |   * 0/DUC#1:1==&amp;gt;0/Radio#1:1&lt;br /&gt;
    |   |   * 0/Radio#1:1==&amp;gt;0/DDC#1:1&lt;br /&gt;
    |   |   * 0/DDC#1:1==&amp;gt;0/SEP#3:0&lt;br /&gt;
    |   |   * 0/SEP#4:0==&amp;gt;0/Replay#0:0&lt;br /&gt;
    |   |   * 0/Replay#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
    |   |   * 0/SEP#5:0==&amp;gt;0/Replay#0:1&lt;br /&gt;
    |   |   * 0/Replay#0:1==&amp;gt;0/SEP#5:0&lt;br /&gt;
    |   |   * 0/SEP#6:0==&amp;gt;0/Replay#0:2&lt;br /&gt;
    |   |   * 0/Replay#0:2==&amp;gt;0/SEP#6:0&lt;br /&gt;
    |   |   * 0/SEP#7:0==&amp;gt;0/Replay#0:3&lt;br /&gt;
    |   |   * 0/Replay#0:3==&amp;gt;0/SEP#7:0&lt;br /&gt;
&lt;br /&gt;
The output tells us that this USRP has a Replay block instantiated (&amp;lt;code&amp;gt;0/Replay#0&amp;lt;/code&amp;gt;).&lt;br /&gt;
It has four static connections to stream endpoints, which also tells us that&lt;br /&gt;
this is a four-port replay block.&lt;br /&gt;
&lt;br /&gt;
If your device does not report a replay block, then you need to load&lt;br /&gt;
an FPGA image which includes this block. See [[#building_fpga|this section]] for instructions on how to do&lt;br /&gt;
this before you proceed. If it does report a block, you can move to the next&lt;br /&gt;
section.&lt;br /&gt;
&lt;br /&gt;
==Running the Example==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; example assumes that you have a&lt;br /&gt;
file containing the samples you wish to replay. This could be generated in&lt;br /&gt;
advance or recorded using &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt; or another method. For&lt;br /&gt;
this demonstration, we'll create a simple Python program (&amp;lt;code&amp;gt;sample_gen.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
to generate some samples to use:&lt;br /&gt;
&lt;br /&gt;
    import math&lt;br /&gt;
    import struct&lt;br /&gt;
    &lt;br /&gt;
    SAMPLE_RATE = 200.0e6        # Sample rate in Hz&lt;br /&gt;
    FREQUENCY   = 500.0e3        # Frequency of sinusoid to generate, in Hz&lt;br /&gt;
    NUM_SAMPLES = 16000          # Number of samples to generate&lt;br /&gt;
    AMPLITUDE   = 0.5            # Amplitude of the signal (from 0 to 1.0)&lt;br /&gt;
    FILE_NAME   = 'samples.dat'&lt;br /&gt;
    &lt;br /&gt;
    file = open(FILE_NAME, 'wb')&lt;br /&gt;
    &lt;br /&gt;
    for i in range(NUM_SAMPLES):&lt;br /&gt;
        I = int((2**15-1) * AMPLITUDE * math.cos(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        Q = int((2**15-1) * AMPLITUDE * math.sin(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        file.write(struct.pack('&amp;lt;2h', I, Q))&lt;br /&gt;
    &lt;br /&gt;
    file.close()&lt;br /&gt;
&lt;br /&gt;
This program generates a file named &amp;lt;code&amp;gt;samples.dat&amp;lt;/code&amp;gt; that contains 16000&lt;br /&gt;
samples (40 periods) of a 500&amp;amp;nbsp;kHz tone sampled at a rate of 200&amp;amp;nbsp;MHz.&lt;br /&gt;
Each sample is saved in &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt; format (signed complex with 16-bit real&lt;br /&gt;
and 16-bit imaginary components). We can run the program by invoking python from&lt;br /&gt;
the command line.&lt;br /&gt;
&lt;br /&gt;
    $ python ./sample_gen.py&lt;br /&gt;
&lt;br /&gt;
To run the UHD Replay example, enter a command like the following (the path to&lt;br /&gt;
the examples depends on your installation method, for a normal installation via&lt;br /&gt;
apt-get, examples will be located in &amp;lt;code&amp;gt;/usr/lib/uhd/examples&amp;lt;/code&amp;gt; or&lt;br /&gt;
&amp;lt;code&amp;gt;/usr/local/lib/uhd/examples&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
    $ cd /path/to/examples&lt;br /&gt;
    $ ./replay_samples_from_file --args &amp;lt;device args&amp;gt; --freq 915e6 --gain 10 --file samples.dat --rate 200e6&lt;br /&gt;
&lt;br /&gt;
This example would stream the samples from the file to the Replay block on the&lt;br /&gt;
FPGA, where they are recorded into the USRP's on-board DRAM. Then, the Replay block&lt;br /&gt;
will play the samples to the radio continuously with a base frequency of 915 MHz,&lt;br /&gt;
creating a tone at 915.5 MHz. Press &amp;lt;code&amp;gt;Ctrl+C&amp;lt;/code&amp;gt; to stop transmitting.&lt;br /&gt;
Alternatively, use the &amp;lt;code&amp;gt;--nsamps&amp;lt;/code&amp;gt; command line argument to transmit&lt;br /&gt;
a certain number of samples before returning to the command line. Use the&lt;br /&gt;
&amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; argument to see a full list of arguments.&lt;br /&gt;
&lt;br /&gt;
The advantage of this example compared to directly streaming the file to the&lt;br /&gt;
device is twofold:&lt;br /&gt;
&lt;br /&gt;
* The initial upload to DRAM can happen at any link rate. Even when using 1 GbE, this example will work.&lt;br /&gt;
* Once uploaded, the host computer is basically idle. The FPGA will handle the streaming to the radio front-end.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp source code]&lt;br /&gt;
for &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; may be considered an example&lt;br /&gt;
for best practices on how to use the replay block.&lt;br /&gt;
&lt;br /&gt;
==Using the Replay Block==&lt;br /&gt;
&lt;br /&gt;
This block works like a record and playback buffer that uses DRAM on the USRP to&lt;br /&gt;
store samples.&lt;br /&gt;
Data can be streamed to the block, like to any other RFNoC block.&lt;br /&gt;
&lt;br /&gt;
Refer the [https://files.ettus.com/manual/classuhd_1_1rfnoc_1_1replay__block__control.html manual of the replay block controller]&lt;br /&gt;
for a comprehensive description of its features and API calls.&lt;br /&gt;
&lt;br /&gt;
In the following, we shall use the C++ API to demonstrate the most important&lt;br /&gt;
API calls. We will assume there is a replay block controller called&lt;br /&gt;
&amp;lt;code&amp;gt;replay_ctrl&amp;lt;/code&amp;gt; available in the current context, and it is of type&lt;br /&gt;
&amp;lt;code&amp;gt;uhd::rfnoc::replay_block_control::sptr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Recording Data===&lt;br /&gt;
&lt;br /&gt;
Before streaming data to the replay block, it needs to be configured for recording:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record(buffer_start_byte_address, buffer_size_in_bytes, replay_chan);&lt;br /&gt;
&lt;br /&gt;
This tells the Replay block that it should start recording any data it receives&lt;br /&gt;
on port &amp;lt;code&amp;gt;port&amp;lt;/code&amp;gt; into the DRAM at byte offset &amp;lt;code&amp;gt;buffer_start_byte_address&amp;lt;/code&amp;gt;&lt;br /&gt;
and should use up to &amp;lt;code&amp;gt;buffer_size_in_bytes&amp;lt;/code&amp;gt; bytes. Once the buffer is&lt;br /&gt;
filled, recording automatically stops. Care should be taken to configure the&lt;br /&gt;
memory buffers so that they do not overlap if more than one Replay block or&lt;br /&gt;
buffer is being used simultaneously.&lt;br /&gt;
&lt;br /&gt;
Call this once for every port that you expect to stream data into.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Care should be taken to not transfer more data to the Replay block&lt;br /&gt;
than the size of the record buffer. Additional data is not accepted or dropped&lt;br /&gt;
by the replay block, but flow control will cause data to back up in the RF network on the FPGA.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The amount of memory available to the Replay block is limited by the&lt;br /&gt;
size of the DRAM on the USRP and how the memory interface is configured on the USRP.&lt;br /&gt;
By default, we expose the entire memory of the device, but it is possible to modify&lt;br /&gt;
&amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; if less memory should be made accessible.&lt;br /&gt;
&lt;br /&gt;
Devices have the following amount of memory:&lt;br /&gt;
{|&lt;br /&gt;
|E310&lt;br /&gt;
|512 MiB&lt;br /&gt;
|-&lt;br /&gt;
|E320&lt;br /&gt;
|2 GiB&lt;br /&gt;
|-&lt;br /&gt;
|N3xx&lt;br /&gt;
|2 GiB&lt;br /&gt;
|-&lt;br /&gt;
|X310&lt;br /&gt;
|1 GiB&lt;br /&gt;
|-&lt;br /&gt;
|X410&lt;br /&gt;
|4 GiB per bank (note: not all banks may be connected)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The currently available memory can be queried using the block controller and the &lt;br /&gt;
&amp;lt;code&amp;gt;get_mem_size()&amp;lt;/code&amp;gt; API call.&lt;br /&gt;
&lt;br /&gt;
To restart recording from the same offset, the following API call can be used:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record_restart(replay_chan);&lt;br /&gt;
&lt;br /&gt;
This resets the record pointer to point back to the beginning of the buffer and&lt;br /&gt;
it resets the internal counters that track how much data has been recorded. If&lt;br /&gt;
a previous recording has taken place then it is a good idea to ensure that&lt;br /&gt;
stale data was not queued up in the RF network on the FPGA from a previous run.&lt;br /&gt;
The &amp;lt;code&amp;gt;replay_samples_from_file&amp;lt;/code&amp;gt; example does this by calling&lt;br /&gt;
&amp;lt;code&amp;gt;record_restart()&amp;lt;/code&amp;gt; then waiting to see if any new data shows up&lt;br /&gt;
unexpectedly in the record buffer. If so, it restarts recording then waits&lt;br /&gt;
again to see if data continues to appear.&lt;br /&gt;
&lt;br /&gt;
You can determine when all data has been received by checking the status of the&lt;br /&gt;
record fullness.&lt;br /&gt;
&lt;br /&gt;
    // Wait for recording to complete&lt;br /&gt;
    while (replay_ctrl-&amp;gt;get_record_fullness(replay_chan) &amp;lt; num_bytes_expected)&lt;br /&gt;
        std::this_thread::sleep_for(100ms);&lt;br /&gt;
&lt;br /&gt;
===Playing Back Data===&lt;br /&gt;
&lt;br /&gt;
Prior to playing back recorded data, it is necessary to configure the base&lt;br /&gt;
address and size of the playback buffer. To play back previously recorded data,&lt;br /&gt;
set the start address to the same address that was used for the record buffer&lt;br /&gt;
and set the size of the playback buffer to the match the amount of data that&lt;br /&gt;
was recorded. Note that the record and playback buffers do not need to be the&lt;br /&gt;
same, allowing a single Replay block to both record and playback to different&lt;br /&gt;
regions of memory simultaneously.&lt;br /&gt;
&lt;br /&gt;
    // Configure the Replay block to play back everything that was recorded&lt;br /&gt;
    num_bytes_recorded = replay_ctrl-&amp;gt;get_record_fullness(replay_chan);&lt;br /&gt;
    replay_ctrl-&amp;gt;config_play(buffer_start_byte_address, num_bytes_recorded, replay_chan);&lt;br /&gt;
&lt;br /&gt;
To play back the data in the playback buffer, issue the appropriate UHD stream command.&lt;br /&gt;
Playback automatically wraps around to the start of the buffer if more data is&lt;br /&gt;
requested than the size of the playback buffer.&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;STREAM_MODE_START_CONTINUOUS&amp;lt;/code&amp;gt; causes playback to continue indefinitely&lt;br /&gt;
until explicitly stopped. &amp;lt;code&amp;gt;STREAM_MODE_NUM_SAMPS_AND_DONE&amp;lt;/code&amp;gt; causes only&lt;br /&gt;
the specified number of samples to be played once. Playback can be stopped by issuing&lt;br /&gt;
 a stop command.&lt;br /&gt;
&lt;br /&gt;
    stream_cmd.stream_mode = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd);&lt;br /&gt;
&lt;br /&gt;
This will stop playback at the end of the next DRAM read after the command is&lt;br /&gt;
received (DRAM reads are not aborted mid-transaction). As a result, some data&lt;br /&gt;
will continue to stream from the Replay block after the stop command is issued&lt;br /&gt;
while waiting for the DRAM read to complete and for all the internal buffers to&lt;br /&gt;
empty.&lt;br /&gt;
&lt;br /&gt;
When using the C++ API, the &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; API call is a useful shorthand&lt;br /&gt;
for configuring playback and submitting the stream command at the same time:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;play(buffer_start_byte_address, num_bytes_to_play, replay_chan, start_time, repeat);&lt;br /&gt;
&lt;br /&gt;
In either case, the start time is optional. When given, the first sample to leave&lt;br /&gt;
the block on playback is tagged with this timestamp.&lt;br /&gt;
&lt;br /&gt;
===Memory Alignment and Word Sizes===&lt;br /&gt;
&lt;br /&gt;
There are two memory alignment values that need to be considered when dealing&lt;br /&gt;
with the replay block. The first is the word size, which is the minimum number of&lt;br /&gt;
bytes per DRAM transaction. For all default configurations, the word size is 64 bits,&lt;br /&gt;
which means that only even numbers of samples can be recorded or played back&lt;br /&gt;
when using 16-bit complex samples (at 4 bytes per sample). Use the &amp;lt;code&amp;gt;get_word_size()&amp;lt;/code&amp;gt;&lt;br /&gt;
API call to identify the correct word size.&lt;br /&gt;
&lt;br /&gt;
The second alignment value is the memory's page boundaries. The start addresses&lt;br /&gt;
for record and replay must fall onto a 4 kiB memory boundary to ensure correct&lt;br /&gt;
alignment of data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;building_fpga&amp;quot;&amp;gt;&lt;br /&gt;
==Building Custom FPGA Images with a Replay Block==&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configure the Default Shell===&lt;br /&gt;
&lt;br /&gt;
Before you begin, make sure you are using the &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt; shell. See [[Software_Development_on_the_E3xx_USRP_-_Building_RFNoC_UHD_/_GNU_Radio_/_gr-ettus_from_Source#Reconfigure_Default_Shell|Reconfigure Default Shell]] in AN-315 for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
===Cloning the Repository===&lt;br /&gt;
&lt;br /&gt;
Note: Cloning the repository is only required when building custom FPGA images.&lt;br /&gt;
If the replay block is already built into the USRP's bit file, this is not&lt;br /&gt;
required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs.&lt;br /&gt;
&lt;br /&gt;
If you do require access to the source code, e.g. to build an FPGA image with a&lt;br /&gt;
custom replay block configuration, run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/EttusResearch/uhd.git&lt;br /&gt;
&lt;br /&gt;
For the rest of the Application Note, we assume the repository was cloned into&lt;br /&gt;
the location &amp;lt;code&amp;gt;~/src/uhd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Installing the FPGA Tools===&lt;br /&gt;
&lt;br /&gt;
In order to build the FPGA image for the intended USRP product, you will need&lt;br /&gt;
to have the Xilinx development tools installed. The specific version required&lt;br /&gt;
depends on the UHD version. Refer to the&lt;br /&gt;
[https://files.ettus.com/manual/md_usrp3_build_instructions.html manual] for the&lt;br /&gt;
correct version for your UHD version, and the installation instructions for&lt;br /&gt;
Vivado in order to install these tools. It is recommended that you use the&lt;br /&gt;
default install location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Building the FPGA===&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Most bitfiles already include the replay block! This section is&lt;br /&gt;
only relevant if you want to build your own bitfile, or the bitfile you're using&lt;br /&gt;
does not contain the replay block already.&lt;br /&gt;
&lt;br /&gt;
In order to use the Replay block, it must be built into the FPGA image for the&lt;br /&gt;
USRP you plan to use. This is currently a manual step. The instructions below&lt;br /&gt;
are for the X310, but similar instructions apply to other RFNoC-capable&lt;br /&gt;
devices.&lt;br /&gt;
&lt;br /&gt;
To create a custom FPGA image with a replay, you need to create an image core file.&lt;br /&gt;
The following lines are the relevant lines from the&lt;br /&gt;
[https://github.com/EttusResearch/uhd/blob/master/fpga/usrp3/top/x300/x310_rfnoc_image_core.yml X310 default image core file]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      # ... all the other stream endpoints...&lt;br /&gt;
      ep4:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
      ep5:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
    &lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      # ... all the other blocks...&lt;br /&gt;
      replay0:&lt;br /&gt;
        block_desc: 'replay.yml'&lt;br /&gt;
        parameters:&lt;br /&gt;
          NUM_PORTS: 2&lt;br /&gt;
          MEM_ADDR_W: 30&lt;br /&gt;
    &lt;br /&gt;
    connections:&lt;br /&gt;
      # ...connections for all the other blocks...&lt;br /&gt;
      # ep4 to replay0(0)&lt;br /&gt;
      - { srcblk: ep4,     srcport: out0,  dstblk: replay0, dstport: in_0 }&lt;br /&gt;
      # replay0(0) to ep4&lt;br /&gt;
      - { srcblk: replay0, srcport: out_0, dstblk: ep4,     dstport: in0  }&lt;br /&gt;
      # ep5 to replay0(1)&lt;br /&gt;
      - { srcblk: ep5,     srcport: out0,  dstblk: replay0, dstport: in_1 }&lt;br /&gt;
      # replay0(1) to ep5&lt;br /&gt;
      - { srcblk: replay0, srcport: out_1, dstblk: ep5,     dstport: in0  }&lt;br /&gt;
      # BSP Connections&lt;br /&gt;
      - { srcblk: replay0, srcport: axi_ram, dstblk: _device_, dstport: dram }&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      # ...all other clock domains...&lt;br /&gt;
      - { srcblk: _device_, srcport: dram,  dstblk: replay0, dstport: mem  }&lt;br /&gt;
&lt;br /&gt;
As you can see, the replay block requires configuration in up to four sections:&lt;br /&gt;
* For maximum flexibility, every port of the replay block will receive its own stream endpoint. This is not a requirement of the replay block, but allows its flexible use.&lt;br /&gt;
* Of course, the block needs to be declared in the &amp;lt;code&amp;gt;noc_blocks&amp;lt;/code&amp;gt; section. The blocks contain two parameters, NUM_PORTS, and MEM_ADDR_W. The former is the number of ports this RFNoC block may have. The latter is the width of the memory address word, i.e., it is log2(memory_size).&lt;br /&gt;
* It must be connected to the stream endpoints in the &amp;lt;code&amp;gt;connections&amp;lt;/code&amp;gt; section, as well as to the DRAM banks (BSP connection).&lt;br /&gt;
* Finally, the clock domain needs to be connected.&lt;br /&gt;
&lt;br /&gt;
All devices have limits regarding the number of ports and the memory size. The following values may not be exceeded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
E310:&lt;br /&gt;
    NUM_PORTS: 2&lt;br /&gt;
    MEM_ADDR_W: 29&lt;br /&gt;
E320:&lt;br /&gt;
    NUM_PORTS: 4&lt;br /&gt;
    MEM_ADDR_W: 31&lt;br /&gt;
N3xx:&lt;br /&gt;
    NUM_PORTS: 4&lt;br /&gt;
    MEM_ADDR_W: 31&lt;br /&gt;
X310:&lt;br /&gt;
    NUM_PORTS: 2&lt;br /&gt;
    MEM_ADDR_W: 30&lt;br /&gt;
X410:&lt;br /&gt;
    NUM_PORTS: 4&lt;br /&gt;
    MEM_ADDR_W: 32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the YAML image core file is complete, save it, e.g., as x310_replay_image_core.yml,&lt;br /&gt;
and pass it to the image builder:&lt;br /&gt;
&lt;br /&gt;
    rfnoc_image_builder -y x310_replay_image_core.yml [ --fpga-dir ~/usr/uhd/fpga ]&lt;br /&gt;
&lt;br /&gt;
This will create a bitfile that contains the replay block. It can be loaded onto&lt;br /&gt;
the device using the &amp;lt;code&amp;gt;uhd_image_loader&amp;lt;/code&amp;gt; tool:&lt;br /&gt;
&lt;br /&gt;
    uhd_image_loader --args type=x300,addr=&amp;lt;ip address&amp;gt; --fpga-path=/path/to/usrp_x310_fpga_HG.bit&lt;br /&gt;
&lt;br /&gt;
When this is complete, the replay block is ready to use.&lt;br /&gt;
&lt;br /&gt;
==Source files==&lt;br /&gt;
&lt;br /&gt;
For reference, the following files implement the replay block:&lt;br /&gt;
&lt;br /&gt;
* Verilog/HDL sources: https://github.com/EttusResearch/uhd/tree/master/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_replay&lt;br /&gt;
* C++ Block controller sources (header, block controller, Python bindings, unit tests):&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/include/uhd/rfnoc/replay_block_control.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control.cpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control_python.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/tests/rfnoc_block_tests/replay_block_test.cpp&lt;br /&gt;
* Example: https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5289</id>
		<title>Using the RFNoC Replay Block in UHD 4</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5289"/>
				<updated>2022-03-01T12:16:31Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* Building the FPGA */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-642b'''&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
This application note guides a user through basic use of the RFNoC Replay block&lt;br /&gt;
in UHD 4.x and explains how to run the UHD Replay example. This example covers&lt;br /&gt;
the USRP X410, X310/X300, N300/N310/N320 and E320 devices. For UHD 3.x, please&lt;br /&gt;
refer to [[Using_the_RFNoC_Replay_Block|the UHD 3.x replay block Application Note]].&lt;br /&gt;
&lt;br /&gt;
An introduction to RFNoC with UHD 4.0 and above can be found [[Getting_Started_with_RFNoC_in_UHD_4.0|here]].&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
The Replay block is an RFNoC block that allows recording and playback of&lt;br /&gt;
arbitrary data using DRAM on the USRP hardware as a buffer. To use the Replay&lt;br /&gt;
block, it must be instantiated in the design and connected to the DRAM interface.&lt;br /&gt;
&lt;br /&gt;
The replay block is a standard feature of UHD and RFNoC, and a custom compile of&lt;br /&gt;
UHD is not required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs, so when using these images,&lt;br /&gt;
the following examples can be run without any manual builds of UHD or FPGA images.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
To follow this application note, you need a device with a replay block instantiated,&lt;br /&gt;
and a UHD version recent enough to have the full support for the replay block&lt;br /&gt;
(UHD 4.2 and beyond). To test for the replay block capabilities, connect and&lt;br /&gt;
enable your USRP device, and run the following command:&lt;br /&gt;
&lt;br /&gt;
    uhd_usrp_probe --args &amp;lt;device args&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert the appropriate device args for your device, e.g.&lt;br /&gt;
&lt;br /&gt;
    uhd_usrp_probe --args type=x4xx,addr=192.168.30.2&lt;br /&gt;
&lt;br /&gt;
Depending on your device, the output could look like this (truncated):&lt;br /&gt;
&lt;br /&gt;
     _____________________________________________________&lt;br /&gt;
    /&lt;br /&gt;
    |       Device: X400-Series Device&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Mboard: ni-x4xx-&amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   pid: 1040&lt;br /&gt;
    |   |   rev: 4&lt;br /&gt;
    |   |   rev_compat: 4&lt;br /&gt;
    |   |   serial: &amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   MPM Version: 4.0&lt;br /&gt;
    |   |   FPGA Version: 7.6&lt;br /&gt;
    |   |   FPGA git hash: &amp;lt;hash&amp;gt;.clean&lt;br /&gt;
    |   |   RFNoC capable: Yes&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   Time sources:  internal, external, qsfp0, gpsdo&lt;br /&gt;
    |   |   Clock sources: mboard, internal, external, nsync, gpsdo&lt;br /&gt;
    |   |   Sensors: ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/DDC#0&lt;br /&gt;
    |   |   * 0/DDC#1&lt;br /&gt;
    |   |   * 0/DUC#0&lt;br /&gt;
    |   |   * 0/DUC#1&lt;br /&gt;
    |   |   * 0/Radio#0&lt;br /&gt;
    |   |   * 0/Radio#1&lt;br /&gt;
    |   |   * 0/Replay#0&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/SEP#0:0==&amp;gt;0/DUC#0:0&lt;br /&gt;
    |   |   * 0/DUC#0:0==&amp;gt;0/Radio#0:0&lt;br /&gt;
    |   |   * 0/Radio#0:0==&amp;gt;0/DDC#0:0&lt;br /&gt;
    |   |   * 0/DDC#0:0==&amp;gt;0/SEP#0:0&lt;br /&gt;
    |   |   * 0/SEP#1:0==&amp;gt;0/DUC#0:1&lt;br /&gt;
    |   |   * 0/DUC#0:1==&amp;gt;0/Radio#0:1&lt;br /&gt;
    |   |   * 0/Radio#0:1==&amp;gt;0/DDC#0:1&lt;br /&gt;
    |   |   * 0/DDC#0:1==&amp;gt;0/SEP#1:0&lt;br /&gt;
    |   |   * 0/SEP#2:0==&amp;gt;0/DUC#1:0&lt;br /&gt;
    |   |   * 0/DUC#1:0==&amp;gt;0/Radio#1:0&lt;br /&gt;
    |   |   * 0/Radio#1:0==&amp;gt;0/DDC#1:0&lt;br /&gt;
    |   |   * 0/DDC#1:0==&amp;gt;0/SEP#2:0&lt;br /&gt;
    |   |   * 0/SEP#3:0==&amp;gt;0/DUC#1:1&lt;br /&gt;
    |   |   * 0/DUC#1:1==&amp;gt;0/Radio#1:1&lt;br /&gt;
    |   |   * 0/Radio#1:1==&amp;gt;0/DDC#1:1&lt;br /&gt;
    |   |   * 0/DDC#1:1==&amp;gt;0/SEP#3:0&lt;br /&gt;
    |   |   * 0/SEP#4:0==&amp;gt;0/Replay#0:0&lt;br /&gt;
    |   |   * 0/Replay#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
    |   |   * 0/SEP#5:0==&amp;gt;0/Replay#0:1&lt;br /&gt;
    |   |   * 0/Replay#0:1==&amp;gt;0/SEP#5:0&lt;br /&gt;
    |   |   * 0/SEP#6:0==&amp;gt;0/Replay#0:2&lt;br /&gt;
    |   |   * 0/Replay#0:2==&amp;gt;0/SEP#6:0&lt;br /&gt;
    |   |   * 0/SEP#7:0==&amp;gt;0/Replay#0:3&lt;br /&gt;
    |   |   * 0/Replay#0:3==&amp;gt;0/SEP#7:0&lt;br /&gt;
&lt;br /&gt;
The output tells us that this USRP has a Replay block instantiated (&amp;lt;code&amp;gt;0/Replay#0&amp;lt;/code&amp;gt;).&lt;br /&gt;
It has four static connections to stream endpoints, which also tells us that&lt;br /&gt;
this is a four-port replay block.&lt;br /&gt;
&lt;br /&gt;
If your device does not report a replay block, then you need to load&lt;br /&gt;
an FPGA image which includes this block. See ... for instructions on how to do&lt;br /&gt;
this before you proceed. If it does report a block, you can move to the next&lt;br /&gt;
section.&lt;br /&gt;
&lt;br /&gt;
==Running the Example==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; example assumes that you have a&lt;br /&gt;
file containing the samples you wish to replay. This could be generated in&lt;br /&gt;
advance or recorded using &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt; or another method. For&lt;br /&gt;
this demonstration, we'll create a simple Python program (&amp;lt;code&amp;gt;sample_gen.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
to generate some samples to use:&lt;br /&gt;
&lt;br /&gt;
    import math&lt;br /&gt;
    import struct&lt;br /&gt;
    &lt;br /&gt;
    SAMPLE_RATE = 200.0e6        # Sample rate in Hz&lt;br /&gt;
    FREQUENCY   = 500.0e3        # Frequency of sinusoid to generate, in Hz&lt;br /&gt;
    NUM_SAMPLES = 16000          # Number of samples to generate&lt;br /&gt;
    AMPLITUDE   = 0.5            # Amplitude of the signal (from 0 to 1.0)&lt;br /&gt;
    FILE_NAME   = 'samples.dat'&lt;br /&gt;
    &lt;br /&gt;
    file = open(FILE_NAME, 'wb')&lt;br /&gt;
    &lt;br /&gt;
    for i in range(NUM_SAMPLES):&lt;br /&gt;
        I = int((2**15-1) * AMPLITUDE * math.cos(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        Q = int((2**15-1) * AMPLITUDE * math.sin(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        file.write(struct.pack('&amp;lt;2h', I, Q))&lt;br /&gt;
    &lt;br /&gt;
    file.close()&lt;br /&gt;
&lt;br /&gt;
This program generates a file named &amp;lt;code&amp;gt;samples.dat&amp;lt;/code&amp;gt; that contains 16000&lt;br /&gt;
samples (40 periods) of a 500&amp;amp;nbsp;kHz tone sampled at a rate of 200&amp;amp;nbsp;MHz.&lt;br /&gt;
Each sample is saved in &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt; format (signed complex with 16-bit real&lt;br /&gt;
and 16-bit imaginary components). We can run the program by invoking python from&lt;br /&gt;
the command line.&lt;br /&gt;
&lt;br /&gt;
    $ python ./sample_gen.py&lt;br /&gt;
&lt;br /&gt;
To run the UHD Replay example, enter a command like the following (the path to&lt;br /&gt;
the examples depends on your installation method, for a normal installation via&lt;br /&gt;
apt-get, examples will be located in &amp;lt;code&amp;gt;/usr/lib/uhd/examples&amp;lt;/code&amp;gt; or&lt;br /&gt;
&amp;lt;code&amp;gt;/usr/local/lib/uhd/examples&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
    $ cd /path/to/examples&lt;br /&gt;
    $ ./replay_samples_from_file --args &amp;lt;device args&amp;gt; --freq 915e6 --gain 10 --file samples.dat --rate 200e6&lt;br /&gt;
&lt;br /&gt;
This example would stream the samples from the file to the Replay block on the&lt;br /&gt;
FPGA, where they are recorded into the USRP's on-board DRAM. Then, the Replay block&lt;br /&gt;
will play the samples to the radio continuously with a base frequency of 915 MHz,&lt;br /&gt;
creating a tone at 915.5 MHz. Press &amp;lt;code&amp;gt;Ctrl+C&amp;lt;/code&amp;gt; to stop transmitting.&lt;br /&gt;
Alternatively, use the &amp;lt;code&amp;gt;--nsamps&amp;lt;/code&amp;gt; command line argument to transmit&lt;br /&gt;
a certain number of samples before returning to the command line. Use the&lt;br /&gt;
&amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; argument to see a full list of arguments.&lt;br /&gt;
&lt;br /&gt;
The advantage of this example compared to directly streaming the file to the&lt;br /&gt;
device is twofold:&lt;br /&gt;
&lt;br /&gt;
* The initial upload to DRAM can happen at any link rate. Even when using 1 GbE, this example will work.&lt;br /&gt;
* Once uploaded, the host computer is basically idle. The FPGA will handle the streaming to the radio front-end.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp source code]&lt;br /&gt;
for &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; may be considered an example&lt;br /&gt;
for best practices on how to use the replay block.&lt;br /&gt;
&lt;br /&gt;
==Using the Replay Block==&lt;br /&gt;
&lt;br /&gt;
This block works like a record and playback buffer that uses DRAM on the USRP to&lt;br /&gt;
store samples.&lt;br /&gt;
Data can be streamed to the block, like to any other RFNoC block.&lt;br /&gt;
&lt;br /&gt;
Refer the [https://files.ettus.com/manual/classuhd_1_1rfnoc_1_1replay__block__control.html manual of the replay block controller]&lt;br /&gt;
for a comprehensive description of its features and API calls.&lt;br /&gt;
&lt;br /&gt;
In the following, we shall use the C++ API to demonstrate the most important&lt;br /&gt;
API calls. We will assume there is a replay block controller called&lt;br /&gt;
&amp;lt;code&amp;gt;replay_ctrl&amp;lt;/code&amp;gt; available in the current context, and it is of type&lt;br /&gt;
&amp;lt;code&amp;gt;uhd::rfnoc::replay_block_control::sptr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Recording Data===&lt;br /&gt;
&lt;br /&gt;
Before streaming data to the replay block, it needs to be configured for recording:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record(buffer_start_byte_address, buffer_size_in_bytes, replay_chan);&lt;br /&gt;
&lt;br /&gt;
This tells the Replay block that it should start recording any data it receives&lt;br /&gt;
on port &amp;lt;code&amp;gt;port&amp;lt;/code&amp;gt; into the DRAM at byte offset &amp;lt;code&amp;gt;buffer_start_byte_address&amp;lt;/code&amp;gt;&lt;br /&gt;
and should use up to &amp;lt;code&amp;gt;buffer_size_in_bytes&amp;lt;/code&amp;gt; bytes. Once the buffer is&lt;br /&gt;
filled, recording automatically stops. Care should be taken to configure the&lt;br /&gt;
memory buffers so that they do not overlap if more than one Replay block or&lt;br /&gt;
buffer is being used simultaneously.&lt;br /&gt;
&lt;br /&gt;
Call this once for every port that you expect to stream data into.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Care should be taken to not transfer more data to the Replay block&lt;br /&gt;
than the size of the record buffer. Additional data is not accepted or dropped&lt;br /&gt;
by the replay block, but flow control will cause data to back up in the RF network on the FPGA.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The amount of memory available to the Replay block is limited by the&lt;br /&gt;
size of the DRAM on the USRP and how the memory interface is configured on the USRP.&lt;br /&gt;
By default, we expose the entire memory of the device, but it is possible to modify&lt;br /&gt;
&amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; if less memory should be made accessible.&lt;br /&gt;
&lt;br /&gt;
Devices have the following amount of memory:&lt;br /&gt;
{|&lt;br /&gt;
|E310&lt;br /&gt;
|512 MiB&lt;br /&gt;
|-&lt;br /&gt;
|E320&lt;br /&gt;
|2 GiB&lt;br /&gt;
|-&lt;br /&gt;
|N3xx&lt;br /&gt;
|2 GiB&lt;br /&gt;
|-&lt;br /&gt;
|X310&lt;br /&gt;
|1 GiB&lt;br /&gt;
|-&lt;br /&gt;
|X410&lt;br /&gt;
|4 GiB per bank (note: not all banks may be connected)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The currently available memory can be queried using the block controller and the &lt;br /&gt;
&amp;lt;code&amp;gt;get_mem_size()&amp;lt;/code&amp;gt; API call.&lt;br /&gt;
&lt;br /&gt;
To restart recording from the same offset, the following API call can be used:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record_restart(replay_chan);&lt;br /&gt;
&lt;br /&gt;
This resets the record pointer to point back to the beginning of the buffer and&lt;br /&gt;
it resets the internal counters that track how much data has been recorded. If&lt;br /&gt;
a previous recording has taken place then it is a good idea to ensure that&lt;br /&gt;
stale data was not queued up in the RF network on the FPGA from a previous run.&lt;br /&gt;
The &amp;lt;code&amp;gt;replay_samples_from_file&amp;lt;/code&amp;gt; example does this by calling&lt;br /&gt;
&amp;lt;code&amp;gt;record_restart()&amp;lt;/code&amp;gt; then waiting to see if any new data shows up&lt;br /&gt;
unexpectedly in the record buffer. If so, it restarts recording then waits&lt;br /&gt;
again to see if data continues to appear.&lt;br /&gt;
&lt;br /&gt;
You can determine when all data has been received by checking the status of the&lt;br /&gt;
record fullness.&lt;br /&gt;
&lt;br /&gt;
    // Wait for recording to complete&lt;br /&gt;
    while (replay_ctrl-&amp;gt;get_record_fullness(replay_chan) &amp;lt; num_bytes_expected)&lt;br /&gt;
        std::this_thread::sleep_for(100ms);&lt;br /&gt;
&lt;br /&gt;
===Playing Back Data===&lt;br /&gt;
&lt;br /&gt;
Prior to playing back recorded data, it is necessary to configure the base&lt;br /&gt;
address and size of the playback buffer. To play back previously recorded data,&lt;br /&gt;
set the start address to the same address that was used for the record buffer&lt;br /&gt;
and set the size of the playback buffer to the match the amount of data that&lt;br /&gt;
was recorded. Note that the record and playback buffers do not need to be the&lt;br /&gt;
same, allowing a single Replay block to both record and playback to different&lt;br /&gt;
regions of memory simultaneously.&lt;br /&gt;
&lt;br /&gt;
    // Configure the Replay block to play back everything that was recorded&lt;br /&gt;
    num_bytes_recorded = replay_ctrl-&amp;gt;get_record_fullness(replay_chan);&lt;br /&gt;
    replay_ctrl-&amp;gt;config_play(buffer_start_byte_address, num_bytes_recorded, replay_chan);&lt;br /&gt;
&lt;br /&gt;
To play back the data in the playback buffer, issue the appropriate UHD stream command.&lt;br /&gt;
Playback automatically wraps around to the start of the buffer if more data is&lt;br /&gt;
requested than the size of the playback buffer.&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;STREAM_MODE_START_CONTINUOUS&amp;lt;/code&amp;gt; causes playback to continue indefinitely&lt;br /&gt;
until explicitly stopped. &amp;lt;code&amp;gt;STREAM_MODE_NUM_SAMPS_AND_DONE&amp;lt;/code&amp;gt; causes only&lt;br /&gt;
the specified number of samples to be played once. Playback can be stopped by issuing&lt;br /&gt;
 a stop command.&lt;br /&gt;
&lt;br /&gt;
    stream_cmd.stream_mode = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd);&lt;br /&gt;
&lt;br /&gt;
This will stop playback at the end of the next DRAM read after the command is&lt;br /&gt;
received (DRAM reads are not aborted mid-transaction). As a result, some data&lt;br /&gt;
will continue to stream from the Replay block after the stop command is issued&lt;br /&gt;
while waiting for the DRAM read to complete and for all the internal buffers to&lt;br /&gt;
empty.&lt;br /&gt;
&lt;br /&gt;
When using the C++ API, the &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; API call is a useful shorthand&lt;br /&gt;
for configuring playback and submitting the stream command at the same time:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;play(buffer_start_byte_address, num_bytes_to_play, replay_chan, start_time, repeat);&lt;br /&gt;
&lt;br /&gt;
In either case, the start time is optional. When given, the first sample to leave&lt;br /&gt;
the block on playback is tagged with this timestamp.&lt;br /&gt;
&lt;br /&gt;
===Memory Alignment and Word Sizes===&lt;br /&gt;
&lt;br /&gt;
There are two memory alignment values that need to be considered when dealing&lt;br /&gt;
with the replay block. The first is the word size, which is the minimum number of&lt;br /&gt;
bytes per DRAM transaction. For all default configurations, the word size is 64 bits,&lt;br /&gt;
which means that only even numbers of samples can be recorded or played back&lt;br /&gt;
when using 16-bit complex samples (at 4 bytes per sample). Use the &amp;lt;code&amp;gt;get_word_size()&amp;lt;/code&amp;gt;&lt;br /&gt;
API call to identify the correct word size.&lt;br /&gt;
&lt;br /&gt;
The second alignment value is the memory's page boundaries. The start addresses&lt;br /&gt;
for record and replay must fall onto a 4 kiB memory boundary to ensure correct&lt;br /&gt;
alignment of data.&lt;br /&gt;
&lt;br /&gt;
==Building Custom FPGA Images with a Replay Block==&lt;br /&gt;
&lt;br /&gt;
===Configure the Default Shell===&lt;br /&gt;
&lt;br /&gt;
Before you begin, make sure you are using the &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt; shell. See [[Software_Development_on_the_E3xx_USRP_-_Building_RFNoC_UHD_/_GNU_Radio_/_gr-ettus_from_Source#Reconfigure_Default_Shell|Reconfigure Default Shell]] in AN-315 for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
===Cloning the Repository===&lt;br /&gt;
&lt;br /&gt;
Note: Cloning the repository is only required when building custom FPGA images.&lt;br /&gt;
If the replay block is already built into the USRP's bit file, this is not&lt;br /&gt;
required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs.&lt;br /&gt;
&lt;br /&gt;
If you do require access to the source code, e.g. to build an FPGA image with a&lt;br /&gt;
custom replay block configuration, run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/EttusResearch/uhd.git&lt;br /&gt;
&lt;br /&gt;
For the rest of the Application Note, we assume the repository was cloned into&lt;br /&gt;
the location &amp;lt;code&amp;gt;~/src/uhd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Installing the FPGA Tools===&lt;br /&gt;
&lt;br /&gt;
In order to build the FPGA image for the intended USRP product, you will need&lt;br /&gt;
to have the Xilinx development tools installed. The specific version required&lt;br /&gt;
depends on the UHD version. Refer to the&lt;br /&gt;
[https://files.ettus.com/manual/md_usrp3_build_instructions.html manual] for the&lt;br /&gt;
correct version for your UHD version, and the installation instructions for&lt;br /&gt;
Vivado in order to install these tools. It is recommended that you use the&lt;br /&gt;
default install location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;building_fpga&amp;quot;&amp;gt;==Building the FPGA==&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Most bitfiles already include the replay block! This section is&lt;br /&gt;
only relevant if you want to build your own bitfile, or the bitfile you're using&lt;br /&gt;
does not contain the replay block already.&lt;br /&gt;
&lt;br /&gt;
In order to use the Replay block, it must be built into the FPGA image for the&lt;br /&gt;
USRP you plan to use. This is currently a manual step. The instructions below&lt;br /&gt;
are for the X310, but similar instructions apply to other RFNoC-capable&lt;br /&gt;
devices.&lt;br /&gt;
&lt;br /&gt;
To create a custom FPGA image with a replay, you need to create an image core file.&lt;br /&gt;
The following lines are the relevant lines from the&lt;br /&gt;
[https://github.com/EttusResearch/uhd/blob/master/fpga/usrp3/top/x300/x310_rfnoc_image_core.yml X310 default image core file]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      # ... all the other stream endpoints...&lt;br /&gt;
      ep4:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
      ep5:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
    &lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      # ... all the other blocks...&lt;br /&gt;
      replay0:&lt;br /&gt;
        block_desc: 'replay.yml'&lt;br /&gt;
        parameters:&lt;br /&gt;
          NUM_PORTS: 2&lt;br /&gt;
          MEM_ADDR_W: 30&lt;br /&gt;
    &lt;br /&gt;
    connections:&lt;br /&gt;
      # ...connections for all the other blocks...&lt;br /&gt;
      # ep4 to replay0(0)&lt;br /&gt;
      - { srcblk: ep4,     srcport: out0,  dstblk: replay0, dstport: in_0 }&lt;br /&gt;
      # replay0(0) to ep4&lt;br /&gt;
      - { srcblk: replay0, srcport: out_0, dstblk: ep4,     dstport: in0  }&lt;br /&gt;
      # ep5 to replay0(1)&lt;br /&gt;
      - { srcblk: ep5,     srcport: out0,  dstblk: replay0, dstport: in_1 }&lt;br /&gt;
      # replay0(1) to ep5&lt;br /&gt;
      - { srcblk: replay0, srcport: out_1, dstblk: ep5,     dstport: in0  }&lt;br /&gt;
      # BSP Connections&lt;br /&gt;
      - { srcblk: replay0, srcport: axi_ram, dstblk: _device_, dstport: dram }&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      # ...all other clock domains...&lt;br /&gt;
      - { srcblk: _device_, srcport: dram,  dstblk: replay0, dstport: mem  }&lt;br /&gt;
&lt;br /&gt;
As you can see, the replay block requires configuration in up to four sections:&lt;br /&gt;
* For maximum flexibility, every port of the replay block will receive its own stream endpoint. This is not a requirement of the replay block, but allows its flexible use.&lt;br /&gt;
* Of course, the block needs to be declared in the &amp;lt;code&amp;gt;noc_blocks&amp;lt;/code&amp;gt; section. The blocks contain two parameters, NUM_PORTS, and MEM_ADDR_W. The former is the number of ports this RFNoC block may have. The latter is the width of the memory address word, i.e., it is log2(memory_size).&lt;br /&gt;
* It must be connected to the stream endpoints in the &amp;lt;code&amp;gt;connections&amp;lt;/code&amp;gt; section, as well as to the DRAM banks (BSP connection).&lt;br /&gt;
* Finally, the clock domain needs to be connected.&lt;br /&gt;
&lt;br /&gt;
All devices have limits regarding the number of ports and the memory size. The following values may not be exceeded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
E310:&lt;br /&gt;
    NUM_PORTS: 2&lt;br /&gt;
    MEM_ADDR_W: 29&lt;br /&gt;
E320:&lt;br /&gt;
    NUM_PORTS: 4&lt;br /&gt;
    MEM_ADDR_W: 31&lt;br /&gt;
N3xx:&lt;br /&gt;
    NUM_PORTS: 4&lt;br /&gt;
    MEM_ADDR_W: 31&lt;br /&gt;
X310:&lt;br /&gt;
    NUM_PORTS: 2&lt;br /&gt;
    MEM_ADDR_W: 30&lt;br /&gt;
X410:&lt;br /&gt;
    NUM_PORTS: 4&lt;br /&gt;
    MEM_ADDR_W: 32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the YAML image core file is complete, save it, e.g., as x310_replay_image_core.yml,&lt;br /&gt;
and pass it to the image builder:&lt;br /&gt;
&lt;br /&gt;
    rfnoc_image_builder -y x310_replay_image_core.yml [ --fpga-dir ~/usr/uhd/fpga ]&lt;br /&gt;
&lt;br /&gt;
This will create a bitfile that contains the replay block. It can be loaded onto&lt;br /&gt;
the device using the &amp;lt;code&amp;gt;uhd_image_loader&amp;lt;/code&amp;gt; tool:&lt;br /&gt;
&lt;br /&gt;
    uhd_image_loader --args type=x300,addr=&amp;lt;ip address&amp;gt; --fpga-path=/path/to/usrp_x310_fpga_HG.bit&lt;br /&gt;
&lt;br /&gt;
When this is complete, the replay block is ready to use.&lt;br /&gt;
&lt;br /&gt;
==Source files==&lt;br /&gt;
&lt;br /&gt;
For reference, the following files implement the replay block:&lt;br /&gt;
&lt;br /&gt;
* Verilog/HDL sources: https://github.com/EttusResearch/uhd/tree/master/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_replay&lt;br /&gt;
* C++ Block controller sources (header, block controller, Python bindings, unit tests):&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/include/uhd/rfnoc/replay_block_control.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control.cpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control_python.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/tests/rfnoc_block_tests/replay_block_test.cpp&lt;br /&gt;
* Example: https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5288</id>
		<title>Using the RFNoC Replay Block in UHD 4</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5288"/>
				<updated>2022-03-01T12:12:51Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-642b'''&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
This application note guides a user through basic use of the RFNoC Replay block&lt;br /&gt;
in UHD 4.x and explains how to run the UHD Replay example. This example covers&lt;br /&gt;
the USRP X410, X310/X300, N300/N310/N320 and E320 devices. For UHD 3.x, please&lt;br /&gt;
refer to [[Using_the_RFNoC_Replay_Block|the UHD 3.x replay block Application Note]].&lt;br /&gt;
&lt;br /&gt;
An introduction to RFNoC with UHD 4.0 and above can be found [[Getting_Started_with_RFNoC_in_UHD_4.0|here]].&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
The Replay block is an RFNoC block that allows recording and playback of&lt;br /&gt;
arbitrary data using DRAM on the USRP hardware as a buffer. To use the Replay&lt;br /&gt;
block, it must be instantiated in the design and connected to the DRAM interface.&lt;br /&gt;
&lt;br /&gt;
The replay block is a standard feature of UHD and RFNoC, and a custom compile of&lt;br /&gt;
UHD is not required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs, so when using these images,&lt;br /&gt;
the following examples can be run without any manual builds of UHD or FPGA images.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
To follow this application note, you need a device with a replay block instantiated,&lt;br /&gt;
and a UHD version recent enough to have the full support for the replay block&lt;br /&gt;
(UHD 4.2 and beyond). To test for the replay block capabilities, connect and&lt;br /&gt;
enable your USRP device, and run the following command:&lt;br /&gt;
&lt;br /&gt;
    uhd_usrp_probe --args &amp;lt;device args&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert the appropriate device args for your device, e.g.&lt;br /&gt;
&lt;br /&gt;
    uhd_usrp_probe --args type=x4xx,addr=192.168.30.2&lt;br /&gt;
&lt;br /&gt;
Depending on your device, the output could look like this (truncated):&lt;br /&gt;
&lt;br /&gt;
     _____________________________________________________&lt;br /&gt;
    /&lt;br /&gt;
    |       Device: X400-Series Device&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Mboard: ni-x4xx-&amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   pid: 1040&lt;br /&gt;
    |   |   rev: 4&lt;br /&gt;
    |   |   rev_compat: 4&lt;br /&gt;
    |   |   serial: &amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   MPM Version: 4.0&lt;br /&gt;
    |   |   FPGA Version: 7.6&lt;br /&gt;
    |   |   FPGA git hash: &amp;lt;hash&amp;gt;.clean&lt;br /&gt;
    |   |   RFNoC capable: Yes&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   Time sources:  internal, external, qsfp0, gpsdo&lt;br /&gt;
    |   |   Clock sources: mboard, internal, external, nsync, gpsdo&lt;br /&gt;
    |   |   Sensors: ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/DDC#0&lt;br /&gt;
    |   |   * 0/DDC#1&lt;br /&gt;
    |   |   * 0/DUC#0&lt;br /&gt;
    |   |   * 0/DUC#1&lt;br /&gt;
    |   |   * 0/Radio#0&lt;br /&gt;
    |   |   * 0/Radio#1&lt;br /&gt;
    |   |   * 0/Replay#0&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/SEP#0:0==&amp;gt;0/DUC#0:0&lt;br /&gt;
    |   |   * 0/DUC#0:0==&amp;gt;0/Radio#0:0&lt;br /&gt;
    |   |   * 0/Radio#0:0==&amp;gt;0/DDC#0:0&lt;br /&gt;
    |   |   * 0/DDC#0:0==&amp;gt;0/SEP#0:0&lt;br /&gt;
    |   |   * 0/SEP#1:0==&amp;gt;0/DUC#0:1&lt;br /&gt;
    |   |   * 0/DUC#0:1==&amp;gt;0/Radio#0:1&lt;br /&gt;
    |   |   * 0/Radio#0:1==&amp;gt;0/DDC#0:1&lt;br /&gt;
    |   |   * 0/DDC#0:1==&amp;gt;0/SEP#1:0&lt;br /&gt;
    |   |   * 0/SEP#2:0==&amp;gt;0/DUC#1:0&lt;br /&gt;
    |   |   * 0/DUC#1:0==&amp;gt;0/Radio#1:0&lt;br /&gt;
    |   |   * 0/Radio#1:0==&amp;gt;0/DDC#1:0&lt;br /&gt;
    |   |   * 0/DDC#1:0==&amp;gt;0/SEP#2:0&lt;br /&gt;
    |   |   * 0/SEP#3:0==&amp;gt;0/DUC#1:1&lt;br /&gt;
    |   |   * 0/DUC#1:1==&amp;gt;0/Radio#1:1&lt;br /&gt;
    |   |   * 0/Radio#1:1==&amp;gt;0/DDC#1:1&lt;br /&gt;
    |   |   * 0/DDC#1:1==&amp;gt;0/SEP#3:0&lt;br /&gt;
    |   |   * 0/SEP#4:0==&amp;gt;0/Replay#0:0&lt;br /&gt;
    |   |   * 0/Replay#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
    |   |   * 0/SEP#5:0==&amp;gt;0/Replay#0:1&lt;br /&gt;
    |   |   * 0/Replay#0:1==&amp;gt;0/SEP#5:0&lt;br /&gt;
    |   |   * 0/SEP#6:0==&amp;gt;0/Replay#0:2&lt;br /&gt;
    |   |   * 0/Replay#0:2==&amp;gt;0/SEP#6:0&lt;br /&gt;
    |   |   * 0/SEP#7:0==&amp;gt;0/Replay#0:3&lt;br /&gt;
    |   |   * 0/Replay#0:3==&amp;gt;0/SEP#7:0&lt;br /&gt;
&lt;br /&gt;
The output tells us that this USRP has a Replay block instantiated (&amp;lt;code&amp;gt;0/Replay#0&amp;lt;/code&amp;gt;).&lt;br /&gt;
It has four static connections to stream endpoints, which also tells us that&lt;br /&gt;
this is a four-port replay block.&lt;br /&gt;
&lt;br /&gt;
If your device does not report a replay block, then you need to load&lt;br /&gt;
an FPGA image which includes this block. See ... for instructions on how to do&lt;br /&gt;
this before you proceed. If it does report a block, you can move to the next&lt;br /&gt;
section.&lt;br /&gt;
&lt;br /&gt;
==Running the Example==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; example assumes that you have a&lt;br /&gt;
file containing the samples you wish to replay. This could be generated in&lt;br /&gt;
advance or recorded using &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt; or another method. For&lt;br /&gt;
this demonstration, we'll create a simple Python program (&amp;lt;code&amp;gt;sample_gen.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
to generate some samples to use:&lt;br /&gt;
&lt;br /&gt;
    import math&lt;br /&gt;
    import struct&lt;br /&gt;
    &lt;br /&gt;
    SAMPLE_RATE = 200.0e6        # Sample rate in Hz&lt;br /&gt;
    FREQUENCY   = 500.0e3        # Frequency of sinusoid to generate, in Hz&lt;br /&gt;
    NUM_SAMPLES = 16000          # Number of samples to generate&lt;br /&gt;
    AMPLITUDE   = 0.5            # Amplitude of the signal (from 0 to 1.0)&lt;br /&gt;
    FILE_NAME   = 'samples.dat'&lt;br /&gt;
    &lt;br /&gt;
    file = open(FILE_NAME, 'wb')&lt;br /&gt;
    &lt;br /&gt;
    for i in range(NUM_SAMPLES):&lt;br /&gt;
        I = int((2**15-1) * AMPLITUDE * math.cos(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        Q = int((2**15-1) * AMPLITUDE * math.sin(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        file.write(struct.pack('&amp;lt;2h', I, Q))&lt;br /&gt;
    &lt;br /&gt;
    file.close()&lt;br /&gt;
&lt;br /&gt;
This program generates a file named &amp;lt;code&amp;gt;samples.dat&amp;lt;/code&amp;gt; that contains 16000&lt;br /&gt;
samples (40 periods) of a 500&amp;amp;nbsp;kHz tone sampled at a rate of 200&amp;amp;nbsp;MHz.&lt;br /&gt;
Each sample is saved in &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt; format (signed complex with 16-bit real&lt;br /&gt;
and 16-bit imaginary components). We can run the program by invoking python from&lt;br /&gt;
the command line.&lt;br /&gt;
&lt;br /&gt;
    $ python ./sample_gen.py&lt;br /&gt;
&lt;br /&gt;
To run the UHD Replay example, enter a command like the following (the path to&lt;br /&gt;
the examples depends on your installation method, for a normal installation via&lt;br /&gt;
apt-get, examples will be located in &amp;lt;code&amp;gt;/usr/lib/uhd/examples&amp;lt;/code&amp;gt; or&lt;br /&gt;
&amp;lt;code&amp;gt;/usr/local/lib/uhd/examples&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
    $ cd /path/to/examples&lt;br /&gt;
    $ ./replay_samples_from_file --args &amp;lt;device args&amp;gt; --freq 915e6 --gain 10 --file samples.dat --rate 200e6&lt;br /&gt;
&lt;br /&gt;
This example would stream the samples from the file to the Replay block on the&lt;br /&gt;
FPGA, where they are recorded into the USRP's on-board DRAM. Then, the Replay block&lt;br /&gt;
will play the samples to the radio continuously with a base frequency of 915 MHz,&lt;br /&gt;
creating a tone at 915.5 MHz. Press &amp;lt;code&amp;gt;Ctrl+C&amp;lt;/code&amp;gt; to stop transmitting.&lt;br /&gt;
Alternatively, use the &amp;lt;code&amp;gt;--nsamps&amp;lt;/code&amp;gt; command line argument to transmit&lt;br /&gt;
a certain number of samples before returning to the command line. Use the&lt;br /&gt;
&amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; argument to see a full list of arguments.&lt;br /&gt;
&lt;br /&gt;
The advantage of this example compared to directly streaming the file to the&lt;br /&gt;
device is twofold:&lt;br /&gt;
&lt;br /&gt;
* The initial upload to DRAM can happen at any link rate. Even when using 1 GbE, this example will work.&lt;br /&gt;
* Once uploaded, the host computer is basically idle. The FPGA will handle the streaming to the radio front-end.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp source code]&lt;br /&gt;
for &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; may be considered an example&lt;br /&gt;
for best practices on how to use the replay block.&lt;br /&gt;
&lt;br /&gt;
==Using the Replay Block==&lt;br /&gt;
&lt;br /&gt;
This block works like a record and playback buffer that uses DRAM on the USRP to&lt;br /&gt;
store samples.&lt;br /&gt;
Data can be streamed to the block, like to any other RFNoC block.&lt;br /&gt;
&lt;br /&gt;
Refer the [https://files.ettus.com/manual/classuhd_1_1rfnoc_1_1replay__block__control.html manual of the replay block controller]&lt;br /&gt;
for a comprehensive description of its features and API calls.&lt;br /&gt;
&lt;br /&gt;
In the following, we shall use the C++ API to demonstrate the most important&lt;br /&gt;
API calls. We will assume there is a replay block controller called&lt;br /&gt;
&amp;lt;code&amp;gt;replay_ctrl&amp;lt;/code&amp;gt; available in the current context, and it is of type&lt;br /&gt;
&amp;lt;code&amp;gt;uhd::rfnoc::replay_block_control::sptr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Recording Data===&lt;br /&gt;
&lt;br /&gt;
Before streaming data to the replay block, it needs to be configured for recording:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record(buffer_start_byte_address, buffer_size_in_bytes, replay_chan);&lt;br /&gt;
&lt;br /&gt;
This tells the Replay block that it should start recording any data it receives&lt;br /&gt;
on port &amp;lt;code&amp;gt;port&amp;lt;/code&amp;gt; into the DRAM at byte offset &amp;lt;code&amp;gt;buffer_start_byte_address&amp;lt;/code&amp;gt;&lt;br /&gt;
and should use up to &amp;lt;code&amp;gt;buffer_size_in_bytes&amp;lt;/code&amp;gt; bytes. Once the buffer is&lt;br /&gt;
filled, recording automatically stops. Care should be taken to configure the&lt;br /&gt;
memory buffers so that they do not overlap if more than one Replay block or&lt;br /&gt;
buffer is being used simultaneously.&lt;br /&gt;
&lt;br /&gt;
Call this once for every port that you expect to stream data into.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Care should be taken to not transfer more data to the Replay block&lt;br /&gt;
than the size of the record buffer. Additional data is not accepted or dropped&lt;br /&gt;
by the replay block, but flow control will cause data to back up in the RF network on the FPGA.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The amount of memory available to the Replay block is limited by the&lt;br /&gt;
size of the DRAM on the USRP and how the memory interface is configured on the USRP.&lt;br /&gt;
By default, we expose the entire memory of the device, but it is possible to modify&lt;br /&gt;
&amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; if less memory should be made accessible.&lt;br /&gt;
&lt;br /&gt;
Devices have the following amount of memory:&lt;br /&gt;
{|&lt;br /&gt;
|E310&lt;br /&gt;
|512 MiB&lt;br /&gt;
|-&lt;br /&gt;
|E320&lt;br /&gt;
|2 GiB&lt;br /&gt;
|-&lt;br /&gt;
|N3xx&lt;br /&gt;
|2 GiB&lt;br /&gt;
|-&lt;br /&gt;
|X310&lt;br /&gt;
|1 GiB&lt;br /&gt;
|-&lt;br /&gt;
|X410&lt;br /&gt;
|4 GiB per bank (note: not all banks may be connected)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The currently available memory can be queried using the block controller and the &lt;br /&gt;
&amp;lt;code&amp;gt;get_mem_size()&amp;lt;/code&amp;gt; API call.&lt;br /&gt;
&lt;br /&gt;
To restart recording from the same offset, the following API call can be used:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record_restart(replay_chan);&lt;br /&gt;
&lt;br /&gt;
This resets the record pointer to point back to the beginning of the buffer and&lt;br /&gt;
it resets the internal counters that track how much data has been recorded. If&lt;br /&gt;
a previous recording has taken place then it is a good idea to ensure that&lt;br /&gt;
stale data was not queued up in the RF network on the FPGA from a previous run.&lt;br /&gt;
The &amp;lt;code&amp;gt;replay_samples_from_file&amp;lt;/code&amp;gt; example does this by calling&lt;br /&gt;
&amp;lt;code&amp;gt;record_restart()&amp;lt;/code&amp;gt; then waiting to see if any new data shows up&lt;br /&gt;
unexpectedly in the record buffer. If so, it restarts recording then waits&lt;br /&gt;
again to see if data continues to appear.&lt;br /&gt;
&lt;br /&gt;
You can determine when all data has been received by checking the status of the&lt;br /&gt;
record fullness.&lt;br /&gt;
&lt;br /&gt;
    // Wait for recording to complete&lt;br /&gt;
    while (replay_ctrl-&amp;gt;get_record_fullness(replay_chan) &amp;lt; num_bytes_expected)&lt;br /&gt;
        std::this_thread::sleep_for(100ms);&lt;br /&gt;
&lt;br /&gt;
===Playing Back Data===&lt;br /&gt;
&lt;br /&gt;
Prior to playing back recorded data, it is necessary to configure the base&lt;br /&gt;
address and size of the playback buffer. To play back previously recorded data,&lt;br /&gt;
set the start address to the same address that was used for the record buffer&lt;br /&gt;
and set the size of the playback buffer to the match the amount of data that&lt;br /&gt;
was recorded. Note that the record and playback buffers do not need to be the&lt;br /&gt;
same, allowing a single Replay block to both record and playback to different&lt;br /&gt;
regions of memory simultaneously.&lt;br /&gt;
&lt;br /&gt;
    // Configure the Replay block to play back everything that was recorded&lt;br /&gt;
    num_bytes_recorded = replay_ctrl-&amp;gt;get_record_fullness(replay_chan);&lt;br /&gt;
    replay_ctrl-&amp;gt;config_play(buffer_start_byte_address, num_bytes_recorded, replay_chan);&lt;br /&gt;
&lt;br /&gt;
To play back the data in the playback buffer, issue the appropriate UHD stream command.&lt;br /&gt;
Playback automatically wraps around to the start of the buffer if more data is&lt;br /&gt;
requested than the size of the playback buffer.&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;STREAM_MODE_START_CONTINUOUS&amp;lt;/code&amp;gt; causes playback to continue indefinitely&lt;br /&gt;
until explicitly stopped. &amp;lt;code&amp;gt;STREAM_MODE_NUM_SAMPS_AND_DONE&amp;lt;/code&amp;gt; causes only&lt;br /&gt;
the specified number of samples to be played once. Playback can be stopped by issuing&lt;br /&gt;
 a stop command.&lt;br /&gt;
&lt;br /&gt;
    stream_cmd.stream_mode = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd);&lt;br /&gt;
&lt;br /&gt;
This will stop playback at the end of the next DRAM read after the command is&lt;br /&gt;
received (DRAM reads are not aborted mid-transaction). As a result, some data&lt;br /&gt;
will continue to stream from the Replay block after the stop command is issued&lt;br /&gt;
while waiting for the DRAM read to complete and for all the internal buffers to&lt;br /&gt;
empty.&lt;br /&gt;
&lt;br /&gt;
When using the C++ API, the &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; API call is a useful shorthand&lt;br /&gt;
for configuring playback and submitting the stream command at the same time:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;play(buffer_start_byte_address, num_bytes_to_play, replay_chan, start_time, repeat);&lt;br /&gt;
&lt;br /&gt;
In either case, the start time is optional. When given, the first sample to leave&lt;br /&gt;
the block on playback is tagged with this timestamp.&lt;br /&gt;
&lt;br /&gt;
===Memory Alignment and Word Sizes===&lt;br /&gt;
&lt;br /&gt;
There are two memory alignment values that need to be considered when dealing&lt;br /&gt;
with the replay block. The first is the word size, which is the minimum number of&lt;br /&gt;
bytes per DRAM transaction. For all default configurations, the word size is 64 bits,&lt;br /&gt;
which means that only even numbers of samples can be recorded or played back&lt;br /&gt;
when using 16-bit complex samples (at 4 bytes per sample). Use the &amp;lt;code&amp;gt;get_word_size()&amp;lt;/code&amp;gt;&lt;br /&gt;
API call to identify the correct word size.&lt;br /&gt;
&lt;br /&gt;
The second alignment value is the memory's page boundaries. The start addresses&lt;br /&gt;
for record and replay must fall onto a 4 kiB memory boundary to ensure correct&lt;br /&gt;
alignment of data.&lt;br /&gt;
&lt;br /&gt;
==Building Custom FPGA Images with a Replay Block==&lt;br /&gt;
&lt;br /&gt;
===Configure the Default Shell===&lt;br /&gt;
&lt;br /&gt;
Before you begin, make sure you are using the &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt; shell. See [[Software_Development_on_the_E3xx_USRP_-_Building_RFNoC_UHD_/_GNU_Radio_/_gr-ettus_from_Source#Reconfigure_Default_Shell|Reconfigure Default Shell]] in AN-315 for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
===Cloning the Repository===&lt;br /&gt;
&lt;br /&gt;
Note: Cloning the repository is only required when building custom FPGA images.&lt;br /&gt;
If the replay block is already built into the USRP's bit file, this is not&lt;br /&gt;
required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs.&lt;br /&gt;
&lt;br /&gt;
If you do require access to the source code, e.g. to build an FPGA image with a&lt;br /&gt;
custom replay block configuration, run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/EttusResearch/uhd.git&lt;br /&gt;
&lt;br /&gt;
For the rest of the Application Note, we assume the repository was cloned into&lt;br /&gt;
the location &amp;lt;code&amp;gt;~/src/uhd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Installing the FPGA Tools===&lt;br /&gt;
&lt;br /&gt;
In order to build the FPGA image for the intended USRP product, you will need&lt;br /&gt;
to have the Xilinx development tools installed. The specific version required&lt;br /&gt;
depends on the UHD version. Refer to the&lt;br /&gt;
[https://files.ettus.com/manual/md_usrp3_build_instructions.html manual] for the&lt;br /&gt;
correct version for your UHD version, and the installation instructions for&lt;br /&gt;
Vivado in order to install these tools. It is recommended that you use the&lt;br /&gt;
default install location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Building the FPGA==&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Most bitfiles already include the replay block! This section is&lt;br /&gt;
only relevant if you want to build your own bitfile, or the bitfile you're using&lt;br /&gt;
does not contain the replay block already.&lt;br /&gt;
&lt;br /&gt;
In order to use the Replay block, it must be built into the FPGA image for the&lt;br /&gt;
USRP you plan to use. This is currently a manual step. The instructions below&lt;br /&gt;
are for the X310, but similar instructions apply to other RFNoC-capable&lt;br /&gt;
devices.&lt;br /&gt;
&lt;br /&gt;
To create a custom FPGA image with a replay, you need to create an image core file.&lt;br /&gt;
The following lines are the relevant lines from the&lt;br /&gt;
[https://github.com/EttusResearch/uhd/blob/master/fpga/usrp3/top/x300/x310_rfnoc_image_core.yml X310 default image core file]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      # ... all the other stream endpoints...&lt;br /&gt;
      ep4:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
      ep5:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
    &lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      # ... all the other blocks...&lt;br /&gt;
      replay0:&lt;br /&gt;
        block_desc: 'replay.yml'&lt;br /&gt;
        parameters:&lt;br /&gt;
          NUM_PORTS: 2&lt;br /&gt;
          MEM_ADDR_W: 30&lt;br /&gt;
    &lt;br /&gt;
    connections:&lt;br /&gt;
      # ...connections for all the other blocks...&lt;br /&gt;
      # ep4 to replay0(0)&lt;br /&gt;
      - { srcblk: ep4,     srcport: out0,  dstblk: replay0, dstport: in_0 }&lt;br /&gt;
      # replay0(0) to ep4&lt;br /&gt;
      - { srcblk: replay0, srcport: out_0, dstblk: ep4,     dstport: in0  }&lt;br /&gt;
      # ep5 to replay0(1)&lt;br /&gt;
      - { srcblk: ep5,     srcport: out0,  dstblk: replay0, dstport: in_1 }&lt;br /&gt;
      # replay0(1) to ep5&lt;br /&gt;
      - { srcblk: replay0, srcport: out_1, dstblk: ep5,     dstport: in0  }&lt;br /&gt;
      # BSP Connections&lt;br /&gt;
      - { srcblk: replay0, srcport: axi_ram, dstblk: _device_, dstport: dram }&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      # ...all other clock domains...&lt;br /&gt;
      - { srcblk: _device_, srcport: dram,  dstblk: replay0, dstport: mem  }&lt;br /&gt;
&lt;br /&gt;
As you can see, the replay block requires configuration in up to four sections:&lt;br /&gt;
* For maximum flexibility, every port of the replay block will receive its own stream endpoint. This is not a requirement of the replay block, but allows its flexible use.&lt;br /&gt;
* Of course, the block needs to be declared in the &amp;lt;code&amp;gt;noc_blocks&amp;lt;/code&amp;gt; section. The blocks contain two parameters, NUM_PORTS, and MEM_ADDR_W. The former is the number of ports this RFNoC block may have. The latter is the width of the memory address word, i.e., it is log2(memory_size).&lt;br /&gt;
* It must be connected to the stream endpoints in the &amp;lt;code&amp;gt;connections&amp;lt;/code&amp;gt; section, as well as to the DRAM banks (BSP connection).&lt;br /&gt;
* Finally, the clock domain needs to be connected.&lt;br /&gt;
&lt;br /&gt;
All devices have limits regarding the number of ports and the memory size. The following values may not be exceeded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
E310:&lt;br /&gt;
    NUM_PORTS: 2&lt;br /&gt;
    MEM_ADDR_W: 29&lt;br /&gt;
E320:&lt;br /&gt;
    NUM_PORTS: 4&lt;br /&gt;
    MEM_ADDR_W: 31&lt;br /&gt;
N3xx:&lt;br /&gt;
    NUM_PORTS: 4&lt;br /&gt;
    MEM_ADDR_W: 31&lt;br /&gt;
X310:&lt;br /&gt;
    NUM_PORTS: 2&lt;br /&gt;
    MEM_ADDR_W: 30&lt;br /&gt;
X410:&lt;br /&gt;
    NUM_PORTS: 4&lt;br /&gt;
    MEM_ADDR_W: 32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the YAML image core file is complete, save it, e.g., as x310_replay_image_core.yml,&lt;br /&gt;
and pass it to the image builder:&lt;br /&gt;
&lt;br /&gt;
    rfnoc_image_builder -y x310_replay_image_core.yml [ --fpga-dir ~/usr/uhd/fpga ]&lt;br /&gt;
&lt;br /&gt;
This will create a bitfile that contains the replay block. It can be loaded onto&lt;br /&gt;
the device using the &amp;lt;code&amp;gt;uhd_image_loader&amp;lt;/code&amp;gt; tool:&lt;br /&gt;
&lt;br /&gt;
    uhd_image_loader --args type=x300,addr=&amp;lt;ip address&amp;gt; --fpga-path=/path/to/usrp_x310_fpga_HG.bit&lt;br /&gt;
&lt;br /&gt;
When this is complete, the replay block is ready to use.&lt;br /&gt;
&lt;br /&gt;
==Source files==&lt;br /&gt;
&lt;br /&gt;
For reference, the following files implement the replay block:&lt;br /&gt;
&lt;br /&gt;
* Verilog/HDL sources: https://github.com/EttusResearch/uhd/tree/master/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_replay&lt;br /&gt;
* C++ Block controller sources (header, block controller, Python bindings, unit tests):&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/include/uhd/rfnoc/replay_block_control.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control.cpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control_python.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/tests/rfnoc_block_tests/replay_block_test.cpp&lt;br /&gt;
* Example: https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5286</id>
		<title>Using the RFNoC Replay Block in UHD 4</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5286"/>
				<updated>2022-03-01T11:54:53Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: MartinBraun moved page Using the RFNoC Replay Block 4.0 to Using the RFNoC Replay Block 4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-642b'''&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
This application note guides a user through basic use of the RFNoC Replay block&lt;br /&gt;
in UHD 4.x and explains how to run the UHD Replay example. This example covers&lt;br /&gt;
the USRP X410, X310/X300, N300/N310/N320 and E320 devices. For UHD 3.x, please&lt;br /&gt;
refer to [[Using_the_RFNoC_Replay_Block|the UHD 3.x replay block Application Note]].&lt;br /&gt;
&lt;br /&gt;
An introduction to RFNoC with UHD 4.0 and above can be found [[Getting_Started_with_RFNoC_in_UHD_4.0|here]].&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
The Replay block is an RFNoC block that allows recording and playback of&lt;br /&gt;
arbitrary data using DRAM on the USRP hardware as a buffer. To use the Replay&lt;br /&gt;
block, it must be instantiated in the design and connected to the DRAM interface.&lt;br /&gt;
&lt;br /&gt;
The replay block is a standard feature of UHD and RFNoC, and a custom compile of&lt;br /&gt;
UHD is not required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs, so when using these images,&lt;br /&gt;
the following examples can be run without any manual builds of UHD or FPGA images.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
To follow this application note, you need a device with a replay block instantiated,&lt;br /&gt;
and a UHD version recent enough to have the full support for the replay block&lt;br /&gt;
(UHD 4.2 and beyond). To test for the replay block capabilities, connect and&lt;br /&gt;
enable your USRP device, and run the following command:&lt;br /&gt;
&lt;br /&gt;
    uhd_usrp_probe --args &amp;lt;device args&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Depending on your device, the output could look like this (truncated):&lt;br /&gt;
&lt;br /&gt;
     _____________________________________________________&lt;br /&gt;
    /&lt;br /&gt;
    |       Device: X400-Series Device&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Mboard: ni-x4xx-&amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   pid: 1040&lt;br /&gt;
    |   |   rev: 4&lt;br /&gt;
    |   |   rev_compat: 4&lt;br /&gt;
    |   |   serial: &amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   MPM Version: 4.0&lt;br /&gt;
    |   |   FPGA Version: 7.6&lt;br /&gt;
    |   |   FPGA git hash: &amp;lt;hash&amp;gt;.clean&lt;br /&gt;
    |   |   RFNoC capable: Yes&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   Time sources:  internal, external, qsfp0, gpsdo&lt;br /&gt;
    |   |   Clock sources: mboard, internal, external, nsync, gpsdo&lt;br /&gt;
    |   |   Sensors: ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/DDC#0&lt;br /&gt;
    |   |   * 0/DDC#1&lt;br /&gt;
    |   |   * 0/DUC#0&lt;br /&gt;
    |   |   * 0/DUC#1&lt;br /&gt;
    |   |   * 0/Radio#0&lt;br /&gt;
    |   |   * 0/Radio#1&lt;br /&gt;
    |   |   * 0/Replay#0&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/SEP#0:0==&amp;gt;0/DUC#0:0&lt;br /&gt;
    |   |   * 0/DUC#0:0==&amp;gt;0/Radio#0:0&lt;br /&gt;
    |   |   * 0/Radio#0:0==&amp;gt;0/DDC#0:0&lt;br /&gt;
    |   |   * 0/DDC#0:0==&amp;gt;0/SEP#0:0&lt;br /&gt;
    |   |   * 0/SEP#1:0==&amp;gt;0/DUC#0:1&lt;br /&gt;
    |   |   * 0/DUC#0:1==&amp;gt;0/Radio#0:1&lt;br /&gt;
    |   |   * 0/Radio#0:1==&amp;gt;0/DDC#0:1&lt;br /&gt;
    |   |   * 0/DDC#0:1==&amp;gt;0/SEP#1:0&lt;br /&gt;
    |   |   * 0/SEP#2:0==&amp;gt;0/DUC#1:0&lt;br /&gt;
    |   |   * 0/DUC#1:0==&amp;gt;0/Radio#1:0&lt;br /&gt;
    |   |   * 0/Radio#1:0==&amp;gt;0/DDC#1:0&lt;br /&gt;
    |   |   * 0/DDC#1:0==&amp;gt;0/SEP#2:0&lt;br /&gt;
    |   |   * 0/SEP#3:0==&amp;gt;0/DUC#1:1&lt;br /&gt;
    |   |   * 0/DUC#1:1==&amp;gt;0/Radio#1:1&lt;br /&gt;
    |   |   * 0/Radio#1:1==&amp;gt;0/DDC#1:1&lt;br /&gt;
    |   |   * 0/DDC#1:1==&amp;gt;0/SEP#3:0&lt;br /&gt;
    |   |   * 0/SEP#4:0==&amp;gt;0/Replay#0:0&lt;br /&gt;
    |   |   * 0/Replay#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
    |   |   * 0/SEP#5:0==&amp;gt;0/Replay#0:1&lt;br /&gt;
    |   |   * 0/Replay#0:1==&amp;gt;0/SEP#5:0&lt;br /&gt;
    |   |   * 0/SEP#6:0==&amp;gt;0/Replay#0:2&lt;br /&gt;
    |   |   * 0/Replay#0:2==&amp;gt;0/SEP#6:0&lt;br /&gt;
    |   |   * 0/SEP#7:0==&amp;gt;0/Replay#0:3&lt;br /&gt;
    |   |   * 0/Replay#0:3==&amp;gt;0/SEP#7:0&lt;br /&gt;
&lt;br /&gt;
The output tells us that this USRP has a Replay block instantiated (&amp;lt;code&amp;gt;0/Replay#0&amp;lt;/code&amp;gt;).&lt;br /&gt;
It has four static connections to stream endpoints, which also tells us that&lt;br /&gt;
this is a four-port replay block.&lt;br /&gt;
&lt;br /&gt;
If your device does not report a replay block, then you need to build and load&lt;br /&gt;
an FPGA image which includes this block. See ... for instructions on how to do&lt;br /&gt;
this before you proceed. If it does report a block, you can move to the next&lt;br /&gt;
section.&lt;br /&gt;
&lt;br /&gt;
==Running the Example==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; example assumes that you have a&lt;br /&gt;
file containing the samples you wish to replay. This could be generated in&lt;br /&gt;
advance or recorded using &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt; or another method. For&lt;br /&gt;
this demonstration, we'll create a simple Python program (&amp;lt;code&amp;gt;sample_gen.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
to generate some samples to use:&lt;br /&gt;
&lt;br /&gt;
    import math&lt;br /&gt;
    import struct&lt;br /&gt;
    &lt;br /&gt;
    SAMPLE_RATE = 200.0e6        # Sample rate in Hz&lt;br /&gt;
    FREQUENCY   = 500.0e3        # Frequency of sinusoid to generate, in Hz&lt;br /&gt;
    NUM_SAMPLES = 16000          # Number of samples to generate&lt;br /&gt;
    AMPLITUDE   = 0.5            # Amplitude of the signal (from 0 to 1.0)&lt;br /&gt;
    FILE_NAME   = 'samples.dat'&lt;br /&gt;
    &lt;br /&gt;
    file = open(FILE_NAME, 'wb')&lt;br /&gt;
    &lt;br /&gt;
    for i in range(NUM_SAMPLES):&lt;br /&gt;
        I = int((2**15-1) * AMPLITUDE * math.cos(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        Q = int((2**15-1) * AMPLITUDE * math.sin(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        file.write(struct.pack('&amp;lt;2h', I, Q))&lt;br /&gt;
    &lt;br /&gt;
    file.close()&lt;br /&gt;
&lt;br /&gt;
This program generates a file named &amp;lt;code&amp;gt;samples.dat&amp;lt;/code&amp;gt; that contains 16000&lt;br /&gt;
samples (40 periods) of a 500&amp;amp;nbsp;kHz tone sampled at a rate of 200&amp;amp;nbsp;MHz.&lt;br /&gt;
Each sample is saved in &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt; format (signed complex with 16-bit real&lt;br /&gt;
and 16-bit imaginary components). We can run the program by invoking python from&lt;br /&gt;
the command line.&lt;br /&gt;
&lt;br /&gt;
    $ python ./sample_gen.py&lt;br /&gt;
&lt;br /&gt;
To run the UHD Replay example, enter a command like the following (the path to&lt;br /&gt;
the examples depends on your installation method, for a normal installation via&lt;br /&gt;
apt-get, examples will be located in &amp;lt;code&amp;gt;/usr/lib/uhd/examples&amp;lt;/code&amp;gt; or&lt;br /&gt;
&amp;lt;code&amp;gt;/usr/local/lib/uhd/examples&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
    $ cd /path/to/examples&lt;br /&gt;
    $ ./replay_samples_from_file --args &amp;lt;device args&amp;gt; --freq 915e6 --gain 10 --file samples.dat --rate 200e6&lt;br /&gt;
&lt;br /&gt;
This example would stream the samples from the file to the Replay block on the&lt;br /&gt;
FPGA, where they are recorded into the USRP's on-board DRAM. Then, the Replay block&lt;br /&gt;
will play the samples to the radio continuously with a base frequency of 915 MHz,&lt;br /&gt;
creating a tone at 915.5 MHz. Press &amp;lt;code&amp;gt;Ctrl+C&amp;lt;/code&amp;gt; to stop transmitting.&lt;br /&gt;
Alternatively, use the &amp;lt;code&amp;gt;--nsamps&amp;lt;/code&amp;gt; command line argument to transmit&lt;br /&gt;
a certain number of samples before returning to the command line. Use the&lt;br /&gt;
&amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; argument to see a full list of arguments.&lt;br /&gt;
&lt;br /&gt;
The advantage of this example compared to directly streaming the file to the&lt;br /&gt;
device is twofold:&lt;br /&gt;
&lt;br /&gt;
* The initial upload to DRAM can happen at any link rate. Even when using 1 GbE, this example will work.&lt;br /&gt;
* Once uploaded, the host computer is basically idle. The FPGA will handle the streaming to the radio front-end.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp source code]&lt;br /&gt;
for &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; may be considered an example&lt;br /&gt;
for best practices on how to use the replay block.&lt;br /&gt;
&lt;br /&gt;
==Using the Replay Block==&lt;br /&gt;
&lt;br /&gt;
This block works like a record and playback buffer that uses DRAM on the USRP to&lt;br /&gt;
store samples.&lt;br /&gt;
Data can be streamed to the block, like to any other RFNoC block.&lt;br /&gt;
&lt;br /&gt;
Refer the [https://files.ettus.com/manual/classuhd_1_1rfnoc_1_1replay__block__control.html manual of the replay block controller]&lt;br /&gt;
for a comprehensive description of its features and API calls.&lt;br /&gt;
&lt;br /&gt;
In the following, we shall use the C++ API to demonstrate the most important&lt;br /&gt;
API calls. We will assume there is a replay block controller called&lt;br /&gt;
&amp;lt;code&amp;gt;replay_ctrl&amp;lt;/code&amp;gt; available in the current context, and it is of type&lt;br /&gt;
&amp;lt;code&amp;gt;uhd::rfnoc::replay_block_control::sptr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Recording Data===&lt;br /&gt;
&lt;br /&gt;
Before streaming data to the replay block, it needs to be configured for recording:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record(buffer_start_byte_address, buffer_size_in_bytes, replay_chan);&lt;br /&gt;
&lt;br /&gt;
This tells the Replay block that it should start recording any data it receives&lt;br /&gt;
on port &amp;lt;code&amp;gt;port&amp;lt;/code&amp;gt; into the DRAM at byte offset &amp;lt;code&amp;gt;buffer_start_byte_address&amp;lt;/code&amp;gt;&lt;br /&gt;
and should use up to &amp;lt;code&amp;gt;buffer_size_in_bytes&amp;lt;/code&amp;gt; bytes. Once the buffer is&lt;br /&gt;
filled, recording automatically stops. Care should be taken to configure the&lt;br /&gt;
memory buffers so that they do not overlap if more than one Replay block or&lt;br /&gt;
buffer is being used simultaneously.&lt;br /&gt;
&lt;br /&gt;
Call this once for every port that you expect to stream data into.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Care should be taken to not transfer more data to the Replay block&lt;br /&gt;
than the size of the record buffer. Additional data is not accepted or dropped&lt;br /&gt;
by the replay block, but flow control will cause data to back up in the RF network on the FPGA.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The amount of memory available to the Replay block is limited by the&lt;br /&gt;
size of the DRAM on the USRP and how the memory interface is configured on the USRP.&lt;br /&gt;
For example, the &amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; IP used by the X310 is&lt;br /&gt;
configured to give each connected device an address space of 32&amp;amp;nbsp;MiB. As a&lt;br /&gt;
result, the Replay block will be limited to this amount of memory. The&lt;br /&gt;
&amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; file must be modified if more than 32&amp;amp;nbsp;MiB needs to be buffered.&lt;br /&gt;
&lt;br /&gt;
To restart recording from the same offset, the following API call can be used:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record_restart(replay_chan);&lt;br /&gt;
&lt;br /&gt;
This resets the record pointer to point back to the beginning of the buffer and&lt;br /&gt;
it resets the internal counters that track how much data has been recorded. If&lt;br /&gt;
a previous recording has taken place then it is a good idea to ensure that&lt;br /&gt;
stale data was not queued up in the RF network on the FPGA from a previous run.&lt;br /&gt;
The &amp;lt;code&amp;gt;replay_samples_from_file&amp;lt;/code&amp;gt; example does this by calling&lt;br /&gt;
&amp;lt;code&amp;gt;record_restart()&amp;lt;/code&amp;gt; then waiting to see if any new data shows up&lt;br /&gt;
unexpectedly in the record buffer. If so, it restarts recording then waits&lt;br /&gt;
again to see if data continues to appear.&lt;br /&gt;
&lt;br /&gt;
You can determine when all data has been received by checking the status of the&lt;br /&gt;
record fullness.&lt;br /&gt;
&lt;br /&gt;
    // Wait for recording to complete&lt;br /&gt;
    while (replay_ctrl-&amp;gt;get_record_fullness(replay_chan) &amp;lt; num_bytes_expected)&lt;br /&gt;
        std::this_thread::sleep_for(100ms);&lt;br /&gt;
&lt;br /&gt;
===Playing Back Data===&lt;br /&gt;
&lt;br /&gt;
Prior to playing back recorded data, it is necessary to configure the base&lt;br /&gt;
address and size of the playback buffer. To play back previously recorded data,&lt;br /&gt;
set the start address to the same address that was used for the record buffer&lt;br /&gt;
and set the size of the playback buffer to the match the amount of data that&lt;br /&gt;
was recorded. Note that the record and playback buffers do not need to be the&lt;br /&gt;
same, allowing a single Replay block to both record and playback to different&lt;br /&gt;
regions of memory simultaneously.&lt;br /&gt;
&lt;br /&gt;
    // Configure the Replay block to play back everything that was recorded&lt;br /&gt;
    num_bytes_recorded = replay_ctrl-&amp;gt;get_record_fullness(replay_chan);&lt;br /&gt;
    replay_ctrl-&amp;gt;config_play(buffer_start_byte_address, num_bytes_recorded, replay_chan);&lt;br /&gt;
&lt;br /&gt;
To play back the data in the playback buffer, issue the appropriate UHD stream command.&lt;br /&gt;
Playback automatically wraps around to the start of the buffer if more data is&lt;br /&gt;
requested than the size of the playback buffer.&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;STREAM_MODE_START_CONTINUOUS&amp;lt;/code&amp;gt; causes playback to continue indefinitely&lt;br /&gt;
until explicitly stopped. &amp;lt;code&amp;gt;STREAM_MODE_NUM_SAMPS_AND_DONE&amp;lt;/code&amp;gt; causes only&lt;br /&gt;
the specified number of samples to be played once. The &amp;lt;code&amp;gt;num_samps&amp;lt;/code&amp;gt;&lt;br /&gt;
parameter is a 28-bit value, limiting this mode of playback to 2&amp;lt;sup&amp;gt;28&amp;lt;/sup&amp;gt;&lt;br /&gt;
words at a time. Playback can be stopped by issuing a stop command.&lt;br /&gt;
&lt;br /&gt;
    stream_cmd.stream_mode = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd);&lt;br /&gt;
&lt;br /&gt;
This will stop playback at the end of the next DRAM read after the command is&lt;br /&gt;
received (DRAM reads are not aborted mid-transaction). As a result, some data&lt;br /&gt;
will continue to stream from the Replay block after the stop command is issued&lt;br /&gt;
while waiting for the DRAM read to complete and for all the internal buffers to&lt;br /&gt;
empty.&lt;br /&gt;
&lt;br /&gt;
When using the C++ API, the &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; API call is a useful shorthand&lt;br /&gt;
for configuring playback and submitting the stream command at the same time:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;play(buffer_start_byte_address, num_bytes_to_play, replay_chan, start_time, repeat);&lt;br /&gt;
&lt;br /&gt;
In either case, the start time is optional. When given, the first sample to leave&lt;br /&gt;
the block on playback is tagged with this timestamp.&lt;br /&gt;
&lt;br /&gt;
===Memory Alignment and Word Sizes===&lt;br /&gt;
&lt;br /&gt;
There are two memory alignment values that need to be considered when dealing&lt;br /&gt;
with the replay block. The first is the word size, which is the minimum number of&lt;br /&gt;
bytes per DRAM transaction. For all default configurations, the word size is 64 bits,&lt;br /&gt;
which means that only even numbers of samples can be recorded or played back&lt;br /&gt;
when using 16-bit complex samples (at 4 bytes per sample). Use the &amp;lt;code&amp;gt;get_word_size()&amp;lt;/code&amp;gt;&lt;br /&gt;
API call to identify the correct word size.&lt;br /&gt;
&lt;br /&gt;
The second alignment value is the memory's page boundaries. The start addresses&lt;br /&gt;
for record and replay must fall onto a 4 kiB memory boundary to ensure correct&lt;br /&gt;
alignment of data.&lt;br /&gt;
&lt;br /&gt;
==Building Custom FPGA Images with a Replay Block==&lt;br /&gt;
&lt;br /&gt;
===Configure the Default Shell===&lt;br /&gt;
&lt;br /&gt;
Before you begin, make sure you are using the &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt; shell. See [[Software_Development_on_the_E3xx_USRP_-_Building_RFNoC_UHD_/_GNU_Radio_/_gr-ettus_from_Source#Reconfigure_Default_Shell|Reconfigure Default Shell]] in AN-315 for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
===Cloning the Repository===&lt;br /&gt;
&lt;br /&gt;
Note: Cloning the repository is only required when building custom FPGA images.&lt;br /&gt;
If the replay block is already built into the USRP's bit file, this is not&lt;br /&gt;
required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs.&lt;br /&gt;
&lt;br /&gt;
If you do require access to the source code, e.g. to build an FPGA image with a&lt;br /&gt;
custom replay block configuration, run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/EttusResearch/uhd.git&lt;br /&gt;
&lt;br /&gt;
For the rest of the Application Note, we assume the repository was cloned into&lt;br /&gt;
the location &amp;lt;code&amp;gt;~/src/uhd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Installing the FPGA Tools===&lt;br /&gt;
&lt;br /&gt;
In order to build the FPGA image for the intended USRP product, you will need&lt;br /&gt;
to have the Xilinx development tools installed. The specific version required&lt;br /&gt;
depends on the UHD version. Refer to the&lt;br /&gt;
[https://files.ettus.com/manual/md_usrp3_build_instructions.html manual] for the&lt;br /&gt;
correct version for your UHD version, and the installation instructions for&lt;br /&gt;
Vivado in order to install these tools. It is recommended that you use the&lt;br /&gt;
default install location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Building the FPGA==&lt;br /&gt;
&lt;br /&gt;
In order to use the Replay block, it must be built into the FPGA image for the&lt;br /&gt;
USRP you plan to use. This is currently a manual step. The instructions below&lt;br /&gt;
are for the X310, but similar instructions apply to other RFNoC-capable&lt;br /&gt;
devices.&lt;br /&gt;
&lt;br /&gt;
To create a custom FPGA image with a replay, you need to create an image core file.&lt;br /&gt;
The following lines are the relevant lines from the&lt;br /&gt;
[https://github.com/EttusResearch/uhd/blob/master/fpga/usrp3/top/x300/x310_rfnoc_image_core.yml X310 default image core file]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      # ... all the other stream endpoints...&lt;br /&gt;
      ep4:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
      ep5:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
    &lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      # ... all the other blocks...&lt;br /&gt;
      replay0:&lt;br /&gt;
        block_desc: 'replay.yml'&lt;br /&gt;
        parameters:&lt;br /&gt;
          NUM_PORTS: 2&lt;br /&gt;
          MEM_ADDR_W: 30&lt;br /&gt;
    &lt;br /&gt;
    connections:&lt;br /&gt;
      # ...connections for all the other blocks...&lt;br /&gt;
      # ep4 to replay0(0)&lt;br /&gt;
      - { srcblk: ep4,     srcport: out0,  dstblk: replay0, dstport: in_0 }&lt;br /&gt;
      # replay0(0) to ep4&lt;br /&gt;
      - { srcblk: replay0, srcport: out_0, dstblk: ep4,     dstport: in0  }&lt;br /&gt;
      # ep5 to replay0(1)&lt;br /&gt;
      - { srcblk: ep5,     srcport: out0,  dstblk: replay0, dstport: in_1 }&lt;br /&gt;
      # replay0(1) to ep5&lt;br /&gt;
      - { srcblk: replay0, srcport: out_1, dstblk: ep5,     dstport: in0  }&lt;br /&gt;
      # BSP Connections&lt;br /&gt;
      - { srcblk: replay0, srcport: axi_ram, dstblk: _device_, dstport: dram }&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      # ...all other clock domains...&lt;br /&gt;
      - { srcblk: _device_, srcport: dram,  dstblk: replay0, dstport: mem  }&lt;br /&gt;
&lt;br /&gt;
As you can see, the replay block requires configuration in up to four sections:&lt;br /&gt;
* For maximum flexibility, every port of the replay block will receive its own stream endpoint. This is not a requirement of the replay block, but allows its flexible use.&lt;br /&gt;
* Of course, the block needs to be declared in the &amp;lt;code&amp;gt;noc_blocks&amp;lt;/code&amp;gt; section.&lt;br /&gt;
* It must be connected to the stream endpoints in the &amp;lt;code&amp;gt;connections&amp;lt;/code&amp;gt; section, as well as to the DRAM banks (BSP connection).&lt;br /&gt;
* Finally, the clock domain needs to be connected.&lt;br /&gt;
&lt;br /&gt;
When the YAML image core file is complete, save it, e.g., as x310_replay_image_core.yml,&lt;br /&gt;
and pass it to the image builder:&lt;br /&gt;
&lt;br /&gt;
    rfnoc_image_builder -y x310_replay_image_core.yml&lt;br /&gt;
&lt;br /&gt;
This will create a bitfile that contains the replay block. It can be loaded onto&lt;br /&gt;
the device using the &amp;lt;code&amp;gt;uhd_image_loader&amp;lt;/code&amp;gt; tool:&lt;br /&gt;
&lt;br /&gt;
    uhd_image_loader --args type=x300,addr=&amp;lt;ip address&amp;gt; --fpga-path=/path/to/usrp_x310_fpga_HG.bit&lt;br /&gt;
&lt;br /&gt;
When this is complete, the replay block is ready to use.&lt;br /&gt;
&lt;br /&gt;
==Source files==&lt;br /&gt;
&lt;br /&gt;
For reference, the following files implement the replay block:&lt;br /&gt;
&lt;br /&gt;
* Verilog/HDL sources: https://github.com/EttusResearch/uhd/tree/master/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_replay&lt;br /&gt;
* C++ Block controller sources (header, block controller, Python bindings, unit tests):&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/include/uhd/rfnoc/replay_block_control.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control.cpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control_python.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/tests/rfnoc_block_tests/replay_block_test.cpp&lt;br /&gt;
* Example: https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_4.0&amp;diff=5287</id>
		<title>Using the RFNoC Replay Block 4.0</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_4.0&amp;diff=5287"/>
				<updated>2022-03-01T11:54:53Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: MartinBraun moved page Using the RFNoC Replay Block 4.0 to Using the RFNoC Replay Block 4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Using the RFNoC Replay Block 4]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=UHD_Python_API&amp;diff=5273</id>
		<title>UHD Python API</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=UHD_Python_API&amp;diff=5273"/>
				<updated>2022-02-10T08:59:49Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* FAQ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What's the UHD Python API? ==&lt;br /&gt;
&lt;br /&gt;
As the name suggests, it exposes the UHD API into Python. We use &amp;lt;code&amp;gt;pybind11&amp;lt;/code&amp;gt;&lt;br /&gt;
to generate a Python module which exposes most of the C++ API, and some extra&lt;br /&gt;
features. The Python API is part of stable releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The USRP Hardware Driver and USRP Manual covers most information about the UHD Python API and can be found here: https://files.ettus.com/manual/page_python.html&lt;br /&gt;
&lt;br /&gt;
== How can I use it? ==&lt;br /&gt;
&lt;br /&gt;
In order to test the Python API, check out the &amp;lt;code&amp;gt;master&amp;lt;/code&amp;gt; branch and build it like always. When running CMake, make sure that the Python API was enabled (&amp;lt;code&amp;gt;-DENABLE_PYTHON_API=ON&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The output from CMake should look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- ######################################################&lt;br /&gt;
-- # UHD enabled components                              &lt;br /&gt;
-- ######################################################&lt;br /&gt;
--   * LibUHD&lt;br /&gt;
--   * LibUHD - C API&lt;br /&gt;
--   * LibUHD - Python API&lt;br /&gt;
--   * Examples&lt;br /&gt;
--   * Utils&lt;br /&gt;
--   * Tests&lt;br /&gt;
--   * USB&lt;br /&gt;
--   * B100&lt;br /&gt;
--   * B200&lt;br /&gt;
--   * USRP1&lt;br /&gt;
--   * USRP2&lt;br /&gt;
--   * X300&lt;br /&gt;
--   * N230&lt;br /&gt;
--   * OctoClock&lt;br /&gt;
--   * Manual&lt;br /&gt;
--   * API/Doxygen&lt;br /&gt;
--   * Man Pages&lt;br /&gt;
-- &lt;br /&gt;
-- ######################################################&lt;br /&gt;
-- # UHD disabled components                             &lt;br /&gt;
-- ######################################################&lt;br /&gt;
--   * GPSD&lt;br /&gt;
--   * E100&lt;br /&gt;
--   * E300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please refer to the [https://files.ettus.com/manual/page_python.html USRP Manual] for extended instructions especially when installing on Windows.&lt;br /&gt;
Once it's built and installed, you'll be able to import the &amp;lt;code&amp;gt;uhd&amp;lt;/code&amp;gt; Python&lt;br /&gt;
module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import uhd&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; my_usrp = uhd.usrp.MultiUSRP(&amp;quot;type=b200&amp;quot;)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; my_usrp.set_rx_gain(70)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have some examples in &amp;lt;code&amp;gt;[https://github.com/EttusResearch/uhd/tree/master/host/examples/python host/examples/python]&amp;lt;/code&amp;gt;. The examples are very&lt;br /&gt;
simple, but concise.&lt;br /&gt;
&lt;br /&gt;
==Example: pyuhd_rx_to_file.py==&lt;br /&gt;
This Python example is based on the C++ example &amp;lt;code&amp;gt;uhd/host/examples/rx_samples_to_file.cpp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import uhd&lt;br /&gt;
import numpy as np&lt;br /&gt;
import argparse&lt;br /&gt;
&lt;br /&gt;
def parse_args():&lt;br /&gt;
    parser = argparse.ArgumentParser()&lt;br /&gt;
    parser.add_argument(&amp;quot;-a&amp;quot;, &amp;quot;--args&amp;quot;, default=&amp;quot;&amp;quot;, type=str)&lt;br /&gt;
    parser.add_argument(&amp;quot;-o&amp;quot;, &amp;quot;--output-file&amp;quot;, type=str, required=True)&lt;br /&gt;
    parser.add_argument(&amp;quot;-f&amp;quot;, &amp;quot;--freq&amp;quot;, type=float, required=True)&lt;br /&gt;
    parser.add_argument(&amp;quot;-r&amp;quot;, &amp;quot;--rate&amp;quot;, default=1e6, type=float)&lt;br /&gt;
    parser.add_argument(&amp;quot;-d&amp;quot;, &amp;quot;--duration&amp;quot;, default=5.0, type=float)&lt;br /&gt;
    parser.add_argument(&amp;quot;-c&amp;quot;, &amp;quot;--channels&amp;quot;, default=0, nargs=&amp;quot;+&amp;quot;, type=int)&lt;br /&gt;
    parser.add_argument(&amp;quot;-g&amp;quot;, &amp;quot;--gain&amp;quot;, type=int, default=10)&lt;br /&gt;
    return parser.parse_args()&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
    args = parse_args()&lt;br /&gt;
    usrp = uhd.usrp.MultiUSRP(args.args)&lt;br /&gt;
    num_samps = int(np.ceil(args.duration*args.rate))&lt;br /&gt;
    if not isinstance(args.channels, list):&lt;br /&gt;
        args.channels = [args.channels]&lt;br /&gt;
    samps = usrp.recv_num_samps(num_samps, args.freq, args.rate, args.channels, args.gain)&lt;br /&gt;
    with open(args.output_file, 'wb') as f:&lt;br /&gt;
        np.save(f, samps, allow_pickle=False, fix_imports=False)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What about documentation? ==&lt;br /&gt;
&lt;br /&gt;
Documentation is currently pretty sparse. The best we can do right now is to ask&lt;br /&gt;
users to infer the documentation from the C++ API. For example, the Python has&lt;br /&gt;
an object called &amp;lt;code&amp;gt;MultiUSRP&amp;lt;/code&amp;gt; which is an equivalent of the C++ &amp;lt;code&amp;gt;multi_usrp&amp;lt;/code&amp;gt; API.&lt;br /&gt;
The methods on both classes are the same, and take the same arguments.&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
'''Does it support Python 2 and 3?'''&lt;br /&gt;
&lt;br /&gt;
Starting with UHD 4, Python 2 support has been removed.&lt;br /&gt;
&lt;br /&gt;
'''Does it require GNU Radio?'''&lt;br /&gt;
&lt;br /&gt;
No.&lt;br /&gt;
&lt;br /&gt;
'''Does it use SWIG?'''&lt;br /&gt;
&lt;br /&gt;
No, it uses &amp;lt;code&amp;gt;pybind11&amp;lt;/code&amp;gt;. It also doesn't require the C API. Pybind11 is vendored with UHD so as to not require installing another dependency.&lt;br /&gt;
&lt;br /&gt;
'''How does this relate to the Python API in gr-uhd?''' &lt;br /&gt;
&lt;br /&gt;
It serves an entirely different purpose. This Python API is for people writing standalone applications for USRPs that *don't* use GNU Radio. &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; is staying the way it is, and is going nowhere. If you're using GNU Radio, you probably don't care about this.&lt;br /&gt;
&lt;br /&gt;
'''Are the UHD Python API and the gr-uhd Python API compatible?'''&lt;br /&gt;
&lt;br /&gt;
Short answer: No. Long answer: There are very few cases where it makes sense to mix these APIs, so no. However, this means that a &amp;lt;code&amp;gt;TimeSpec&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;Boost.Python&amp;lt;/code&amp;gt; API is not convertible into a &amp;lt;code&amp;gt;time_spec_t&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; API.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Does it support RFNoC API?'''&lt;br /&gt;
&lt;br /&gt;
For sure!&lt;br /&gt;
&lt;br /&gt;
'''What's the streaming performance?'''&lt;br /&gt;
&lt;br /&gt;
Worse than straight C++, but not a lot, thanks to NumPy. You can run &amp;lt;code&amp;gt;host/examples/benchmark_rate.py&amp;lt;/code&amp;gt; if you want to see for yourself.&lt;br /&gt;
Overall, &amp;lt;code&amp;gt;recv()&amp;lt;/code&amp;gt; calls are pretty efficient if you've pre-allocated a NumPy array, because we can cast that to a straight pointer (and also skip any type checking!) and then it's not that different from a &amp;lt;code&amp;gt;recv()&amp;lt;/code&amp;gt; call in a C++ app. However, consuming the data is limited by how fast you can handle that in Python.&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=UHD_Python_API&amp;diff=5272</id>
		<title>UHD Python API</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=UHD_Python_API&amp;diff=5272"/>
				<updated>2022-02-10T08:08:06Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What's the UHD Python API? ==&lt;br /&gt;
&lt;br /&gt;
As the name suggests, it exposes the UHD API into Python. We use &amp;lt;code&amp;gt;pybind11&amp;lt;/code&amp;gt;&lt;br /&gt;
to generate a Python module which exposes most of the C++ API, and some extra&lt;br /&gt;
features. The Python API is part of stable releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The USRP Hardware Driver and USRP Manual covers most information about the UHD Python API and can be found here: https://files.ettus.com/manual/page_python.html&lt;br /&gt;
&lt;br /&gt;
== How can I use it? ==&lt;br /&gt;
&lt;br /&gt;
In order to test the Python API, check out the &amp;lt;code&amp;gt;master&amp;lt;/code&amp;gt; branch and build it like always. When running CMake, make sure that the Python API was enabled (&amp;lt;code&amp;gt;-DENABLE_PYTHON_API=ON&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The output from CMake should look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- ######################################################&lt;br /&gt;
-- # UHD enabled components                              &lt;br /&gt;
-- ######################################################&lt;br /&gt;
--   * LibUHD&lt;br /&gt;
--   * LibUHD - C API&lt;br /&gt;
--   * LibUHD - Python API&lt;br /&gt;
--   * Examples&lt;br /&gt;
--   * Utils&lt;br /&gt;
--   * Tests&lt;br /&gt;
--   * USB&lt;br /&gt;
--   * B100&lt;br /&gt;
--   * B200&lt;br /&gt;
--   * USRP1&lt;br /&gt;
--   * USRP2&lt;br /&gt;
--   * X300&lt;br /&gt;
--   * N230&lt;br /&gt;
--   * OctoClock&lt;br /&gt;
--   * Manual&lt;br /&gt;
--   * API/Doxygen&lt;br /&gt;
--   * Man Pages&lt;br /&gt;
-- &lt;br /&gt;
-- ######################################################&lt;br /&gt;
-- # UHD disabled components                             &lt;br /&gt;
-- ######################################################&lt;br /&gt;
--   * GPSD&lt;br /&gt;
--   * E100&lt;br /&gt;
--   * E300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please refer to the [https://files.ettus.com/manual/page_python.html USRP Manual] for extended instructions especially when installing on Windows.&lt;br /&gt;
Once it's built and installed, you'll be able to import the &amp;lt;code&amp;gt;uhd&amp;lt;/code&amp;gt; Python&lt;br /&gt;
module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import uhd&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; my_usrp = uhd.usrp.MultiUSRP(&amp;quot;type=b200&amp;quot;)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; my_usrp.set_rx_gain(70)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have some examples in &amp;lt;code&amp;gt;[https://github.com/EttusResearch/uhd/tree/master/host/examples/python host/examples/python]&amp;lt;/code&amp;gt;. The examples are very&lt;br /&gt;
simple, but concise.&lt;br /&gt;
&lt;br /&gt;
==Example: pyuhd_rx_to_file.py==&lt;br /&gt;
This Python example is based on the C++ example &amp;lt;code&amp;gt;uhd/host/examples/rx_samples_to_file.cpp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import uhd&lt;br /&gt;
import numpy as np&lt;br /&gt;
import argparse&lt;br /&gt;
&lt;br /&gt;
def parse_args():&lt;br /&gt;
    parser = argparse.ArgumentParser()&lt;br /&gt;
    parser.add_argument(&amp;quot;-a&amp;quot;, &amp;quot;--args&amp;quot;, default=&amp;quot;&amp;quot;, type=str)&lt;br /&gt;
    parser.add_argument(&amp;quot;-o&amp;quot;, &amp;quot;--output-file&amp;quot;, type=str, required=True)&lt;br /&gt;
    parser.add_argument(&amp;quot;-f&amp;quot;, &amp;quot;--freq&amp;quot;, type=float, required=True)&lt;br /&gt;
    parser.add_argument(&amp;quot;-r&amp;quot;, &amp;quot;--rate&amp;quot;, default=1e6, type=float)&lt;br /&gt;
    parser.add_argument(&amp;quot;-d&amp;quot;, &amp;quot;--duration&amp;quot;, default=5.0, type=float)&lt;br /&gt;
    parser.add_argument(&amp;quot;-c&amp;quot;, &amp;quot;--channels&amp;quot;, default=0, nargs=&amp;quot;+&amp;quot;, type=int)&lt;br /&gt;
    parser.add_argument(&amp;quot;-g&amp;quot;, &amp;quot;--gain&amp;quot;, type=int, default=10)&lt;br /&gt;
    return parser.parse_args()&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
    args = parse_args()&lt;br /&gt;
    usrp = uhd.usrp.MultiUSRP(args.args)&lt;br /&gt;
    num_samps = int(np.ceil(args.duration*args.rate))&lt;br /&gt;
    if not isinstance(args.channels, list):&lt;br /&gt;
        args.channels = [args.channels]&lt;br /&gt;
    samps = usrp.recv_num_samps(num_samps, args.freq, args.rate, args.channels, args.gain)&lt;br /&gt;
    with open(args.output_file, 'wb') as f:&lt;br /&gt;
        np.save(f, samps, allow_pickle=False, fix_imports=False)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What about documentation? ==&lt;br /&gt;
&lt;br /&gt;
Documentation is currently pretty sparse. The best we can do right now is to ask&lt;br /&gt;
users to infer the documentation from the C++ API. For example, the Python has&lt;br /&gt;
an object called &amp;lt;code&amp;gt;MultiUSRP&amp;lt;/code&amp;gt; which is an equivalent of the C++ &amp;lt;code&amp;gt;multi_usrp&amp;lt;/code&amp;gt; API.&lt;br /&gt;
The methods on both classes are the same, and take the same arguments.&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
'''Does it support Python 2 and 3?'''&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
'''Does it require GNU Radio?'''&lt;br /&gt;
&lt;br /&gt;
No.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Does it use SWIG?'''&lt;br /&gt;
&lt;br /&gt;
No, it uses &amp;lt;code&amp;gt;Boost.Python&amp;lt;/code&amp;gt;. We didn't want to add another dependency to UHD (i.e., SWIG) and Boost was already a dependency of UHD. It also doesn't require the C API.&lt;br /&gt;
&lt;br /&gt;
'''How does this relate to the Python API in gr-uhd?''' &lt;br /&gt;
&lt;br /&gt;
It serves an entirely different purpose. This Python API is for people writing standalone applications for USRPs that *don't* use GNU Radio. &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; is staying the way it is, and is going nowhere. If you're using GNU Radio, you probably don't care about this.&lt;br /&gt;
&lt;br /&gt;
'''Are the UHD Python API and the gr-uhd Python API compatible?'''&lt;br /&gt;
&lt;br /&gt;
Short answer: No. Long answer: There are very few cases where it makes sense to mix these APIs, so no. However, this means that a &amp;lt;code&amp;gt;TimeSpec&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;Boost.Python&amp;lt;/code&amp;gt; API is not convertible into a &amp;lt;code&amp;gt;time_spec_t&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; API.&lt;br /&gt;
&lt;br /&gt;
'''When will it be released?'''&lt;br /&gt;
&lt;br /&gt;
It is currently on &amp;lt;code&amp;gt;master&amp;lt;/code&amp;gt; branch, and will become part of the next major release.&lt;br /&gt;
&lt;br /&gt;
'''Does it support RFNoC API?'''&lt;br /&gt;
&lt;br /&gt;
Not yet, but it's in the pipeline. We wanted to get the basics (i.e. &amp;lt;code&amp;gt;multi_usrp&amp;lt;/code&amp;gt; API) right first.&lt;br /&gt;
&lt;br /&gt;
'''What's the streaming performance?'''&lt;br /&gt;
&lt;br /&gt;
Worse than straight C++, but not a lot, thanks to NumPy. You can run &amp;lt;code&amp;gt;host/examples/benchmark_rate.py&amp;lt;/code&amp;gt; if you want to see for yourself.&lt;br /&gt;
Overall, &amp;lt;code&amp;gt;recv()&amp;lt;/code&amp;gt; calls are pretty efficient if you've preallocated a NumPy array, because we can cast that to a straight pointer (and also skip any type checking!) and then it's not that different from a &amp;lt;code&amp;gt;recv()&amp;lt;/code&amp;gt; call in a C++ app. However, consuming the data is limited by how fast you can handle that in Python.&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Knowledge_Base&amp;diff=5266</id>
		<title>Knowledge Base</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Knowledge_Base&amp;diff=5266"/>
				<updated>2022-02-07T15:29:03Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /*  Software Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Ettus Research Knowledge Base (KB). The KB is continuously being updated and expanded. If you have any suggestions, or do not find what you are looking for, then please [http://www.ettus.com/contact Contact Us].&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
== [[Getting Started Guides|&amp;lt;i class=&amp;quot;fa fa-road&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Getting Started Guides]] ==&lt;br /&gt;
&lt;br /&gt;
'''Motherboards'''&lt;br /&gt;
* [[B200/B210/B200mini/B205mini Getting Started Guides|B200/B210/B200mini/B205mini]]&lt;br /&gt;
* [[Ettus USRP E300 Embedded Family Getting Started Guides|E310/E312/E313]]&lt;br /&gt;
* [[E320 Getting Started Guide|E320]]&lt;br /&gt;
* [[N200/N210 Getting Started Guides|N200/N210]]&lt;br /&gt;
* [[USRP N300/N310/N320/N321 Getting Started Guide|N300/N310/N320/N321]]&lt;br /&gt;
* [[X300/X310 Getting Started Guides|X300/X310]]&lt;br /&gt;
* [[USRP-2974 Getting Started Guide|USRP-2974]]&lt;br /&gt;
* [[USRP X410 Getting Started Guide|X410]]&lt;br /&gt;
&lt;br /&gt;
'''Daughterboards'''&lt;br /&gt;
* [[BasicTX/BasicRX Getting Started Guides|BasicTX/BasicRX]]&lt;br /&gt;
* [[CBX Getting Started Guides|CBX]]&lt;br /&gt;
* [[LFTX/LFRX Getting Started Guides|LFTX/LFRX]]&lt;br /&gt;
* [[SBX Getting Started Guides|SBX]]&lt;br /&gt;
* [[TwinRX Getting Started Guides|TwinRX]]&lt;br /&gt;
* [[UBX Getting Started Guides|UBX]]&lt;br /&gt;
* [[WBX Getting Started Guides|WBX]]&lt;br /&gt;
&lt;br /&gt;
'''Other'''&lt;br /&gt;
* [[Getting_Started_with_RFNoC_Development|RFNoC Development]]&lt;br /&gt;
* [[Live SDR Environment Getting Started Guides|Live SDR Environment]]&lt;br /&gt;
* [[OctoClock CDA-2990 Getting Started Guides|OctoClock CDA-2990]]&lt;br /&gt;
* [[Using Ethernet-Based Synchronization on the USRP™ N3xx Devices|White Rabbit]]&lt;br /&gt;
* [[Getting Started with DPDK and UHD|DPDK]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Hardware Resources|&amp;lt;i class=&amp;quot;fa fa-cogs&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Hardware Resources]] ==&lt;br /&gt;
'''Motherboards'''&lt;br /&gt;
* [[B200/B210/B200mini/B205mini]]&lt;br /&gt;
* [[Ettus USRP E300 Embedded Family Hardware Resources|E310/E312/E313]]&lt;br /&gt;
* [[E320|E320]]&lt;br /&gt;
* [[N200/N210]]&lt;br /&gt;
* [[N300/N310]]&lt;br /&gt;
* [[N320/N321]]&lt;br /&gt;
* [[X300/X310]]&lt;br /&gt;
* [[USRP-2974]]&lt;br /&gt;
&lt;br /&gt;
'''Daughterboards'''&lt;br /&gt;
* [[BasicTX/BasicRX]]&lt;br /&gt;
* [[CBX]]&lt;br /&gt;
* [[LFTX/LFRX]]&lt;br /&gt;
* [[SBX]]&lt;br /&gt;
* [[TwinRX]]&lt;br /&gt;
* [[UBX]]&lt;br /&gt;
* [[WBX]]&lt;br /&gt;
&lt;br /&gt;
'''Other'''&lt;br /&gt;
* [[OctoClock CDA-2990]]&lt;br /&gt;
* [[GPSDO]]&lt;br /&gt;
* [[Antennas]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Software Resources|&amp;lt;i class=&amp;quot;fa fa-desktop&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Software Resources]] ==&lt;br /&gt;
'''Ettus Products'''&lt;br /&gt;
* [[UHD]]&lt;br /&gt;
* [[UHD Python API]]&lt;br /&gt;
* [[Getting_Started_with_RFNoC_in_UHD_4.0|RFNoC (UHD 4.x)]]&lt;br /&gt;
* [[RFNoC]] (UHD 3.x)&lt;br /&gt;
&lt;br /&gt;
'''Third Party'''&lt;br /&gt;
* [[GNU Radio]]&lt;br /&gt;
* [[LabVIEW]]&lt;br /&gt;
* [[Matlab/Simulink]]&lt;br /&gt;
* [[OpenBTS]]&lt;br /&gt;
* [[Eurecom OpenAirInterface (OAI)]]&lt;br /&gt;
* [[srsLTE/srsUE]]&lt;br /&gt;
* [[Gqrx]]&lt;br /&gt;
* [[Fosphor]]&lt;br /&gt;
&lt;br /&gt;
'''Reference Architectures'''&lt;br /&gt;
* [[Open Architecture For Radar and EW Research]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[UHD and USRP User Manual|&amp;lt;i class=&amp;quot;fa fa-flag&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; UHD and USRP User Manual]] ==&lt;br /&gt;
'''Software'''&lt;br /&gt;
* [http://files.ettus.com/manual/ UHD Manual (master)]&lt;br /&gt;
* [https://files.ettus.com/manual_archive/ UHD Manual Archive (previous releases)]&lt;br /&gt;
&lt;br /&gt;
'''Motherboards'''&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_b200.html  B200/B210/B200mini/B205mini]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_x3x0.html X300/X310]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp2.html N200/N210]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_n3xx.html N300/N310/N320/N321]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_e3xx.html E310/E312/E313/E320]&lt;br /&gt;
&lt;br /&gt;
'''Daughterboards'''&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_basictx BasicRX/LFRX]&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_basicrx BasicTX/LFTX]&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_cbx CBX]&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_sbx SBX]&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_wbx WBX]&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_ubx UBX]&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_twinrx TwinRX]&lt;br /&gt;
&lt;br /&gt;
'''Other'''&lt;br /&gt;
* [http://files.ettus.com/manual/page_octoclock.html OctoClock]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Application Notes|&amp;lt;i class=&amp;quot;fa fa-file-text-o&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Application Notes]] ==&lt;br /&gt;
Application Notes (AN) and technical articles written by engineers, for engineers. These articles offer experienced analysis, design ideas, reference designs, and tutorials—to make you productive and successful using USRP devices.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Additional Resources|&amp;lt;i class=&amp;quot;fa fa-book&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Additional Resources]] ==&lt;br /&gt;
* [[Suggested Reading|Suggested Reading]]&lt;br /&gt;
* [[Suggested Videos|Suggested Videos]]&lt;br /&gt;
* [[SDR Events]]&lt;br /&gt;
* [[CGRAN]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Technical Support|&amp;lt;i class=&amp;quot;fa fa-life-ring&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Technical Support]] ==&lt;br /&gt;
* [[Email|Email]]&lt;br /&gt;
* [[Mailing Lists|Mailing Lists]]&lt;br /&gt;
* [[Slack|Slack]]&lt;br /&gt;
* [[Internet Relay Chat (IRC)|Internet Relay Chat (IRC)]]&lt;br /&gt;
* [[StackExchange|StackExchange]]&lt;br /&gt;
* [[Ordering and Fulfillment Help | Ordering and Fulfillment Help]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Faq|&amp;lt;i class=&amp;quot;fa fa-info-circle&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; FAQ]] ==&lt;br /&gt;
* [[Technical FAQ|Technical]]&lt;br /&gt;
* [[Licensing FAQ|Licensing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Legacy Products| &amp;lt;i class=&amp;quot;fa fa-hourglass-end&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Legacy Products]] ==&lt;br /&gt;
'''Motherboards'''&lt;br /&gt;
* [[USRP1|USRP1]]&lt;br /&gt;
* [[USRP2|USRP2]]&lt;br /&gt;
* [[E100/E110|E100/E110]]&lt;br /&gt;
* [[B100]]&lt;br /&gt;
&lt;br /&gt;
'''Daughterboards'''&lt;br /&gt;
* [[DBSRX2]]&lt;br /&gt;
* [[TVRX2]]&lt;br /&gt;
* [[XCVR2450]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Knowledge_Base&amp;diff=5265</id>
		<title>Knowledge Base</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Knowledge_Base&amp;diff=5265"/>
				<updated>2022-02-07T15:28:15Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /*  Software Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Ettus Research Knowledge Base (KB). The KB is continuously being updated and expanded. If you have any suggestions, or do not find what you are looking for, then please [http://www.ettus.com/contact Contact Us].&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
== [[Getting Started Guides|&amp;lt;i class=&amp;quot;fa fa-road&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Getting Started Guides]] ==&lt;br /&gt;
&lt;br /&gt;
'''Motherboards'''&lt;br /&gt;
* [[B200/B210/B200mini/B205mini Getting Started Guides|B200/B210/B200mini/B205mini]]&lt;br /&gt;
* [[Ettus USRP E300 Embedded Family Getting Started Guides|E310/E312/E313]]&lt;br /&gt;
* [[E320 Getting Started Guide|E320]]&lt;br /&gt;
* [[N200/N210 Getting Started Guides|N200/N210]]&lt;br /&gt;
* [[USRP N300/N310/N320/N321 Getting Started Guide|N300/N310/N320/N321]]&lt;br /&gt;
* [[X300/X310 Getting Started Guides|X300/X310]]&lt;br /&gt;
* [[USRP-2974 Getting Started Guide|USRP-2974]]&lt;br /&gt;
* [[USRP X410 Getting Started Guide|X410]]&lt;br /&gt;
&lt;br /&gt;
'''Daughterboards'''&lt;br /&gt;
* [[BasicTX/BasicRX Getting Started Guides|BasicTX/BasicRX]]&lt;br /&gt;
* [[CBX Getting Started Guides|CBX]]&lt;br /&gt;
* [[LFTX/LFRX Getting Started Guides|LFTX/LFRX]]&lt;br /&gt;
* [[SBX Getting Started Guides|SBX]]&lt;br /&gt;
* [[TwinRX Getting Started Guides|TwinRX]]&lt;br /&gt;
* [[UBX Getting Started Guides|UBX]]&lt;br /&gt;
* [[WBX Getting Started Guides|WBX]]&lt;br /&gt;
&lt;br /&gt;
'''Other'''&lt;br /&gt;
* [[Getting_Started_with_RFNoC_Development|RFNoC Development]]&lt;br /&gt;
* [[Live SDR Environment Getting Started Guides|Live SDR Environment]]&lt;br /&gt;
* [[OctoClock CDA-2990 Getting Started Guides|OctoClock CDA-2990]]&lt;br /&gt;
* [[Using Ethernet-Based Synchronization on the USRP™ N3xx Devices|White Rabbit]]&lt;br /&gt;
* [[Getting Started with DPDK and UHD|DPDK]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Hardware Resources|&amp;lt;i class=&amp;quot;fa fa-cogs&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Hardware Resources]] ==&lt;br /&gt;
'''Motherboards'''&lt;br /&gt;
* [[B200/B210/B200mini/B205mini]]&lt;br /&gt;
* [[Ettus USRP E300 Embedded Family Hardware Resources|E310/E312/E313]]&lt;br /&gt;
* [[E320|E320]]&lt;br /&gt;
* [[N200/N210]]&lt;br /&gt;
* [[N300/N310]]&lt;br /&gt;
* [[N320/N321]]&lt;br /&gt;
* [[X300/X310]]&lt;br /&gt;
* [[USRP-2974]]&lt;br /&gt;
&lt;br /&gt;
'''Daughterboards'''&lt;br /&gt;
* [[BasicTX/BasicRX]]&lt;br /&gt;
* [[CBX]]&lt;br /&gt;
* [[LFTX/LFRX]]&lt;br /&gt;
* [[SBX]]&lt;br /&gt;
* [[TwinRX]]&lt;br /&gt;
* [[UBX]]&lt;br /&gt;
* [[WBX]]&lt;br /&gt;
&lt;br /&gt;
'''Other'''&lt;br /&gt;
* [[OctoClock CDA-2990]]&lt;br /&gt;
* [[GPSDO]]&lt;br /&gt;
* [[Antennas]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Software Resources|&amp;lt;i class=&amp;quot;fa fa-desktop&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Software Resources]] ==&lt;br /&gt;
'''Ettus Products'''&lt;br /&gt;
* [[UHD]]&lt;br /&gt;
* [[UHD Python API]]&lt;br /&gt;
* [[RFNoC]] (UHD 3.0)&lt;br /&gt;
&lt;br /&gt;
'''Third Party'''&lt;br /&gt;
* [[GNU Radio]]&lt;br /&gt;
* [[LabVIEW]]&lt;br /&gt;
* [[Matlab/Simulink]]&lt;br /&gt;
* [[OpenBTS]]&lt;br /&gt;
* [[Eurecom OpenAirInterface (OAI)]]&lt;br /&gt;
* [[srsLTE/srsUE]]&lt;br /&gt;
* [[Gqrx]]&lt;br /&gt;
* [[Fosphor]]&lt;br /&gt;
&lt;br /&gt;
'''Reference Architectures'''&lt;br /&gt;
* [[Open Architecture For Radar and EW Research]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[UHD and USRP User Manual|&amp;lt;i class=&amp;quot;fa fa-flag&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; UHD and USRP User Manual]] ==&lt;br /&gt;
'''Software'''&lt;br /&gt;
* [http://files.ettus.com/manual/ UHD Manual (master)]&lt;br /&gt;
* [https://files.ettus.com/manual_archive/ UHD Manual Archive (previous releases)]&lt;br /&gt;
&lt;br /&gt;
'''Motherboards'''&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_b200.html  B200/B210/B200mini/B205mini]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_x3x0.html X300/X310]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp2.html N200/N210]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_n3xx.html N300/N310/N320/N321]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_e3xx.html E310/E312/E313/E320]&lt;br /&gt;
&lt;br /&gt;
'''Daughterboards'''&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_basictx BasicRX/LFRX]&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_basicrx BasicTX/LFTX]&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_cbx CBX]&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_sbx SBX]&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_wbx WBX]&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_ubx UBX]&lt;br /&gt;
* [http://files.ettus.com/manual/page_dboards.html#dboards_twinrx TwinRX]&lt;br /&gt;
&lt;br /&gt;
'''Other'''&lt;br /&gt;
* [http://files.ettus.com/manual/page_octoclock.html OctoClock]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Application Notes|&amp;lt;i class=&amp;quot;fa fa-file-text-o&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Application Notes]] ==&lt;br /&gt;
Application Notes (AN) and technical articles written by engineers, for engineers. These articles offer experienced analysis, design ideas, reference designs, and tutorials—to make you productive and successful using USRP devices.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Additional Resources|&amp;lt;i class=&amp;quot;fa fa-book&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Additional Resources]] ==&lt;br /&gt;
* [[Suggested Reading|Suggested Reading]]&lt;br /&gt;
* [[Suggested Videos|Suggested Videos]]&lt;br /&gt;
* [[SDR Events]]&lt;br /&gt;
* [[CGRAN]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Technical Support|&amp;lt;i class=&amp;quot;fa fa-life-ring&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Technical Support]] ==&lt;br /&gt;
* [[Email|Email]]&lt;br /&gt;
* [[Mailing Lists|Mailing Lists]]&lt;br /&gt;
* [[Slack|Slack]]&lt;br /&gt;
* [[Internet Relay Chat (IRC)|Internet Relay Chat (IRC)]]&lt;br /&gt;
* [[StackExchange|StackExchange]]&lt;br /&gt;
* [[Ordering and Fulfillment Help | Ordering and Fulfillment Help]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Faq|&amp;lt;i class=&amp;quot;fa fa-info-circle&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; FAQ]] ==&lt;br /&gt;
* [[Technical FAQ|Technical]]&lt;br /&gt;
* [[Licensing FAQ|Licensing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col-1-3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Legacy Products| &amp;lt;i class=&amp;quot;fa fa-hourglass-end&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Legacy Products]] ==&lt;br /&gt;
'''Motherboards'''&lt;br /&gt;
* [[USRP1|USRP1]]&lt;br /&gt;
* [[USRP2|USRP2]]&lt;br /&gt;
* [[E100/E110|E100/E110]]&lt;br /&gt;
* [[B100]]&lt;br /&gt;
&lt;br /&gt;
'''Daughterboards'''&lt;br /&gt;
* [[DBSRX2]]&lt;br /&gt;
* [[TVRX2]]&lt;br /&gt;
* [[XCVR2450]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=RFNoC&amp;diff=5264</id>
		<title>RFNoC</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=RFNoC&amp;diff=5264"/>
				<updated>2022-02-07T15:27:33Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: MartinBraun moved page RFNoC to RFNoC (UHD 3.0)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[RFNoC (UHD 3.0)]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=RFNoC_(UHD_3.0)&amp;diff=5263</id>
		<title>RFNoC (UHD 3.0)</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=RFNoC_(UHD_3.0)&amp;diff=5263"/>
				<updated>2022-02-07T15:27:32Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: MartinBraun moved page RFNoC to RFNoC (UHD 3.0)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;vertical-align:top; width: 60%;&amp;quot;|RFNoC is a network-distributed heterogeneous processing tool with a focus on enabling FPGA processing in USRP devices. It allows you to move data on and off of an FPGA in a transparent way, thus enabling seamless use of both host-based and FPGA-based processing in an application. It provides a way to leverage FPGA processing capabilities and IP in your application which can scale across multiple FPGAs and devices across a network.&lt;br /&gt;
&lt;br /&gt;
Signal processing algorithms are contained modules known as &amp;quot;Computation Engines&amp;quot; or &amp;quot;RFNoC Blocks&amp;quot;, and an interface wrapper is provided to encapsulate existing or external IP to use with RFNoC. This allows you to import Xilinx™ CoreGen™ IP blocks, for example, and use them immediately in your RFNoC application. The internals of a RFNoC block are wholly independent from any other block, and can be designed with any tool that supports AXI stream interfaces, including VHDL, Verilog, and Xilinx™ Vivado™ HLS.&lt;br /&gt;
&lt;br /&gt;
We are quickly building out the library of ready-to-use RFNoC blocks and already have many available, including the blocks necessary for an OFDM stack (e.g., detection, synchronization, equalizer, packet demodulator).&lt;br /&gt;
&lt;br /&gt;
RFNoC is integrated with the UHD™ software, and all USRP devices from the third-generation on (X300 Series, E300 Series) are supported by RFNoC out-of-the-box. Like UHD, RFNoC is also Free and Open Source Software (LGPL), and the full source code can be found in our public code repositories.&lt;br /&gt;
||[[File:rfnoc.png|250px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Framework and Data Flow Example==&lt;br /&gt;
Below is a figure of the RFNoC stack.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc_stack.png|650px]]&lt;br /&gt;
&lt;br /&gt;
The example below shows basic data flow of an RFNoC application. While this shows one possible data flow, there are many possible combinations from Host block to FPGA block, FPGA block to Host block, Host to Host, FPGA to FPGA, etc. &lt;br /&gt;
&lt;br /&gt;
[[File:gr_rfnoc_ex1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
==Supported Devices==&lt;br /&gt;
* E310/E312&lt;br /&gt;
* E320&lt;br /&gt;
* X300/X310&lt;br /&gt;
* N300/N310/N320/N321&lt;br /&gt;
&lt;br /&gt;
==Sample of Available Blocks==&lt;br /&gt;
*FIFO&lt;br /&gt;
*FFT&lt;br /&gt;
*FIR&lt;br /&gt;
*fosphor (real-time spectrum analyzer)&lt;br /&gt;
*Decimator (Keep 1 in N)&lt;br /&gt;
*Log Power Calculator&lt;br /&gt;
*Radio Interface&lt;br /&gt;
*Vector IIR (moving average)&lt;br /&gt;
*Window multiplier (for FFT)&lt;br /&gt;
*OFDM: Burst detection + synchronization, equalizer, packet demodulator&lt;br /&gt;
*and [https://github.com/EttusResearch/fpga/tree/maint/usrp3/lib/rfnoc more...]&lt;br /&gt;
&lt;br /&gt;
==RFNoC FAQs==&lt;br /&gt;
===FPGA===&lt;br /&gt;
====What is the purpose of the rb_stb signal on NoC Shell?====&lt;br /&gt;
When writing or reading a settings register in a RFNoC block, the block receives a command packet (with the register address / value to write as the payload) and sends out a response packet. The response packet acknowledges the command packet and includes readback data as the payload. In the write case, the readback data is usually discarded. In the read case, the readback data payload will be the value of the register read in the block.&lt;br /&gt;
&lt;br /&gt;
The signal &amp;lt;code&amp;gt;rb_stb&amp;lt;/code&amp;gt;, called readback strobe, is used to control the the output of the response packet. After receiving a command packet, Noc Shell’s command packet processor will not output a response packet unless &amp;lt;code&amp;gt;rb_stb&amp;lt;/code&amp;gt; is asserted. This functionality can be used to throttle the reception of command packets / settings register read/writes. &lt;br /&gt;
&lt;br /&gt;
Most blocks should keep &amp;lt;code&amp;gt;rb_stb&amp;lt;/code&amp;gt; asserted. Note, the &amp;lt;code&amp;gt;rb_stb&amp;lt;/code&amp;gt; bit width is as wide as the number of block ports in use. For example, a two block port RFNoC block should set &amp;lt;code&amp;gt;rb_stb&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;2’b11&amp;lt;/code&amp;gt;, otherwise a command packet timeout will occur.&lt;br /&gt;
&lt;br /&gt;
===UHD===&lt;br /&gt;
====Why do I have a command timeout error?====&lt;br /&gt;
Error message example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;RuntimeError: EnvironmentError: IOError: 0/FIR_0 user_reg_read64() failed: EnvironmentError: IOError: [0/FIR_0] sr_read64() failed: EnvironmentError: IOError: Block ctrl (CE_04_Port_70) no response packet - AssertionError: bool(buff) &lt;br /&gt;
in uint64_t ctrl_iface_impl::wait_for_ack(bool) &lt;br /&gt;
at /home/ettus/src/uhd/host/lib/rfnoc/ctrl_iface.cpp:205&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check &amp;lt;code&amp;gt;ce_clk&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;ce_rst&amp;lt;/code&amp;gt; are correctly connected in &amp;lt;code&amp;gt;rfnoc_ce_auto_inst_&amp;lt;device&amp;gt;.v&amp;lt;/code&amp;gt; file where &amp;lt;code&amp;gt;&amp;lt;device&amp;gt;&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;x300&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;x310&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;e310&amp;lt;/code&amp;gt;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check block is correctly connected to the crossbar. Generally this is only an issue if manually connecting RFNoC block’s signals to the crossbar.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check if Noc Shell’s &amp;lt;code&amp;gt;rb_stb&amp;lt;/code&amp;gt; signal is properly asserted. Note, &amp;lt;code&amp;gt;rb_stb&amp;lt;/code&amp;gt; bit width must be as wide as the number of block ports in use, i.e. if using 2 block ports, &amp;lt;code&amp;gt;rb_stb&amp;lt;/code&amp;gt; must be &amp;lt;code&amp;gt;2’b11&amp;lt;/code&amp;gt;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;RFNoC block is using timed commands (&amp;lt;code&amp;gt;USE_TIMED_CMDS&amp;lt;/code&amp;gt;) with Noc Shell and the command FIFO depth parameter (&amp;lt;code&amp;gt;CMD_FIFO_SIZE&amp;lt;/code&amp;gt;) on Noc Shell is too small. UHD will issue up to 64 commands at once, so set &amp;lt;code&amp;gt;CMD_FIFO_SIZE&amp;lt;/code&amp;gt; to at least &amp;lt;code&amp;gt;8&amp;lt;/code&amp;gt;.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GNU Radio===&lt;br /&gt;
====When do I use an RFNoC FIFO in my flowgraph and which kind if any?====&lt;br /&gt;
&lt;br /&gt;
An '''RFNoC FIFO''' is needed in your flowgraph in the following 2 conditions:&lt;br /&gt;
&lt;br /&gt;
First, if you are running a GNU Radio flowgraph that is structured as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Host block -&amp;gt; RFNoC block -&amp;gt; Host block&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, you need to do either: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Host block -&amp;gt; RFNoC FIFO -&amp;gt; RFNoC Block -&amp;gt; Host block&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-OR- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Host block -&amp;gt; RFNoC Block -&amp;gt; RFNoC FIFO -&amp;gt; Host block&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order doesn't matter. This structure also benefits from having the [http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorial_GRC#243-A-Note-on-the-Throttle-Block GNU Radio Throttle block] in the sequence. The reason behind the need to add the FIFO is because of performance inside of GNU Radio, so that the RX/TX work functions in the GNU Radio RFNoC block implementations run in separate threads.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;RFNoC: FIFO&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;AXI_FIFO_LOOPBACK&amp;lt;/code&amp;gt;) in this case. See the following figure as an example.&lt;br /&gt;
&lt;br /&gt;
[[File:fifo_v01.png|650px]]&lt;br /&gt;
&lt;br /&gt;
Second, in the case where you are transmitting out to the antenna on the X3xx series devices, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Host -&amp;gt; DmaFIFO -&amp;gt; Radio&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-OR-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Host -&amp;gt; DmaFIFO -&amp;gt; DUC -&amp;gt; Radio&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ethernet introduces a latency in flow control from the X3x0 back to the host. The latency will cause underruns unless a large buffer, i.e. &amp;lt;code&amp;gt;DMA_FIFO&amp;lt;/code&amp;gt;, is added to the flowgraph.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;RFNoC: DmaFIFO&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;AXI_DMA_FIFO&amp;lt;/code&amp;gt;) in this case. See the following figures as examples.&lt;br /&gt;
&lt;br /&gt;
[[File:dma_fifo_v01.png|650px]]&lt;br /&gt;
&lt;br /&gt;
-OR-&lt;br /&gt;
&lt;br /&gt;
[[File:dma_fifo_v02.png|650px]]&lt;br /&gt;
&lt;br /&gt;
====Splitting an RFNoC Data Stream in GNU Radio====&lt;br /&gt;
&lt;br /&gt;
'''Copy Block:''' In the RFNoC domain, streams of data can not be split as easily as they are in the GNU Radio domain. The &amp;lt;code&amp;gt;Copy&amp;lt;/code&amp;gt; block depicted in the screenshot below serves the function as a stream splitter at the FPGA-Host boundary. It’s main purpose, when &amp;lt;code&amp;gt;Enabled&amp;lt;/code&amp;gt;, is to copy the samples it is getting at its input and putting then into the output, but here it is also serving as a boundary between a RFNoC-domain and a GNURadio-domain. In the flowgraph above. after this boundary is passed, the data stream can easily be split into the two sinks to have them run simultaneously (standard GNU Radio functionality). It is possible to connect the GNU Radio blocks directly to RFNoC blocks without a &amp;lt;code&amp;gt;Copy&amp;lt;/code&amp;gt; block, but only one would work at a time (the other ones would have to be disabled). Another way to split data streams from the RFNoC-domain is to use the &amp;lt;code&amp;gt;RFNoC: Split Stream&amp;lt;/code&amp;gt; block, which would split the streams in the RFNoC domain, but this is not very useful here as we are moving into the GNURadio-domain.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc_ddc.grc_v02.png|650px]]&lt;br /&gt;
&lt;br /&gt;
====What is the difference between USRP Sink/Source blocks and the RFNoC:Radio block?====&lt;br /&gt;
&lt;br /&gt;
The USRP Source and Sink blocks use the &amp;lt;code&amp;gt;multi_usrp&amp;lt;/code&amp;gt; API, whereas the &amp;lt;code&amp;gt;RFNoC:Radio&amp;lt;/code&amp;gt; block uses the RFNoC API. In general, unless RFNoC features are desired, there is no need to use the &amp;lt;code&amp;gt;RFNoC:Radio&amp;lt;/code&amp;gt; block. The &amp;lt;code&amp;gt;RFNoC:Radio&amp;lt;/code&amp;gt; block is most useful when its output is connected directly to another RFNoC block. Below is a list of differences as well as a GRC screenshot to help differentiate between the two blocks.&lt;br /&gt;
&lt;br /&gt;
Distinctions:&lt;br /&gt;
* The USRP Source/Sink blocks work with any version of UHD, and does not require &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; Out-Of-Tree GNU Radio module is currently needed to use any RFNoC Blocks. This requirement will be removed as more RFNoC components are migrated into UHD.&lt;br /&gt;
* The USRP Source/Sink blocks include a superset of the not only the components of an &amp;lt;code&amp;gt;RFNoC:Radio&amp;lt;/code&amp;gt;, but also &amp;lt;code&amp;gt;DDC/DUC&amp;lt;/code&amp;gt; chains, and the &amp;lt;code&amp;gt;DRAM FIFO&amp;lt;/code&amp;gt; (specific to X3xx series). When using the &amp;lt;code&amp;gt;RFNoC:Radio&amp;lt;/code&amp;gt; block, the &amp;lt;code&amp;gt;DDC/DUC&amp;lt;/code&amp;gt; blocks need to be added explicitly. See the figure below.&lt;br /&gt;
* When using the USRP Source/Sink blocks, it is not possible to connect to any RFNoC blocks. &lt;br /&gt;
* USRP Source/Sink blocks can only be used when using a &amp;lt;code&amp;gt;multi_usrp&amp;lt;/code&amp;gt; API FPGA image (when looking in the USRP FPGA images directory they are the images without the term “RFNOC” in them), or an FPGA image that includes &amp;lt;code&amp;gt;RFNoC:Radio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;RFNoC:DDC/DUC&amp;lt;/code&amp;gt; blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The RFNOC:DmaFIFO block is only needed for the X3xx series devices.&lt;br /&gt;
[[File:rfnocRadio_uhdSinkSource_grc_v07.png|650px]]&lt;br /&gt;
&lt;br /&gt;
===Tools===&lt;br /&gt;
====Xilinx License: Xilinx’s License manager looks for an Ethernet adapter with the name eth0...====&lt;br /&gt;
&lt;br /&gt;
'''Problem:''' The Xilinx Vivado License Manager looks for an Ethernet adapter with the name &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;, but Ubuntu 16.04 and later now use a persistent naming scheme, with interface names such as (e.g. &amp;lt;code&amp;gt;np6s0, enp4s0, enp2s0f0, enp2s0f1, enx00ef5c620935&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
'''Solution:''' Rename the ethernet adapter to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Create this file:&lt;br /&gt;
&amp;lt;code&amp;gt;70-persistent-net.rules&amp;lt;/code&amp;gt; in this &amp;lt;code&amp;gt;/etc/udev/rules.d/&amp;lt;/code&amp;gt; directory&lt;br /&gt;
And adding the following line to the file (substitute &amp;lt;code&amp;gt;xx:xx:xx:xx:xx:xx&amp;lt;/code&amp;gt; for the MAC address of the Ethernet adapter):&lt;br /&gt;
&lt;br /&gt;
    SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;add&amp;quot;, DRIVERS==&amp;quot;?*&amp;quot;, ATTR{address}==&amp;quot;xx:xx:xx:xx:xx:xx&amp;quot;, ATTR{dev_id}==&amp;quot;0x0&amp;quot;, ATTR{type}==&amp;quot;1&amp;quot;, NAME=&amp;quot;eth0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Ubuntu information:&lt;br /&gt;
&lt;br /&gt;
http://askubuntu.com/questions/767786/changing-network-interfaces-name-ubuntu-16-04&lt;br /&gt;
&lt;br /&gt;
Xilinx information:&lt;br /&gt;
&lt;br /&gt;
https://www.xilinx.com/support/answers/60510.html&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
* [[Licensing FAQ]]&lt;br /&gt;
&lt;br /&gt;
==RFNoC Resources==&lt;br /&gt;
*[[Getting_Started_with_RFNoC_Development|Getting Started with RFNoC Development]]&lt;br /&gt;
*[https://drive.google.com/file/d/0B6ccrJyAZaq3MTRDbmVUR0gwVU0/view GNU Radio 2016 Conference Presentation]&lt;br /&gt;
*[https://www.youtube.com/watch?v=8cPd3t88djE Virginia Tech Video Presentation]&lt;br /&gt;
*[https://kb.ettus.com/images/e/eb/RFNoC_Wireless_at_VirginiaTech_2014_Intro.pdf Virginia Tech Presentation - Introduction to RFNoC]&lt;br /&gt;
*[https://kb.ettus.com/images/1/1e/RFNoC_Wireless_at_VirginiaTech_2014_Host.pdf Virginia Tech Presentation - RFNoC Deep Dive: Host Side]&lt;br /&gt;
*[https://kb.ettus.com/images/7/78/RFNoC_Wireless_at_VirginiaTech_2014_FPGA.pdf Virginia Tech Presentation - RFNoC Deep Dive: FPGA]&lt;br /&gt;
*[https://conferences.sigcomm.org/sigcomm/2013/papers/srif/p45.pdf sigcom 2013 Paper]&lt;br /&gt;
&lt;br /&gt;
[[Category:Software Resources]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5262</id>
		<title>Using the RFNoC Replay Block in UHD 4</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5262"/>
				<updated>2022-02-07T15:19:16Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-642b'''&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
This application note guides a user through basic use of the RFNoC Replay block&lt;br /&gt;
in UHD 4.x and explains how to run the UHD Replay example. This example covers&lt;br /&gt;
the USRP X410, X310/X300, N300/N310/N320 and E320 devices. For UHD 3.x, please&lt;br /&gt;
refer to [[Using_the_RFNoC_Replay_Block|the UHD 3.x replay block Application Note]].&lt;br /&gt;
&lt;br /&gt;
An introduction to RFNoC with UHD 4.0 and above can be found [[Getting_Started_with_RFNoC_in_UHD_4.0|here]].&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
The Replay block is an RFNoC block that allows recording and playback of&lt;br /&gt;
arbitrary data using DRAM on the USRP hardware as a buffer. To use the Replay&lt;br /&gt;
block, it must be instantiated in the design and connected to the DRAM interface.&lt;br /&gt;
&lt;br /&gt;
The replay block is a standard feature of UHD and RFNoC, and a custom compile of&lt;br /&gt;
UHD is not required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs, so when using these images,&lt;br /&gt;
the following examples can be run without any manual builds of UHD or FPGA images.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
To follow this application note, you need a device with a replay block instantiated,&lt;br /&gt;
and a UHD version recent enough to have the full support for the replay block&lt;br /&gt;
(UHD 4.2 and beyond). To test for the replay block capabilities, connect and&lt;br /&gt;
enable your USRP device, and run the following command:&lt;br /&gt;
&lt;br /&gt;
    uhd_usrp_probe --args &amp;lt;device args&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Depending on your device, the output could look like this (truncated):&lt;br /&gt;
&lt;br /&gt;
     _____________________________________________________&lt;br /&gt;
    /&lt;br /&gt;
    |       Device: X400-Series Device&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Mboard: ni-x4xx-&amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   pid: 1040&lt;br /&gt;
    |   |   rev: 4&lt;br /&gt;
    |   |   rev_compat: 4&lt;br /&gt;
    |   |   serial: &amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   MPM Version: 4.0&lt;br /&gt;
    |   |   FPGA Version: 7.6&lt;br /&gt;
    |   |   FPGA git hash: &amp;lt;hash&amp;gt;.clean&lt;br /&gt;
    |   |   RFNoC capable: Yes&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   Time sources:  internal, external, qsfp0, gpsdo&lt;br /&gt;
    |   |   Clock sources: mboard, internal, external, nsync, gpsdo&lt;br /&gt;
    |   |   Sensors: ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/DDC#0&lt;br /&gt;
    |   |   * 0/DDC#1&lt;br /&gt;
    |   |   * 0/DUC#0&lt;br /&gt;
    |   |   * 0/DUC#1&lt;br /&gt;
    |   |   * 0/Radio#0&lt;br /&gt;
    |   |   * 0/Radio#1&lt;br /&gt;
    |   |   * 0/Replay#0&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/SEP#0:0==&amp;gt;0/DUC#0:0&lt;br /&gt;
    |   |   * 0/DUC#0:0==&amp;gt;0/Radio#0:0&lt;br /&gt;
    |   |   * 0/Radio#0:0==&amp;gt;0/DDC#0:0&lt;br /&gt;
    |   |   * 0/DDC#0:0==&amp;gt;0/SEP#0:0&lt;br /&gt;
    |   |   * 0/SEP#1:0==&amp;gt;0/DUC#0:1&lt;br /&gt;
    |   |   * 0/DUC#0:1==&amp;gt;0/Radio#0:1&lt;br /&gt;
    |   |   * 0/Radio#0:1==&amp;gt;0/DDC#0:1&lt;br /&gt;
    |   |   * 0/DDC#0:1==&amp;gt;0/SEP#1:0&lt;br /&gt;
    |   |   * 0/SEP#2:0==&amp;gt;0/DUC#1:0&lt;br /&gt;
    |   |   * 0/DUC#1:0==&amp;gt;0/Radio#1:0&lt;br /&gt;
    |   |   * 0/Radio#1:0==&amp;gt;0/DDC#1:0&lt;br /&gt;
    |   |   * 0/DDC#1:0==&amp;gt;0/SEP#2:0&lt;br /&gt;
    |   |   * 0/SEP#3:0==&amp;gt;0/DUC#1:1&lt;br /&gt;
    |   |   * 0/DUC#1:1==&amp;gt;0/Radio#1:1&lt;br /&gt;
    |   |   * 0/Radio#1:1==&amp;gt;0/DDC#1:1&lt;br /&gt;
    |   |   * 0/DDC#1:1==&amp;gt;0/SEP#3:0&lt;br /&gt;
    |   |   * 0/SEP#4:0==&amp;gt;0/Replay#0:0&lt;br /&gt;
    |   |   * 0/Replay#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
    |   |   * 0/SEP#5:0==&amp;gt;0/Replay#0:1&lt;br /&gt;
    |   |   * 0/Replay#0:1==&amp;gt;0/SEP#5:0&lt;br /&gt;
    |   |   * 0/SEP#6:0==&amp;gt;0/Replay#0:2&lt;br /&gt;
    |   |   * 0/Replay#0:2==&amp;gt;0/SEP#6:0&lt;br /&gt;
    |   |   * 0/SEP#7:0==&amp;gt;0/Replay#0:3&lt;br /&gt;
    |   |   * 0/Replay#0:3==&amp;gt;0/SEP#7:0&lt;br /&gt;
&lt;br /&gt;
The output tells us that this USRP has a Replay block instantiated (&amp;lt;code&amp;gt;0/Replay#0&amp;lt;/code&amp;gt;).&lt;br /&gt;
It has four static connections to stream endpoints, which also tells us that&lt;br /&gt;
this is a four-port replay block.&lt;br /&gt;
&lt;br /&gt;
If your device does not report a replay block, then you need to build and load&lt;br /&gt;
an FPGA image which includes this block. See ... for instructions on how to do&lt;br /&gt;
this before you proceed. If it does report a block, you can move to the next&lt;br /&gt;
section.&lt;br /&gt;
&lt;br /&gt;
==Running the Example==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; example assumes that you have a&lt;br /&gt;
file containing the samples you wish to replay. This could be generated in&lt;br /&gt;
advance or recorded using &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt; or another method. For&lt;br /&gt;
this demonstration, we'll create a simple Python program (&amp;lt;code&amp;gt;sample_gen.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
to generate some samples to use:&lt;br /&gt;
&lt;br /&gt;
    import math&lt;br /&gt;
    import struct&lt;br /&gt;
    &lt;br /&gt;
    SAMPLE_RATE = 200.0e6        # Sample rate in Hz&lt;br /&gt;
    FREQUENCY   = 500.0e3        # Frequency of sinusoid to generate, in Hz&lt;br /&gt;
    NUM_SAMPLES = 16000          # Number of samples to generate&lt;br /&gt;
    AMPLITUDE   = 0.5            # Amplitude of the signal (from 0 to 1.0)&lt;br /&gt;
    FILE_NAME   = 'samples.dat'&lt;br /&gt;
    &lt;br /&gt;
    file = open(FILE_NAME, 'wb')&lt;br /&gt;
    &lt;br /&gt;
    for i in range(NUM_SAMPLES):&lt;br /&gt;
        I = int((2**15-1) * AMPLITUDE * math.cos(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        Q = int((2**15-1) * AMPLITUDE * math.sin(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        file.write(struct.pack('&amp;lt;2h', I, Q))&lt;br /&gt;
    &lt;br /&gt;
    file.close()&lt;br /&gt;
&lt;br /&gt;
This program generates a file named &amp;lt;code&amp;gt;samples.dat&amp;lt;/code&amp;gt; that contains 16000&lt;br /&gt;
samples (40 periods) of a 500&amp;amp;nbsp;kHz tone sampled at a rate of 200&amp;amp;nbsp;MHz.&lt;br /&gt;
Each sample is saved in &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt; format (signed complex with 16-bit real&lt;br /&gt;
and 16-bit imaginary components). We can run the program by invoking python from&lt;br /&gt;
the command line.&lt;br /&gt;
&lt;br /&gt;
    $ python ./sample_gen.py&lt;br /&gt;
&lt;br /&gt;
To run the UHD Replay example, enter a command like the following (the path to&lt;br /&gt;
the examples depends on your installation method, for a normal installation via&lt;br /&gt;
apt-get, examples will be located in &amp;lt;code&amp;gt;/usr/lib/uhd/examples&amp;lt;/code&amp;gt; or&lt;br /&gt;
&amp;lt;code&amp;gt;/usr/local/lib/uhd/examples&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
    $ cd /path/to/examples&lt;br /&gt;
    $ ./replay_samples_from_file --args &amp;lt;device args&amp;gt; --freq 915e6 --gain 10 --file samples.dat --rate 200e6&lt;br /&gt;
&lt;br /&gt;
This example would stream the samples from the file to the Replay block on the&lt;br /&gt;
FPGA, where they are recorded into the USRP's on-board DRAM. Then, the Replay block&lt;br /&gt;
will play the samples to the radio continuously with a base frequency of 915 MHz,&lt;br /&gt;
creating a tone at 915.5 MHz. Press &amp;lt;code&amp;gt;Ctrl+C&amp;lt;/code&amp;gt; to stop transmitting.&lt;br /&gt;
Alternatively, use the &amp;lt;code&amp;gt;--nsamps&amp;lt;/code&amp;gt; command line argument to transmit&lt;br /&gt;
a certain number of samples before returning to the command line. Use the&lt;br /&gt;
&amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; argument to see a full list of arguments.&lt;br /&gt;
&lt;br /&gt;
The advantage of this example compared to directly streaming the file to the&lt;br /&gt;
device is twofold:&lt;br /&gt;
&lt;br /&gt;
* The initial upload to DRAM can happen at any link rate. Even when using 1 GbE, this example will work.&lt;br /&gt;
* Once uploaded, the host computer is basically idle. The FPGA will handle the streaming to the radio front-end.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp source code]&lt;br /&gt;
for &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; may be considered an example&lt;br /&gt;
for best practices on how to use the replay block.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Using the Replay Block==&lt;br /&gt;
&lt;br /&gt;
This block works like a record and playback buffer that uses DRAM on the USRP to&lt;br /&gt;
store samples.&lt;br /&gt;
Data can be streamed to the block, like to any other RFNoC block.&lt;br /&gt;
&lt;br /&gt;
Refer the [https://files.ettus.com/manual/classuhd_1_1rfnoc_1_1replay__block__control.html manual of the replay block controller]&lt;br /&gt;
for a comprehensive description of its features and API calls.&lt;br /&gt;
&lt;br /&gt;
In the following, we shall use the C++ API to demonstrate the most important&lt;br /&gt;
API calls. We will assume there is a replay block controller called&lt;br /&gt;
&amp;lt;code&amp;gt;replay_ctrl&amp;lt;/code&amp;gt; available in the current context, and it is of type&lt;br /&gt;
&amp;lt;code&amp;gt;uhd::rfnoc::replay_block_control::sptr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Recording Data===&lt;br /&gt;
&lt;br /&gt;
Before streaming data to the replay block, it needs to be configured for recording:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record(buffer_start_byte_address, buffer_size_in_bytes, replay_chan);&lt;br /&gt;
&lt;br /&gt;
This tells the Replay block that it should start recording any data it receives&lt;br /&gt;
on port &amp;lt;code&amp;gt;port&amp;lt;/code&amp;gt; into the DRAM at byte offset &amp;lt;code&amp;gt;buffer_start_byte_address&amp;lt;/code&amp;gt;&lt;br /&gt;
and should use up to &amp;lt;code&amp;gt;buffer_size_in_bytes&amp;lt;/code&amp;gt; bytes. Once the buffer is&lt;br /&gt;
filled, recording automatically stops. Care should be taken to configure the&lt;br /&gt;
memory buffers so that they do not overlap if more than one Replay block or&lt;br /&gt;
buffer is being used simultaneously.&lt;br /&gt;
&lt;br /&gt;
Call this once for every port that you expect to stream data into.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Care should be taken to not transfer more data to the Replay block&lt;br /&gt;
than the size of the record buffer. Additional data is not accepted or dropped&lt;br /&gt;
by the replay block, but flow control will cause data to back up in the RF network on the FPGA.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The amount of memory available to the Replay block is limited by the&lt;br /&gt;
size of the DRAM on the USRP and how the memory interface is configured on the USRP.&lt;br /&gt;
For example, the &amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; IP used by the X310 is&lt;br /&gt;
configured to give each connected device an address space of 32&amp;amp;nbsp;MiB. As a&lt;br /&gt;
result, the Replay block will be limited to this amount of memory. The&lt;br /&gt;
&amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; file must be modified if more than 32&amp;amp;nbsp;MiB needs to be buffered.&lt;br /&gt;
&lt;br /&gt;
To restart recording from the same offset, the following API call can be used:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record_restart(replay_chan);&lt;br /&gt;
&lt;br /&gt;
This resets the record pointer to point back to the beginning of the buffer and&lt;br /&gt;
it resets the internal counters that track how much data has been recorded. If&lt;br /&gt;
a previous recording has taken place then it is a good idea to ensure that&lt;br /&gt;
stale data was not queued up in the RF network on the FPGA from a previous run.&lt;br /&gt;
The &amp;lt;code&amp;gt;replay_samples_from_file&amp;lt;/code&amp;gt; example does this by calling&lt;br /&gt;
&amp;lt;code&amp;gt;record_restart()&amp;lt;/code&amp;gt; then waiting to see if any new data shows up&lt;br /&gt;
unexpectedly in the record buffer. If so, it restarts recording then waits&lt;br /&gt;
again to see if data continues to appear.&lt;br /&gt;
&lt;br /&gt;
You can determine when all data has been received by checking the status of the&lt;br /&gt;
record fullness.&lt;br /&gt;
&lt;br /&gt;
    // Wait for recording to complete&lt;br /&gt;
    while (replay_ctrl-&amp;gt;get_record_fullness(replay_chan) &amp;lt; num_bytes_expected)&lt;br /&gt;
        std::this_thread::sleep_for(100ms);&lt;br /&gt;
&lt;br /&gt;
===Playing back Data===&lt;br /&gt;
&lt;br /&gt;
Prior to playing back recorded data, it is necessary to configure the base&lt;br /&gt;
address and size of the playback buffer. To play back previously recorded data,&lt;br /&gt;
set the start address to the same address that was used for the record buffer&lt;br /&gt;
and set the size of the playback buffer to the match the amount of data that&lt;br /&gt;
was recorded. Note that the record and playback buffers do not need to be the&lt;br /&gt;
same, allowing a single Replay block to both record and playback to different&lt;br /&gt;
regions of memory simultaneously.&lt;br /&gt;
&lt;br /&gt;
    // Configure the Replay block to play back everything that was recorded&lt;br /&gt;
    num_bytes_recorded = replay_ctrl-&amp;gt;get_record_fullness(replay_chan);&lt;br /&gt;
    replay_ctrl-&amp;gt;config_play(buffer_start_byte_address, num_bytes_recorded, replay_chan);&lt;br /&gt;
&lt;br /&gt;
To play back the data in the playback buffer, issue the appropriate UHD stream command.&lt;br /&gt;
Playback automatically wraps around to the start of the buffer if more data is&lt;br /&gt;
requested than the size of the playback buffer.&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;STREAM_MODE_START_CONTINUOUS&amp;lt;/code&amp;gt; causes playback to continue indefinitely&lt;br /&gt;
until explicitly stopped. &amp;lt;code&amp;gt;STREAM_MODE_NUM_SAMPS_AND_DONE&amp;lt;/code&amp;gt; causes only&lt;br /&gt;
the specified number of samples to be played once. The &amp;lt;code&amp;gt;num_samps&amp;lt;/code&amp;gt;&lt;br /&gt;
parameter is a 28-bit value, limiting this mode of playback to 2&amp;lt;sup&amp;gt;28&amp;lt;/sup&amp;gt;&lt;br /&gt;
words at a time. Playback can be stopped by issuing a stop command.&lt;br /&gt;
&lt;br /&gt;
    stream_cmd.stream_mode = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd);&lt;br /&gt;
&lt;br /&gt;
This will stop playback at the end of the next DRAM read after the command is&lt;br /&gt;
received (DRAM reads are not aborted mid-transaction). As a result, some data&lt;br /&gt;
will continue to stream from the Replay block after the stop command is issued&lt;br /&gt;
while waiting for the DRAM read to complete and for all the internal buffers to&lt;br /&gt;
empty.&lt;br /&gt;
&lt;br /&gt;
When using the C++ API, the &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; API call is a useful shorthand&lt;br /&gt;
for configuring playback and submitting the stream command at the same time:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;play(buffer_start_byte_address, num_bytes_to_play, replay_chan, start_time, repeat);&lt;br /&gt;
&lt;br /&gt;
In either case, the start time is optional. When given, the first sample to leave&lt;br /&gt;
the block on playback is tagged with this timestamp.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Memory alignment and word sizes===&lt;br /&gt;
&lt;br /&gt;
There are two memory alignment values that need to be considered when dealing&lt;br /&gt;
with the replay block. The first is the word size, which is the minimum number of&lt;br /&gt;
bytes per transaction. For all default configurations, the word size is 64 bits,&lt;br /&gt;
which means that only even numbers of samples can be recorded or played back&lt;br /&gt;
when using 16-bit complex samples (at 4 bytes per sample). Use the &amp;lt;code&amp;gt;get_word_size()&amp;lt;/code&amp;gt;&lt;br /&gt;
API call to identify the correct word size.&lt;br /&gt;
&lt;br /&gt;
The second alignment value is the memory's page boundaries. The start addresses&lt;br /&gt;
for record and replay must fall onto a 4 kiB memory boundary to ensure correct&lt;br /&gt;
alignment of data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Building Custom FPGA Images with a Replay Block==&lt;br /&gt;
&lt;br /&gt;
===Configure the Default Shell===&lt;br /&gt;
&lt;br /&gt;
Before you begin, make sure you are using the &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt; shell. See [[Software_Development_on_the_E3xx_USRP_-_Building_RFNoC_UHD_/_GNU_Radio_/_gr-ettus_from_Source#Reconfigure_Default_Shell|Reconfigure Default Shell]] in AN-315 for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
===Cloning the Repository===&lt;br /&gt;
&lt;br /&gt;
Note: Cloning the repository is only required when building custom FPGA images.&lt;br /&gt;
If the replay block is already built into the USRP's bit file, this is not&lt;br /&gt;
required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs.&lt;br /&gt;
&lt;br /&gt;
If you do require access to the source code, e.g. to build an FPGA image with a&lt;br /&gt;
custom replay block configuration, run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/EttusResearch/uhd.git&lt;br /&gt;
&lt;br /&gt;
For the rest of the Application Note, we assume the repository was cloned into&lt;br /&gt;
the location ~/src/uhd.&lt;br /&gt;
&lt;br /&gt;
===Installing the FPGA Tools===&lt;br /&gt;
&lt;br /&gt;
In order to build the FPGA image for the intended USRP product, you will need&lt;br /&gt;
to have the Xilinx development tools installed. The specific version required&lt;br /&gt;
depends on the UHD version. Refer to the&lt;br /&gt;
[https://files.ettus.com/manual/md_usrp3_build_instructions.html manual] for the&lt;br /&gt;
correct version for your UHD version, and the installation instructions for&lt;br /&gt;
Vivado in order to install these tools. It is recommended that you use the&lt;br /&gt;
default install location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Building the FPGA==&lt;br /&gt;
&lt;br /&gt;
In order to use the Replay block, it must be built into the FPGA image for the&lt;br /&gt;
USRP you plan to use. This is currently a manual step. The instructions below&lt;br /&gt;
are for the X310, but similar instructions apply to other RFNoC-capable&lt;br /&gt;
devices.&lt;br /&gt;
&lt;br /&gt;
To create a custom FPGA image with a replay, you need to create an image core file.&lt;br /&gt;
The following lines are the relevant lines from the&lt;br /&gt;
[https://github.com/EttusResearch/uhd/blob/master/fpga/usrp3/top/x300/x310_rfnoc_image_core.yml X310 default image core file]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      # ... all the other stream endpoints...&lt;br /&gt;
      ep4:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
      ep5:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
    &lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      # ... all the other blocks...&lt;br /&gt;
      replay0:&lt;br /&gt;
        block_desc: 'replay.yml'&lt;br /&gt;
        parameters:&lt;br /&gt;
          NUM_PORTS: 2&lt;br /&gt;
    &lt;br /&gt;
     connections:&lt;br /&gt;
      # ...connections for all the other blocks...&lt;br /&gt;
      # ep4 to replay0(0)&lt;br /&gt;
      - { srcblk: ep4,     srcport: out0,  dstblk: replay0, dstport: in_0 }&lt;br /&gt;
      # replay0(0) to ep4&lt;br /&gt;
      - { srcblk: replay0, srcport: out_0, dstblk: ep4,     dstport: in0  }&lt;br /&gt;
      # ep5 to replay0(1)&lt;br /&gt;
      - { srcblk: ep5,     srcport: out0,  dstblk: replay0, dstport: in_1 }&lt;br /&gt;
      # replay0(1) to ep5&lt;br /&gt;
      - { srcblk: replay0, srcport: out_1, dstblk: ep5,     dstport: in0  }&lt;br /&gt;
      # BSP Connections&lt;br /&gt;
      - { srcblk: replay0, srcport: axi_ram, dstblk: _device_, dstport: dram }     MEM_ADDR_W: 30&lt;br /&gt;
    clk_domains:&lt;br /&gt;
        # ...all other clock domains...&lt;br /&gt;
        - { srcblk: _device_, srcport: dram,  dstblk: replay0, dstport: mem  }&lt;br /&gt;
&lt;br /&gt;
As you can see, the replay block requires configuration in up to four sections:&lt;br /&gt;
* For maximum flexibility, every port of the replay block will receive its own stream endpoint. This is not a requirement of the replay block, but allows its flexible use.&lt;br /&gt;
* Of course, the block needs to be declared in the &amp;lt;code&amp;gt;noc_blocks&amp;lt;/code&amp;gt; section.&lt;br /&gt;
* It must be connected to the stream endpoints in the &amp;lt;code&amp;gt;connections&amp;lt;/code&amp;gt; section, as well as to the DRAM banks (BSP connection).&lt;br /&gt;
* Finally, the clock domain needs to be connected.&lt;br /&gt;
&lt;br /&gt;
When the YAML image core file is complete, save it, e.g., as x310_replay_image_core.yml,&lt;br /&gt;
and pass it to the image builder:&lt;br /&gt;
&lt;br /&gt;
    rfnoc_image_builder -y x310_replay_image_core.yml&lt;br /&gt;
&lt;br /&gt;
This will create a bitfile that contains the replay block. It can be loaded onto&lt;br /&gt;
the device using the &amp;lt;code&amp;gt;uhd_image_loader&amp;lt;/code&amp;gt; tool:&lt;br /&gt;
&lt;br /&gt;
    uhd_image_loader --args type=x300,addr=&amp;lt;ip address&amp;gt; --fpga-path=/path/to/usrp_x310_fpga_HG.bit&lt;br /&gt;
&lt;br /&gt;
When this is complete, the replay block is ready to use.&lt;br /&gt;
&lt;br /&gt;
==Source files==&lt;br /&gt;
&lt;br /&gt;
For reference, the following files implement the replay block:&lt;br /&gt;
&lt;br /&gt;
* Verilog/HDL sources: https://github.com/EttusResearch/uhd/tree/master/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_replay&lt;br /&gt;
* C++ Block controller sources (header, block controller, Python bindings, unit tests):&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/include/uhd/rfnoc/replay_block_control.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control.cpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control_python.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/tests/rfnoc_block_tests/replay_block_test.cpp&lt;br /&gt;
* Example: https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_in_UHD_4.0&amp;diff=5261</id>
		<title>Getting Started with RFNoC in UHD 4.0</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_in_UHD_4.0&amp;diff=5261"/>
				<updated>2022-02-07T15:18:11Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* Streaming Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number and Authors==&lt;br /&gt;
'''AN-400''' by Sugandha Gupta, Brent Stapleton, Wade Fife, and Michael Dickens&lt;br /&gt;
&amp;lt;!-- Internal use only: please do keep this updated!&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2020-02-14&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Sugandha Gupta&amp;lt;br&amp;gt;Brent Stapleton&amp;lt;br&amp;gt;Wade Fife&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;| Initial creation&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2020-09-14&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Wade Fife&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;| Added introduction to RFNoC&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2021-02-18&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Michael Dickens&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;| Minor but critical tweak of `srcport` per https://github.com/EttusResearch/uhd/issues/416&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2021-03-02&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Michael Dickens&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;| re-tweak `srcport` per certain USRPs as noted&lt;br /&gt;
|}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This guide describes how to get started with FPGA and Software development for RF Network-on-Chip (RFNoC™). It gives a brief introduction to RFNoC and explains the steps needed to generate, build, and use custom RFNoC images and introduces the process for creating and integrating new RFNoC IP blocks.&lt;br /&gt;
&amp;lt;!-- A guide to migrating a block created in earlier versions of RFNoC (UHD 3) to RFNoC in UHD 4 can be found in the RFNoC Migration Guide. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Intended Audience==&lt;br /&gt;
This guide is written for hardware and software engineers who want to use the RF Network-on-Chip (RFNoC™) architecture or want to develop intellectual property (IP) using the RFNoC architecture. For more details on the architecture please refer to the [https://files.ettus.com/app_notes/RFNoC_Specification.pdf RFNoC Specification].&lt;br /&gt;
&lt;br /&gt;
This guide assumes that you have some basic familiarity with USRPs, such as connecting them, configuring your network interfaces, etc., so that your USRP is ready for use. See the [https://kb.ettus.com/Getting_Started_Guides Getting Started Guide] for your USRP if you are just getting started with USRPs.&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
The RFNoC code base is open source, including code that executes on the host, as well as code targeted to the USRP hardware (FPGA and microcontroller firmware). RFNoC is available under the open-source GNU Lesser General Public License (LGPL). For more information on our licensing policy, please contact [mailto:info@ettus.com info@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
RFNoC is currently supported on the USRP X410 series, and all the Generation-3 USRPs in the X series (X3xx), E series (E3xx) and  N series (N3xx). For details on the hardware, software, and process required to build custom USRP FPGA images that include RFNoC blocks, see the [http://files.ettus.com/manual/md_usrp3_build_instructions.html USRP Build Documentation] in the UHD and USRP Manual.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you learn how to build an FPGA image for your USRP and download it to the device before starting this guide if you have never done so before. This will ensure you have all the necessary software installed.&lt;br /&gt;
&lt;br /&gt;
==Introduction to RFNoC==&lt;br /&gt;
&lt;br /&gt;
===What is RFNoC?===&lt;br /&gt;
&lt;br /&gt;
RFNoC™ is a heterogeneous processing framework used to implement high-throughput DSP in the FPGA for Software Defined Radio (SDR) systems in an easy-to-use and flexible way. It provides all the infrastructure required to insert signal-processing IP into the FPGA logic and communicate with it through software. It also provides highly-optimized software and FPGA code to enable high-performance streaming to and from IP blocks on the USRP device.&lt;br /&gt;
&lt;br /&gt;
The IP blocks in RFNoC are called ''RFNoC blocks''. The RFNoC blocks wrap the IP and provide a custom interface to the RFNoC infrastructure through a tool-generated interface called the ''NoC Shell''. Many standard blocks are included in UHD 4.0. These blocks enable typical operation of the USRP and allow RFNoC to connect to the different hardware components of the USRP. Several of the included blocks are described in the section [[#Available RFNoC Blocks|Available RFNoC Blocks]]. You can mix the available blocks for your application, or develop your own custom RFNoC blocks with your own IP to open up new applications. The NoC Shell hides the complexity of RFNoC from your block, making it easy to plug your IP into the USRP.&lt;br /&gt;
&lt;br /&gt;
RFNoC is used on all Generation-3 USRPs and is installed with UHD 4.0. USRPs ship with a default RFNoC image that can be used as is, or can be modified and/or customized to suite your application. So if you're using a modern USRP, it's running RFNoC under the hood even if you haven't customized anything.&lt;br /&gt;
&lt;br /&gt;
===Example RFNoC Image===&lt;br /&gt;
&lt;br /&gt;
The diagram below shows a simplified view of an RFNoC FPGA image that is similar to the default images available on USRPs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:simplified_rfnoc_image_uhd_4.png|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that an RFNoC FPGA is made up of several components. A description of each one is provided below.&lt;br /&gt;
&lt;br /&gt;
* '''RFNoC Image Core'''&amp;lt;br&amp;gt;This is the main block of the RFNoC framework and instantiates the components that make up RFNoC. The contents of the image core are described by an RFNoC image core YAML file, and the Verilog code that represents this block is automatically generated by the RFNoC Image Builder tool based on the YAML description. In other words, you provide a description of what you want to be included in RFNoC and the tools generate the code to implement that description.&lt;br /&gt;
* '''Transport Adapter'''&amp;lt;br&amp;gt;The transport adapter is a component of the USRP that allows communication with an outside interface. These vary depending on the USRP model in use. For example, this could be a 10 Gbps Ethernet link for SFP+ port of the USRP, or a cabled PCIe interface.&lt;br /&gt;
* '''CHDR Crossbar'''&amp;lt;br&amp;gt;The CHDR crossbar is a dynamic router for RFNoC traffic. This is a high-throughput crossbar designed for RF streaming applications. It is reconfigurable at run time via software and can be used to configure routes between stream endpoints and transport adapters. The number of ports available is configurable by changing the RFNoC image core YAML file. CHDR (Condensed Hierarchical Datagram for RFNoC) refers to the network protocol that is used for RFNoC.&lt;br /&gt;
* '''Stream Endpoint (SEP)'''&amp;lt;br&amp;gt;The stream endpoint (SEP) provides the high-level flow control for traffic over the network. It also separates control traffic from data traffic to create a separate AXIS-Ctrl network for control traffic. Control traffic refers to things like register reads and writes for configuring and monitoring RFNoC blocks.&lt;br /&gt;
* '''Control Crossbar'''&amp;lt;br&amp;gt;The control crossbar is similar to the CHDR Crossbar, but is only for control traffic. It has a much lower throughput and has been optimized for control-traffic, making it much less resource intensive than the CHDR crossbar.&lt;br /&gt;
* '''Other Blocks'''&amp;lt;br&amp;gt;The DDC (digital down converter), DUC (digital up converter), and Radio in this example are RFNoC blocks that are included with UHD. These are standard components included the default USRP images and enable typical RF applications. Most blocks only communicate with the RFNoC network, but some blocks require access to external hardware interfaces, such as the radio or DRAM. In this example, the radio blocks connect to the radio hardware on the USRP.&lt;br /&gt;
&lt;br /&gt;
===Static vs. Dynamic Routing===&lt;br /&gt;
&lt;br /&gt;
The routes between blocks that go through the crossbar are ''dynamic''. That is, the routes can be changed at run time and are controlled by software. The CHDR crossbar is very powerful in that it allows any of its ports to communicate with each other. It allows for streaming between blocks on the same FPGA, between RFNoC blocks and a host computer, or between blocks on different USRPs. New signal processing chains can be added to this crossbar, as needed, for the application.&lt;br /&gt;
&lt;br /&gt;
Similarly, the control crossbar supports dynamic routing, allowing any RFNoC block to send control traffic to any other RFNoC block, even to blocks on a different USRP. Control traffic can also be sent from the host computer to the RFNoC blocks, for example to read/write registers. Additionally, RFNoC blocks can send control to the host computer. In this example, the Radio block sends control traffic to the computer to report specific events, such as overflow or underflow in the radio.&lt;br /&gt;
&lt;br /&gt;
The block connections that don't go through a crossbar (e.g., the connection from the radio to the DDC, and the DDC to the stream endpoint, etc.) are ''static'' connections. That is, they cannot be changed at run time. Making a connection static has the advantage that it does not require additional ports on the crossbar and that the connection can be made much simpler because the high-level network flow-control protocol used by CHDR is not required. This reduces latency between blocks and leads to FPGA resource savings, allowing more logic be included in a single FPGA image. The static connections are described by the RFNoC image core YAML file. In order to change the static connections, the YAML description needs to be updated and the FPGA image needs to be rebuilt.&lt;br /&gt;
&lt;br /&gt;
===RFNoC Customization===&lt;br /&gt;
&lt;br /&gt;
The RFNoC framework makes it easy to customize the RFNoC image and add your own IP blocks. Later on in this guide, we'll explore how you can customize the RFNoC image to add or remove blocks, as well as create your own RFNoC blocks and include them in your FPGA builds. This allows you to create highly-customized and high-performance FPGA images for your USRP.&lt;br /&gt;
&lt;br /&gt;
==Setting Up==&lt;br /&gt;
To use RFNoC in UHD 4.0 you need to perform the following:&lt;br /&gt;
&lt;br /&gt;
* Clone the UHD repository&lt;br /&gt;
* Install UHD&lt;br /&gt;
* Update your device's filesystem and FPGA image&lt;br /&gt;
&lt;br /&gt;
Building custom RFNoC images requires the FPGA source code and build system. These are included in the UHD repository, located in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;&amp;lt;/code&amp;gt; refers to the location where you cloned the UHD repository.&lt;br /&gt;
&lt;br /&gt;
Please see the [http://files.ettus.com/manual/page_install.html Binary Installation] for UHD installation documentation or [https://files.ettus.com/manual/page_build_guide.html Building and Installing] instructions to build and install UHD from source. Additionally, [[Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux|AN-445]] provides step-by step instructions for cloning the repository and installing UHD from source.&lt;br /&gt;
&lt;br /&gt;
Starting with UHD 3.15, RFNoC is enabled by default, and starting with UHD 4.0, it can no longer be disabled, so no additional instructions are necessary to install support for RFNoC in UHD.&lt;br /&gt;
&lt;br /&gt;
Many of the UHD utilities we will use in this guide are based on Python. Please ensure that your &amp;lt;code&amp;gt;PYTHONPATH&amp;lt;/code&amp;gt; is set correctly. If not set correctly, you will see errors indicating that Python could not find the &amp;lt;code&amp;gt;uhd&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;image_builder&amp;lt;/code&amp;gt; libraries. The correct setting may depend on where you installed UHD and which Linux distribution you are using. If you installed UHD from source to the default location on Ubuntu, you may need to add &amp;lt;code&amp;gt;/usr/local/lib/python3/dist-packages&amp;lt;/code&amp;gt; to your &amp;lt;code&amp;gt;PYTHONPATH&amp;lt;/code&amp;gt; variable. For example:&lt;br /&gt;
&lt;br /&gt;
    $ export PYTHONPATH=/usr/local/lib/python3/dist-packages&lt;br /&gt;
&lt;br /&gt;
Instructions for updating your device's filesystem (applicable to E3xx and N3xx) and FPGA image can be found in that device's [https://kb.ettus.com/Getting_Started_Guides Getting Started Guide]. If your filesystem is already up to date, or your device does not use a filesystem (e.g., X3xx), then instructions on flashing an FPGA image to a device can be found in the following locations:&lt;br /&gt;
&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs X3xx series]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_e3xx.html#e3xx_getting_started_fpga_update E3xx series]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_n3xx.html#n3xx_getting_started_fpga_update N3xx series]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device, NOT the USRP series. For example, a USRP X300 FPGA image will NOT work on a USRP X310 and vice versa. Loading an image that does not correspond to your USRP device will likely lead to an error message but can brick the device under some circumstances.&lt;br /&gt;
&lt;br /&gt;
===Configure the Default Shell===&lt;br /&gt;
&lt;br /&gt;
Make sure you are using the &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt; shell. Many of the build scripts used by RFNoC are written for &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt;. See [[Software_Development_on_the_E3xx_USRP_-_Building_RFNoC_UHD_/_GNU_Radio_/_gr-ettus_from_Source#Reconfigure_Default_Shell|Reconfigure Default Shell]] in AN-315 for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
==Testing the Default FPGA Image==&lt;br /&gt;
&lt;br /&gt;
Before continuing, please verify that you have downloaded and flashed the latest FPGA image for your version of UHD. All FPGA images for Generation-3 and above devices are RFNoC images, so there is no requirement to download a special image for RFNoC.&lt;br /&gt;
&lt;br /&gt;
===Inspect the Default Image===&lt;br /&gt;
&lt;br /&gt;
Before we start customizing our FPGA, let's get familiar with the default FPGA image, which is pre-built with a set of RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
Run the following command, with your USRP connected to your PC, to see what is available on the device.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe --args type=x300&lt;br /&gt;
&lt;br /&gt;
Note that your &amp;lt;code&amp;gt;args&amp;lt;/code&amp;gt; may be different, depending on the USRP device you're using. The example here works for X300/X310. Refer to the manual page on [https://files.ettus.com/manual/page_identification.html Identifying USRP Devices] for more details. If an RFNoC image was successfully loaded onto the USRP, the output will show something like the following:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;  _____________________________________________________&lt;br /&gt;
 /&lt;br /&gt;
|       Device: X-Series Device&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       Mboard: X310&lt;br /&gt;
|   |   revision: 11&lt;br /&gt;
|   |   revision_compat: 7&lt;br /&gt;
|   |   product: 30818&lt;br /&gt;
|   |   mac-addr0: 00:80:2f:17:40:6d&lt;br /&gt;
|   |   mac-addr1: 00:80:2f:17:40:6e&lt;br /&gt;
|   |   gateway: 192.168.10.1&lt;br /&gt;
|   |   ip-addr0: 192.168.10.2&lt;br /&gt;
|   |   subnet0: 255.255.255.0&lt;br /&gt;
|   |   ip-addr1: 192.168.20.2&lt;br /&gt;
|   |   subnet1: 255.255.255.0&lt;br /&gt;
|   |   ip-addr2: 192.168.30.2&lt;br /&gt;
|   |   subnet2: 255.255.255.0&lt;br /&gt;
|   |   ip-addr3: 192.168.40.2&lt;br /&gt;
|   |   subnet3: 255.255.255.0&lt;br /&gt;
|   |   serial: 311EF81&lt;br /&gt;
|   |   FW Version: 6.0&lt;br /&gt;
|   |   FPGA Version: 38.0&lt;br /&gt;
|   |   FPGA git hash: be53058&lt;br /&gt;
|   |&lt;br /&gt;
|   |   Time sources:  internal, external, gpsdo&lt;br /&gt;
|   |   Clock sources: internal, external, gpsdo&lt;br /&gt;
|   |   Sensors: ref_locked&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       RFNoC blocks on this device:&lt;br /&gt;
|   |&lt;br /&gt;
|   |   * 0/DDC#0&lt;br /&gt;
|   |   * 0/DDC#1&lt;br /&gt;
|   |   * 0/DUC#0&lt;br /&gt;
|   |   * 0/DUC#1&lt;br /&gt;
|   |   * 0/Radio#0&lt;br /&gt;
|   |   * 0/Radio#1&lt;br /&gt;
|   |   * 0/Replay#0&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       Static connections on this device:&lt;br /&gt;
|   |&lt;br /&gt;
|   |   * 0/SEP#0:0==&amp;gt;0/DUC#0:0&lt;br /&gt;
|   |   * 0/DUC#0:0==&amp;gt;0/Radio#0:0&lt;br /&gt;
|   |   * 0/Radio#0:0==&amp;gt;0/DDC#0:0&lt;br /&gt;
|   |   * 0/DDC#0:0==&amp;gt;0/SEP#0:0&lt;br /&gt;
|   |   * 0/Radio#0:1==&amp;gt;0/DDC#0:1&lt;br /&gt;
|   |   * 0/DDC#0:1==&amp;gt;0/SEP#1:0&lt;br /&gt;
|   |   * 0/SEP#2:0==&amp;gt;0/DUC#1:0&lt;br /&gt;
|   |   * 0/DUC#1:0==&amp;gt;0/Radio#1:0&lt;br /&gt;
|   |   * 0/Radio#1:0==&amp;gt;0/DDC#1:0&lt;br /&gt;
|   |   * 0/DDC#1:0==&amp;gt;0/SEP#2:0&lt;br /&gt;
|   |   * 0/Radio#1:1==&amp;gt;0/DDC#1:1&lt;br /&gt;
|   |   * 0/DDC#1:1==&amp;gt;0/SEP#3:0&lt;br /&gt;
|   |   * 0/SEP#4:0==&amp;gt;0/Replay#0:0&lt;br /&gt;
|   |   * 0/Replay#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
|   |   * 0/SEP#5:0==&amp;gt;0/Replay#0:1&lt;br /&gt;
|   |   * 0/Replay#0:1==&amp;gt;0/SEP#5:0&lt;br /&gt;
...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More than this will likely be shown. The specifics of the output depend on the UHD version and which device you're running on. However, we're interested in the following sections:&lt;br /&gt;
&lt;br /&gt;
* '''Device description'''. At the top, there is a section with basic information about your device, such as serial number, revision, etc. You can use this information to verify that you are indeed communicating with the correct device, and that the device has been updated. The FPGA git hash identifies the commit from which the FPGA image was built.&lt;br /&gt;
* '''RFNoC blocks on this device'''. This section lists all the RFNoC blocks in the loaded FPGA image. The blocks are listed by their block IDs. For example, &amp;lt;code&amp;gt;0/Radio#0&amp;lt;/code&amp;gt; means that we're on device zero (&amp;lt;code&amp;gt;0/&amp;lt;/code&amp;gt;), and we're talking about the first radio (with index &amp;lt;code&amp;gt;#0&amp;lt;/code&amp;gt;). Unless you probe multiple devices at once by specifying multiple addresses in the &amp;lt;code&amp;gt;--args&amp;lt;/code&amp;gt; argument, the device number will always be zero, but the block index will change depending on the number of blocks of that type. For example, on X310, &amp;lt;code&amp;gt;Radio#0&amp;lt;/code&amp;gt; corresponds to RF A and &amp;lt;code&amp;gt;Radio#1&amp;lt;/code&amp;gt; corresponds to RF B.&lt;br /&gt;
* '''Static connections on this device'''. This section lists how the blocks are pre-connected in the FPGA image. For example, the line &amp;lt;code&amp;gt;0/Radio#0:0==&amp;gt;0/DDC#0:0&amp;lt;/code&amp;gt; means that radio zero, port zero (&amp;lt;code&amp;gt;:0&amp;lt;/code&amp;gt;), is connected statically to DDC zero, port zero. Static connections can only be changed at compile time when building the FPGA image.&lt;br /&gt;
&lt;br /&gt;
The connection endpoints labeled &amp;lt;code&amp;gt;SEP&amp;lt;/code&amp;gt; are not RFNoC blocks. They are Stream Endpoints (SEPs). SEPs can send data packets to one another, or to streamers in software, using the CHDR crossbar, which is a dynamic router on the FPGA.&lt;br /&gt;
&lt;br /&gt;
===Available RFNoC Blocks===&lt;br /&gt;
&lt;br /&gt;
Many RFNoC blocks come with UHD. The HDL source code for these blocks resides in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/lib/rfnoc/blocks/&amp;lt;/code&amp;gt;. several of the blocks are described below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Block Name&lt;br /&gt;
!HDL Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|AddSub&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_addsub&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add/Subtract Verilog/VHDL/HLS Example&lt;br /&gt;
|-&lt;br /&gt;
|DmaFIFO&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_axi_ram_fifo&amp;lt;/code&amp;gt;&lt;br /&gt;
|FIFO that uses an AXI4 memory-mapped interface for storage. For use with external DRAM or on-chip SRAM.&lt;br /&gt;
|-&lt;br /&gt;
|DDC&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_ddc&amp;lt;/code&amp;gt;&lt;br /&gt;
|Digital Down Converter&lt;br /&gt;
|-&lt;br /&gt;
|DUC&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_duc&amp;lt;/code&amp;gt;&lt;br /&gt;
|Digital Up Converter&lt;br /&gt;
|-&lt;br /&gt;
|FFT&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_fft&amp;lt;/code&amp;gt;&lt;br /&gt;
|Fast Fourier Transform&lt;br /&gt;
|-&lt;br /&gt;
|FIR&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_fir_filter&amp;lt;/code&amp;gt;&lt;br /&gt;
|Finite Impulse Response Filter&lt;br /&gt;
|-&lt;br /&gt;
|Fosphor&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_fosphor&amp;lt;/code&amp;gt;&lt;br /&gt;
|FFT and waterfall display tool&lt;br /&gt;
|-&lt;br /&gt;
|KeepOneInN&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_keep_one_in_n&amp;lt;/code&amp;gt;&lt;br /&gt;
|Keep one sample/packet in N&lt;br /&gt;
|-&lt;br /&gt;
|LogPwr&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_logpwr&amp;lt;/code&amp;gt;&lt;br /&gt;
|Computes an estimate of log2(i^2+q^2)&lt;br /&gt;
|-&lt;br /&gt;
|MovingAverage&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_moving_avg&amp;lt;/code&amp;gt;&lt;br /&gt;
|Outputs the running average of the N most recent inputs of data stream&lt;br /&gt;
|-&lt;br /&gt;
|NullSrcSink&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_null_src_sink&amp;lt;/code&amp;gt;&lt;br /&gt;
|Data source generator, sink, and loopback for testing&lt;br /&gt;
|-&lt;br /&gt;
|Radio&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_radio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Radio Interface&lt;br /&gt;
|-&lt;br /&gt;
|Replay&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_replay&amp;lt;/code&amp;gt;&lt;br /&gt;
|Record/Playblack using AXI4 memory-mapped interface. For use with external DRAM or on-chip SRAM.&lt;br /&gt;
|-&lt;br /&gt;
|SigGen&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
|Signal Generator. Supports sinusoidal, constant, and random outputs, with configurable gain.&lt;br /&gt;
|-&lt;br /&gt;
|SplitStream&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_split_stream&amp;lt;/code&amp;gt;&lt;br /&gt;
|Splits a single data stream into two&lt;br /&gt;
|-&lt;br /&gt;
|Switchboard&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_switchboard&amp;lt;/code&amp;gt;&lt;br /&gt;
|A configurable RFNoC datapath switch for testing&lt;br /&gt;
|-&lt;br /&gt;
|VectorIIR&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_vector_iir&amp;lt;/code&amp;gt;&lt;br /&gt;
|Implements an IIR filter with variable length delay line&lt;br /&gt;
|-&lt;br /&gt;
|Window&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_window&amp;lt;/code&amp;gt;&lt;br /&gt;
|Windowing module for use with FFT block&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Streaming Example===&lt;br /&gt;
&lt;br /&gt;
In the UHD installation directory, you'll find example applications (e.g., in &amp;lt;code&amp;gt;/usr/lib/uhd/examples/&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/usr/local/lib/uhd/examples/&amp;lt;/code&amp;gt;). We'll look at &amp;lt;code&amp;gt;rfnoc_rx_to_file&amp;lt;/code&amp;gt; to familiarize ourselves with the RFNoC API.&lt;br /&gt;
&lt;br /&gt;
If we look at the source code for this example (located at &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/host/examples/rfnoc_rx_to_file.cpp&amp;lt;/code&amp;gt;), we can see the components necessary in an RFNoC application. In the &amp;lt;code&amp;gt;UHD_SAFE_MAIN&amp;lt;/code&amp;gt; function, we create a few crucial objects, such as an RFNoC graph, a radio block controller, a DDC block controller, and an RX streamer.&lt;br /&gt;
&lt;br /&gt;
    auto graph = uhd::rfnoc::rfnoc_graph::make(args);&lt;br /&gt;
    // ...&lt;br /&gt;
    auto radio_ctrl = graph-&amp;gt;get_block&amp;lt;uhd::rfnoc::radio_control&amp;gt;(radio_ctrl_id);&lt;br /&gt;
    // ...&lt;br /&gt;
    uhd::rfnoc::ddc_block_control::sptr ddc_ctrl;&lt;br /&gt;
    // ...&lt;br /&gt;
    auto rx_stream = graph-&amp;gt;create_rx_streamer(1, stream_args);&lt;br /&gt;
&lt;br /&gt;
We also make connections in our graph and configure our blocks.&lt;br /&gt;
&lt;br /&gt;
    // Connect blocks and commit the graph&lt;br /&gt;
    for (auto&amp;amp; edge : chain) {&lt;br /&gt;
        if (uhd::rfnoc::block_id_t(edge.dst_blockid).match(uhd::rfnoc::NODE_ID_SEP)) {&lt;br /&gt;
            graph-&amp;gt;connect(edge.src_blockid, edge.src_port, rx_stream, 0);&lt;br /&gt;
        } else {&lt;br /&gt;
            graph-&amp;gt;connect(&lt;br /&gt;
                edge.src_blockid, edge.src_port, edge.dst_blockid, edge.dst_port);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    ...&lt;br /&gt;
    rate = radio_ctrl-&amp;gt;set_rate(rate);&lt;br /&gt;
    ...&lt;br /&gt;
    radio_ctrl-&amp;gt;set_rx_frequency(freq, radio_chan);&lt;br /&gt;
&lt;br /&gt;
Once our graph and blocks are configured, we use the &amp;lt;code&amp;gt;recv_to_file&amp;lt;/code&amp;gt; function to receive data from our device and write it to a file on our host computer. Running this example with the &amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; argument shows the available options. For example, to receive 3 seconds of data at a specific frequency and sample rate, we can run:&lt;br /&gt;
&lt;br /&gt;
    rfnoc_rx_to_file --args type=x300 --freq 2.4e9 --rate 10e6 --duration 3&lt;br /&gt;
&lt;br /&gt;
Now you are ready to move to the next step and build your own blocks and FPGA images.&lt;br /&gt;
&lt;br /&gt;
==RFNoC Image Builder==&lt;br /&gt;
&lt;br /&gt;
UHD provides tooling to help develop custom RFNoC images. In this guide we will demonstrate how to use the RFNoC Image Builder, which will allow you to change which blocks are included and the connections between blocks. Let's go over common decisions you'll have to make with this tool.&lt;br /&gt;
&lt;br /&gt;
* '''Blocks Included'''&amp;lt;br&amp;gt;The particular blocks to be included in the image is the most impactful decision you'll make in the image building process, both in terms of image functionality and FPGA resource utilization. Adding more blocks means more processing in the image, but it also means longer FPGA build times and less space in the FPGA.&lt;br /&gt;
* '''Static Connections'''&amp;lt;br&amp;gt;Recall that blocks can be statically connected, as opposed to connecting every block to the CHDR crossbar (dynamically connected). The number of dynamic connections has a large impact on the size of the CHDR crossbar, so static connections are used to lower resource utilization. However, once a block is statically connected in a chain of blocks, data cannot be sent between arbitrary blocks; it must traverse and be processed by each block in the order defined by the static connections.&lt;br /&gt;
* '''Hardware Connections'''&amp;lt;br&amp;gt;All blocks share some connections defined by the [https://files.ettus.com/app_notes/RFNoC_Specification.pdf RFNoC Specification]. These connections are made automatically and cannot be changed. Many blocks require additional connections, such as clocks for the internal DSP or external DRAM interfaces. These connections must also be specified.&lt;br /&gt;
&lt;br /&gt;
Now that we've gone over some of the considerations, let's look at how to actually build a custom RFNoC image. This begins with the RFNoC image core YAML description.&amp;lt;!-- TODO: Originally, I think we were also going to describe how to use GNU Radio to create/build an FPGA image. That would be cool. Maybe that should be in a separate KB? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Understanding the RFNoC Image YAML File===&lt;br /&gt;
&lt;br /&gt;
The image YAML file defines RFNoC blocks in the FPGA image. It is designed to be both human-readable and machine-parseable, which allows us to make edits quickly and easily. Each device type has a default YAML image file, which is named &amp;lt;code&amp;gt;&amp;lt;DEVICE&amp;gt;_rfnoc_image_core.yml&amp;lt;/code&amp;gt; (e.g., &amp;lt;code&amp;gt;x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;). Take a look at the RFNoC image core YAML file for the X310 by opening &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;. Notice that it has the following sections.&lt;br /&gt;
&lt;br /&gt;
* '''General Parameters'''&amp;lt;br&amp;gt;Here we define the device, the bit width of our CHDR connections, as well as some versioning and licensing.&lt;br /&gt;
* '''Stream Endpoints'''&amp;lt;br&amp;gt;In the &amp;lt;code&amp;gt;stream_endpoints&amp;lt;/code&amp;gt; section we list each stream endpoint (SEP) that we wish to instantiate. These will be directly connected to the CHDR crossbar and will allow us to make dynamic connections within the CHDR crossbar. Typically you will have one SEP that forms the start and end of a single DSP chain of RFNoC blocks.&amp;lt;br&amp;gt;You can also add some per-stream-endpoint configuration here, such as the ingress buffer size, which affects streaming performance from your computer to that SEP. For example, if we know that one SEP will be receiving data transferred from your computer to the USRP then a data buffer is needed to accept those incoming packets, in which case we specify the buffer size by setting the &amp;lt;code&amp;gt;buff_size&amp;lt;/code&amp;gt; option on that SEP. Alternatively, if we know that a particular SEP only sends data from the USRP to the computer, then we won't need the ingress data buffer and we can set &amp;lt;code&amp;gt;buff-size&amp;lt;/code&amp;gt; to 0, thus saving FPGA resources.&amp;lt;br&amp;gt;Each SEP can have an AXIS-Ctrl and an AXIS-CHDR port, as indicated by the &amp;lt;code&amp;gt;ctrl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; options. At least one AXIS-Ctrl port is required to communicate with the RFNoC blocks, so &amp;lt;code&amp;gt;ctrl&amp;lt;/code&amp;gt; typically enabled on just the first SEP. Every SEP will usually have AXIS-CHDR connections to one or more RFNoC blocks, so &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; is usually enabled on all SEPs.&lt;br /&gt;
* '''NoC Blocks'''&amp;lt;br&amp;gt;In the &amp;lt;code&amp;gt;noc_blocks&amp;lt;/code&amp;gt; section we specify all the RFNoC blocks to include in the FPGA image. We'll need to give each block a unique name and reference a block definition YAML file (which we'll discuss in a later section). The blocks chosen have the greatest impact on the functionality of the image, as well as providing very coarse control over the FPGA resource utilization. We'll look at how to change the blocks included in the image as part of our example below.&lt;br /&gt;
*'''Static Connections'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;connections&amp;lt;/code&amp;gt; section defines static connections between blocks, stream endpoints, and various hardware interfaces on the USRP. Statically connected chains of blocks will usually start and end at a stream endpoint (SEP). SEPs are automatically connected to the CHDR crossbar by the RFNoC infrastructure. Remember that data must be passed through the entire statically connected chain; dynamic connections cannot be made to the statically connected blocks in the middle of the chain. Other hardware connections, such as to the external DRAM, would also be specified here. We'll take a closer look at making connections as part of our example below.&lt;br /&gt;
* '''Clock Domains'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;clk_domains&amp;lt;/code&amp;gt; section defines which clocks to connect to each block's clock inputs. Some blocks do not need any clock connections beyond the base clocks required by RFNoC. These required connections are not listed here, since they are always the same for each block. Other blocks may require additional clocks. For example, the radio blocks should be connected to the &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; clock. Many other blocks require a &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; (Compute Engine) clock, which is used for the block's internal DSP.&lt;br /&gt;
&lt;br /&gt;
===Running the Image Builder===&lt;br /&gt;
&lt;br /&gt;
Before we look at editing the image core YAML file, let's go over how to use the RFNoC image builder to generate a bitstream from that YAML file. Additional details on how to run the image builder can be found with the &amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; option:&lt;br /&gt;
&lt;br /&gt;
    $ rfnoc_image_builder --help&lt;br /&gt;
&lt;br /&gt;
Here are some of the options provided:&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-y&amp;lt;/code&amp;gt;''': Path to the RFNoC image core YAML file&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-t&amp;lt;/code&amp;gt;''': The image target you would like to build. These are the same targets that are used in the FPGA &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; process. More details on these can be found in the [https://files.ettus.com/manual/md_usrp3_build_instructions.html Generation 3 USRP Build Documentation] of the UHD and USRP Manual. If not specified, the default specified in the image core YAML file will be used.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-l debug&amp;lt;/code&amp;gt;''': Use the &amp;lt;code&amp;gt;debug&amp;lt;/code&amp;gt; log level. This prints more information about the FPGA connections and available port names, which can be useful for debugging connection errors in the YAML file.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;--generate-only&amp;lt;/code&amp;gt;''': Generate the HDL files required, but do not build the FPGA. Users can then build the FPGA later using &amp;lt;code&amp;gt;make &amp;lt;target&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt;''': Path to the directory containing out-of-tree block YAML descriptions (the YAML files installed with UHD are included by default). This option is only needed if using an out-of-tree RFNoC block.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-F&amp;lt;/code&amp;gt;''': Path to the FPGA source code (e.g., &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga&amp;lt;/code&amp;gt;). This path is only required if the current working directory is not within the UHD repository.&lt;br /&gt;
&lt;br /&gt;
For example, to build the default RFNoC image for X310, you might use the following command:&lt;br /&gt;
&lt;br /&gt;
    $ cd &amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/&lt;br /&gt;
    $ rfnoc_image_builder -y ./x310_rfnoc_image_core.yml -t X310_XG&lt;br /&gt;
&lt;br /&gt;
In this example &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;&amp;lt;/code&amp;gt; refers to the location where you cloned the UHD repository and should be replaced by the location you used. &amp;lt;code&amp;gt;x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt; is the default RFNoC image core YAML file for the X310, which is in the x300 project directory. &amp;lt;code&amp;gt;X310_XG&amp;lt;/code&amp;gt; is the make target to use for the build. &amp;lt;code&amp;gt;XG&amp;lt;/code&amp;gt; in this case refers to dual 10 Gbps Ethernet.&lt;br /&gt;
&lt;br /&gt;
For an out-of-tree RFNoC block, you will also need to specify the location of the block information. For example:&lt;br /&gt;
&lt;br /&gt;
    $ rfnoc_image_builder -F &amp;lt;repo&amp;gt;/fpga -I &amp;lt;repo&amp;gt;/host/examples/rfnoc-example -y &amp;lt;repo&amp;gt;/host/examples/rfnoc-example/icores/x310_rfnoc_image_core.yml -t X310_XG &lt;br /&gt;
&lt;br /&gt;
This example shows how to build an FPGA with the Gain example out-of-tree RFNoC block, which is located in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/host/examples/rfnoc-example/&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;-F&amp;lt;/code&amp;gt; option is added to specify the location of the FPGA source, and &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; specifies the location of the out-of-tree block YAML.&lt;br /&gt;
&lt;br /&gt;
The image builder performs several steps in order to build the FPGA image from the image coure YAML:&lt;br /&gt;
&lt;br /&gt;
# It generates the &amp;lt;code&amp;gt;&amp;lt;device&amp;gt;_rfnoc_image_core.v&amp;lt;/code&amp;gt; file. This file includes the Verilog code described by the YAML image core file. A &amp;lt;code&amp;gt;&amp;lt;device&amp;gt;_static_router.hex&amp;lt;/code&amp;gt; file is also generated. This file describes the static connections that should be made by the Verilog code. In the case of the X310 examples above, the output files would be named &amp;lt;code&amp;gt;x310_rfnoc_image_core.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;x310_static_router.hex&amp;lt;/code&amp;gt;, and would be placed in the project directory for the X310 (&amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/&amp;lt;/code&amp;gt;).&lt;br /&gt;
# The image builder will configure the environment for building the FPGA. This is equivalent to sourcing the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script for the device type being built. For example, in our example above, it would run &amp;lt;code&amp;gt;source &amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/setupenv.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# The image builder runs &amp;lt;code&amp;gt;make &amp;lt;target&amp;gt;&amp;lt;/code&amp;gt; to build the IP and the FPGA bitstream for the indicated target. The generated &amp;lt;code&amp;gt;rfnoc_image_core.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;static_router.hex&amp;lt;/code&amp;gt; are automatically pulled into this build. The completed bitstream will be located in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/top/{project}/build&amp;lt;/code&amp;gt; directory, which is the same directory created through the normal make process. For example, for X310 it would be located in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/top/X300/build&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Example: Adding an FFT Block===&lt;br /&gt;
&lt;br /&gt;
As an example, let's run through how to modify the YAML file to modify the RFNoC image. Suppose we have an application that we'd like to run on a USRP X310 and we would like to offload the FFT processing to the FPGA. UHD provides an FFT RFNoC block, and the default X310 image has some extra space in it, so we should be able to add this block. First, we copy the default X310 image core file, named &amp;lt;code&amp;gt;x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
    $ cd &amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/&lt;br /&gt;
    $ cp x310_rfnoc_image_core.yml x310_with_fft.yml&lt;br /&gt;
&lt;br /&gt;
Now open &amp;lt;code&amp;gt;x310_with_fft.yml&amp;lt;/code&amp;gt; in your favorite text editor. We'll start by making some room for our new block. The default images use very large ingress FIFO buffers for the main SEPs to maximize streaming performance. But we want to make sure we have enough memory buffer space for our new blocks. So Start by reducing the &amp;lt;code&amp;gt;buf_size&amp;lt;/code&amp;gt; parameters for &amp;lt;code&amp;gt;ep0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ep2&amp;lt;/code&amp;gt; from 65536 to 32768. If using a device other than X310, the numbers may be different, but you can similarly reduce the &amp;lt;code&amp;gt;buff_size&amp;lt;/code&amp;gt; parameter by half. On smaller devices, it may be necessary to remove the Replay block to make room for the FFT blocks. After making the changes on X310, the result should look like the following:&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      ep0:                       # Stream endpoint name&lt;br /&gt;
        ctrl: True                      # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 32768                # Ingress buffer size for data&lt;br /&gt;
      ...&lt;br /&gt;
      ep2:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 32768                # Ingress buffer size for data&lt;br /&gt;
&lt;br /&gt;
Now we can add our FFT block. We'll put it on its own stream endpoint, so we first need to add a new stream endpoint. Add the following to the &amp;lt;code&amp;gt;stream_endpoints&amp;lt;/code&amp;gt; section:&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      ...&lt;br /&gt;
      ep_fft:                # The name can be incremented from previous SEP&lt;br /&gt;
        ctrl: False          # Only the first SEP needs control traffic&lt;br /&gt;
        data: True           # We do want to pass data through this SEP&lt;br /&gt;
        buff_size: 32768     # Ingress buffer size for data&lt;br /&gt;
&lt;br /&gt;
In this example, we've named the SEP &amp;lt;code&amp;gt;ep_fft&amp;lt;/code&amp;gt;. Other names could be given, as long as the name is unique (it does not have to be numbered). Now that we've allocated an SEP for our block, we need to instantiate the actual block. In the next section, add the following:&lt;br /&gt;
&lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      ...&lt;br /&gt;
      fft0:                          # FFT block name&lt;br /&gt;
        block_desc: 'fft_1x64.yml'   # Block YAML descriptor file&lt;br /&gt;
        parameters:                  # Specify any Verilog module parameters (optional)&lt;br /&gt;
          EN_FFT_SHIFT: 1&lt;br /&gt;
&lt;br /&gt;
Again, the name &amp;lt;code&amp;gt;fft0&amp;lt;/code&amp;gt; is arbitrary, but the name must be unique. In some cases, there will also be block parameters you'll want to pass, such as the data format of the FFT output data. In our example, we're setting &amp;lt;code&amp;gt;EN_FFT_SHIFT&amp;lt;/code&amp;gt; parameter to 1, which causes the FFT block to center the zero frequency bin.&lt;br /&gt;
&lt;br /&gt;
Now that we've added our FFT block, we need to connect it to the stream endpoint. In the next section of the YAML file, we add the static connections:&lt;br /&gt;
&lt;br /&gt;
    connections:&lt;br /&gt;
      ...&lt;br /&gt;
      - { srcblk: ep_fft, srcport: out0,  dstblk: fft0,   dstport: in_0 }&lt;br /&gt;
      - { srcblk: fft0,   srcport: out_0, dstblk: ep_fft, dstport: in0  }&lt;br /&gt;
&lt;br /&gt;
This connects the output of SEP &amp;lt;code&amp;gt;ep_fft&amp;lt;/code&amp;gt; to the input of block &amp;lt;code&amp;gt;fft0&amp;lt;/code&amp;gt;, and the output of &amp;lt;code&amp;gt;fft0&amp;lt;/code&amp;gt; to the input of &amp;lt;code&amp;gt;ep_fft&amp;lt;/code&amp;gt;. Since we're placing the FFT block on its own SEP, the only connections we need to make are between the SEP and the FFT. All SEPs are automatically connected to the CHDR crossbar, so this effectively connects the FFT block to the crossbar, allowing it to communicate with anything on the RFNoC network.&lt;br /&gt;
&lt;br /&gt;
The names of block ports are defined in the YAML descriptions for the blocks. Blocks can use any names for their ports, and they don't have to be numbered (unless the number of ports is parameterized). Generally, the block ports are named &amp;lt;code&amp;gt;in_N&amp;lt;/code&amp;gt; for inputs to the block and &amp;lt;code&amp;gt;out_N&amp;lt;/code&amp;gt; for outputs. SEP ports are named &amp;lt;code&amp;gt;in0&amp;lt;/code&amp;gt; for the input &amp;lt;code&amp;gt;out0&amp;lt;/code&amp;gt; for the output.&lt;br /&gt;
&lt;br /&gt;
If you are having trouble connecting a block due to an unresolved connection, running &amp;lt;code&amp;gt;rfnoc_image_builder&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;-l debug&amp;lt;/code&amp;gt; option will list all available block ports.&lt;br /&gt;
&lt;br /&gt;
Finally, the FFT block has an additional clock input port named &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; that is used for the FFT signal processing. We need to connect it to a clock domain. Any clock that's at least as fast as the incoming data rate should be sufficient. For example, X3xx devices have a &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; clock (214.286 MHz) that is usually a good choice, but &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock (200 MHz) should also work for this example. For N31x and E3xx devices, &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock is a good choice (200 MHz on N31x and 100 MHz on E3xx). For N32x, &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; clock (250 MHz) is a good choice. For example, this is how you would connect the X310's &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; clock to the &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; port of the FFT block:&lt;br /&gt;
&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      ...&lt;br /&gt;
      - { srcblk: _device_, srcport: ce, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
And this is how you would connect &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock to the &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; port:&lt;br /&gt;
&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      ...&lt;br /&gt;
      - { srcblk: _device_, srcport: rfnoc_chdr, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
And finally, this is how you would connect &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; clock:&lt;br /&gt;
&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      ...&lt;br /&gt;
      - { srcblk: _device_, srcport: radio, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
The source block name &amp;lt;code&amp;gt;_device_&amp;lt;/code&amp;gt; is special and refers to the USRP device itself. Choose a clock that's apprpriate for your device and connect it as shown above.&lt;br /&gt;
&lt;br /&gt;
And that's it! The next step will be to run the image builder on our modified YAML file. Once that's done, and the bitstream has been created, you can load it onto your USRP X310 device, and verify the blocks, as we did in the [[#Inspect_the_Default_Image|Inspect the Default Image]] section.&lt;br /&gt;
&lt;br /&gt;
For example, from the X300 directory, you would run the following command to run the image builder:&lt;br /&gt;
&lt;br /&gt;
    $ rfnoc_image_builder -y x310_with_fft.yml -t X310_XG&lt;br /&gt;
&lt;br /&gt;
To download the FPGA bitstream to the X310, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args &amp;quot;type=x300,addr=192.168.30.2&amp;quot; --fpga-path ./build/usrp_x310_fpga_XG.bin&lt;br /&gt;
&lt;br /&gt;
You may need to change the IP address to match your device, depending on your configuration. After completing the flash update and power-cycling the USRP, run &amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt; to confirm that the FFT block was recognized.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe --args &amp;quot;type=x300,addr=192.168.30.2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Take a look at the RFNoC blocks and the static connections on the device. You should see the following new blocks and connections:&lt;br /&gt;
&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    ...&lt;br /&gt;
    |   |   * 0/FFT#0&lt;br /&gt;
    ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    ...&lt;br /&gt;
    |   |   * 0/SEP#6:0==&amp;gt;0/FFT#0:0&lt;br /&gt;
    |   |   * 0/FFT#0:0==&amp;gt;0/SEP#6:0&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;!-- TODO: At this point were were supposed to have a description of how to&lt;br /&gt;
test the FFT block. We might want to use a Python example, to keep it simple, but here's what was originally in the document.&lt;br /&gt;
&lt;br /&gt;
Since we put the FFT block on its own SEP, verifying that it is operating correctly will be simple. We can start by running some test vectors through the block by making an RFNoC application that creates only the RFNoC graph, the FFT block controller, and both an RX and a TX streamer.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;b&amp;gt;**************TODO**************&amp;lt;/b&amp;gt;&lt;br /&gt;
    // Make our controllers&lt;br /&gt;
    rfnoc_graph graph = graph(&amp;quot;&amp;quot;);&lt;br /&gt;
    auto fft_ctrl = graph-&amp;gt;get_block&amp;lt;fft_block_ctrl&amp;gt;(&amp;quot;0/FFT#0&amp;quot;);&lt;br /&gt;
    auto rx_streamer = graph-&amp;gt;get_rx_streamer();&lt;br /&gt;
    auto tx_streamer = graph-&amp;gt;get_tx_streamer();&lt;br /&gt;
     &lt;br /&gt;
    // Make connections&lt;br /&gt;
    graph-&amp;gt;connect(tx_streamer, fft);&lt;br /&gt;
    graph-&amp;gt;connect(fft, rx_streamer);&lt;br /&gt;
     &lt;br /&gt;
    // Make a test vector&lt;br /&gt;
    vec data = {0, 0.5, 1.};&lt;br /&gt;
    vec result(256);&lt;br /&gt;
     &lt;br /&gt;
    // Transmit to block&lt;br /&gt;
    tx_streamer.send(data);&lt;br /&gt;
    this_thread::sleep(10ms)&lt;br /&gt;
    rx_streamer.recv(result);&lt;br /&gt;
    // Verify&lt;br /&gt;
    // Check that each member in the result is as expected&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Adding an FFT Block to the Receive Chain===&lt;br /&gt;
&lt;br /&gt;
Now that we've added the FFT block and verified that it is operating as expected, let's see if we can modify it a little. Let's say that we're sure that we always want to receive the FFT bins from our device, and we don't want to see the raw samples. In order to save some FPGA resources, we can move our FFT block to be between the DDC and the SEP, on the RX data path. Instead of the previous modifications to our YAML file, we want the following:&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      ...&lt;br /&gt;
      # Unchanged from the default image core (no need for ep_fft).&lt;br /&gt;
    &lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      ...&lt;br /&gt;
      fft0:                          # FFT block name&lt;br /&gt;
        block_desc: 'fft_1x64.yml'   # Block YAML descriptor file&lt;br /&gt;
        parameters:                  # Specify any Verilog module parameters (optional)&lt;br /&gt;
          EN_FFT_SHIFT: 1&lt;br /&gt;
    &lt;br /&gt;
    connections:&lt;br /&gt;
      ...&lt;br /&gt;
      # Change this line:&lt;br /&gt;
      # - { srcblk: ddc0, srcport: out_0, dstblk: ep0, dstport: in0  }&lt;br /&gt;
      # Change it to the following to add fft0 between ddc0 and ep0:&lt;br /&gt;
      - { srcblk: ddc0, srcport: out_0, dstblk: fft0, dstport: in_0 }&lt;br /&gt;
      - { srcblk: fft0, srcport: out_0, dstblk: ep0,  dstport: in0 }&lt;br /&gt;
&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      ...&lt;br /&gt;
      # As before, we still connect our FFT block to the clock domain&lt;br /&gt;
      - { srcblk: _device_, srcport: rfnoc_chdr, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
This last line is valid for E310/E320; for X300/X310/N300/N310/N320/N321 use the following:&lt;br /&gt;
&lt;br /&gt;
      - { srcblk: _device_, srcport: ce, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
And as simply as that, we have added the FFT block to our RX block chain. Remember that this is a static connection, so when the resulting FPGA image is loaded onto your device, you will no longer be able to receive samples from the DDC directly; all samples on that chain will be processed by the FFT block, and you will only receive FFT bins from this radio chain.&lt;br /&gt;
&lt;br /&gt;
==Out-of-tree Modules==&lt;br /&gt;
&lt;br /&gt;
===OOT Overview===&lt;br /&gt;
&lt;br /&gt;
Now that we've gone over what is provided by UHD, let's start to look at custom RFNoC development. It's recommended that custom RFNoC development be kept separate from the in-tree UHD RFNoC infrastructure and examples, in order to simplify version control and licensing. Modules located outside of the repository are called ''out-of-tree'' (OOT).&lt;br /&gt;
&lt;br /&gt;
In order to understand how OOT modules for RFNoC are created, let's take a look at the example that's provided with UHD. You can find the example located in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/host/examples/rfnoc-example/&amp;lt;/code&amp;gt;. This example includes a simple Gain RFNoC block that we can use as a reference for creating our own OOT blocks.&lt;br /&gt;
&lt;br /&gt;
===OOT Subdirectories===&lt;br /&gt;
&lt;br /&gt;
Take a look at the &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; directory structure. An OOT module is a collection of block implementations, the software controllers for those blocks, and sometimes applications to demonstrate their functionality. These different components within the OOT module are organized into the directories described below.&lt;br /&gt;
&lt;br /&gt;
* HDL and Image Resources&lt;br /&gt;
** &amp;lt;code&amp;gt;fpga/&amp;lt;/code&amp;gt;: Contains the HDL (e.g., Verilog) required for the module. Each RFNoC block should have its own subdirectory here, such as &amp;lt;code&amp;gt;rfnoc_block_gain&amp;lt;/code&amp;gt;, for the Gain block.&lt;br /&gt;
** &amp;lt;code&amp;gt;blocks/&amp;lt;/code&amp;gt;: Contains the YAML RFNoC block definition files. These describe the block's interfaces and are used by the image builder. We'll go into more detail with regards to what goes into these YAML files in the [[#Creating_Your_Own_RFNoC_Block|Creating Your Own RFNoC Block]] section.&lt;br /&gt;
** &amp;lt;code&amp;gt;icores/&amp;lt;/code&amp;gt;: Contains example FPGA image core YAML files, to demonstrate how to create an FPGA image using your custom blocks. These image core files may demonstrate important parameters or show recommended configurations for chains of blocks.&lt;br /&gt;
* Block Controller and Example Software&lt;br /&gt;
** &amp;lt;code&amp;gt;include/&amp;lt;/code&amp;gt;: Contains the headers for the block controller software. Once installed, these headers will be used by UHD and other applications to interface with and control your custom RFNoC blocks.&lt;br /&gt;
** &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt;: Contains the block controller implementations. The files here should implement the features outlined in the headers located in the &amp;lt;code&amp;gt;include/&amp;lt;/code&amp;gt; directory. All unit test code should also be located here.&lt;br /&gt;
** &amp;lt;code&amp;gt;apps/&amp;lt;/code&amp;gt;: Contains example applications for your custom blocks. These applications may demonstrate how to use the block controllers, common configurations, or how to process data from your blocks.&lt;br /&gt;
* Infrastructure&lt;br /&gt;
** &amp;lt;code&amp;gt;cmake/&amp;lt;/code&amp;gt;: Contains any custom CMake commands the module may need. In general, simple modules will not need to modify this directory at all. More complicated modules with additional external dependencies may need to modify this.&lt;br /&gt;
&lt;br /&gt;
Take some time to explore the files in the &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt;. Note the following files and directories related to the Gain example:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-example/fpga/rfnoc_block_gain/&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;This is the HDL for the Gain RFNoC block.&lt;br /&gt;
** &amp;lt;code&amp;gt;rfnoc_block_gain.v&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The top-level synthesizable file for the Gain block&lt;br /&gt;
** &amp;lt;code&amp;gt;noc_shell_gain.v&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The NoC Shell for the Gain block&lt;br /&gt;
** &amp;lt;code&amp;gt;rfnoc_block_gain_tb.sv&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The simulation testbench&lt;br /&gt;
** &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The simulation Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-example/blocks/gain.yml&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The YAML block definition file for the Gain block&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-example/icores/x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;An example RFNoC image core YAML description showing how to connect the Gain block&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-example/include/rfnoc/example/gain_block_control.hpp&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The software block controller header&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-example/lib/gain_block_control.cpp&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The software block controller implementation&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-example/apps/init_gain_block.cpp&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;An example showing how to find and initialize the Gain block&lt;br /&gt;
&amp;lt;!-- We should have an example that streams data that the customers can run using the Gain block --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Creating Your Own OOT Module===&lt;br /&gt;
&lt;br /&gt;
To create your own OOT module, make a copy of the &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; directory. This will contain all the subdirectories and infrastructure files that you need to create your custom module. The directory name for your copy should be renamed to your desired name; we recommend something like &amp;lt;code&amp;gt;rfnoc-foo&amp;lt;/code&amp;gt;, for example, where &amp;lt;code&amp;gt;foo&amp;lt;/code&amp;gt; is the name for your OOT module. You'll also need to change &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; within the module's &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt; files to your module's name.&lt;br /&gt;
&lt;br /&gt;
Let's start by creating our own copy of the &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; to work with. We'll call our module &amp;lt;code&amp;gt;demo&amp;lt;/code&amp;gt;. You can put the copy wherever you like, but for this example we'll put it in our home directory. &lt;br /&gt;
&lt;br /&gt;
    $ cp -r &amp;lt;repo&amp;gt;/host/examples/rfnoc-example ~/&lt;br /&gt;
    $ mv ~/rfnoc-example ~/rfnoc-demo&lt;br /&gt;
&lt;br /&gt;
Now we need to edit our &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt; files to rename our module. Edit the following files and change all instances of &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;rfnoc-demo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
    ~/rfnoc-demo/CMakeLists.txt&lt;br /&gt;
    ~/rfnoc-demo/lib/CMakeLists.txt&lt;br /&gt;
&lt;br /&gt;
===Building and Installing an OOT Module===&lt;br /&gt;
The OOT module will need to be built and installed in order to use its RFNoC blocks. To build and install the OOT module we just created, do the following:&lt;br /&gt;
&lt;br /&gt;
    $ mkdir ~/rfnoc-demo/build&lt;br /&gt;
    $ cd ~/rfnoc-demo/build&lt;br /&gt;
    $ cmake -DUHD_FPGA_DIR=&amp;lt;repo&amp;gt;/fpga/ ../&lt;br /&gt;
&lt;br /&gt;
This configures the project to be installed in the default location. You may want to provide a different install directory to CMake using the &amp;lt;code&amp;gt;-DCMAKE_INSTALL_PREFIX&amp;lt;/code&amp;gt;. Please refer to the [https://files.ettus.com/manual/page_build_guide.html UHD Installation Guide] or the installation guide for other CMake-based projects for instructions on configuring CMake.&lt;br /&gt;
&lt;br /&gt;
Note that we specify the location of the FPGA source code using the &amp;lt;code&amp;gt;-DUHD_FPGA_DIR&amp;lt;/code&amp;gt; option. This allows you to run the FPGA testbenches and to build the example FPGA image provided with the OOT example.&lt;br /&gt;
&lt;br /&gt;
At this point, you can run &amp;lt;code&amp;gt;make help&amp;lt;/code&amp;gt; to see what options are available. A few of the available make targets are described below:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make rfnoc-demo&amp;lt;/code&amp;gt;: Build the block controllers for the RFNoC blocks&lt;br /&gt;
* &amp;lt;code&amp;gt;make testbenches&amp;lt;/code&amp;gt;: Run the testbenches for the RFNoC blocks&lt;br /&gt;
* &amp;lt;code&amp;gt;make x310_rfnoc_image_core&amp;lt;/code&amp;gt;: Build the FPGA example image&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;: Install the module&lt;br /&gt;
&lt;br /&gt;
To build and install the block, perform the following steps.&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/rfnoc-demo/build&lt;br /&gt;
    $ make&lt;br /&gt;
    $ make install&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; may be required depending on the install location.&lt;br /&gt;
&lt;br /&gt;
===Building an FPGA Image with OOT Blocks===&lt;br /&gt;
&lt;br /&gt;
At this point you can build the example FPGA that's included in the &amp;lt;code&amp;gt;icores&amp;lt;/code&amp;gt; directory. Take a look at &amp;lt;code&amp;gt;~/rfnoc-demo/icores/x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;. Note that the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block is added in exactly the same way that the FFT block was in [[#Example:_Adding_an_FFT_Block|Example: Adding an FFT Block]]. You can build this example FPGA for the X310 using the following steps:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/rfnoc-demo/build&lt;br /&gt;
    $ make x310_rfnoc_image_core&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can call &amp;lt;code&amp;gt;rfnoc_image_builder&amp;lt;/code&amp;gt; directly. In order to get the image builder to find your custom blocks, you may need to supply some additional arguments to find the OOT module, as shown in the following example:&lt;br /&gt;
&lt;br /&gt;
    $ rfnoc_image_builder -F &amp;lt;repo&amp;gt;/fpga –I ~/rfnoc-demo/include/rfnoc -y ~/rfnoc-demo/icores/x310_rfnoc_image_core.yml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; option is only required if the OOT module has not been installed on the system. &amp;lt;!-- I think this is supposed to be the case, but it's not working right now, so we will see. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have an X310, you can build and use the provided example to test the Gain block. If you have a different USRP, you can use its default &amp;lt;code&amp;gt;rfnoc_image_core.yml&amp;lt;/code&amp;gt; as a starting point and follow the same steps that we followed for the FFT block in [[#Example:_Adding_an_FFT_Block|Example: Adding an FFT Block]], then build it using the process described above.&lt;br /&gt;
&lt;br /&gt;
===Testing the Gain Example===&lt;br /&gt;
&lt;br /&gt;
After building an FPGA image for your USRP and downloading it to your device, the Gain block should be available. Test this by running &amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
   $ uhd_usrp_probe --args &amp;quot;type=x300,addr=192.168.30.2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Again, note that your &amp;lt;code&amp;gt;args&amp;lt;/code&amp;gt; may be different or may not be required if you only have a single USRP connected.&lt;br /&gt;
&lt;br /&gt;
Take a look at the RFNoC blocks and the static connections on the device. You should see the following new blocks and connections:&lt;br /&gt;
&amp;lt;!-- TODO: It should show &amp;quot;0/Gain#0&amp;quot; here --&amp;gt;&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    ...&lt;br /&gt;
    |   |   * 0/Block#0&lt;br /&gt;
    ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    ...&lt;br /&gt;
    |   |   * 0/SEP#4:0==&amp;gt;0/Block#0:0&lt;br /&gt;
    |   |   * 0/Block#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;!-- TODO:&lt;br /&gt;
Next, let's run the provided &amp;lt;code&amp;gt;init_gain_block&amp;lt;/code&amp;gt; application example.&lt;br /&gt;
&lt;br /&gt;
    $ ~/rfnoc-demo/build/apps/init_gain_block&lt;br /&gt;
    ...&lt;br /&gt;
    Gain value read/write loopback successful!&lt;br /&gt;
    $ &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
==Creating Your Own RFNoC Block==&lt;br /&gt;
&lt;br /&gt;
The Gain block is a useful example and could even be used as the starting point for a new block, but rather than trying to copy and edit the Gain block, it is best to use the RFNoC ModTool to create a new block template. This is also required if you want to change the interfaces provided to your IP that are exposed by the NoC Shell.&lt;br /&gt;
&lt;br /&gt;
===Understanding the Block Definition YAML===&lt;br /&gt;
&lt;br /&gt;
The first step in creating a new block is to write a YAML description for the block that you want to create. The options available are described [https://files.ettus.com/app_notes/RFNoC_Specification.pdf RFNoC Specification]. You can also look at the blocks available in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/host/include/uhd/rfnoc/blocks/&amp;lt;/code&amp;gt; for examples. We'll provide a brief overview here.&lt;br /&gt;
&lt;br /&gt;
Open up and take a look at the Gain block definition located in &amp;lt;code&amp;gt;~/rfnoc-demo/blocks/gain.yml&amp;lt;/code&amp;gt;. Notice the different sections, which are described below:&lt;br /&gt;
&lt;br /&gt;
* '''General Parameters'''&amp;lt;br&amp;gt;In this section we give our block a name (&amp;lt;code&amp;gt;module_name&amp;lt;/code&amp;gt;) and a unique block ID (&amp;lt;code&amp;gt;noc_id&amp;lt;/code&amp;gt;). The NoC ID is an arbitrary 32-bit number that will be used by the software to identify the block during system discovery. You can also specify the CHDR bus width, which should be 64 for Generation-3 USRPs.&lt;br /&gt;
* '''Clocks'''&amp;lt;br&amp;gt;In the &amp;lt;code&amp;gt;clocks&amp;lt;/code&amp;gt; section, we define the clocks that will be used by the block. The &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rfnoc_ctrl&amp;lt;/code&amp;gt; clocks are required. Many blocks also have a &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; clock for internal DSP.&lt;br /&gt;
* '''Control Interface'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;control&amp;lt;/code&amp;gt; section defines what type of control interface to make available to your block. The control interface is used for register reads and writes. Most blocks do not need to modify this section and will use the &amp;lt;code&amp;gt;ctrlport&amp;lt;/code&amp;gt; interface type. Control Port is the standard register interface used by RFNoC. The &amp;lt;code&amp;gt;clk_domain&amp;lt;/code&amp;gt; parameter allows you to specify which clock domain to use for the register interface exposed to your block. Typically this is the same clock that is used for the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; interface, to avoid clock crossings.&lt;br /&gt;
* '''Data Interface'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; section defines what type of data interface to make available to your block and describes the ports. Most blocks use either the &amp;lt;code&amp;gt;axis_pyld_ctxt&amp;lt;/code&amp;gt; or the &amp;lt;code&amp;gt;axis_data&amp;lt;/code&amp;gt; interface types.&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;clk_domain&amp;lt;/code&amp;gt; parameter allows you to specify which clock domain to use for the data interfaces exposed to your block. Typically this is the same clock that is used for the &amp;lt;code&amp;gt;control&amp;lt;/code&amp;gt; interface, to avoid clock crossings.&amp;lt;br&amp;gt;Under the &amp;lt;code&amp;gt;inputs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;outputs&amp;lt;/code&amp;gt; sections you can describe the input and output ports.&lt;br /&gt;
* '''IO Ports'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;io_ports&amp;lt;/code&amp;gt; section is used to describe other device-specific ports to which your block needs to connect (such as the DRAM or radio interfaces). For most blocks, this section is not used.&lt;br /&gt;
&lt;br /&gt;
A few other sections might be present in the YAML file (e.g., &amp;lt;code&amp;gt;registers&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;properties&amp;lt;/code&amp;gt;). These sections are reserved for future use and can be left empty.&lt;br /&gt;
&lt;br /&gt;
===Starting Your Own Block Definition===&lt;br /&gt;
&lt;br /&gt;
Let's start by making a copy of the Gain block YAML for our use case. &lt;br /&gt;
&lt;br /&gt;
    $ cp ~/rfnoc-demo/blocks/gain.yml ~/rfnoc-demo/blocks/demo.yml&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;lt;code&amp;gt;demo.yml&amp;lt;/code&amp;gt; file you just created and make the following changes:&lt;br /&gt;
&lt;br /&gt;
# Change the name of the block from &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;demo&amp;lt;/code&amp;gt;&lt;br /&gt;
# Change the &amp;lt;code&amp;gt;noc_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;0x0000DE30&amp;lt;/code&amp;gt;&lt;br /&gt;
# Change the &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; for the &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;out&amp;lt;/code&amp;gt; ports from &amp;lt;code&amp;gt;int32&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This YAML file now describes a block with the following features:&lt;br /&gt;
&lt;br /&gt;
* The block named &amp;quot;demo&amp;quot;&lt;br /&gt;
* NoC ID of 0xDE30&lt;br /&gt;
* CtrlPort register interface on the &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock domain&lt;br /&gt;
* A single 32-bit input port named &amp;quot;In&amp;quot; on the &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock domain that will provide sc16 samples to your IP&lt;br /&gt;
* A single 32-bit output port named &amp;quot;Out&amp;quot; on the &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock domain that will receive sc16 samples from your IP&lt;br /&gt;
&lt;br /&gt;
===Generating Your Block Using the ModTool===&lt;br /&gt;
&lt;br /&gt;
Now that we have a block definition YAML file, we can generate the source code templates and NoC Shell for our block. To do so, run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ python3 &amp;lt;repo&amp;gt;/host/utils/rfnoc_blocktool/rfnoc_create_verilog.py -c ~/rfnoc-demo/blocks/demo.yml -d ~/rfnoc-demo/fpga/rfnoc_block_demo&lt;br /&gt;
&lt;br /&gt;
This will create a folder named &amp;lt;code&amp;gt;~/rfnoc-demo/fpga/rfnoc_block_demo&amp;lt;/code&amp;gt; with an RFNoC block template for you to use. Explore the folder that was created. You should see the following files:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;''': This is the Makefile for the simulation testbench. See [https://files.ettus.com/manual/md_usrp3_sim_running_testbenches.html Running a Testbench] in the UHD and USRP Manual for instructions on how to run a testbench.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt;''': This is another makefile that identifies the HDL source code that makes up your RFNoC block. &lt;br /&gt;
* '''&amp;lt;code&amp;gt;noc_shell_demo.v&amp;lt;/code&amp;gt;''': This is the NoC Shell that was generated for your block. It provides the interfaces described in the block definition YAML.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;rfnoc_block_demo.v&amp;lt;/code&amp;gt;''': This is a template for your RFNoC block. It includes all the top-level ports required by RFNoC and instantiates the NoC Shell.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;rfnoc_block_demo_tb.sv&amp;lt;/code&amp;gt;''': This is a testbench template for your RFNoC block. It instantiates your RFNoC block and the bus functional models (BFMs) needed to communicate with your block in simulation.&lt;br /&gt;
&lt;br /&gt;
Take a moment to look at the &amp;lt;code&amp;gt;rfnoc_block_demo.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rfnoc_block_demo_tb.sv&amp;lt;/code&amp;gt; files that were generated for your block. Notice the &amp;quot;User Logic&amp;quot; section towards the end of the &amp;lt;code&amp;gt;rfnoc_block_demo&amp;lt;/code&amp;gt; module. This is the location where you can insert your own IP.&lt;br /&gt;
&lt;br /&gt;
The input data samples come in on the &amp;lt;code&amp;gt;m_in_payload&amp;lt;/code&amp;gt; AXI4-Stream bus. The output data samples go out on the &amp;lt;code&amp;gt;s_out_payload&amp;lt;/code&amp;gt; AXI4-Stream data bus. &lt;br /&gt;
&lt;br /&gt;
If your input packets are the same size as your output packets (i.e., for every sample in you generate one sample out) then the &amp;lt;code&amp;gt;m_in_context&amp;lt;/code&amp;gt; data bus can be used to drive &amp;lt;code&amp;gt;s_out_context&amp;lt;/code&amp;gt;. The context bus is described in detail in the [https://files.ettus.com/app_notes/RFNoC_Specification.pdf RFNoC Specification].&lt;br /&gt;
&lt;br /&gt;
Similarly, the testbench has a section where you can add your own test sequences to the test bench.&lt;br /&gt;
&lt;br /&gt;
If you decide you need to change the RFNoC interfaces for your block (e.g., add ports, or change the interface type), then it is recommended to update the block definition YAML then regenerate the block. Please take care to not overwrite any code you have written when regenerating the files for your block! Rerunning the tool will cause new files to be generated, with a new NoC Shell, and will demonstrate how to update your code for the new interfaces.&lt;br /&gt;
&lt;br /&gt;
Refer to the Gain example and other RFNoC blocks for examples of how to complete your RFNoC block logic and testbenches.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
In this guide we have given a brief introduction on how to develop for RFNoC in UHD 4.0. There's a lot more you can do than is described here, but this will hopefully get you started. Happy coding!&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_in_UHD_4.0&amp;diff=5260</id>
		<title>Getting Started with RFNoC in UHD 4.0</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_in_UHD_4.0&amp;diff=5260"/>
				<updated>2022-02-07T15:08:05Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number and Authors==&lt;br /&gt;
'''AN-400''' by Sugandha Gupta, Brent Stapleton, Wade Fife, and Michael Dickens&lt;br /&gt;
&amp;lt;!-- Internal use only: please do keep this updated!&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2020-02-14&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Sugandha Gupta&amp;lt;br&amp;gt;Brent Stapleton&amp;lt;br&amp;gt;Wade Fife&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;| Initial creation&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2020-09-14&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Wade Fife&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;| Added introduction to RFNoC&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2021-02-18&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Michael Dickens&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;| Minor but critical tweak of `srcport` per https://github.com/EttusResearch/uhd/issues/416&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2021-03-02&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Michael Dickens&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;| re-tweak `srcport` per certain USRPs as noted&lt;br /&gt;
|}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This guide describes how to get started with FPGA and Software development for RF Network-on-Chip (RFNoC™). It gives a brief introduction to RFNoC and explains the steps needed to generate, build, and use custom RFNoC images and introduces the process for creating and integrating new RFNoC IP blocks.&lt;br /&gt;
&amp;lt;!-- A guide to migrating a block created in earlier versions of RFNoC (UHD 3) to RFNoC in UHD 4 can be found in the RFNoC Migration Guide. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Intended Audience==&lt;br /&gt;
This guide is written for hardware and software engineers who want to use the RF Network-on-Chip (RFNoC™) architecture or want to develop intellectual property (IP) using the RFNoC architecture. For more details on the architecture please refer to the [https://files.ettus.com/app_notes/RFNoC_Specification.pdf RFNoC Specification].&lt;br /&gt;
&lt;br /&gt;
This guide assumes that you have some basic familiarity with USRPs, such as connecting them, configuring your network interfaces, etc., so that your USRP is ready for use. See the [https://kb.ettus.com/Getting_Started_Guides Getting Started Guide] for your USRP if you are just getting started with USRPs.&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
The RFNoC code base is open source, including code that executes on the host, as well as code targeted to the USRP hardware (FPGA and microcontroller firmware). RFNoC is available under the open-source GNU Lesser General Public License (LGPL). For more information on our licensing policy, please contact [mailto:info@ettus.com info@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
RFNoC is currently supported on the USRP X410 series, and all the Generation-3 USRPs in the X series (X3xx), E series (E3xx) and  N series (N3xx). For details on the hardware, software, and process required to build custom USRP FPGA images that include RFNoC blocks, see the [http://files.ettus.com/manual/md_usrp3_build_instructions.html USRP Build Documentation] in the UHD and USRP Manual.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you learn how to build an FPGA image for your USRP and download it to the device before starting this guide if you have never done so before. This will ensure you have all the necessary software installed.&lt;br /&gt;
&lt;br /&gt;
==Introduction to RFNoC==&lt;br /&gt;
&lt;br /&gt;
===What is RFNoC?===&lt;br /&gt;
&lt;br /&gt;
RFNoC™ is a heterogeneous processing framework used to implement high-throughput DSP in the FPGA for Software Defined Radio (SDR) systems in an easy-to-use and flexible way. It provides all the infrastructure required to insert signal-processing IP into the FPGA logic and communicate with it through software. It also provides highly-optimized software and FPGA code to enable high-performance streaming to and from IP blocks on the USRP device.&lt;br /&gt;
&lt;br /&gt;
The IP blocks in RFNoC are called ''RFNoC blocks''. The RFNoC blocks wrap the IP and provide a custom interface to the RFNoC infrastructure through a tool-generated interface called the ''NoC Shell''. Many standard blocks are included in UHD 4.0. These blocks enable typical operation of the USRP and allow RFNoC to connect to the different hardware components of the USRP. Several of the included blocks are described in the section [[#Available RFNoC Blocks|Available RFNoC Blocks]]. You can mix the available blocks for your application, or develop your own custom RFNoC blocks with your own IP to open up new applications. The NoC Shell hides the complexity of RFNoC from your block, making it easy to plug your IP into the USRP.&lt;br /&gt;
&lt;br /&gt;
RFNoC is used on all Generation-3 USRPs and is installed with UHD 4.0. USRPs ship with a default RFNoC image that can be used as is, or can be modified and/or customized to suite your application. So if you're using a modern USRP, it's running RFNoC under the hood even if you haven't customized anything.&lt;br /&gt;
&lt;br /&gt;
===Example RFNoC Image===&lt;br /&gt;
&lt;br /&gt;
The diagram below shows a simplified view of an RFNoC FPGA image that is similar to the default images available on USRPs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:simplified_rfnoc_image_uhd_4.png|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that an RFNoC FPGA is made up of several components. A description of each one is provided below.&lt;br /&gt;
&lt;br /&gt;
* '''RFNoC Image Core'''&amp;lt;br&amp;gt;This is the main block of the RFNoC framework and instantiates the components that make up RFNoC. The contents of the image core are described by an RFNoC image core YAML file, and the Verilog code that represents this block is automatically generated by the RFNoC Image Builder tool based on the YAML description. In other words, you provide a description of what you want to be included in RFNoC and the tools generate the code to implement that description.&lt;br /&gt;
* '''Transport Adapter'''&amp;lt;br&amp;gt;The transport adapter is a component of the USRP that allows communication with an outside interface. These vary depending on the USRP model in use. For example, this could be a 10 Gbps Ethernet link for SFP+ port of the USRP, or a cabled PCIe interface.&lt;br /&gt;
* '''CHDR Crossbar'''&amp;lt;br&amp;gt;The CHDR crossbar is a dynamic router for RFNoC traffic. This is a high-throughput crossbar designed for RF streaming applications. It is reconfigurable at run time via software and can be used to configure routes between stream endpoints and transport adapters. The number of ports available is configurable by changing the RFNoC image core YAML file. CHDR (Condensed Hierarchical Datagram for RFNoC) refers to the network protocol that is used for RFNoC.&lt;br /&gt;
* '''Stream Endpoint (SEP)'''&amp;lt;br&amp;gt;The stream endpoint (SEP) provides the high-level flow control for traffic over the network. It also separates control traffic from data traffic to create a separate AXIS-Ctrl network for control traffic. Control traffic refers to things like register reads and writes for configuring and monitoring RFNoC blocks.&lt;br /&gt;
* '''Control Crossbar'''&amp;lt;br&amp;gt;The control crossbar is similar to the CHDR Crossbar, but is only for control traffic. It has a much lower throughput and has been optimized for control-traffic, making it much less resource intensive than the CHDR crossbar.&lt;br /&gt;
* '''Other Blocks'''&amp;lt;br&amp;gt;The DDC (digital down converter), DUC (digital up converter), and Radio in this example are RFNoC blocks that are included with UHD. These are standard components included the default USRP images and enable typical RF applications. Most blocks only communicate with the RFNoC network, but some blocks require access to external hardware interfaces, such as the radio or DRAM. In this example, the radio blocks connect to the radio hardware on the USRP.&lt;br /&gt;
&lt;br /&gt;
===Static vs. Dynamic Routing===&lt;br /&gt;
&lt;br /&gt;
The routes between blocks that go through the crossbar are ''dynamic''. That is, the routes can be changed at run time and are controlled by software. The CHDR crossbar is very powerful in that it allows any of its ports to communicate with each other. It allows for streaming between blocks on the same FPGA, between RFNoC blocks and a host computer, or between blocks on different USRPs. New signal processing chains can be added to this crossbar, as needed, for the application.&lt;br /&gt;
&lt;br /&gt;
Similarly, the control crossbar supports dynamic routing, allowing any RFNoC block to send control traffic to any other RFNoC block, even to blocks on a different USRP. Control traffic can also be sent from the host computer to the RFNoC blocks, for example to read/write registers. Additionally, RFNoC blocks can send control to the host computer. In this example, the Radio block sends control traffic to the computer to report specific events, such as overflow or underflow in the radio.&lt;br /&gt;
&lt;br /&gt;
The block connections that don't go through a crossbar (e.g., the connection from the radio to the DDC, and the DDC to the stream endpoint, etc.) are ''static'' connections. That is, they cannot be changed at run time. Making a connection static has the advantage that it does not require additional ports on the crossbar and that the connection can be made much simpler because the high-level network flow-control protocol used by CHDR is not required. This reduces latency between blocks and leads to FPGA resource savings, allowing more logic be included in a single FPGA image. The static connections are described by the RFNoC image core YAML file. In order to change the static connections, the YAML description needs to be updated and the FPGA image needs to be rebuilt.&lt;br /&gt;
&lt;br /&gt;
===RFNoC Customization===&lt;br /&gt;
&lt;br /&gt;
The RFNoC framework makes it easy to customize the RFNoC image and add your own IP blocks. Later on in this guide, we'll explore how you can customize the RFNoC image to add or remove blocks, as well as create your own RFNoC blocks and include them in your FPGA builds. This allows you to create highly-customized and high-performance FPGA images for your USRP.&lt;br /&gt;
&lt;br /&gt;
==Setting Up==&lt;br /&gt;
To use RFNoC in UHD 4.0 you need to perform the following:&lt;br /&gt;
&lt;br /&gt;
* Clone the UHD repository&lt;br /&gt;
* Install UHD&lt;br /&gt;
* Update your device's filesystem and FPGA image&lt;br /&gt;
&lt;br /&gt;
Building custom RFNoC images requires the FPGA source code and build system. These are included in the UHD repository, located in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;&amp;lt;/code&amp;gt; refers to the location where you cloned the UHD repository.&lt;br /&gt;
&lt;br /&gt;
Please see the [http://files.ettus.com/manual/page_install.html Binary Installation] for UHD installation documentation or [https://files.ettus.com/manual/page_build_guide.html Building and Installing] instructions to build and install UHD from source. Additionally, [[Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux|AN-445]] provides step-by step instructions for cloning the repository and installing UHD from source.&lt;br /&gt;
&lt;br /&gt;
Starting with UHD 3.15, RFNoC is enabled by default, and starting with UHD 4.0, it can no longer be disabled, so no additional instructions are necessary to install support for RFNoC in UHD.&lt;br /&gt;
&lt;br /&gt;
Many of the UHD utilities we will use in this guide are based on Python. Please ensure that your &amp;lt;code&amp;gt;PYTHONPATH&amp;lt;/code&amp;gt; is set correctly. If not set correctly, you will see errors indicating that Python could not find the &amp;lt;code&amp;gt;uhd&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;image_builder&amp;lt;/code&amp;gt; libraries. The correct setting may depend on where you installed UHD and which Linux distribution you are using. If you installed UHD from source to the default location on Ubuntu, you may need to add &amp;lt;code&amp;gt;/usr/local/lib/python3/dist-packages&amp;lt;/code&amp;gt; to your &amp;lt;code&amp;gt;PYTHONPATH&amp;lt;/code&amp;gt; variable. For example:&lt;br /&gt;
&lt;br /&gt;
    $ export PYTHONPATH=/usr/local/lib/python3/dist-packages&lt;br /&gt;
&lt;br /&gt;
Instructions for updating your device's filesystem (applicable to E3xx and N3xx) and FPGA image can be found in that device's [https://kb.ettus.com/Getting_Started_Guides Getting Started Guide]. If your filesystem is already up to date, or your device does not use a filesystem (e.g., X3xx), then instructions on flashing an FPGA image to a device can be found in the following locations:&lt;br /&gt;
&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs X3xx series]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_e3xx.html#e3xx_getting_started_fpga_update E3xx series]&lt;br /&gt;
* [http://files.ettus.com/manual/page_usrp_n3xx.html#n3xx_getting_started_fpga_update N3xx series]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device, NOT the USRP series. For example, a USRP X300 FPGA image will NOT work on a USRP X310 and vice versa. Loading an image that does not correspond to your USRP device will likely lead to an error message but can brick the device under some circumstances.&lt;br /&gt;
&lt;br /&gt;
===Configure the Default Shell===&lt;br /&gt;
&lt;br /&gt;
Make sure you are using the &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt; shell. Many of the build scripts used by RFNoC are written for &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt;. See [[Software_Development_on_the_E3xx_USRP_-_Building_RFNoC_UHD_/_GNU_Radio_/_gr-ettus_from_Source#Reconfigure_Default_Shell|Reconfigure Default Shell]] in AN-315 for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
==Testing the Default FPGA Image==&lt;br /&gt;
&lt;br /&gt;
Before continuing, please verify that you have downloaded and flashed the latest FPGA image for your version of UHD. All FPGA images for Generation-3 and above devices are RFNoC images, so there is no requirement to download a special image for RFNoC.&lt;br /&gt;
&lt;br /&gt;
===Inspect the Default Image===&lt;br /&gt;
&lt;br /&gt;
Before we start customizing our FPGA, let's get familiar with the default FPGA image, which is pre-built with a set of RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
Run the following command, with your USRP connected to your PC, to see what is available on the device.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe --args type=x300&lt;br /&gt;
&lt;br /&gt;
Note that your &amp;lt;code&amp;gt;args&amp;lt;/code&amp;gt; may be different, depending on the USRP device you're using. The example here works for X300/X310. Refer to the manual page on [https://files.ettus.com/manual/page_identification.html Identifying USRP Devices] for more details. If an RFNoC image was successfully loaded onto the USRP, the output will show something like the following:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;  _____________________________________________________&lt;br /&gt;
 /&lt;br /&gt;
|       Device: X-Series Device&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       Mboard: X310&lt;br /&gt;
|   |   revision: 11&lt;br /&gt;
|   |   revision_compat: 7&lt;br /&gt;
|   |   product: 30818&lt;br /&gt;
|   |   mac-addr0: 00:80:2f:17:40:6d&lt;br /&gt;
|   |   mac-addr1: 00:80:2f:17:40:6e&lt;br /&gt;
|   |   gateway: 192.168.10.1&lt;br /&gt;
|   |   ip-addr0: 192.168.10.2&lt;br /&gt;
|   |   subnet0: 255.255.255.0&lt;br /&gt;
|   |   ip-addr1: 192.168.20.2&lt;br /&gt;
|   |   subnet1: 255.255.255.0&lt;br /&gt;
|   |   ip-addr2: 192.168.30.2&lt;br /&gt;
|   |   subnet2: 255.255.255.0&lt;br /&gt;
|   |   ip-addr3: 192.168.40.2&lt;br /&gt;
|   |   subnet3: 255.255.255.0&lt;br /&gt;
|   |   serial: 311EF81&lt;br /&gt;
|   |   FW Version: 6.0&lt;br /&gt;
|   |   FPGA Version: 38.0&lt;br /&gt;
|   |   FPGA git hash: be53058&lt;br /&gt;
|   |&lt;br /&gt;
|   |   Time sources:  internal, external, gpsdo&lt;br /&gt;
|   |   Clock sources: internal, external, gpsdo&lt;br /&gt;
|   |   Sensors: ref_locked&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       RFNoC blocks on this device:&lt;br /&gt;
|   |&lt;br /&gt;
|   |   * 0/DDC#0&lt;br /&gt;
|   |   * 0/DDC#1&lt;br /&gt;
|   |   * 0/DUC#0&lt;br /&gt;
|   |   * 0/DUC#1&lt;br /&gt;
|   |   * 0/Radio#0&lt;br /&gt;
|   |   * 0/Radio#1&lt;br /&gt;
|   |   * 0/Replay#0&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       Static connections on this device:&lt;br /&gt;
|   |&lt;br /&gt;
|   |   * 0/SEP#0:0==&amp;gt;0/DUC#0:0&lt;br /&gt;
|   |   * 0/DUC#0:0==&amp;gt;0/Radio#0:0&lt;br /&gt;
|   |   * 0/Radio#0:0==&amp;gt;0/DDC#0:0&lt;br /&gt;
|   |   * 0/DDC#0:0==&amp;gt;0/SEP#0:0&lt;br /&gt;
|   |   * 0/Radio#0:1==&amp;gt;0/DDC#0:1&lt;br /&gt;
|   |   * 0/DDC#0:1==&amp;gt;0/SEP#1:0&lt;br /&gt;
|   |   * 0/SEP#2:0==&amp;gt;0/DUC#1:0&lt;br /&gt;
|   |   * 0/DUC#1:0==&amp;gt;0/Radio#1:0&lt;br /&gt;
|   |   * 0/Radio#1:0==&amp;gt;0/DDC#1:0&lt;br /&gt;
|   |   * 0/DDC#1:0==&amp;gt;0/SEP#2:0&lt;br /&gt;
|   |   * 0/Radio#1:1==&amp;gt;0/DDC#1:1&lt;br /&gt;
|   |   * 0/DDC#1:1==&amp;gt;0/SEP#3:0&lt;br /&gt;
|   |   * 0/SEP#4:0==&amp;gt;0/Replay#0:0&lt;br /&gt;
|   |   * 0/Replay#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
|   |   * 0/SEP#5:0==&amp;gt;0/Replay#0:1&lt;br /&gt;
|   |   * 0/Replay#0:1==&amp;gt;0/SEP#5:0&lt;br /&gt;
...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More than this will likely be shown. The specifics of the output depend on the UHD version and which device you're running on. However, we're interested in the following sections:&lt;br /&gt;
&lt;br /&gt;
* '''Device description'''. At the top, there is a section with basic information about your device, such as serial number, revision, etc. You can use this information to verify that you are indeed communicating with the correct device, and that the device has been updated. The FPGA git hash identifies the commit from which the FPGA image was built.&lt;br /&gt;
* '''RFNoC blocks on this device'''. This section lists all the RFNoC blocks in the loaded FPGA image. The blocks are listed by their block IDs. For example, &amp;lt;code&amp;gt;0/Radio#0&amp;lt;/code&amp;gt; means that we're on device zero (&amp;lt;code&amp;gt;0/&amp;lt;/code&amp;gt;), and we're talking about the first radio (with index &amp;lt;code&amp;gt;#0&amp;lt;/code&amp;gt;). Unless you probe multiple devices at once by specifying multiple addresses in the &amp;lt;code&amp;gt;--args&amp;lt;/code&amp;gt; argument, the device number will always be zero, but the block index will change depending on the number of blocks of that type. For example, on X310, &amp;lt;code&amp;gt;Radio#0&amp;lt;/code&amp;gt; corresponds to RF A and &amp;lt;code&amp;gt;Radio#1&amp;lt;/code&amp;gt; corresponds to RF B.&lt;br /&gt;
* '''Static connections on this device'''. This section lists how the blocks are pre-connected in the FPGA image. For example, the line &amp;lt;code&amp;gt;0/Radio#0:0==&amp;gt;0/DDC#0:0&amp;lt;/code&amp;gt; means that radio zero, port zero (&amp;lt;code&amp;gt;:0&amp;lt;/code&amp;gt;), is connected statically to DDC zero, port zero. Static connections can only be changed at compile time when building the FPGA image.&lt;br /&gt;
&lt;br /&gt;
The connection endpoints labeled &amp;lt;code&amp;gt;SEP&amp;lt;/code&amp;gt; are not RFNoC blocks. They are Stream Endpoints (SEPs). SEPs can send data packets to one another, or to streamers in software, using the CHDR crossbar, which is a dynamic router on the FPGA.&lt;br /&gt;
&lt;br /&gt;
===Available RFNoC Blocks===&lt;br /&gt;
&lt;br /&gt;
Many RFNoC blocks come with UHD. The HDL source code for these blocks resides in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/lib/rfnoc/blocks/&amp;lt;/code&amp;gt;. several of the blocks are described below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Block Name&lt;br /&gt;
!HDL Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|AddSub&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_addsub&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add/Subtract Verilog/VHDL/HLS Example&lt;br /&gt;
|-&lt;br /&gt;
|DmaFIFO&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_axi_ram_fifo&amp;lt;/code&amp;gt;&lt;br /&gt;
|FIFO that uses an AXI4 memory-mapped interface for storage. For use with external DRAM or on-chip SRAM.&lt;br /&gt;
|-&lt;br /&gt;
|DDC&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_ddc&amp;lt;/code&amp;gt;&lt;br /&gt;
|Digital Down Converter&lt;br /&gt;
|-&lt;br /&gt;
|DUC&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_duc&amp;lt;/code&amp;gt;&lt;br /&gt;
|Digital Up Converter&lt;br /&gt;
|-&lt;br /&gt;
|FFT&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_fft&amp;lt;/code&amp;gt;&lt;br /&gt;
|Fast Fourier Transform&lt;br /&gt;
|-&lt;br /&gt;
|FIR&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_fir_filter&amp;lt;/code&amp;gt;&lt;br /&gt;
|Finite Impulse Response Filter&lt;br /&gt;
|-&lt;br /&gt;
|Fosphor&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_fosphor&amp;lt;/code&amp;gt;&lt;br /&gt;
|FFT and waterfall display tool&lt;br /&gt;
|-&lt;br /&gt;
|KeepOneInN&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_keep_one_in_n&amp;lt;/code&amp;gt;&lt;br /&gt;
|Keep one sample/packet in N&lt;br /&gt;
|-&lt;br /&gt;
|LogPwr&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_logpwr&amp;lt;/code&amp;gt;&lt;br /&gt;
|Computes an estimate of log2(i^2+q^2)&lt;br /&gt;
|-&lt;br /&gt;
|MovingAverage&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_moving_avg&amp;lt;/code&amp;gt;&lt;br /&gt;
|Outputs the running average of the N most recent inputs of data stream&lt;br /&gt;
|-&lt;br /&gt;
|NullSrcSink&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_null_src_sink&amp;lt;/code&amp;gt;&lt;br /&gt;
|Data source generator, sink, and loopback for testing&lt;br /&gt;
|-&lt;br /&gt;
|Radio&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_radio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Radio Interface&lt;br /&gt;
|-&lt;br /&gt;
|Replay&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_replay&amp;lt;/code&amp;gt;&lt;br /&gt;
|Record/Playblack using AXI4 memory-mapped interface. For use with external DRAM or on-chip SRAM.&lt;br /&gt;
|-&lt;br /&gt;
|SigGen&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
|Signal Generator. Supports sinusoidal, constant, and random outputs, with configurable gain.&lt;br /&gt;
|-&lt;br /&gt;
|SplitStream&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_split_stream&amp;lt;/code&amp;gt;&lt;br /&gt;
|Splits a single data stream into two&lt;br /&gt;
|-&lt;br /&gt;
|Switchboard&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_switchboard&amp;lt;/code&amp;gt;&lt;br /&gt;
|A configurable RFNoC datapath switch for testing&lt;br /&gt;
|-&lt;br /&gt;
|VectorIIR&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_vector_iir&amp;lt;/code&amp;gt;&lt;br /&gt;
|Implements an IIR filter with variable length delay line&lt;br /&gt;
|-&lt;br /&gt;
|Window&lt;br /&gt;
|&amp;lt;code&amp;gt;rfnoc_block_window&amp;lt;/code&amp;gt;&lt;br /&gt;
|Windowing module for use with FFT block&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Streaming Example===&lt;br /&gt;
&lt;br /&gt;
In the UHD installation directory, you'll find example applications (e.g., in &amp;lt;code&amp;gt;/usr/lib/uhd/examples/&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/usr/local/lib/uhd/examples/&amp;lt;/code&amp;gt;). We'll look at &amp;lt;code&amp;gt;rfnoc_rx_to_file&amp;lt;/code&amp;gt; to familiarize ourselves with the RFNoC API.&lt;br /&gt;
&lt;br /&gt;
If we look at the source code for this example (located at &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/host/examples/rfnoc_rx_to_file.cpp&amp;lt;/code&amp;gt;), we can see the components necessary in an RFNoC application. In the &amp;lt;code&amp;gt;UHD_SAFE_MAIN&amp;lt;/code&amp;gt; function, we create a few crucial objects, such as an RFNoC graph, a radio block controller, a DDC block controller, and an RX streamer.&lt;br /&gt;
&lt;br /&gt;
    uhd::rfnoc::rfnoc_graph::sptr graph = uhd::rfnoc::rfnoc_graph::make(args);&lt;br /&gt;
    ...&lt;br /&gt;
    uhd::rfnoc::radio_control::sptr radio_ctrl =&lt;br /&gt;
        graph-&amp;gt;get_block&amp;lt;uhd::rfnoc::radio_control&amp;gt;(radio_ctrl_id);&lt;br /&gt;
    ...&lt;br /&gt;
    uhd::rfnoc::ddc_block_control::sptr ddc_ctrl;&lt;br /&gt;
    ...&lt;br /&gt;
    uhd::rx_streamer::sptr rx_stream = graph-&amp;gt;create_rx_streamer(1, stream_args);&lt;br /&gt;
&lt;br /&gt;
We also make connections in our graph and configure our blocks.&lt;br /&gt;
&lt;br /&gt;
    // Connect blocks and commit the graph&lt;br /&gt;
    for (auto&amp;amp; edge : chain) {&lt;br /&gt;
        if (uhd::rfnoc::block_id_t(edge.dst_blockid).match(uhd::rfnoc::NODE_ID_SEP)) {&lt;br /&gt;
            graph-&amp;gt;connect(edge.src_blockid, edge.src_port, rx_stream, 0);&lt;br /&gt;
        } else {&lt;br /&gt;
            graph-&amp;gt;connect(&lt;br /&gt;
                edge.src_blockid, edge.src_port, edge.dst_blockid, edge.dst_port);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    ...&lt;br /&gt;
    rate = radio_ctrl-&amp;gt;set_rate(rate);&lt;br /&gt;
    ...&lt;br /&gt;
    radio_ctrl-&amp;gt;set_rx_frequency(freq, radio_chan);&lt;br /&gt;
&lt;br /&gt;
Once our graph and blocks are configured, we use the &amp;lt;code&amp;gt;recv_to_file&amp;lt;/code&amp;gt; function to receive data from our device and write it to a file on our host computer. Running this example with the &amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; argument shows the available options. For example, to receive 3 seconds of data at a specific frequency and sample rate, we can run:&lt;br /&gt;
&lt;br /&gt;
    rfnoc_rx_to_file --args type=x300 --freq 2.4e9 --rate 10e6 --duration 3&lt;br /&gt;
&lt;br /&gt;
Now you are ready to move to the next step and build your own blocks and FPGA images.&lt;br /&gt;
&lt;br /&gt;
==RFNoC Image Builder==&lt;br /&gt;
&lt;br /&gt;
UHD provides tooling to help develop custom RFNoC images. In this guide we will demonstrate how to use the RFNoC Image Builder, which will allow you to change which blocks are included and the connections between blocks. Let's go over common decisions you'll have to make with this tool.&lt;br /&gt;
&lt;br /&gt;
* '''Blocks Included'''&amp;lt;br&amp;gt;The particular blocks to be included in the image is the most impactful decision you'll make in the image building process, both in terms of image functionality and FPGA resource utilization. Adding more blocks means more processing in the image, but it also means longer FPGA build times and less space in the FPGA.&lt;br /&gt;
* '''Static Connections'''&amp;lt;br&amp;gt;Recall that blocks can be statically connected, as opposed to connecting every block to the CHDR crossbar (dynamically connected). The number of dynamic connections has a large impact on the size of the CHDR crossbar, so static connections are used to lower resource utilization. However, once a block is statically connected in a chain of blocks, data cannot be sent between arbitrary blocks; it must traverse and be processed by each block in the order defined by the static connections.&lt;br /&gt;
* '''Hardware Connections'''&amp;lt;br&amp;gt;All blocks share some connections defined by the [https://files.ettus.com/app_notes/RFNoC_Specification.pdf RFNoC Specification]. These connections are made automatically and cannot be changed. Many blocks require additional connections, such as clocks for the internal DSP or external DRAM interfaces. These connections must also be specified.&lt;br /&gt;
&lt;br /&gt;
Now that we've gone over some of the considerations, let's look at how to actually build a custom RFNoC image. This begins with the RFNoC image core YAML description.&amp;lt;!-- TODO: Originally, I think we were also going to describe how to use GNU Radio to create/build an FPGA image. That would be cool. Maybe that should be in a separate KB? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Understanding the RFNoC Image YAML File===&lt;br /&gt;
&lt;br /&gt;
The image YAML file defines RFNoC blocks in the FPGA image. It is designed to be both human-readable and machine-parseable, which allows us to make edits quickly and easily. Each device type has a default YAML image file, which is named &amp;lt;code&amp;gt;&amp;lt;DEVICE&amp;gt;_rfnoc_image_core.yml&amp;lt;/code&amp;gt; (e.g., &amp;lt;code&amp;gt;x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;). Take a look at the RFNoC image core YAML file for the X310 by opening &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;. Notice that it has the following sections.&lt;br /&gt;
&lt;br /&gt;
* '''General Parameters'''&amp;lt;br&amp;gt;Here we define the device, the bit width of our CHDR connections, as well as some versioning and licensing.&lt;br /&gt;
* '''Stream Endpoints'''&amp;lt;br&amp;gt;In the &amp;lt;code&amp;gt;stream_endpoints&amp;lt;/code&amp;gt; section we list each stream endpoint (SEP) that we wish to instantiate. These will be directly connected to the CHDR crossbar and will allow us to make dynamic connections within the CHDR crossbar. Typically you will have one SEP that forms the start and end of a single DSP chain of RFNoC blocks.&amp;lt;br&amp;gt;You can also add some per-stream-endpoint configuration here, such as the ingress buffer size, which affects streaming performance from your computer to that SEP. For example, if we know that one SEP will be receiving data transferred from your computer to the USRP then a data buffer is needed to accept those incoming packets, in which case we specify the buffer size by setting the &amp;lt;code&amp;gt;buff_size&amp;lt;/code&amp;gt; option on that SEP. Alternatively, if we know that a particular SEP only sends data from the USRP to the computer, then we won't need the ingress data buffer and we can set &amp;lt;code&amp;gt;buff-size&amp;lt;/code&amp;gt; to 0, thus saving FPGA resources.&amp;lt;br&amp;gt;Each SEP can have an AXIS-Ctrl and an AXIS-CHDR port, as indicated by the &amp;lt;code&amp;gt;ctrl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; options. At least one AXIS-Ctrl port is required to communicate with the RFNoC blocks, so &amp;lt;code&amp;gt;ctrl&amp;lt;/code&amp;gt; typically enabled on just the first SEP. Every SEP will usually have AXIS-CHDR connections to one or more RFNoC blocks, so &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; is usually enabled on all SEPs.&lt;br /&gt;
* '''NoC Blocks'''&amp;lt;br&amp;gt;In the &amp;lt;code&amp;gt;noc_blocks&amp;lt;/code&amp;gt; section we specify all the RFNoC blocks to include in the FPGA image. We'll need to give each block a unique name and reference a block definition YAML file (which we'll discuss in a later section). The blocks chosen have the greatest impact on the functionality of the image, as well as providing very coarse control over the FPGA resource utilization. We'll look at how to change the blocks included in the image as part of our example below.&lt;br /&gt;
*'''Static Connections'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;connections&amp;lt;/code&amp;gt; section defines static connections between blocks, stream endpoints, and various hardware interfaces on the USRP. Statically connected chains of blocks will usually start and end at a stream endpoint (SEP). SEPs are automatically connected to the CHDR crossbar by the RFNoC infrastructure. Remember that data must be passed through the entire statically connected chain; dynamic connections cannot be made to the statically connected blocks in the middle of the chain. Other hardware connections, such as to the external DRAM, would also be specified here. We'll take a closer look at making connections as part of our example below.&lt;br /&gt;
* '''Clock Domains'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;clk_domains&amp;lt;/code&amp;gt; section defines which clocks to connect to each block's clock inputs. Some blocks do not need any clock connections beyond the base clocks required by RFNoC. These required connections are not listed here, since they are always the same for each block. Other blocks may require additional clocks. For example, the radio blocks should be connected to the &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; clock. Many other blocks require a &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; (Compute Engine) clock, which is used for the block's internal DSP.&lt;br /&gt;
&lt;br /&gt;
===Running the Image Builder===&lt;br /&gt;
&lt;br /&gt;
Before we look at editing the image core YAML file, let's go over how to use the RFNoC image builder to generate a bitstream from that YAML file. Additional details on how to run the image builder can be found with the &amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; option:&lt;br /&gt;
&lt;br /&gt;
    $ rfnoc_image_builder --help&lt;br /&gt;
&lt;br /&gt;
Here are some of the options provided:&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-y&amp;lt;/code&amp;gt;''': Path to the RFNoC image core YAML file&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-t&amp;lt;/code&amp;gt;''': The image target you would like to build. These are the same targets that are used in the FPGA &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; process. More details on these can be found in the [https://files.ettus.com/manual/md_usrp3_build_instructions.html Generation 3 USRP Build Documentation] of the UHD and USRP Manual. If not specified, the default specified in the image core YAML file will be used.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-l debug&amp;lt;/code&amp;gt;''': Use the &amp;lt;code&amp;gt;debug&amp;lt;/code&amp;gt; log level. This prints more information about the FPGA connections and available port names, which can be useful for debugging connection errors in the YAML file.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;--generate-only&amp;lt;/code&amp;gt;''': Generate the HDL files required, but do not build the FPGA. Users can then build the FPGA later using &amp;lt;code&amp;gt;make &amp;lt;target&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt;''': Path to the directory containing out-of-tree block YAML descriptions (the YAML files installed with UHD are included by default). This option is only needed if using an out-of-tree RFNoC block.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;-F&amp;lt;/code&amp;gt;''': Path to the FPGA source code (e.g., &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga&amp;lt;/code&amp;gt;). This path is only required if the current working directory is not within the UHD repository.&lt;br /&gt;
&lt;br /&gt;
For example, to build the default RFNoC image for X310, you might use the following command:&lt;br /&gt;
&lt;br /&gt;
    $ cd &amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/&lt;br /&gt;
    $ rfnoc_image_builder -y ./x310_rfnoc_image_core.yml -t X310_XG&lt;br /&gt;
&lt;br /&gt;
In this example &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;&amp;lt;/code&amp;gt; refers to the location where you cloned the UHD repository and should be replaced by the location you used. &amp;lt;code&amp;gt;x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt; is the default RFNoC image core YAML file for the X310, which is in the x300 project directory. &amp;lt;code&amp;gt;X310_XG&amp;lt;/code&amp;gt; is the make target to use for the build. &amp;lt;code&amp;gt;XG&amp;lt;/code&amp;gt; in this case refers to dual 10 Gbps Ethernet.&lt;br /&gt;
&lt;br /&gt;
For an out-of-tree RFNoC block, you will also need to specify the location of the block information. For example:&lt;br /&gt;
&lt;br /&gt;
    $ rfnoc_image_builder -F &amp;lt;repo&amp;gt;/fpga -I &amp;lt;repo&amp;gt;/host/examples/rfnoc-example -y &amp;lt;repo&amp;gt;/host/examples/rfnoc-example/icores/x310_rfnoc_image_core.yml -t X310_XG &lt;br /&gt;
&lt;br /&gt;
This example shows how to build an FPGA with the Gain example out-of-tree RFNoC block, which is located in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/host/examples/rfnoc-example/&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;-F&amp;lt;/code&amp;gt; option is added to specify the location of the FPGA source, and &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; specifies the location of the out-of-tree block YAML.&lt;br /&gt;
&lt;br /&gt;
The image builder performs several steps in order to build the FPGA image from the image coure YAML:&lt;br /&gt;
&lt;br /&gt;
# It generates the &amp;lt;code&amp;gt;&amp;lt;device&amp;gt;_rfnoc_image_core.v&amp;lt;/code&amp;gt; file. This file includes the Verilog code described by the YAML image core file. A &amp;lt;code&amp;gt;&amp;lt;device&amp;gt;_static_router.hex&amp;lt;/code&amp;gt; file is also generated. This file describes the static connections that should be made by the Verilog code. In the case of the X310 examples above, the output files would be named &amp;lt;code&amp;gt;x310_rfnoc_image_core.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;x310_static_router.hex&amp;lt;/code&amp;gt;, and would be placed in the project directory for the X310 (&amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/&amp;lt;/code&amp;gt;).&lt;br /&gt;
# The image builder will configure the environment for building the FPGA. This is equivalent to sourcing the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script for the device type being built. For example, in our example above, it would run &amp;lt;code&amp;gt;source &amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/setupenv.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# The image builder runs &amp;lt;code&amp;gt;make &amp;lt;target&amp;gt;&amp;lt;/code&amp;gt; to build the IP and the FPGA bitstream for the indicated target. The generated &amp;lt;code&amp;gt;rfnoc_image_core.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;static_router.hex&amp;lt;/code&amp;gt; are automatically pulled into this build. The completed bitstream will be located in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/top/{project}/build&amp;lt;/code&amp;gt; directory, which is the same directory created through the normal make process. For example, for X310 it would be located in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/fpga/usrp3/top/X300/build&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Example: Adding an FFT Block===&lt;br /&gt;
&lt;br /&gt;
As an example, let's run through how to modify the YAML file to modify the RFNoC image. Suppose we have an application that we'd like to run on a USRP X310 and we would like to offload the FFT processing to the FPGA. UHD provides an FFT RFNoC block, and the default X310 image has some extra space in it, so we should be able to add this block. First, we copy the default X310 image core file, named &amp;lt;code&amp;gt;x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
    $ cd &amp;lt;repo&amp;gt;/fpga/usrp3/top/x300/&lt;br /&gt;
    $ cp x310_rfnoc_image_core.yml x310_with_fft.yml&lt;br /&gt;
&lt;br /&gt;
Now open &amp;lt;code&amp;gt;x310_with_fft.yml&amp;lt;/code&amp;gt; in your favorite text editor. We'll start by making some room for our new block. The default images use very large ingress FIFO buffers for the main SEPs to maximize streaming performance. But we want to make sure we have enough memory buffer space for our new blocks. So Start by reducing the &amp;lt;code&amp;gt;buf_size&amp;lt;/code&amp;gt; parameters for &amp;lt;code&amp;gt;ep0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ep2&amp;lt;/code&amp;gt; from 65536 to 32768. If using a device other than X310, the numbers may be different, but you can similarly reduce the &amp;lt;code&amp;gt;buff_size&amp;lt;/code&amp;gt; parameter by half. On smaller devices, it may be necessary to remove the Replay block to make room for the FFT blocks. After making the changes on X310, the result should look like the following:&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      ep0:                       # Stream endpoint name&lt;br /&gt;
        ctrl: True                      # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 32768                # Ingress buffer size for data&lt;br /&gt;
      ...&lt;br /&gt;
      ep2:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 32768                # Ingress buffer size for data&lt;br /&gt;
&lt;br /&gt;
Now we can add our FFT block. We'll put it on its own stream endpoint, so we first need to add a new stream endpoint. Add the following to the &amp;lt;code&amp;gt;stream_endpoints&amp;lt;/code&amp;gt; section:&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      ...&lt;br /&gt;
      ep_fft:                # The name can be incremented from previous SEP&lt;br /&gt;
        ctrl: False          # Only the first SEP needs control traffic&lt;br /&gt;
        data: True           # We do want to pass data through this SEP&lt;br /&gt;
        buff_size: 32768     # Ingress buffer size for data&lt;br /&gt;
&lt;br /&gt;
In this example, we've named the SEP &amp;lt;code&amp;gt;ep_fft&amp;lt;/code&amp;gt;. Other names could be given, as long as the name is unique (it does not have to be numbered). Now that we've allocated an SEP for our block, we need to instantiate the actual block. In the next section, add the following:&lt;br /&gt;
&lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      ...&lt;br /&gt;
      fft0:                          # FFT block name&lt;br /&gt;
        block_desc: 'fft_1x64.yml'   # Block YAML descriptor file&lt;br /&gt;
        parameters:                  # Specify any Verilog module parameters (optional)&lt;br /&gt;
          EN_FFT_SHIFT: 1&lt;br /&gt;
&lt;br /&gt;
Again, the name &amp;lt;code&amp;gt;fft0&amp;lt;/code&amp;gt; is arbitrary, but the name must be unique. In some cases, there will also be block parameters you'll want to pass, such as the data format of the FFT output data. In our example, we're setting &amp;lt;code&amp;gt;EN_FFT_SHIFT&amp;lt;/code&amp;gt; parameter to 1, which causes the FFT block to center the zero frequency bin.&lt;br /&gt;
&lt;br /&gt;
Now that we've added our FFT block, we need to connect it to the stream endpoint. In the next section of the YAML file, we add the static connections:&lt;br /&gt;
&lt;br /&gt;
    connections:&lt;br /&gt;
      ...&lt;br /&gt;
      - { srcblk: ep_fft, srcport: out0,  dstblk: fft0,   dstport: in_0 }&lt;br /&gt;
      - { srcblk: fft0,   srcport: out_0, dstblk: ep_fft, dstport: in0  }&lt;br /&gt;
&lt;br /&gt;
This connects the output of SEP &amp;lt;code&amp;gt;ep_fft&amp;lt;/code&amp;gt; to the input of block &amp;lt;code&amp;gt;fft0&amp;lt;/code&amp;gt;, and the output of &amp;lt;code&amp;gt;fft0&amp;lt;/code&amp;gt; to the input of &amp;lt;code&amp;gt;ep_fft&amp;lt;/code&amp;gt;. Since we're placing the FFT block on its own SEP, the only connections we need to make are between the SEP and the FFT. All SEPs are automatically connected to the CHDR crossbar, so this effectively connects the FFT block to the crossbar, allowing it to communicate with anything on the RFNoC network.&lt;br /&gt;
&lt;br /&gt;
The names of block ports are defined in the YAML descriptions for the blocks. Blocks can use any names for their ports, and they don't have to be numbered (unless the number of ports is parameterized). Generally, the block ports are named &amp;lt;code&amp;gt;in_N&amp;lt;/code&amp;gt; for inputs to the block and &amp;lt;code&amp;gt;out_N&amp;lt;/code&amp;gt; for outputs. SEP ports are named &amp;lt;code&amp;gt;in0&amp;lt;/code&amp;gt; for the input &amp;lt;code&amp;gt;out0&amp;lt;/code&amp;gt; for the output.&lt;br /&gt;
&lt;br /&gt;
If you are having trouble connecting a block due to an unresolved connection, running &amp;lt;code&amp;gt;rfnoc_image_builder&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;-l debug&amp;lt;/code&amp;gt; option will list all available block ports.&lt;br /&gt;
&lt;br /&gt;
Finally, the FFT block has an additional clock input port named &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; that is used for the FFT signal processing. We need to connect it to a clock domain. Any clock that's at least as fast as the incoming data rate should be sufficient. For example, X3xx devices have a &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; clock (214.286 MHz) that is usually a good choice, but &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock (200 MHz) should also work for this example. For N31x and E3xx devices, &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock is a good choice (200 MHz on N31x and 100 MHz on E3xx). For N32x, &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; clock (250 MHz) is a good choice. For example, this is how you would connect the X310's &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; clock to the &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; port of the FFT block:&lt;br /&gt;
&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      ...&lt;br /&gt;
      - { srcblk: _device_, srcport: ce, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
And this is how you would connect &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock to the &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; port:&lt;br /&gt;
&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      ...&lt;br /&gt;
      - { srcblk: _device_, srcport: rfnoc_chdr, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
And finally, this is how you would connect &amp;lt;code&amp;gt;radio&amp;lt;/code&amp;gt; clock:&lt;br /&gt;
&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      ...&lt;br /&gt;
      - { srcblk: _device_, srcport: radio, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
The source block name &amp;lt;code&amp;gt;_device_&amp;lt;/code&amp;gt; is special and refers to the USRP device itself. Choose a clock that's apprpriate for your device and connect it as shown above.&lt;br /&gt;
&lt;br /&gt;
And that's it! The next step will be to run the image builder on our modified YAML file. Once that's done, and the bitstream has been created, you can load it onto your USRP X310 device, and verify the blocks, as we did in the [[#Inspect_the_Default_Image|Inspect the Default Image]] section.&lt;br /&gt;
&lt;br /&gt;
For example, from the X300 directory, you would run the following command to run the image builder:&lt;br /&gt;
&lt;br /&gt;
    $ rfnoc_image_builder -y x310_with_fft.yml -t X310_XG&lt;br /&gt;
&lt;br /&gt;
To download the FPGA bitstream to the X310, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args &amp;quot;type=x300,addr=192.168.30.2&amp;quot; --fpga-path ./build/usrp_x310_fpga_XG.bin&lt;br /&gt;
&lt;br /&gt;
You may need to change the IP address to match your device, depending on your configuration. After completing the flash update and power-cycling the USRP, run &amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt; to confirm that the FFT block was recognized.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe --args &amp;quot;type=x300,addr=192.168.30.2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Take a look at the RFNoC blocks and the static connections on the device. You should see the following new blocks and connections:&lt;br /&gt;
&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    ...&lt;br /&gt;
    |   |   * 0/FFT#0&lt;br /&gt;
    ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    ...&lt;br /&gt;
    |   |   * 0/SEP#6:0==&amp;gt;0/FFT#0:0&lt;br /&gt;
    |   |   * 0/FFT#0:0==&amp;gt;0/SEP#6:0&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;!-- TODO: At this point were were supposed to have a description of how to&lt;br /&gt;
test the FFT block. We might want to use a Python example, to keep it simple, but here's what was originally in the document.&lt;br /&gt;
&lt;br /&gt;
Since we put the FFT block on its own SEP, verifying that it is operating correctly will be simple. We can start by running some test vectors through the block by making an RFNoC application that creates only the RFNoC graph, the FFT block controller, and both an RX and a TX streamer.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;b&amp;gt;**************TODO**************&amp;lt;/b&amp;gt;&lt;br /&gt;
    // Make our controllers&lt;br /&gt;
    rfnoc_graph graph = graph(&amp;quot;&amp;quot;);&lt;br /&gt;
    auto fft_ctrl = graph-&amp;gt;get_block&amp;lt;fft_block_ctrl&amp;gt;(&amp;quot;0/FFT#0&amp;quot;);&lt;br /&gt;
    auto rx_streamer = graph-&amp;gt;get_rx_streamer();&lt;br /&gt;
    auto tx_streamer = graph-&amp;gt;get_tx_streamer();&lt;br /&gt;
     &lt;br /&gt;
    // Make connections&lt;br /&gt;
    graph-&amp;gt;connect(tx_streamer, fft);&lt;br /&gt;
    graph-&amp;gt;connect(fft, rx_streamer);&lt;br /&gt;
     &lt;br /&gt;
    // Make a test vector&lt;br /&gt;
    vec data = {0, 0.5, 1.};&lt;br /&gt;
    vec result(256);&lt;br /&gt;
     &lt;br /&gt;
    // Transmit to block&lt;br /&gt;
    tx_streamer.send(data);&lt;br /&gt;
    this_thread::sleep(10ms)&lt;br /&gt;
    rx_streamer.recv(result);&lt;br /&gt;
    // Verify&lt;br /&gt;
    // Check that each member in the result is as expected&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Adding an FFT Block to the Receive Chain===&lt;br /&gt;
&lt;br /&gt;
Now that we've added the FFT block and verified that it is operating as expected, let's see if we can modify it a little. Let's say that we're sure that we always want to receive the FFT bins from our device, and we don't want to see the raw samples. In order to save some FPGA resources, we can move our FFT block to be between the DDC and the SEP, on the RX data path. Instead of the previous modifications to our YAML file, we want the following:&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      ...&lt;br /&gt;
      # Unchanged from the default image core (no need for ep_fft).&lt;br /&gt;
    &lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      ...&lt;br /&gt;
      fft0:                          # FFT block name&lt;br /&gt;
        block_desc: 'fft_1x64.yml'   # Block YAML descriptor file&lt;br /&gt;
        parameters:                  # Specify any Verilog module parameters (optional)&lt;br /&gt;
          EN_FFT_SHIFT: 1&lt;br /&gt;
    &lt;br /&gt;
    connections:&lt;br /&gt;
      ...&lt;br /&gt;
      # Change this line:&lt;br /&gt;
      # - { srcblk: ddc0, srcport: out_0, dstblk: ep0, dstport: in0  }&lt;br /&gt;
      # Change it to the following to add fft0 between ddc0 and ep0:&lt;br /&gt;
      - { srcblk: ddc0, srcport: out_0, dstblk: fft0, dstport: in_0 }&lt;br /&gt;
      - { srcblk: fft0, srcport: out_0, dstblk: ep0,  dstport: in0 }&lt;br /&gt;
&lt;br /&gt;
    clk_domains:&lt;br /&gt;
      ...&lt;br /&gt;
      # As before, we still connect our FFT block to the clock domain&lt;br /&gt;
      - { srcblk: _device_, srcport: rfnoc_chdr, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
This last line is valid for E310/E320; for X300/X310/N300/N310/N320/N321 use the following:&lt;br /&gt;
&lt;br /&gt;
      - { srcblk: _device_, srcport: ce, dstblk: fft0, dstport: ce }&lt;br /&gt;
&lt;br /&gt;
And as simply as that, we have added the FFT block to our RX block chain. Remember that this is a static connection, so when the resulting FPGA image is loaded onto your device, you will no longer be able to receive samples from the DDC directly; all samples on that chain will be processed by the FFT block, and you will only receive FFT bins from this radio chain.&lt;br /&gt;
&lt;br /&gt;
==Out-of-tree Modules==&lt;br /&gt;
&lt;br /&gt;
===OOT Overview===&lt;br /&gt;
&lt;br /&gt;
Now that we've gone over what is provided by UHD, let's start to look at custom RFNoC development. It's recommended that custom RFNoC development be kept separate from the in-tree UHD RFNoC infrastructure and examples, in order to simplify version control and licensing. Modules located outside of the repository are called ''out-of-tree'' (OOT).&lt;br /&gt;
&lt;br /&gt;
In order to understand how OOT modules for RFNoC are created, let's take a look at the example that's provided with UHD. You can find the example located in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/host/examples/rfnoc-example/&amp;lt;/code&amp;gt;. This example includes a simple Gain RFNoC block that we can use as a reference for creating our own OOT blocks.&lt;br /&gt;
&lt;br /&gt;
===OOT Subdirectories===&lt;br /&gt;
&lt;br /&gt;
Take a look at the &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; directory structure. An OOT module is a collection of block implementations, the software controllers for those blocks, and sometimes applications to demonstrate their functionality. These different components within the OOT module are organized into the directories described below.&lt;br /&gt;
&lt;br /&gt;
* HDL and Image Resources&lt;br /&gt;
** &amp;lt;code&amp;gt;fpga/&amp;lt;/code&amp;gt;: Contains the HDL (e.g., Verilog) required for the module. Each RFNoC block should have its own subdirectory here, such as &amp;lt;code&amp;gt;rfnoc_block_gain&amp;lt;/code&amp;gt;, for the Gain block.&lt;br /&gt;
** &amp;lt;code&amp;gt;blocks/&amp;lt;/code&amp;gt;: Contains the YAML RFNoC block definition files. These describe the block's interfaces and are used by the image builder. We'll go into more detail with regards to what goes into these YAML files in the [[#Creating_Your_Own_RFNoC_Block|Creating Your Own RFNoC Block]] section.&lt;br /&gt;
** &amp;lt;code&amp;gt;icores/&amp;lt;/code&amp;gt;: Contains example FPGA image core YAML files, to demonstrate how to create an FPGA image using your custom blocks. These image core files may demonstrate important parameters or show recommended configurations for chains of blocks.&lt;br /&gt;
* Block Controller and Example Software&lt;br /&gt;
** &amp;lt;code&amp;gt;include/&amp;lt;/code&amp;gt;: Contains the headers for the block controller software. Once installed, these headers will be used by UHD and other applications to interface with and control your custom RFNoC blocks.&lt;br /&gt;
** &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt;: Contains the block controller implementations. The files here should implement the features outlined in the headers located in the &amp;lt;code&amp;gt;include/&amp;lt;/code&amp;gt; directory. All unit test code should also be located here.&lt;br /&gt;
** &amp;lt;code&amp;gt;apps/&amp;lt;/code&amp;gt;: Contains example applications for your custom blocks. These applications may demonstrate how to use the block controllers, common configurations, or how to process data from your blocks.&lt;br /&gt;
* Infrastructure&lt;br /&gt;
** &amp;lt;code&amp;gt;cmake/&amp;lt;/code&amp;gt;: Contains any custom CMake commands the module may need. In general, simple modules will not need to modify this directory at all. More complicated modules with additional external dependencies may need to modify this.&lt;br /&gt;
&lt;br /&gt;
Take some time to explore the files in the &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt;. Note the following files and directories related to the Gain example:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-example/fpga/rfnoc_block_gain/&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;This is the HDL for the Gain RFNoC block.&lt;br /&gt;
** &amp;lt;code&amp;gt;rfnoc_block_gain.v&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The top-level synthesizable file for the Gain block&lt;br /&gt;
** &amp;lt;code&amp;gt;noc_shell_gain.v&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The NoC Shell for the Gain block&lt;br /&gt;
** &amp;lt;code&amp;gt;rfnoc_block_gain_tb.sv&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The simulation testbench&lt;br /&gt;
** &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The simulation Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-example/blocks/gain.yml&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The YAML block definition file for the Gain block&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-example/icores/x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;An example RFNoC image core YAML description showing how to connect the Gain block&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-example/include/rfnoc/example/gain_block_control.hpp&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The software block controller header&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-example/lib/gain_block_control.cpp&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;The software block controller implementation&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-example/apps/init_gain_block.cpp&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;An example showing how to find and initialize the Gain block&lt;br /&gt;
&amp;lt;!-- We should have an example that streams data that the customers can run using the Gain block --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Creating Your Own OOT Module===&lt;br /&gt;
&lt;br /&gt;
To create your own OOT module, make a copy of the &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; directory. This will contain all the subdirectories and infrastructure files that you need to create your custom module. The directory name for your copy should be renamed to your desired name; we recommend something like &amp;lt;code&amp;gt;rfnoc-foo&amp;lt;/code&amp;gt;, for example, where &amp;lt;code&amp;gt;foo&amp;lt;/code&amp;gt; is the name for your OOT module. You'll also need to change &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; within the module's &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt; files to your module's name.&lt;br /&gt;
&lt;br /&gt;
Let's start by creating our own copy of the &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; to work with. We'll call our module &amp;lt;code&amp;gt;demo&amp;lt;/code&amp;gt;. You can put the copy wherever you like, but for this example we'll put it in our home directory. &lt;br /&gt;
&lt;br /&gt;
    $ cp -r &amp;lt;repo&amp;gt;/host/examples/rfnoc-example ~/&lt;br /&gt;
    $ mv ~/rfnoc-example ~/rfnoc-demo&lt;br /&gt;
&lt;br /&gt;
Now we need to edit our &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt; files to rename our module. Edit the following files and change all instances of &amp;lt;code&amp;gt;rfnoc-example&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;rfnoc-demo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
    ~/rfnoc-demo/CMakeLists.txt&lt;br /&gt;
    ~/rfnoc-demo/lib/CMakeLists.txt&lt;br /&gt;
&lt;br /&gt;
===Building and Installing an OOT Module===&lt;br /&gt;
The OOT module will need to be built and installed in order to use its RFNoC blocks. To build and install the OOT module we just created, do the following:&lt;br /&gt;
&lt;br /&gt;
    $ mkdir ~/rfnoc-demo/build&lt;br /&gt;
    $ cd ~/rfnoc-demo/build&lt;br /&gt;
    $ cmake -DUHD_FPGA_DIR=&amp;lt;repo&amp;gt;/fpga/ ../&lt;br /&gt;
&lt;br /&gt;
This configures the project to be installed in the default location. You may want to provide a different install directory to CMake using the &amp;lt;code&amp;gt;-DCMAKE_INSTALL_PREFIX&amp;lt;/code&amp;gt;. Please refer to the [https://files.ettus.com/manual/page_build_guide.html UHD Installation Guide] or the installation guide for other CMake-based projects for instructions on configuring CMake.&lt;br /&gt;
&lt;br /&gt;
Note that we specify the location of the FPGA source code using the &amp;lt;code&amp;gt;-DUHD_FPGA_DIR&amp;lt;/code&amp;gt; option. This allows you to run the FPGA testbenches and to build the example FPGA image provided with the OOT example.&lt;br /&gt;
&lt;br /&gt;
At this point, you can run &amp;lt;code&amp;gt;make help&amp;lt;/code&amp;gt; to see what options are available. A few of the available make targets are described below:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make rfnoc-demo&amp;lt;/code&amp;gt;: Build the block controllers for the RFNoC blocks&lt;br /&gt;
* &amp;lt;code&amp;gt;make testbenches&amp;lt;/code&amp;gt;: Run the testbenches for the RFNoC blocks&lt;br /&gt;
* &amp;lt;code&amp;gt;make x310_rfnoc_image_core&amp;lt;/code&amp;gt;: Build the FPGA example image&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;: Install the module&lt;br /&gt;
&lt;br /&gt;
To build and install the block, perform the following steps.&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/rfnoc-demo/build&lt;br /&gt;
    $ make&lt;br /&gt;
    $ make install&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; may be required depending on the install location.&lt;br /&gt;
&lt;br /&gt;
===Building an FPGA Image with OOT Blocks===&lt;br /&gt;
&lt;br /&gt;
At this point you can build the example FPGA that's included in the &amp;lt;code&amp;gt;icores&amp;lt;/code&amp;gt; directory. Take a look at &amp;lt;code&amp;gt;~/rfnoc-demo/icores/x310_rfnoc_image_core.yml&amp;lt;/code&amp;gt;. Note that the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block is added in exactly the same way that the FFT block was in [[#Example:_Adding_an_FFT_Block|Example: Adding an FFT Block]]. You can build this example FPGA for the X310 using the following steps:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/rfnoc-demo/build&lt;br /&gt;
    $ make x310_rfnoc_image_core&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can call &amp;lt;code&amp;gt;rfnoc_image_builder&amp;lt;/code&amp;gt; directly. In order to get the image builder to find your custom blocks, you may need to supply some additional arguments to find the OOT module, as shown in the following example:&lt;br /&gt;
&lt;br /&gt;
    $ rfnoc_image_builder -F &amp;lt;repo&amp;gt;/fpga –I ~/rfnoc-demo/include/rfnoc -y ~/rfnoc-demo/icores/x310_rfnoc_image_core.yml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; option is only required if the OOT module has not been installed on the system. &amp;lt;!-- I think this is supposed to be the case, but it's not working right now, so we will see. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have an X310, you can build and use the provided example to test the Gain block. If you have a different USRP, you can use its default &amp;lt;code&amp;gt;rfnoc_image_core.yml&amp;lt;/code&amp;gt; as a starting point and follow the same steps that we followed for the FFT block in [[#Example:_Adding_an_FFT_Block|Example: Adding an FFT Block]], then build it using the process described above.&lt;br /&gt;
&lt;br /&gt;
===Testing the Gain Example===&lt;br /&gt;
&lt;br /&gt;
After building an FPGA image for your USRP and downloading it to your device, the Gain block should be available. Test this by running &amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
   $ uhd_usrp_probe --args &amp;quot;type=x300,addr=192.168.30.2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Again, note that your &amp;lt;code&amp;gt;args&amp;lt;/code&amp;gt; may be different or may not be required if you only have a single USRP connected.&lt;br /&gt;
&lt;br /&gt;
Take a look at the RFNoC blocks and the static connections on the device. You should see the following new blocks and connections:&lt;br /&gt;
&amp;lt;!-- TODO: It should show &amp;quot;0/Gain#0&amp;quot; here --&amp;gt;&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    ...&lt;br /&gt;
    |   |   * 0/Block#0&lt;br /&gt;
    ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    ...&lt;br /&gt;
    |   |   * 0/SEP#4:0==&amp;gt;0/Block#0:0&lt;br /&gt;
    |   |   * 0/Block#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;!-- TODO:&lt;br /&gt;
Next, let's run the provided &amp;lt;code&amp;gt;init_gain_block&amp;lt;/code&amp;gt; application example.&lt;br /&gt;
&lt;br /&gt;
    $ ~/rfnoc-demo/build/apps/init_gain_block&lt;br /&gt;
    ...&lt;br /&gt;
    Gain value read/write loopback successful!&lt;br /&gt;
    $ &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
==Creating Your Own RFNoC Block==&lt;br /&gt;
&lt;br /&gt;
The Gain block is a useful example and could even be used as the starting point for a new block, but rather than trying to copy and edit the Gain block, it is best to use the RFNoC ModTool to create a new block template. This is also required if you want to change the interfaces provided to your IP that are exposed by the NoC Shell.&lt;br /&gt;
&lt;br /&gt;
===Understanding the Block Definition YAML===&lt;br /&gt;
&lt;br /&gt;
The first step in creating a new block is to write a YAML description for the block that you want to create. The options available are described [https://files.ettus.com/app_notes/RFNoC_Specification.pdf RFNoC Specification]. You can also look at the blocks available in &amp;lt;code&amp;gt;&amp;lt;repo&amp;gt;/host/include/uhd/rfnoc/blocks/&amp;lt;/code&amp;gt; for examples. We'll provide a brief overview here.&lt;br /&gt;
&lt;br /&gt;
Open up and take a look at the Gain block definition located in &amp;lt;code&amp;gt;~/rfnoc-demo/blocks/gain.yml&amp;lt;/code&amp;gt;. Notice the different sections, which are described below:&lt;br /&gt;
&lt;br /&gt;
* '''General Parameters'''&amp;lt;br&amp;gt;In this section we give our block a name (&amp;lt;code&amp;gt;module_name&amp;lt;/code&amp;gt;) and a unique block ID (&amp;lt;code&amp;gt;noc_id&amp;lt;/code&amp;gt;). The NoC ID is an arbitrary 32-bit number that will be used by the software to identify the block during system discovery. You can also specify the CHDR bus width, which should be 64 for Generation-3 USRPs.&lt;br /&gt;
* '''Clocks'''&amp;lt;br&amp;gt;In the &amp;lt;code&amp;gt;clocks&amp;lt;/code&amp;gt; section, we define the clocks that will be used by the block. The &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rfnoc_ctrl&amp;lt;/code&amp;gt; clocks are required. Many blocks also have a &amp;lt;code&amp;gt;ce&amp;lt;/code&amp;gt; clock for internal DSP.&lt;br /&gt;
* '''Control Interface'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;control&amp;lt;/code&amp;gt; section defines what type of control interface to make available to your block. The control interface is used for register reads and writes. Most blocks do not need to modify this section and will use the &amp;lt;code&amp;gt;ctrlport&amp;lt;/code&amp;gt; interface type. Control Port is the standard register interface used by RFNoC. The &amp;lt;code&amp;gt;clk_domain&amp;lt;/code&amp;gt; parameter allows you to specify which clock domain to use for the register interface exposed to your block. Typically this is the same clock that is used for the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; interface, to avoid clock crossings.&lt;br /&gt;
* '''Data Interface'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; section defines what type of data interface to make available to your block and describes the ports. Most blocks use either the &amp;lt;code&amp;gt;axis_pyld_ctxt&amp;lt;/code&amp;gt; or the &amp;lt;code&amp;gt;axis_data&amp;lt;/code&amp;gt; interface types.&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;clk_domain&amp;lt;/code&amp;gt; parameter allows you to specify which clock domain to use for the data interfaces exposed to your block. Typically this is the same clock that is used for the &amp;lt;code&amp;gt;control&amp;lt;/code&amp;gt; interface, to avoid clock crossings.&amp;lt;br&amp;gt;Under the &amp;lt;code&amp;gt;inputs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;outputs&amp;lt;/code&amp;gt; sections you can describe the input and output ports.&lt;br /&gt;
* '''IO Ports'''&amp;lt;br&amp;gt;The &amp;lt;code&amp;gt;io_ports&amp;lt;/code&amp;gt; section is used to describe other device-specific ports to which your block needs to connect (such as the DRAM or radio interfaces). For most blocks, this section is not used.&lt;br /&gt;
&lt;br /&gt;
A few other sections might be present in the YAML file (e.g., &amp;lt;code&amp;gt;registers&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;properties&amp;lt;/code&amp;gt;). These sections are reserved for future use and can be left empty.&lt;br /&gt;
&lt;br /&gt;
===Starting Your Own Block Definition===&lt;br /&gt;
&lt;br /&gt;
Let's start by making a copy of the Gain block YAML for our use case. &lt;br /&gt;
&lt;br /&gt;
    $ cp ~/rfnoc-demo/blocks/gain.yml ~/rfnoc-demo/blocks/demo.yml&lt;br /&gt;
&lt;br /&gt;
Now open the &amp;lt;code&amp;gt;demo.yml&amp;lt;/code&amp;gt; file you just created and make the following changes:&lt;br /&gt;
&lt;br /&gt;
# Change the name of the block from &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;demo&amp;lt;/code&amp;gt;&lt;br /&gt;
# Change the &amp;lt;code&amp;gt;noc_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;0x0000DE30&amp;lt;/code&amp;gt;&lt;br /&gt;
# Change the &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; for the &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;out&amp;lt;/code&amp;gt; ports from &amp;lt;code&amp;gt;int32&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This YAML file now describes a block with the following features:&lt;br /&gt;
&lt;br /&gt;
* The block named &amp;quot;demo&amp;quot;&lt;br /&gt;
* NoC ID of 0xDE30&lt;br /&gt;
* CtrlPort register interface on the &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock domain&lt;br /&gt;
* A single 32-bit input port named &amp;quot;In&amp;quot; on the &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock domain that will provide sc16 samples to your IP&lt;br /&gt;
* A single 32-bit output port named &amp;quot;Out&amp;quot; on the &amp;lt;code&amp;gt;rfnoc_chdr&amp;lt;/code&amp;gt; clock domain that will receive sc16 samples from your IP&lt;br /&gt;
&lt;br /&gt;
===Generating Your Block Using the ModTool===&lt;br /&gt;
&lt;br /&gt;
Now that we have a block definition YAML file, we can generate the source code templates and NoC Shell for our block. To do so, run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ python3 &amp;lt;repo&amp;gt;/host/utils/rfnoc_blocktool/rfnoc_create_verilog.py -c ~/rfnoc-demo/blocks/demo.yml -d ~/rfnoc-demo/fpga/rfnoc_block_demo&lt;br /&gt;
&lt;br /&gt;
This will create a folder named &amp;lt;code&amp;gt;~/rfnoc-demo/fpga/rfnoc_block_demo&amp;lt;/code&amp;gt; with an RFNoC block template for you to use. Explore the folder that was created. You should see the following files:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;''': This is the Makefile for the simulation testbench. See [https://files.ettus.com/manual/md_usrp3_sim_running_testbenches.html Running a Testbench] in the UHD and USRP Manual for instructions on how to run a testbench.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt;''': This is another makefile that identifies the HDL source code that makes up your RFNoC block. &lt;br /&gt;
* '''&amp;lt;code&amp;gt;noc_shell_demo.v&amp;lt;/code&amp;gt;''': This is the NoC Shell that was generated for your block. It provides the interfaces described in the block definition YAML.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;rfnoc_block_demo.v&amp;lt;/code&amp;gt;''': This is a template for your RFNoC block. It includes all the top-level ports required by RFNoC and instantiates the NoC Shell.&lt;br /&gt;
* '''&amp;lt;code&amp;gt;rfnoc_block_demo_tb.sv&amp;lt;/code&amp;gt;''': This is a testbench template for your RFNoC block. It instantiates your RFNoC block and the bus functional models (BFMs) needed to communicate with your block in simulation.&lt;br /&gt;
&lt;br /&gt;
Take a moment to look at the &amp;lt;code&amp;gt;rfnoc_block_demo.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rfnoc_block_demo_tb.sv&amp;lt;/code&amp;gt; files that were generated for your block. Notice the &amp;quot;User Logic&amp;quot; section towards the end of the &amp;lt;code&amp;gt;rfnoc_block_demo&amp;lt;/code&amp;gt; module. This is the location where you can insert your own IP.&lt;br /&gt;
&lt;br /&gt;
The input data samples come in on the &amp;lt;code&amp;gt;m_in_payload&amp;lt;/code&amp;gt; AXI4-Stream bus. The output data samples go out on the &amp;lt;code&amp;gt;s_out_payload&amp;lt;/code&amp;gt; AXI4-Stream data bus. &lt;br /&gt;
&lt;br /&gt;
If your input packets are the same size as your output packets (i.e., for every sample in you generate one sample out) then the &amp;lt;code&amp;gt;m_in_context&amp;lt;/code&amp;gt; data bus can be used to drive &amp;lt;code&amp;gt;s_out_context&amp;lt;/code&amp;gt;. The context bus is described in detail in the [https://files.ettus.com/app_notes/RFNoC_Specification.pdf RFNoC Specification].&lt;br /&gt;
&lt;br /&gt;
Similarly, the testbench has a section where you can add your own test sequences to the test bench.&lt;br /&gt;
&lt;br /&gt;
If you decide you need to change the RFNoC interfaces for your block (e.g., add ports, or change the interface type), then it is recommended to update the block definition YAML then regenerate the block. Please take care to not overwrite any code you have written when regenerating the files for your block! Rerunning the tool will cause new files to be generated, with a new NoC Shell, and will demonstrate how to update your code for the new interfaces.&lt;br /&gt;
&lt;br /&gt;
Refer to the Gain example and other RFNoC blocks for examples of how to complete your RFNoC block logic and testbenches.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
In this guide we have given a brief introduction on how to develop for RFNoC in UHD 4.0. There's a lot more you can do than is described here, but this will hopefully get you started. Happy coding!&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5258</id>
		<title>Using the RFNoC Replay Block in UHD 4</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5258"/>
				<updated>2022-02-04T13:43:12Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* Building the FPGA */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-642b'''&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
This application note guides a user through basic use of the RFNoC Replay block&lt;br /&gt;
in UHD 4.x and explains how to run the UHD Replay example. This example covers&lt;br /&gt;
the USRP X410, X310/X300, N300/N310/N320 and E320 devices. For UHD 3.x, please&lt;br /&gt;
refer to [[Using_the_RFNoC_Replay_Block|the UHD 3.x replay block Application Note]].&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
The Replay block is an RFNoC block that allows recording and playback of&lt;br /&gt;
arbitrary data using DRAM on the USRP hardware as a buffer. To use the Replay&lt;br /&gt;
block, it must be instantiated in the design and connected to the DRAM interface.&lt;br /&gt;
&lt;br /&gt;
The replay block is a standard feature of UHD and RFNoC, and a custom compile of&lt;br /&gt;
UHD is not required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs, so when using these images,&lt;br /&gt;
the following examples can be run without any manual builds of UHD or FPGA images.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
To follow this application note, you need a device with a replay block instantiated,&lt;br /&gt;
and a UHD version recent enough to have the full support for the replay block&lt;br /&gt;
(UHD 4.2 and beyond). To test for the replay block capabilities, connect and&lt;br /&gt;
enable your USRP device, and run the following command:&lt;br /&gt;
&lt;br /&gt;
    uhd_usrp_probe --args &amp;lt;device args&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Depending on your device, the output could look like this (truncated):&lt;br /&gt;
&lt;br /&gt;
     _____________________________________________________&lt;br /&gt;
    /&lt;br /&gt;
    |       Device: X400-Series Device&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Mboard: ni-x4xx-&amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   pid: 1040&lt;br /&gt;
    |   |   rev: 4&lt;br /&gt;
    |   |   rev_compat: 4&lt;br /&gt;
    |   |   serial: &amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   MPM Version: 4.0&lt;br /&gt;
    |   |   FPGA Version: 7.6&lt;br /&gt;
    |   |   FPGA git hash: &amp;lt;hash&amp;gt;.clean&lt;br /&gt;
    |   |   RFNoC capable: Yes&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   Time sources:  internal, external, qsfp0, gpsdo&lt;br /&gt;
    |   |   Clock sources: mboard, internal, external, nsync, gpsdo&lt;br /&gt;
    |   |   Sensors: ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/DDC#0&lt;br /&gt;
    |   |   * 0/DDC#1&lt;br /&gt;
    |   |   * 0/DUC#0&lt;br /&gt;
    |   |   * 0/DUC#1&lt;br /&gt;
    |   |   * 0/Radio#0&lt;br /&gt;
    |   |   * 0/Radio#1&lt;br /&gt;
    |   |   * 0/Replay#0&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/SEP#0:0==&amp;gt;0/DUC#0:0&lt;br /&gt;
    |   |   * 0/DUC#0:0==&amp;gt;0/Radio#0:0&lt;br /&gt;
    |   |   * 0/Radio#0:0==&amp;gt;0/DDC#0:0&lt;br /&gt;
    |   |   * 0/DDC#0:0==&amp;gt;0/SEP#0:0&lt;br /&gt;
    |   |   * 0/SEP#1:0==&amp;gt;0/DUC#0:1&lt;br /&gt;
    |   |   * 0/DUC#0:1==&amp;gt;0/Radio#0:1&lt;br /&gt;
    |   |   * 0/Radio#0:1==&amp;gt;0/DDC#0:1&lt;br /&gt;
    |   |   * 0/DDC#0:1==&amp;gt;0/SEP#1:0&lt;br /&gt;
    |   |   * 0/SEP#2:0==&amp;gt;0/DUC#1:0&lt;br /&gt;
    |   |   * 0/DUC#1:0==&amp;gt;0/Radio#1:0&lt;br /&gt;
    |   |   * 0/Radio#1:0==&amp;gt;0/DDC#1:0&lt;br /&gt;
    |   |   * 0/DDC#1:0==&amp;gt;0/SEP#2:0&lt;br /&gt;
    |   |   * 0/SEP#3:0==&amp;gt;0/DUC#1:1&lt;br /&gt;
    |   |   * 0/DUC#1:1==&amp;gt;0/Radio#1:1&lt;br /&gt;
    |   |   * 0/Radio#1:1==&amp;gt;0/DDC#1:1&lt;br /&gt;
    |   |   * 0/DDC#1:1==&amp;gt;0/SEP#3:0&lt;br /&gt;
    |   |   * 0/SEP#4:0==&amp;gt;0/Replay#0:0&lt;br /&gt;
    |   |   * 0/Replay#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
    |   |   * 0/SEP#5:0==&amp;gt;0/Replay#0:1&lt;br /&gt;
    |   |   * 0/Replay#0:1==&amp;gt;0/SEP#5:0&lt;br /&gt;
    |   |   * 0/SEP#6:0==&amp;gt;0/Replay#0:2&lt;br /&gt;
    |   |   * 0/Replay#0:2==&amp;gt;0/SEP#6:0&lt;br /&gt;
    |   |   * 0/SEP#7:0==&amp;gt;0/Replay#0:3&lt;br /&gt;
    |   |   * 0/Replay#0:3==&amp;gt;0/SEP#7:0&lt;br /&gt;
&lt;br /&gt;
The output tells us that this USRP has a Replay block instantiated (&amp;lt;code&amp;gt;0/Replay#0&amp;lt;/code&amp;gt;).&lt;br /&gt;
It has four static connections to stream endpoints, which also tells us that&lt;br /&gt;
this is a four-port replay block.&lt;br /&gt;
&lt;br /&gt;
If your device does not report a replay block, then you need to build and load&lt;br /&gt;
an FPGA image which includes this block. See ... for instructions on how to do&lt;br /&gt;
this before you proceed. If it does report a block, you can move to the next&lt;br /&gt;
section.&lt;br /&gt;
&lt;br /&gt;
==Running the Example==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; example assumes that you have a&lt;br /&gt;
file containing the samples you wish to replay. This could be generated in&lt;br /&gt;
advance or recorded using &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt; or another method. For&lt;br /&gt;
this demonstration, we'll create a simple Python program (&amp;lt;code&amp;gt;sample_gen.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
to generate some samples to use:&lt;br /&gt;
&lt;br /&gt;
    import math&lt;br /&gt;
    import struct&lt;br /&gt;
    &lt;br /&gt;
    SAMPLE_RATE = 200.0e6        # Sample rate in Hz&lt;br /&gt;
    FREQUENCY   = 500.0e3        # Frequency of sinusoid to generate, in Hz&lt;br /&gt;
    NUM_SAMPLES = 16000          # Number of samples to generate&lt;br /&gt;
    AMPLITUDE   = 0.5            # Amplitude of the signal (from 0 to 1.0)&lt;br /&gt;
    FILE_NAME   = 'samples.dat'&lt;br /&gt;
    &lt;br /&gt;
    file = open(FILE_NAME, 'wb')&lt;br /&gt;
    &lt;br /&gt;
    for i in range(NUM_SAMPLES):&lt;br /&gt;
        I = int((2**15-1) * AMPLITUDE * math.cos(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        Q = int((2**15-1) * AMPLITUDE * math.sin(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        file.write(struct.pack('&amp;lt;2h', I, Q))&lt;br /&gt;
    &lt;br /&gt;
    file.close()&lt;br /&gt;
&lt;br /&gt;
This program generates a file named &amp;lt;code&amp;gt;samples.dat&amp;lt;/code&amp;gt; that contains 16000&lt;br /&gt;
samples (40 periods) of a 500&amp;amp;nbsp;kHz tone sampled at a rate of 200&amp;amp;nbsp;MHz.&lt;br /&gt;
Each sample is saved in &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt; format (signed complex with 16-bit real&lt;br /&gt;
and 16-bit imaginary components). We can run the program by invoking python from&lt;br /&gt;
the command line.&lt;br /&gt;
&lt;br /&gt;
    $ python ./sample_gen.py&lt;br /&gt;
&lt;br /&gt;
To run the UHD Replay example, enter a command like the following (the path to&lt;br /&gt;
the examples depends on your installation method, for a normal installation via&lt;br /&gt;
apt-get, examples will be located in &amp;lt;code&amp;gt;/usr/lib/uhd/examples&amp;lt;/code&amp;gt; or&lt;br /&gt;
&amp;lt;code&amp;gt;/usr/local/lib/uhd/examples&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
    $ cd /path/to/examples&lt;br /&gt;
    $ ./replay_samples_from_file --args &amp;lt;device args&amp;gt; --freq 915e6 --gain 10 --file samples.dat --rate 200e6&lt;br /&gt;
&lt;br /&gt;
This example would stream the samples from the file to the Replay block on the&lt;br /&gt;
FPGA, where they are recorded into the USRP's on-board DRAM. Then, the Replay block&lt;br /&gt;
will play the samples to the radio continuously with a base frequency of 915 MHz,&lt;br /&gt;
creating a tone at 915.5 MHz. Press &amp;lt;code&amp;gt;Ctrl+C&amp;lt;/code&amp;gt; to stop transmitting.&lt;br /&gt;
Alternatively, use the &amp;lt;code&amp;gt;--nsamps&amp;lt;/code&amp;gt; command line argument to transmit&lt;br /&gt;
a certain number of samples before returning to the command line. Use the&lt;br /&gt;
&amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; argument to see a full list of arguments.&lt;br /&gt;
&lt;br /&gt;
The advantage of this example compared to directly streaming the file to the&lt;br /&gt;
device is twofold:&lt;br /&gt;
&lt;br /&gt;
* The initial upload to DRAM can happen at any link rate. Even when using 1 GbE, this example will work.&lt;br /&gt;
* Once uploaded, the host computer is basically idle. The FPGA will handle the streaming to the radio front-end.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp source code]&lt;br /&gt;
for &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; may be considered an example&lt;br /&gt;
for best practices on how to use the replay block.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Using the Replay Block==&lt;br /&gt;
&lt;br /&gt;
This block works like a record and playback buffer that uses DRAM on the USRP to&lt;br /&gt;
store samples.&lt;br /&gt;
Data can be streamed to the block, like to any other RFNoC block.&lt;br /&gt;
&lt;br /&gt;
Refer the [https://files.ettus.com/manual/classuhd_1_1rfnoc_1_1replay__block__control.html manual of the replay block controller]&lt;br /&gt;
for a comprehensive description of its features and API calls.&lt;br /&gt;
&lt;br /&gt;
In the following, we shall use the C++ API to demonstrate the most important&lt;br /&gt;
API calls. We will assume there is a replay block controller called&lt;br /&gt;
&amp;lt;code&amp;gt;replay_ctrl&amp;lt;/code&amp;gt; available in the current context, and it is of type&lt;br /&gt;
&amp;lt;code&amp;gt;uhd::rfnoc::replay_block_control::sptr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Recording Data===&lt;br /&gt;
&lt;br /&gt;
Before streaming data to the replay block, it needs to be configured for recording:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record(buffer_start_byte_address, buffer_size_in_bytes, replay_chan);&lt;br /&gt;
&lt;br /&gt;
This tells the Replay block that it should start recording any data it receives&lt;br /&gt;
on port &amp;lt;code&amp;gt;port&amp;lt;/code&amp;gt; into the DRAM at byte offset &amp;lt;code&amp;gt;buffer_start_byte_address&amp;lt;/code&amp;gt;&lt;br /&gt;
and should use up to &amp;lt;code&amp;gt;buffer_size_in_bytes&amp;lt;/code&amp;gt; bytes. Once the buffer is&lt;br /&gt;
filled, recording automatically stops. Care should be taken to configure the&lt;br /&gt;
memory buffers so that they do not overlap if more than one Replay block or&lt;br /&gt;
buffer is being used simultaneously.&lt;br /&gt;
&lt;br /&gt;
Call this once for every port that you expect to stream data into.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Care should be taken to not transfer more data to the Replay block&lt;br /&gt;
than the size of the record buffer. Additional data is not accepted or dropped&lt;br /&gt;
by the replay block, but flow control will cause data to back up in the RF network on the FPGA.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The amount of memory available to the Replay block is limited by the&lt;br /&gt;
size of the DRAM on the USRP and how the memory interface is configured on the USRP.&lt;br /&gt;
For example, the &amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; IP used by the X310 is&lt;br /&gt;
configured to give each connected device an address space of 32&amp;amp;nbsp;MiB. As a&lt;br /&gt;
result, the Replay block will be limited to this amount of memory. The&lt;br /&gt;
&amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; file must be modified if more than 32&amp;amp;nbsp;MiB needs to be buffered.&lt;br /&gt;
&lt;br /&gt;
To restart recording from the same offset, the following API call can be used:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record_restart(replay_chan);&lt;br /&gt;
&lt;br /&gt;
This resets the record pointer to point back to the beginning of the buffer and&lt;br /&gt;
it resets the internal counters that track how much data has been recorded. If&lt;br /&gt;
a previous recording has taken place then it is a good idea to ensure that&lt;br /&gt;
stale data was not queued up in the RF network on the FPGA from a previous run.&lt;br /&gt;
The &amp;lt;code&amp;gt;replay_samples_from_file&amp;lt;/code&amp;gt; example does this by calling&lt;br /&gt;
&amp;lt;code&amp;gt;record_restart()&amp;lt;/code&amp;gt; then waiting to see if any new data shows up&lt;br /&gt;
unexpectedly in the record buffer. If so, it restarts recording then waits&lt;br /&gt;
again to see if data continues to appear.&lt;br /&gt;
&lt;br /&gt;
You can determine when all data has been received by checking the status of the&lt;br /&gt;
record fullness.&lt;br /&gt;
&lt;br /&gt;
    // Wait for recording to complete&lt;br /&gt;
    while (replay_ctrl-&amp;gt;get_record_fullness(replay_chan) &amp;lt; num_bytes_expected)&lt;br /&gt;
        std::this_thread::sleep_for(100ms);&lt;br /&gt;
&lt;br /&gt;
===Playing back Data===&lt;br /&gt;
&lt;br /&gt;
Prior to playing back recorded data, it is necessary to configure the base&lt;br /&gt;
address and size of the playback buffer. To play back previously recorded data,&lt;br /&gt;
set the start address to the same address that was used for the record buffer&lt;br /&gt;
and set the size of the playback buffer to the match the amount of data that&lt;br /&gt;
was recorded. Note that the record and playback buffers do not need to be the&lt;br /&gt;
same, allowing a single Replay block to both record and playback to different&lt;br /&gt;
regions of memory simultaneously.&lt;br /&gt;
&lt;br /&gt;
    // Configure the Replay block to play back everything that was recorded&lt;br /&gt;
    num_bytes_recorded = replay_ctrl-&amp;gt;get_record_fullness(replay_chan);&lt;br /&gt;
    replay_ctrl-&amp;gt;config_play(buffer_start_byte_address, num_bytes_recorded, replay_chan);&lt;br /&gt;
&lt;br /&gt;
To play back the data in the playback buffer, issue the appropriate UHD stream command.&lt;br /&gt;
Playback automatically wraps around to the start of the buffer if more data is&lt;br /&gt;
requested than the size of the playback buffer.&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;STREAM_MODE_START_CONTINUOUS&amp;lt;/code&amp;gt; causes playback to continue indefinitely&lt;br /&gt;
until explicitly stopped. &amp;lt;code&amp;gt;STREAM_MODE_NUM_SAMPS_AND_DONE&amp;lt;/code&amp;gt; causes only&lt;br /&gt;
the specified number of samples to be played once. The &amp;lt;code&amp;gt;num_samps&amp;lt;/code&amp;gt;&lt;br /&gt;
parameter is a 28-bit value, limiting this mode of playback to 2&amp;lt;sup&amp;gt;28&amp;lt;/sup&amp;gt;&lt;br /&gt;
words at a time. Playback can be stopped by issuing a stop command.&lt;br /&gt;
&lt;br /&gt;
    stream_cmd.stream_mode = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd);&lt;br /&gt;
&lt;br /&gt;
This will stop playback at the end of the next DRAM read after the command is&lt;br /&gt;
received (DRAM reads are not aborted mid-transaction). As a result, some data&lt;br /&gt;
will continue to stream from the Replay block after the stop command is issued&lt;br /&gt;
while waiting for the DRAM read to complete and for all the internal buffers to&lt;br /&gt;
empty.&lt;br /&gt;
&lt;br /&gt;
When using the C++ API, the &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; API call is a useful shorthand&lt;br /&gt;
for configuring playback and submitting the stream command at the same time:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;play(buffer_start_byte_address, num_bytes_to_play, replay_chan, start_time, repeat);&lt;br /&gt;
&lt;br /&gt;
In either case, the start time is optional. When given, the first sample to leave&lt;br /&gt;
the block on playback is tagged with this timestamp.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Memory alignment and word sizes===&lt;br /&gt;
&lt;br /&gt;
There are two memory alignment values that need to be considered when dealing&lt;br /&gt;
with the replay block. The first is the word size, which is the minimum number of&lt;br /&gt;
bytes per transaction. For all default configurations, the word size is 64 bits,&lt;br /&gt;
which means that only even numbers of samples can be recorded or played back&lt;br /&gt;
when using 16-bit complex samples (at 4 bytes per sample). Use the &amp;lt;code&amp;gt;get_word_size()&amp;lt;/code&amp;gt;&lt;br /&gt;
API call to identify the correct word size.&lt;br /&gt;
&lt;br /&gt;
The second alignment value is the memory's page boundaries. The start addresses&lt;br /&gt;
for record and replay must fall onto a 4 kiB memory boundary to ensure correct&lt;br /&gt;
alignment of data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Building Custom FPGA Images with a Replay Block==&lt;br /&gt;
&lt;br /&gt;
===Configure the Default Shell===&lt;br /&gt;
&lt;br /&gt;
Before you begin, make sure you are using the &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt; shell. See [[Software_Development_on_the_E3xx_USRP_-_Building_RFNoC_UHD_/_GNU_Radio_/_gr-ettus_from_Source#Reconfigure_Default_Shell|Reconfigure Default Shell]] in AN-315 for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
===Cloning the Repository===&lt;br /&gt;
&lt;br /&gt;
Note: Cloning the repository is only required when building custom FPGA images.&lt;br /&gt;
If the replay block is already built into the USRP's bit file, this is not&lt;br /&gt;
required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs.&lt;br /&gt;
&lt;br /&gt;
If you do require access to the source code, e.g. to build an FPGA image with a&lt;br /&gt;
custom replay block configuration, run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/EttusResearch/uhd.git&lt;br /&gt;
&lt;br /&gt;
For the rest of the Application Note, we assume the repository was cloned into&lt;br /&gt;
the location ~/src/uhd.&lt;br /&gt;
&lt;br /&gt;
===Installing the FPGA Tools===&lt;br /&gt;
&lt;br /&gt;
In order to build the FPGA image for the intended USRP product, you will need&lt;br /&gt;
to have the Xilinx development tools installed. The specific version required&lt;br /&gt;
depends on the UHD version. Refer to the&lt;br /&gt;
[https://files.ettus.com/manual/md_usrp3_build_instructions.html manual] for the&lt;br /&gt;
correct version for your UHD version, and the installation instructions for&lt;br /&gt;
Vivado in order to install these tools. It is recommended that you use the&lt;br /&gt;
default install location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Building the FPGA==&lt;br /&gt;
&lt;br /&gt;
In order to use the Replay block, it must be built into the FPGA image for the&lt;br /&gt;
USRP you plan to use. This is currently a manual step. The instructions below&lt;br /&gt;
are for the X310, but similar instructions apply to other RFNoC-capable&lt;br /&gt;
devices.&lt;br /&gt;
&lt;br /&gt;
To create a custom FPGA image with a replay, you need to create an image core file.&lt;br /&gt;
The following lines are the relevant lines from the&lt;br /&gt;
[https://github.com/EttusResearch/uhd/blob/master/fpga/usrp3/top/x300/x310_rfnoc_image_core.yml X310 default image core file]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      # ... all the other stream endpoints...&lt;br /&gt;
      ep4:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
      ep5:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
    &lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      # ... all the other blocks...&lt;br /&gt;
      replay0:&lt;br /&gt;
        block_desc: 'replay.yml'&lt;br /&gt;
        parameters:&lt;br /&gt;
          NUM_PORTS: 2&lt;br /&gt;
    &lt;br /&gt;
     connections:&lt;br /&gt;
      # ...connections for all the other blocks...&lt;br /&gt;
      # ep4 to replay0(0)&lt;br /&gt;
      - { srcblk: ep4,     srcport: out0,  dstblk: replay0, dstport: in_0 }&lt;br /&gt;
      # replay0(0) to ep4&lt;br /&gt;
      - { srcblk: replay0, srcport: out_0, dstblk: ep4,     dstport: in0  }&lt;br /&gt;
      # ep5 to replay0(1)&lt;br /&gt;
      - { srcblk: ep5,     srcport: out0,  dstblk: replay0, dstport: in_1 }&lt;br /&gt;
      # replay0(1) to ep5&lt;br /&gt;
      - { srcblk: replay0, srcport: out_1, dstblk: ep5,     dstport: in0  }&lt;br /&gt;
      # BSP Connections&lt;br /&gt;
      - { srcblk: replay0, srcport: axi_ram, dstblk: _device_, dstport: dram }     MEM_ADDR_W: 30&lt;br /&gt;
    clk_domains:&lt;br /&gt;
        # ...all other clock domains...&lt;br /&gt;
        - { srcblk: _device_, srcport: dram,  dstblk: replay0, dstport: mem  }&lt;br /&gt;
&lt;br /&gt;
As you can see, the replay block requires configuration in up to four sections:&lt;br /&gt;
* For maximum flexibility, every port of the replay block will receive its own stream endpoint. This is not a requirement of the replay block, but allows its flexible use.&lt;br /&gt;
* Of course, the block needs to be declared in the &amp;lt;code&amp;gt;noc_blocks&amp;lt;/code&amp;gt; section.&lt;br /&gt;
* It must be connected to the stream endpoints in the &amp;lt;code&amp;gt;connections&amp;lt;/code&amp;gt; section, as well as to the DRAM banks (BSP connection).&lt;br /&gt;
* Finally, the clock domain needs to be connected.&lt;br /&gt;
&lt;br /&gt;
When the YAML image core file is complete, save it, e.g., as x310_replay_image_core.yml,&lt;br /&gt;
and pass it to the image builder:&lt;br /&gt;
&lt;br /&gt;
    rfnoc_image_builder -y x310_replay_image_core.yml&lt;br /&gt;
&lt;br /&gt;
This will create a bitfile that contains the replay block. It can be loaded onto&lt;br /&gt;
the device using the &amp;lt;code&amp;gt;uhd_image_loader&amp;lt;/code&amp;gt; tool:&lt;br /&gt;
&lt;br /&gt;
    uhd_image_loader --args type=x300,addr=&amp;lt;ip address&amp;gt; --fpga-path=/path/to/usrp_x310_fpga_HG.bit&lt;br /&gt;
&lt;br /&gt;
When this is complete, the replay block is ready to use.&lt;br /&gt;
&lt;br /&gt;
==Source files==&lt;br /&gt;
&lt;br /&gt;
For reference, the following files implement the replay block:&lt;br /&gt;
&lt;br /&gt;
* Verilog/HDL sources: https://github.com/EttusResearch/uhd/tree/master/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_replay&lt;br /&gt;
* C++ Block controller sources (header, block controller, Python bindings, unit tests):&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/include/uhd/rfnoc/replay_block_control.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control.cpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control_python.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/tests/rfnoc_block_tests/replay_block_test.cpp&lt;br /&gt;
* Example: https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block&amp;diff=5257</id>
		<title>Using the RFNoC Replay Block</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block&amp;diff=5257"/>
				<updated>2022-02-04T13:42:46Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-642'''&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This application note guides a user through basic use of the &lt;br /&gt;
RFNoC Replay block in UHD 3.x and explains how to run the UHD Replay example. This example covers use on the X300/X310 and N310 products. UHD 4.0 and later is not covered in [[Using the RFNoC Replay Block 4.0]].&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The Replay block is an RFNoC block that allows recording and playback of arbitrary data using DRAM on the USRP hardware as a buffer. To use the Replay block, it must be instantiated in the design and connected to the DRAM interface. It can take the place of the DMA FIFO(s) or be used concert with the DMA FIFO(s). In this note we will be replacing the DMA FIFO block with the Replay block and running a UHD example that records data to DRAM from a file then plays it back over the radio continuously.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
===Configure the Default Shell===&lt;br /&gt;
&lt;br /&gt;
Before you begin, make sure you are using the &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt; shell. See [[Software_Development_on_the_E3xx_USRP_-_Building_RFNoC_UHD_/_GNU_Radio_/_gr-ettus_from_Source#Reconfigure_Default_Shell|Reconfigure Default Shell]] in AN-315 for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
===Cloning the Repository===&lt;br /&gt;
&lt;br /&gt;
Your system must be configured for RFNoC development to compile and use the RFNoC examples. Here we briefly explain how to setup a system to build and run the RFNoC Replay example.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Refer to Application Note AN-823 [[Getting Started with RFNoC Development]] for a more detailed overview of RFNoC development.&lt;br /&gt;
&lt;br /&gt;
To begin, use the following &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt; command to download the needed UHD repository. The &amp;lt;code&amp;gt;--recursive&amp;lt;/code&amp;gt; option causes the latest compatible FPGA code to also be cloned into the &amp;lt;code&amp;gt;fpga-src&amp;lt;/code&amp;gt; subfolder.&lt;br /&gt;
&lt;br /&gt;
    $ git clone --recursive https://github.com/EttusResearch/uhd.git&lt;br /&gt;
&lt;br /&gt;
Then checkout the appropriate version of UHD that you intend to use. Replay block support was added in UHD 3.14. The latest UHD 3.x version is recommended.&lt;br /&gt;
&lt;br /&gt;
    $ git checkout UHD-3.15.LTS&lt;br /&gt;
    $ git submodule update --recursive&lt;br /&gt;
&lt;br /&gt;
===Building and Installing UHD===&lt;br /&gt;
&lt;br /&gt;
If you have not already done so, follow the steps in Application Note '''AN-445''' under the heading [[Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux#Update_and_Install_dependencies|Update and Install dependencies]].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Refer to Application Note [[Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux|AN-445]] for detailed instructions on building and installing UHD from the source code. However, RFNoC must be enabled when running CMake in order to run the RFNoC examples. The instructions below summarize the basic steps required to build and install UHD so that you can run the Replay example.&lt;br /&gt;
&lt;br /&gt;
To build and install UHD, begin by opening a terminal in the UHD repository that you cloned, then create a &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; folder within the &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; host folder of the repository.&lt;br /&gt;
&lt;br /&gt;
    $ cd uhd/host&lt;br /&gt;
    $ mkdir build&lt;br /&gt;
    $ cd build&lt;br /&gt;
&lt;br /&gt;
Run CMake with RFNoC enabled to create the Makefiles.&lt;br /&gt;
&lt;br /&gt;
    $ cmake -DENABLE_RFNOC=ON ../&lt;br /&gt;
&lt;br /&gt;
Run Make to build UHD with RFNoC support.&lt;br /&gt;
&lt;br /&gt;
    $ make&lt;br /&gt;
&lt;br /&gt;
Install UHD, using the default install prefix, which will install UHD under the &amp;lt;code&amp;gt;/usr/local/lib&amp;lt;/code&amp;gt; folder. You need to run this as root due to the permissions on that folder.&lt;br /&gt;
&lt;br /&gt;
   $ sudo make install&lt;br /&gt;
&lt;br /&gt;
Update the system's shared library cache.&lt;br /&gt;
&lt;br /&gt;
   $ sudo ldconfig&lt;br /&gt;
&lt;br /&gt;
Make sure that the &amp;lt;code&amp;gt;LD_LIBRARY_PATH&amp;lt;/code&amp;gt; environment variable is defined and includes the folder under which UHD was installed. Most commonly, you can add the line below to the end of your &amp;lt;code&amp;gt;$HOME/.bashrc&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' the &amp;lt;code&amp;gt;LD_LIBRARY_PATH&amp;lt;/code&amp;gt; location may vary depending on your Linux distribution.&lt;br /&gt;
&lt;br /&gt;
   $ export LD_LIBRARY_PATH=/usr/local/lib&lt;br /&gt;
&lt;br /&gt;
===Installing the FPGA Tools===&lt;br /&gt;
&lt;br /&gt;
In order to build the FPGA image for the intended USRP product, you will need to have the Xilinx development tools installed. The specific version required depends on the branch and state of the FPGA code. The UHD-3.13 branches require Vivado 17.4. Refer to the installation instructions for Vivado in order to install these tools. It is recommended that you use the default install location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt; to ensure compatibility with the FPGA build flow.&lt;br /&gt;
&lt;br /&gt;
==Building the FPGA==&lt;br /&gt;
&lt;br /&gt;
In order to use the Replay block, it must be built into the FPGA image for the USRP you plan to use. This is currently a manual step. The instructions below are for the X310, but similar instructions apply to the N310.&lt;br /&gt;
&lt;br /&gt;
First, we must modify the Verilog code to include the Replay Block. To do this, modify the file &amp;lt;code&amp;gt;fpga-src/top/x300/x300_core.v&amp;lt;/code&amp;gt; and change localparam &amp;lt;code&amp;gt;USE_REPLAY&amp;lt;/code&amp;gt; from 0 to 1. This causes the FPGA code to instantiate &amp;lt;code&amp;gt;noc_block_replay&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;noc_block_axi_dma_fifo&amp;lt;/code&amp;gt;. Note that the DMA FIFO will not be included in this example and therefore cannot be used.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If using the N310, modify the file &amp;lt;code&amp;gt;fpga-src/top/n3xx/n3xx_core.v&amp;lt;/code&amp;gt; and make the same change. Other products that support RFNoC can also use the replay block. However, in other products, the noc_block_replay instance would need to be manually instantiated in the code following the examples given in the &amp;lt;code&amp;gt;x300_core.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;n3xx_core.v&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
After making the required code change, you are ready to rebuild the FPGA image. Begin by setting up the environment to use the FPGA build tools.&lt;br /&gt;
&lt;br /&gt;
    $ cd uhd/fpga-src/usrp3/top/x300&lt;br /&gt;
    $ source ./setup.sh&lt;br /&gt;
&lt;br /&gt;
Run make to build the desired FPGA image. For example, to build the X310 HG image, use the following command:&lt;br /&gt;
&lt;br /&gt;
    $ make X310_HG&lt;br /&gt;
&lt;br /&gt;
Once compilation is complete, download the image to your USRP product. For example, if the X310 HG image were connected to SFP port 0 (1 Gigabit Ethernet) using the default IP address, then you would run the following command.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args=&amp;quot;type=x300,addr=192.168.10.2&amp;quot; --fpga-path=./build-X310_HG/x300.bit&lt;br /&gt;
&lt;br /&gt;
After the download has completed, power cycle the X310 to load the new bitstream. Confirm that the Replay block appears in the system by running &amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe --args=&amp;quot;addr=192.168.10.2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should see the &amp;lt;code&amp;gt;Replay&amp;lt;/code&amp;gt; block listed among the RFNoC blocks on the device.&lt;br /&gt;
&lt;br /&gt;
   |   |     _____________________________________________________&lt;br /&gt;
   |   |    /&lt;br /&gt;
   |   |   |       RFNoC blocks on this device:&lt;br /&gt;
   |   |   |   &lt;br /&gt;
   |   |   |   * Replay_0&lt;br /&gt;
   |   |   |   * Radio_0&lt;br /&gt;
   |   |   |   * Radio_1&lt;br /&gt;
   |   |   |   * DDC_0&lt;br /&gt;
   |   |   |   * DDC_1&lt;br /&gt;
   |   |   |   * DUC_0&lt;br /&gt;
   |   |   |   * DUC_1&lt;br /&gt;
&lt;br /&gt;
==Building the Replay Example==&lt;br /&gt;
&lt;br /&gt;
In this section we will compile the replay_from_file UHD example. Begin by creating a CMake file for the Replay example using &amp;lt;code&amp;gt;uhd/host/examples/init_usrp/CMakeLists.txt&amp;lt;/code&amp;gt; as an example.&lt;br /&gt;
&lt;br /&gt;
    $ cd uhd/host/examples&lt;br /&gt;
    $ mkdir replay_samples_from_file&lt;br /&gt;
    $ cd replay_samples_from_file&lt;br /&gt;
    $ cp ../init_usrp/CMakeLists.txt ./&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt; and change the &amp;lt;code&amp;gt;init_usrp&amp;lt;/code&amp;gt; references to &amp;lt;code&amp;gt;replay_samples_from_file&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;init_usrp.cpp&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;../replay_samples_from_file.cpp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:uhd cpp makefile edits.png|650px]]&lt;br /&gt;
&lt;br /&gt;
You can now invoke CMake and run Make to build the example.&lt;br /&gt;
&lt;br /&gt;
    $ mkdir build&lt;br /&gt;
    $ cd build&lt;br /&gt;
    $ cmake ../&lt;br /&gt;
    $ make&lt;br /&gt;
&lt;br /&gt;
==Running the Example==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;replay_samples_from_file&amp;lt;/code&amp;gt; example assumes that you have a file containing the samples you wish to replay. This could be generated in advance or recorded using &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt; or another method. For this demonstration, we'll create a simple Python program (&amp;lt;code&amp;gt;sample_gen.py&amp;lt;/code&amp;gt;) to generate some samples to use:&lt;br /&gt;
&lt;br /&gt;
    import math&lt;br /&gt;
    import struct&lt;br /&gt;
    &lt;br /&gt;
    SAMPLE_RATE = 200.0e6        # Sample rate in Hz&lt;br /&gt;
    FREQUENCY   = 500.0e3        # Frequency of sinusoid to generate, in Hz&lt;br /&gt;
    NUM_SAMPLES = 16000          # Number of samples to generate&lt;br /&gt;
    AMPLITUDE   = 0.5            # Amplitude of the signal (from 0 to 1.0)&lt;br /&gt;
    FILE_NAME   = 'samples.dat'&lt;br /&gt;
    &lt;br /&gt;
    file = open(FILE_NAME, 'wb')&lt;br /&gt;
    &lt;br /&gt;
    for i in range(NUM_SAMPLES):&lt;br /&gt;
        I = int((2**15-1) * AMPLITUDE * math.cos(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        Q = int((2**15-1) * AMPLITUDE * math.sin(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        file.write(struct.pack('&amp;lt;2h', I, Q))&lt;br /&gt;
    &lt;br /&gt;
    file.close()&lt;br /&gt;
&lt;br /&gt;
This program generates a file named &amp;lt;code&amp;gt;samples.dat&amp;lt;/code&amp;gt; that contains 16000 samples (40 periods) of a 500&amp;amp;nbsp;kHz tone sampled at a rate of 200&amp;amp;nbsp;MHz. Each sample is saved in &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt; format (signed complex with 16-bit real and 16-bit imaginary components). We can run the program by invoking python from the command line.&lt;br /&gt;
&lt;br /&gt;
    $ python ./sample_gen.py&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The &amp;lt;code&amp;gt;replay_samples_from_file&amp;lt;/code&amp;gt; example does not perform rate conversion (i.e., the the DUC is not used), so the rate specified must match the native sample rate of your device (i.e., 200&amp;amp;nbsp;Msps for the X300/X310 or 125&amp;amp;nbsp;Msps for the N310). The samples file should contain &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt; data samples and should be a multiple of 2 samples (8 bytes) in size, since the Replay block records and plays back in multiples of 8 bytes. For example, for the N310 you could change &amp;lt;code&amp;gt;SAMPLE_RATE&amp;lt;/code&amp;gt; in the Python program to 125.0e6, which would result in 64 periods of the 500&amp;amp;nbsp;kHz tone.&lt;br /&gt;
&lt;br /&gt;
To run the UHD Replay example, you could enter a command like the following.&lt;br /&gt;
&lt;br /&gt;
    $ ./replay_samples_from_file --freq 915e6 --gain 10 --file samples.dat&lt;br /&gt;
&lt;br /&gt;
This example would stream the samples from the file to the Replay block on the FPGA, where they are recorded into the USRP's on-board DRAM, then would cause Replay block to play back the samples to the radio continuously with a base frequency of 915 MHz, creating a tone at 915.5 MHz. Press &amp;lt;code&amp;gt;Ctrl+C&amp;lt;/code&amp;gt; to stop transmitting.&lt;br /&gt;
&lt;br /&gt;
==Using the Replay Block==&lt;br /&gt;
&lt;br /&gt;
The Replay block is contained in &amp;lt;code&amp;gt;noc_block_replay.v&amp;lt;/code&amp;gt;. This block works like a record and playback buffer that uses DRAM on the USRP to store samples. It connects to the RFNoC crossbar and to the DRAM in the same way that the &amp;lt;code&amp;gt;noc_block_axi_dma_fifo&amp;lt;/code&amp;gt; block does. Data can be streamed to the block, like to any other RFNoC block. Playback is analogous to the way the &amp;lt;code&amp;gt;noc_block_radio_core&amp;lt;/code&amp;gt; works when we ask it to receive radio samples.&lt;br /&gt;
&lt;br /&gt;
One key difference is that the Replay block works only with 64-bit samples. Therefore, all addresses, buffer sizes, and transfers should be a multiple of 8 bytes. For example, when using &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt; samples (4 bytes each) everything should be a multiple of two samples to ensure we are always working with multiples of 8 bytes.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Refer to the example source code in &amp;lt;code&amp;gt;replay_samples_from_file.cpp&amp;lt;/code&amp;gt; for a more detailed example of how to use the Replay block.&lt;br /&gt;
&lt;br /&gt;
Prior to streaming data to the Replay block for recording, it is necessary to configure the base address and size of the record buffer.&lt;br /&gt;
&lt;br /&gt;
    // Configure the record buffer&lt;br /&gt;
    replay_ctrl-&amp;gt;config_record(buffer_start_byte_address, buffer_size_in_bytes, replay_chan);&lt;br /&gt;
&lt;br /&gt;
This tells the Replay block that it should start recording any data it receives into the DRAM at byte offset &amp;lt;code&amp;gt;buffer_start_byte_address&amp;lt;/code&amp;gt; and should use up to &amp;lt;code&amp;gt;buffer_size_in_bytes&amp;lt;/code&amp;gt; bytes. Once the buffer is filled, recording automatically stops. Care should be taken to configure the memory buffers so that they do not overlap if more than one Replay block or buffer is being used simultaneously. The memory addresses and sizes should be 8-byte aligned.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Care should be taken to not transfer more data to the Replay block than the size of the record buffer. Additional data is not accepted or dropped by the replay block, but flow control will cause data to back up in the RF network on the FPGA.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The amount of memory available to the Replay block is limited by the size of the DRAM on the USRP and how the memory interface is configured on the USRP. For example, the &amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; IP used by the X310 is configured to give each connected device an address space of 32&amp;amp;nbsp;MiB. As a result, the Replay block will be limited to this amount of memory. The &amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; file must be modified if more than 32&amp;amp;nbsp;MiB needs to be buffered.&lt;br /&gt;
&lt;br /&gt;
To begin recording data to the Replay block, the record logic should be initialized:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record_restart(replay_chan);&lt;br /&gt;
&lt;br /&gt;
This resets the record pointer to point back to the beginning of the buffer and it resets the internal counters that track how much data has been recorded. If a previous recording has taken place then it is a good idea to ensure that stale data was not queued up in the RF network on the FPGA from a previous run. The &amp;lt;code&amp;gt;replay_samples_from_file&amp;lt;/code&amp;gt; example does this by calling &amp;lt;code&amp;gt;record_restart()&amp;lt;/code&amp;gt; then waiting to see if any new data shows up unexpectedly in the record buffer. If so, it restarts recording then waits again to see if data continues to appear.&lt;br /&gt;
&lt;br /&gt;
You can determine when all data has been received by checking the status of the record fullness.&lt;br /&gt;
&lt;br /&gt;
    // Wait for recording to complete&lt;br /&gt;
    while (replay_ctrl-&amp;gt;get_record_fullness(replay_chan) &amp;lt; num_bytes_expected);&lt;br /&gt;
&lt;br /&gt;
Prior to playing back recorded data, it is necessary to configure the base address and size of the playback buffer. To play back previously recorded data, set the start address to the same address that was used for the record buffer and set the size of the playback buffer to the match the amount of data that was recorded. Note that the record and playback buffers do not need to the same, allowing a single Replay block to both record and playback to different regions of memory simultaneously.&lt;br /&gt;
&lt;br /&gt;
    // Configure the Replay block to play back everything that was recorded&lt;br /&gt;
    num_bytes_recorded = replay_ctrl-&amp;gt;get_record_fullness(replay_chan);&lt;br /&gt;
    replay_ctrl-&amp;gt;config_play(buffer_start_byte_address, num_bytes_recorded, replay_chan);&lt;br /&gt;
&lt;br /&gt;
To play back the data in the playback buffer, issue the appropriate UHD stream command. Playback automatically wraps around to the start of the buffer if more data is requested than the size of the playback buffer.&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;STREAM_MODE_START_CONTINUOUS&amp;lt;/code&amp;gt; causes playback to continue indefinitely until explicitly stopped. &amp;lt;code&amp;gt;STREAM_MODE_NUM_SAMPS_AND_DONE&amp;lt;/code&amp;gt; causes only the specified number of samples to be played once. The &amp;lt;code&amp;gt;num_samps&amp;lt;/code&amp;gt; parameter is a 28-bit value, limiting this mode of playback to 2&amp;lt;sup&amp;gt;28&amp;lt;/sup&amp;gt; words at a time. Playback can be stopped by issuing a stop command.&lt;br /&gt;
&lt;br /&gt;
    stream_cmd.stream_mode = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd);&lt;br /&gt;
&lt;br /&gt;
This will stop playback at the end of the next DRAM read after the command is received (DRAM reads are not aborted mid-transaction). As a result, some data will continue to stream from the Replay block after the stop command is issued while waiting for the DRAM read to complete and for all the internal buffers to empty. The &amp;lt;code&amp;gt;replay_samples_from_file&amp;lt;/code&amp;gt; example determines when playback streaming has stopped by reading the 64-bit &amp;lt;code&amp;gt;SR_READBACK_REG_GLOBAL_PARAMS&amp;lt;/code&amp;gt; register and waiting for the packet count to stop increasing.&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5256</id>
		<title>Using the RFNoC Replay Block in UHD 4</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Using_the_RFNoC_Replay_Block_in_UHD_4&amp;diff=5256"/>
				<updated>2022-02-04T13:41:09Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: Created page with &amp;quot;==Application Note Number== '''AN-642b'''  ==Abstract==  This application note guides a user through basic use of the RFNoC Replay block in UHD 4.x and explains how to run the...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-642b'''&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
This application note guides a user through basic use of the RFNoC Replay block&lt;br /&gt;
in UHD 4.x and explains how to run the UHD Replay example. This example covers&lt;br /&gt;
the USRP X410, X310/X300, N300/N310/N320 and E320 devices. For UHD 3.x, please&lt;br /&gt;
refer to [[Using_the_RFNoC_Replay_Block|the UHD 3.x replay block Application Note]].&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
The Replay block is an RFNoC block that allows recording and playback of&lt;br /&gt;
arbitrary data using DRAM on the USRP hardware as a buffer. To use the Replay&lt;br /&gt;
block, it must be instantiated in the design and connected to the DRAM interface.&lt;br /&gt;
&lt;br /&gt;
The replay block is a standard feature of UHD and RFNoC, and a custom compile of&lt;br /&gt;
UHD is not required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs, so when using these images,&lt;br /&gt;
the following examples can be run without any manual builds of UHD or FPGA images.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
To follow this application note, you need a device with a replay block instantiated,&lt;br /&gt;
and a UHD version recent enough to have the full support for the replay block&lt;br /&gt;
(UHD 4.2 and beyond). To test for the replay block capabilities, connect and&lt;br /&gt;
enable your USRP device, and run the following command:&lt;br /&gt;
&lt;br /&gt;
    uhd_usrp_probe --args &amp;lt;device args&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Depending on your device, the output could look like this (truncated):&lt;br /&gt;
&lt;br /&gt;
     _____________________________________________________&lt;br /&gt;
    /&lt;br /&gt;
    |       Device: X400-Series Device&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Mboard: ni-x4xx-&amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   pid: 1040&lt;br /&gt;
    |   |   rev: 4&lt;br /&gt;
    |   |   rev_compat: 4&lt;br /&gt;
    |   |   serial: &amp;lt;serial&amp;gt;&lt;br /&gt;
    |   |   MPM Version: 4.0&lt;br /&gt;
    |   |   FPGA Version: 7.6&lt;br /&gt;
    |   |   FPGA git hash: &amp;lt;hash&amp;gt;.clean&lt;br /&gt;
    |   |   RFNoC capable: Yes&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   Time sources:  internal, external, qsfp0, gpsdo&lt;br /&gt;
    |   |   Clock sources: mboard, internal, external, nsync, gpsdo&lt;br /&gt;
    |   |   Sensors: ...&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/DDC#0&lt;br /&gt;
    |   |   * 0/DDC#1&lt;br /&gt;
    |   |   * 0/DUC#0&lt;br /&gt;
    |   |   * 0/DUC#1&lt;br /&gt;
    |   |   * 0/Radio#0&lt;br /&gt;
    |   |   * 0/Radio#1&lt;br /&gt;
    |   |   * 0/Replay#0&lt;br /&gt;
    |     _____________________________________________________&lt;br /&gt;
    |    /&lt;br /&gt;
    |   |       Static connections on this device:&lt;br /&gt;
    |   |&lt;br /&gt;
    |   |   * 0/SEP#0:0==&amp;gt;0/DUC#0:0&lt;br /&gt;
    |   |   * 0/DUC#0:0==&amp;gt;0/Radio#0:0&lt;br /&gt;
    |   |   * 0/Radio#0:0==&amp;gt;0/DDC#0:0&lt;br /&gt;
    |   |   * 0/DDC#0:0==&amp;gt;0/SEP#0:0&lt;br /&gt;
    |   |   * 0/SEP#1:0==&amp;gt;0/DUC#0:1&lt;br /&gt;
    |   |   * 0/DUC#0:1==&amp;gt;0/Radio#0:1&lt;br /&gt;
    |   |   * 0/Radio#0:1==&amp;gt;0/DDC#0:1&lt;br /&gt;
    |   |   * 0/DDC#0:1==&amp;gt;0/SEP#1:0&lt;br /&gt;
    |   |   * 0/SEP#2:0==&amp;gt;0/DUC#1:0&lt;br /&gt;
    |   |   * 0/DUC#1:0==&amp;gt;0/Radio#1:0&lt;br /&gt;
    |   |   * 0/Radio#1:0==&amp;gt;0/DDC#1:0&lt;br /&gt;
    |   |   * 0/DDC#1:0==&amp;gt;0/SEP#2:0&lt;br /&gt;
    |   |   * 0/SEP#3:0==&amp;gt;0/DUC#1:1&lt;br /&gt;
    |   |   * 0/DUC#1:1==&amp;gt;0/Radio#1:1&lt;br /&gt;
    |   |   * 0/Radio#1:1==&amp;gt;0/DDC#1:1&lt;br /&gt;
    |   |   * 0/DDC#1:1==&amp;gt;0/SEP#3:0&lt;br /&gt;
    |   |   * 0/SEP#4:0==&amp;gt;0/Replay#0:0&lt;br /&gt;
    |   |   * 0/Replay#0:0==&amp;gt;0/SEP#4:0&lt;br /&gt;
    |   |   * 0/SEP#5:0==&amp;gt;0/Replay#0:1&lt;br /&gt;
    |   |   * 0/Replay#0:1==&amp;gt;0/SEP#5:0&lt;br /&gt;
    |   |   * 0/SEP#6:0==&amp;gt;0/Replay#0:2&lt;br /&gt;
    |   |   * 0/Replay#0:2==&amp;gt;0/SEP#6:0&lt;br /&gt;
    |   |   * 0/SEP#7:0==&amp;gt;0/Replay#0:3&lt;br /&gt;
    |   |   * 0/Replay#0:3==&amp;gt;0/SEP#7:0&lt;br /&gt;
&lt;br /&gt;
The output tells us that this USRP has a Replay block instantiated (&amp;lt;code&amp;gt;0/Replay#0&amp;lt;/code&amp;gt;).&lt;br /&gt;
It has four static connections to stream endpoints, which also tells us that&lt;br /&gt;
this is a four-port replay block.&lt;br /&gt;
&lt;br /&gt;
If your device does not report a replay block, then you need to build and load&lt;br /&gt;
an FPGA image which includes this block. See ... for instructions on how to do&lt;br /&gt;
this before you proceed. If it does report a block, you can move to the next&lt;br /&gt;
section.&lt;br /&gt;
&lt;br /&gt;
==Running the Example==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; example assumes that you have a&lt;br /&gt;
file containing the samples you wish to replay. This could be generated in&lt;br /&gt;
advance or recorded using &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt; or another method. For&lt;br /&gt;
this demonstration, we'll create a simple Python program (&amp;lt;code&amp;gt;sample_gen.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
to generate some samples to use:&lt;br /&gt;
&lt;br /&gt;
    import math&lt;br /&gt;
    import struct&lt;br /&gt;
    &lt;br /&gt;
    SAMPLE_RATE = 200.0e6        # Sample rate in Hz&lt;br /&gt;
    FREQUENCY   = 500.0e3        # Frequency of sinusoid to generate, in Hz&lt;br /&gt;
    NUM_SAMPLES = 16000          # Number of samples to generate&lt;br /&gt;
    AMPLITUDE   = 0.5            # Amplitude of the signal (from 0 to 1.0)&lt;br /&gt;
    FILE_NAME   = 'samples.dat'&lt;br /&gt;
    &lt;br /&gt;
    file = open(FILE_NAME, 'wb')&lt;br /&gt;
    &lt;br /&gt;
    for i in range(NUM_SAMPLES):&lt;br /&gt;
        I = int((2**15-1) * AMPLITUDE * math.cos(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        Q = int((2**15-1) * AMPLITUDE * math.sin(i / (SAMPLE_RATE / FREQUENCY) * 2 * math.pi))&lt;br /&gt;
        file.write(struct.pack('&amp;lt;2h', I, Q))&lt;br /&gt;
    &lt;br /&gt;
    file.close()&lt;br /&gt;
&lt;br /&gt;
This program generates a file named &amp;lt;code&amp;gt;samples.dat&amp;lt;/code&amp;gt; that contains 16000&lt;br /&gt;
samples (40 periods) of a 500&amp;amp;nbsp;kHz tone sampled at a rate of 200&amp;amp;nbsp;MHz.&lt;br /&gt;
Each sample is saved in &amp;lt;code&amp;gt;sc16&amp;lt;/code&amp;gt; format (signed complex with 16-bit real&lt;br /&gt;
and 16-bit imaginary components). We can run the program by invoking python from&lt;br /&gt;
the command line.&lt;br /&gt;
&lt;br /&gt;
    $ python ./sample_gen.py&lt;br /&gt;
&lt;br /&gt;
To run the UHD Replay example, enter a command like the following (the path to&lt;br /&gt;
the examples depends on your installation method, for a normal installation via&lt;br /&gt;
apt-get, examples will be located in &amp;lt;code&amp;gt;/usr/lib/uhd/examples&amp;lt;/code&amp;gt; or&lt;br /&gt;
&amp;lt;code&amp;gt;/usr/local/lib/uhd/examples&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
    $ cd /path/to/examples&lt;br /&gt;
    $ ./replay_samples_from_file --args &amp;lt;device args&amp;gt; --freq 915e6 --gain 10 --file samples.dat --rate 200e6&lt;br /&gt;
&lt;br /&gt;
This example would stream the samples from the file to the Replay block on the&lt;br /&gt;
FPGA, where they are recorded into the USRP's on-board DRAM. Then, the Replay block&lt;br /&gt;
will play the samples to the radio continuously with a base frequency of 915 MHz,&lt;br /&gt;
creating a tone at 915.5 MHz. Press &amp;lt;code&amp;gt;Ctrl+C&amp;lt;/code&amp;gt; to stop transmitting.&lt;br /&gt;
Alternatively, use the &amp;lt;code&amp;gt;--nsamps&amp;lt;/code&amp;gt; command line argument to transmit&lt;br /&gt;
a certain number of samples before returning to the command line. Use the&lt;br /&gt;
&amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; argument to see a full list of arguments.&lt;br /&gt;
&lt;br /&gt;
The advantage of this example compared to directly streaming the file to the&lt;br /&gt;
device is twofold:&lt;br /&gt;
&lt;br /&gt;
* The initial upload to DRAM can happen at any link rate. Even when using 1 GbE, this example will work.&lt;br /&gt;
* Once uploaded, the host computer is basically idle. The FPGA will handle the streaming to the radio front-end.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp source code]&lt;br /&gt;
for &amp;lt;code&amp;gt;rfnoc_replay_samples_from_file&amp;lt;/code&amp;gt; may be considered an example&lt;br /&gt;
for best practices on how to use the replay block.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Using the Replay Block==&lt;br /&gt;
&lt;br /&gt;
This block works like a record and playback buffer that uses DRAM on the USRP to&lt;br /&gt;
store samples.&lt;br /&gt;
Data can be streamed to the block, like to any other RFNoC block.&lt;br /&gt;
&lt;br /&gt;
Refer the [https://files.ettus.com/manual/classuhd_1_1rfnoc_1_1replay__block__control.html manual of the replay block controller]&lt;br /&gt;
for a comprehensive description of its features and API calls.&lt;br /&gt;
&lt;br /&gt;
In the following, we shall use the C++ API to demonstrate the most important&lt;br /&gt;
API calls. We will assume there is a replay block controller called&lt;br /&gt;
&amp;lt;code&amp;gt;replay_ctrl&amp;lt;/code&amp;gt; available in the current context, and it is of type&lt;br /&gt;
&amp;lt;code&amp;gt;uhd::rfnoc::replay_block_control::sptr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Recording Data===&lt;br /&gt;
&lt;br /&gt;
Before streaming data to the replay block, it needs to be configured for recording:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record(buffer_start_byte_address, buffer_size_in_bytes, replay_chan);&lt;br /&gt;
&lt;br /&gt;
This tells the Replay block that it should start recording any data it receives&lt;br /&gt;
on port &amp;lt;code&amp;gt;port&amp;lt;/code&amp;gt; into the DRAM at byte offset &amp;lt;code&amp;gt;buffer_start_byte_address&amp;lt;/code&amp;gt;&lt;br /&gt;
and should use up to &amp;lt;code&amp;gt;buffer_size_in_bytes&amp;lt;/code&amp;gt; bytes. Once the buffer is&lt;br /&gt;
filled, recording automatically stops. Care should be taken to configure the&lt;br /&gt;
memory buffers so that they do not overlap if more than one Replay block or&lt;br /&gt;
buffer is being used simultaneously.&lt;br /&gt;
&lt;br /&gt;
Call this once for every port that you expect to stream data into.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Care should be taken to not transfer more data to the Replay block&lt;br /&gt;
than the size of the record buffer. Additional data is not accepted or dropped&lt;br /&gt;
by the replay block, but flow control will cause data to back up in the RF network on the FPGA.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The amount of memory available to the Replay block is limited by the&lt;br /&gt;
size of the DRAM on the USRP and how the memory interface is configured on the USRP.&lt;br /&gt;
For example, the &amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; IP used by the X310 is&lt;br /&gt;
configured to give each connected device an address space of 32&amp;amp;nbsp;MiB. As a&lt;br /&gt;
result, the Replay block will be limited to this amount of memory. The&lt;br /&gt;
&amp;lt;code&amp;gt;axi_intercon_2x64_128_bd&amp;lt;/code&amp;gt; file must be modified if more than 32&amp;amp;nbsp;MiB needs to be buffered.&lt;br /&gt;
&lt;br /&gt;
To restart recording from the same offset, the following API call can be used:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;record_restart(replay_chan);&lt;br /&gt;
&lt;br /&gt;
This resets the record pointer to point back to the beginning of the buffer and&lt;br /&gt;
it resets the internal counters that track how much data has been recorded. If&lt;br /&gt;
a previous recording has taken place then it is a good idea to ensure that&lt;br /&gt;
stale data was not queued up in the RF network on the FPGA from a previous run.&lt;br /&gt;
The &amp;lt;code&amp;gt;replay_samples_from_file&amp;lt;/code&amp;gt; example does this by calling&lt;br /&gt;
&amp;lt;code&amp;gt;record_restart()&amp;lt;/code&amp;gt; then waiting to see if any new data shows up&lt;br /&gt;
unexpectedly in the record buffer. If so, it restarts recording then waits&lt;br /&gt;
again to see if data continues to appear.&lt;br /&gt;
&lt;br /&gt;
You can determine when all data has been received by checking the status of the&lt;br /&gt;
record fullness.&lt;br /&gt;
&lt;br /&gt;
    // Wait for recording to complete&lt;br /&gt;
    while (replay_ctrl-&amp;gt;get_record_fullness(replay_chan) &amp;lt; num_bytes_expected)&lt;br /&gt;
        std::this_thread::sleep_for(100ms);&lt;br /&gt;
&lt;br /&gt;
===Playing back Data===&lt;br /&gt;
&lt;br /&gt;
Prior to playing back recorded data, it is necessary to configure the base&lt;br /&gt;
address and size of the playback buffer. To play back previously recorded data,&lt;br /&gt;
set the start address to the same address that was used for the record buffer&lt;br /&gt;
and set the size of the playback buffer to the match the amount of data that&lt;br /&gt;
was recorded. Note that the record and playback buffers do not need to be the&lt;br /&gt;
same, allowing a single Replay block to both record and playback to different&lt;br /&gt;
regions of memory simultaneously.&lt;br /&gt;
&lt;br /&gt;
    // Configure the Replay block to play back everything that was recorded&lt;br /&gt;
    num_bytes_recorded = replay_ctrl-&amp;gt;get_record_fullness(replay_chan);&lt;br /&gt;
    replay_ctrl-&amp;gt;config_play(buffer_start_byte_address, num_bytes_recorded, replay_chan);&lt;br /&gt;
&lt;br /&gt;
To play back the data in the playback buffer, issue the appropriate UHD stream command.&lt;br /&gt;
Playback automatically wraps around to the start of the buffer if more data is&lt;br /&gt;
requested than the size of the playback buffer.&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);&lt;br /&gt;
    stream_cmd.num_samps  = words_to_replay;&lt;br /&gt;
    stream_cmd.stream_now = true;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd, replay_chan);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;STREAM_MODE_START_CONTINUOUS&amp;lt;/code&amp;gt; causes playback to continue indefinitely&lt;br /&gt;
until explicitly stopped. &amp;lt;code&amp;gt;STREAM_MODE_NUM_SAMPS_AND_DONE&amp;lt;/code&amp;gt; causes only&lt;br /&gt;
the specified number of samples to be played once. The &amp;lt;code&amp;gt;num_samps&amp;lt;/code&amp;gt;&lt;br /&gt;
parameter is a 28-bit value, limiting this mode of playback to 2&amp;lt;sup&amp;gt;28&amp;lt;/sup&amp;gt;&lt;br /&gt;
words at a time. Playback can be stopped by issuing a stop command.&lt;br /&gt;
&lt;br /&gt;
    stream_cmd.stream_mode = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS;&lt;br /&gt;
    replay_ctrl-&amp;gt;issue_stream_cmd(stream_cmd);&lt;br /&gt;
&lt;br /&gt;
This will stop playback at the end of the next DRAM read after the command is&lt;br /&gt;
received (DRAM reads are not aborted mid-transaction). As a result, some data&lt;br /&gt;
will continue to stream from the Replay block after the stop command is issued&lt;br /&gt;
while waiting for the DRAM read to complete and for all the internal buffers to&lt;br /&gt;
empty.&lt;br /&gt;
&lt;br /&gt;
When using the C++ API, the &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; API call is a useful shorthand&lt;br /&gt;
for configuring playback and submitting the stream command at the same time:&lt;br /&gt;
&lt;br /&gt;
    replay_ctrl-&amp;gt;play(buffer_start_byte_address, num_bytes_to_play, replay_chan, start_time, repeat);&lt;br /&gt;
&lt;br /&gt;
In either case, the start time is optional. When given, the first sample to leave&lt;br /&gt;
the block on playback is tagged with this timestamp.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Memory alignment and word sizes===&lt;br /&gt;
&lt;br /&gt;
There are two memory alignment values that need to be considered when dealing&lt;br /&gt;
with the replay block. The first is the word size, which is the minimum number of&lt;br /&gt;
bytes per transaction. For all default configurations, the word size is 64 bits,&lt;br /&gt;
which means that only even numbers of samples can be recorded or played back&lt;br /&gt;
when using 16-bit complex samples (at 4 bytes per sample). Use the &amp;lt;code&amp;gt;get_word_size()&amp;lt;/code&amp;gt;&lt;br /&gt;
API call to identify the correct word size.&lt;br /&gt;
&lt;br /&gt;
The second alignment value is the memory's page boundaries. The start addresses&lt;br /&gt;
for record and replay must fall onto a 4 kiB memory boundary to ensure correct&lt;br /&gt;
alignment of data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Building Custom FPGA Images with a Replay Block==&lt;br /&gt;
&lt;br /&gt;
===Configure the Default Shell===&lt;br /&gt;
&lt;br /&gt;
Before you begin, make sure you are using the &amp;lt;code&amp;gt;Bash&amp;lt;/code&amp;gt; shell. See [[Software_Development_on_the_E3xx_USRP_-_Building_RFNoC_UHD_/_GNU_Radio_/_gr-ettus_from_Source#Reconfigure_Default_Shell|Reconfigure Default Shell]] in AN-315 for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
===Cloning the Repository===&lt;br /&gt;
&lt;br /&gt;
Note: Cloning the repository is only required when building custom FPGA images.&lt;br /&gt;
If the replay block is already built into the USRP's bit file, this is not&lt;br /&gt;
required. By default, UHD ships the Replay block with the default images for&lt;br /&gt;
the X410, X310/X300, N300/N310/N320 series of USRPs.&lt;br /&gt;
&lt;br /&gt;
If you do require access to the source code, e.g. to build an FPGA image with a&lt;br /&gt;
custom replay block configuration, run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/EttusResearch/uhd.git&lt;br /&gt;
&lt;br /&gt;
For the rest of the Application Note, we assume the repository was cloned into&lt;br /&gt;
the location ~/src/uhd.&lt;br /&gt;
&lt;br /&gt;
===Installing the FPGA Tools===&lt;br /&gt;
&lt;br /&gt;
In order to build the FPGA image for the intended USRP product, you will need&lt;br /&gt;
to have the Xilinx development tools installed. The specific version required&lt;br /&gt;
depends on the UHD version. Refer to the&lt;br /&gt;
[https://files.ettus.com/manual/md_usrp3_build_instructions.html manual] for the&lt;br /&gt;
correct version for your UHD version, and the installation instructions for&lt;br /&gt;
Vivado in order to install these tools. It is recommended that you use the&lt;br /&gt;
default install location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Building the FPGA==&lt;br /&gt;
&lt;br /&gt;
In order to use the Replay block, it must be built into the FPGA image for the&lt;br /&gt;
USRP you plan to use. This is currently a manual step. The instructions below&lt;br /&gt;
are for the X310, but similar instructions apply to other RFNoC-capable&lt;br /&gt;
devices.&lt;br /&gt;
&lt;br /&gt;
To create a custom FPGA image with a replay, you need to create an image core file.&lt;br /&gt;
The following lines are the relevant lines from the&lt;br /&gt;
[https://github.com/EttusResearch/uhd/blob/master/fpga/usrp3/top/x300/x310_rfnoc_image_core.yml X310 default image core file]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    stream_endpoints:&lt;br /&gt;
      # ... all the other stream endpoints...&lt;br /&gt;
      ep4:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
      ep5:                       # Stream endpoint name&lt;br /&gt;
        ctrl: False                     # Endpoint passes control traffic&lt;br /&gt;
        data: True                      # Endpoint passes data traffic&lt;br /&gt;
        buff_size: 4096                 # Ingress buffer size for data&lt;br /&gt;
&lt;br /&gt;
    noc_blocks:&lt;br /&gt;
      # ... all the other blocks...&lt;br /&gt;
      replay0:&lt;br /&gt;
        block_desc: 'replay.yml'&lt;br /&gt;
        parameters:&lt;br /&gt;
          NUM_PORTS: 2&lt;br /&gt;
    &lt;br /&gt;
     connections:&lt;br /&gt;
      # ...connections for all the other blocks...&lt;br /&gt;
      # ep4 to replay0(0)&lt;br /&gt;
      - { srcblk: ep4,     srcport: out0,  dstblk: replay0, dstport: in_0 }&lt;br /&gt;
      # replay0(0) to ep4&lt;br /&gt;
      - { srcblk: replay0, srcport: out_0, dstblk: ep4,     dstport: in0  }&lt;br /&gt;
      # ep5 to replay0(1)&lt;br /&gt;
      - { srcblk: ep5,     srcport: out0,  dstblk: replay0, dstport: in_1 }&lt;br /&gt;
      # replay0(1) to ep5&lt;br /&gt;
      - { srcblk: replay0, srcport: out_1, dstblk: ep5,     dstport: in0  }&lt;br /&gt;
      # BSP Connections&lt;br /&gt;
      - { srcblk: replay0, srcport: axi_ram, dstblk: _device_, dstport: dram }     MEM_ADDR_W: 30&lt;br /&gt;
    clk_domains:&lt;br /&gt;
        # ...all other clock domains...&lt;br /&gt;
        - { srcblk: _device_, srcport: dram,  dstblk: replay0, dstport: mem  }&lt;br /&gt;
&lt;br /&gt;
As you can see, the replay block requires configuration in up to four sections:&lt;br /&gt;
* For maximum flexibility, every port of the replay block will receive its own stream endpoint. This is not a requirement of the replay block, but allows its flexible use.&lt;br /&gt;
* Of course, the block needs to be declared in the &amp;lt;code&amp;gt;noc_blocks&amp;lt;/code&amp;gt; section.&lt;br /&gt;
* It must be connected to the stream endpoints in the &amp;lt;code&amp;gt;connections&amp;lt;/code&amp;gt; section, as well as to the DRAM banks (BSP connection).&lt;br /&gt;
* Finally, the clock domain needs to be connected.&lt;br /&gt;
&lt;br /&gt;
When the YAML image core file is complete, save it, e.g., as x310_replay_image_core.yml,&lt;br /&gt;
and pass it to the image builder:&lt;br /&gt;
&lt;br /&gt;
    rfnoc_image_builder -y x310_replay_image_core.yml&lt;br /&gt;
&lt;br /&gt;
This will create a bitfile that contains the replay block. It can be loaded onto&lt;br /&gt;
the device using the &amp;lt;code&amp;gt;uhd_image_loader&amp;lt;/code&amp;gt; tool:&lt;br /&gt;
&lt;br /&gt;
    uhd_image_loader --args type=x300,addr=&amp;lt;ip address&amp;gt; --fpga-path=/path/to/usrp_x310_fpga_HG.bit&lt;br /&gt;
&lt;br /&gt;
When this is complete, the replay block is ready to use.&lt;br /&gt;
&lt;br /&gt;
==Source files==&lt;br /&gt;
&lt;br /&gt;
For reference, the following files implement the replay block:&lt;br /&gt;
&lt;br /&gt;
* Verilog/HDL sources: https://github.com/EttusResearch/uhd/tree/master/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_replay&lt;br /&gt;
* C++ Block controller sources (header, block controller, Python bindings, unit tests):&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/include/uhd/rfnoc/replay_block_control.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control.cpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/lib/rfnoc/replay_block_control_python.hpp&lt;br /&gt;
** https://github.com/EttusResearch/uhd/blob/master/host/tests/rfnoc_block_tests/replay_block_test.cpp&lt;br /&gt;
* Example: https://github.com/EttusResearch/uhd/blob/master/host/examples/rfnoc_replay_samples_from_file.cpp&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Verifying_the_Operation_of_the_USRP_Using_UHD_and_GNU_Radio&amp;diff=4975</id>
		<title>Verifying the Operation of the USRP Using UHD and GNU Radio</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Verifying_the_Operation_of_the_USRP_Using_UHD_and_GNU_Radio&amp;diff=4975"/>
				<updated>2020-09-09T19:05:36Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* UHD Programs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-936'''&lt;br /&gt;
&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-05-01   &lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Neel Pandeya&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This AN explains how to use UHD and GNU Radio, once installed, to verify the correct operation of the USRP. Several test procedures are explained in detail. Several tests make use of an optional spectrum analyzer and signal generator. &lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
This application note will cover testing your USRP to verify it is operational. You will need to have a working installation of UHD to preform the following steps to verify your USRP. If you do not have UHD installed, please reference the Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on [[Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on Linux|Linux]], [[Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on OS X|OS X]] and [[Building and Installing the USRP Open Source Toolchain (UHD and GNU Radio) on Windows|Windows]] Application Notes.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you may use the [[Live SDR Environment]] to perform the following steps. More information about the [[Live SDR Environment]] is available at the [[Live SDR Environment Getting Started Guides]] page.&lt;br /&gt;
&lt;br /&gt;
==Proper Care and Handling==&lt;br /&gt;
All Ettus Research products are individually tested before shipment. The USRP™ is guaranteed to be functional at the time it is received by the customer. Improper use or handling of the USRP™ can easily cause the device to become non-functional. Listed below are some examples of actions which can prevent damage to the unit:&lt;br /&gt;
&lt;br /&gt;
*Never allow metal objects to touch the circuit board while powered.&lt;br /&gt;
*Always properly terminate the transmit port with an antenna or 50Ω load.&lt;br /&gt;
*Always handle the board with proper anti-static methods.&lt;br /&gt;
*Never allow the board to directly or indirectly come into contact with any voltage spikes.&lt;br /&gt;
*Never allow any water, or condensing moisture, to come into contact with the boards.&lt;br /&gt;
*Always use caution with FPGA, firmware, or software modifications.&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |[[File:Caution.png|24px|center]]&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |Never apply more than -15 dBm of power into any RF input&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |[[File:Caution.png|24px|center]]&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |Always use at least 30dB attenuation if operating in loopback configuration&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Finding the Device==&lt;br /&gt;
*Report detailed information on UHD-supported Software Radio Peripherals attached by USB, network, or embedded configuration. Details  include unit names, revision numbers, and available sensors on all attached USRP motherboards and daughterboards.&lt;br /&gt;
    uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ uhd_usrp_probe &lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
  _____________________________________________________&lt;br /&gt;
 /&lt;br /&gt;
|       Device: USRP2 / N-Series Device&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       Mboard: N210r4&lt;br /&gt;
|   |   hardware: 2577&lt;br /&gt;
|   |   mac-addr: 00:00:00:00:00:00&lt;br /&gt;
|   |   ip-addr: 192.168.10.2&lt;br /&gt;
|   |   subnet: 255.255.255.255&lt;br /&gt;
|   |   gateway: 255.255.255.255&lt;br /&gt;
|   |   gpsdo: none&lt;br /&gt;
|   |   serial: xxxxxx&lt;br /&gt;
|   |   FW Version: 12.4&lt;br /&gt;
|   |   FPGA Version: 11.1&lt;br /&gt;
|   |   &lt;br /&gt;
|   |   Time sources:  none, external, _external_, mimo&lt;br /&gt;
|   |   Clock sources: internal, external, mimo&lt;br /&gt;
|   |   Sensors: mimo_locked, ref_locked&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX DSP: 0&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   Freq range: -50.000 to 50.000 MHz&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX DSP: 1&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   Freq range: -50.000 to 50.000 MHz&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX Dboard: A&lt;br /&gt;
|   |   |   ID: WBX, WBX + Simple GDB (0x0053)&lt;br /&gt;
|   |   |   Serial: xxxxxx&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: WBXv2 RX+GDB&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, RX2, CAL&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 68.750 to 2200.000 MHz&lt;br /&gt;
|   |   |   |   Gain range PGA0: 0.0 to 31.5 step 0.5 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 40000000.0 to 40000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Codec: A&lt;br /&gt;
|   |   |   |   Name: ads62p44&lt;br /&gt;
|   |   |   |   Gain range digital: 0.0 to 6.0 step 0.5 dB&lt;br /&gt;
|   |   |   |   Gain range fine: 0.0 to 0.5 step 0.1 dB&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX DSP: 0&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   Freq range: -50.000 to 50.000 MHz&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX Dboard: A&lt;br /&gt;
|   |   |   ID: WBX (0x0052)&lt;br /&gt;
|   |   |   Serial: xxxxxx&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: WBXv2 TX+GDB&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, CAL&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 68.750 to 2200.000 MHz&lt;br /&gt;
|   |   |   |   Gain range PGA0: 0.0 to 25.0 step 0.1 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 40000000.0 to 40000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Codec: A&lt;br /&gt;
|   |   |   |   Name: ad9777&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Find UHD-supporting Software Radio Peripherals attached by USB, network or embedded configuration. Uses broadcast packets for discovery. Often blocked by routers, switches, firewalls.&lt;br /&gt;
    uhd_find_devices&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;uhd_find_devices&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ uhd_find_devices &lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
-- UHD Device 0&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
Device Address:&lt;br /&gt;
    type: usrp2&lt;br /&gt;
    addr: 192.168.10.2&lt;br /&gt;
    name: &lt;br /&gt;
    serial: xxxxxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*View firewall settings with:&lt;br /&gt;
    sudo iptables -L&lt;br /&gt;
&lt;br /&gt;
==UHD Programs==&lt;br /&gt;
The example programs included with the UHD driver will be located at: &lt;br /&gt;
    $install_prefix/lib/uhd/examples&lt;br /&gt;
&lt;br /&gt;
On Linux, the default installation prefix location is &amp;lt;code&amp;gt;/usr/local&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The example programs are located in the folder:&lt;br /&gt;
    /usr/local/lib/uhd/examples&lt;br /&gt;
&lt;br /&gt;
On OSX, the configuration is similar to Linux, however the default installation prefix location is &amp;lt;code&amp;gt;/opt/local&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The example programs will be located in the folder:&lt;br /&gt;
    /opt/local/lib/uhd/examples&lt;br /&gt;
&lt;br /&gt;
On Windows, the default installation prefix will be &amp;lt;code&amp;gt;C:\Program Files\UHD\&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The example programs will be located in the folder:&lt;br /&gt;
    C:\Program Files\UHD\lib\uhd\examples&lt;br /&gt;
&lt;br /&gt;
Before executing the following commands, change directory to the appropriate location.&lt;br /&gt;
&lt;br /&gt;
==Benchmarking your system==&lt;br /&gt;
*Benchmarks interface with device.&lt;br /&gt;
    ./benchmark_rate --rx_rate 10e6 --tx_rate 10e6&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;benmark_rate&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./benchmark_rate --rx_rate 10e6 --tx_rate 10e6&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting device timestamp to 0...&lt;br /&gt;
Testing receive rate 10.000000 Msps on 1 channels&lt;br /&gt;
Testing transmit rate 10.000000 Msps on 1 channels&lt;br /&gt;
&lt;br /&gt;
Benchmark rate summary:&lt;br /&gt;
  Num received samples:    100104043&lt;br /&gt;
  Num dropped samples:     0&lt;br /&gt;
  Num overflows detected:  0&lt;br /&gt;
  Num transmitted samples: 100229019&lt;br /&gt;
  Num sequence errors:     0&lt;br /&gt;
  Num underflows detected: 0&lt;br /&gt;
  Num late commands:       0&lt;br /&gt;
  Num timeouts:            0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Receiving Samples== &lt;br /&gt;
*Saves samples to file &lt;br /&gt;
    ./rx_samples_to_file --freq 98e6 --rate 5e6 --gain 20 --duration 10 usrp_samples.dat&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./rx_samples_to_file --freq 98e6 --rate 5e6 --gain 20 --duration 10 usrp_samples.dat&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting RX Rate: 5.000000 Msps...&lt;br /&gt;
Actual RX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting RX Freq: 98.000000 MHz...&lt;br /&gt;
Actual RX Freq: 98.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting RX Gain: 20.000000 dB...&lt;br /&gt;
Actual RX Gain: 20.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Waiting for &amp;quot;lo_locked&amp;quot;: ++++++++++ locked.&lt;br /&gt;
&lt;br /&gt;
Press Ctrl + C to stop streaming...&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of file size output from &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -al usrp_samples.dat &lt;br /&gt;
-rw-rw-r-- 1 user user 200040000 Sep  1 14:43 usrp_samples.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Transmitting Samples==&lt;br /&gt;
*Transmits samples from file&lt;br /&gt;
    ./tx_samples_from_file --freq 915e6 --rate 5e6 --gain 10 usrp_samples.dat&lt;br /&gt;
&lt;br /&gt;
Example of output from &amp;lt;code&amp;gt;tx_samples_from_file&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./tx_samples_from_file --freq 915e6 --rate 5e6 --gain 10 usrp_samples.dat&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting TX Rate: 5.000000 Msps...&lt;br /&gt;
Actual TX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting TX Freq: 915.000000 MHz...&lt;br /&gt;
Actual TX Freq: 915.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting TX Gain: 10.000000 dB...&lt;br /&gt;
Actual TX Gain: 10.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Checking TX: LO: locked ...&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Terminal DFT/FFT==&lt;br /&gt;
*Creates ASCII/Ncurses FFT&lt;br /&gt;
    ./rx_ascii_art_dft --freq 98e6 --rate 5e6 --gain 20 --bw 5e6 --ref-lvl -30&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;rx_ascii_art_dft&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./rx_ascii_art_dft --freq 98e6 --rate 5e6 --gain 20 --bw 5e6 --ref-lvl -30&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting RX Rate: 5.000000 Msps...&lt;br /&gt;
Actual RX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting RX Freq: 98.000000 MHz...&lt;br /&gt;
Actual RX Freq: 98.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting RX Gain: 20.000000 dB...&lt;br /&gt;
Actual RX Gain: 20.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Setting RX Bandwidth: 5.000000 MHz...&lt;br /&gt;
Actual RX Bandwidth: 5.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Checking RX: LO: locked ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example screenshot of &amp;lt;code&amp;gt;rx_ascii_art_dft&amp;lt;/code&amp;gt; running:&lt;br /&gt;
&lt;br /&gt;
[[File:rx ascii art dft.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Transmit test signal==&lt;br /&gt;
*Transmits specific waveform &lt;br /&gt;
    ./tx_waveforms --freq 915e6 --rate 5e6 --gain 0&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;tx_waveforms&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./tx_waveforms --freq 915e6 --rate 5e6 --gain 0 &lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting TX Rate: 5.000000 Msps...&lt;br /&gt;
Actual TX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting TX Freq: 915.000000 MHz...&lt;br /&gt;
Actual TX Freq: 915.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting TX Gain: 0.000000 dB...&lt;br /&gt;
Actual TX Gain: 0.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Setting device timestamp to 0...&lt;br /&gt;
Checking TX: LO: locked ...&lt;br /&gt;
Press Ctrl + C to stop streaming...&lt;br /&gt;
^C&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional UHD Utilities==&lt;br /&gt;
*Downloads FPGA images for current UHD version&lt;br /&gt;
    sudo uhd_images_downloader&lt;br /&gt;
&lt;br /&gt;
Example output from running &amp;lt;code&amp;gt;uhd_images_downloader&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ [sudo] uhd_images_downloader # Use sudo if installing into /usr or /usr/local on Linux systems&lt;br /&gt;
Images destination:      /usr/local/share/uhd/images&lt;br /&gt;
Downloading images from: http://files.ettus.com/binaries/images/uhd-images_003.010.000.000-release.zip&lt;br /&gt;
Downloading images to:   /tmp/tmpPYd_5J/uhd-images_003.010.000.000-release.zip&lt;br /&gt;
58959 kB / 58959 kB (100%)&lt;br /&gt;
&lt;br /&gt;
Images successfully installed to: /usr/local/share/uhd/images&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Flashes an image onto the X300/X310 FPGA&lt;br /&gt;
    usrp_x3xx_fpga_burner&lt;br /&gt;
&lt;br /&gt;
*Reading and writing motherboard EEPROM&lt;br /&gt;
    usrp_burn_mb_eeprom&lt;br /&gt;
&lt;br /&gt;
*Reading and writing daughterboard EEPROM&lt;br /&gt;
    usrp_burn_db_eeprom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Verifying_the_Operation_of_the_USRP_Using_UHD_and_GNU_Radio&amp;diff=4974</id>
		<title>Verifying the Operation of the USRP Using UHD and GNU Radio</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Verifying_the_Operation_of_the_USRP_Using_UHD_and_GNU_Radio&amp;diff=4974"/>
				<updated>2020-09-09T19:04:08Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* Receiving Samples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-936'''&lt;br /&gt;
&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-05-01   &lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Neel Pandeya&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This AN explains how to use UHD and GNU Radio, once installed, to verify the correct operation of the USRP. Several test procedures are explained in detail. Several tests make use of an optional spectrum analyzer and signal generator. &lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
This application note will cover testing your USRP to verify it is operational. You will need to have a working installation of UHD to preform the following steps to verify your USRP. If you do not have UHD installed, please reference the Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on [[Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on Linux|Linux]], [[Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on OS X|OS X]] and [[Building and Installing the USRP Open Source Toolchain (UHD and GNU Radio) on Windows|Windows]] Application Notes.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you may use the [[Live SDR Environment]] to perform the following steps. More information about the [[Live SDR Environment]] is available at the [[Live SDR Environment Getting Started Guides]] page.&lt;br /&gt;
&lt;br /&gt;
==Proper Care and Handling==&lt;br /&gt;
All Ettus Research products are individually tested before shipment. The USRP™ is guaranteed to be functional at the time it is received by the customer. Improper use or handling of the USRP™ can easily cause the device to become non-functional. Listed below are some examples of actions which can prevent damage to the unit:&lt;br /&gt;
&lt;br /&gt;
*Never allow metal objects to touch the circuit board while powered.&lt;br /&gt;
*Always properly terminate the transmit port with an antenna or 50Ω load.&lt;br /&gt;
*Always handle the board with proper anti-static methods.&lt;br /&gt;
*Never allow the board to directly or indirectly come into contact with any voltage spikes.&lt;br /&gt;
*Never allow any water, or condensing moisture, to come into contact with the boards.&lt;br /&gt;
*Always use caution with FPGA, firmware, or software modifications.&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |[[File:Caution.png|24px|center]]&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |Never apply more than -15 dBm of power into any RF input&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |[[File:Caution.png|24px|center]]&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |Always use at least 30dB attenuation if operating in loopback configuration&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Finding the Device==&lt;br /&gt;
*Report detailed information on UHD-supported Software Radio Peripherals attached by USB, network, or embedded configuration. Details  include unit names, revision numbers, and available sensors on all attached USRP motherboards and daughterboards.&lt;br /&gt;
    uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ uhd_usrp_probe &lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
  _____________________________________________________&lt;br /&gt;
 /&lt;br /&gt;
|       Device: USRP2 / N-Series Device&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       Mboard: N210r4&lt;br /&gt;
|   |   hardware: 2577&lt;br /&gt;
|   |   mac-addr: 00:00:00:00:00:00&lt;br /&gt;
|   |   ip-addr: 192.168.10.2&lt;br /&gt;
|   |   subnet: 255.255.255.255&lt;br /&gt;
|   |   gateway: 255.255.255.255&lt;br /&gt;
|   |   gpsdo: none&lt;br /&gt;
|   |   serial: xxxxxx&lt;br /&gt;
|   |   FW Version: 12.4&lt;br /&gt;
|   |   FPGA Version: 11.1&lt;br /&gt;
|   |   &lt;br /&gt;
|   |   Time sources:  none, external, _external_, mimo&lt;br /&gt;
|   |   Clock sources: internal, external, mimo&lt;br /&gt;
|   |   Sensors: mimo_locked, ref_locked&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX DSP: 0&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   Freq range: -50.000 to 50.000 MHz&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX DSP: 1&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   Freq range: -50.000 to 50.000 MHz&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX Dboard: A&lt;br /&gt;
|   |   |   ID: WBX, WBX + Simple GDB (0x0053)&lt;br /&gt;
|   |   |   Serial: xxxxxx&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: WBXv2 RX+GDB&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, RX2, CAL&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 68.750 to 2200.000 MHz&lt;br /&gt;
|   |   |   |   Gain range PGA0: 0.0 to 31.5 step 0.5 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 40000000.0 to 40000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Codec: A&lt;br /&gt;
|   |   |   |   Name: ads62p44&lt;br /&gt;
|   |   |   |   Gain range digital: 0.0 to 6.0 step 0.5 dB&lt;br /&gt;
|   |   |   |   Gain range fine: 0.0 to 0.5 step 0.1 dB&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX DSP: 0&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   Freq range: -50.000 to 50.000 MHz&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX Dboard: A&lt;br /&gt;
|   |   |   ID: WBX (0x0052)&lt;br /&gt;
|   |   |   Serial: xxxxxx&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: WBXv2 TX+GDB&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, CAL&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 68.750 to 2200.000 MHz&lt;br /&gt;
|   |   |   |   Gain range PGA0: 0.0 to 25.0 step 0.1 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 40000000.0 to 40000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Codec: A&lt;br /&gt;
|   |   |   |   Name: ad9777&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Find UHD-supporting Software Radio Peripherals attached by USB, network or embedded configuration. Uses broadcast packets for discovery. Often blocked by routers, switches, firewalls.&lt;br /&gt;
    uhd_find_devices&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;uhd_find_devices&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ uhd_find_devices &lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
-- UHD Device 0&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
Device Address:&lt;br /&gt;
    type: usrp2&lt;br /&gt;
    addr: 192.168.10.2&lt;br /&gt;
    name: &lt;br /&gt;
    serial: xxxxxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*View firewall settings with:&lt;br /&gt;
    sudo iptables -L&lt;br /&gt;
&lt;br /&gt;
==UHD Programs==&lt;br /&gt;
The example programs included with the UHD driver will be located at: &lt;br /&gt;
    $install_prefix/lib/uhd/examples&lt;br /&gt;
&lt;br /&gt;
On Linux, the default installation prefix location is &amp;lt;code&amp;gt;/usr/local&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The example programs are located in the folder:&lt;br /&gt;
    /usr/local/lib/uhd/examples&lt;br /&gt;
&lt;br /&gt;
On OSX, the configuration is similar to Linux, however the default installation prefix location is &amp;lt;code&amp;gt;/opt/local&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The example programs will be located in the folder:&lt;br /&gt;
    /opt/local/lib/uhd/examples&lt;br /&gt;
&lt;br /&gt;
On Windows, the default installation prefix will be &amp;lt;code&amp;gt;C:\Program Files\UHD\&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The example programs will be located in the folder:&lt;br /&gt;
    C:\Program Files\UHD\lib\uhd\examples&lt;br /&gt;
&lt;br /&gt;
==Benchmarking your system==&lt;br /&gt;
*Benchmarks interface with device.&lt;br /&gt;
    ./benchmark_rate --rx_rate 10e6 --tx_rate 10e6&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;benmark_rate&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./benchmark_rate --rx_rate 10e6 --tx_rate 10e6&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting device timestamp to 0...&lt;br /&gt;
Testing receive rate 10.000000 Msps on 1 channels&lt;br /&gt;
Testing transmit rate 10.000000 Msps on 1 channels&lt;br /&gt;
&lt;br /&gt;
Benchmark rate summary:&lt;br /&gt;
  Num received samples:    100104043&lt;br /&gt;
  Num dropped samples:     0&lt;br /&gt;
  Num overflows detected:  0&lt;br /&gt;
  Num transmitted samples: 100229019&lt;br /&gt;
  Num sequence errors:     0&lt;br /&gt;
  Num underflows detected: 0&lt;br /&gt;
  Num late commands:       0&lt;br /&gt;
  Num timeouts:            0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Receiving Samples== &lt;br /&gt;
*Saves samples to file &lt;br /&gt;
    ./rx_samples_to_file --freq 98e6 --rate 5e6 --gain 20 --duration 10 usrp_samples.dat&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./rx_samples_to_file --freq 98e6 --rate 5e6 --gain 20 --duration 10 usrp_samples.dat&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting RX Rate: 5.000000 Msps...&lt;br /&gt;
Actual RX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting RX Freq: 98.000000 MHz...&lt;br /&gt;
Actual RX Freq: 98.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting RX Gain: 20.000000 dB...&lt;br /&gt;
Actual RX Gain: 20.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Waiting for &amp;quot;lo_locked&amp;quot;: ++++++++++ locked.&lt;br /&gt;
&lt;br /&gt;
Press Ctrl + C to stop streaming...&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of file size output from &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -al usrp_samples.dat &lt;br /&gt;
-rw-rw-r-- 1 user user 200040000 Sep  1 14:43 usrp_samples.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Transmitting Samples==&lt;br /&gt;
*Transmits samples from file&lt;br /&gt;
    ./tx_samples_from_file --freq 915e6 --rate 5e6 --gain 10 usrp_samples.dat&lt;br /&gt;
&lt;br /&gt;
Example of output from &amp;lt;code&amp;gt;tx_samples_from_file&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./tx_samples_from_file --freq 915e6 --rate 5e6 --gain 10 usrp_samples.dat&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting TX Rate: 5.000000 Msps...&lt;br /&gt;
Actual TX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting TX Freq: 915.000000 MHz...&lt;br /&gt;
Actual TX Freq: 915.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting TX Gain: 10.000000 dB...&lt;br /&gt;
Actual TX Gain: 10.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Checking TX: LO: locked ...&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Terminal DFT/FFT==&lt;br /&gt;
*Creates ASCII/Ncurses FFT&lt;br /&gt;
    ./rx_ascii_art_dft --freq 98e6 --rate 5e6 --gain 20 --bw 5e6 --ref-lvl -30&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;rx_ascii_art_dft&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./rx_ascii_art_dft --freq 98e6 --rate 5e6 --gain 20 --bw 5e6 --ref-lvl -30&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting RX Rate: 5.000000 Msps...&lt;br /&gt;
Actual RX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting RX Freq: 98.000000 MHz...&lt;br /&gt;
Actual RX Freq: 98.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting RX Gain: 20.000000 dB...&lt;br /&gt;
Actual RX Gain: 20.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Setting RX Bandwidth: 5.000000 MHz...&lt;br /&gt;
Actual RX Bandwidth: 5.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Checking RX: LO: locked ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example screenshot of &amp;lt;code&amp;gt;rx_ascii_art_dft&amp;lt;/code&amp;gt; running:&lt;br /&gt;
&lt;br /&gt;
[[File:rx ascii art dft.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Transmit test signal==&lt;br /&gt;
*Transmits specific waveform &lt;br /&gt;
    ./tx_waveforms --freq 915e6 --rate 5e6 --gain 0&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;tx_waveforms&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./tx_waveforms --freq 915e6 --rate 5e6 --gain 0 &lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting TX Rate: 5.000000 Msps...&lt;br /&gt;
Actual TX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting TX Freq: 915.000000 MHz...&lt;br /&gt;
Actual TX Freq: 915.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting TX Gain: 0.000000 dB...&lt;br /&gt;
Actual TX Gain: 0.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Setting device timestamp to 0...&lt;br /&gt;
Checking TX: LO: locked ...&lt;br /&gt;
Press Ctrl + C to stop streaming...&lt;br /&gt;
^C&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional UHD Utilities==&lt;br /&gt;
*Downloads FPGA images for current UHD version&lt;br /&gt;
    sudo uhd_images_downloader&lt;br /&gt;
&lt;br /&gt;
Example output from running &amp;lt;code&amp;gt;uhd_images_downloader&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ [sudo] uhd_images_downloader # Use sudo if installing into /usr or /usr/local on Linux systems&lt;br /&gt;
Images destination:      /usr/local/share/uhd/images&lt;br /&gt;
Downloading images from: http://files.ettus.com/binaries/images/uhd-images_003.010.000.000-release.zip&lt;br /&gt;
Downloading images to:   /tmp/tmpPYd_5J/uhd-images_003.010.000.000-release.zip&lt;br /&gt;
58959 kB / 58959 kB (100%)&lt;br /&gt;
&lt;br /&gt;
Images successfully installed to: /usr/local/share/uhd/images&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Flashes an image onto the X300/X310 FPGA&lt;br /&gt;
    usrp_x3xx_fpga_burner&lt;br /&gt;
&lt;br /&gt;
*Reading and writing motherboard EEPROM&lt;br /&gt;
    usrp_burn_mb_eeprom&lt;br /&gt;
&lt;br /&gt;
*Reading and writing daughterboard EEPROM&lt;br /&gt;
    usrp_burn_db_eeprom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Verifying_the_Operation_of_the_USRP_Using_UHD_and_GNU_Radio&amp;diff=4973</id>
		<title>Verifying the Operation of the USRP Using UHD and GNU Radio</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Verifying_the_Operation_of_the_USRP_Using_UHD_and_GNU_Radio&amp;diff=4973"/>
				<updated>2020-09-09T19:03:55Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* Transmitting Samples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-936'''&lt;br /&gt;
&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-05-01   &lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Neel Pandeya&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This AN explains how to use UHD and GNU Radio, once installed, to verify the correct operation of the USRP. Several test procedures are explained in detail. Several tests make use of an optional spectrum analyzer and signal generator. &lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
This application note will cover testing your USRP to verify it is operational. You will need to have a working installation of UHD to preform the following steps to verify your USRP. If you do not have UHD installed, please reference the Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on [[Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on Linux|Linux]], [[Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on OS X|OS X]] and [[Building and Installing the USRP Open Source Toolchain (UHD and GNU Radio) on Windows|Windows]] Application Notes.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you may use the [[Live SDR Environment]] to perform the following steps. More information about the [[Live SDR Environment]] is available at the [[Live SDR Environment Getting Started Guides]] page.&lt;br /&gt;
&lt;br /&gt;
==Proper Care and Handling==&lt;br /&gt;
All Ettus Research products are individually tested before shipment. The USRP™ is guaranteed to be functional at the time it is received by the customer. Improper use or handling of the USRP™ can easily cause the device to become non-functional. Listed below are some examples of actions which can prevent damage to the unit:&lt;br /&gt;
&lt;br /&gt;
*Never allow metal objects to touch the circuit board while powered.&lt;br /&gt;
*Always properly terminate the transmit port with an antenna or 50Ω load.&lt;br /&gt;
*Always handle the board with proper anti-static methods.&lt;br /&gt;
*Never allow the board to directly or indirectly come into contact with any voltage spikes.&lt;br /&gt;
*Never allow any water, or condensing moisture, to come into contact with the boards.&lt;br /&gt;
*Always use caution with FPGA, firmware, or software modifications.&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |[[File:Caution.png|24px|center]]&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |Never apply more than -15 dBm of power into any RF input&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |[[File:Caution.png|24px|center]]&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |Always use at least 30dB attenuation if operating in loopback configuration&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Finding the Device==&lt;br /&gt;
*Report detailed information on UHD-supported Software Radio Peripherals attached by USB, network, or embedded configuration. Details  include unit names, revision numbers, and available sensors on all attached USRP motherboards and daughterboards.&lt;br /&gt;
    uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ uhd_usrp_probe &lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
  _____________________________________________________&lt;br /&gt;
 /&lt;br /&gt;
|       Device: USRP2 / N-Series Device&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       Mboard: N210r4&lt;br /&gt;
|   |   hardware: 2577&lt;br /&gt;
|   |   mac-addr: 00:00:00:00:00:00&lt;br /&gt;
|   |   ip-addr: 192.168.10.2&lt;br /&gt;
|   |   subnet: 255.255.255.255&lt;br /&gt;
|   |   gateway: 255.255.255.255&lt;br /&gt;
|   |   gpsdo: none&lt;br /&gt;
|   |   serial: xxxxxx&lt;br /&gt;
|   |   FW Version: 12.4&lt;br /&gt;
|   |   FPGA Version: 11.1&lt;br /&gt;
|   |   &lt;br /&gt;
|   |   Time sources:  none, external, _external_, mimo&lt;br /&gt;
|   |   Clock sources: internal, external, mimo&lt;br /&gt;
|   |   Sensors: mimo_locked, ref_locked&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX DSP: 0&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   Freq range: -50.000 to 50.000 MHz&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX DSP: 1&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   Freq range: -50.000 to 50.000 MHz&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX Dboard: A&lt;br /&gt;
|   |   |   ID: WBX, WBX + Simple GDB (0x0053)&lt;br /&gt;
|   |   |   Serial: xxxxxx&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: WBXv2 RX+GDB&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, RX2, CAL&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 68.750 to 2200.000 MHz&lt;br /&gt;
|   |   |   |   Gain range PGA0: 0.0 to 31.5 step 0.5 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 40000000.0 to 40000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Codec: A&lt;br /&gt;
|   |   |   |   Name: ads62p44&lt;br /&gt;
|   |   |   |   Gain range digital: 0.0 to 6.0 step 0.5 dB&lt;br /&gt;
|   |   |   |   Gain range fine: 0.0 to 0.5 step 0.1 dB&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX DSP: 0&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   Freq range: -50.000 to 50.000 MHz&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX Dboard: A&lt;br /&gt;
|   |   |   ID: WBX (0x0052)&lt;br /&gt;
|   |   |   Serial: xxxxxx&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: WBXv2 TX+GDB&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, CAL&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 68.750 to 2200.000 MHz&lt;br /&gt;
|   |   |   |   Gain range PGA0: 0.0 to 25.0 step 0.1 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 40000000.0 to 40000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Codec: A&lt;br /&gt;
|   |   |   |   Name: ad9777&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Find UHD-supporting Software Radio Peripherals attached by USB, network or embedded configuration. Uses broadcast packets for discovery. Often blocked by routers, switches, firewalls.&lt;br /&gt;
    uhd_find_devices&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;uhd_find_devices&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ uhd_find_devices &lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
-- UHD Device 0&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
Device Address:&lt;br /&gt;
    type: usrp2&lt;br /&gt;
    addr: 192.168.10.2&lt;br /&gt;
    name: &lt;br /&gt;
    serial: xxxxxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*View firewall settings with:&lt;br /&gt;
    sudo iptables -L&lt;br /&gt;
&lt;br /&gt;
==UHD Programs==&lt;br /&gt;
The example programs included with the UHD driver will be located at: &lt;br /&gt;
    $install_prefix/lib/uhd/examples&lt;br /&gt;
&lt;br /&gt;
On Linux, the default installation prefix location is &amp;lt;code&amp;gt;/usr/local&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The example programs are located in the folder:&lt;br /&gt;
    /usr/local/lib/uhd/examples&lt;br /&gt;
&lt;br /&gt;
On OSX, the configuration is similar to Linux, however the default installation prefix location is &amp;lt;code&amp;gt;/opt/local&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The example programs will be located in the folder:&lt;br /&gt;
    /opt/local/lib/uhd/examples&lt;br /&gt;
&lt;br /&gt;
On Windows, the default installation prefix will be &amp;lt;code&amp;gt;C:\Program Files\UHD\&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The example programs will be located in the folder:&lt;br /&gt;
    C:\Program Files\UHD\lib\uhd\examples&lt;br /&gt;
&lt;br /&gt;
==Benchmarking your system==&lt;br /&gt;
*Benchmarks interface with device.&lt;br /&gt;
    ./benchmark_rate --rx_rate 10e6 --tx_rate 10e6&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;benmark_rate&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./benchmark_rate --rx_rate 10e6 --tx_rate 10e6&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting device timestamp to 0...&lt;br /&gt;
Testing receive rate 10.000000 Msps on 1 channels&lt;br /&gt;
Testing transmit rate 10.000000 Msps on 1 channels&lt;br /&gt;
&lt;br /&gt;
Benchmark rate summary:&lt;br /&gt;
  Num received samples:    100104043&lt;br /&gt;
  Num dropped samples:     0&lt;br /&gt;
  Num overflows detected:  0&lt;br /&gt;
  Num transmitted samples: 100229019&lt;br /&gt;
  Num sequence errors:     0&lt;br /&gt;
  Num underflows detected: 0&lt;br /&gt;
  Num late commands:       0&lt;br /&gt;
  Num timeouts:            0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Receiving Samples== &lt;br /&gt;
*Saves samples to file &lt;br /&gt;
    ./rx_samples_to_file --freq 98e6 --rate 5e6 --gain 20 --duration 10 usrp_samples.dat&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /usr/local/lib/uhd/examples/rx_samples_to_file --freq 98e6 --rate 5e6 --gain 20 --duration 10 usrp_samples.dat&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting RX Rate: 5.000000 Msps...&lt;br /&gt;
Actual RX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting RX Freq: 98.000000 MHz...&lt;br /&gt;
Actual RX Freq: 98.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting RX Gain: 20.000000 dB...&lt;br /&gt;
Actual RX Gain: 20.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Waiting for &amp;quot;lo_locked&amp;quot;: ++++++++++ locked.&lt;br /&gt;
&lt;br /&gt;
Press Ctrl + C to stop streaming...&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of file size output from &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -al usrp_samples.dat &lt;br /&gt;
-rw-rw-r-- 1 user user 200040000 Sep  1 14:43 usrp_samples.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Transmitting Samples==&lt;br /&gt;
*Transmits samples from file&lt;br /&gt;
    ./tx_samples_from_file --freq 915e6 --rate 5e6 --gain 10 usrp_samples.dat&lt;br /&gt;
&lt;br /&gt;
Example of output from &amp;lt;code&amp;gt;tx_samples_from_file&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./tx_samples_from_file --freq 915e6 --rate 5e6 --gain 10 usrp_samples.dat&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting TX Rate: 5.000000 Msps...&lt;br /&gt;
Actual TX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting TX Freq: 915.000000 MHz...&lt;br /&gt;
Actual TX Freq: 915.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting TX Gain: 10.000000 dB...&lt;br /&gt;
Actual TX Gain: 10.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Checking TX: LO: locked ...&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Terminal DFT/FFT==&lt;br /&gt;
*Creates ASCII/Ncurses FFT&lt;br /&gt;
    ./rx_ascii_art_dft --freq 98e6 --rate 5e6 --gain 20 --bw 5e6 --ref-lvl -30&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;rx_ascii_art_dft&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./rx_ascii_art_dft --freq 98e6 --rate 5e6 --gain 20 --bw 5e6 --ref-lvl -30&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting RX Rate: 5.000000 Msps...&lt;br /&gt;
Actual RX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting RX Freq: 98.000000 MHz...&lt;br /&gt;
Actual RX Freq: 98.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting RX Gain: 20.000000 dB...&lt;br /&gt;
Actual RX Gain: 20.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Setting RX Bandwidth: 5.000000 MHz...&lt;br /&gt;
Actual RX Bandwidth: 5.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Checking RX: LO: locked ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example screenshot of &amp;lt;code&amp;gt;rx_ascii_art_dft&amp;lt;/code&amp;gt; running:&lt;br /&gt;
&lt;br /&gt;
[[File:rx ascii art dft.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Transmit test signal==&lt;br /&gt;
*Transmits specific waveform &lt;br /&gt;
    ./tx_waveforms --freq 915e6 --rate 5e6 --gain 0&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;tx_waveforms&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./tx_waveforms --freq 915e6 --rate 5e6 --gain 0 &lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting TX Rate: 5.000000 Msps...&lt;br /&gt;
Actual TX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting TX Freq: 915.000000 MHz...&lt;br /&gt;
Actual TX Freq: 915.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting TX Gain: 0.000000 dB...&lt;br /&gt;
Actual TX Gain: 0.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Setting device timestamp to 0...&lt;br /&gt;
Checking TX: LO: locked ...&lt;br /&gt;
Press Ctrl + C to stop streaming...&lt;br /&gt;
^C&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional UHD Utilities==&lt;br /&gt;
*Downloads FPGA images for current UHD version&lt;br /&gt;
    sudo uhd_images_downloader&lt;br /&gt;
&lt;br /&gt;
Example output from running &amp;lt;code&amp;gt;uhd_images_downloader&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ [sudo] uhd_images_downloader # Use sudo if installing into /usr or /usr/local on Linux systems&lt;br /&gt;
Images destination:      /usr/local/share/uhd/images&lt;br /&gt;
Downloading images from: http://files.ettus.com/binaries/images/uhd-images_003.010.000.000-release.zip&lt;br /&gt;
Downloading images to:   /tmp/tmpPYd_5J/uhd-images_003.010.000.000-release.zip&lt;br /&gt;
58959 kB / 58959 kB (100%)&lt;br /&gt;
&lt;br /&gt;
Images successfully installed to: /usr/local/share/uhd/images&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Flashes an image onto the X300/X310 FPGA&lt;br /&gt;
    usrp_x3xx_fpga_burner&lt;br /&gt;
&lt;br /&gt;
*Reading and writing motherboard EEPROM&lt;br /&gt;
    usrp_burn_mb_eeprom&lt;br /&gt;
&lt;br /&gt;
*Reading and writing daughterboard EEPROM&lt;br /&gt;
    usrp_burn_db_eeprom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Verifying_the_Operation_of_the_USRP_Using_UHD_and_GNU_Radio&amp;diff=4972</id>
		<title>Verifying the Operation of the USRP Using UHD and GNU Radio</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Verifying_the_Operation_of_the_USRP_Using_UHD_and_GNU_Radio&amp;diff=4972"/>
				<updated>2020-09-09T19:03:25Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* Additional UHD Utilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-936'''&lt;br /&gt;
&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-05-01   &lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Neel Pandeya&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This AN explains how to use UHD and GNU Radio, once installed, to verify the correct operation of the USRP. Several test procedures are explained in detail. Several tests make use of an optional spectrum analyzer and signal generator. &lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
This application note will cover testing your USRP to verify it is operational. You will need to have a working installation of UHD to preform the following steps to verify your USRP. If you do not have UHD installed, please reference the Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on [[Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on Linux|Linux]], [[Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on OS X|OS X]] and [[Building and Installing the USRP Open Source Toolchain (UHD and GNU Radio) on Windows|Windows]] Application Notes.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you may use the [[Live SDR Environment]] to perform the following steps. More information about the [[Live SDR Environment]] is available at the [[Live SDR Environment Getting Started Guides]] page.&lt;br /&gt;
&lt;br /&gt;
==Proper Care and Handling==&lt;br /&gt;
All Ettus Research products are individually tested before shipment. The USRP™ is guaranteed to be functional at the time it is received by the customer. Improper use or handling of the USRP™ can easily cause the device to become non-functional. Listed below are some examples of actions which can prevent damage to the unit:&lt;br /&gt;
&lt;br /&gt;
*Never allow metal objects to touch the circuit board while powered.&lt;br /&gt;
*Always properly terminate the transmit port with an antenna or 50Ω load.&lt;br /&gt;
*Always handle the board with proper anti-static methods.&lt;br /&gt;
*Never allow the board to directly or indirectly come into contact with any voltage spikes.&lt;br /&gt;
*Never allow any water, or condensing moisture, to come into contact with the boards.&lt;br /&gt;
*Always use caution with FPGA, firmware, or software modifications.&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |[[File:Caution.png|24px|center]]&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |Never apply more than -15 dBm of power into any RF input&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |[[File:Caution.png|24px|center]]&lt;br /&gt;
|style=&amp;quot;padding-left:10px; padding-right:10px; padding-bottom:10px;&amp;quot; |Always use at least 30dB attenuation if operating in loopback configuration&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Finding the Device==&lt;br /&gt;
*Report detailed information on UHD-supported Software Radio Peripherals attached by USB, network, or embedded configuration. Details  include unit names, revision numbers, and available sensors on all attached USRP motherboards and daughterboards.&lt;br /&gt;
    uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ uhd_usrp_probe &lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
  _____________________________________________________&lt;br /&gt;
 /&lt;br /&gt;
|       Device: USRP2 / N-Series Device&lt;br /&gt;
|     _____________________________________________________&lt;br /&gt;
|    /&lt;br /&gt;
|   |       Mboard: N210r4&lt;br /&gt;
|   |   hardware: 2577&lt;br /&gt;
|   |   mac-addr: 00:00:00:00:00:00&lt;br /&gt;
|   |   ip-addr: 192.168.10.2&lt;br /&gt;
|   |   subnet: 255.255.255.255&lt;br /&gt;
|   |   gateway: 255.255.255.255&lt;br /&gt;
|   |   gpsdo: none&lt;br /&gt;
|   |   serial: xxxxxx&lt;br /&gt;
|   |   FW Version: 12.4&lt;br /&gt;
|   |   FPGA Version: 11.1&lt;br /&gt;
|   |   &lt;br /&gt;
|   |   Time sources:  none, external, _external_, mimo&lt;br /&gt;
|   |   Clock sources: internal, external, mimo&lt;br /&gt;
|   |   Sensors: mimo_locked, ref_locked&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX DSP: 0&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   Freq range: -50.000 to 50.000 MHz&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX DSP: 1&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   Freq range: -50.000 to 50.000 MHz&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       RX Dboard: A&lt;br /&gt;
|   |   |   ID: WBX, WBX + Simple GDB (0x0053)&lt;br /&gt;
|   |   |   Serial: xxxxxx&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: WBXv2 RX+GDB&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, RX2, CAL&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 68.750 to 2200.000 MHz&lt;br /&gt;
|   |   |   |   Gain range PGA0: 0.0 to 31.5 step 0.5 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 40000000.0 to 40000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       RX Codec: A&lt;br /&gt;
|   |   |   |   Name: ads62p44&lt;br /&gt;
|   |   |   |   Gain range digital: 0.0 to 6.0 step 0.5 dB&lt;br /&gt;
|   |   |   |   Gain range fine: 0.0 to 0.5 step 0.1 dB&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX DSP: 0&lt;br /&gt;
|   |   |   &lt;br /&gt;
|   |   |   Freq range: -50.000 to 50.000 MHz&lt;br /&gt;
|   |     _____________________________________________________&lt;br /&gt;
|   |    /&lt;br /&gt;
|   |   |       TX Dboard: A&lt;br /&gt;
|   |   |   ID: WBX (0x0052)&lt;br /&gt;
|   |   |   Serial: xxxxxx&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Frontend: 0&lt;br /&gt;
|   |   |   |   Name: WBXv2 TX+GDB&lt;br /&gt;
|   |   |   |   Antennas: TX/RX, CAL&lt;br /&gt;
|   |   |   |   Sensors: lo_locked&lt;br /&gt;
|   |   |   |   Freq range: 68.750 to 2200.000 MHz&lt;br /&gt;
|   |   |   |   Gain range PGA0: 0.0 to 25.0 step 0.1 dB&lt;br /&gt;
|   |   |   |   Bandwidth range: 40000000.0 to 40000000.0 step 0.0 Hz&lt;br /&gt;
|   |   |   |   Connection Type: IQ&lt;br /&gt;
|   |   |   |   Uses LO offset: No&lt;br /&gt;
|   |   |     _____________________________________________________&lt;br /&gt;
|   |   |    /&lt;br /&gt;
|   |   |   |       TX Codec: A&lt;br /&gt;
|   |   |   |   Name: ad9777&lt;br /&gt;
|   |   |   |   Gain Elements: None&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Find UHD-supporting Software Radio Peripherals attached by USB, network or embedded configuration. Uses broadcast packets for discovery. Often blocked by routers, switches, firewalls.&lt;br /&gt;
    uhd_find_devices&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;uhd_find_devices&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ uhd_find_devices &lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
-- UHD Device 0&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
Device Address:&lt;br /&gt;
    type: usrp2&lt;br /&gt;
    addr: 192.168.10.2&lt;br /&gt;
    name: &lt;br /&gt;
    serial: xxxxxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*View firewall settings with:&lt;br /&gt;
    sudo iptables -L&lt;br /&gt;
&lt;br /&gt;
==UHD Programs==&lt;br /&gt;
The example programs included with the UHD driver will be located at: &lt;br /&gt;
    $install_prefix/lib/uhd/examples&lt;br /&gt;
&lt;br /&gt;
On Linux, the default installation prefix location is &amp;lt;code&amp;gt;/usr/local&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The example programs are located in the folder:&lt;br /&gt;
    /usr/local/lib/uhd/examples&lt;br /&gt;
&lt;br /&gt;
On OSX, the configuration is similar to Linux, however the default installation prefix location is &amp;lt;code&amp;gt;/opt/local&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The example programs will be located in the folder:&lt;br /&gt;
    /opt/local/lib/uhd/examples&lt;br /&gt;
&lt;br /&gt;
On Windows, the default installation prefix will be &amp;lt;code&amp;gt;C:\Program Files\UHD\&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The example programs will be located in the folder:&lt;br /&gt;
    C:\Program Files\UHD\lib\uhd\examples&lt;br /&gt;
&lt;br /&gt;
==Benchmarking your system==&lt;br /&gt;
*Benchmarks interface with device.&lt;br /&gt;
    ./benchmark_rate --rx_rate 10e6 --tx_rate 10e6&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;benmark_rate&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./benchmark_rate --rx_rate 10e6 --tx_rate 10e6&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting device timestamp to 0...&lt;br /&gt;
Testing receive rate 10.000000 Msps on 1 channels&lt;br /&gt;
Testing transmit rate 10.000000 Msps on 1 channels&lt;br /&gt;
&lt;br /&gt;
Benchmark rate summary:&lt;br /&gt;
  Num received samples:    100104043&lt;br /&gt;
  Num dropped samples:     0&lt;br /&gt;
  Num overflows detected:  0&lt;br /&gt;
  Num transmitted samples: 100229019&lt;br /&gt;
  Num sequence errors:     0&lt;br /&gt;
  Num underflows detected: 0&lt;br /&gt;
  Num late commands:       0&lt;br /&gt;
  Num timeouts:            0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Receiving Samples== &lt;br /&gt;
*Saves samples to file &lt;br /&gt;
    ./rx_samples_to_file --freq 98e6 --rate 5e6 --gain 20 --duration 10 usrp_samples.dat&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /usr/local/lib/uhd/examples/rx_samples_to_file --freq 98e6 --rate 5e6 --gain 20 --duration 10 usrp_samples.dat&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting RX Rate: 5.000000 Msps...&lt;br /&gt;
Actual RX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting RX Freq: 98.000000 MHz...&lt;br /&gt;
Actual RX Freq: 98.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting RX Gain: 20.000000 dB...&lt;br /&gt;
Actual RX Gain: 20.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Waiting for &amp;quot;lo_locked&amp;quot;: ++++++++++ locked.&lt;br /&gt;
&lt;br /&gt;
Press Ctrl + C to stop streaming...&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of file size output from &amp;lt;code&amp;gt;rx_samples_to_file&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -al usrp_samples.dat &lt;br /&gt;
-rw-rw-r-- 1 user user 200040000 Sep  1 14:43 usrp_samples.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Transmitting Samples==&lt;br /&gt;
*Transmits samples from file&lt;br /&gt;
    ./tx_samples_from_file --freq 915e6 --rate 5e6 --gain 10 usrp_samples.dat&lt;br /&gt;
&lt;br /&gt;
Example of output from &amp;lt;code&amp;gt;tx_samples_from_file&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /usr/local/lib/uhd/examples/tx_samples_from_file --freq 915e6 --rate 5e6 --gain 10 usrp_samples.dat&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting TX Rate: 5.000000 Msps...&lt;br /&gt;
Actual TX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting TX Freq: 915.000000 MHz...&lt;br /&gt;
Actual TX Freq: 915.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting TX Gain: 10.000000 dB...&lt;br /&gt;
Actual TX Gain: 10.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Checking TX: LO: locked ...&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Terminal DFT/FFT==&lt;br /&gt;
*Creates ASCII/Ncurses FFT&lt;br /&gt;
    ./rx_ascii_art_dft --freq 98e6 --rate 5e6 --gain 20 --bw 5e6 --ref-lvl -30&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;rx_ascii_art_dft&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./rx_ascii_art_dft --freq 98e6 --rate 5e6 --gain 20 --bw 5e6 --ref-lvl -30&lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting RX Rate: 5.000000 Msps...&lt;br /&gt;
Actual RX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting RX Freq: 98.000000 MHz...&lt;br /&gt;
Actual RX Freq: 98.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting RX Gain: 20.000000 dB...&lt;br /&gt;
Actual RX Gain: 20.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Setting RX Bandwidth: 5.000000 MHz...&lt;br /&gt;
Actual RX Bandwidth: 5.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Checking RX: LO: locked ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example screenshot of &amp;lt;code&amp;gt;rx_ascii_art_dft&amp;lt;/code&amp;gt; running:&lt;br /&gt;
&lt;br /&gt;
[[File:rx ascii art dft.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Transmit test signal==&lt;br /&gt;
*Transmits specific waveform &lt;br /&gt;
    ./tx_waveforms --freq 915e6 --rate 5e6 --gain 0&lt;br /&gt;
&lt;br /&gt;
Example output from &amp;lt;code&amp;gt;tx_waveforms&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./tx_waveforms --freq 915e6 --rate 5e6 --gain 0 &lt;br /&gt;
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.HEAD-0-g6e1ac3fc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating the usrp device with: ...&lt;br /&gt;
-- Opening a USRP2/N-Series device...&lt;br /&gt;
-- Current recv frame size: 1472 bytes&lt;br /&gt;
-- Current send frame size: 1472 bytes&lt;br /&gt;
Using Device: Single USRP:&lt;br /&gt;
  Device: USRP2 / N-Series Device&lt;br /&gt;
  Mboard 0: N210r4&lt;br /&gt;
  RX Channel: 0&lt;br /&gt;
    RX DSP: 0&lt;br /&gt;
    RX Dboard: A&lt;br /&gt;
    RX Subdev: WBXv2 RX+GDB&lt;br /&gt;
  TX Channel: 0&lt;br /&gt;
    TX DSP: 0&lt;br /&gt;
    TX Dboard: A&lt;br /&gt;
    TX Subdev: WBXv2 TX+GDB&lt;br /&gt;
&lt;br /&gt;
Setting TX Rate: 5.000000 Msps...&lt;br /&gt;
Actual TX Rate: 5.000000 Msps...&lt;br /&gt;
&lt;br /&gt;
Setting TX Freq: 915.000000 MHz...&lt;br /&gt;
Actual TX Freq: 915.000000 MHz...&lt;br /&gt;
&lt;br /&gt;
Setting TX Gain: 0.000000 dB...&lt;br /&gt;
Actual TX Gain: 0.000000 dB...&lt;br /&gt;
&lt;br /&gt;
Setting device timestamp to 0...&lt;br /&gt;
Checking TX: LO: locked ...&lt;br /&gt;
Press Ctrl + C to stop streaming...&lt;br /&gt;
^C&lt;br /&gt;
Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional UHD Utilities==&lt;br /&gt;
*Downloads FPGA images for current UHD version&lt;br /&gt;
    sudo uhd_images_downloader&lt;br /&gt;
&lt;br /&gt;
Example output from running &amp;lt;code&amp;gt;uhd_images_downloader&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ [sudo] uhd_images_downloader # Use sudo if installing into /usr or /usr/local on Linux systems&lt;br /&gt;
Images destination:      /usr/local/share/uhd/images&lt;br /&gt;
Downloading images from: http://files.ettus.com/binaries/images/uhd-images_003.010.000.000-release.zip&lt;br /&gt;
Downloading images to:   /tmp/tmpPYd_5J/uhd-images_003.010.000.000-release.zip&lt;br /&gt;
58959 kB / 58959 kB (100%)&lt;br /&gt;
&lt;br /&gt;
Images successfully installed to: /usr/local/share/uhd/images&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Flashes an image onto the X300/X310 FPGA&lt;br /&gt;
    usrp_x3xx_fpga_burner&lt;br /&gt;
&lt;br /&gt;
*Reading and writing motherboard EEPROM&lt;br /&gt;
    usrp_burn_mb_eeprom&lt;br /&gt;
&lt;br /&gt;
*Reading and writing daughterboard EEPROM&lt;br /&gt;
    usrp_burn_db_eeprom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=UHD_Python_API&amp;diff=3796</id>
		<title>UHD Python API</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=UHD_Python_API&amp;diff=3796"/>
				<updated>2018-06-21T01:13:14Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: Merge to master&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What's the UHD Python API? ==&lt;br /&gt;
&lt;br /&gt;
As the name suggests, it exposes the UHD API into Python. We use &amp;lt;code&amp;gt;Boost.Python&amp;lt;/code&amp;gt;&lt;br /&gt;
to generate a Python module which exposes most of the C++ API, and some extra&lt;br /&gt;
features. The Python API is currently part of master branch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pre-release announcement covers most of the information and can be found here: http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2017-June/025379.html&lt;br /&gt;
&lt;br /&gt;
We'll be doing some more development on this branch before we're merging it, but most importantly, we'd like to get some feedback from the greater community.&lt;br /&gt;
&lt;br /&gt;
The biggest thing missing is more documentation, but it already includes some examples. It's definitely ready for testing!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I use it? ==&lt;br /&gt;
&lt;br /&gt;
In order to test the Python API, check out the &amp;lt;code&amp;gt;master&amp;lt;/code&amp;gt; branch and build it like always. When running CMake, make sure that the Python API was enabled (&amp;lt;code&amp;gt;-DENABLE_PYTHON_API=ON&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The output from CMake should look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- ######################################################&lt;br /&gt;
-- # UHD enabled components                              &lt;br /&gt;
-- ######################################################&lt;br /&gt;
--   * LibUHD&lt;br /&gt;
--   * LibUHD - C API&lt;br /&gt;
--   * LibUHD - Python API&lt;br /&gt;
--   * Examples&lt;br /&gt;
--   * Utils&lt;br /&gt;
--   * Tests&lt;br /&gt;
--   * USB&lt;br /&gt;
--   * B100&lt;br /&gt;
--   * B200&lt;br /&gt;
--   * USRP1&lt;br /&gt;
--   * USRP2&lt;br /&gt;
--   * X300&lt;br /&gt;
--   * N230&lt;br /&gt;
--   * OctoClock&lt;br /&gt;
--   * Manual&lt;br /&gt;
--   * API/Doxygen&lt;br /&gt;
--   * Man Pages&lt;br /&gt;
-- &lt;br /&gt;
-- ######################################################&lt;br /&gt;
-- # UHD disabled components                             &lt;br /&gt;
-- ######################################################&lt;br /&gt;
--   * GPSD&lt;br /&gt;
--   * E100&lt;br /&gt;
--   * E300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it's built and installed, you'll be able to import the &amp;lt;code&amp;gt;uhd&amp;lt;/code&amp;gt; Python&lt;br /&gt;
module:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import uhd&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; my_usrp = uhd.usrp.MultiUSRP(&amp;quot;type=b200&amp;quot;)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; my_usrp.set_rx_gain(70)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have some examples in &amp;lt;code&amp;gt;[https://github.com/EttusResearch/uhd/tree/master/host/examples/python host/examples/python]&amp;lt;/code&amp;gt;. The examples are very&lt;br /&gt;
simple, but concise.&lt;br /&gt;
&lt;br /&gt;
==Example: pyuhd_rx_to_file.py==&lt;br /&gt;
This Python example is based on the C++ example &amp;lt;code&amp;gt;uhd/host/examples/rx_samples_to_file.cpp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import uhd&lt;br /&gt;
import numpy as np&lt;br /&gt;
import argparse&lt;br /&gt;
&lt;br /&gt;
def parse_args():&lt;br /&gt;
    parser = argparse.ArgumentParser()&lt;br /&gt;
    parser.add_argument(&amp;quot;-a&amp;quot;, &amp;quot;--args&amp;quot;, default=&amp;quot;&amp;quot;, type=str)&lt;br /&gt;
    parser.add_argument(&amp;quot;-o&amp;quot;, &amp;quot;--output-file&amp;quot;, type=str, required=True)&lt;br /&gt;
    parser.add_argument(&amp;quot;-f&amp;quot;, &amp;quot;--freq&amp;quot;, type=float, required=True)&lt;br /&gt;
    parser.add_argument(&amp;quot;-r&amp;quot;, &amp;quot;--rate&amp;quot;, default=1e6, type=float)&lt;br /&gt;
    parser.add_argument(&amp;quot;-d&amp;quot;, &amp;quot;--duration&amp;quot;, default=5.0, type=float)&lt;br /&gt;
    parser.add_argument(&amp;quot;-c&amp;quot;, &amp;quot;--channels&amp;quot;, default=0, nargs=&amp;quot;+&amp;quot;, type=int)&lt;br /&gt;
    parser.add_argument(&amp;quot;-g&amp;quot;, &amp;quot;--gain&amp;quot;, type=int, default=10)&lt;br /&gt;
    return parser.parse_args()&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
    args = parse_args()&lt;br /&gt;
    usrp = uhd.usrp.MultiUSRP(args.args)&lt;br /&gt;
    num_samps = int(np.ceil(args.duration*args.rate))&lt;br /&gt;
    if not isinstance(args.channels, list):&lt;br /&gt;
        args.channels = [args.channels]&lt;br /&gt;
    samps = usrp.recv_num_samps(num_samps, args.freq, args.rate, args.channels, args.gain)&lt;br /&gt;
    with open(args.output_file, 'wb') as f:&lt;br /&gt;
        np.save(f, samps, allow_pickle=False, fix_imports=False)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What about documentation? ==&lt;br /&gt;
&lt;br /&gt;
Documentation is currently pretty sparse. The best we can do right now is to ask&lt;br /&gt;
users to infer the documentation from the C++ API. For example, the Python has&lt;br /&gt;
an object called &amp;lt;code&amp;gt;MultiUSRP&amp;lt;/code&amp;gt; which is an equivalent of the C++ &amp;lt;code&amp;gt;multi_usrp&amp;lt;/code&amp;gt; API.&lt;br /&gt;
The methods on both classes are the same, and take the same arguments.&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
'''Does it support Python 2 and 3?'''&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
'''Does it require GNU Radio?'''&lt;br /&gt;
&lt;br /&gt;
No.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Does it use SWIG?'''&lt;br /&gt;
&lt;br /&gt;
No, it uses &amp;lt;code&amp;gt;Boost.Python&amp;lt;/code&amp;gt;. We didn't want to add another dependency to UHD (i.e., SWIG) and Boost was already a dependency of UHD. It also doesn't require the C API.&lt;br /&gt;
&lt;br /&gt;
'''How does this relate to the Python API in gr-uhd?''' &lt;br /&gt;
&lt;br /&gt;
It serves an entirely different purpose. This Python API is for people writing standalone applications for USRPs that *don't* use GNU Radio. &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; is staying the way it is, and is going nowhere. If you're using GNU Radio, you probably don't care about this.&lt;br /&gt;
&lt;br /&gt;
'''Are the UHD Python API and the gr-uhd Python API compatible?'''&lt;br /&gt;
&lt;br /&gt;
Short answer: No. Long answer: There are very few cases where it makes sense to mix these APIs, so no. However, this means that a &amp;lt;code&amp;gt;TimeSpec&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;Boost.Python&amp;lt;/code&amp;gt; API is not convertible into a &amp;lt;code&amp;gt;time_spec_t&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; API.&lt;br /&gt;
&lt;br /&gt;
'''When will it be released?'''&lt;br /&gt;
&lt;br /&gt;
It is currently on &amp;lt;code&amp;gt;master&amp;lt;/code&amp;gt; branch, and will become part of the next major release.&lt;br /&gt;
&lt;br /&gt;
'''Does it support RFNoC API?'''&lt;br /&gt;
&lt;br /&gt;
Not yet, but it's in the pipeline. We wanted to get the basics (i.e. &amp;lt;code&amp;gt;multi_usrp&amp;lt;/code&amp;gt; API) right first.&lt;br /&gt;
&lt;br /&gt;
'''What's the streaming performance?'''&lt;br /&gt;
&lt;br /&gt;
Worse than straight C++, but not a lot, thanks to NumPy. You can run &amp;lt;code&amp;gt;host/examples/benchmark_rate.py&amp;lt;/code&amp;gt; if you want to see for yourself.&lt;br /&gt;
Overall, &amp;lt;code&amp;gt;recv()&amp;lt;/code&amp;gt; calls are pretty efficient if you've preallocated a NumPy array, because we can cast that to a straight pointer (and also skip any type checking!) and then it's not that different from a &amp;lt;code&amp;gt;recv()&amp;lt;/code&amp;gt; call in a C++ app. However, consuming the data is limited by how fast you can handle that in Python.&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=UHD_Python_API&amp;diff=3551</id>
		<title>UHD Python API</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=UHD_Python_API&amp;diff=3551"/>
				<updated>2017-07-11T00:15:30Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* FAQ */ Added gr q&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What's the UHD Python API? ==&lt;br /&gt;
&lt;br /&gt;
As the name suggests, it exposes the UHD API into Python. We use &amp;lt;code&amp;gt;Boost.Python&amp;lt;/code&amp;gt;&lt;br /&gt;
to generate a Python module which exposes most of the C++ API, and some extra&lt;br /&gt;
features.&lt;br /&gt;
&lt;br /&gt;
The Python API is currently in a public beta test. We very much encourage users&lt;br /&gt;
to try it out and voice their feedback. It is our intention to merge this API&lt;br /&gt;
into the master branch soon, and ship it as a regular feature.&lt;br /&gt;
&lt;br /&gt;
The pre-release announcement covers most of the information and can be found here: http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2017-June/025379.html&lt;br /&gt;
&lt;br /&gt;
We'll be doing some more development on this branch before we're merging it, but most importantly, we'd like to get some feedback from the greater community.&lt;br /&gt;
&lt;br /&gt;
The biggest thing missing is more documentation, but it already includes some examples. It's definitely ready for testing!&lt;br /&gt;
&lt;br /&gt;
==Feedback==&lt;br /&gt;
Any feedback is encouraged, please use the Github issue linked below for Python API discussion/bugs/improvements:&lt;br /&gt;
&lt;br /&gt;
https://github.com/EttusResearch/uhd/issues/105&lt;br /&gt;
&lt;br /&gt;
== How can I use it? ==&lt;br /&gt;
&lt;br /&gt;
In order to test the Python API, check out the &amp;lt;code&amp;gt;python-api&amp;lt;/code&amp;gt; branch (see:&lt;br /&gt;
https://github.com/EttusResearch/uhd/tree/python-api) and build it like any&lt;br /&gt;
other UHD branch. When running CMake, make sure that the Python API was enabled.&lt;br /&gt;
&lt;br /&gt;
The output from CMake should look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- ######################################################&lt;br /&gt;
-- # UHD enabled components                              &lt;br /&gt;
-- ######################################################&lt;br /&gt;
--   * LibUHD&lt;br /&gt;
--   * LibUHD - C API&lt;br /&gt;
--   * LibUHD - Python API&lt;br /&gt;
--   * Examples&lt;br /&gt;
--   * Utils&lt;br /&gt;
--   * Tests&lt;br /&gt;
--   * USB&lt;br /&gt;
--   * B100&lt;br /&gt;
--   * B200&lt;br /&gt;
--   * USRP1&lt;br /&gt;
--   * USRP2&lt;br /&gt;
--   * X300&lt;br /&gt;
--   * N230&lt;br /&gt;
--   * OctoClock&lt;br /&gt;
--   * Manual&lt;br /&gt;
--   * API/Doxygen&lt;br /&gt;
--   * Man Pages&lt;br /&gt;
-- &lt;br /&gt;
-- ######################################################&lt;br /&gt;
-- # UHD disabled components                             &lt;br /&gt;
-- ######################################################&lt;br /&gt;
--   * GPSD&lt;br /&gt;
--   * E100&lt;br /&gt;
--   * E300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it's built and installed, you'll be able to import the &amp;lt;code&amp;gt;uhd&amp;lt;/code&amp;gt; Python&lt;br /&gt;
module:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import uhd&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; my_usrp = uhd.usrp.MultiUSRP(&amp;quot;type=b200&amp;quot;)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; my_usrp.set_rx_gain(70)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have some examples in &amp;lt;code&amp;gt;[https://github.com/EttusResearch/uhd/tree/python-api/host/examples/python host/examples/python]&amp;lt;/code&amp;gt;. The examples are very&lt;br /&gt;
simple, but concise.&lt;br /&gt;
&lt;br /&gt;
==Example: pyuhd_rx_to_file.py==&lt;br /&gt;
This Python example is based on the C++ example &amp;lt;code&amp;gt;uhd/host/examples/rx_samples_to_file.cpp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import uhd&lt;br /&gt;
import numpy as np&lt;br /&gt;
import argparse&lt;br /&gt;
&lt;br /&gt;
def parse_args():&lt;br /&gt;
    parser = argparse.ArgumentParser()&lt;br /&gt;
    parser.add_argument(&amp;quot;-a&amp;quot;, &amp;quot;--args&amp;quot;, default=&amp;quot;&amp;quot;, type=str)&lt;br /&gt;
    parser.add_argument(&amp;quot;-o&amp;quot;, &amp;quot;--output-file&amp;quot;, type=str, required=True)&lt;br /&gt;
    parser.add_argument(&amp;quot;-f&amp;quot;, &amp;quot;--freq&amp;quot;, type=float, required=True)&lt;br /&gt;
    parser.add_argument(&amp;quot;-r&amp;quot;, &amp;quot;--rate&amp;quot;, default=1e6, type=float)&lt;br /&gt;
    parser.add_argument(&amp;quot;-d&amp;quot;, &amp;quot;--duration&amp;quot;, default=5.0, type=float)&lt;br /&gt;
    parser.add_argument(&amp;quot;-c&amp;quot;, &amp;quot;--channels&amp;quot;, default=0, nargs=&amp;quot;+&amp;quot;, type=int)&lt;br /&gt;
    parser.add_argument(&amp;quot;-g&amp;quot;, &amp;quot;--gain&amp;quot;, type=int, default=10)&lt;br /&gt;
    return parser.parse_args()&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
    args = parse_args()&lt;br /&gt;
    usrp = uhd.usrp.MultiUSRP(args.args)&lt;br /&gt;
    num_samps = int(np.ceil(args.duration*args.rate))&lt;br /&gt;
    if not isinstance(args.channels, list):&lt;br /&gt;
        args.channels = [args.channels]&lt;br /&gt;
    samps = usrp.recv_num_samps(num_samps, args.freq, args.rate, args.channels, args.gain)&lt;br /&gt;
    with open(args.output_file, 'wb') as f:&lt;br /&gt;
        np.save(f, samps, allow_pickle=False, fix_imports=False)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What about documentation? ==&lt;br /&gt;
&lt;br /&gt;
Documentation is currently pretty sparse. The best we can do right now is to ask&lt;br /&gt;
users to infer the documentation from the C++ API. For example, the Python has&lt;br /&gt;
an object called &amp;lt;code&amp;gt;MultiUSRP&amp;lt;/code&amp;gt; which is an equivalent of the C++ &amp;lt;code&amp;gt;multi_usrp&amp;lt;/code&amp;gt; API.&lt;br /&gt;
The methods on both classes are the same, and take the same arguments.&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
'''Does it support Python 2 and 3?'''&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
'''Does it require GNU Radio?'''&lt;br /&gt;
&lt;br /&gt;
No.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Does it use SWIG?'''&lt;br /&gt;
&lt;br /&gt;
No, it uses &amp;lt;code&amp;gt;Boost.Python&amp;lt;/code&amp;gt;. We didn't want to add another dependency to UHD (i.e., SWIG) and Boost was already a dependency of UHD. It also doesn't require the C API.&lt;br /&gt;
&lt;br /&gt;
'''How does this relate to the Python API in gr-uhd?''' &lt;br /&gt;
&lt;br /&gt;
It serves an entirely different purpose. This Python API is for people writing standalone applications for USRPs that *don't* use GNU Radio. &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; is staying the way it is, and is going nowhere. If you're using GNU Radio, you probably don't care about this.&lt;br /&gt;
&lt;br /&gt;
'''Are the UHD Python API and the gr-uhd Python API compatible?'''&lt;br /&gt;
&lt;br /&gt;
Short answer: No. Long answer: There are very few cases where it makes sense to mix these APIs, so no. However, this means that a &amp;lt;code&amp;gt;TimeSpec&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;Boost.Python&amp;lt;/code&amp;gt; API is not convertible into a &amp;lt;code&amp;gt;time_spec_t&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; API.&lt;br /&gt;
&lt;br /&gt;
'''When will it be released?'''&lt;br /&gt;
&lt;br /&gt;
TBD, but if we hear a lot of encouragement that'll drive things along faster. It'll go into &amp;lt;code&amp;gt;master&amp;lt;/code&amp;gt; branch whenever it's considered stable enough, and then in the first major release after that merge.&lt;br /&gt;
&lt;br /&gt;
'''Does it support RFNoC API?'''&lt;br /&gt;
&lt;br /&gt;
Not yet, but it's not hard to add. We wanted to get the basics (i.e. &amp;lt;code&amp;gt;multi_usrp&amp;lt;/code&amp;gt; API) right first.&lt;br /&gt;
&lt;br /&gt;
'''What's the streaming performance?'''&lt;br /&gt;
&lt;br /&gt;
Worse than straight C++. Better than I would have thought, thanks to NumPy. We have no benchmarks yet. Overall, &amp;lt;code&amp;gt;recv()&amp;lt;/code&amp;gt; calls are pretty efficient if you've preallocated a NumPy array, because we can cast that to a straight pointer (and also skip any type checking!!!!!!) and then it's not that different from a &amp;lt;code&amp;gt;recv()&amp;lt;/code&amp;gt; call in a C++ app. However, consuming the data is limited by how&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=UHD_Python_API&amp;diff=3545</id>
		<title>UHD Python API</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=UHD_Python_API&amp;diff=3545"/>
				<updated>2017-07-10T23:29:59Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What's the UHD Python API? ==&lt;br /&gt;
&lt;br /&gt;
As the name suggests, it exposes the UHD API into Python. We use Boost.Python&lt;br /&gt;
to generate a Python module which exposes most of the C++ API, and some extra&lt;br /&gt;
features.&lt;br /&gt;
&lt;br /&gt;
The Python API is currently in a public beta test. We very much encourage users&lt;br /&gt;
to try it out and voice their feedback. It is our intention to merge this API&lt;br /&gt;
into the master branch soon, and ship it as a regular feature.&lt;br /&gt;
&lt;br /&gt;
The pre-release announcement covers most of the information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Hi all,&lt;br /&gt;
&lt;br /&gt;
some people have already heard the rumour that we're working on a Python&lt;br /&gt;
API for UHD that does not involve gr-uhd. And yes, it's true. A minute&lt;br /&gt;
ago, I published our current development branch on github:&lt;br /&gt;
&lt;br /&gt;
https://github.com/EttusResearch/uhd/tree/python-api&lt;br /&gt;
&lt;br /&gt;
We'll be doing some more development on this branch before we're merging&lt;br /&gt;
it, but most importantly, we'd like to get some feedback from the&lt;br /&gt;
greater community.&lt;br /&gt;
&lt;br /&gt;
The biggest thing missing is more documentation, but it already includes&lt;br /&gt;
some examples. It's definitely ready for testing!&lt;br /&gt;
If you have feedback, post it either in this thread, or on github:&lt;br /&gt;
https://github.com/EttusResearch/uhd/issues/105&lt;br /&gt;
&lt;br /&gt;
I've tried to preempt some questions:&lt;br /&gt;
&lt;br /&gt;
- Does it support Python 2 and 3? Yes.&lt;br /&gt;
- Does it use SWIG? No, it uses Boost.Python. We didn't want to add&lt;br /&gt;
another dependency to UHD (i.e., SWIG) and Boost was already a&lt;br /&gt;
dependency of UHD. It also doesn't require the C API.&lt;br /&gt;
- How does this relate to the Python API in gr-uhd? It serves an&lt;br /&gt;
entirely different purpose. This Python API is for people writing&lt;br /&gt;
standalone applications for USRPs that *don't* use GNU Radio. gr-uhd is&lt;br /&gt;
staying the way it is, and is going nowhere. If you're using GNU Radio,&lt;br /&gt;
you probably don't care about this.&lt;br /&gt;
- Are the UHD Python API and the gr-uhd Python API compatible? Short&lt;br /&gt;
answer: No. Long answer: There are very few cases where it makes sense&lt;br /&gt;
to mix these APIs, so no. However, this means that a TimeSpec from the&lt;br /&gt;
Boost.Python API is not convertible into a time_spec_t from the gr-uhd API.&lt;br /&gt;
- When will it be released? TBD, but if we hear a lot of encouragement&lt;br /&gt;
that'll drive things along faster. It'll go into master branch whenever&lt;br /&gt;
it's considered stable enough, and then in the first major release after&lt;br /&gt;
that merge.&lt;br /&gt;
- Does it support RFNoC API? Not yet, but it's not hard to add. We&lt;br /&gt;
wanted to get the basics (i.e. multi_usrp API) right first.&lt;br /&gt;
- What's the streaming performance? Worse than straight C++. Better than&lt;br /&gt;
I would have thought, thanks to numpy. We have no benchmarks yet.&lt;br /&gt;
Overall, recv() calls are pretty efficient if you've preallocated a&lt;br /&gt;
numpy array, because we can cast that to a straight pointer (and also&lt;br /&gt;
skip any type checking!!!!!!) and then it's not that different from a&lt;br /&gt;
recv() call in a C++ app. However, consuming the data is limited by how&lt;br /&gt;
fast you can handle that in Python.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How can I use it? ==&lt;br /&gt;
&lt;br /&gt;
In order to test the Python API, check out the python-api branch (see:&lt;br /&gt;
https://github.com/EttusResearch/uhd/tree/python-api) and build it like any&lt;br /&gt;
other UHD branch. When running CMake, make sure that the Python API was enabled.&lt;br /&gt;
&lt;br /&gt;
The output from CMake should look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- ######################################################&lt;br /&gt;
-- # UHD enabled components                              &lt;br /&gt;
-- ######################################################&lt;br /&gt;
--   * LibUHD&lt;br /&gt;
--   * LibUHD - C API&lt;br /&gt;
--   * LibUHD - Python API&lt;br /&gt;
--   * Examples&lt;br /&gt;
--   * Utils&lt;br /&gt;
--   * Tests&lt;br /&gt;
--   * USB&lt;br /&gt;
--   * B100&lt;br /&gt;
--   * B200&lt;br /&gt;
--   * USRP1&lt;br /&gt;
--   * USRP2&lt;br /&gt;
--   * X300&lt;br /&gt;
--   * N230&lt;br /&gt;
--   * OctoClock&lt;br /&gt;
--   * Manual&lt;br /&gt;
--   * API/Doxygen&lt;br /&gt;
--   * Man Pages&lt;br /&gt;
-- &lt;br /&gt;
-- ######################################################&lt;br /&gt;
-- # UHD disabled components                             &lt;br /&gt;
-- ######################################################&lt;br /&gt;
--   * GPSD&lt;br /&gt;
--   * E100&lt;br /&gt;
--   * E300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it's built and installed, you'll be able to import the '''uhd''' Python&lt;br /&gt;
module:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import uhd&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; my_usrp = uhd.usrp.MultiUSRP(&amp;quot;type=b200&amp;quot;)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; my_usrp.set_rx_gain(70)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have some examples in '''host/examples/python'''. The examples are very&lt;br /&gt;
simple, but concise.&lt;br /&gt;
&lt;br /&gt;
== What about documentation? ==&lt;br /&gt;
&lt;br /&gt;
Documentation is currently pretty sparse. The best we can do right now is to ask&lt;br /&gt;
users to infer the documentation from the C++ API. For example, the Python has&lt;br /&gt;
an object called 'MultiUSRP' which is an equivalent of the C++ 'multi_usrp' API.&lt;br /&gt;
The methods on both classes are the same, and take the same arguments.&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=UHD_Python_API&amp;diff=3544</id>
		<title>UHD Python API</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=UHD_Python_API&amp;diff=3544"/>
				<updated>2017-07-10T21:59:40Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: Not finished yet&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What's the UHD Python API? ==&lt;br /&gt;
&lt;br /&gt;
As the name suggests, it exposes the UHD API into Python. We use Boost.Python&lt;br /&gt;
to generate a Python module which exposes most of the C++ API, and some extra&lt;br /&gt;
features.&lt;br /&gt;
&lt;br /&gt;
The Python API is currently in a public beta test. We very much encourage users&lt;br /&gt;
to try it out and voice their feedback. It is our intention to merge this API&lt;br /&gt;
into the master branch soon, and ship it as a regular feature.&lt;br /&gt;
&lt;br /&gt;
The pre-release announcement covers most of the information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Hi all,&lt;br /&gt;
&lt;br /&gt;
some people have already heard the rumour that we're working on a Python&lt;br /&gt;
API for UHD that does not involve gr-uhd. And yes, it's true. A minute&lt;br /&gt;
ago, I published our current development branch on github:&lt;br /&gt;
&lt;br /&gt;
https://github.com/EttusResearch/uhd/tree/python-api&lt;br /&gt;
&lt;br /&gt;
We'll be doing some more development on this branch before we're merging&lt;br /&gt;
it, but most importantly, we'd like to get some feedback from the&lt;br /&gt;
greater community.&lt;br /&gt;
&lt;br /&gt;
The biggest thing missing is more documentation, but it already includes&lt;br /&gt;
some examples. It's definitely ready for testing!&lt;br /&gt;
If you have feedback, post it either in this thread, or on github:&lt;br /&gt;
https://github.com/EttusResearch/uhd/issues/105&lt;br /&gt;
&lt;br /&gt;
I've tried to preempt some questions:&lt;br /&gt;
&lt;br /&gt;
- Does it support Python 2 and 3? Yes.&lt;br /&gt;
- Does it use SWIG? No, it uses Boost.Python. We didn't want to add&lt;br /&gt;
another dependency to UHD (i.e., SWIG) and Boost was already a&lt;br /&gt;
dependency of UHD. It also doesn't require the C API.&lt;br /&gt;
- How does this relate to the Python API in gr-uhd? It serves an&lt;br /&gt;
entirely different purpose. This Python API is for people writing&lt;br /&gt;
standalone applications for USRPs that *don't* use GNU Radio. gr-uhd is&lt;br /&gt;
staying the way it is, and is going nowhere. If you're using GNU Radio,&lt;br /&gt;
you probably don't care about this.&lt;br /&gt;
- Are the UHD Python API and the gr-uhd Python API compatible? Short&lt;br /&gt;
answer: No. Long answer: There are very few cases where it makes sense&lt;br /&gt;
to mix these APIs, so no. However, this means that a TimeSpec from the&lt;br /&gt;
Boost.Python API is not convertible into a time_spec_t from the gr-uhd API.&lt;br /&gt;
- When will it be released? TBD, but if we hear a lot of encouragement&lt;br /&gt;
that'll drive things along faster. It'll go into master branch whenever&lt;br /&gt;
it's considered stable enough, and then in the first major release after&lt;br /&gt;
that merge.&lt;br /&gt;
- Does it support RFNoC API? Not yet, but it's not hard to add. We&lt;br /&gt;
wanted to get the basics (i.e. multi_usrp API) right first.&lt;br /&gt;
- What's the streaming performance? Worse than straight C++. Better than&lt;br /&gt;
I would have thought, thanks to numpy. We have no benchmarks yet.&lt;br /&gt;
Overall, recv() calls are pretty efficient if you've preallocated a&lt;br /&gt;
numpy array, because we can cast that to a straight pointer (and also&lt;br /&gt;
skip any type checking!!!!!!) and then it's not that different from a&lt;br /&gt;
recv() call in a C++ app. However, consuming the data is limited by how&lt;br /&gt;
fast you can handle that in Python.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How can I use it? ==&lt;br /&gt;
&lt;br /&gt;
In order to test the Python API, check out the python-api branch (see:&lt;br /&gt;
https://github.com/EttusResearch/uhd/tree/python-api) and build it like any&lt;br /&gt;
other UHD branch. When running CMake, make sure that the Python API was enabled.&lt;br /&gt;
&lt;br /&gt;
The output from CMake should look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- ######################################################&lt;br /&gt;
-- # UHD enabled components                              &lt;br /&gt;
-- ######################################################&lt;br /&gt;
--   * LibUHD&lt;br /&gt;
--   * LibUHD - C API&lt;br /&gt;
--   * LibUHD - Python API&lt;br /&gt;
--   * Examples&lt;br /&gt;
--   * Utils&lt;br /&gt;
--   * Tests&lt;br /&gt;
--   * USB&lt;br /&gt;
--   * B100&lt;br /&gt;
--   * B200&lt;br /&gt;
--   * USRP1&lt;br /&gt;
--   * USRP2&lt;br /&gt;
--   * X300&lt;br /&gt;
--   * N230&lt;br /&gt;
--   * OctoClock&lt;br /&gt;
--   * Manual&lt;br /&gt;
--   * API/Doxygen&lt;br /&gt;
--   * Man Pages&lt;br /&gt;
-- &lt;br /&gt;
-- ######################################################&lt;br /&gt;
-- # UHD disabled components                             &lt;br /&gt;
-- ######################################################&lt;br /&gt;
--   * GPSD&lt;br /&gt;
--   * E100&lt;br /&gt;
--   * E300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it's built and installed, you'll be able to import the '''uhd''' Python&lt;br /&gt;
module:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import uhd&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; my_usrp = uhd.usrp.MultiUSRP(&amp;quot;type=b200&amp;quot;)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; my_usrp.set_rx_gain(70)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have some examples in '''host/examples/python'''. The examples are very&lt;br /&gt;
simple, but concise.&lt;br /&gt;
&lt;br /&gt;
== What about documentation? ==&lt;br /&gt;
&lt;br /&gt;
Documentation is currently pretty sparse. The best we can do right now is to ask&lt;br /&gt;
users to infer the documentation from&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=3542</id>
		<title>Getting Started with RFNoC Development</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=3542"/>
				<updated>2017-07-10T16:27:58Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: Typo (removed a ')&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-823'''&lt;br /&gt;
&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-07-12&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Martin Braun&amp;lt;br&amp;gt; Nicolas Cuervo&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2017-01-10&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Team&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Added “Digital Gain” example&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2017-05-08&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Jose Loera&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Updated example code. Update to Testbench section.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This application note guides a user through basic information on the RFNoC architecture, installing necessary software to develop custom RFNoC blocks, also called Computation Engines (CE), and walks through the steps of creating a custom RFNoC block using an example.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
First sections deal with installing tools and validating correct tool installation in order to do RFNoC development. Later sections deal with creating a custom RFNoC block, using the built-in testbench architecture, building an FPGA image with the custom block and finally testing out the new block within GNU Radio.&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
The RFNoC code base is open source, including code that executes on the host, as well as code targeted to the USRP hardware (FPGA and microcontroller firmware). As dual-licensed software, RFNoC is available under the open-source GNU Public License version 3 (GPLv3), as well as an alternative, less-restrictive license offered only by Ettus Research. For more information on our licensing policy, please contact [mailto:info@ettus.com info@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
RFNoC is only supported on the USRP E310/E312 and the USRP X300/X310.&lt;br /&gt;
&lt;br /&gt;
In order to build custom USRP FPGA images and RFNoC blocks the following hardware and software are needed.&lt;br /&gt;
&lt;br /&gt;
* '''Ubuntu 14.04.5 or 16.04.1 (preferred):''' Currently PyBOMBS (which can be used to install the ''Software build tools''), works most reliably in Ubuntu, and thus, we recommend using this distribution. Also, a majority of the scripts used during the build process are Linux (Ubuntu) specific. A PC with multiple cores and 8GB+ of RAM is recommended.&lt;br /&gt;
&lt;br /&gt;
* '''Xilinx Vivado tools (version 2015.4):''' The specific version depends on the branch and state of the FPGA code. The default install location is &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;. Once all of the Software build tools are installed the specific version for the downloaded code can be found in the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{DEVICE}&amp;lt;/code&amp;gt; directory. Further information can be found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here].&lt;br /&gt;
&lt;br /&gt;
* '''Software build tools:''' If UHD can be or has been compiled from source on the development PC then all the necessary software build components are present (PyBOMBS can be used to set all this up and instructions on how to do so are given in a following step).&lt;br /&gt;
&lt;br /&gt;
* X3xx series or E3xx series device or any future USRP&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
* The edition of Xilinx Vivado that is required will depend on which USRP device is being used.&lt;br /&gt;
** X3xx series devices: Design Edition or System Edition.&lt;br /&gt;
** E3xx series devices: Design Edition, System Edition, or the free WebPack Edition.&lt;br /&gt;
* Other operating systems can be used, but the exact steps on how to proceed are not given in this Application Note.&lt;br /&gt;
* In some Linux distributions (e.g. Ubuntu) &amp;lt;code&amp;gt;dash&amp;lt;/code&amp;gt; is set as default shell, which may cause some issues. It is recommended to set the shell to &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; by running the following commands in the terminal. Choose &amp;lt;code&amp;gt;&amp;lt;No&amp;gt;&amp;lt;/code&amp;gt; when prompted by the first command and the second command will validate the that bash will be used.&lt;br /&gt;
&lt;br /&gt;
    $ sudo dpkg-reconfigure dash&lt;br /&gt;
    $ ll /bin/sh&lt;br /&gt;
&lt;br /&gt;
==Creating a development environment==&lt;br /&gt;
While this Application Note goes through the process of integrating GNU Radio into the RFNoC development flow, it is by no means required to use or develop within the RFNoC framework, but it makes it a great deal easier to use a framework on top of RFNoC for aspects such as visualization and other features. GNU Radio is freely available and more information about it can be found [http://gnuradio.org/ here].&lt;br /&gt;
&lt;br /&gt;
The following software packages are required in order to setup a development environment/sandbox:&lt;br /&gt;
&lt;br /&gt;
* UHD&lt;br /&gt;
* GNU Radio &lt;br /&gt;
* gr-ettus&lt;br /&gt;
&lt;br /&gt;
===Create development environment using PyBOMBS===&lt;br /&gt;
The cleanest way to set this up is to install everything into a dedicated directory. [https://github.com/gnuradio/pybombs PyBOMBS] is the simplest way to do this. If not already installed, PyBOMBS can be setup with the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ sudo apt-get install git&lt;br /&gt;
    $ sudo apt-get install python-setuptools python-dev python-pip build-essential &lt;br /&gt;
    &lt;br /&gt;
    $ sudo pip install git+https://github.com/gnuradio/pybombs.git&lt;br /&gt;
    $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git&lt;br /&gt;
    $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git&lt;br /&gt;
&lt;br /&gt;
These commands will do the following:&lt;br /&gt;
* Install &amp;lt;code&amp;gt;Git&amp;lt;/code&amp;gt;&lt;br /&gt;
* Install &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; and other Python dependencies&lt;br /&gt;
* Install the latest &amp;lt;code&amp;gt;PyBOMBS&amp;lt;/code&amp;gt; from its Git repository&lt;br /&gt;
* Add the &amp;lt;code&amp;gt;gr-recipes&amp;lt;/code&amp;gt; recipes which are used to install GNU Radio specific software&lt;br /&gt;
* Add the &amp;lt;code&amp;gt;ettus&amp;lt;/code&amp;gt; recipes which are used to install Ettus Research specific software&lt;br /&gt;
&lt;br /&gt;
From here, PyBOMBS can be used to setup and install the development environment/sandbox by running the following command:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs prefix init ~/rfnoc -R rfnoc -a rfnoc&lt;br /&gt;
&lt;br /&gt;
This will do the following:&lt;br /&gt;
&lt;br /&gt;
* Create a directory in the user’s home directory called &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; (any valid directory name will work)&lt;br /&gt;
&lt;br /&gt;
* Give the prefix an alias of &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; ( &amp;lt;code&amp;gt;[-a alias]&amp;lt;/code&amp;gt;, e.g. &amp;lt;code&amp;gt;–a rfnoc&amp;lt;/code&amp;gt; ), which would be the name given to this path. This name will be used in further steps that use PyBOMBS. When creating the first prefix and omitting the alias, the prefix will be setup as the default.&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; prefix recipe ( as opposed to a package recipe like &amp;lt;code&amp;gt;gqrx&amp;lt;/code&amp;gt; ) to clone UHD, FPGA, GNU Radio, and gr-ettus sources into the &amp;lt;code&amp;gt;~/rfnoc&amp;lt;/code&amp;gt; directory as well as compile and install all the software&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' A user can specify how many cores are used by builds when using PyBOMBS. The default is set to 4. For example, this will set the number of cores used to 3:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs config makewidth 3&lt;br /&gt;
&lt;br /&gt;
The value will be written into a configuration file and then applied to subsequent PyBOMBS commands. This value can temporarily be overridden for a specific build by specifying the &amp;lt;code&amp;gt;--config makewidth=X&amp;lt;/code&amp;gt; argument, where “&amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;” is an integer number. If the user only has 4 cores it is recommend to use this argument in the pybombs command to limit the number of cores to &amp;lt;4 (e.g. 3) so that the computer stays responsive. Following are 2 examples, one using less cores and the other using more cores:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs --config makewidth=3 prefix init ~/rfnoc -R rfnoc -a rfnoc &lt;br /&gt;
    $ pybombs --config makewidth=7 prefix init ~/rfnoc -R rfnoc -a rfnoc&lt;br /&gt;
&lt;br /&gt;
Then, it is necessary to setup the PyBOMBS environment, so that the system/terminal session will have the environmental variables pointing to this newly created prefix, which is done with the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/rfnoc&lt;br /&gt;
    $ source ./setup_env.sh&lt;br /&gt;
&lt;br /&gt;
Once the previous command is run, this terminal session will have access to the environmental variables that allow the complete use of the set of software that was just installed with PyBOMBS. If access to the software is needed in other terminals the same command must be run within them.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Throughout the rest of this document the term &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; will used at the beginning of different directories. For example, &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&amp;lt;/code&amp;gt; is a directory that contains useful scripts for compiling. The term &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; is used to denote the folders that precede the &amp;lt;code&amp;gt;/src&amp;lt;/code&amp;gt; directory. Examples of what &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; could be: &amp;lt;code&amp;gt;/home/user/rfnoc&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/home/user/myDevfolder/&amp;lt;/code&amp;gt;. On many Linux environments using &amp;lt;code&amp;gt;~/&amp;lt;/code&amp;gt; at the beginning of the target directory path is equivalent to the user’s home directory.( i.e &amp;lt;code&amp;gt;~/&amp;lt;/code&amp;gt; is equal to &amp;lt;code&amp;gt;/home/user/&amp;lt;/code&amp;gt;). So &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; could also look like &amp;lt;code&amp;gt;~/rfnoc&amp;lt;/code&amp;gt;  or &amp;lt;code&amp;gt;~/myDevfolder/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Create the development environment manually===&lt;br /&gt;
As an alternative to using PyBOMBS, manually installing and configuring the software is done by following the individual install notes for [http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGRFromSource GNU Radio], [https://files.ettus.com/manual/page_build_guide.html UHD] and [https://github.com/EttusResearch/gr-ettus gr-ettus] and by making sure they are reachable by linkers and compilers.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The Application Note found [https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux here] goes through the process of manually installing UHD and GNU Radio on Linux platforms.&lt;br /&gt;
&lt;br /&gt;
To manually download the software, use these &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt; commands, which will select the correct branches:&lt;br /&gt;
&lt;br /&gt;
    $ git clone --recursive -b rfnoc-devel https://github.com/EttusResearch/uhd.git &lt;br /&gt;
    $ git clone --recursive -b maint https://github.com/gnuradio/gnuradio.git # master branch is also fine instead of maint&lt;br /&gt;
    $ git clone -b master https://github.com/EttusResearch/gr-ettus.git &lt;br /&gt;
    $ git clone -b rfnoc-devel https://github.com/EttusResearch/fpga.git&lt;br /&gt;
&lt;br /&gt;
If UHD, GNU Radio and/or gr-ettus are already installed, it would be sufficient to checkout the branches mentioned and update them them (&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;). Thereafter, rebuild each of the repositories (rebuild order: UHD, GNU Radio, gr-ettus).&lt;br /&gt;
&lt;br /&gt;
===Verify Environment===&lt;br /&gt;
Running the command “&amp;lt;code&amp;gt;uhd_config_info&amp;lt;/code&amp;gt;” with the “&amp;lt;code&amp;gt;--version&amp;lt;/code&amp;gt;” flag will verify that the installation has been completed successfully.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The version string output from this command may differ, however it should be similar to the output below.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_config_info --version&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-161- g83150fdd&lt;br /&gt;
    &lt;br /&gt;
    4.0.0.rfnoc-devel-161-g83150fdd&lt;br /&gt;
&lt;br /&gt;
===Testing the default FPGA image and building from existing blocks===&lt;br /&gt;
&lt;br /&gt;
It is recommended to spend a moment looking at the Ettus Research default image, which is pre-built with a set of RFNoC blocks, as well as building a custom image with a unique set of pre-built RFNoC blocks. To get the default image(s), run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_images_downloader&lt;br /&gt;
&lt;br /&gt;
Ettus Research will be updating the default image(s) occasionally, and &amp;lt;code&amp;gt;uhd_images_downloader&amp;lt;/code&amp;gt; can be run anytime after running &amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt; and re-installing to pull the most current images. Images are stored in the &amp;lt;code&amp;gt;{USER_PREFIX}/share/uhd/images&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
The following images have the corresponding RFNoC blocks (Computation Engines):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Image Name&lt;br /&gt;
!Included Blocks&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x300_fpga_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x300_fpga_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;2x DDC, 2x DUC&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x300_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x300_fpga_RFNOC_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DUC, DDC (one channel), fosphor, window, fft, 2x AXI FIFOs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DUC, DDC (one channel), fosphor, window, fft, 2x AXI FIFOs, Keep One in N, FIR, Siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_e310_fpga.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_e310_fpga_sg3.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;1x DDC, 1x DUC&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_e310_fpga_RFNOC.bit (sg1 version)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_e310_fpga_RFNOC_sg3.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;fosphor, window, fft, 2x AXI FIFOs, FIR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Instructions on flashing the image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
  &lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device.&lt;br /&gt;
&lt;br /&gt;
By following the steps above the following should now be available:&lt;br /&gt;
* UHD/RFNoC code downloaded and installed&lt;br /&gt;
* FPGA code available&lt;br /&gt;
* A valid RFNoC image on your X3xx or E3xx series device&lt;br /&gt;
&lt;br /&gt;
====Inspect default images====&lt;br /&gt;
Run the following command, with a USRP connected to your PC, to verify current image on the USRP.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
If an RFNoC image was successfully loaded onto the USRP, there will be a lot of output text (RFNoC code is currently very verbose). The final lines of the output should be similar to the following for an USRP X310 ( e.g. &amp;lt;code&amp;gt;usrp_x310_fpga_HG&amp;lt;/code&amp;gt; ):&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * DDC_1&lt;br /&gt;
    |   |   |   * DUC_0&lt;br /&gt;
    |   |   |   * DUC_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Final output for &amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt; image:&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * DUC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * Window_0&lt;br /&gt;
    |   |   |   * FIR_0&lt;br /&gt;
    |   |   |   * SigGen_0&lt;br /&gt;
    |   |   |   * KeepOneInN_0&lt;br /&gt;
    |   |   |   * fosphor_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The actual names and number of blocks can differ. The list of blocks should start with the &amp;lt;code&amp;gt;DmaFIFO_x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Radio_x&amp;lt;/code&amp;gt;, and then a couple more lines of block IDs should follow.&lt;br /&gt;
&lt;br /&gt;
====Build custom image with pre-built RFNoC blocks====&lt;br /&gt;
Because of the growing number of RFNoC blocks, the user has the option to build an FPGA image with a set of pre-built RFNoC blocks of their choosing. The following steps describe the process for doing this and by so doing will also validate proper tool installation. Because compilation can take a couple of hours, it is recommended the user begin this process while continuing the rest of this guide.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA compilations can run in the background, however they are very resource intensive. If the user intents to use the same computer that is compiling to walk through the rest of this Application Note, it is recommended that the computer has plenty of resources.&lt;br /&gt;
&lt;br /&gt;
The script to initiate a compile is called &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt;, and is located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&amp;lt;/code&amp;gt; directory. Run the help menu by typing:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts &lt;br /&gt;
    $ ./uhd_image_builder.py --help&lt;br /&gt;
&lt;br /&gt;
A more detailed discussion of this script is given in an upcoming section. For now, compiling an FPGA image that has 2 RFNoC blocks (&amp;lt;code&amp;gt;window&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fft&amp;lt;/code&amp;gt;) and some &amp;lt;code&amp;gt;FIFOs&amp;lt;/code&amp;gt;, is done by running the script with the following arguments.&lt;br /&gt;
&lt;br /&gt;
Example for an X310 USRP:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py window fft -d x310 -t X310_RFNOC_HG -m 5 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
Example for an E310 USRP with Speed Grade 3 (sg3) FPGA:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py window fft -d e310 -t E310_RFNOC_sg3 -m 5 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
At the end of a successful compilation process, write the new image to a USRP. If the image was compiled for a USRP X310, the following command will load the new image. Update the &amp;lt;code&amp;gt;{IP_Address}&amp;lt;/code&amp;gt; of the USRP and &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; to the appropriate values for your configuration before running the command.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args &amp;quot;type=x300,addr={IP_ADDRESS}&amp;quot; --fpga-path {USER_PREFIX}/src/uhd-fpga/usrp3/top/x300/build/usrp_x310_fpga_RFNOC_HG.bit&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. Additional instructions on flashing a custom image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
&lt;br /&gt;
After the image has been successfully written to the USRP, power-cycle it and run the “&amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;” utility to view the newly compiled blocks.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
The final lines of output for the image built for the X310 is as follows:&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * Window_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
===Getting started with UHD + RFNoC===&lt;br /&gt;
The following new examples included within the &amp;lt;code&amp;gt;rfnoc-devel&amp;lt;/code&amp;gt; branch of UHD, are a good reference on how to use RFNoC from UHD.&lt;br /&gt;
&lt;br /&gt;
The following example is based off of &amp;lt;code&amp;gt;rx_samples_to_file.cpp&amp;lt;/code&amp;gt;. The example can be configured to place an RFNoC block in between the radio and host.&lt;br /&gt;
&lt;br /&gt;
    rfnoc_rx_to_file.cpp&lt;br /&gt;
&lt;br /&gt;
This next example chains a null source to another block and streams the data to the host.&lt;br /&gt;
&lt;br /&gt;
    rfnoc_nullsource_ce_rx.cpp&lt;br /&gt;
&lt;br /&gt;
These examples demonstrate the core features and flexibility of RFNoC.&lt;br /&gt;
&lt;br /&gt;
For more information on UHD and UHD development please refer to the [https://kb.ettus.com/UHD UHD Software Resource page], [https://kb.ettus.com/Getting_Started_with_UHD_and_C%2B%2B Getting Started with UHD and C++ Application Note] or directly to the [http://files.ettus.com/manual/ UHD user manual].&lt;br /&gt;
&lt;br /&gt;
===Getting started with GNU Radio + RFNoC===&lt;br /&gt;
A good way of getting started with RFNoC in a more visual way is to use GNU Radio. The &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; out-of-tree module (OOT) allows a user to use RFNoC blocks in their local GNU Radio / GNU Radio Companion (GRC) installation. This GNU Radio OOT contains blocks that allow you to configure your FPGA through GRC.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' As blocks in the &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; OOT mature, they will be upstreamed to &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt;. Also, &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; is a container used by Ettus Research to disseminate experimental or under-development features for &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt;. It is not a replacement for &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; (in fact, the latter is a requirement for &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;).&lt;br /&gt;
    &lt;br /&gt;
Examples can be run from &amp;lt;code&amp;gt;gr-ettus/examples/rfnoc&amp;lt;/code&amp;gt;, provided that the appropriate RFNoC blocks are compiled into the FPGA image currently running on the USRP.&lt;br /&gt;
&lt;br /&gt;
A couple of rules for building GNU Radio flowgraphs with RFNoC blocks:&lt;br /&gt;
&lt;br /&gt;
* You always need a &amp;lt;code&amp;gt;Device3&amp;lt;/code&amp;gt; object in your flow graph (it does not get connected, see screenshot below).&lt;br /&gt;
* You should have at least two RFNoC blocks connected together, going &amp;lt;code&amp;gt;GNU Radio Block&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;RFNoC Block&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;GNU Radio Block&amp;lt;/code&amp;gt; is not recommended (it will work, but with suboptimal performance).&lt;br /&gt;
&lt;br /&gt;
The GNU Radio flowgraph &amp;lt;code&amp;gt;rfnoc_ddc.grc&amp;lt;/code&amp;gt; is an example that can be run using the default RFNoC image. Below are screenshots of the flowgraph and what it produces.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 1.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Copy Block: In the RFNoC domain, streams of data can not be split as easily as they are in the GNU Radio domain. The “copy” block depicted in the screenshot above serves the function as a stream splitter . It’s main purpose, when “enabled”, is to copy the samples it is getting at its input and putting then into the output, but here it is also serving as a boundary between a RFNoC-domain and a GNURadio-domain. In the flowgraph above. after this boundary is passed, the data stream can easily be split into the two sinks to have them run simultaneously (standard GNU Radio functionality). It is possible to connect the GNU Radio blocks directly to RFNoC blocks without a “copy” block, but only one would work at a time (the other ones would have to be disabled). Another way to split data streams from the RFNoC- domain is to use the ”RFNoC: split stream” block, which would split the streams in the RFNoC domain, but this is not very useful here as we are, in any case, moving into the GNURadio-domain.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 2.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
For more information on GNURadio development please refer to the [http://gnuradio.org/doc/doxygen/ GNURadio user's manual and API].&lt;br /&gt;
&lt;br /&gt;
==Starting a custom RFNoC block using RFNoC Modtool==&lt;br /&gt;
The figure below shows the basic structure of the RFNoC Stack. Corresponding code is needed in each of the three sections in order to build a custom RFNoC block with GNU Radio integration. A tool called RFNoC Modtool was created in order to minimize the effort needed to implement a new RFNoC block. RFNoC Modtool creates a custom GNU Radio OOT module with the basic structure and the necessary files for each of these sections. RFNoC Modtool is currently a part of the GNU Radio OOT module &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 3.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
===RFNoC Modtool Utilization===&lt;br /&gt;
'''NOTE:''' Console outputs may vary depending on the version of UHD the user is running. However, functionality should be the same or similar.&lt;br /&gt;
&lt;br /&gt;
Because the RFNoC Modtool has similar functionality to the &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt; [ [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules gr_modtool] ] provided by GNU Radio, those that have worked with &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt; in the past will find the RFNoC Modtool familiar.&lt;br /&gt;
&lt;br /&gt;
To check the usage of the tool, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool help&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    Usage:&lt;br /&gt;
    rfnocmodtool &amp;lt;command&amp;gt; [options] -- Run &amp;lt;command&amp;gt; with the given options.&lt;br /&gt;
    rfnocmodtool help -- Show a list of commands.&lt;br /&gt;
    rfnocmodtool help &amp;lt;command&amp;gt; -- Shows the help for a given command. &lt;br /&gt;
    &lt;br /&gt;
    List of possible commands:&lt;br /&gt;
    &lt;br /&gt;
    Name      Aliases          Description&lt;br /&gt;
    =====================================================================&lt;br /&gt;
    disable   dis              Disable block (comments out CMake entries for files) &lt;br /&gt;
    info      getinfo,inf      Return information about a given module &lt;br /&gt;
    remove    rm,del           Remove block (delete files and remove Makefile entries) &lt;br /&gt;
    makexml   mx               Make XML file for GRC block bindings &lt;br /&gt;
    add       insert           Add block to the out-of-tree module. &lt;br /&gt;
    newmod    nm,create        Create a new out-of-tree module &lt;br /&gt;
    rename    mv               Rename a block in the out-of-tree module.&lt;br /&gt;
&lt;br /&gt;
===Creating an RFNoC OOT Module===&lt;br /&gt;
&lt;br /&gt;
To start generating an RFNoC OOT module navigate to the source location ( i.e. &amp;lt;code&amp;gt;cd ~/{USER_PREFIX}/src&amp;lt;/code&amp;gt; ) and type:&lt;br /&gt;
    $ rfnocmodtool newmod [NAME OF THE MODULE]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;code&amp;gt;[NAME OF THE MODULE]&amp;lt;/code&amp;gt; is a name the user gives the new module. In the following, a module is created with the name “&amp;lt;code&amp;gt;tutorial&amp;lt;/code&amp;gt;”. If the user does not write the name of the module following the &amp;lt;code&amp;gt;newmod&amp;lt;/code&amp;gt; command the tool will ask for it interactively. Running this command will create a folder containing the basic folders that you may need for a functional module.&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod tutorial&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    Creating out-of-tree module in ./rfnoc-tutorial... Done.&lt;br /&gt;
    Use 'rfnocmodtool add' to add a new block to this currently empty module.&lt;br /&gt;
&lt;br /&gt;
To see what files and directories were created run:&lt;br /&gt;
&lt;br /&gt;
    $ ls rfnoc-tutorial/&lt;br /&gt;
    apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In contrast with &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt;, this includes a folder called &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt;, which is where the UHD/FPGA files are located.&lt;br /&gt;
&lt;br /&gt;
===Adding custom blocks to OOT Module===&lt;br /&gt;
In order to add blocks to a module, navigate to the folder just created and use the &amp;lt;code&amp;gt;add&amp;lt;/code&amp;gt; command of &amp;lt;code&amp;gt;rfnocmodtool&amp;lt;/code&amp;gt;. Continuing with the example above, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ cd rfnoc-tutorial&lt;br /&gt;
    $ rfnocmodtool add [NAME OF THE BLOCK]&lt;br /&gt;
&lt;br /&gt;
For demonstrative purposes, a block named &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; will be created. The &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block will multiply samples that pass through it by a constant. As before, if the name is not given, the tool will ask the user for the name. There are several arguments that can be passed to the tool, but running the tool without any of these arguments will give the following interactive parsing output:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool add gain&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    RFNoC module name identified: tutorial&lt;br /&gt;
    Block/code identifier: gain&lt;br /&gt;
    Enter valid argument list, including default arguments: &lt;br /&gt;
    Block NoC ID (Hexadecimal): 1111222233334444&lt;br /&gt;
    Skip Block Controllers Generation? [UHD block ctrl files] [y/N] N&lt;br /&gt;
    Skip Block interface files Generation? [GRC block ctrl files] [y/N] N&lt;br /&gt;
&lt;br /&gt;
Hitting &amp;lt;code&amp;gt;enter&amp;lt;/code&amp;gt; on each one of the options will take the default values.&lt;br /&gt;
&lt;br /&gt;
The following is a description of the valid argument list items:&lt;br /&gt;
&lt;br /&gt;
* '''NoC ID:''' This ID is a Hexadecimal number which serves as identification between the hardware part and the software part of the design. It can be as long as 16 0-9 A-F digits. If a NoC ID is not provided, it will be set to a random number.&lt;br /&gt;
&lt;br /&gt;
* '''Block Controllers Generation:''' The block controllers are the C++ control that the user can apply to the UHD-part of the design. In these files, the user can add more control over this layer of the design. Depending on the complexity of the block it may be possible to add all necessary control using NoCScript (more details on NoCScript can be found in the section labeled UHD Integration). In this case the cpp/hpp block control files generation are not needed. Default is to generate as their existence will be ignored if not edited.&lt;br /&gt;
&lt;br /&gt;
* '''Block Interface:''' Add more design specific functionality to the design at the GNU Radio interface by generating these block-interface files and adding necessary logic.  Depending on the complexity of the block it may be possible to add all necessary control using NoC-Script. In this case the block-interface files are not needed. Default is to generate as their existence will be ignored if not edited.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' If the user does not intend to use the block controllers or is not sure if they are needed, the presence of them in the design will do no harm. It is recommended to add them. This leaves the possibility to add more functions inside them in a future stage of development. &lt;br /&gt;
&lt;br /&gt;
After finishing the parsing, the following files will be generated/edited:&lt;br /&gt;
&lt;br /&gt;
    Adding file 'lib/gain_impl.h'...&lt;br /&gt;
    Adding file 'lib/gain_impl.cc'...&lt;br /&gt;
    Adding file 'include/tutorial/gain.h'...&lt;br /&gt;
    Adding file 'include/tutorial/gain_block_ctrl.hpp'...&lt;br /&gt;
    Adding file 'lib/gain_block_ctrl_impl.cpp'...&lt;br /&gt;
    Editing swig/tutorial_swig.i...&lt;br /&gt;
    Adding file 'python/qa_gain.py'...&lt;br /&gt;
    Editing python/CMakeLists.txt...&lt;br /&gt;
    Adding file 'grc/tutorial_gain.xml'...&lt;br /&gt;
    Adding file 'rfnoc/blocks/gain.xml'...&lt;br /&gt;
    Adding file 'rfnoc/fpga-src/noc_block_gain.v'...&lt;br /&gt;
    rfnoc/testbenches/noc_block_gain_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
==Creating FPGA portion of custom RFNoC Block==&lt;br /&gt;
===RFNoC FPGA User Interface (API)===&lt;br /&gt;
RFNoC blocks or Computation Engines (CEs) in the FPGA use a NoC Shell instance to interface with the rest of RFNoC. NoC Shell implements RFNoC's core functionality: packet muxing and demuxing, flow control, and the settings register bus (i.e. write/read control/status registers). The NoC Shell has an interface to the RFNoC AXI stream crossbar and a user interface. NoC Shell AXI stream interfaces expect CHDR packets with a proper header. See the manual for information on [https://files.ettus.com/manual/page_rtp.html CHDR and SID].&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' AXI Stream is an ARM AMBA standard interface. Xilinx has an [http://www.xilinx.com/support/documentation/ip_documentation/ug761_axi_reference_guide.pdf AXI Reference Guide] with more details on this standard.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 4.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
Many designs will want to use an AXI Stream interface with only sample data. However, as stated earlier, the NoC Shell block expects CHDR packets. To ease interfacing user code, the AXI Wrapper block provides the necessary logic to strip and insert the CHDR header, effectively converting packetized sample data into streaming sample data and vice versa. The example RFNoC blocks &amp;lt;code&amp;gt;noc_block_fft.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noc_block_fir.v&amp;lt;/code&amp;gt; show how AXI Wrapper is used to implement existing Xilinx AXI Stream based IP within a computation engine.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' AXI Wrapper also supports AXI Stream buses for configuration. These buses are driven via the setting register bus and do not have back pressure. They also consume two user register addresses per bus.&lt;br /&gt;
&lt;br /&gt;
The primary user interface consists of four AXI stream interfaces ( &amp;lt;code&amp;gt;tready, tvalid, tlast, tdata&amp;lt;/code&amp;gt; ) and a settings register bus ( 8-bit, valid user register addresses: &amp;lt;code&amp;gt;128-255&amp;lt;/code&amp;gt; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
AXI Stream signals:&lt;br /&gt;
* '''m_axis_data_tdata:''' Input sample data packets &lt;br /&gt;
** Data coming from host or another CE&lt;br /&gt;
* '''s_axis_data_tdata:''' Output sample data packets &lt;br /&gt;
** Data going to another CE or host&lt;br /&gt;
* '''m_axis_data_tready:''' Input signal to CE&lt;br /&gt;
** Used to notify CE that downstream CE is ready for data &lt;br /&gt;
* '''s_axis_data_tready:''' Output signal to CE&lt;br /&gt;
** Used to notify upstream CE that CE is ready for data &lt;br /&gt;
* '''m_axis_data_tvalid:''' Input signal to CE&lt;br /&gt;
** Used to indicate upstream CE has valid data &lt;br /&gt;
* '''s_axis_data_tvalid:''' Output signal to CE&lt;br /&gt;
** Used to indicate to downstream CE that CE has valid data &lt;br /&gt;
* '''m_axis_data_tlast:''' Input signal to CE&lt;br /&gt;
** Used to delimit packets from upstream CE &lt;br /&gt;
* '''s_axis_data_tlast:''' Output signal to CE&lt;br /&gt;
** Used to delimit packets to downstream CE&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; |[[File:rfnoc gsg an 5.png|right|500px|]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 6.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Settings Bus signals:&lt;br /&gt;
* '''set_stb:''' Assert to write '''set_data''' to register at '''set_addr'''ess&lt;br /&gt;
* '''set_addr:''' Register address to set&lt;br /&gt;
* '''set_data:''' Data to set&lt;br /&gt;
* '''rb_data:''' Data to read back&lt;br /&gt;
* '''rb_strobe:''' Assert to read '''rb_data''' from register at '''set_addr'''ess&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; |[[File:rfnoc gsg an 7.png|right|500px|]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
For the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; example block the following architecture is desired:&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 8.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;lt;code&amp;gt;rfnoc-tutorial/rfnoc/fpga-src/noc_block_gain.v&amp;lt;/code&amp;gt; that contains the RFNoC block skeleton code that was created when the &amp;lt;code&amp;gt;$ rfnocmodtool add gain&amp;lt;/code&amp;gt; command was run and modify the following ('''BOLD''' indicates changes to the skeleton code).&lt;br /&gt;
&lt;br /&gt;
    '''localparam [7:0] SR_GAIN = SR_USER_REG_BASE;'''&lt;br /&gt;
    localparam [7:0] SR_TEST_REG_1 = SR_USER_REG_BASE + 8'd1;&lt;br /&gt;
    &lt;br /&gt;
    '''wire [15:0] gain;'''&lt;br /&gt;
    '''setting_reg #('''&lt;br /&gt;
      '''.my_addr(SR_GAIN), .awidth(8), .width(16))'''&lt;br /&gt;
    '''sr_gain ('''&lt;br /&gt;
      '''.clk(ce_clk), .rst(ce_rst),'''&lt;br /&gt;
      '''.strobe(set_stb), .addr(set_addr), .in(set_data), .out(gain), .changed());'''&lt;br /&gt;
    &lt;br /&gt;
     always @(posedge ce_clk) begin&lt;br /&gt;
        case(rb_addr)&lt;br /&gt;
          '''8'd0 : rb_data &amp;lt;= {48'd0, gain};'''&lt;br /&gt;
          8'd1 : rb_data &amp;lt;= {32'd0, test_reg_1};&lt;br /&gt;
          default : rb_data &amp;lt;= 64'h0BADC0DE0BADC0DE;&lt;br /&gt;
        endcase&lt;br /&gt;
     end&lt;br /&gt;
     &lt;br /&gt;
     '''wire [31:0] pipe_in_tdata;'''&lt;br /&gt;
     '''wire pipe_in_tvalid, pipe_in_tlast;'''&lt;br /&gt;
     '''wire pipe_in_tready;'''&lt;br /&gt;
 &lt;br /&gt;
     '''wire [31:0] pipe_out_tdata;'''&lt;br /&gt;
     '''wire pipe_out_tvalid, pipe_out_tlast;'''&lt;br /&gt;
     '''wire pipe_out_tready;'''&lt;br /&gt;
 &lt;br /&gt;
     '''// Adding FIFO to ensure Pipeline'''&lt;br /&gt;
     '''axi_fifo_flop #(.WIDTH(32+1))'''&lt;br /&gt;
     '''pipeline0_axi_fifo_flop ('''&lt;br /&gt;
       '''.clk(ce_clk),'''&lt;br /&gt;
       '''.reset(ce_rst),'''&lt;br /&gt;
       '''.clear(clear_tx_seqnum),'''&lt;br /&gt;
       '''.i_tdata({m_axis_data_tlast,m_axis_data_tdata}),'''&lt;br /&gt;
       '''.i_tvalid(m_axis_data_tvalid),'''&lt;br /&gt;
       '''.i_tready(m_axis_data_tready),'''&lt;br /&gt;
       '''.o_tdata({pipe_in_tlast,pipe_in_tdata}),'''&lt;br /&gt;
       '''.o_tvalid(pipe_in_tvalid),'''&lt;br /&gt;
       '''.o_tready(pipe_in_tready));'''  &lt;br /&gt;
 &lt;br /&gt;
     '''wire [15:0] i = pipe_in_tdata[31:16];'''&lt;br /&gt;
     '''wire [15:0] q = pipe_in_tdata[15:0];'''&lt;br /&gt;
 &lt;br /&gt;
     '''wire [31:0] i_mult_gain = i*gain;'''&lt;br /&gt;
     '''wire [31:0] q_mult_gain = q*gain;'''&lt;br /&gt;
 &lt;br /&gt;
     '''wire [31:0] mult_gain = {i_mult_gain[15:0], q_mult_gain[15:0]};'''&lt;br /&gt;
     '''axi_fifo_flop #(.WIDTH(32+1))'''&lt;br /&gt;
     '''pipeline1_axi_fifo_flop ('''&lt;br /&gt;
       '''.clk(ce_clk),'''&lt;br /&gt;
       '''.reset(ce_rst),'''&lt;br /&gt;
       '''.clear(clear_tx_seqnum),'''&lt;br /&gt;
       '''.i_tdata({pipe_in_tlast,mult_gain}),'''&lt;br /&gt;
       '''.i_tvalid(pipe_in_tvalid),'''&lt;br /&gt;
       '''.i_tready(pipe_in_tready),'''&lt;br /&gt;
       '''.o_tdata({pipe_out_tlast,pipe_out_tdata}),'''&lt;br /&gt;
       '''.o_tvalid(pipe_out_tvalid),'''&lt;br /&gt;
       '''.o_tready(pipe_out_tready));'''&lt;br /&gt;
 &lt;br /&gt;
     '''/* Output Signals */'''&lt;br /&gt;
     '''assign pipe_out_tready = s_axis_data_tready;'''&lt;br /&gt;
     '''assign s_axis_data_tvalid = pipe_out_tvalid;'''&lt;br /&gt;
     '''assign s_axis_data_tlast  = pipe_out_tlast;'''&lt;br /&gt;
     '''assign s_axis_data_tdata  = pipe_out_tdata;'''&lt;br /&gt;
&lt;br /&gt;
The following is a block diagram of the code created by the above Verilog:&lt;br /&gt;
&lt;br /&gt;
[[File:gain_block_diagram_v01.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''  In order to meet timing, FIFO blocks were added to either side of the Multiplication process.&lt;br /&gt;
&lt;br /&gt;
===Creating and running HDL testbenches===&lt;br /&gt;
In order to make the coding iteration process more efficient, it is recommended to create testbenches for all RFNoC blocks before compiling them into the FPGA image. This allows for flaw and/or bug detection early in the design. RFNoC Modtool provides the structure and files ( e.g. noc_block_{USER_BLOCK_NAME}_tb ) for the testbenches of each of the OOT blocks that are added with the &amp;lt;code&amp;gt;$ rfnocmodtool add&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
Below is a figure that shows the general testbench architecture  that is created by the RFNoC Modtool. This architecture allows a user to test their custom block in the exact same environment it will be placed in when it is built into the RFNoC architecture. Other benefits of the testbench architecture include:&lt;br /&gt;
* Testing through multiple blocks (e.g. FILTER -&amp;gt; FFT -&amp;gt; AVE) &lt;br /&gt;
* Testing with multiple streams (e.g. RFNoC block ADD/SUB takes 2 streams, one that will have a constant added to it and one that will have a constant subtracted from it)&lt;br /&gt;
* Data transfer abstraction (e.g. RFNoC Sim Lib API calls to &amp;lt;code&amp;gt;tb_streamer.send&amp;lt;/code&amp;gt; and  &amp;lt;code&amp;gt;tb_streamer.recv&amp;lt;/code&amp;gt; which take care of all the AXI stream signaling)&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 9.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The &amp;lt;code&amp;gt;noc_block_tb&amp;lt;/code&amp;gt; block is an instantiation of the &amp;lt;code&amp;gt;noc_block_export_io&amp;lt;/code&amp;gt; that is used in testbenches to communicate to the RFNoC architecture. This makes it possible to talk “RFNoC” to the user’s custom block and as such the custom block has a complete RFNoC experience (signaling, flowcontrol, addressing, etc)&lt;br /&gt;
&lt;br /&gt;
From the [[Getting Started with RFNoC Development#Adding_custom_blocks_to_OOT_Module|Adding custom blocks to OOT Module section]] where the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block was initially created, the last files generated were:&lt;br /&gt;
&lt;br /&gt;
    rfnoc/testbenches/noc_block_gain_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;noc_block_gain_tb&amp;lt;/code&amp;gt; is a folder generated to contain all the files related to the test bench of the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block. Each time a new OOT block is created, a new folder will be generated as well. &lt;br /&gt;
&lt;br /&gt;
Inside of this folder are the following three files:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt:&amp;lt;/code&amp;gt; this is an empty file used, so far, only to increase the scope of the compilers.&lt;br /&gt;
* &amp;lt;code&amp;gt;noc_block_gain_tb.sv:&amp;lt;/code&amp;gt; this is a ''System Verilog'' file, in which user custom tests are to be located.  This is the '''only''' file that needs to be modified.&lt;br /&gt;
* &amp;lt;code&amp;gt;Makefile:&amp;lt;/code&amp;gt; This file determines the directives that run the simulation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;noc_block_gain_tb.sv&amp;lt;/code&amp;gt; testbench skeleton code creates the following architecture:&lt;br /&gt;
&lt;br /&gt;
[[File:testbench_arch_gain_v01.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;lt;code&amp;gt;rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv&amp;lt;/code&amp;gt; and modify the following lines:&lt;br /&gt;
&lt;br /&gt;
Right under the “Verification” section:&lt;br /&gt;
&lt;br /&gt;
    initial begin : tb_main&lt;br /&gt;
      string s;&lt;br /&gt;
      logic [31:0] random_word;&lt;br /&gt;
      logic [63:0] readback;&lt;br /&gt;
      '''logic [15:0] gain;'''&lt;br /&gt;
&lt;br /&gt;
In the “Test 4 -- Write / readback user registers” section:&lt;br /&gt;
    &lt;br /&gt;
    `TEST_CASE_START(&amp;quot;Write / readback user registers&amp;quot;);&lt;br /&gt;
    random_word = $random();&lt;br /&gt;
    '''tb_streamer.write_user_reg(sid_noc_block_gain, noc_block_gain.SR_GAIN, random_word[15:0]);'''&lt;br /&gt;
    '''tb_streamer.read_user_reg(sid_noc_block_gain, 0, readback);'''&lt;br /&gt;
    '''$sformat(s, &amp;quot;User register 0 incorrect readback! Expected: %0d, Actual %0d&amp;quot;, readback[15:0], random_word[15:0]);'''&lt;br /&gt;
    '''`ASSERT_ERROR(readback[15:0] == random_word[15:0], s);'''&lt;br /&gt;
    &lt;br /&gt;
In the “Test 5 -- Test sequence” section:&lt;br /&gt;
&lt;br /&gt;
    `TEST_CASE_START(&amp;quot;Test sequence&amp;quot;);&lt;br /&gt;
    '''gain = 100;'''&lt;br /&gt;
    '''tb_streamer.write_user_reg(sid_noc_block_gain, noc_block_gain.SR_GAIN, gain);'''&lt;br /&gt;
    fork&lt;br /&gt;
      begin&lt;br /&gt;
        cvita_payload_t send_payload;&lt;br /&gt;
        for (int i = 0; i &amp;lt; SPP/2; i++) begin&lt;br /&gt;
          send_payload.push_back(64'(i));&lt;br /&gt;
        end&lt;br /&gt;
        tb_streamer.send(send_payload);&lt;br /&gt;
      end&lt;br /&gt;
      begin&lt;br /&gt;
        cvita_payload_t recv_payload;&lt;br /&gt;
        cvita_metadata_t md;&lt;br /&gt;
        logic [63:0] expected_value;&lt;br /&gt;
        tb_streamer.recv(recv_payload,md);&lt;br /&gt;
        for (int i = 0; i &amp;lt; SPP/2; i++) begin&lt;br /&gt;
          '''expected_value = i*gain;'''&lt;br /&gt;
&lt;br /&gt;
Test #4 verifies that we can write and readback the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; value. Test #5 writes to the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; register, sends a sample set in the form of a ramp (1, 2, 3, 4, etc) to the RFNoC gain block and finally reads the values from the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block and compares them to expected values. The followings steps will allow the user to run this testbench.&lt;br /&gt;
&lt;br /&gt;
From within the &amp;lt;code&amp;gt;rfnoc-tutorial&amp;lt;/code&amp;gt; directory, create a &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory and enter it by running:&lt;br /&gt;
&lt;br /&gt;
    $ mkdir build &amp;amp;&amp;amp; cd build/&lt;br /&gt;
&lt;br /&gt;
The next step is to run &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt;. If PyBOMBS was used to create the development sandbox, &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt; will automatically detect the location of the &amp;lt;code&amp;gt;fpga&amp;lt;/code&amp;gt; repository. If PyBOMBS was not used, the user must provide the location of where the &amp;lt;code&amp;gt;fpga&amp;lt;/code&amp;gt; repository is installed.&lt;br /&gt;
&lt;br /&gt;
If PyBOMBS used, run:&lt;br /&gt;
&lt;br /&gt;
    $ cmake ../&lt;br /&gt;
&lt;br /&gt;
If PyBOMBS not used, run:&lt;br /&gt;
&lt;br /&gt;
    $ cmake [-DUHD_FPGA_DIR=/PATH/TO/FPGA/REPOSITORY] ../&lt;br /&gt;
&lt;br /&gt;
Final output from the &amp;lt;code&amp;gt;$ cmake ../&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
    -- Configuring done&lt;br /&gt;
    -- Generating done&lt;br /&gt;
    -- Build files have been written to: /home/widow/rfnoc/src/rfnoc-tutorial/build&lt;br /&gt;
&lt;br /&gt;
The following command will modify the necessary files and set the correct path to the simulation tools. From now on, every time a new block is added, this command will be run automatically. Remember, only run the following command once for each OOT module (not RFNoC block, but OOT module) created:&lt;br /&gt;
&lt;br /&gt;
    $ make test_tb&lt;br /&gt;
    Scanning dependencies of target test_tb&lt;br /&gt;
    Built target test_tb&lt;br /&gt;
&lt;br /&gt;
Testbenches can be executed by running the command:&lt;br /&gt;
&lt;br /&gt;
    $ make noc_block_[name_of_your_block]_tb &lt;br /&gt;
&lt;br /&gt;
The gain block testbench can be run by running the following command:&lt;br /&gt;
&lt;br /&gt;
    $ make noc_block_gain_tb&lt;br /&gt;
&lt;br /&gt;
The simulation will start.  Final output should look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ========================================================&lt;br /&gt;
    TESTBENCH STARTED: noc_block_gain&lt;br /&gt;
    ========================================================&lt;br /&gt;
    [TEST CASE   1] (t=000000000) BEGIN: Wait for Reset...&lt;br /&gt;
    [TEST CASE   1] (t=000001002) DONE... Passed&lt;br /&gt;
    [TEST CASE   2] (t=000001002) BEGIN: Check NoC ID...&lt;br /&gt;
    Read GAIN NOC ID: 1111222233334444&lt;br /&gt;
    [TEST CASE   2] (t=000001238) DONE... Passed&lt;br /&gt;
    [TEST CASE   3] (t=000001238) BEGIN: Connect RFNoC blocks...&lt;br /&gt;
    Connecting noc_block_tb (SID: 1:0) to noc_block_gain (SID: 0:0)&lt;br /&gt;
    Connecting noc_block_gain (SID: 0:0) to noc_block_tb (SID: 1:0)&lt;br /&gt;
    [TEST CASE   3] (t=000005457) DONE... Passed&lt;br /&gt;
    [TEST CASE   4] (t=000005457) BEGIN: Write / readback user registers...&lt;br /&gt;
    [TEST CASE   4] (t=000006888) DONE... Passed&lt;br /&gt;
    [TEST CASE   5] (t=000006888) BEGIN: Test sequence...&lt;br /&gt;
    [TEST CASE   5] (t=000007633) DONE... Passed&lt;br /&gt;
    ========================================================&lt;br /&gt;
    '''TESTBENCH FINISHED: noc_block_gain'''&lt;br /&gt;
    ''' - Time elapsed:   7700 ns'''             &lt;br /&gt;
    ''' - Tests Expected: 5'''&lt;br /&gt;
    ''' - Tests Run:      5'''&lt;br /&gt;
    ''' - Tests Passed:   5'''&lt;br /&gt;
    '''Result: PASSED'''   &lt;br /&gt;
    ========================================================&lt;br /&gt;
    $finish called at time : 7700 ns : File &amp;quot;/home/widow/rfnoc/src/rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv&amp;quot; Line 10&lt;br /&gt;
    INFO: [USF-XSim-96] XSim completed. Design snapshot 'noc_block_gain_tb_behav' loaded.&lt;br /&gt;
    INFO: [USF-XSim-97] XSim simulation ran for 1000000000us&lt;br /&gt;
    launch_simulation: Time (s): cpu = 00:00:10 ; elapsed = 00:00:12 . Memory (MB): peak = 966.387 ; gain = 54.848 ; free physical = 3080 ; free virtual = 29888&lt;br /&gt;
    # if [string equal $vivado_mode &amp;quot;batch&amp;quot;] {&lt;br /&gt;
    #     puts &amp;quot;BUILDER: Closing project&amp;quot;&lt;br /&gt;
    #     close_project&lt;br /&gt;
    # } else {&lt;br /&gt;
    #     puts &amp;quot;BUILDER: In GUI mode. Leaving project open.&amp;quot;&lt;br /&gt;
    # }&lt;br /&gt;
    BUILDER: Closing project&lt;br /&gt;
    ****** Webtalk v2015.4 (64-bit)&lt;br /&gt;
      **** SW Build 1412921 on Wed Nov 18 09:44:32 MST 2015&lt;br /&gt;
      **** IP Build 1412160 on Tue Nov 17 13:47:24 MST 2015&lt;br /&gt;
        ** Copyright 1986-2015 Xilinx, Inc. All Rights Reserved.&lt;br /&gt;
    &lt;br /&gt;
    source /home/widow/rfnoc/src/rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/xsim_proj/xsim_proj.hw/webtalk/labtool_webtalk.tcl -notrace&lt;br /&gt;
    INFO: [Common 17-206] Exiting Webtalk at Tue Jan 10 23:26:20 2017...&lt;br /&gt;
    INFO: [Common 17-206] Exiting Vivado at Tue Jan 10 23:26:22 2017...&lt;br /&gt;
    Built target noc_block_gain_tb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With every custom block created, a &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; directive will be available to run the simulation from the &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
===Building the FPGA image with a custom user block===&lt;br /&gt;
In this section steps are given on how to initiate an FPGA build while incorporating the user’s custom RFNoC block. The first sections give general information on building RFNoC images. The remaining two sections show how to initiate FPGA builds using a command line interface and using a graphical interface (coming out soon), respectively.&lt;br /&gt;
&lt;br /&gt;
====Discussion on number of blocks in an FPGA image====&lt;br /&gt;
There is a maximum number of blocks that can be added for each device. The maximum amount of computation engines (CEs/RFNoC blocks) that each device can use is 16, but the amount of custom blocks that can be added depends on the device. &lt;br /&gt;
&lt;br /&gt;
If using a device from the X3xx series, from the 16 CEs, there are 6 that will be always added and are not subject to direct customization: 1 CE for the AXI bus, 1 CE for the Ethernet Interface, 2 Radios and 2 Dma FIFOS. Because of this, the application will only allow a number of 10 custom blocks on the X3xx series. &lt;br /&gt;
&lt;br /&gt;
If using a device from the E3xx series, 2 CE engines are always added and are not subject to direct customization: 1 CE for the AXI bus and 1 Radio. This would virtually allow 14 slots for custom blocks. However, given the size of the FPGA on the E3xx series of devices, the application only allows a number of 6 custom blocks. &lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Blocks with higher resource utilization may fill up the FPGA and force the user to include less blocks.&lt;br /&gt;
&lt;br /&gt;
Verify the current maximum values by running the &amp;lt;code&amp;gt;uhd_images_builder.py&amp;lt;/code&amp;gt; utility from the scripts directory.&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&lt;br /&gt;
    $ uhd_image_builder.py --help&lt;br /&gt;
&lt;br /&gt;
====Discussion on FPGA image targets====&lt;br /&gt;
RFNoC target names follow the pattern &amp;lt;code&amp;gt;{DEVICE}_RFNOC_{BUILD_TYPE}&amp;lt;/code&amp;gt; with the following build types: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HG:&amp;lt;/code&amp;gt; 1GigE on SFP+ Port0, 10Gig on SFP+ Port&lt;br /&gt;
* &amp;lt;code&amp;gt;XG:&amp;lt;/code&amp;gt; 10GigE on both SFP+ ports&lt;br /&gt;
* &amp;lt;code&amp;gt;HLS:&amp;lt;/code&amp;gt; Vivado High Level Synthesis enabled&lt;br /&gt;
* &amp;lt;code&amp;gt;sgX:&amp;lt;/code&amp;gt; Speed grade for E300 devices (1 or 3)&lt;br /&gt;
&lt;br /&gt;
Some examples are:&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_XG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_XG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_HLS_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_HLS_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;E310_RFNOC&amp;lt;/code&amp;gt; (this is for the speed grade 1 FPGA version of E310, append &amp;lt;code&amp;gt;_sg3&amp;lt;/code&amp;gt; for speed grade 3)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' E310, E312 and E313 all have the same FPGA hardware and therefore will use the &amp;lt;code&amp;gt;E310_RFNOC_{BUILD_TYPE}&amp;lt;/code&amp;gt; target. USRP E3xx devices have either &amp;lt;code&amp;gt;sg1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sg3&amp;lt;/code&amp;gt; hardware, please visit [http://files.ettus.com/e3xx_images/README here] to find out how to differentiate.&lt;br /&gt;
&lt;br /&gt;
Additional information about the build targets can be found at the build instructions for USRP3, found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here].&lt;br /&gt;
&lt;br /&gt;
====Image building using the command line====&lt;br /&gt;
The script &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; is used to generate the NoC block instantiation file and build the FPGA image. Run the help menu by typing:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&lt;br /&gt;
    $ ./uhd_image_builder.py --help&lt;br /&gt;
         &lt;br /&gt;
    usage: uhd_image_builder.py [-h] [-I INCLUDE_DIR [INCLUDE_DIR ...]]&lt;br /&gt;
                                [-m MAX_NUM_BLOCKS] [--fill-with-fifos]&lt;br /&gt;
                                [-o OUTFILE] [-d DEVICE] [-t TARGET] [-g] [-c]&lt;br /&gt;
                                [blocks [blocks ...]]&lt;br /&gt;
    &lt;br /&gt;
    Generate the NoC block instantiation file&lt;br /&gt;
    &lt;br /&gt;
    positional arguments:&lt;br /&gt;
      blocks                List block names to instantiate.&lt;br /&gt;
    &lt;br /&gt;
    optional arguments:&lt;br /&gt;
      -h, --help            show this help message and exit&lt;br /&gt;
      -I INCLUDE_DIR [INCLUDE_DIR ...], --include-dir INCLUDE_DIR [INCLUDE_DIR ...]&lt;br /&gt;
                            Path directory of the RFNoC Out-of-Tree module&lt;br /&gt;
      -m MAX_NUM_BLOCKS, --max-num-blocks MAX_NUM_BLOCKS&lt;br /&gt;
                            Maximum number of blocks (Max. Allowed for x310|x300:&lt;br /&gt;
                            10, for e300: 6)&lt;br /&gt;
      --fill-with-fifos     If the number of blocks provided was smaller than the&lt;br /&gt;
                            max number, fill the rest with FIFOs&lt;br /&gt;
      -o OUTFILE, --outfile OUTFILE&lt;br /&gt;
                            Output /path/filename - By running this directive, you&lt;br /&gt;
                            won't build your IP&lt;br /&gt;
      -d DEVICE, --device DEVICE&lt;br /&gt;
                            Device to be programmed [x300, x310, e310]&lt;br /&gt;
      -t TARGET, --target TARGET&lt;br /&gt;
                            Build target - image type [X3X0_RFNOC_HG,&lt;br /&gt;
                            X3X0_RFNOC_XG, E310_RFNOC_sg3...]&lt;br /&gt;
      -g, --GUI             Open Vivado GUI during the FPGA building process&lt;br /&gt;
      -c, --clean-all       Cleans the IP before a new build&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are details on the usage of the script which is followed by an example:&lt;br /&gt;
&lt;br /&gt;
'''Blocks:''' The first arguments are the names of RFNoC blocks that the user wants to have compiled into the new image which are separated by a space. They can be custom blocks from the user’s OOT module or from the ones that are provided from Ettus, or a combination. Blocks provided by Ettus Research are listed (among other sources necessary for the FPGA build) in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/lib/rfnoc/Makefile.srcs&amp;lt;/code&amp;gt; file. &lt;br /&gt;
&lt;br /&gt;
These blocks can be identified by the following pattern: &lt;br /&gt;
&lt;br /&gt;
    noc_block_{NAME}.v&lt;br /&gt;
&lt;br /&gt;
However, as all the RFNoC blocks have the same &amp;lt;code&amp;gt;noc_block_&amp;lt;/code&amp;gt; prefix, for simplicity this prefix is omitted when listing the blocks in the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; utility. As an example of the incorrect and correct way of adding blocks, consider the following examples when adding the &amp;lt;code&amp;gt;noc_block_null_source_sink&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noc_block_siggen&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
Incorrect method:  &lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py noc_block_null_source_sink noc_block_siggen ...&lt;br /&gt;
&lt;br /&gt;
Correct method:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py null_source_sink siggen ...&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Blocks generated by the RFNoC Modtool follow the same naming convention.&lt;br /&gt;
&lt;br /&gt;
There is an increasing list of pre-built blocks. Here is a sample:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;axi_fifo_loopback&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;axi_dma_fifo&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fir_filter&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fft&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;null_source_sink&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;schmidl_cox&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;packet_resizer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;split_stream&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;vector_iir&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;addsub&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;window&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;keep_one_in_n&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;pfb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;export_io&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;conv_encoder_qpsk&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;logpwr&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fosphor&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;moving_avg&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ddc&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;duc&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RFNoC related blocks generally reside in &amp;lt;code&amp;gt;fpga/usrp3/lib/rfnoc/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!Block&lt;br /&gt;
!Filename&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FIFO&lt;br /&gt;
|[https://github.com/EttusResearch/fpga/blob/maint/usrp3/lib/rfnoc/noc_block_axi_fifo_loopback.v noc_block_axi_fifo_loopback.v]&lt;br /&gt;
|Simple FIFO loopback / passthrough block.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FFT&lt;br /&gt;
|[https://github.com/EttusResearch/fpga/blob/maint/usrp3/lib/rfnoc/noc_block_fft.v noc_block_fft.v]&lt;br /&gt;
|Xilinx coregen based Fast Fourier Transform up to length 4096.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FIR&lt;br /&gt;
|[https://github.com/EttusResearch/fpga/blob/maint/usrp3/lib/rfnoc/noc_block_fir_filter.v noc_block_fir_filter.v]&lt;br /&gt;
|Xilinx coregen based Finite Impulse Response Filter, 41 taps, reconfigurable tap coefficients.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|Window&lt;br /&gt;
|[https://github.com/EttusResearch/fpga/blob/maint/usrp3/lib/rfnoc/noc_block_window.v noc_block_window.v]&lt;br /&gt;
|Windowing block for use with FFT block.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Vector IIR&lt;br /&gt;
|[https://github.com/EttusResearch/fpga/blob/maint/usrp3/lib/rfnoc/noc_block_vector_iir.v noc_block_vector_iir.v]&lt;br /&gt;
|Single pole IIR with configurable coefficients that filters data along vectors (i.e. parallel streams of samples). Useful with FFT output.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Keep One in N&lt;br /&gt;
|[https://github.com/EttusResearch/fpga/blob/maint/usrp3/lib/rfnoc/noc_block_keep_one_in_n.v noc_block_keep_one_in_n.v]&lt;br /&gt;
|Keeps one packet every N packets.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|AddSub&lt;br /&gt;
|[https://github.com/EttusResearch/fpga/blob/maint/usrp3/lib/rfnoc/noc_block_addsub.v noc_block_addsub.v]&lt;br /&gt;
|Example of using multiple block ports in a single RFNoC block to add and subtract streams.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Null Source Sink&lt;br /&gt;
|[https://github.com/EttusResearch/fpga/blob/maint/usrp3/lib/rfnoc/noc_block_null_source_sink.v noc_block_null_source_sink.v]&lt;br /&gt;
|Generates dummy packets and can consume packets at a configurable rate. Useful for testing.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Packet Resizer&lt;br /&gt;
|[https://github.com/EttusResearch/fpga/blob/maint/usrp3/lib/rfnoc/noc_block_packet_resizer.v noc_block_packet_resizer.v]&lt;br /&gt;
|Resizes input packets to a configurable size (larger or smaller than source packets).&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Split Stream&lt;br /&gt;
|[https://github.com/EttusResearch/fpga/blob/maint/usrp3/lib/rfnoc/noc_block_split_stream.v noc_block_split_stream.v]&lt;br /&gt;
|Replicates an input stream to a configurable number of output streams.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' There is a restriction on the amount of blocks that can added into the FPGA image, see the section in this Application Note labeled [[Getting_Started_with_RFNoC_Development#Discussion_on_number_of_blocks_in_an_FPGA_image|Discussion on number of blocks in an FPGA image]] for more information. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-I INCLUDE_DIR:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; directive provides the path to the users &amp;lt;code&amp;gt;rfnoc/fpga-src&amp;lt;/code&amp;gt; directory which contains the custom blocks. This path is needed by the Xilinx Vivado tool. Inside the &amp;lt;code&amp;gt;fpga-src&amp;lt;/code&amp;gt; directory there is a file called &amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt; that contains the path of the OOT module and a list of all the custom OOT blocks. This is an auto generated file, which is amended every time a new block is added to the OOT module. Manually modifying this file is not recommended. If there are multiple OOT modules with various custom blocks that reside in different directories the way to include them all is by separating the different paths by a space (e.g. &amp;lt;code&amp;gt;-I /first/OOT/path/ /second/OOT/path/&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT:''' Please be sure to terminate the path of your OOT with the &amp;quot;/&amp;quot; character. Otherwise the path might not be recognized.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-d DEVICE:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; directive directs the script on which USRP device the build is for. If no &amp;lt;code&amp;gt;–d&amp;lt;/code&amp;gt; is included the default is &amp;lt;code&amp;gt;–d x310&amp;lt;/code&amp;gt;. Generation-3 USRPs and above all support RFNoC.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-t TARGET:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;–t&amp;lt;/code&amp;gt; directive directs the script on which type of image to build for the chosen device. With each USRP device there are several build options to choose from. Detailed information about the build targets can be found at the build instructions for USRP3, found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here]. If &amp;lt;code&amp;gt;-t&amp;lt;/code&amp;gt; is not included, a default target will be chosen for the given device. For example, the default &amp;lt;code&amp;gt;X310_RFNOC_HG&amp;lt;/code&amp;gt; target builds for the &amp;lt;code&amp;gt;–d x310&amp;lt;/code&amp;gt; device. More details on targets can be found in the section of this Application Note labeled [[Getting Started with RFNoC Development#Discussion_on_FPGA_image_targets|Discussion on FPGA image targets]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-m MAX_NUM_BLOCKS:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;–m&amp;lt;/code&amp;gt; directive specifies the max number of RFNoC blocks to build on the FPGA image. An RFNoC image does not need to fill all available slots with RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--fill-with-fifos:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;--fill-with-fifos&amp;lt;/code&amp;gt; directive will fill the empty RFNoC block slots with FIFOS. As an example, if a user indicates three RFNoC blocks by name and also specifies &amp;lt;code&amp;gt;–m 5&amp;lt;/code&amp;gt; then the other two slots will be filed with FIFOs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-o OUTFILE:&amp;lt;/code&amp;gt; With the &amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; directive, the RFNoC blocks instantiation file is generated and saved at the desired path with the given name for the user to inspect. The FPGA image will NOT build if this directive is provided. The purpose of the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script is to auto generate an instantiation file and populate the source files needed for the Xilinx Vivado tool to build the FPGA image, however, it may be desirable to only see the effect of adding a custom OOT module in the &amp;lt;code&amp;gt;fpga/&amp;lt;/code&amp;gt; directory, or for inspecting the instantiation file. When the directive is not provided the &amp;lt;code&amp;gt;rfnoc_ce_auto_inst_x3x0.v&amp;lt;/code&amp;gt; file is overwritten and the FPGA image build process will start automatically (standard use).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-g, --GUI:&amp;lt;/code&amp;gt; Open Vivado GUI during the FPGA building process&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-c, --clean-all:&amp;lt;/code&amp;gt; Cleans the IP before a new build&lt;br /&gt;
&lt;br /&gt;
Here is how to create an X310 FPGA image incorporating the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block that was created earlier in this Application Note:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts     &lt;br /&gt;
    $ ./uhd_image_builder.py gain ddc fft -I {USER_PREFIX}/src/rfnoc-tutorial/rfnoc/fpga-src/ -d x310 -t X310_RFNOC_HG -m 6 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end of a successful compilation process, write the new image to a USRP. The following command will load the new image. Update the &amp;lt;code&amp;gt;{IP_Address}&amp;lt;/code&amp;gt; of the USRP and &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; to the appropriate values for your configuration before running the command.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args &amp;quot;type=x300,addr={IP_ADDRESS}&amp;quot; --fpga-path {USER_PREFIX}/src/uhd-fpga/usrp3/top/x300/build/usrp_x310_fpga_RFNOC_HG.bit&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' &lt;br /&gt;
* The FPGA image building process may take over an hour.&lt;br /&gt;
&lt;br /&gt;
* FPGA images are specific to the USRP device NOT the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. Additional instructions on flashing a custom image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
&lt;br /&gt;
* [Environment setup] - The &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script will also set up the Xilinx Vivado environment by automatically running the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{device}&amp;lt;/code&amp;gt; directory. The &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script assumes that Xilinx Vivado is installed in the default location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.  If the installation is in a different directory the &amp;lt;code&amp;gt;setupenv_base.sh&amp;lt;/code&amp;gt; script will need to be modified. The script is located at: &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts/setupenv_base.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Besides the custom &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block, a &amp;lt;code&amp;gt;DDC&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FFT&amp;lt;/code&amp;gt; block are also being added along with three &amp;lt;code&amp;gt;FIFOs&amp;lt;/code&amp;gt;.  The &amp;lt;code&amp;gt;DDC&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;FFT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FIFO&amp;lt;/code&amp;gt; blocks are already in the script's path and therefore do not need their path specified (they ship with the Ettus Research FPGA code). The reason three FIFOs are added is because the max number of blocks was specified to be 6 ( &amp;lt;code&amp;gt;-m 6&amp;lt;/code&amp;gt; ) and since only 3 blocks were specifically named the other three slots are filled with FIFOs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 10.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Instructions on flashing the image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series. FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. &lt;br /&gt;
&lt;br /&gt;
Once the newly compiled image is loaded onto a USRP X3xx running the following command will show what RFNoC blocks are available on the FPGA:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * '''Block_0'''&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The reason the custom block is called &amp;lt;code&amp;gt;Block_0&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;gain_0&amp;lt;/code&amp;gt; is because there is still host side software/files that need updated in order for this block to populate it’s proper name. A following section (UHD Integration) will step through the process of updating those host side files.&lt;br /&gt;
&lt;br /&gt;
====Using a graphical interface====&lt;br /&gt;
A graphical user interface for FPGA generation and building is shipped along with the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script. This intuitive application aids in setting up a custom FPGA build. &lt;br /&gt;
&lt;br /&gt;
This utility is located in the same &amp;lt;code&amp;gt;scripts&amp;lt;/code&amp;gt; directory as &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
To run it, enter the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts/&lt;br /&gt;
    $ ./uhd_image_builder_gui&lt;br /&gt;
&lt;br /&gt;
The application will then be launched:&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 11.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''1. Select build target:''' In this panel the available build targets are listed. This list may vary depending on which branch of the FPGA repository this user is using. Only RFNoC targets are listed. The build type descriptions are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HG:&amp;lt;/code&amp;gt; 1GigE on SFP+ Port0, 10Gig on SFP+ Port1&lt;br /&gt;
* &amp;lt;code&amp;gt;XG:&amp;lt;/code&amp;gt; 10GigE on both SFP+ ports&lt;br /&gt;
* &amp;lt;code&amp;gt;HLS:&amp;lt;/code&amp;gt; Vivado High Level Synthesis enabled&lt;br /&gt;
* &amp;lt;code&amp;gt;sgX:&amp;lt;/code&amp;gt; Speed grade for E300 devices (1 or 3)&lt;br /&gt;
&lt;br /&gt;
'''2. List of blocks available:''' In this panel the available blocks are listed that can be included into a custom design. This list separates the RFNoC blocks provided by Ettus Research and the OOT modules and corresponding blocks that the user adds. Given the hardware differences between the X3xx and E3xx devices, this list will dynamically change when a different device is selected from the panel on the left. This implies that it is necessary to add the OOT modules for each device independently. This is accomplished by using the &amp;lt;code&amp;gt;Add OOT Blocks&amp;lt;/code&amp;gt; feature of the application, details of which are explained at #7 (&amp;lt;code&amp;gt;Add OOT Blocks&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
'''3. Blocks in current design:''' This panel will be populated by adding elements from the available blocks. All the blocks listed in here will be compiled into the FPGA custom image. There is a maximum number of blocks that can be added for each device. See the section in this App Note labeled Discussion on number of blocks in an FPGA image for more information. &lt;br /&gt;
&lt;br /&gt;
'''4. Add button (&amp;gt;&amp;gt;):''' Manually add the blocks from the central panel into your design.&lt;br /&gt;
&lt;br /&gt;
'''5. Remove button (&amp;lt;&amp;lt;):''' Remove blocks from the current design (far-left panel)&lt;br /&gt;
&lt;br /&gt;
'''6. Fill with FIFOs:''' By checking this box, the design will fill any available/unspecified block slots with FIFOs. The number of FIFO blocks that will be instantiated is based on the rules of amount of blocks explained at #3. When less than the max amount of blocks are needed for certain implementation, many users choose to fill their design with FIFO blocks. &lt;br /&gt;
&lt;br /&gt;
'''7. Open Vivado GUI:''' Open Vivado GUI during the FPGA building process. This allows the user to save a Vivado project with all IP and work within the Vivado GUI for development.&lt;br /&gt;
&lt;br /&gt;
'''8. Clean IP:''' Cleans the IP before a new build (recompiles all IP).&lt;br /&gt;
&lt;br /&gt;
'''9. Add OOT blocks:''' Manually add RFNoC Modtool-generated OOT modules by pointing the application to the &amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt; file, which is located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/{USER-OOT-moddir}/rfnoc/fpga-srcs/&amp;lt;/code&amp;gt; directory. After adding this file, blocks will appear under “&amp;lt;code&amp;gt;OOT blocks for XXXX devices&amp;lt;/code&amp;gt;”&lt;br /&gt;
&lt;br /&gt;
'''10. Import from GRC:''' If the user has a GNU Radio flowgraph with RFNoC blocks already in it, this application can read what RFNoC blocks are in the flowgraph and populate the &amp;lt;code&amp;gt;Blocks in current design&amp;lt;/code&amp;gt; section of the application with the necessary RFNoC blocks. '''NOTE:''' All RFNoC blocks pulled from a &amp;lt;code&amp;gt;.grc&amp;lt;/code&amp;gt; file must be in the of &amp;lt;code&amp;gt;List of blocks available&amp;lt;/code&amp;gt; before beginning the build.&lt;br /&gt;
&lt;br /&gt;
'''11. Show Instantiation File:''' The application auto-generates the instantiation file that is going to be used by Vivado to build the FPGA image. This instantiation file can be viewed and edited before starting the build by clicking this button. &lt;br /&gt;
&lt;br /&gt;
'''12. Generate .bit file:''' Start the build by clicking this button. &lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' See the latter end of the previous section for additional information on what to expect once the compile has started as well as final output.&lt;br /&gt;
&lt;br /&gt;
==Creating Software/Host portion of custom RFNoC Block==&lt;br /&gt;
Now that the FPGA portion is complete the next step is to add software integration to UHD and GNU Radio as depicted in the RFNoC Stack below.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 12.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
===UHD integration===&lt;br /&gt;
Despite the data processing happening on the FPGA, the host software still has a lot of responsibilities in order for an RFNoC application to function. For example, it needs to know which settings registers are available within an RFNoC block, or what kind of input and output a block has. All of this information goes into the &amp;lt;code&amp;gt;Block Declaration&amp;lt;/code&amp;gt;, which is an XML file that is readable by UHD. Often, some simple logic needs to be embedded in the XML file, which we can do by using a simple scripting language called Noc-Script. Changes to the block declaration file are immediately imported into UHD every time an application is executed, and therefore, no software development toolchain needs to be set up.&lt;br /&gt;
&lt;br /&gt;
The list of things declared by the block declaration file includes:&lt;br /&gt;
&lt;br /&gt;
* Block name and Noc-ID&lt;br /&gt;
* Registers&lt;br /&gt;
* Inputs and outputs (including types)&lt;br /&gt;
&lt;br /&gt;
In some cases, additional C++ code is required to properly control a block from software. In this case, a &amp;lt;code&amp;gt;Block Controller&amp;lt;/code&amp;gt; file is required as well as the declaration file. In most cases, the default block controller provided by UHD is sufficient, so no C++ code needs to be written. Writing custom block controllers requires more effort, and means having to set up a programming toolchain. A common reason to write custom C++ block controllers is if setting a register requires a lot of computation, which is not feasible to do within a block declaration file (e.g., using Noc-Script).&lt;br /&gt;
&lt;br /&gt;
Skeleton code for both the block declaration and the block controller (if required) can be generated through RFNoC Modtool.&lt;br /&gt;
&lt;br /&gt;
Because the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block does not require anything other than simply reading and writing to a single register the default block controller will suffice for this example. However, we will need to add information about the register.&lt;br /&gt;
&lt;br /&gt;
Open the &amp;lt;code&amp;gt;gain.xml&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;/rfnoc-tutorial/rfnoc/blocks&amp;lt;/code&amp;gt; directory and add the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;&amp;lt;!--Default XML file--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;nocblock&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;gain&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;blockname&amp;gt;gain&amp;lt;/blockname&amp;gt;&lt;br /&gt;
      &amp;lt;ids&amp;gt;&lt;br /&gt;
        &amp;lt;id revision=&amp;quot;0&amp;quot;&amp;gt;1111222233334444&amp;lt;/id&amp;gt;&lt;br /&gt;
      &amp;lt;/ids&amp;gt;&lt;br /&gt;
      '''&amp;lt;nowiki&amp;gt;&amp;lt;!-- Registers --&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;registers&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;setreg&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;name&amp;gt;GAIN&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;address&amp;gt;128&amp;lt;/address&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;/setreg&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;/registers&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;nowiki&amp;gt;&amp;lt;!-- Args --&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;args&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;arg&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;name&amp;gt;gain&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;double&amp;lt;/type&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;value&amp;gt;1.0&amp;lt;/value&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;check&amp;gt;GE($gain, 0.0) AND LE($gain, 32767.0)&amp;lt;/check&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;check_message&amp;gt;Invalid gain.&amp;lt;/check_message&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;action&amp;gt;'''&lt;br /&gt;
            '''SR_WRITE(&amp;quot;GAIN&amp;quot;, IROUND($gain))'''&lt;br /&gt;
          '''&amp;lt;/action&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;/arg&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;/args&amp;gt;'''&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!--One input, one output. If this is used, better have all the info the C++ file.--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;ports&amp;gt;&lt;br /&gt;
        &amp;lt;sink&amp;gt;&lt;br /&gt;
          '''&amp;lt;name&amp;gt;in0&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;sc16&amp;lt;/type&amp;gt;'''&lt;br /&gt;
        &amp;lt;/sink&amp;gt;&lt;br /&gt;
        &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
          '''&amp;lt;name&amp;gt;out0&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;sc16&amp;lt;/type&amp;gt;'''&lt;br /&gt;
        &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;/ports&amp;gt;&lt;br /&gt;
    &amp;lt;/nocblock&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GNU Radio Integration===&lt;br /&gt;
GNU Radio is built around the concept of blocks, similarly to RFNoC. When mapping RFNoC into an application, the simple constraint is made that every RFNoC block maps to a single GNU Radio block. Thus, when creating mixed GNU Radio/RFNoC applications, there is a very clear 1:1 mapping between what’s happening in RFNoC and GNU Radio.&lt;br /&gt;
&lt;br /&gt;
Since most RFNoC blocks behave very similar to one another from GNU Radio’s perspective, it is generally not required to write C++ code for another block. Rather, a default block provided by RFNoC can be used with appropriate configuration. However, in some cases it may be desirable or even necessary to write a custom GNU Radio block for more specific controlling of the underlying RFNoC block. GNU Radio allows writing blocks in either C++ or Python, but since UHD and RFNoC do not have a Python API, a custom wrapper for an RFNoC block needs to be written in C++. RFNoC Modtool will create skeleton files for this purpose.&lt;br /&gt;
&lt;br /&gt;
The most popular and effective way to use GNU Radio is through the graphical interface, the GNU Radio Companion (GRC). GRC requires a separate description of every GNU Radio block in order to become available in the graphical UI, and the same is true for an RFNoC block that is wrapped in a GNU Radio block (even if the generic RFNoC block wrapper is used). For GNU Radio 3.7 and earlier, GRC bindings for blocks are written as XML files with interspersed Cheetah or Python statements. For a more detailed tutorial on how to write these files, refer to the [http://gnuradio.org/redmine/projects/gnuradio/wiki GNU Radio Documentation] and associated [http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials tutorials].&lt;br /&gt;
&lt;br /&gt;
====GNU Radio Block Code====&lt;br /&gt;
&lt;br /&gt;
* C++ or Python, although RFNoC blocks need to be written in C++ (if at all)&lt;br /&gt;
* How does GNU Radio interface to RFNoC?&lt;br /&gt;
** via C++ infrastructure code in &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; provides a base RFNoC block class&lt;br /&gt;
** Users extend base class for their RFNoC blocks&lt;br /&gt;
** Many blocks can use base class “as is”&lt;br /&gt;
** No C++ or Python code!&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-tutorial/lib/gain_impl.cc&amp;lt;/code&amp;gt;&lt;br /&gt;
** The gain block does not need anything additional&lt;br /&gt;
&lt;br /&gt;
====GNU Radio Companion Bindings====&lt;br /&gt;
* XML&lt;br /&gt;
* Describes GNU Radio blocks to GRC&lt;br /&gt;
* No recompilation&lt;br /&gt;
* Requirement of GNU Radio Companion&lt;br /&gt;
* Not strictly necessary for GNU Radio&lt;br /&gt;
* Tutorial on how to write them:&lt;br /&gt;
** [http://gnuradio.org/redmine/projects/gnuradio/wiki/GNURadioCompanion http://gnuradio.org/redmine/projects/gnuradio/wiki/GNURadioCompanion ]&lt;br /&gt;
* Skeleton file generated by RFNoC Modtool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Open the &amp;lt;code&amp;gt;tutorial-gain.xml&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;rfnoc-tutorial/grc&amp;lt;/code&amp;gt; directory and edit as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;block&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;RFNoC: gain&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;key&amp;gt;tutorial_gain&amp;lt;/key&amp;gt;&lt;br /&gt;
      &amp;lt;category&amp;gt;tutorial&amp;lt;/category&amp;gt;&lt;br /&gt;
      &amp;lt;import&amp;gt;import tutorial&amp;lt;/import&amp;gt;&lt;br /&gt;
      &amp;lt;make&amp;gt;tutorial.gain(&lt;br /&gt;
        self.device3,&lt;br /&gt;
        uhd.stream_args( \# TX Stream Args&lt;br /&gt;
            cpu_format=&amp;quot;'''fc32'''&amp;quot;,&lt;br /&gt;
            otw_format=&amp;quot;'''sc16'''&amp;quot;,&lt;br /&gt;
            args=&amp;quot;gr_vlen={0},{1}&amp;quot;.format(${grvlen}, &amp;quot;&amp;quot; if $grvlen == 1 else &amp;quot;spp={0}&amp;quot;.format($grvlen)),&lt;br /&gt;
        ),&lt;br /&gt;
        uhd.stream_args( \# RX Stream Args&lt;br /&gt;
            cpu_format=&amp;quot;'''fc32'''&amp;quot;,&lt;br /&gt;
            otw_format=&amp;quot;'''sc16'''&amp;quot;,&lt;br /&gt;
            args=&amp;quot;gr_vlen={0},{1}&amp;quot;.format(${grvlen}, &amp;quot;&amp;quot; if $grvlen == 1 else &amp;quot;spp={0}&amp;quot;.format($grvlen)),&lt;br /&gt;
        ),&lt;br /&gt;
        $block_index, $device_index,&lt;br /&gt;
      )&lt;br /&gt;
    '''self.$(id).set_arg(&amp;quot;gain&amp;quot;, $gain)'''&lt;br /&gt;
      '''&amp;lt;/make&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;callback&amp;gt;set_arg(&amp;quot;gain&amp;quot;, $gain)&amp;lt;/callback&amp;gt;'''&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'param' node for every Parameter you want settable from the GUI.&lt;br /&gt;
           Sub-nodes:&lt;br /&gt;
           * name&lt;br /&gt;
           * key (makes the value accessible as $keyname, e.g. in the make node)&lt;br /&gt;
           * type --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
         .  &lt;br /&gt;
         .&lt;br /&gt;
         .&lt;br /&gt;
    &lt;br /&gt;
        &amp;lt;option&amp;gt;&lt;br /&gt;
          &amp;lt;name&amp;gt;Byte&amp;lt;/name&amp;gt;&lt;br /&gt;
          &amp;lt;key&amp;gt;u8&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;/option&amp;gt;&lt;br /&gt;
      &amp;lt;/param&amp;gt;&lt;br /&gt;
      &amp;lt;param&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;'''Gain'''&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;'''gain'''&amp;lt;/key&amp;gt;&lt;br /&gt;
        '''&amp;lt;value&amp;gt;1.0&amp;lt;/value&amp;gt;'''&lt;br /&gt;
        &amp;lt;type&amp;gt;'''real'''&amp;lt;/type&amp;gt;&lt;br /&gt;
      &amp;lt;/param&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'sink' node per input. Sub-nodes:&lt;br /&gt;
           * name (an identifier for the GUI)&lt;br /&gt;
           * type&lt;br /&gt;
           * vlen&lt;br /&gt;
           * optional (set to 1 for optional inputs) --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;sink&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;in&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''complex'''&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;vlen&amp;gt;$grvlen&amp;lt;/vlen&amp;gt;&lt;br /&gt;
        &amp;lt;domain&amp;gt;rfnoc&amp;lt;/domain&amp;gt;&lt;br /&gt;
      &amp;lt;/sink&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'source' node per output. Sub-nodes:&lt;br /&gt;
           * name (an identifier for the GUI)&lt;br /&gt;
           * type&lt;br /&gt;
           * vlen&lt;br /&gt;
           * optional (set to 1 for optional inputs) --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;out&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''complex'''&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;vlen&amp;gt;$grvlen&amp;lt;/vlen&amp;gt;&lt;br /&gt;
        &amp;lt;domain&amp;gt;rfnoc&amp;lt;/domain&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Indentation spacing is important in the &amp;lt;code&amp;gt;&amp;lt;make&amp;gt;&amp;lt;/code&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
===Compile, Install and Verify===&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/rfnoc-tutorial/build&lt;br /&gt;
    $ make install&lt;br /&gt;
    &lt;br /&gt;
    $ uhd_usrp_probe &lt;br /&gt;
    &lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * '''gain_0'''&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' In the case where the &amp;lt;code&amp;gt;gain_0&amp;lt;/code&amp;gt; does not appear but &amp;lt;code&amp;gt;Block_0&amp;lt;/code&amp;gt; does: Most likely, the XML block declaration file (see [[Getting_Started_with_RFNoC_Development#UHD_integration|UHD Integration]] section) for the block contains a NoC-ID that does not match with any NoC-ID defined in the hardware part of the design. The user has to be certain that the description files are up-to-date and that the NoC-ID matches in the SW and HW side. See the [[Getting_Started_with_RFNoC_Development#UHD_integration|UHD Integration]] section to update those host side files.&lt;br /&gt;
&lt;br /&gt;
==Testing out the custom block==&lt;br /&gt;
At this point the custom &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; RFNoc Block (Computation Engine) can be used within a GNU Radio flowgraph. Below is an example GRC flowgraph using our new block as well as the output application it produces. &lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 13.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Copy Block: In the RFNoC domain, streams of data can not be split as easily as they are in the GNU Radio domain. The “copy” block depicted in the screenshot above serves the function as a stream splitter . It’s main purpose, when “enabled”, is to copy the samples it is getting at its input and putting then into the output, but here it is also serving as a boundary between a RFNoC-domain and a GNURadio-domain. In the flowgraph above. after this boundary is passed, the data stream can easily be split into the two sinks to have them run simultaneously (standard GNU Radio functionality). It is possible to connect the GNU Radio blocks directly to RFNoC blocks without a “copy” block, but only one would work at a time (the other ones would have to be disabled). Another way to split data streams from the RFNoC-domain is to use the ”RFNoC: split stream” block, which would split the streams in the RFNoC domain, but this is not very useful here as we are, in any case, moving into the GNURadio-domain.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 14.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
===Xilinx Vivado===&lt;br /&gt;
====Compile issues====&lt;br /&gt;
=====Synthesis is failing=====&lt;br /&gt;
Verify all the correct Xilinx [[Getting Started with RFNoC Development#Prerequisites|prerequisite software]] is installed.&lt;br /&gt;
&lt;br /&gt;
Additional helpful information can be found in the following Xilinx forum posts:&lt;br /&gt;
* https://forums.xilinx.com/t5/Synthesis/Synthesis-failed-without-reporting-any-error/td-p/686000&lt;br /&gt;
* https://forums.xilinx.com/t5/Installation-and-Licensing/Vivado-on-Linux-synthesis-fails-with-no-error-message/td-p/732143&lt;br /&gt;
&lt;br /&gt;
====Environment Setup====&lt;br /&gt;
The &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script will also set up the Xilinx Vivado environment by automatically running the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{device}&amp;lt;/code&amp;gt; directory. The &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script assumes that Xilinx Vivado is installed in the default location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;. If the installation is in a different directory, then the &amp;lt;code&amp;gt;setupenv_base.sh&amp;lt;/code&amp;gt; script will need to be modified. The script is located at: &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3_rfnoc/tools/scripts/setupenv_base.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reference Files==&lt;br /&gt;
The following reference files are included within the gain_src.tar.gz archive linked below:&lt;br /&gt;
&lt;br /&gt;
* gain.xml		&lt;br /&gt;
* noc_block_gain.v	&lt;br /&gt;
* noc_block_gain_tb.sv	&lt;br /&gt;
* tutorial_gain.xml&lt;br /&gt;
* rfnoc_gain.grc&lt;br /&gt;
&lt;br /&gt;
[[Media:gain src.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
==Links and Additional Resources==&lt;br /&gt;
===RFNoC additional resources===&lt;br /&gt;
* [https://kb.ettus.com/RFNoC RFNoC Software Resources Page]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Intro.pdf RFNoC Introduction]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_FPGA.pdf RFNoC Deep Dive: FPGA]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Host.pdf RFNoC Deep Dive: Host side]&lt;br /&gt;
* [https://www.youtube.com/watch?v=8cPd3t88djE Video: RFNoC presented at Wireless @ Virginia Tech, 2015 ]&lt;br /&gt;
** Explaining the slides of Intro, FPGA and Host presentations above (in that order).&lt;br /&gt;
* [https://www.youtube.com/watch?v=51rpjJ2W0Qs Video: It's the RFNoC Life for Us by Martin Braun at GRCon16, 2016]&lt;br /&gt;
&lt;br /&gt;
===GNU Radio resources===&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules GNU Radio OutOfTree Modules tutorial]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGRFromSource GNU Radio Installation]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/Tutorials GNU Radio Tutorials]&lt;br /&gt;
&lt;br /&gt;
===UHD resources===&lt;br /&gt;
* [https://kb.ettus.com/UHD UHD Software Resources Page]&lt;br /&gt;
* [http://files.ettus.com/manual/md_usrp3_build_instructions.html USRP3 build instructions]&lt;br /&gt;
* [http://files.ettus.com/manual/ UHD Manual]&lt;br /&gt;
&lt;br /&gt;
===Other resources===&lt;br /&gt;
* [https://www.xilinx.com/support/documentation/ip_documentation/ug761_axi_reference_guide.pdf Xilinx - AXI reference guide]&lt;br /&gt;
* [https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux UHD + GNU Radio Application Note (Linux)]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/pybombs/wiki PyBOMBS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=3319</id>
		<title>Getting Started with RFNoC Development</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=3319"/>
				<updated>2017-01-17T01:31:33Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* Verify Environment */ uhd_config_info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-823'''&lt;br /&gt;
&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-07-12&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Martin Braun&amp;lt;br&amp;gt; Nicolas Cuervo&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2017-01-10&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Team&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Added “Digital Gain” example&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This application note guides a user through basic information on the RFNoC architecture, installing necessary software to develop custom RFNoC blocks, also called Computation Engines (CE), and walks through the steps of creating a custom RFNoC block using an example.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
First sections deal with installing tools and validating correct tool installation in order to do RFNoC development. Later sections deal with creating a custom RFNoC block, using the built-in testbench architecture, building an FPGA image with the custom block and finally testing out the new block within GNU Radio.&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
The RFNoC code base is open source, including code that executes on the host, as well as code targeted to the USRP hardware (FPGA and microcontroller firmware). As dual-licensed software, RFNoC is available under the open-source GNU Public License version 3 (GPLv3), as well as an alternative, less-restrictive license offered only by Ettus Research. For more information on our licensing policy, please contact [mailto:info@ettus.com info@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
In order to build custom USRP FPGA images and RFNoC blocks the following hardware and software are needed.&lt;br /&gt;
&lt;br /&gt;
* '''Ubuntu 14.04 or 16.04(preferred):''' Currently PyBOMBS (which can be used to install the ''Software build tools''), works most reliably in Ubuntu, and thus, we recommend using this distribution. Also, a majority of the scripts used during the build process are Linux (Ubuntu) specific. A PC with multiple cores and 8GB+ of RAM is recommended.&lt;br /&gt;
&lt;br /&gt;
* '''Xilinx Vivado tools (ver. 2015.4):''' The specific version depends on the branch and state of the FPGA code. The default install location is &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;. Once all of the Software build tools are installed the specific version for the downloaded code can be found in the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{DEVICE}&amp;lt;/code&amp;gt; directory. Further information can be found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here].&lt;br /&gt;
&lt;br /&gt;
* '''Software build tools:''' If UHD can be or has been compiled from source on the development PC then all the necessary software build components are present (PyBOMBS can be used to set all this up and instructions on how to do so are given in a following step).&lt;br /&gt;
&lt;br /&gt;
* X3xx series or E3xx series device or any future USRP&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
* The edition of Xilinx Vivado that is required will depend on the USRP device.&lt;br /&gt;
** X3xx series devices: Design or System editions.&lt;br /&gt;
** E3xx series devices: Design, System or the free WebPack edition.&lt;br /&gt;
* Other operating systems can be used, but the exact steps on how to proceed are not given in this Application Note.&lt;br /&gt;
* In some Linux distributions (e.g. Ubuntu) &amp;lt;code&amp;gt;dash&amp;lt;/code&amp;gt; is set as default shell, which may cause some issues. It is recommended to set the shell to &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; by running the following commands in the terminal. Choose &amp;lt;code&amp;gt;&amp;lt;No&amp;gt;&amp;lt;/code&amp;gt; when prompted by the first command and the second command will validate the that bash will be used.&lt;br /&gt;
&lt;br /&gt;
    $ sudo dpkg-reconfigure dash&lt;br /&gt;
    $ ll /bin/sh&lt;br /&gt;
&lt;br /&gt;
==Creating a development environment==&lt;br /&gt;
While this Application Note goes through the process of integrating GNU Radio into the RFNoC development flow, it is by no means required to use or develop within the RFNoC framework, but it makes it a great deal easier to use a framework on top of RFNoC for aspects such as visualization and other features. GNU Radio is freely available and more information about it can be found [http://gnuradio.org/ here].&lt;br /&gt;
&lt;br /&gt;
The following software packages are required in order to setup a development environment/sandbox:&lt;br /&gt;
&lt;br /&gt;
* UHD&lt;br /&gt;
* GNU Radio &lt;br /&gt;
* gr-ettus&lt;br /&gt;
&lt;br /&gt;
===Create development environment using PyBOMBS===&lt;br /&gt;
The cleanest way to set this up is to install everything into a dedicated directory. [http://gnuradio.org/redmine/projects/pybombs/wiki PyBOMBS] is the simplest way to do this. If not already installed, PyBOMBS can be setup with the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ sudo apt-get install git&lt;br /&gt;
    $ sudo apt-get install python-setuptools python-dev python-pip build-essential &lt;br /&gt;
    &lt;br /&gt;
    $ sudo pip install git+https://github.com/gnuradio/pybombs.git&lt;br /&gt;
    $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git&lt;br /&gt;
    $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git&lt;br /&gt;
&lt;br /&gt;
These commands will do the following:&lt;br /&gt;
* Install &amp;lt;code&amp;gt;Git&amp;lt;/code&amp;gt;&lt;br /&gt;
* Install &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; and other Python dependencies&lt;br /&gt;
* Install the latest &amp;lt;code&amp;gt;PyBOMBS&amp;lt;/code&amp;gt; from its Git repository&lt;br /&gt;
* Add the &amp;lt;code&amp;gt;gr-recipes&amp;lt;/code&amp;gt; recipes which are used to install GNU Radio specific software&lt;br /&gt;
* Add the &amp;lt;code&amp;gt;ettus&amp;lt;/code&amp;gt; recipes which are used to install Ettus Research specific software&lt;br /&gt;
&lt;br /&gt;
From here, PyBOMBS can be used to setup and install the development environment/sandbox by running the following command:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs prefix init ~/rfnoc -R rfnoc -a rfnoc&lt;br /&gt;
&lt;br /&gt;
This will do the following:&lt;br /&gt;
&lt;br /&gt;
* Create a directory in the user’s home directory called &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; (any valid directory name will work)&lt;br /&gt;
&lt;br /&gt;
* Give the prefix an alias of &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; ( &amp;lt;code&amp;gt;[-a alias]&amp;lt;/code&amp;gt;, e.g. &amp;lt;code&amp;gt;–a rfnoc&amp;lt;/code&amp;gt; ), which would be the name given to this path. This name will be used in further steps that use PyBOMBS. When creating the first prefix and omitting the alias, the prefix will be setup as the default.&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; prefix recipe ( as opposed to a package recipe like &amp;lt;code&amp;gt;gqrx&amp;lt;/code&amp;gt; ) to clone UHD, FPGA, GNU Radio, and gr-ettus sources into the &amp;lt;code&amp;gt;~/rfnoc&amp;lt;/code&amp;gt; directory as well as compile and install all the software&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' A user can specify how many cores are used by builds when using PyBOMBS. The default is set to 4. For example, this will set the number of cores used to 3:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs config makewidth 3&lt;br /&gt;
&lt;br /&gt;
The value will be written into a configuration file and then applied to subsequent PyBOMBS commands. This value can temporarily be overridden for a specific build by specifying the &amp;lt;code&amp;gt;--config makewidth=X&amp;lt;/code&amp;gt; argument, where “&amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;” is an integer number. If the user only has 4 cores it is recommend to use this argument in the pybombs command to limit the number of cores to &amp;lt;4 (e.g. 3) so that the computer stays responsive. Following are 2 examples, one using less cores and the other using more cores:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs --config makewidth=3 prefix init ~/rfnoc -R rfnoc -a rfnoc &lt;br /&gt;
    $ pybombs --config makewidth=7 prefix init ~/rfnoc -R rfnoc -a rfnoc&lt;br /&gt;
&lt;br /&gt;
Then, it is necessary to setup the PyBOMBS environment, so that the system/terminal session will have the environmental variables pointing to this newly created prefix, which is done with the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/rfnoc&lt;br /&gt;
    $ source ./setup_env.sh&lt;br /&gt;
&lt;br /&gt;
Once the previous command is run, this terminal session will have access to the environmental variables that allow the complete use of the set of software that was just installed with PyBOMBS. If access to the software is needed in other terminals the same command must be run within them.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Throughout the rest of this document the term &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; will used at the beginning of different directories. For example, &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&amp;lt;/code&amp;gt; is a directory that contains useful scripts for compiling. The term &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; is used to denote the folders that precede the &amp;lt;code&amp;gt;/src&amp;lt;/code&amp;gt; directory. Examples of what &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; could be: &amp;lt;code&amp;gt;/home/user/rfnoc&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/home/user/myDevfolder/&amp;lt;/code&amp;gt;. On many Linux environments using &amp;lt;code&amp;gt;~/&amp;lt;/code&amp;gt; at the beginning of the target directory path is equivalent to the user’s home directory.( i.e &amp;lt;code&amp;gt;~/&amp;lt;/code&amp;gt; is equal to &amp;lt;code&amp;gt;/home/user/&amp;lt;/code&amp;gt;). So &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; could also look like &amp;lt;code&amp;gt;~/rfnoc&amp;lt;/code&amp;gt;  or &amp;lt;code&amp;gt;~/myDevfolder/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Create the development environment manually===&lt;br /&gt;
As an alternative to using PyBOMBS, manually installing and configuring the software is done by following the individual install notes for [http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGRFromSource GNU Radio], [https://files.ettus.com/manual/page_build_guide.html UHD] and [https://github.com/EttusResearch/gr-ettus gr-ettus] and by making sure they are reachable by linkers and compilers.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The Application Note found [https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux here] goes through the process of manually installing UHD and GNU Radio on Linux platforms.&lt;br /&gt;
&lt;br /&gt;
To manually download the software, use these &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt; commands, which will select the correct branches:&lt;br /&gt;
&lt;br /&gt;
    $ git clone --recursive -b rfnoc-devel https://github.com/EttusResearch/uhd.git &lt;br /&gt;
    $ git clone --recursive -b maint https://github.com/gnuradio/gnuradio.git # master branch is also fine instead of maint&lt;br /&gt;
    $ git clone -b master https://github.com/EttusResearch/gr-ettus.git &lt;br /&gt;
    $ git clone -b rfnoc-devel https://github.com/EttusResearch/fpga.git&lt;br /&gt;
&lt;br /&gt;
If UHD, GNU Radio and/or gr-ettus are already installed, it would be sufficient to checkout the branches mentioned and update them them (&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;). Thereafter, rebuild each of the repositories (rebuild order: UHD, GNU Radio, gr-ettus).&lt;br /&gt;
&lt;br /&gt;
===Verify Environment===&lt;br /&gt;
Running the command “&amp;lt;code&amp;gt;uhd_config_info&amp;lt;/code&amp;gt;” with the “&amp;lt;code&amp;gt;--version&amp;lt;/code&amp;gt;” flag will verify that the installation has been completed successfully.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The version string output from this command may differ, however it should be similar to the output below.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_config_info --version&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-161- g83150fdd&lt;br /&gt;
    &lt;br /&gt;
    4.0.0.rfnoc-devel-161-g83150fdd&lt;br /&gt;
&lt;br /&gt;
===Testing the default FPGA image and building from existing blocks===&lt;br /&gt;
&lt;br /&gt;
It is recommended to spend a moment looking at the Ettus Research default image, which is pre-built with a set of RFNoC blocks, as well as building a custom image with a unique set of pre-built RFNoC blocks. To get the default image(s), run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_images_downloader&lt;br /&gt;
&lt;br /&gt;
Ettus Research will be updating the default image(s) occasionally, and &amp;lt;code&amp;gt;uhd_images_downloader&amp;lt;/code&amp;gt; can be run anytime after running &amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt; and re-installing to pull the most current images. Images are stored in the &amp;lt;code&amp;gt;{USER_PREFIX}/share/uhd/images&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
The following images have the corresponding RFNoC blocks (Computation Engines):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Image Name&lt;br /&gt;
!Included Blocks&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x300_fpga_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x300_fpga_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;2x DDC, 2x DUC&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x300_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x300_fpga_RFNOC_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DUC, DDC (one channel), fosphor, window, fft, 2x AXI FIFOs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DUC, DDC (one channel), fosphor, window, fft, 2x AXI FIFOs, Keep One in N, FIR, Siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_e310_fpga.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_e310_fpga_sg3.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;1x DDC, 1x DUC&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_e310_fpga_RFNOC.bit (sg1 version)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_e310_fpga_RFNOC_sg3.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;fosphor, window, fft, 2x AXI FIFOs, FIR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Instructions on flashing the image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
  &lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device.&lt;br /&gt;
&lt;br /&gt;
By following the steps above the following should now be available:&lt;br /&gt;
* UHD/RFNoC code downloaded and installed&lt;br /&gt;
* FPGA code available&lt;br /&gt;
* A valid RFNoC image on your X3xx or E3xx series device&lt;br /&gt;
&lt;br /&gt;
====Inspect default images====&lt;br /&gt;
Run the following command, with a USRP connected to your PC, to verify current image on the USRP.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
If an RFNoC image was successfully loaded onto the USRP, there will be a lot of output text (RFNoC code is currently very verbose). The final lines of the output should be similar to the following for an USRP X310 ( e.g. &amp;lt;code&amp;gt;usrp_x310_fpga_HG&amp;lt;/code&amp;gt; ):&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * DDC_1&lt;br /&gt;
    |   |   |   * DUC_0&lt;br /&gt;
    |   |   |   * DUC_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Final output for &amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt; image:&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * DUC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * Window_0&lt;br /&gt;
    |   |   |   * FIR_0&lt;br /&gt;
    |   |   |   * SigGen_0&lt;br /&gt;
    |   |   |   * KeepOneInN_0&lt;br /&gt;
    |   |   |   * fosphor_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The actual names and number of blocks can differ. The list of blocks should start with the &amp;lt;code&amp;gt;DmaFIFO_x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Radio_x&amp;lt;/code&amp;gt;, and then a couple more lines of block IDs should follow.&lt;br /&gt;
&lt;br /&gt;
====Build custom image with pre-built RFNoC blocks====&lt;br /&gt;
Because of the growing number of RFNoC blocks, the user has the option to build an FPGA image with a set of pre-built RFNoC blocks of their choosing. The following steps describe the process for doing this and by so doing will also validate proper tool installation. Because compilation can take a couple of hours, it is recommended the user begin this process while continuing the rest of this guide.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA compilations can run in the background, however they are very resource intensive. If the user intents to use the same computer that is compiling to walk through the rest of this Application Note, it is recommended that the computer has plenty of resources.&lt;br /&gt;
&lt;br /&gt;
The script to initiate a compile is called &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt;, and is located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&amp;lt;/code&amp;gt; directory. Run the help menu by typing:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts &lt;br /&gt;
    $ ./uhd_image_builder.py --help&lt;br /&gt;
&lt;br /&gt;
A more detailed discussion of this script is given in an upcoming section. For now, compiling an FPGA image that has 2 RFNoC blocks (&amp;lt;code&amp;gt;window&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fft&amp;lt;/code&amp;gt;) and some &amp;lt;code&amp;gt;FIFOs&amp;lt;/code&amp;gt;, is done by running the script with the following arguments.&lt;br /&gt;
&lt;br /&gt;
Example for an X310 USRP:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py window fft -d x310 -t X310_RFNOC_HG -m 5 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
Example for an E310 USRP with Speed Grade 3 (sg3) FPGA:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py window fft -d e310 -t E310_RFNOC_sg3 -m 5 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
At the end of a successful compilation process, write the new image to a USRP. If the image was compiled for a USRP X310, the following command will load the new image. Update the &amp;lt;code&amp;gt;{IP_Address}&amp;lt;/code&amp;gt; of the USRP and &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; to the appropriate values for your configuration before running the command.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args “type=x300,addr={IP_ADDRESS}” --fpga-path {USER_PREFIX}/src/uhd-fpga/usrp3/top/x300/build/usrp_x310_fpga_RFNOC_HG.bit&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. Additional instructions on flashing a custom image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
&lt;br /&gt;
After the image has been successfully written to the USRP, power-cycle it and run the “&amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;” utility to view the newly compiled blocks.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
The final lines of output for the image built for the X310 is as follows:&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * Window_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
===Getting started with UHD + RFNoC===&lt;br /&gt;
The following new examples included within the &amp;lt;code&amp;gt;rfnoc-devel&amp;lt;/code&amp;gt; branch of UHD, are a good reference on how to use RFNoC from UHD.&lt;br /&gt;
&lt;br /&gt;
The following example is based off of &amp;lt;code&amp;gt;rx_samples_to_file.cpp&amp;lt;/code&amp;gt;. The example can be configured to place an RFNoC block in between the radio and host.&lt;br /&gt;
&lt;br /&gt;
    rfnoc_rx_to_file.cpp&lt;br /&gt;
&lt;br /&gt;
This next example chains a null source to another block and streams the data to the host.&lt;br /&gt;
&lt;br /&gt;
    rfnoc_nullsource_ce_rx.cpp&lt;br /&gt;
&lt;br /&gt;
These examples demonstrate the core features and flexibility of RFNoC.&lt;br /&gt;
&lt;br /&gt;
For more information on UHD and UHD development please refer to the [https://kb.ettus.com/UHD UHD Software Resource page], [https://kb.ettus.com/Getting_Started_with_UHD_and_C%2B%2B Getting Started with UHD and C++ Application Note] or directly to the [http://files.ettus.com/manual/ UHD user manual].&lt;br /&gt;
&lt;br /&gt;
===Getting started with GNU Radio + RFNoC===&lt;br /&gt;
A good way of getting started with RFNoC in a more tangible fashion is to use GNU Radio. The &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; out-of-tree module (OOT) allows a user to use RFNoC blocks in their local GNU Radio / GNU Radio Companion (GRC) installation. This GNU Radio OOT contains blocks that allow you to configure your FPGA through GRC.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' As blocks in the &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; OOT mature, they will be upstreamed to &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt;. Also, &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; is a container used by Ettus Research to disseminate experimental or under-development features for &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt;. It is not a replacement for &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; (in fact, the latter is a requirement for &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;).&lt;br /&gt;
    &lt;br /&gt;
Examples can be run from &amp;lt;code&amp;gt;gr-ettus/examples/rfnoc&amp;lt;/code&amp;gt;, provided that the appropriate RFNoC blocks and compiled into the FPGA image currently running on the USRP.&lt;br /&gt;
&lt;br /&gt;
A couple of rules for building GNU Radio flowgraphs:&lt;br /&gt;
&lt;br /&gt;
* You always need a &amp;lt;code&amp;gt;Device3&amp;lt;/code&amp;gt; object in your flow graph (it does not get connected, see screenshot below).&lt;br /&gt;
* You should have at least two RFNoC blocks connected together, going &amp;lt;code&amp;gt;GNU Radio Block&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;RFNoC Block&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;GNU Radio Block&amp;lt;/code&amp;gt; is not recommended (it will work, but with suboptimal performance).&lt;br /&gt;
&lt;br /&gt;
The GNU Radio flowgraph &amp;lt;code&amp;gt;rfnoc_ddc.grc&amp;lt;/code&amp;gt; is an example that can be run using the default RFNoC image. Below are screenshots of the flowgraph and what it produces.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 1.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Copy Block: In the RFNoC domain, streams of data can not be split as easily as they are in the GNU Radio domain. The “copy” block depicted in the screenshot above serves the function as a stream splitter . It’s main purpose, when “enabled”, is to copy the samples it is getting at its input and putting then into the output, but here it is also serving as a boundary between a RFNoC-domain and a GNURadio-domain. In the flowgraph above. after this boundary is passed, the data stream can easily be split into the two sinks to have them run simultaneously (standard GNU Radio functionality). It is possible to connect the GNU Radio blocks directly to RFNoC blocks without a “copy” block, but only one would work at a time (the other ones would have to be disabled). Another way to split data streams from the RFNoC- domain is to use the ”RFNoC: split stream” block, which would split the streams in the RFNoC domain, but this is not very useful here as we are, in any case, moving into the GNURadio-domain.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 2.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
For more information on GNURadio development please refer to the [http://gnuradio.org/doc/doxygen/ GNURadio user's manual and API].&lt;br /&gt;
&lt;br /&gt;
==Starting a custom RFNoC block using RFNoC Modtool==&lt;br /&gt;
The figure below shows the basic structure of the RFNoC Stack. Corresponding code is needed in each of the three sections in order to build a custom RFNoC block with GNU Radio integration. A tool called RFNoC Modtool was created in order to minimize the effort needed to implement a new RFNoC block. RFNoC Modtool creates a custom GNU Radio OOT module with the basic structure and the necessary files for each of these sections. RFNoC Modtool is currently a part of the GNU Radio OOT module &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 3.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
===RFNoC Modtool Utilization===&lt;br /&gt;
'''NOTE:''' Console outputs may vary depending on the version of UHD the user is running. However, functionality should be the same or similar.&lt;br /&gt;
&lt;br /&gt;
Because the RFNoC Modtool has similar functionality to the &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt; [ [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules gr_modtool] ] provided by GNU Radio, those that have worked with &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt; in the past will find the RFNoC Modtool familiar.&lt;br /&gt;
&lt;br /&gt;
To check the usage of the tool, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool help&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    Usage:&lt;br /&gt;
    rfnocmodtool &amp;lt;command&amp;gt; [options] -- Run &amp;lt;command&amp;gt; with the given options.&lt;br /&gt;
    rfnocmodtool help -- Show a list of commands.&lt;br /&gt;
    rfnocmodtool help &amp;lt;command&amp;gt; -- Shows the help for a given command. &lt;br /&gt;
    &lt;br /&gt;
    List of possible commands:&lt;br /&gt;
    &lt;br /&gt;
    Name      Aliases          Description&lt;br /&gt;
    =====================================================================&lt;br /&gt;
    disable   dis              Disable block (comments out CMake entries for files) &lt;br /&gt;
    info      getinfo,inf      Return information about a given module &lt;br /&gt;
    remove    rm,del           Remove block (delete files and remove Makefile entries) &lt;br /&gt;
    makexml   mx               Make XML file for GRC block bindings &lt;br /&gt;
    add       insert           Add block to the out-of-tree module. &lt;br /&gt;
    newmod    nm,create        Create a new out-of-tree module &lt;br /&gt;
    rename    mv               Rename a block in the out-of-tree module.&lt;br /&gt;
&lt;br /&gt;
===Creating an RFNoC OOT Module===&lt;br /&gt;
&lt;br /&gt;
To start generating an RFNoC OOT module navigate to the source location ( i.e. &amp;lt;code&amp;gt;cd ~/{USER_PREFIX}/src&amp;lt;/code&amp;gt; ) and type:&lt;br /&gt;
    $ rfnocmodtool newmod [NAME OF THE MODULE]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;code&amp;gt;[NAME OF THE MODULE]&amp;lt;/code&amp;gt; is a name the user gives the new module. In the following, a module is created with the name “&amp;lt;code&amp;gt;tutorial&amp;lt;/code&amp;gt;”. If the user does not write the name of the module following the &amp;lt;code&amp;gt;newmod&amp;lt;/code&amp;gt; command the tool will ask for it interactively. Running this command will create a folder containing the basic folders that you may need for a functional module.&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod tutorial&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    Creating out-of-tree module in ./rfnoc-tutorial... Done.&lt;br /&gt;
    Use 'rfnocmodtool add' to add a new block to this currently empty module.&lt;br /&gt;
&lt;br /&gt;
To see what files and directories were created run:&lt;br /&gt;
&lt;br /&gt;
    $ ls rfnoc-tutorial/&lt;br /&gt;
    apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In contrast with &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt;, this includes a folder called &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt;, which is where the UHD/FPGA files are located.&lt;br /&gt;
&lt;br /&gt;
===Adding custom blocks to OOT Module===&lt;br /&gt;
In order to add blocks to your module, navigate to the folder just created and use the &amp;lt;code&amp;gt;add&amp;lt;/code&amp;gt; command of &amp;lt;code&amp;gt;rfnocmodtool&amp;lt;/code&amp;gt;. Continuing with the example above, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ cd rfnoc-tutorial&lt;br /&gt;
    $ rfnocmodtool add [NAME OF THE BLOCK]&lt;br /&gt;
&lt;br /&gt;
For demonstrative purposes, a block named &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; will be created. The &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block will multiply samples that pass through it by a constant. As before, if the name is not given, the tool will ask the user for the name. There are several arguments that can be passed to the tool, but running the tool without any of these arguments will give the following interactive parsing output:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool add gain&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    RFNoC module name identified: tutorial&lt;br /&gt;
    Block/code identifier: gain&lt;br /&gt;
    Enter valid argument list, including default arguments: &lt;br /&gt;
    Add Python QA code? [Y/n] Y&lt;br /&gt;
    Add C++ QA code? [y/N] N&lt;br /&gt;
    Block NoC ID (Hexadecimal): 1111222233334444&lt;br /&gt;
    Skip Block Controllers Generation? [UHD block ctrl files] [y/N] N&lt;br /&gt;
    Skip Block interface files Generation? [GRC block ctrl files] [y/N] N&lt;br /&gt;
&lt;br /&gt;
Hitting &amp;lt;code&amp;gt;enter&amp;lt;/code&amp;gt; on each one of the options will take the default values.&lt;br /&gt;
&lt;br /&gt;
The following is a description of the valid argument list items:&lt;br /&gt;
&lt;br /&gt;
* '''Add Python QA code:''' Not used.&lt;br /&gt;
&lt;br /&gt;
* '''Add C++ QA code:''' Not used.&lt;br /&gt;
&lt;br /&gt;
* '''NoC ID:''' This ID is a Hexadecimal number which serves as identification between the hardware part and the software part of the design. It can be as long as 16 0-9 A-F digits. If a NoC ID is not provided, it will be set to a random number.&lt;br /&gt;
&lt;br /&gt;
* '''Block Controllers Generation:''' The block controllers are the C++ control that the user can apply to the UHD-part of the design. In these files, the user can add more control over this layer of the design. Depending on the complexity of the block it may be possible to add all necessary control using NoCScript (more details on NoCScript can be found in the section labeled UHD Integration). In this case the cpp/hpp block control files generation are not needed. Default is to generate as their existence will be ignored if not edited.&lt;br /&gt;
&lt;br /&gt;
* '''Block Interface:''' Add more design specific functionality to the design at the GNU Radio interface by generating these block-interface files and adding necessary logic.  Depending on the complexity of the block it may be possible to add all necessary control using NoC-Script. In this case the block-interface files are not needed. Default is to generate as their existence will be ignored if not edited.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' If the user does not intend to use the block controllers or is not sure if they are needed, the presence of them in the design will do no harm. It is recommended to add them. This leaves the possibility to add more functions inside them in a future stage of development. &lt;br /&gt;
&lt;br /&gt;
After finishing the parsing, the following files will be generated/edited:&lt;br /&gt;
&lt;br /&gt;
    Adding file 'lib/gain_impl.h'...&lt;br /&gt;
    Adding file 'lib/gain_impl.cc'...&lt;br /&gt;
    Adding file 'include/tutorial/gain.h'...&lt;br /&gt;
    Adding file 'include/tutorial/gain_block_ctrl.hpp'...&lt;br /&gt;
    Adding file 'lib/gain_block_ctrl_impl.cpp'...&lt;br /&gt;
    Editing swig/tutorial_swig.i...&lt;br /&gt;
    Adding file 'python/qa_gain.py'...&lt;br /&gt;
    Editing python/CMakeLists.txt...&lt;br /&gt;
    Adding file 'grc/tutorial_gain.xml'...&lt;br /&gt;
    Adding file 'rfnoc/blocks/gain.xml'...&lt;br /&gt;
    Adding file 'rfnoc/fpga-src/noc_block_gain.v'...&lt;br /&gt;
    rfnoc/testbenches/noc_block_gain_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
==Creating FPGA portion of custom RFNoC Block==&lt;br /&gt;
===RFNoC FPGA User Interface (API)===&lt;br /&gt;
RFNoC blocks or Computation Engines (CEs) in the FPGA use a NoC Shell instance to interface with the rest of RFNoC. NoC Shell implements RFNoC's core functionality: packet muxing and demuxing, flow control, and the settings register bus (i.e. write/read control/status registers). The NoC Shell has an interface to the RFNoC AXI stream crossbar and a user interface. NoC Shell AXI stream interfaces expect CHDR packets with a proper header. See the manual for information on [https://files.ettus.com/manual/page_rtp.html CHDR and SID].&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' AXI Stream is an ARM AMBA standard interface. Xilinx has an [http://www.xilinx.com/support/documentation/ip_documentation/ug761_axi_reference_guide.pdf AXI Reference Guide] with more details on this standard.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 4.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
Many designs will want to use an AXI Stream interface with only sample data. However, as stated earlier, the NoC Shell block expects CHDR packets. To ease interfacing user code, the AXI Wrapper block provides the necessary logic to strip and insert the CHDR header, effectively converting packetized sample data into streaming sample data and vice versa. The example RFNoC blocks &amp;lt;code&amp;gt;noc_block_fft.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noc_block_fir.v&amp;lt;/code&amp;gt; show how AXI Wrapper is used to implement existing Xilinx AXI Stream based IP within a computation engine.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' AXI Wrapper also supports AXI Stream buses for configuration. These buses are driven via the setting register bus and do not have back pressure. They also consume two user register addresses per bus.&lt;br /&gt;
&lt;br /&gt;
The primary user interface consists of four AXI stream interfaces ( &amp;lt;code&amp;gt;tready, tvalid, tlast, tdata&amp;lt;/code&amp;gt; ) and a settings register bus ( 8-bit, valid user register addresses: &amp;lt;code&amp;gt;128-255&amp;lt;/code&amp;gt; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
AXI Stream signals:&lt;br /&gt;
* '''m_axis_data_tdata:''' Input sample data packets &lt;br /&gt;
** Data coming from host or another CE&lt;br /&gt;
* '''s_axis_data_tdata:''' Output sample data packets &lt;br /&gt;
** Data going to another CE or host&lt;br /&gt;
* '''m_axis_data_tready:''' Input signal to CE&lt;br /&gt;
** Used to notify CE that downstream CE is ready for data &lt;br /&gt;
* '''s_axis_data_tready:''' Output signal to CE&lt;br /&gt;
** Used to notify upstream CE that CE is ready for data &lt;br /&gt;
* '''m_axis_data_tvalid:''' Input signal to CE&lt;br /&gt;
** Used to indicate upstream CE has valid data &lt;br /&gt;
* '''s_axis_data_tvalid:''' Output signal to CE&lt;br /&gt;
** Used to indicate to downstream CE that CE has valid data &lt;br /&gt;
* '''m_axis_data_tlast:''' Input signal to CE&lt;br /&gt;
** Used to delimit packets from upstream CE &lt;br /&gt;
* '''s_axis_data_tlast:''' Output signal to CE&lt;br /&gt;
** Used to delimit packets to downstream CE&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; |[[File:rfnoc gsg an 5.png|right|500px|]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 6.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Settings Bus signals:&lt;br /&gt;
* '''set_stb:''' Assert to write '''set_data''' to register at '''set_addr'''ess&lt;br /&gt;
* '''set_addr:''' Register address to set&lt;br /&gt;
* '''set_data:''' Data to set&lt;br /&gt;
* '''rb_data:''' Data to read back&lt;br /&gt;
* '''rb_strobe:''' Assert to read '''rb_data''' from register at '''set_addr'''ess&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; |[[File:rfnoc gsg an 7.png|right|500px|]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
For the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; example block the following architecture is desired (the blue signal has both “I” and “Q” data):&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 8.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;lt;code&amp;gt;rfnoc-tutorial/rfnoc/fpga-src/noc_block_gain.v&amp;lt;/code&amp;gt; that contains the RFNoC block skeleton code that was created when the &amp;lt;code&amp;gt;$ rfnocmodtool add gain&amp;lt;/code&amp;gt; command was run and modify the following sections.&lt;br /&gt;
&lt;br /&gt;
For the setting register that will hold the constant value as well as the read back register:&lt;br /&gt;
&lt;br /&gt;
    '''localparam [7:0] SR_GAIN = SR_USER_REG_BASE;'''&lt;br /&gt;
    localparam [7:0] SR_TEST_REG_1 = SR_USER_REG_BASE + 8'd1;&lt;br /&gt;
    &lt;br /&gt;
    '''wire [15:0] gain;'''&lt;br /&gt;
    '''setting_reg #('''&lt;br /&gt;
      '''.my_addr(SR_GAIN), .awidth(8), .width(16))'''&lt;br /&gt;
    '''sr_gain ('''&lt;br /&gt;
      '''.clk(ce_clk), .rst(ce_rst),'''&lt;br /&gt;
      '''.strobe(set_stb), .addr(set_addr), .in(set_data), .out(gain), .changed());'''&lt;br /&gt;
    &lt;br /&gt;
     always @(posedge ce_clk) begin&lt;br /&gt;
        case(rb_addr)&lt;br /&gt;
          '''8'd0 : rb_data &amp;lt;= {48'd0, gain};'''&lt;br /&gt;
          8'd1 : rb_data &amp;lt;= {32'd0, test_reg_1};&lt;br /&gt;
          default : rb_data &amp;lt;= 64'h0BADC0DE0BADC0DE;&lt;br /&gt;
        endcase&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And for the processing section:&lt;br /&gt;
&lt;br /&gt;
    assign m_axis_data_tready = s_axis_data_tready;&lt;br /&gt;
    assign s_axis_data_tvalid = m_axis_data_tvalid;&lt;br /&gt;
    assign s_axis_data_tlast = m_axis_data_tlast;&lt;br /&gt;
    &lt;br /&gt;
    '''wire [15:0] i = m_axis_data_tdata[31:16];'''&lt;br /&gt;
    '''wire [15:0] q = m_axis_data_tdata[15:0];'''&lt;br /&gt;
    &lt;br /&gt;
    '''wire [31:0] i_mult_gain = i*gain;'''&lt;br /&gt;
    '''wire [31:0] q_mult_gain = q*gain;'''&lt;br /&gt;
    &lt;br /&gt;
    '''assign s_axis_data_tdata = {i_mult_gain[15:0], q_mult_gain[15:0]};'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''  Because the multiplication process can occur in the same clock cycle there is no need for handshaking with the AXI &amp;lt;code&amp;gt;tready, tvalid  and tlast&amp;lt;/code&amp;gt; signals and therefore they are simply passed through the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; RFNoC block.&lt;br /&gt;
&lt;br /&gt;
===Creating and running HDL testbenches===&lt;br /&gt;
In order to make the coding iteration process more efficient, it is recommended to create testbenches for all RFNoC blocks before compiling them into the FPGA image. This allows for flaw and/or bug detection early in the design. RFNoC Modtool provides the structure and files ( e.g. &amp;lt;code&amp;gt;noc_block_{USER_BLOCK_NAME}_tb&amp;lt;/code&amp;gt; ) for the testbenches of each of the OOT blocks that are added with the &amp;lt;code&amp;gt;$ rfnocmodtool add&amp;lt;/code&amp;gt; command. &lt;br /&gt;
&lt;br /&gt;
Below is a figure that shows the structure of the testbench created by the RFNoC Modtool.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 9.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
From the [[Getting Started with RFNoC Development#Adding_custom_blocks_to_OOT_Module|Adding custom blocks to OOT Module section]] where the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block was initially created, the last files generated were:&lt;br /&gt;
&lt;br /&gt;
    rfnoc/testbenches/noc_block_gain_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;noc_block_gain_tb&amp;lt;/code&amp;gt; is a folder generated to contain all the files related to the test bench of the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block. Each time a new OOT block is created, a new folder will be generated as well. &lt;br /&gt;
&lt;br /&gt;
Inside of this folder are the following three files:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt:&amp;lt;/code&amp;gt; this is an empty file used, so far, only to increase the scope of the compilers.&lt;br /&gt;
* &amp;lt;code&amp;gt;noc_block_gain_tb.sv:&amp;lt;/code&amp;gt; this is a ''System Verilog'' file, in which user custom tests are to be located.  This is the '''only''' file that needs to be modified.&lt;br /&gt;
* &amp;lt;code&amp;gt;Makefile:&amp;lt;/code&amp;gt; This file determines the directives that run the simulation.&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;lt;code&amp;gt;rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv&amp;lt;/code&amp;gt; and modify the following lines:&lt;br /&gt;
&lt;br /&gt;
    initial begin : tb_main&lt;br /&gt;
      string s;&lt;br /&gt;
      logic [31:0] random_word;&lt;br /&gt;
      logic [63:0] readback;&lt;br /&gt;
      '''logic [15:0] gain;'''&lt;br /&gt;
    &lt;br /&gt;
    `TEST_CASE_START(&amp;quot;Write / readback user registers&amp;quot;);&lt;br /&gt;
    random_word = $random();&lt;br /&gt;
    '''tb_streamer.write_user_reg(sid_noc_block_gain, noc_block_gain.SR_GAIN, random_word[15:0]);&lt;br /&gt;
    tb_streamer.read_user_reg(sid_noc_block_gain, 0, readback);&lt;br /&gt;
    $sformat(s, &amp;quot;User register 0 incorrect readback! Expected: %0d, Actual %0d&amp;quot;, readback[15:0], random_word[15:0]);&lt;br /&gt;
    `ASSERT_ERROR(readback[15:0] == random_word[15:0], s);'''&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    `TEST_CASE_START(&amp;quot;Test sequence&amp;quot;);&lt;br /&gt;
    '''gain = 100;'''&lt;br /&gt;
    '''tb_streamer.write_user_reg(sid_noc_block_gain, noc_block_gain.SR_GAIN, gain);'''&lt;br /&gt;
      fork&lt;br /&gt;
        begin&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    tb_streamer.recv(recv_payload,md);&lt;br /&gt;
      for (int i = 0; i &amp;lt; SPP/2; i++) begin&lt;br /&gt;
        '''expected_value = i*gain;'''&lt;br /&gt;
&lt;br /&gt;
Create a &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory, verify directory location is &amp;lt;code&amp;gt;rfnoc-tutorial&amp;lt;/code&amp;gt; and run:&lt;br /&gt;
&lt;br /&gt;
    $ mkdir build &amp;amp;&amp;amp; cd build/&lt;br /&gt;
&lt;br /&gt;
The next step is to run &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt;. If PyBOMBS was used to create the development sandbox, &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt; will automatically detect the location of the &amp;lt;code&amp;gt;fpga&amp;lt;/code&amp;gt; repository. If PyBOMBS was not used, the user must provide the location of where the &amp;lt;code&amp;gt;fpga&amp;lt;/code&amp;gt; repository is installed.&lt;br /&gt;
&lt;br /&gt;
If PyBOMBS used, run:&lt;br /&gt;
&lt;br /&gt;
    $ cmake ../&lt;br /&gt;
&lt;br /&gt;
If PyBOMBS not used, run:&lt;br /&gt;
&lt;br /&gt;
    $ cmake [-DUHD_FPGA_DIR=/PATH/TO/FPGA/REPOSITORY] ../&lt;br /&gt;
&lt;br /&gt;
Final output from the &amp;lt;code&amp;gt;$ cmake ../&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
    -- Configuring done&lt;br /&gt;
    -- Generating done&lt;br /&gt;
    -- Build files have been written to: /home/widow/rfnoc/src/rfnoc-tutorial/build&lt;br /&gt;
&lt;br /&gt;
The following command will modify the necessary files and set the correct path to the simulation tools. From now on, every time a new block is added, this command will be run automatically. Remember, only run the following command once for each OOT module (not RFNoC block, but OOT module) created:&lt;br /&gt;
&lt;br /&gt;
    $ make test_tb&lt;br /&gt;
    Scanning dependencies of target test_tb&lt;br /&gt;
    Built target test_tb&lt;br /&gt;
&lt;br /&gt;
Testbenches can be executed by running the command:&lt;br /&gt;
&lt;br /&gt;
    $ make noc_block_[name_of_your_block]_tb &lt;br /&gt;
&lt;br /&gt;
The gain block testbench can be run by running the following command:&lt;br /&gt;
&lt;br /&gt;
    $ make noc_block_gain_tb&lt;br /&gt;
&lt;br /&gt;
The simulation will start.  Final output should look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ========================================================&lt;br /&gt;
    TESTBENCH STARTED: noc_block_gain&lt;br /&gt;
    ========================================================&lt;br /&gt;
    [TEST CASE   1] (t=000000000) BEGIN: Wait for Reset...&lt;br /&gt;
    [TEST CASE   1] (t=000001002) DONE... Passed&lt;br /&gt;
    [TEST CASE   2] (t=000001002) BEGIN: Check NoC ID...&lt;br /&gt;
    Read GAIN NOC ID: 1111222233334444&lt;br /&gt;
    [TEST CASE   2] (t=000001238) DONE... Passed&lt;br /&gt;
    [TEST CASE   3] (t=000001238) BEGIN: Connect RFNoC blocks...&lt;br /&gt;
    Connecting noc_block_tb (SID: 1:0) to noc_block_gain (SID: 0:0)&lt;br /&gt;
    Connecting noc_block_gain (SID: 0:0) to noc_block_tb (SID: 1:0)&lt;br /&gt;
    [TEST CASE   3] (t=000005457) DONE... Passed&lt;br /&gt;
    [TEST CASE   4] (t=000005457) BEGIN: Write / readback user registers...&lt;br /&gt;
    [TEST CASE   4] (t=000006888) DONE... Passed&lt;br /&gt;
    [TEST CASE   5] (t=000006888) BEGIN: Test sequence...&lt;br /&gt;
    [TEST CASE   5] (t=000007633) DONE... Passed&lt;br /&gt;
    ========================================================&lt;br /&gt;
    '''TESTBENCH FINISHED: noc_block_gain'''&lt;br /&gt;
    ''' - Time elapsed:   7700 ns'''             &lt;br /&gt;
    ''' - Tests Expected: 5'''&lt;br /&gt;
    ''' - Tests Run:      5'''&lt;br /&gt;
    ''' - Tests Passed:   5'''&lt;br /&gt;
    '''Result: PASSED'''   &lt;br /&gt;
    ========================================================&lt;br /&gt;
    $finish called at time : 7700 ns : File &amp;quot;/home/widow/rfnoc/src/rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv&amp;quot; Line 10&lt;br /&gt;
    INFO: [USF-XSim-96] XSim completed. Design snapshot 'noc_block_gain_tb_behav' loaded.&lt;br /&gt;
    INFO: [USF-XSim-97] XSim simulation ran for 1000000000us&lt;br /&gt;
    launch_simulation: Time (s): cpu = 00:00:10 ; elapsed = 00:00:12 . Memory (MB): peak = 966.387 ; gain = 54.848 ; free physical = 3080 ; free virtual = 29888&lt;br /&gt;
    # if [string equal $vivado_mode &amp;quot;batch&amp;quot;] {&lt;br /&gt;
    #     puts &amp;quot;BUILDER: Closing project&amp;quot;&lt;br /&gt;
    #     close_project&lt;br /&gt;
    # } else {&lt;br /&gt;
    #     puts &amp;quot;BUILDER: In GUI mode. Leaving project open.&amp;quot;&lt;br /&gt;
    # }&lt;br /&gt;
    BUILDER: Closing project&lt;br /&gt;
    ****** Webtalk v2015.4 (64-bit)&lt;br /&gt;
      **** SW Build 1412921 on Wed Nov 18 09:44:32 MST 2015&lt;br /&gt;
      **** IP Build 1412160 on Tue Nov 17 13:47:24 MST 2015&lt;br /&gt;
        ** Copyright 1986-2015 Xilinx, Inc. All Rights Reserved.&lt;br /&gt;
    &lt;br /&gt;
    source /home/widow/rfnoc/src/rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/xsim_proj/xsim_proj.hw/webtalk/labtool_webtalk.tcl -notrace&lt;br /&gt;
    INFO: [Common 17-206] Exiting Webtalk at Tue Jan 10 23:26:20 2017...&lt;br /&gt;
    INFO: [Common 17-206] Exiting Vivado at Tue Jan 10 23:26:22 2017...&lt;br /&gt;
    Built target noc_block_gain_tb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With every custom block created, a &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; directive will be available to run the simulation from the &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
===Building the FPGA image with a custom user block===&lt;br /&gt;
In this section steps are given on how to initiate an FPGA build while incorporating the user’s custom RFNoC block. The first sections give general information on building RFNoC images. The remaining two sections show how to initiate FPGA builds using a command line interface and using a graphical interface (coming out soon), respectively.&lt;br /&gt;
&lt;br /&gt;
====Discussion on number of blocks in an FPGA image====&lt;br /&gt;
There is a maximum number of blocks that can be added for each device. The maximum amount of computation engines (CEs/RFNoC blocks) that each device can use is 16, but the amount of custom blocks that can be added depends on the device. &lt;br /&gt;
&lt;br /&gt;
If using a device from the X3xx series, from the 16 CEs, there are 6 that will be always added and are not subject to direct customization: 1 CE for the AXI bus, 1 CE for the Ethernet Interface, 2 Radios and 2 Dma FIFOS. Because of this, the application will only allow a number of 10 custom blocks on the X3xx series. &lt;br /&gt;
&lt;br /&gt;
If using a device from the E3xx series, 2 CE engines are always added and are not subject to direct customization: 1 CE for the AXI bus and 1 Radio. This would virtually allow 14 slots for custom blocks. However, given the size of the FPGA on the E3xx series of devices, the application only allows a number of 6 custom blocks. &lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Blocks with higher resource utilization may fill up the FPGA and force the user to include less blocks.&lt;br /&gt;
&lt;br /&gt;
Verify the current maximum values by running the &amp;lt;code&amp;gt;uhd_images_builder.py&amp;lt;/code&amp;gt; utility from the scripts directory.&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&lt;br /&gt;
    $ uhd_image_builder.py --help&lt;br /&gt;
&lt;br /&gt;
====Discussion on FPGA image targets====&lt;br /&gt;
RFNoC target names follow the pattern &amp;lt;code&amp;gt;{DEVICE}_RFNoC_{BUILD_TYPE}&amp;lt;/code&amp;gt; with the following build types: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HG:&amp;lt;/code&amp;gt; 1GigE on SFP+ Port0, 10Gig on SFP+ Port&lt;br /&gt;
* &amp;lt;code&amp;gt;XG:&amp;lt;/code&amp;gt; 10GigE on both SFP+ ports&lt;br /&gt;
* &amp;lt;code&amp;gt;HLS:&amp;lt;/code&amp;gt; Vivado High Level Synthesis enabled&lt;br /&gt;
* &amp;lt;code&amp;gt;sgX:&amp;lt;/code&amp;gt; Speed grade for E300 devices (1 or 3)&lt;br /&gt;
&lt;br /&gt;
Some examples are:&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_XG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_XG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_HLS_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_HLS_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;E310_RFNOC&amp;lt;/code&amp;gt; (this is for the speed grade 1 FPGA version of E310, append &amp;lt;code&amp;gt;_sg3&amp;lt;/code&amp;gt; for speed grade 3)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' E310, E312 and E313 all have the same FPGA hardware and therefore will use the &amp;lt;code&amp;gt;E310_RFNOC_{BUILD_TYPE}&amp;lt;/code&amp;gt; target. USRP E3xx devices have either &amp;lt;code&amp;gt;sg1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sg3&amp;lt;/code&amp;gt; hardware, please visit [http://files.ettus.com/e3xx_images/README here] to find out how to differentiate.&lt;br /&gt;
&lt;br /&gt;
Additional information about the build targets can be found at the build instructions for USRP3, found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here].&lt;br /&gt;
&lt;br /&gt;
====Image building using the command line====&lt;br /&gt;
The script &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; is used to generate the NoC block instantiation file and build the FPGA image. Run the help menu by typing:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&lt;br /&gt;
    $ ./uhd_image_builder.py --help&lt;br /&gt;
         &lt;br /&gt;
    usage: uhd_image_builder.py [-h] [-I INCLUDE_DIR [INCLUDE_DIR ...]]&lt;br /&gt;
                                [-m MAX_NUM_BLOCKS] [--fill-with-fifos]&lt;br /&gt;
                                [-o OUTFILE] [-d DEVICE] [-t TARGET] [-g] [-c]&lt;br /&gt;
                                [blocks [blocks ...]]&lt;br /&gt;
    &lt;br /&gt;
    Generate the NoC block instantiation file&lt;br /&gt;
    &lt;br /&gt;
    positional arguments:&lt;br /&gt;
      blocks                List block names to instantiate.&lt;br /&gt;
    &lt;br /&gt;
    optional arguments:&lt;br /&gt;
      -h, --help            show this help message and exit&lt;br /&gt;
      -I INCLUDE_DIR [INCLUDE_DIR ...], --include-dir INCLUDE_DIR [INCLUDE_DIR ...]&lt;br /&gt;
                            Path directory of the RFNoC Out-of-Tree module&lt;br /&gt;
      -m MAX_NUM_BLOCKS, --max-num-blocks MAX_NUM_BLOCKS&lt;br /&gt;
                            Maximum number of blocks (Max. Allowed for x310|x300:&lt;br /&gt;
                            10, for e300: 6)&lt;br /&gt;
      --fill-with-fifos     If the number of blocks provided was smaller than the&lt;br /&gt;
                            max number, fill the rest with FIFOs&lt;br /&gt;
      -o OUTFILE, --outfile OUTFILE&lt;br /&gt;
                            Output /path/filename - By running this directive, you&lt;br /&gt;
                            won't build your IP&lt;br /&gt;
      -d DEVICE, --device DEVICE&lt;br /&gt;
                            Device to be programmed [x300, x310, e310]&lt;br /&gt;
      -t TARGET, --target TARGET&lt;br /&gt;
                            Build target - image type [X3X0_RFNOC_HG,&lt;br /&gt;
                            X3X0_RFNOC_XG, E310_RFNOC_sg3...]&lt;br /&gt;
      -g, --GUI             Open Vivado GUI during the FPGA building process&lt;br /&gt;
      -c, --clean-all       Cleans the IP before a new build&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are details on the usage of the script which is followed by an example:&lt;br /&gt;
&lt;br /&gt;
'''Blocks:''' The first arguments are the names of RFNoC blocks that the user wants to have compiled into the new image which are separated by a space. They can be custom blocks from the user’s OOT module or from the ones that are provided from Ettus, or a combination. Blocks provided by Ettus Research are listed (among other sources necessary for the FPGA build) in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/lib/rfnoc/Makefile.srcs&amp;lt;/code&amp;gt; file. &lt;br /&gt;
&lt;br /&gt;
These blocks can be identified by the following pattern: &lt;br /&gt;
&lt;br /&gt;
    noc_block_{NAME}.v&lt;br /&gt;
&lt;br /&gt;
However, as all the RFNoC blocks have the same &amp;lt;code&amp;gt;noc_block_&amp;lt;/code&amp;gt; prefix, for simplicity this prefix is omitted when listing the blocks in the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; utility. As an example of the incorrect and correct way of adding blocks, consider the following examples when adding the &amp;lt;code&amp;gt;noc_block_null_source_sink&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noc_block_siggen&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
Incorrect method:  &lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py noc_block_null_source_sink noc_block_siggen ...&lt;br /&gt;
&lt;br /&gt;
Correct method:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py null_source_sink siggen ...&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Blocks generated by the RFNoC Modtool follow the same naming convention.&lt;br /&gt;
&lt;br /&gt;
There is an increasing list of pre-built blocks. Here is a sample:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;axi_fifo_loopback&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;axi_dma_fifo&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fir_filter&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fft&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;null_source_sink&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;schmidl_cox&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;packet_resizer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;split_stream&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;vector_iir&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;addsub&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;window&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;keep_one_in_n&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;pfb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;export_io&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;conv_encoder_qpsk&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;logpwr&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fosphor&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;moving_avg&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ddc&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;duc&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RFNoC related blocks generally reside in &amp;lt;code&amp;gt;fpga/usrp3/lib/rfnoc/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!Block&lt;br /&gt;
!Filename&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FIFO&lt;br /&gt;
|noc_block_axi_fifo_loopback.v&lt;br /&gt;
|Simple FIFO loopback / passthrough block.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FFT&lt;br /&gt;
|noc_block_fft.v&lt;br /&gt;
|Xilinx coregen based Fast Fourier Transform up to length 4096.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FIR&lt;br /&gt;
|noc_block_fir_filter.v&lt;br /&gt;
|Xilinx coregen based Finite Impulse Response Filter, 41 taps, reconfigurable tap coefficients.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|Window&lt;br /&gt;
|noc_block_window.v&lt;br /&gt;
|Windowing block for use with FFT block.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Vector IIR&lt;br /&gt;
|noc_block_vector_iir.v&lt;br /&gt;
|Single pole IIR with configurable coefficients that filters data along vectors (i.e. parallel streams of samples). Useful with FFT output.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Keep One in N&lt;br /&gt;
|noc_block_keep_one_in_n.v&lt;br /&gt;
|Keeps one packet every N packets.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|AddSub&lt;br /&gt;
|noc_block_addsub.v&lt;br /&gt;
|Example of using multiple block ports in a single RFNoC block to add and subtract streams.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Null Source Sink&lt;br /&gt;
|noc_block_null_source_sink.v&lt;br /&gt;
|Generates dummy packets and can consume packets at a configurable rate. Useful for testing.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Packet Resizer&lt;br /&gt;
|noc_block_packet_resizer.v&lt;br /&gt;
|Resizes input packets to a configurable size (larger or smaller than source packets).&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Split Stream&lt;br /&gt;
|noc_block_split_stream.v&lt;br /&gt;
|Replicates an input stream to a configurable number of output streams.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' There is a restriction on the amount of blocks that can added into the FPGA image, see the section in this Application Note labeled [[Getting_Started_with_RFNoC_Development#Discussion_on_number_of_blocks_in_an_FPGA_image|Discussion on number of blocks in an FPGA image]] for more information. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-I INCLUDE_DIR:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; directive provides the path to the users &amp;lt;code&amp;gt;rfnoc/fpga-src&amp;lt;/code&amp;gt; directory which contains the custom blocks. This path is needed by the Xilinx Vivado tool. Inside the &amp;lt;code&amp;gt;fpga-src&amp;lt;/code&amp;gt; directory there is a file called &amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt; that contains the path of the OOT module and a list of all the custom OOT blocks. This is an auto generated file, which is amended every time a new block is added to the OOT module. Manually modifying this file is not recommended. If there are multiple OOT modules with various custom blocks that reside in different directories the way to include them all is by separating the different paths by a space (e.g. &amp;lt;code&amp;gt;-I /first/OOT/path/ /second/OOT/path/&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-d DEVICE:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; directive directs the script on which USRP device the build is for. If no &amp;lt;code&amp;gt;–d&amp;lt;/code&amp;gt; is included the default is &amp;lt;code&amp;gt;–d x310&amp;lt;/code&amp;gt;. Generation-3 USRPs and above all support RFNoC.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-t TARGET:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;–t&amp;lt;/code&amp;gt; directive directs the script on which type of image to build for the chosen device. With each USRP device there are several build options to choose from. Detailed information about the build targets can be found at the build instructions for USRP3, found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here]. If &amp;lt;code&amp;gt;-t&amp;lt;/code&amp;gt; is not included, a default target will be chosen for the given device. For example, the default &amp;lt;code&amp;gt;X310_RFNOC_HG&amp;lt;/code&amp;gt; target builds for the &amp;lt;code&amp;gt;–d x310&amp;lt;/code&amp;gt; device. More details on targets can be found in the section of this Application Note labeled [[Getting Started with RFNoC Development#Discussion_on_FPGA_image_targets|Discussion on FPGA image targets]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-m MAX_NUM_BLOCKS:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;–m&amp;lt;/code&amp;gt; directive specifies the max number of RFNoC blocks to build on the FPGA image. An RFNoC image does not need to fill all available slots with RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--fill-with-fifos:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;--fill-with-fifos&amp;lt;/code&amp;gt; directive will fill the empty RFNoC block slots with FIFOS. As an example, if a user indicates three RFNoC blocks by name and also specifies &amp;lt;code&amp;gt;–m 5&amp;lt;/code&amp;gt; then the other two slots will be filed with FIFOs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-o OUTFILE:&amp;lt;/code&amp;gt; With the &amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; directive, the RFNoC blocks instantiation file is generated and saved at the desired path with the given name for the user to inspect. The FPGA image will NOT build if this directive is provided. The purpose of the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script is to auto generate an instantiation file and populate the source files needed for the Xilinx Vivado tool to build the FPGA image, however, it may be desirable to only see the effect of adding a custom OOT module in the &amp;lt;code&amp;gt;fpga/&amp;lt;/code&amp;gt; directory, or for inspecting the instantiation file. When the directive is not provided the &amp;lt;code&amp;gt;rfnoc_ce_auto_inst_x3x0.v&amp;lt;/code&amp;gt; file is overwritten and the FPGA image build process will start automatically (standard use).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-g, --GUI:&amp;lt;/code&amp;gt; Open Vivado GUI during the FPGA building process&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-c, --clean-all:&amp;lt;/code&amp;gt; Cleans the IP before a new build&lt;br /&gt;
&lt;br /&gt;
Here is how to create an X310 FPGA image incorporating the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block that was created earlier in this Application Note:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts     &lt;br /&gt;
    $ ./uhd_image_builder.py gain ddc fft -I {USER_PREFIX}/src/rfnoc-tutorial/rfnoc/fpga-src/ -d x310 -t X310_RFNOC_HG -m 6 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end of a successful compilation process, write the new image to a USRP. The following command will load the new image. Update the &amp;lt;code&amp;gt;{IP_Address}&amp;lt;/code&amp;gt; of the USRP and &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; to the appropriate values for your configuration before running the command.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args “type=x300,addr={IP_ADDRESS}” --fpga-path {USER_PREFIX}/src/uhd-fpga/usrp3/top/x300/build/usrp_x310_fpga_RFNOC_HG.bit&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' &lt;br /&gt;
* The FPGA image building process may take over an hour.&lt;br /&gt;
&lt;br /&gt;
* FPGA images are specific to the USRP device NOT the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. Additional instructions on flashing a custom image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
&lt;br /&gt;
* [Environment setup] - The &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script will also set up the Xilinx Vivado environment by automatically running the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{device}&amp;lt;/code&amp;gt; directory. The &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script assumes that Xilinx Vivado is installed in the default location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.  If the installation is in a different directory the &amp;lt;code&amp;gt;setupenv_base.sh&amp;lt;/code&amp;gt; script will need to be modified. The script is located at: &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts/setupenv_base.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Besides the custom &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block, a &amp;lt;code&amp;gt;DDC&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FFT&amp;lt;/code&amp;gt; block are also being added along with three &amp;lt;code&amp;gt;FIFOs&amp;lt;/code&amp;gt;.  The &amp;lt;code&amp;gt;DDC&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;FFT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FIFO&amp;lt;/code&amp;gt; blocks are already in the script's path and therefore do not need their path specified (they ship with the Ettus Research FPGA code). The reason three FIFOs are added is because the max number of blocks was specified to be 6 ( &amp;lt;code&amp;gt;-m 6&amp;lt;/code&amp;gt; ) and since only 3 blocks were specifically named the other three slots are filled with FIFOs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 10.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Instructions on flashing the image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series. FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. &lt;br /&gt;
&lt;br /&gt;
Once the newly compiled image is loaded onto a USRP X3xx running the following command will show what RFNoC blocks are available on the FPGA:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * '''Block_0'''&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The reason the custom block is called &amp;lt;code&amp;gt;Block_0&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;gain_0&amp;lt;/code&amp;gt; is because there is still host side software/files that need updated in order for this block to populate it’s proper name. A following section (UHD Integration) will step through the process of updating those host side files.&lt;br /&gt;
&lt;br /&gt;
====Using a graphical interface====&lt;br /&gt;
A graphical user interface for FPGA generation and building is shipped along with the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script. This intuitive application aids in setting up a custom FPGA build. &lt;br /&gt;
&lt;br /&gt;
This utility is located in the same &amp;lt;code&amp;gt;scripts&amp;lt;/code&amp;gt; directory as &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
To run it, enter the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts/&lt;br /&gt;
    $ ./uhd_image_builder_gui&lt;br /&gt;
&lt;br /&gt;
The application will then be launched:&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 11.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''1. Select build target:''' In this panel the available build targets are listed. This list may vary depending on which branch of the FPGA repository this user is using. Only RFNoC targets are listed. The build type descriptions are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HG:&amp;lt;/code&amp;gt; 1GigE on SFP+ Port0, 10Gig on SFP+ Port1&lt;br /&gt;
* &amp;lt;code&amp;gt;XG:&amp;lt;/code&amp;gt; 10GigE on both SFP+ ports&lt;br /&gt;
* &amp;lt;code&amp;gt;HLS:&amp;lt;/code&amp;gt; Vivado High Level Synthesis enabled&lt;br /&gt;
* &amp;lt;code&amp;gt;sgX:&amp;lt;/code&amp;gt; Speed grade for E300 devices (1 or 3)&lt;br /&gt;
&lt;br /&gt;
'''2. List of blocks available:''' In this panel the available blocks are listed that can be included into a custom design. This list separates the RFNoC blocks provided by Ettus Research and the OOT modules and corresponding blocks that the user adds. Given the hardware differences between the X3xx and E3xx devices, this list will dynamically change when a different device is selected from the panel on the left. This implies that it is necessary to add the OOT modules for each device independently. This is accomplished by using the &amp;lt;code&amp;gt;Add OOT Blocks&amp;lt;/code&amp;gt; feature of the application, details of which are explained at #7 (&amp;lt;code&amp;gt;Add OOT Blocks&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
'''3. Blocks in current design:''' This panel will be populated by adding elements from the available blocks. All the blocks listed in here will be compiled into the FPGA custom image. There is a maximum number of blocks that can be added for each device. See the section in this App Note labeled Discussion on number of blocks in an FPGA image for more information. &lt;br /&gt;
&lt;br /&gt;
'''4. Add button (&amp;gt;&amp;gt;):''' Manually add the blocks from the central panel into your design.&lt;br /&gt;
&lt;br /&gt;
'''5. Remove button (&amp;lt;&amp;lt;):''' Remove blocks from the current design (far-left panel)&lt;br /&gt;
&lt;br /&gt;
'''6. Fill with FIFOs:''' By checking this box, the design will fill any available/unspecified block slots with FIFOs. The number of FIFO blocks that will be instantiated is based on the rules of amount of blocks explained at #3. When less than the max amount of blocks are needed for certain implementation, many users choose to fill their design with FIFO blocks. &lt;br /&gt;
&lt;br /&gt;
'''7. Open Vivado GUI:''' Open Vivado GUI during the FPGA building process. This allows the user to save a Vivado project with all IP and work within the Vivado GUI for development.&lt;br /&gt;
&lt;br /&gt;
'''8. Clean IP:''' Cleans the IP before a new build (recompiles all IP).&lt;br /&gt;
&lt;br /&gt;
'''9. Add OOT blocks:''' Manually add RFNoC Modtool-generated OOT modules by pointing the application to the &amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt; file, which is located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/{USER-OOT-moddir}/rfnoc/fpga-srcs/&amp;lt;/code&amp;gt; directory. After adding this file, blocks will appear under “&amp;lt;code&amp;gt;OOT blocks for XXXX devices&amp;lt;/code&amp;gt;”&lt;br /&gt;
&lt;br /&gt;
'''10. Import from GRC:''' If the user has a GNU Radio flowgraph with RFNoC blocks already in it, this application can read what RFNoC blocks are in the flowgraph and populate the &amp;lt;code&amp;gt;Blocks in current design&amp;lt;/code&amp;gt; section of the application with the necessary RFNoC blocks. '''NOTE:''' All RFNoC blocks pulled from a &amp;lt;code&amp;gt;.grc&amp;lt;/code&amp;gt; file must be in the of &amp;lt;code&amp;gt;List of blocks available&amp;lt;/code&amp;gt; before beginning the build.&lt;br /&gt;
&lt;br /&gt;
'''11. Show Instantiation File:''' The application auto-generates the instantiation file that is going to be used by Vivado to build the FPGA image. This instantiation file can be viewed and edited before starting the build by clicking this button. &lt;br /&gt;
&lt;br /&gt;
'''12. Generate .bit file:''' Start the build by clicking this button. &lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' See the latter end of the previous section for additional information on what to expect once the compile has started as well as final output.&lt;br /&gt;
&lt;br /&gt;
==Creating Software/Host portion of custom RFNoC Block==&lt;br /&gt;
Now that the FPGA portion is complete the next step is to add software integration to UHD and GNU Radio as depicted in the RFNoC Stack below.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 12.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
===UHD integration===&lt;br /&gt;
Despite the data processing happening on the FPGA, the host software still has a lot of responsibilities in order for an RFNoC application to function. For example, it needs to know which settings registers are available within an RFNoC block, or what kind of input and output a block has. All of this information goes into the &amp;lt;code&amp;gt;Block Declaration&amp;lt;/code&amp;gt;, which is an XML file that is readable by UHD. Often, some simple logic needs to be embedded in the XML file, which we can do by using a simple scripting language called Noc-Script. Changes to the block declaration file are immediately imported into UHD every time an application is executed, and therefore, no software development toolchain needs to be set up.&lt;br /&gt;
&lt;br /&gt;
The list of things declared by the block declaration file includes:&lt;br /&gt;
&lt;br /&gt;
* Block name and Noc-ID&lt;br /&gt;
* Registers&lt;br /&gt;
* Inputs and outputs (including types)&lt;br /&gt;
&lt;br /&gt;
In some cases, additional C++ code is required to properly control a block from software. In this case, a &amp;lt;code&amp;gt;Block Controller&amp;lt;/code&amp;gt; file is required as well as the declaration file. In most cases, the default block controller provided by UHD is sufficient, so no C++ code needs to be written. Writing custom block controllers requires more effort, and means having to set up a programming toolchain. A common reason to write custom C++ block controllers is if setting a register requires a lot of computation, which is not feasible to do within a block declaration file (e.g., using Noc-Script).&lt;br /&gt;
&lt;br /&gt;
Skeleton code for both the block declaration and the block controller (if required) can be generated through RFNoC Modtool.&lt;br /&gt;
&lt;br /&gt;
Because the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block does not require anything other than simply reading and writing to a single register the default block controller will suffice for this example. However, we will need to add information about the register.&lt;br /&gt;
&lt;br /&gt;
Open the &amp;lt;code&amp;gt;gain.xml&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;/rfnoc-tutorial/rfnoc/blocks&amp;lt;/code&amp;gt; directory and add the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;&amp;lt;!--Default XML file--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;nocblock&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;gain&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;blockname&amp;gt;gain&amp;lt;/blockname&amp;gt;&lt;br /&gt;
      &amp;lt;ids&amp;gt;&lt;br /&gt;
        &amp;lt;id revision=&amp;quot;0&amp;quot;&amp;gt;1111222233334444&amp;lt;/id&amp;gt;&lt;br /&gt;
      &amp;lt;/ids&amp;gt;&lt;br /&gt;
      '''&amp;lt;nowiki&amp;gt;&amp;lt;!-- Registers --&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;registers&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;setreg&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;name&amp;gt;GAIN&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;address&amp;gt;128&amp;lt;/address&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;/setreg&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;/registers&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;nowiki&amp;gt;&amp;lt;!-- Args --&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;args&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;arg&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;name&amp;gt;gain&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;double&amp;lt;/type&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;value&amp;gt;1.0&amp;lt;/value&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;check&amp;gt;GE($gain, 0.0) AND LE($gain, 32767.0)&amp;lt;/check&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;check_message&amp;gt;Invalid gain.&amp;lt;/check_message&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;action&amp;gt;'''&lt;br /&gt;
            '''SR_WRITE(&amp;quot;GAIN&amp;quot;, IROUND($gain))'''&lt;br /&gt;
          '''&amp;lt;/action&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;/arg&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;/args&amp;gt;'''&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!--One input, one output. If this is used, better have all the info the C++ file.--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;ports&amp;gt;&lt;br /&gt;
        &amp;lt;sink&amp;gt;&lt;br /&gt;
          '''&amp;lt;name&amp;gt;in0&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;sc16&amp;lt;/type&amp;gt;'''&lt;br /&gt;
        &amp;lt;/sink&amp;gt;&lt;br /&gt;
        &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
          '''&amp;lt;name&amp;gt;out0&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;sc16&amp;lt;/type&amp;gt;'''&lt;br /&gt;
        &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;/ports&amp;gt;&lt;br /&gt;
    &amp;lt;/nocblock&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GNU Radio Integration===&lt;br /&gt;
GNU Radio is built around the concept of blocks, similarly to RFNoC. When mapping RFNoC into an application, the simple constraint is made that every RFNoC block maps to a single GNU Radio block. Thus, when creating mixed GNU Radio/RFNoC applications, there is a very clear 1:1 mapping between what’s happening in RFNoC and GNU Radio.&lt;br /&gt;
&lt;br /&gt;
Since most RFNoC blocks behave very similar to one another from GNU Radio’s perspective, it is generally not required to write C++ code for another block. Rather, a default block provided by RFNoC can be used with appropriate configuration. However, in some cases it may be desirable or even necessary to write a custom GNU Radio block for more specific controlling of the underlying RFNoC block. GNU Radio allows writing blocks in either C++ or Python, but since UHD and RFNoC do not have a Python API, a custom wrapper for an RFNoC block needs to be written in C++. RFNoC Modtool will create skeleton files for these purpose.&lt;br /&gt;
&lt;br /&gt;
The most popular and effective way to use GNU Radio is through the graphical interface, the GNU Radio Companion (GRC). GRC requires a separate description of every GNU Radio block in order to become available in the graphical UI, and the same is true for an RFNoC block that is wrapped in a GNU Radio block (even if the generic RFNoC block wrapper is used). For GNU Radio 3.7 and earlier, GRC bindings for blocks are written as XML files with interspersed Cheetah or Python statements. For a more detailed tutorial on how to write these files, refer to the [http://gnuradio.org/redmine/projects/gnuradio/wiki GNU Radio Documentation] and associated [http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials tutorials].&lt;br /&gt;
&lt;br /&gt;
====GNU Radio Block Code====&lt;br /&gt;
&lt;br /&gt;
* C++ or Python, although RFNoC blocks need to be written in C++ (if at all)&lt;br /&gt;
* How does GNU Radio interface to RFNoC?&lt;br /&gt;
** via C++ infrastructure code in &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; provides a base RFNoC block class&lt;br /&gt;
** Users extend base class for their RFNoC blocks&lt;br /&gt;
** Many blocks can use base class “as is”&lt;br /&gt;
** No C++ or Python code!&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-tutorial/lib/gain_impl.cc&amp;lt;/code&amp;gt;&lt;br /&gt;
** The gain block does not need anything additional&lt;br /&gt;
&lt;br /&gt;
====GNU Radio Companion Bindings====&lt;br /&gt;
* XML&lt;br /&gt;
* Describes GNU Radio blocks to GRC&lt;br /&gt;
* No recompilation&lt;br /&gt;
* Requirement of GNU Radio Companion&lt;br /&gt;
* Not strictly necessary for GNU Radio&lt;br /&gt;
* Tutorial on how to write them:&lt;br /&gt;
** [http://gnuradio.org/redmine/projects/gnuradio/wiki/GNURadioCompanion http://gnuradio.org/redmine/projects/gnuradio/wiki/GNURadioCompanion ]&lt;br /&gt;
* Skeleton file generated by RFNoC Modtool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Open the &amp;lt;code&amp;gt;tutorial-gain.xml&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;rfnoc-tutorial/grc&amp;lt;/code&amp;gt; directory and edit as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;block&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;RFNoC: gain&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;key&amp;gt;tutorial_gain&amp;lt;/key&amp;gt;&lt;br /&gt;
      &amp;lt;category&amp;gt;tutorial&amp;lt;/category&amp;gt;&lt;br /&gt;
      &amp;lt;import&amp;gt;import tutorial&amp;lt;/import&amp;gt;&lt;br /&gt;
      &amp;lt;make&amp;gt;tutorial.gain(&lt;br /&gt;
        self.device3,&lt;br /&gt;
        uhd.stream_args( \# TX Stream Args&lt;br /&gt;
            cpu_format=&amp;quot;'''fc32'''&amp;quot;,&lt;br /&gt;
            otw_format=&amp;quot;'''sc16'''&amp;quot;,&lt;br /&gt;
            args=&amp;quot;gr_vlen={0},{1}&amp;quot;.format(${grvlen}, &amp;quot;&amp;quot; if $grvlen == 1 else &amp;quot;spp={0}&amp;quot;.format($grvlen)),&lt;br /&gt;
        ),&lt;br /&gt;
        uhd.stream_args( \# RX Stream Args&lt;br /&gt;
            cpu_format=&amp;quot;'''fc32'''&amp;quot;,&lt;br /&gt;
            otw_format=&amp;quot;'''sc16'''&amp;quot;,&lt;br /&gt;
            args=&amp;quot;gr_vlen={0},{1}&amp;quot;.format(${grvlen}, &amp;quot;&amp;quot; if $grvlen == 1 else &amp;quot;spp={0}&amp;quot;.format($grvlen)),&lt;br /&gt;
        ),&lt;br /&gt;
        $block_index, $device_index,&lt;br /&gt;
    )&lt;br /&gt;
    '''self.$(id).set_arg(&amp;quot;gain&amp;quot;, $gain)'''&lt;br /&gt;
      '''&amp;lt;/make&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;callback&amp;gt;set_arg(&amp;quot;gain&amp;quot;, $gain)&amp;lt;/callback&amp;gt;'''&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'param' node for every Parameter you want settable from the GUI.&lt;br /&gt;
           Sub-nodes:&lt;br /&gt;
           * name&lt;br /&gt;
           * key (makes the value accessible as $keyname, e.g. in the make node)&lt;br /&gt;
           * type --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
         .  &lt;br /&gt;
         .&lt;br /&gt;
         .&lt;br /&gt;
    &lt;br /&gt;
        &amp;lt;option&amp;gt;&lt;br /&gt;
          &amp;lt;name&amp;gt;Byte&amp;lt;/name&amp;gt;&lt;br /&gt;
          &amp;lt;key&amp;gt;u8&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;/option&amp;gt;&lt;br /&gt;
      &amp;lt;/param&amp;gt;&lt;br /&gt;
      &amp;lt;param&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;'''Gain'''&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;'''gain'''&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;value&amp;gt;'''1.0'''&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''real'''&amp;lt;/type&amp;gt;&lt;br /&gt;
      &amp;lt;/param&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'sink' node per input. Sub-nodes:&lt;br /&gt;
           * name (an identifier for the GUI)&lt;br /&gt;
           * type&lt;br /&gt;
           * vlen&lt;br /&gt;
           * optional (set to 1 for optional inputs) --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;sink&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;in&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''complex'''&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;vlen&amp;gt;$grvlen&amp;lt;/vlen&amp;gt;&lt;br /&gt;
        &amp;lt;domain&amp;gt;rfnoc&amp;lt;/domain&amp;gt;&lt;br /&gt;
      &amp;lt;/sink&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'source' node per output. Sub-nodes:&lt;br /&gt;
           * name (an identifier for the GUI)&lt;br /&gt;
           * type&lt;br /&gt;
           * vlen&lt;br /&gt;
           * optional (set to 1 for optional inputs) --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;out&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''complex'''&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;vlen&amp;gt;$grvlen&amp;lt;/vlen&amp;gt;&lt;br /&gt;
        &amp;lt;domain&amp;gt;rfnoc&amp;lt;/domain&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Indentation spacing is important in the &amp;lt;code&amp;gt;&amp;lt;make&amp;gt;&amp;lt;/code&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
===Compile, Install and Verify===&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/rfnoc-tutorial/build&lt;br /&gt;
    $ make install&lt;br /&gt;
    &lt;br /&gt;
    $ uhd_usrp_probe &lt;br /&gt;
    &lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * '''gain_0'''&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' In the case where the &amp;lt;code&amp;gt;gain_0&amp;lt;/code&amp;gt; does not appear but &amp;lt;code&amp;gt;Block_0&amp;lt;/code&amp;gt; does: Most likely, the XML block declaration file (see [[Getting_Started_with_RFNoC_Development#UHD_integration|UHD Integration]] section) for the block contains a NoC-ID that does not match with any NoC-ID defined in the hardware part of the design. The user has to be certain that the description files are up-to-date and that the NoC-ID matches in the SW and HW side. See the [[Getting_Started_with_RFNoC_Development#UHD_integration|UHD Integration]] section to update those host side files.&lt;br /&gt;
&lt;br /&gt;
==Testing out the custom block==&lt;br /&gt;
At this point the custom &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; RFNoc Block (Computation Engine) can be used within a GNU Radio flowgraph. Below is an example GRC flowgraph using our new block as well as the output application it produces. &lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 13.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Copy Block: In the RFNoC domain, streams of data can not be split as easily as they are in the GNU Radio domain. The “copy” block depicted in the screenshot above serves the function as a stream splitter . It’s main purpose, when “enabled”, is to copy the samples it is getting at its input and putting then into the output, but here it is also serving as a boundary between a RFNoC-domain and a GNURadio-domain. In the flowgraph above. after this boundary is passed, the data stream can easily be split into the two sinks to have them run simultaneously (standard GNU Radio functionality). It is possible to connect the GNU Radio blocks directly to RFNoC blocks without a “copy” block, but only one would work at a time (the other ones would have to be disabled). Another way to split data streams from the RFNoC-domain is to use the ”RFNoC: split stream” block, which would split the streams in the RFNoC domain, but this is not very useful here as we are, in any case, moving into the GNURadio-domain.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 14.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
===Xilinx Vivado===&lt;br /&gt;
====Compile issues====&lt;br /&gt;
=====Synthesis is failing=====&lt;br /&gt;
Verify all the correct Xilinx [[Getting Started with RFNoC Development#Prerequisites|prerequisite software]] is installed.&lt;br /&gt;
&lt;br /&gt;
Additional helpful information can be found in the following Xilinx forum posts:&lt;br /&gt;
* https://forums.xilinx.com/t5/Synthesis/Synthesis-failed-without-reporting-any-error/td-p/686000&lt;br /&gt;
* https://forums.xilinx.com/t5/Installation-and-Licensing/Vivado-on-Linux-synthesis-fails-with-no-error-message/td-p/732143&lt;br /&gt;
&lt;br /&gt;
====Environment Setup====&lt;br /&gt;
The &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script will also set up the Xilinx Vivado environment by automatically running the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{device}&amp;lt;/code&amp;gt; directory. The &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script assumes that Xilinx Vivado is installed in the default location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;. If the installation is in a different directory, then the &amp;lt;code&amp;gt;setupenv_base.sh&amp;lt;/code&amp;gt; script will need to be modified. The script is located at: &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3_rfnoc/tools/scripts/setupenv_base.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Links and Additional Resources==&lt;br /&gt;
===RFNoC additional resources===&lt;br /&gt;
* [https://kb.ettus.com/RFNoC RFNoC Primary Application Note]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Intro.pdf RFNoC Introduction]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_FPGA.pdf RFNoC Deep Dive: FPGA]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Host.pdf RFNoC Deep Dive: Host side]&lt;br /&gt;
* [https://www.youtube.com/watch?v=8cPd3t88djE Video: RFNoC presented at Wireless @ Virginia Tech, 2015 ]&lt;br /&gt;
** Explaining the slides of Intro, FPGA and Host presentations above (in that order).&lt;br /&gt;
&lt;br /&gt;
===GNU Radio resources===&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules GNU Radio OutOfTree Modules tutorial]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGRFromSource GNU Radio Installation]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/Tutorials GNU Radio Tutorials]&lt;br /&gt;
&lt;br /&gt;
===UHD resources===&lt;br /&gt;
* [https://kb.ettus.com/UHD UHD Software Resources Page]&lt;br /&gt;
* [http://files.ettus.com/manual/md_usrp3_build_instructions.html USRP3 build instructions]&lt;br /&gt;
* [http://files.ettus.com/manual/ UHD Manual]&lt;br /&gt;
&lt;br /&gt;
===Other resources===&lt;br /&gt;
* [https://www.xilinx.com/support/documentation/ip_documentation/ug761_axi_reference_guide.pdf Xilinx - AXI reference guide]&lt;br /&gt;
* [https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux UHD + GNU Radio Application Note (Linux)]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/pybombs/wiki PyBOMBS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=3318</id>
		<title>Getting Started with RFNoC Development</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=3318"/>
				<updated>2017-01-17T01:30:11Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* Create development environment manually */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-823'''&lt;br /&gt;
&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-07-12&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Martin Braun&amp;lt;br&amp;gt; Nicolas Cuervo&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2017-01-10&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Team&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Added “Digital Gain” example&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This application note guides a user through basic information on the RFNoC architecture, installing necessary software to develop custom RFNoC blocks, also called Computation Engines (CE), and walks through the steps of creating a custom RFNoC block using an example.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
First sections deal with installing tools and validating correct tool installation in order to do RFNoC development. Later sections deal with creating a custom RFNoC block, using the built-in testbench architecture, building an FPGA image with the custom block and finally testing out the new block within GNU Radio.&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
The RFNoC code base is open source, including code that executes on the host, as well as code targeted to the USRP hardware (FPGA and microcontroller firmware). As dual-licensed software, RFNoC is available under the open-source GNU Public License version 3 (GPLv3), as well as an alternative, less-restrictive license offered only by Ettus Research. For more information on our licensing policy, please contact [mailto:info@ettus.com info@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
In order to build custom USRP FPGA images and RFNoC blocks the following hardware and software are needed.&lt;br /&gt;
&lt;br /&gt;
* '''Ubuntu 14.04 or 16.04(preferred):''' Currently PyBOMBS (which can be used to install the ''Software build tools''), works most reliably in Ubuntu, and thus, we recommend using this distribution. Also, a majority of the scripts used during the build process are Linux (Ubuntu) specific. A PC with multiple cores and 8GB+ of RAM is recommended.&lt;br /&gt;
&lt;br /&gt;
* '''Xilinx Vivado tools (ver. 2015.4):''' The specific version depends on the branch and state of the FPGA code. The default install location is &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;. Once all of the Software build tools are installed the specific version for the downloaded code can be found in the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{DEVICE}&amp;lt;/code&amp;gt; directory. Further information can be found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here].&lt;br /&gt;
&lt;br /&gt;
* '''Software build tools:''' If UHD can be or has been compiled from source on the development PC then all the necessary software build components are present (PyBOMBS can be used to set all this up and instructions on how to do so are given in a following step).&lt;br /&gt;
&lt;br /&gt;
* X3xx series or E3xx series device or any future USRP&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
* The edition of Xilinx Vivado that is required will depend on the USRP device.&lt;br /&gt;
** X3xx series devices: Design or System editions.&lt;br /&gt;
** E3xx series devices: Design, System or the free WebPack edition.&lt;br /&gt;
* Other operating systems can be used, but the exact steps on how to proceed are not given in this Application Note.&lt;br /&gt;
* In some Linux distributions (e.g. Ubuntu) &amp;lt;code&amp;gt;dash&amp;lt;/code&amp;gt; is set as default shell, which may cause some issues. It is recommended to set the shell to &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; by running the following commands in the terminal. Choose &amp;lt;code&amp;gt;&amp;lt;No&amp;gt;&amp;lt;/code&amp;gt; when prompted by the first command and the second command will validate the that bash will be used.&lt;br /&gt;
&lt;br /&gt;
    $ sudo dpkg-reconfigure dash&lt;br /&gt;
    $ ll /bin/sh&lt;br /&gt;
&lt;br /&gt;
==Creating a development environment==&lt;br /&gt;
While this Application Note goes through the process of integrating GNU Radio into the RFNoC development flow, it is by no means required to use or develop within the RFNoC framework, but it makes it a great deal easier to use a framework on top of RFNoC for aspects such as visualization and other features. GNU Radio is freely available and more information about it can be found [http://gnuradio.org/ here].&lt;br /&gt;
&lt;br /&gt;
The following software packages are required in order to setup a development environment/sandbox:&lt;br /&gt;
&lt;br /&gt;
* UHD&lt;br /&gt;
* GNU Radio &lt;br /&gt;
* gr-ettus&lt;br /&gt;
&lt;br /&gt;
===Create development environment using PyBOMBS===&lt;br /&gt;
The cleanest way to set this up is to install everything into a dedicated directory. [http://gnuradio.org/redmine/projects/pybombs/wiki PyBOMBS] is the simplest way to do this. If not already installed, PyBOMBS can be setup with the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ sudo apt-get install git&lt;br /&gt;
    $ sudo apt-get install python-setuptools python-dev python-pip build-essential &lt;br /&gt;
    &lt;br /&gt;
    $ sudo pip install git+https://github.com/gnuradio/pybombs.git&lt;br /&gt;
    $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git&lt;br /&gt;
    $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git&lt;br /&gt;
&lt;br /&gt;
These commands will do the following:&lt;br /&gt;
* Install &amp;lt;code&amp;gt;Git&amp;lt;/code&amp;gt;&lt;br /&gt;
* Install &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; and other Python dependencies&lt;br /&gt;
* Install the latest &amp;lt;code&amp;gt;PyBOMBS&amp;lt;/code&amp;gt; from its Git repository&lt;br /&gt;
* Add the &amp;lt;code&amp;gt;gr-recipes&amp;lt;/code&amp;gt; recipes which are used to install GNU Radio specific software&lt;br /&gt;
* Add the &amp;lt;code&amp;gt;ettus&amp;lt;/code&amp;gt; recipes which are used to install Ettus Research specific software&lt;br /&gt;
&lt;br /&gt;
From here, PyBOMBS can be used to setup and install the development environment/sandbox by running the following command:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs prefix init ~/rfnoc -R rfnoc -a rfnoc&lt;br /&gt;
&lt;br /&gt;
This will do the following:&lt;br /&gt;
&lt;br /&gt;
* Create a directory in the user’s home directory called &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; (any valid directory name will work)&lt;br /&gt;
&lt;br /&gt;
* Give the prefix an alias of &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; ( &amp;lt;code&amp;gt;[-a alias]&amp;lt;/code&amp;gt;, e.g. &amp;lt;code&amp;gt;–a rfnoc&amp;lt;/code&amp;gt; ), which would be the name given to this path. This name will be used in further steps that use PyBOMBS. When creating the first prefix and omitting the alias, the prefix will be setup as the default.&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; prefix recipe ( as opposed to a package recipe like &amp;lt;code&amp;gt;gqrx&amp;lt;/code&amp;gt; ) to clone UHD, FPGA, GNU Radio, and gr-ettus sources into the &amp;lt;code&amp;gt;~/rfnoc&amp;lt;/code&amp;gt; directory as well as compile and install all the software&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' A user can specify how many cores are used by builds when using PyBOMBS. The default is set to 4. For example, this will set the number of cores used to 3:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs config makewidth 3&lt;br /&gt;
&lt;br /&gt;
The value will be written into a configuration file and then applied to subsequent PyBOMBS commands. This value can temporarily be overridden for a specific build by specifying the &amp;lt;code&amp;gt;--config makewidth=X&amp;lt;/code&amp;gt; argument, where “&amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;” is an integer number. If the user only has 4 cores it is recommend to use this argument in the pybombs command to limit the number of cores to &amp;lt;4 (e.g. 3) so that the computer stays responsive. Following are 2 examples, one using less cores and the other using more cores:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs --config makewidth=3 prefix init ~/rfnoc -R rfnoc -a rfnoc &lt;br /&gt;
    $ pybombs --config makewidth=7 prefix init ~/rfnoc -R rfnoc -a rfnoc&lt;br /&gt;
&lt;br /&gt;
Then, it is necessary to setup the PyBOMBS environment, so that the system/terminal session will have the environmental variables pointing to this newly created prefix, which is done with the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/rfnoc&lt;br /&gt;
    $ source ./setup_env.sh&lt;br /&gt;
&lt;br /&gt;
Once the previous command is run, this terminal session will have access to the environmental variables that allow the complete use of the set of software that was just installed with PyBOMBS. If access to the software is needed in other terminals the same command must be run within them.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Throughout the rest of this document the term &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; will used at the beginning of different directories. For example, &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&amp;lt;/code&amp;gt; is a directory that contains useful scripts for compiling. The term &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; is used to denote the folders that precede the &amp;lt;code&amp;gt;/src&amp;lt;/code&amp;gt; directory. Examples of what &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; could be: &amp;lt;code&amp;gt;/home/user/rfnoc&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/home/user/myDevfolder/&amp;lt;/code&amp;gt;. On many Linux environments using &amp;lt;code&amp;gt;~/&amp;lt;/code&amp;gt; at the beginning of the target directory path is equivalent to the user’s home directory.( i.e &amp;lt;code&amp;gt;~/&amp;lt;/code&amp;gt; is equal to &amp;lt;code&amp;gt;/home/user/&amp;lt;/code&amp;gt;). So &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; could also look like &amp;lt;code&amp;gt;~/rfnoc&amp;lt;/code&amp;gt;  or &amp;lt;code&amp;gt;~/myDevfolder/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Create the development environment manually===&lt;br /&gt;
As an alternative to using PyBOMBS, manually installing and configuring the software is done by following the individual install notes for [http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGRFromSource GNU Radio], [https://files.ettus.com/manual/page_build_guide.html UHD] and [https://github.com/EttusResearch/gr-ettus gr-ettus] and by making sure they are reachable by linkers and compilers.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The Application Note found [https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux here] goes through the process of manually installing UHD and GNU Radio on Linux platforms.&lt;br /&gt;
&lt;br /&gt;
To manually download the software, use these &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt; commands, which will select the correct branches:&lt;br /&gt;
&lt;br /&gt;
    $ git clone --recursive -b rfnoc-devel https://github.com/EttusResearch/uhd.git &lt;br /&gt;
    $ git clone --recursive -b maint https://github.com/gnuradio/gnuradio.git # master branch is also fine instead of maint&lt;br /&gt;
    $ git clone -b master https://github.com/EttusResearch/gr-ettus.git &lt;br /&gt;
    $ git clone -b rfnoc-devel https://github.com/EttusResearch/fpga.git&lt;br /&gt;
&lt;br /&gt;
If UHD, GNU Radio and/or gr-ettus are already installed, it would be sufficient to checkout the branches mentioned and update them them (&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;). Thereafter, rebuild each of the repositories (rebuild order: UHD, GNU Radio, gr-ettus).&lt;br /&gt;
&lt;br /&gt;
===Verify Environment===&lt;br /&gt;
Running the command “&amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;” with the “&amp;lt;code&amp;gt;--version&amp;lt;/code&amp;gt;” flag will verify that the installation has been completed successfully.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The version string output from this command may differ, however it should be similar to the output below.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe --version&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-161- g83150fdd&lt;br /&gt;
    &lt;br /&gt;
    4.0.0.rfnoc-devel-161-g83150fdd&lt;br /&gt;
&lt;br /&gt;
===Testing the default FPGA image and building from existing blocks===&lt;br /&gt;
&lt;br /&gt;
It is recommended to spend a moment looking at the Ettus Research default image, which is pre-built with a set of RFNoC blocks, as well as building a custom image with a unique set of pre-built RFNoC blocks. To get the default image(s), run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_images_downloader&lt;br /&gt;
&lt;br /&gt;
Ettus Research will be updating the default image(s) occasionally, and &amp;lt;code&amp;gt;uhd_images_downloader&amp;lt;/code&amp;gt; can be run anytime after running &amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt; and re-installing to pull the most current images. Images are stored in the &amp;lt;code&amp;gt;{USER_PREFIX}/share/uhd/images&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
The following images have the corresponding RFNoC blocks (Computation Engines):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Image Name&lt;br /&gt;
!Included Blocks&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x300_fpga_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x300_fpga_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;2x DDC, 2x DUC&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x300_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x300_fpga_RFNOC_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DUC, DDC (one channel), fosphor, window, fft, 2x AXI FIFOs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DUC, DDC (one channel), fosphor, window, fft, 2x AXI FIFOs, Keep One in N, FIR, Siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_e310_fpga.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_e310_fpga_sg3.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;1x DDC, 1x DUC&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_e310_fpga_RFNOC.bit (sg1 version)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_e310_fpga_RFNOC_sg3.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;fosphor, window, fft, 2x AXI FIFOs, FIR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Instructions on flashing the image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
  &lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device.&lt;br /&gt;
&lt;br /&gt;
By following the steps above the following should now be available:&lt;br /&gt;
* UHD/RFNoC code downloaded and installed&lt;br /&gt;
* FPGA code available&lt;br /&gt;
* A valid RFNoC image on your X3xx or E3xx series device&lt;br /&gt;
&lt;br /&gt;
====Inspect default images====&lt;br /&gt;
Run the following command, with a USRP connected to your PC, to verify current image on the USRP.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
If an RFNoC image was successfully loaded onto the USRP, there will be a lot of output text (RFNoC code is currently very verbose). The final lines of the output should be similar to the following for an USRP X310 ( e.g. &amp;lt;code&amp;gt;usrp_x310_fpga_HG&amp;lt;/code&amp;gt; ):&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * DDC_1&lt;br /&gt;
    |   |   |   * DUC_0&lt;br /&gt;
    |   |   |   * DUC_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Final output for &amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt; image:&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * DUC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * Window_0&lt;br /&gt;
    |   |   |   * FIR_0&lt;br /&gt;
    |   |   |   * SigGen_0&lt;br /&gt;
    |   |   |   * KeepOneInN_0&lt;br /&gt;
    |   |   |   * fosphor_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The actual names and number of blocks can differ. The list of blocks should start with the &amp;lt;code&amp;gt;DmaFIFO_x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Radio_x&amp;lt;/code&amp;gt;, and then a couple more lines of block IDs should follow.&lt;br /&gt;
&lt;br /&gt;
====Build custom image with pre-built RFNoC blocks====&lt;br /&gt;
Because of the growing number of RFNoC blocks, the user has the option to build an FPGA image with a set of pre-built RFNoC blocks of their choosing. The following steps describe the process for doing this and by so doing will also validate proper tool installation. Because compilation can take a couple of hours, it is recommended the user begin this process while continuing the rest of this guide.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA compilations can run in the background, however they are very resource intensive. If the user intents to use the same computer that is compiling to walk through the rest of this Application Note, it is recommended that the computer has plenty of resources.&lt;br /&gt;
&lt;br /&gt;
The script to initiate a compile is called &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt;, and is located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&amp;lt;/code&amp;gt; directory. Run the help menu by typing:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts &lt;br /&gt;
    $ ./uhd_image_builder.py --help&lt;br /&gt;
&lt;br /&gt;
A more detailed discussion of this script is given in an upcoming section. For now, compiling an FPGA image that has 2 RFNoC blocks (&amp;lt;code&amp;gt;window&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fft&amp;lt;/code&amp;gt;) and some &amp;lt;code&amp;gt;FIFOs&amp;lt;/code&amp;gt;, is done by running the script with the following arguments.&lt;br /&gt;
&lt;br /&gt;
Example for an X310 USRP:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py window fft -d x310 -t X310_RFNOC_HG -m 5 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
Example for an E310 USRP with Speed Grade 3 (sg3) FPGA:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py window fft -d e310 -t E310_RFNOC_sg3 -m 5 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
At the end of a successful compilation process, write the new image to a USRP. If the image was compiled for a USRP X310, the following command will load the new image. Update the &amp;lt;code&amp;gt;{IP_Address}&amp;lt;/code&amp;gt; of the USRP and &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; to the appropriate values for your configuration before running the command.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args “type=x300,addr={IP_ADDRESS}” --fpga-path {USER_PREFIX}/src/uhd-fpga/usrp3/top/x300/build/usrp_x310_fpga_RFNOC_HG.bit&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. Additional instructions on flashing a custom image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
&lt;br /&gt;
After the image has been successfully written to the USRP, power-cycle it and run the “&amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;” utility to view the newly compiled blocks.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
The final lines of output for the image built for the X310 is as follows:&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * Window_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
===Getting started with UHD + RFNoC===&lt;br /&gt;
The following new examples included within the &amp;lt;code&amp;gt;rfnoc-devel&amp;lt;/code&amp;gt; branch of UHD, are a good reference on how to use RFNoC from UHD.&lt;br /&gt;
&lt;br /&gt;
The following example is based off of &amp;lt;code&amp;gt;rx_samples_to_file.cpp&amp;lt;/code&amp;gt;. The example can be configured to place an RFNoC block in between the radio and host.&lt;br /&gt;
&lt;br /&gt;
    rfnoc_rx_to_file.cpp&lt;br /&gt;
&lt;br /&gt;
This next example chains a null source to another block and streams the data to the host.&lt;br /&gt;
&lt;br /&gt;
    rfnoc_nullsource_ce_rx.cpp&lt;br /&gt;
&lt;br /&gt;
These examples demonstrate the core features and flexibility of RFNoC.&lt;br /&gt;
&lt;br /&gt;
For more information on UHD and UHD development please refer to the [https://kb.ettus.com/UHD UHD Software Resource page], [https://kb.ettus.com/Getting_Started_with_UHD_and_C%2B%2B Getting Started with UHD and C++ Application Note] or directly to the [http://files.ettus.com/manual/ UHD user manual].&lt;br /&gt;
&lt;br /&gt;
===Getting started with GNU Radio + RFNoC===&lt;br /&gt;
A good way of getting started with RFNoC in a more tangible fashion is to use GNU Radio. The &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; out-of-tree module (OOT) allows a user to use RFNoC blocks in their local GNU Radio / GNU Radio Companion (GRC) installation. This GNU Radio OOT contains blocks that allow you to configure your FPGA through GRC.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' As blocks in the &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; OOT mature, they will be upstreamed to &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt;. Also, &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; is a container used by Ettus Research to disseminate experimental or under-development features for &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt;. It is not a replacement for &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; (in fact, the latter is a requirement for &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;).&lt;br /&gt;
    &lt;br /&gt;
Examples can be run from &amp;lt;code&amp;gt;gr-ettus/examples/rfnoc&amp;lt;/code&amp;gt;, provided that the appropriate RFNoC blocks and compiled into the FPGA image currently running on the USRP.&lt;br /&gt;
&lt;br /&gt;
A couple of rules for building GNU Radio flowgraphs:&lt;br /&gt;
&lt;br /&gt;
* You always need a &amp;lt;code&amp;gt;Device3&amp;lt;/code&amp;gt; object in your flow graph (it does not get connected, see screenshot below).&lt;br /&gt;
* You should have at least two RFNoC blocks connected together, going &amp;lt;code&amp;gt;GNU Radio Block&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;RFNoC Block&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;GNU Radio Block&amp;lt;/code&amp;gt; is not recommended (it will work, but with suboptimal performance).&lt;br /&gt;
&lt;br /&gt;
The GNU Radio flowgraph &amp;lt;code&amp;gt;rfnoc_ddc.grc&amp;lt;/code&amp;gt; is an example that can be run using the default RFNoC image. Below are screenshots of the flowgraph and what it produces.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 1.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Copy Block: In the RFNoC domain, streams of data can not be split as easily as they are in the GNU Radio domain. The “copy” block depicted in the screenshot above serves the function as a stream splitter . It’s main purpose, when “enabled”, is to copy the samples it is getting at its input and putting then into the output, but here it is also serving as a boundary between a RFNoC-domain and a GNURadio-domain. In the flowgraph above. after this boundary is passed, the data stream can easily be split into the two sinks to have them run simultaneously (standard GNU Radio functionality). It is possible to connect the GNU Radio blocks directly to RFNoC blocks without a “copy” block, but only one would work at a time (the other ones would have to be disabled). Another way to split data streams from the RFNoC- domain is to use the ”RFNoC: split stream” block, which would split the streams in the RFNoC domain, but this is not very useful here as we are, in any case, moving into the GNURadio-domain.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 2.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
For more information on GNURadio development please refer to the [http://gnuradio.org/doc/doxygen/ GNURadio user's manual and API].&lt;br /&gt;
&lt;br /&gt;
==Starting a custom RFNoC block using RFNoC Modtool==&lt;br /&gt;
The figure below shows the basic structure of the RFNoC Stack. Corresponding code is needed in each of the three sections in order to build a custom RFNoC block with GNU Radio integration. A tool called RFNoC Modtool was created in order to minimize the effort needed to implement a new RFNoC block. RFNoC Modtool creates a custom GNU Radio OOT module with the basic structure and the necessary files for each of these sections. RFNoC Modtool is currently a part of the GNU Radio OOT module &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 3.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
===RFNoC Modtool Utilization===&lt;br /&gt;
'''NOTE:''' Console outputs may vary depending on the version of UHD the user is running. However, functionality should be the same or similar.&lt;br /&gt;
&lt;br /&gt;
Because the RFNoC Modtool has similar functionality to the &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt; [ [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules gr_modtool] ] provided by GNU Radio, those that have worked with &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt; in the past will find the RFNoC Modtool familiar.&lt;br /&gt;
&lt;br /&gt;
To check the usage of the tool, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool help&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    Usage:&lt;br /&gt;
    rfnocmodtool &amp;lt;command&amp;gt; [options] -- Run &amp;lt;command&amp;gt; with the given options.&lt;br /&gt;
    rfnocmodtool help -- Show a list of commands.&lt;br /&gt;
    rfnocmodtool help &amp;lt;command&amp;gt; -- Shows the help for a given command. &lt;br /&gt;
    &lt;br /&gt;
    List of possible commands:&lt;br /&gt;
    &lt;br /&gt;
    Name      Aliases          Description&lt;br /&gt;
    =====================================================================&lt;br /&gt;
    disable   dis              Disable block (comments out CMake entries for files) &lt;br /&gt;
    info      getinfo,inf      Return information about a given module &lt;br /&gt;
    remove    rm,del           Remove block (delete files and remove Makefile entries) &lt;br /&gt;
    makexml   mx               Make XML file for GRC block bindings &lt;br /&gt;
    add       insert           Add block to the out-of-tree module. &lt;br /&gt;
    newmod    nm,create        Create a new out-of-tree module &lt;br /&gt;
    rename    mv               Rename a block in the out-of-tree module.&lt;br /&gt;
&lt;br /&gt;
===Creating an RFNoC OOT Module===&lt;br /&gt;
&lt;br /&gt;
To start generating an RFNoC OOT module navigate to the source location ( i.e. &amp;lt;code&amp;gt;cd ~/{USER_PREFIX}/src&amp;lt;/code&amp;gt; ) and type:&lt;br /&gt;
    $ rfnocmodtool newmod [NAME OF THE MODULE]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;code&amp;gt;[NAME OF THE MODULE]&amp;lt;/code&amp;gt; is a name the user gives the new module. In the following, a module is created with the name “&amp;lt;code&amp;gt;tutorial&amp;lt;/code&amp;gt;”. If the user does not write the name of the module following the &amp;lt;code&amp;gt;newmod&amp;lt;/code&amp;gt; command the tool will ask for it interactively. Running this command will create a folder containing the basic folders that you may need for a functional module.&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod tutorial&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    Creating out-of-tree module in ./rfnoc-tutorial... Done.&lt;br /&gt;
    Use 'rfnocmodtool add' to add a new block to this currently empty module.&lt;br /&gt;
&lt;br /&gt;
To see what files and directories were created run:&lt;br /&gt;
&lt;br /&gt;
    $ ls rfnoc-tutorial/&lt;br /&gt;
    apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In contrast with &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt;, this includes a folder called &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt;, which is where the UHD/FPGA files are located.&lt;br /&gt;
&lt;br /&gt;
===Adding custom blocks to OOT Module===&lt;br /&gt;
In order to add blocks to your module, navigate to the folder just created and use the &amp;lt;code&amp;gt;add&amp;lt;/code&amp;gt; command of &amp;lt;code&amp;gt;rfnocmodtool&amp;lt;/code&amp;gt;. Continuing with the example above, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ cd rfnoc-tutorial&lt;br /&gt;
    $ rfnocmodtool add [NAME OF THE BLOCK]&lt;br /&gt;
&lt;br /&gt;
For demonstrative purposes, a block named &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; will be created. The &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block will multiply samples that pass through it by a constant. As before, if the name is not given, the tool will ask the user for the name. There are several arguments that can be passed to the tool, but running the tool without any of these arguments will give the following interactive parsing output:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool add gain&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    RFNoC module name identified: tutorial&lt;br /&gt;
    Block/code identifier: gain&lt;br /&gt;
    Enter valid argument list, including default arguments: &lt;br /&gt;
    Add Python QA code? [Y/n] Y&lt;br /&gt;
    Add C++ QA code? [y/N] N&lt;br /&gt;
    Block NoC ID (Hexadecimal): 1111222233334444&lt;br /&gt;
    Skip Block Controllers Generation? [UHD block ctrl files] [y/N] N&lt;br /&gt;
    Skip Block interface files Generation? [GRC block ctrl files] [y/N] N&lt;br /&gt;
&lt;br /&gt;
Hitting &amp;lt;code&amp;gt;enter&amp;lt;/code&amp;gt; on each one of the options will take the default values.&lt;br /&gt;
&lt;br /&gt;
The following is a description of the valid argument list items:&lt;br /&gt;
&lt;br /&gt;
* '''Add Python QA code:''' Not used.&lt;br /&gt;
&lt;br /&gt;
* '''Add C++ QA code:''' Not used.&lt;br /&gt;
&lt;br /&gt;
* '''NoC ID:''' This ID is a Hexadecimal number which serves as identification between the hardware part and the software part of the design. It can be as long as 16 0-9 A-F digits. If a NoC ID is not provided, it will be set to a random number.&lt;br /&gt;
&lt;br /&gt;
* '''Block Controllers Generation:''' The block controllers are the C++ control that the user can apply to the UHD-part of the design. In these files, the user can add more control over this layer of the design. Depending on the complexity of the block it may be possible to add all necessary control using NoCScript (more details on NoCScript can be found in the section labeled UHD Integration). In this case the cpp/hpp block control files generation are not needed. Default is to generate as their existence will be ignored if not edited.&lt;br /&gt;
&lt;br /&gt;
* '''Block Interface:''' Add more design specific functionality to the design at the GNU Radio interface by generating these block-interface files and adding necessary logic.  Depending on the complexity of the block it may be possible to add all necessary control using NoC-Script. In this case the block-interface files are not needed. Default is to generate as their existence will be ignored if not edited.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' If the user does not intend to use the block controllers or is not sure if they are needed, the presence of them in the design will do no harm. It is recommended to add them. This leaves the possibility to add more functions inside them in a future stage of development. &lt;br /&gt;
&lt;br /&gt;
After finishing the parsing, the following files will be generated/edited:&lt;br /&gt;
&lt;br /&gt;
    Adding file 'lib/gain_impl.h'...&lt;br /&gt;
    Adding file 'lib/gain_impl.cc'...&lt;br /&gt;
    Adding file 'include/tutorial/gain.h'...&lt;br /&gt;
    Adding file 'include/tutorial/gain_block_ctrl.hpp'...&lt;br /&gt;
    Adding file 'lib/gain_block_ctrl_impl.cpp'...&lt;br /&gt;
    Editing swig/tutorial_swig.i...&lt;br /&gt;
    Adding file 'python/qa_gain.py'...&lt;br /&gt;
    Editing python/CMakeLists.txt...&lt;br /&gt;
    Adding file 'grc/tutorial_gain.xml'...&lt;br /&gt;
    Adding file 'rfnoc/blocks/gain.xml'...&lt;br /&gt;
    Adding file 'rfnoc/fpga-src/noc_block_gain.v'...&lt;br /&gt;
    rfnoc/testbenches/noc_block_gain_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
==Creating FPGA portion of custom RFNoC Block==&lt;br /&gt;
===RFNoC FPGA User Interface (API)===&lt;br /&gt;
RFNoC blocks or Computation Engines (CEs) in the FPGA use a NoC Shell instance to interface with the rest of RFNoC. NoC Shell implements RFNoC's core functionality: packet muxing and demuxing, flow control, and the settings register bus (i.e. write/read control/status registers). The NoC Shell has an interface to the RFNoC AXI stream crossbar and a user interface. NoC Shell AXI stream interfaces expect CHDR packets with a proper header. See the manual for information on [https://files.ettus.com/manual/page_rtp.html CHDR and SID].&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' AXI Stream is an ARM AMBA standard interface. Xilinx has an [http://www.xilinx.com/support/documentation/ip_documentation/ug761_axi_reference_guide.pdf AXI Reference Guide] with more details on this standard.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 4.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
Many designs will want to use an AXI Stream interface with only sample data. However, as stated earlier, the NoC Shell block expects CHDR packets. To ease interfacing user code, the AXI Wrapper block provides the necessary logic to strip and insert the CHDR header, effectively converting packetized sample data into streaming sample data and vice versa. The example RFNoC blocks &amp;lt;code&amp;gt;noc_block_fft.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noc_block_fir.v&amp;lt;/code&amp;gt; show how AXI Wrapper is used to implement existing Xilinx AXI Stream based IP within a computation engine.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' AXI Wrapper also supports AXI Stream buses for configuration. These buses are driven via the setting register bus and do not have back pressure. They also consume two user register addresses per bus.&lt;br /&gt;
&lt;br /&gt;
The primary user interface consists of four AXI stream interfaces ( &amp;lt;code&amp;gt;tready, tvalid, tlast, tdata&amp;lt;/code&amp;gt; ) and a settings register bus ( 8-bit, valid user register addresses: &amp;lt;code&amp;gt;128-255&amp;lt;/code&amp;gt; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
AXI Stream signals:&lt;br /&gt;
* '''m_axis_data_tdata:''' Input sample data packets &lt;br /&gt;
** Data coming from host or another CE&lt;br /&gt;
* '''s_axis_data_tdata:''' Output sample data packets &lt;br /&gt;
** Data going to another CE or host&lt;br /&gt;
* '''m_axis_data_tready:''' Input signal to CE&lt;br /&gt;
** Used to notify CE that downstream CE is ready for data &lt;br /&gt;
* '''s_axis_data_tready:''' Output signal to CE&lt;br /&gt;
** Used to notify upstream CE that CE is ready for data &lt;br /&gt;
* '''m_axis_data_tvalid:''' Input signal to CE&lt;br /&gt;
** Used to indicate upstream CE has valid data &lt;br /&gt;
* '''s_axis_data_tvalid:''' Output signal to CE&lt;br /&gt;
** Used to indicate to downstream CE that CE has valid data &lt;br /&gt;
* '''m_axis_data_tlast:''' Input signal to CE&lt;br /&gt;
** Used to delimit packets from upstream CE &lt;br /&gt;
* '''s_axis_data_tlast:''' Output signal to CE&lt;br /&gt;
** Used to delimit packets to downstream CE&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; |[[File:rfnoc gsg an 5.png|right|500px|]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 6.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Settings Bus signals:&lt;br /&gt;
* '''set_stb:''' Assert to write '''set_data''' to register at '''set_addr'''ess&lt;br /&gt;
* '''set_addr:''' Register address to set&lt;br /&gt;
* '''set_data:''' Data to set&lt;br /&gt;
* '''rb_data:''' Data to read back&lt;br /&gt;
* '''rb_strobe:''' Assert to read '''rb_data''' from register at '''set_addr'''ess&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; |[[File:rfnoc gsg an 7.png|right|500px|]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
For the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; example block the following architecture is desired (the blue signal has both “I” and “Q” data):&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 8.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;lt;code&amp;gt;rfnoc-tutorial/rfnoc/fpga-src/noc_block_gain.v&amp;lt;/code&amp;gt; that contains the RFNoC block skeleton code that was created when the &amp;lt;code&amp;gt;$ rfnocmodtool add gain&amp;lt;/code&amp;gt; command was run and modify the following sections.&lt;br /&gt;
&lt;br /&gt;
For the setting register that will hold the constant value as well as the read back register:&lt;br /&gt;
&lt;br /&gt;
    '''localparam [7:0] SR_GAIN = SR_USER_REG_BASE;'''&lt;br /&gt;
    localparam [7:0] SR_TEST_REG_1 = SR_USER_REG_BASE + 8'd1;&lt;br /&gt;
    &lt;br /&gt;
    '''wire [15:0] gain;'''&lt;br /&gt;
    '''setting_reg #('''&lt;br /&gt;
      '''.my_addr(SR_GAIN), .awidth(8), .width(16))'''&lt;br /&gt;
    '''sr_gain ('''&lt;br /&gt;
      '''.clk(ce_clk), .rst(ce_rst),'''&lt;br /&gt;
      '''.strobe(set_stb), .addr(set_addr), .in(set_data), .out(gain), .changed());'''&lt;br /&gt;
    &lt;br /&gt;
     always @(posedge ce_clk) begin&lt;br /&gt;
        case(rb_addr)&lt;br /&gt;
          '''8'd0 : rb_data &amp;lt;= {48'd0, gain};'''&lt;br /&gt;
          8'd1 : rb_data &amp;lt;= {32'd0, test_reg_1};&lt;br /&gt;
          default : rb_data &amp;lt;= 64'h0BADC0DE0BADC0DE;&lt;br /&gt;
        endcase&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And for the processing section:&lt;br /&gt;
&lt;br /&gt;
    assign m_axis_data_tready = s_axis_data_tready;&lt;br /&gt;
    assign s_axis_data_tvalid = m_axis_data_tvalid;&lt;br /&gt;
    assign s_axis_data_tlast = m_axis_data_tlast;&lt;br /&gt;
    &lt;br /&gt;
    '''wire [15:0] i = m_axis_data_tdata[31:16];'''&lt;br /&gt;
    '''wire [15:0] q = m_axis_data_tdata[15:0];'''&lt;br /&gt;
    &lt;br /&gt;
    '''wire [31:0] i_mult_gain = i*gain;'''&lt;br /&gt;
    '''wire [31:0] q_mult_gain = q*gain;'''&lt;br /&gt;
    &lt;br /&gt;
    '''assign s_axis_data_tdata = {i_mult_gain[15:0], q_mult_gain[15:0]};'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''  Because the multiplication process can occur in the same clock cycle there is no need for handshaking with the AXI &amp;lt;code&amp;gt;tready, tvalid  and tlast&amp;lt;/code&amp;gt; signals and therefore they are simply passed through the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; RFNoC block.&lt;br /&gt;
&lt;br /&gt;
===Creating and running HDL testbenches===&lt;br /&gt;
In order to make the coding iteration process more efficient, it is recommended to create testbenches for all RFNoC blocks before compiling them into the FPGA image. This allows for flaw and/or bug detection early in the design. RFNoC Modtool provides the structure and files ( e.g. &amp;lt;code&amp;gt;noc_block_{USER_BLOCK_NAME}_tb&amp;lt;/code&amp;gt; ) for the testbenches of each of the OOT blocks that are added with the &amp;lt;code&amp;gt;$ rfnocmodtool add&amp;lt;/code&amp;gt; command. &lt;br /&gt;
&lt;br /&gt;
Below is a figure that shows the structure of the testbench created by the RFNoC Modtool.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 9.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
From the [[Getting Started with RFNoC Development#Adding_custom_blocks_to_OOT_Module|Adding custom blocks to OOT Module section]] where the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block was initially created, the last files generated were:&lt;br /&gt;
&lt;br /&gt;
    rfnoc/testbenches/noc_block_gain_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;noc_block_gain_tb&amp;lt;/code&amp;gt; is a folder generated to contain all the files related to the test bench of the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block. Each time a new OOT block is created, a new folder will be generated as well. &lt;br /&gt;
&lt;br /&gt;
Inside of this folder are the following three files:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt:&amp;lt;/code&amp;gt; this is an empty file used, so far, only to increase the scope of the compilers.&lt;br /&gt;
* &amp;lt;code&amp;gt;noc_block_gain_tb.sv:&amp;lt;/code&amp;gt; this is a ''System Verilog'' file, in which user custom tests are to be located.  This is the '''only''' file that needs to be modified.&lt;br /&gt;
* &amp;lt;code&amp;gt;Makefile:&amp;lt;/code&amp;gt; This file determines the directives that run the simulation.&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;lt;code&amp;gt;rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv&amp;lt;/code&amp;gt; and modify the following lines:&lt;br /&gt;
&lt;br /&gt;
    initial begin : tb_main&lt;br /&gt;
      string s;&lt;br /&gt;
      logic [31:0] random_word;&lt;br /&gt;
      logic [63:0] readback;&lt;br /&gt;
      '''logic [15:0] gain;'''&lt;br /&gt;
    &lt;br /&gt;
    `TEST_CASE_START(&amp;quot;Write / readback user registers&amp;quot;);&lt;br /&gt;
    random_word = $random();&lt;br /&gt;
    '''tb_streamer.write_user_reg(sid_noc_block_gain, noc_block_gain.SR_GAIN, random_word[15:0]);&lt;br /&gt;
    tb_streamer.read_user_reg(sid_noc_block_gain, 0, readback);&lt;br /&gt;
    $sformat(s, &amp;quot;User register 0 incorrect readback! Expected: %0d, Actual %0d&amp;quot;, readback[15:0], random_word[15:0]);&lt;br /&gt;
    `ASSERT_ERROR(readback[15:0] == random_word[15:0], s);'''&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    `TEST_CASE_START(&amp;quot;Test sequence&amp;quot;);&lt;br /&gt;
    '''gain = 100;'''&lt;br /&gt;
    '''tb_streamer.write_user_reg(sid_noc_block_gain, noc_block_gain.SR_GAIN, gain);'''&lt;br /&gt;
      fork&lt;br /&gt;
        begin&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    tb_streamer.recv(recv_payload,md);&lt;br /&gt;
      for (int i = 0; i &amp;lt; SPP/2; i++) begin&lt;br /&gt;
        '''expected_value = i*gain;'''&lt;br /&gt;
&lt;br /&gt;
Create a &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory, verify directory location is &amp;lt;code&amp;gt;rfnoc-tutorial&amp;lt;/code&amp;gt; and run:&lt;br /&gt;
&lt;br /&gt;
    $ mkdir build &amp;amp;&amp;amp; cd build/&lt;br /&gt;
&lt;br /&gt;
The next step is to run &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt;. If PyBOMBS was used to create the development sandbox, &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt; will automatically detect the location of the &amp;lt;code&amp;gt;fpga&amp;lt;/code&amp;gt; repository. If PyBOMBS was not used, the user must provide the location of where the &amp;lt;code&amp;gt;fpga&amp;lt;/code&amp;gt; repository is installed.&lt;br /&gt;
&lt;br /&gt;
If PyBOMBS used, run:&lt;br /&gt;
&lt;br /&gt;
    $ cmake ../&lt;br /&gt;
&lt;br /&gt;
If PyBOMBS not used, run:&lt;br /&gt;
&lt;br /&gt;
    $ cmake [-DUHD_FPGA_DIR=/PATH/TO/FPGA/REPOSITORY] ../&lt;br /&gt;
&lt;br /&gt;
Final output from the &amp;lt;code&amp;gt;$ cmake ../&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
    -- Configuring done&lt;br /&gt;
    -- Generating done&lt;br /&gt;
    -- Build files have been written to: /home/widow/rfnoc/src/rfnoc-tutorial/build&lt;br /&gt;
&lt;br /&gt;
The following command will modify the necessary files and set the correct path to the simulation tools. From now on, every time a new block is added, this command will be run automatically. Remember, only run the following command once for each OOT module (not RFNoC block, but OOT module) created:&lt;br /&gt;
&lt;br /&gt;
    $ make test_tb&lt;br /&gt;
    Scanning dependencies of target test_tb&lt;br /&gt;
    Built target test_tb&lt;br /&gt;
&lt;br /&gt;
Testbenches can be executed by running the command:&lt;br /&gt;
&lt;br /&gt;
    $ make noc_block_[name_of_your_block]_tb &lt;br /&gt;
&lt;br /&gt;
The gain block testbench can be run by running the following command:&lt;br /&gt;
&lt;br /&gt;
    $ make noc_block_gain_tb&lt;br /&gt;
&lt;br /&gt;
The simulation will start.  Final output should look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ========================================================&lt;br /&gt;
    TESTBENCH STARTED: noc_block_gain&lt;br /&gt;
    ========================================================&lt;br /&gt;
    [TEST CASE   1] (t=000000000) BEGIN: Wait for Reset...&lt;br /&gt;
    [TEST CASE   1] (t=000001002) DONE... Passed&lt;br /&gt;
    [TEST CASE   2] (t=000001002) BEGIN: Check NoC ID...&lt;br /&gt;
    Read GAIN NOC ID: 1111222233334444&lt;br /&gt;
    [TEST CASE   2] (t=000001238) DONE... Passed&lt;br /&gt;
    [TEST CASE   3] (t=000001238) BEGIN: Connect RFNoC blocks...&lt;br /&gt;
    Connecting noc_block_tb (SID: 1:0) to noc_block_gain (SID: 0:0)&lt;br /&gt;
    Connecting noc_block_gain (SID: 0:0) to noc_block_tb (SID: 1:0)&lt;br /&gt;
    [TEST CASE   3] (t=000005457) DONE... Passed&lt;br /&gt;
    [TEST CASE   4] (t=000005457) BEGIN: Write / readback user registers...&lt;br /&gt;
    [TEST CASE   4] (t=000006888) DONE... Passed&lt;br /&gt;
    [TEST CASE   5] (t=000006888) BEGIN: Test sequence...&lt;br /&gt;
    [TEST CASE   5] (t=000007633) DONE... Passed&lt;br /&gt;
    ========================================================&lt;br /&gt;
    '''TESTBENCH FINISHED: noc_block_gain'''&lt;br /&gt;
    ''' - Time elapsed:   7700 ns'''             &lt;br /&gt;
    ''' - Tests Expected: 5'''&lt;br /&gt;
    ''' - Tests Run:      5'''&lt;br /&gt;
    ''' - Tests Passed:   5'''&lt;br /&gt;
    '''Result: PASSED'''   &lt;br /&gt;
    ========================================================&lt;br /&gt;
    $finish called at time : 7700 ns : File &amp;quot;/home/widow/rfnoc/src/rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv&amp;quot; Line 10&lt;br /&gt;
    INFO: [USF-XSim-96] XSim completed. Design snapshot 'noc_block_gain_tb_behav' loaded.&lt;br /&gt;
    INFO: [USF-XSim-97] XSim simulation ran for 1000000000us&lt;br /&gt;
    launch_simulation: Time (s): cpu = 00:00:10 ; elapsed = 00:00:12 . Memory (MB): peak = 966.387 ; gain = 54.848 ; free physical = 3080 ; free virtual = 29888&lt;br /&gt;
    # if [string equal $vivado_mode &amp;quot;batch&amp;quot;] {&lt;br /&gt;
    #     puts &amp;quot;BUILDER: Closing project&amp;quot;&lt;br /&gt;
    #     close_project&lt;br /&gt;
    # } else {&lt;br /&gt;
    #     puts &amp;quot;BUILDER: In GUI mode. Leaving project open.&amp;quot;&lt;br /&gt;
    # }&lt;br /&gt;
    BUILDER: Closing project&lt;br /&gt;
    ****** Webtalk v2015.4 (64-bit)&lt;br /&gt;
      **** SW Build 1412921 on Wed Nov 18 09:44:32 MST 2015&lt;br /&gt;
      **** IP Build 1412160 on Tue Nov 17 13:47:24 MST 2015&lt;br /&gt;
        ** Copyright 1986-2015 Xilinx, Inc. All Rights Reserved.&lt;br /&gt;
    &lt;br /&gt;
    source /home/widow/rfnoc/src/rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/xsim_proj/xsim_proj.hw/webtalk/labtool_webtalk.tcl -notrace&lt;br /&gt;
    INFO: [Common 17-206] Exiting Webtalk at Tue Jan 10 23:26:20 2017...&lt;br /&gt;
    INFO: [Common 17-206] Exiting Vivado at Tue Jan 10 23:26:22 2017...&lt;br /&gt;
    Built target noc_block_gain_tb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With every custom block created, a &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; directive will be available to run the simulation from the &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
===Building the FPGA image with a custom user block===&lt;br /&gt;
In this section steps are given on how to initiate an FPGA build while incorporating the user’s custom RFNoC block. The first sections give general information on building RFNoC images. The remaining two sections show how to initiate FPGA builds using a command line interface and using a graphical interface (coming out soon), respectively.&lt;br /&gt;
&lt;br /&gt;
====Discussion on number of blocks in an FPGA image====&lt;br /&gt;
There is a maximum number of blocks that can be added for each device. The maximum amount of computation engines (CEs/RFNoC blocks) that each device can use is 16, but the amount of custom blocks that can be added depends on the device. &lt;br /&gt;
&lt;br /&gt;
If using a device from the X3xx series, from the 16 CEs, there are 6 that will be always added and are not subject to direct customization: 1 CE for the AXI bus, 1 CE for the Ethernet Interface, 2 Radios and 2 Dma FIFOS. Because of this, the application will only allow a number of 10 custom blocks on the X3xx series. &lt;br /&gt;
&lt;br /&gt;
If using a device from the E3xx series, 2 CE engines are always added and are not subject to direct customization: 1 CE for the AXI bus and 1 Radio. This would virtually allow 14 slots for custom blocks. However, given the size of the FPGA on the E3xx series of devices, the application only allows a number of 6 custom blocks. &lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Blocks with higher resource utilization may fill up the FPGA and force the user to include less blocks.&lt;br /&gt;
&lt;br /&gt;
Verify the current maximum values by running the &amp;lt;code&amp;gt;uhd_images_builder.py&amp;lt;/code&amp;gt; utility from the scripts directory.&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&lt;br /&gt;
    $ uhd_image_builder.py --help&lt;br /&gt;
&lt;br /&gt;
====Discussion on FPGA image targets====&lt;br /&gt;
RFNoC target names follow the pattern &amp;lt;code&amp;gt;{DEVICE}_RFNoC_{BUILD_TYPE}&amp;lt;/code&amp;gt; with the following build types: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HG:&amp;lt;/code&amp;gt; 1GigE on SFP+ Port0, 10Gig on SFP+ Port&lt;br /&gt;
* &amp;lt;code&amp;gt;XG:&amp;lt;/code&amp;gt; 10GigE on both SFP+ ports&lt;br /&gt;
* &amp;lt;code&amp;gt;HLS:&amp;lt;/code&amp;gt; Vivado High Level Synthesis enabled&lt;br /&gt;
* &amp;lt;code&amp;gt;sgX:&amp;lt;/code&amp;gt; Speed grade for E300 devices (1 or 3)&lt;br /&gt;
&lt;br /&gt;
Some examples are:&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_XG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_XG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_HLS_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_HLS_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;E310_RFNOC&amp;lt;/code&amp;gt; (this is for the speed grade 1 FPGA version of E310, append &amp;lt;code&amp;gt;_sg3&amp;lt;/code&amp;gt; for speed grade 3)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' E310, E312 and E313 all have the same FPGA hardware and therefore will use the &amp;lt;code&amp;gt;E310_RFNOC_{BUILD_TYPE}&amp;lt;/code&amp;gt; target. USRP E3xx devices have either &amp;lt;code&amp;gt;sg1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sg3&amp;lt;/code&amp;gt; hardware, please visit [http://files.ettus.com/e3xx_images/README here] to find out how to differentiate.&lt;br /&gt;
&lt;br /&gt;
Additional information about the build targets can be found at the build instructions for USRP3, found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here].&lt;br /&gt;
&lt;br /&gt;
====Image building using the command line====&lt;br /&gt;
The script &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; is used to generate the NoC block instantiation file and build the FPGA image. Run the help menu by typing:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&lt;br /&gt;
    $ ./uhd_image_builder.py --help&lt;br /&gt;
         &lt;br /&gt;
    usage: uhd_image_builder.py [-h] [-I INCLUDE_DIR [INCLUDE_DIR ...]]&lt;br /&gt;
                                [-m MAX_NUM_BLOCKS] [--fill-with-fifos]&lt;br /&gt;
                                [-o OUTFILE] [-d DEVICE] [-t TARGET] [-g] [-c]&lt;br /&gt;
                                [blocks [blocks ...]]&lt;br /&gt;
    &lt;br /&gt;
    Generate the NoC block instantiation file&lt;br /&gt;
    &lt;br /&gt;
    positional arguments:&lt;br /&gt;
      blocks                List block names to instantiate.&lt;br /&gt;
    &lt;br /&gt;
    optional arguments:&lt;br /&gt;
      -h, --help            show this help message and exit&lt;br /&gt;
      -I INCLUDE_DIR [INCLUDE_DIR ...], --include-dir INCLUDE_DIR [INCLUDE_DIR ...]&lt;br /&gt;
                            Path directory of the RFNoC Out-of-Tree module&lt;br /&gt;
      -m MAX_NUM_BLOCKS, --max-num-blocks MAX_NUM_BLOCKS&lt;br /&gt;
                            Maximum number of blocks (Max. Allowed for x310|x300:&lt;br /&gt;
                            10, for e300: 6)&lt;br /&gt;
      --fill-with-fifos     If the number of blocks provided was smaller than the&lt;br /&gt;
                            max number, fill the rest with FIFOs&lt;br /&gt;
      -o OUTFILE, --outfile OUTFILE&lt;br /&gt;
                            Output /path/filename - By running this directive, you&lt;br /&gt;
                            won't build your IP&lt;br /&gt;
      -d DEVICE, --device DEVICE&lt;br /&gt;
                            Device to be programmed [x300, x310, e310]&lt;br /&gt;
      -t TARGET, --target TARGET&lt;br /&gt;
                            Build target - image type [X3X0_RFNOC_HG,&lt;br /&gt;
                            X3X0_RFNOC_XG, E310_RFNOC_sg3...]&lt;br /&gt;
      -g, --GUI             Open Vivado GUI during the FPGA building process&lt;br /&gt;
      -c, --clean-all       Cleans the IP before a new build&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are details on the usage of the script which is followed by an example:&lt;br /&gt;
&lt;br /&gt;
'''Blocks:''' The first arguments are the names of RFNoC blocks that the user wants to have compiled into the new image which are separated by a space. They can be custom blocks from the user’s OOT module or from the ones that are provided from Ettus, or a combination. Blocks provided by Ettus Research are listed (among other sources necessary for the FPGA build) in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/lib/rfnoc/Makefile.srcs&amp;lt;/code&amp;gt; file. &lt;br /&gt;
&lt;br /&gt;
These blocks can be identified by the following pattern: &lt;br /&gt;
&lt;br /&gt;
    noc_block_{NAME}.v&lt;br /&gt;
&lt;br /&gt;
However, as all the RFNoC blocks have the same &amp;lt;code&amp;gt;noc_block_&amp;lt;/code&amp;gt; prefix, for simplicity this prefix is omitted when listing the blocks in the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; utility. As an example of the incorrect and correct way of adding blocks, consider the following examples when adding the &amp;lt;code&amp;gt;noc_block_null_source_sink&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noc_block_siggen&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
Incorrect method:  &lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py noc_block_null_source_sink noc_block_siggen ...&lt;br /&gt;
&lt;br /&gt;
Correct method:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py null_source_sink siggen ...&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Blocks generated by the RFNoC Modtool follow the same naming convention.&lt;br /&gt;
&lt;br /&gt;
There is an increasing list of pre-built blocks. Here is a sample:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;axi_fifo_loopback&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;axi_dma_fifo&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fir_filter&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fft&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;null_source_sink&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;schmidl_cox&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;packet_resizer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;split_stream&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;vector_iir&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;addsub&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;window&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;keep_one_in_n&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;pfb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;export_io&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;conv_encoder_qpsk&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;logpwr&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fosphor&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;moving_avg&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ddc&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;duc&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RFNoC related blocks generally reside in &amp;lt;code&amp;gt;fpga/usrp3/lib/rfnoc/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!Block&lt;br /&gt;
!Filename&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FIFO&lt;br /&gt;
|noc_block_axi_fifo_loopback.v&lt;br /&gt;
|Simple FIFO loopback / passthrough block.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FFT&lt;br /&gt;
|noc_block_fft.v&lt;br /&gt;
|Xilinx coregen based Fast Fourier Transform up to length 4096.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FIR&lt;br /&gt;
|noc_block_fir_filter.v&lt;br /&gt;
|Xilinx coregen based Finite Impulse Response Filter, 41 taps, reconfigurable tap coefficients.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|Window&lt;br /&gt;
|noc_block_window.v&lt;br /&gt;
|Windowing block for use with FFT block.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Vector IIR&lt;br /&gt;
|noc_block_vector_iir.v&lt;br /&gt;
|Single pole IIR with configurable coefficients that filters data along vectors (i.e. parallel streams of samples). Useful with FFT output.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Keep One in N&lt;br /&gt;
|noc_block_keep_one_in_n.v&lt;br /&gt;
|Keeps one packet every N packets.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|AddSub&lt;br /&gt;
|noc_block_addsub.v&lt;br /&gt;
|Example of using multiple block ports in a single RFNoC block to add and subtract streams.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Null Source Sink&lt;br /&gt;
|noc_block_null_source_sink.v&lt;br /&gt;
|Generates dummy packets and can consume packets at a configurable rate. Useful for testing.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Packet Resizer&lt;br /&gt;
|noc_block_packet_resizer.v&lt;br /&gt;
|Resizes input packets to a configurable size (larger or smaller than source packets).&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Split Stream&lt;br /&gt;
|noc_block_split_stream.v&lt;br /&gt;
|Replicates an input stream to a configurable number of output streams.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' There is a restriction on the amount of blocks that can added into the FPGA image, see the section in this Application Note labeled [[Getting_Started_with_RFNoC_Development#Discussion_on_number_of_blocks_in_an_FPGA_image|Discussion on number of blocks in an FPGA image]] for more information. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-I INCLUDE_DIR:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; directive provides the path to the users &amp;lt;code&amp;gt;rfnoc/fpga-src&amp;lt;/code&amp;gt; directory which contains the custom blocks. This path is needed by the Xilinx Vivado tool. Inside the &amp;lt;code&amp;gt;fpga-src&amp;lt;/code&amp;gt; directory there is a file called &amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt; that contains the path of the OOT module and a list of all the custom OOT blocks. This is an auto generated file, which is amended every time a new block is added to the OOT module. Manually modifying this file is not recommended. If there are multiple OOT modules with various custom blocks that reside in different directories the way to include them all is by separating the different paths by a space (e.g. &amp;lt;code&amp;gt;-I /first/OOT/path/ /second/OOT/path/&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-d DEVICE:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; directive directs the script on which USRP device the build is for. If no &amp;lt;code&amp;gt;–d&amp;lt;/code&amp;gt; is included the default is &amp;lt;code&amp;gt;–d x310&amp;lt;/code&amp;gt;. Generation-3 USRPs and above all support RFNoC.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-t TARGET:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;–t&amp;lt;/code&amp;gt; directive directs the script on which type of image to build for the chosen device. With each USRP device there are several build options to choose from. Detailed information about the build targets can be found at the build instructions for USRP3, found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here]. If &amp;lt;code&amp;gt;-t&amp;lt;/code&amp;gt; is not included, a default target will be chosen for the given device. For example, the default &amp;lt;code&amp;gt;X310_RFNOC_HG&amp;lt;/code&amp;gt; target builds for the &amp;lt;code&amp;gt;–d x310&amp;lt;/code&amp;gt; device. More details on targets can be found in the section of this Application Note labeled [[Getting Started with RFNoC Development#Discussion_on_FPGA_image_targets|Discussion on FPGA image targets]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-m MAX_NUM_BLOCKS:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;–m&amp;lt;/code&amp;gt; directive specifies the max number of RFNoC blocks to build on the FPGA image. An RFNoC image does not need to fill all available slots with RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--fill-with-fifos:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;--fill-with-fifos&amp;lt;/code&amp;gt; directive will fill the empty RFNoC block slots with FIFOS. As an example, if a user indicates three RFNoC blocks by name and also specifies &amp;lt;code&amp;gt;–m 5&amp;lt;/code&amp;gt; then the other two slots will be filed with FIFOs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-o OUTFILE:&amp;lt;/code&amp;gt; With the &amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; directive, the RFNoC blocks instantiation file is generated and saved at the desired path with the given name for the user to inspect. The FPGA image will NOT build if this directive is provided. The purpose of the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script is to auto generate an instantiation file and populate the source files needed for the Xilinx Vivado tool to build the FPGA image, however, it may be desirable to only see the effect of adding a custom OOT module in the &amp;lt;code&amp;gt;fpga/&amp;lt;/code&amp;gt; directory, or for inspecting the instantiation file. When the directive is not provided the &amp;lt;code&amp;gt;rfnoc_ce_auto_inst_x3x0.v&amp;lt;/code&amp;gt; file is overwritten and the FPGA image build process will start automatically (standard use).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-g, --GUI:&amp;lt;/code&amp;gt; Open Vivado GUI during the FPGA building process&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-c, --clean-all:&amp;lt;/code&amp;gt; Cleans the IP before a new build&lt;br /&gt;
&lt;br /&gt;
Here is how to create an X310 FPGA image incorporating the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block that was created earlier in this Application Note:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts     &lt;br /&gt;
    $ ./uhd_image_builder.py gain ddc fft -I {USER_PREFIX}/src/rfnoc-tutorial/rfnoc/fpga-src/ -d x310 -t X310_RFNOC_HG -m 6 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end of a successful compilation process, write the new image to a USRP. The following command will load the new image. Update the &amp;lt;code&amp;gt;{IP_Address}&amp;lt;/code&amp;gt; of the USRP and &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; to the appropriate values for your configuration before running the command.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args “type=x300,addr={IP_ADDRESS}” --fpga-path {USER_PREFIX}/src/uhd-fpga/usrp3/top/x300/build/usrp_x310_fpga_RFNOC_HG.bit&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' &lt;br /&gt;
* The FPGA image building process may take over an hour.&lt;br /&gt;
&lt;br /&gt;
* FPGA images are specific to the USRP device NOT the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. Additional instructions on flashing a custom image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
&lt;br /&gt;
* [Environment setup] - The &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script will also set up the Xilinx Vivado environment by automatically running the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{device}&amp;lt;/code&amp;gt; directory. The &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script assumes that Xilinx Vivado is installed in the default location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.  If the installation is in a different directory the &amp;lt;code&amp;gt;setupenv_base.sh&amp;lt;/code&amp;gt; script will need to be modified. The script is located at: &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts/setupenv_base.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Besides the custom &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block, a &amp;lt;code&amp;gt;DDC&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FFT&amp;lt;/code&amp;gt; block are also being added along with three &amp;lt;code&amp;gt;FIFOs&amp;lt;/code&amp;gt;.  The &amp;lt;code&amp;gt;DDC&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;FFT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FIFO&amp;lt;/code&amp;gt; blocks are already in the script's path and therefore do not need their path specified (they ship with the Ettus Research FPGA code). The reason three FIFOs are added is because the max number of blocks was specified to be 6 ( &amp;lt;code&amp;gt;-m 6&amp;lt;/code&amp;gt; ) and since only 3 blocks were specifically named the other three slots are filled with FIFOs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 10.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Instructions on flashing the image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series. FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. &lt;br /&gt;
&lt;br /&gt;
Once the newly compiled image is loaded onto a USRP X3xx running the following command will show what RFNoC blocks are available on the FPGA:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * '''Block_0'''&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The reason the custom block is called &amp;lt;code&amp;gt;Block_0&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;gain_0&amp;lt;/code&amp;gt; is because there is still host side software/files that need updated in order for this block to populate it’s proper name. A following section (UHD Integration) will step through the process of updating those host side files.&lt;br /&gt;
&lt;br /&gt;
====Using a graphical interface====&lt;br /&gt;
A graphical user interface for FPGA generation and building is shipped along with the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script. This intuitive application aids in setting up a custom FPGA build. &lt;br /&gt;
&lt;br /&gt;
This utility is located in the same &amp;lt;code&amp;gt;scripts&amp;lt;/code&amp;gt; directory as &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
To run it, enter the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts/&lt;br /&gt;
    $ ./uhd_image_builder_gui&lt;br /&gt;
&lt;br /&gt;
The application will then be launched:&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 11.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''1. Select build target:''' In this panel the available build targets are listed. This list may vary depending on which branch of the FPGA repository this user is using. Only RFNoC targets are listed. The build type descriptions are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HG:&amp;lt;/code&amp;gt; 1GigE on SFP+ Port0, 10Gig on SFP+ Port1&lt;br /&gt;
* &amp;lt;code&amp;gt;XG:&amp;lt;/code&amp;gt; 10GigE on both SFP+ ports&lt;br /&gt;
* &amp;lt;code&amp;gt;HLS:&amp;lt;/code&amp;gt; Vivado High Level Synthesis enabled&lt;br /&gt;
* &amp;lt;code&amp;gt;sgX:&amp;lt;/code&amp;gt; Speed grade for E300 devices (1 or 3)&lt;br /&gt;
&lt;br /&gt;
'''2. List of blocks available:''' In this panel the available blocks are listed that can be included into a custom design. This list separates the RFNoC blocks provided by Ettus Research and the OOT modules and corresponding blocks that the user adds. Given the hardware differences between the X3xx and E3xx devices, this list will dynamically change when a different device is selected from the panel on the left. This implies that it is necessary to add the OOT modules for each device independently. This is accomplished by using the &amp;lt;code&amp;gt;Add OOT Blocks&amp;lt;/code&amp;gt; feature of the application, details of which are explained at #7 (&amp;lt;code&amp;gt;Add OOT Blocks&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
'''3. Blocks in current design:''' This panel will be populated by adding elements from the available blocks. All the blocks listed in here will be compiled into the FPGA custom image. There is a maximum number of blocks that can be added for each device. See the section in this App Note labeled Discussion on number of blocks in an FPGA image for more information. &lt;br /&gt;
&lt;br /&gt;
'''4. Add button (&amp;gt;&amp;gt;):''' Manually add the blocks from the central panel into your design.&lt;br /&gt;
&lt;br /&gt;
'''5. Remove button (&amp;lt;&amp;lt;):''' Remove blocks from the current design (far-left panel)&lt;br /&gt;
&lt;br /&gt;
'''6. Fill with FIFOs:''' By checking this box, the design will fill any available/unspecified block slots with FIFOs. The number of FIFO blocks that will be instantiated is based on the rules of amount of blocks explained at #3. When less than the max amount of blocks are needed for certain implementation, many users choose to fill their design with FIFO blocks. &lt;br /&gt;
&lt;br /&gt;
'''7. Open Vivado GUI:''' Open Vivado GUI during the FPGA building process. This allows the user to save a Vivado project with all IP and work within the Vivado GUI for development.&lt;br /&gt;
&lt;br /&gt;
'''8. Clean IP:''' Cleans the IP before a new build (recompiles all IP).&lt;br /&gt;
&lt;br /&gt;
'''9. Add OOT blocks:''' Manually add RFNoC Modtool-generated OOT modules by pointing the application to the &amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt; file, which is located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/{USER-OOT-moddir}/rfnoc/fpga-srcs/&amp;lt;/code&amp;gt; directory. After adding this file, blocks will appear under “&amp;lt;code&amp;gt;OOT blocks for XXXX devices&amp;lt;/code&amp;gt;”&lt;br /&gt;
&lt;br /&gt;
'''10. Import from GRC:''' If the user has a GNU Radio flowgraph with RFNoC blocks already in it, this application can read what RFNoC blocks are in the flowgraph and populate the &amp;lt;code&amp;gt;Blocks in current design&amp;lt;/code&amp;gt; section of the application with the necessary RFNoC blocks. '''NOTE:''' All RFNoC blocks pulled from a &amp;lt;code&amp;gt;.grc&amp;lt;/code&amp;gt; file must be in the of &amp;lt;code&amp;gt;List of blocks available&amp;lt;/code&amp;gt; before beginning the build.&lt;br /&gt;
&lt;br /&gt;
'''11. Show Instantiation File:''' The application auto-generates the instantiation file that is going to be used by Vivado to build the FPGA image. This instantiation file can be viewed and edited before starting the build by clicking this button. &lt;br /&gt;
&lt;br /&gt;
'''12. Generate .bit file:''' Start the build by clicking this button. &lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' See the latter end of the previous section for additional information on what to expect once the compile has started as well as final output.&lt;br /&gt;
&lt;br /&gt;
==Creating Software/Host portion of custom RFNoC Block==&lt;br /&gt;
Now that the FPGA portion is complete the next step is to add software integration to UHD and GNU Radio as depicted in the RFNoC Stack below.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 12.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
===UHD integration===&lt;br /&gt;
Despite the data processing happening on the FPGA, the host software still has a lot of responsibilities in order for an RFNoC application to function. For example, it needs to know which settings registers are available within an RFNoC block, or what kind of input and output a block has. All of this information goes into the &amp;lt;code&amp;gt;Block Declaration&amp;lt;/code&amp;gt;, which is an XML file that is readable by UHD. Often, some simple logic needs to be embedded in the XML file, which we can do by using a simple scripting language called Noc-Script. Changes to the block declaration file are immediately imported into UHD every time an application is executed, and therefore, no software development toolchain needs to be set up.&lt;br /&gt;
&lt;br /&gt;
The list of things declared by the block declaration file includes:&lt;br /&gt;
&lt;br /&gt;
* Block name and Noc-ID&lt;br /&gt;
* Registers&lt;br /&gt;
* Inputs and outputs (including types)&lt;br /&gt;
&lt;br /&gt;
In some cases, additional C++ code is required to properly control a block from software. In this case, a &amp;lt;code&amp;gt;Block Controller&amp;lt;/code&amp;gt; file is required as well as the declaration file. In most cases, the default block controller provided by UHD is sufficient, so no C++ code needs to be written. Writing custom block controllers requires more effort, and means having to set up a programming toolchain. A common reason to write custom C++ block controllers is if setting a register requires a lot of computation, which is not feasible to do within a block declaration file (e.g., using Noc-Script).&lt;br /&gt;
&lt;br /&gt;
Skeleton code for both the block declaration and the block controller (if required) can be generated through RFNoC Modtool.&lt;br /&gt;
&lt;br /&gt;
Because the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block does not require anything other than simply reading and writing to a single register the default block controller will suffice for this example. However, we will need to add information about the register.&lt;br /&gt;
&lt;br /&gt;
Open the &amp;lt;code&amp;gt;gain.xml&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;/rfnoc-tutorial/rfnoc/blocks&amp;lt;/code&amp;gt; directory and add the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;&amp;lt;!--Default XML file--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;nocblock&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;gain&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;blockname&amp;gt;gain&amp;lt;/blockname&amp;gt;&lt;br /&gt;
      &amp;lt;ids&amp;gt;&lt;br /&gt;
        &amp;lt;id revision=&amp;quot;0&amp;quot;&amp;gt;1111222233334444&amp;lt;/id&amp;gt;&lt;br /&gt;
      &amp;lt;/ids&amp;gt;&lt;br /&gt;
      '''&amp;lt;nowiki&amp;gt;&amp;lt;!-- Registers --&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;registers&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;setreg&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;name&amp;gt;GAIN&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;address&amp;gt;128&amp;lt;/address&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;/setreg&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;/registers&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;nowiki&amp;gt;&amp;lt;!-- Args --&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;args&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;arg&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;name&amp;gt;gain&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;double&amp;lt;/type&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;value&amp;gt;1.0&amp;lt;/value&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;check&amp;gt;GE($gain, 0.0) AND LE($gain, 32767.0)&amp;lt;/check&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;check_message&amp;gt;Invalid gain.&amp;lt;/check_message&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;action&amp;gt;'''&lt;br /&gt;
            '''SR_WRITE(&amp;quot;GAIN&amp;quot;, IROUND($gain))'''&lt;br /&gt;
          '''&amp;lt;/action&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;/arg&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;/args&amp;gt;'''&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!--One input, one output. If this is used, better have all the info the C++ file.--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;ports&amp;gt;&lt;br /&gt;
        &amp;lt;sink&amp;gt;&lt;br /&gt;
          '''&amp;lt;name&amp;gt;in0&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;sc16&amp;lt;/type&amp;gt;'''&lt;br /&gt;
        &amp;lt;/sink&amp;gt;&lt;br /&gt;
        &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
          '''&amp;lt;name&amp;gt;out0&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;sc16&amp;lt;/type&amp;gt;'''&lt;br /&gt;
        &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;/ports&amp;gt;&lt;br /&gt;
    &amp;lt;/nocblock&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GNU Radio Integration===&lt;br /&gt;
GNU Radio is built around the concept of blocks, similarly to RFNoC. When mapping RFNoC into an application, the simple constraint is made that every RFNoC block maps to a single GNU Radio block. Thus, when creating mixed GNU Radio/RFNoC applications, there is a very clear 1:1 mapping between what’s happening in RFNoC and GNU Radio.&lt;br /&gt;
&lt;br /&gt;
Since most RFNoC blocks behave very similar to one another from GNU Radio’s perspective, it is generally not required to write C++ code for another block. Rather, a default block provided by RFNoC can be used with appropriate configuration. However, in some cases it may be desirable or even necessary to write a custom GNU Radio block for more specific controlling of the underlying RFNoC block. GNU Radio allows writing blocks in either C++ or Python, but since UHD and RFNoC do not have a Python API, a custom wrapper for an RFNoC block needs to be written in C++. RFNoC Modtool will create skeleton files for these purpose.&lt;br /&gt;
&lt;br /&gt;
The most popular and effective way to use GNU Radio is through the graphical interface, the GNU Radio Companion (GRC). GRC requires a separate description of every GNU Radio block in order to become available in the graphical UI, and the same is true for an RFNoC block that is wrapped in a GNU Radio block (even if the generic RFNoC block wrapper is used). For GNU Radio 3.7 and earlier, GRC bindings for blocks are written as XML files with interspersed Cheetah or Python statements. For a more detailed tutorial on how to write these files, refer to the [http://gnuradio.org/redmine/projects/gnuradio/wiki GNU Radio Documentation] and associated [http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials tutorials].&lt;br /&gt;
&lt;br /&gt;
====GNU Radio Block Code====&lt;br /&gt;
&lt;br /&gt;
* C++ or Python, although RFNoC blocks need to be written in C++ (if at all)&lt;br /&gt;
* How does GNU Radio interface to RFNoC?&lt;br /&gt;
** via C++ infrastructure code in &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; provides a base RFNoC block class&lt;br /&gt;
** Users extend base class for their RFNoC blocks&lt;br /&gt;
** Many blocks can use base class “as is”&lt;br /&gt;
** No C++ or Python code!&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-tutorial/lib/gain_impl.cc&amp;lt;/code&amp;gt;&lt;br /&gt;
** The gain block does not need anything additional&lt;br /&gt;
&lt;br /&gt;
====GNU Radio Companion Bindings====&lt;br /&gt;
* XML&lt;br /&gt;
* Describes GNU Radio blocks to GRC&lt;br /&gt;
* No recompilation&lt;br /&gt;
* Requirement of GNU Radio Companion&lt;br /&gt;
* Not strictly necessary for GNU Radio&lt;br /&gt;
* Tutorial on how to write them:&lt;br /&gt;
** [http://gnuradio.org/redmine/projects/gnuradio/wiki/GNURadioCompanion http://gnuradio.org/redmine/projects/gnuradio/wiki/GNURadioCompanion ]&lt;br /&gt;
* Skeleton file generated by RFNoC Modtool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Open the &amp;lt;code&amp;gt;tutorial-gain.xml&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;rfnoc-tutorial/grc&amp;lt;/code&amp;gt; directory and edit as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;block&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;RFNoC: gain&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;key&amp;gt;tutorial_gain&amp;lt;/key&amp;gt;&lt;br /&gt;
      &amp;lt;category&amp;gt;tutorial&amp;lt;/category&amp;gt;&lt;br /&gt;
      &amp;lt;import&amp;gt;import tutorial&amp;lt;/import&amp;gt;&lt;br /&gt;
      &amp;lt;make&amp;gt;tutorial.gain(&lt;br /&gt;
        self.device3,&lt;br /&gt;
        uhd.stream_args( \# TX Stream Args&lt;br /&gt;
            cpu_format=&amp;quot;'''fc32'''&amp;quot;,&lt;br /&gt;
            otw_format=&amp;quot;'''sc16'''&amp;quot;,&lt;br /&gt;
            args=&amp;quot;gr_vlen={0},{1}&amp;quot;.format(${grvlen}, &amp;quot;&amp;quot; if $grvlen == 1 else &amp;quot;spp={0}&amp;quot;.format($grvlen)),&lt;br /&gt;
        ),&lt;br /&gt;
        uhd.stream_args( \# RX Stream Args&lt;br /&gt;
            cpu_format=&amp;quot;'''fc32'''&amp;quot;,&lt;br /&gt;
            otw_format=&amp;quot;'''sc16'''&amp;quot;,&lt;br /&gt;
            args=&amp;quot;gr_vlen={0},{1}&amp;quot;.format(${grvlen}, &amp;quot;&amp;quot; if $grvlen == 1 else &amp;quot;spp={0}&amp;quot;.format($grvlen)),&lt;br /&gt;
        ),&lt;br /&gt;
        $block_index, $device_index,&lt;br /&gt;
    )&lt;br /&gt;
    '''self.$(id).set_arg(&amp;quot;gain&amp;quot;, $gain)'''&lt;br /&gt;
      '''&amp;lt;/make&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;callback&amp;gt;set_arg(&amp;quot;gain&amp;quot;, $gain)&amp;lt;/callback&amp;gt;'''&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'param' node for every Parameter you want settable from the GUI.&lt;br /&gt;
           Sub-nodes:&lt;br /&gt;
           * name&lt;br /&gt;
           * key (makes the value accessible as $keyname, e.g. in the make node)&lt;br /&gt;
           * type --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
         .  &lt;br /&gt;
         .&lt;br /&gt;
         .&lt;br /&gt;
    &lt;br /&gt;
        &amp;lt;option&amp;gt;&lt;br /&gt;
          &amp;lt;name&amp;gt;Byte&amp;lt;/name&amp;gt;&lt;br /&gt;
          &amp;lt;key&amp;gt;u8&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;/option&amp;gt;&lt;br /&gt;
      &amp;lt;/param&amp;gt;&lt;br /&gt;
      &amp;lt;param&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;'''Gain'''&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;'''gain'''&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;value&amp;gt;'''1.0'''&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''real'''&amp;lt;/type&amp;gt;&lt;br /&gt;
      &amp;lt;/param&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'sink' node per input. Sub-nodes:&lt;br /&gt;
           * name (an identifier for the GUI)&lt;br /&gt;
           * type&lt;br /&gt;
           * vlen&lt;br /&gt;
           * optional (set to 1 for optional inputs) --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;sink&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;in&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''complex'''&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;vlen&amp;gt;$grvlen&amp;lt;/vlen&amp;gt;&lt;br /&gt;
        &amp;lt;domain&amp;gt;rfnoc&amp;lt;/domain&amp;gt;&lt;br /&gt;
      &amp;lt;/sink&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'source' node per output. Sub-nodes:&lt;br /&gt;
           * name (an identifier for the GUI)&lt;br /&gt;
           * type&lt;br /&gt;
           * vlen&lt;br /&gt;
           * optional (set to 1 for optional inputs) --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;out&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''complex'''&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;vlen&amp;gt;$grvlen&amp;lt;/vlen&amp;gt;&lt;br /&gt;
        &amp;lt;domain&amp;gt;rfnoc&amp;lt;/domain&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Indentation spacing is important in the &amp;lt;code&amp;gt;&amp;lt;make&amp;gt;&amp;lt;/code&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
===Compile, Install and Verify===&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/rfnoc-tutorial/build&lt;br /&gt;
    $ make install&lt;br /&gt;
    &lt;br /&gt;
    $ uhd_usrp_probe &lt;br /&gt;
    &lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * '''gain_0'''&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' In the case where the &amp;lt;code&amp;gt;gain_0&amp;lt;/code&amp;gt; does not appear but &amp;lt;code&amp;gt;Block_0&amp;lt;/code&amp;gt; does: Most likely, the XML block declaration file (see [[Getting_Started_with_RFNoC_Development#UHD_integration|UHD Integration]] section) for the block contains a NoC-ID that does not match with any NoC-ID defined in the hardware part of the design. The user has to be certain that the description files are up-to-date and that the NoC-ID matches in the SW and HW side. See the [[Getting_Started_with_RFNoC_Development#UHD_integration|UHD Integration]] section to update those host side files.&lt;br /&gt;
&lt;br /&gt;
==Testing out the custom block==&lt;br /&gt;
At this point the custom &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; RFNoc Block (Computation Engine) can be used within a GNU Radio flowgraph. Below is an example GRC flowgraph using our new block as well as the output application it produces. &lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 13.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Copy Block: In the RFNoC domain, streams of data can not be split as easily as they are in the GNU Radio domain. The “copy” block depicted in the screenshot above serves the function as a stream splitter . It’s main purpose, when “enabled”, is to copy the samples it is getting at its input and putting then into the output, but here it is also serving as a boundary between a RFNoC-domain and a GNURadio-domain. In the flowgraph above. after this boundary is passed, the data stream can easily be split into the two sinks to have them run simultaneously (standard GNU Radio functionality). It is possible to connect the GNU Radio blocks directly to RFNoC blocks without a “copy” block, but only one would work at a time (the other ones would have to be disabled). Another way to split data streams from the RFNoC-domain is to use the ”RFNoC: split stream” block, which would split the streams in the RFNoC domain, but this is not very useful here as we are, in any case, moving into the GNURadio-domain.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 14.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
===Xilinx Vivado===&lt;br /&gt;
====Compile issues====&lt;br /&gt;
=====Synthesis is failing=====&lt;br /&gt;
Verify all the correct Xilinx [[Getting Started with RFNoC Development#Prerequisites|prerequisite software]] is installed.&lt;br /&gt;
&lt;br /&gt;
Additional helpful information can be found in the following Xilinx forum posts:&lt;br /&gt;
* https://forums.xilinx.com/t5/Synthesis/Synthesis-failed-without-reporting-any-error/td-p/686000&lt;br /&gt;
* https://forums.xilinx.com/t5/Installation-and-Licensing/Vivado-on-Linux-synthesis-fails-with-no-error-message/td-p/732143&lt;br /&gt;
&lt;br /&gt;
====Environment Setup====&lt;br /&gt;
The &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script will also set up the Xilinx Vivado environment by automatically running the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{device}&amp;lt;/code&amp;gt; directory. The &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script assumes that Xilinx Vivado is installed in the default location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;. If the installation is in a different directory, then the &amp;lt;code&amp;gt;setupenv_base.sh&amp;lt;/code&amp;gt; script will need to be modified. The script is located at: &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3_rfnoc/tools/scripts/setupenv_base.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Links and Additional Resources==&lt;br /&gt;
===RFNoC additional resources===&lt;br /&gt;
* [https://kb.ettus.com/RFNoC RFNoC Primary Application Note]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Intro.pdf RFNoC Introduction]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_FPGA.pdf RFNoC Deep Dive: FPGA]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Host.pdf RFNoC Deep Dive: Host side]&lt;br /&gt;
* [https://www.youtube.com/watch?v=8cPd3t88djE Video: RFNoC presented at Wireless @ Virginia Tech, 2015 ]&lt;br /&gt;
** Explaining the slides of Intro, FPGA and Host presentations above (in that order).&lt;br /&gt;
&lt;br /&gt;
===GNU Radio resources===&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules GNU Radio OutOfTree Modules tutorial]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGRFromSource GNU Radio Installation]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/Tutorials GNU Radio Tutorials]&lt;br /&gt;
&lt;br /&gt;
===UHD resources===&lt;br /&gt;
* [https://kb.ettus.com/UHD UHD Software Resources Page]&lt;br /&gt;
* [http://files.ettus.com/manual/md_usrp3_build_instructions.html USRP3 build instructions]&lt;br /&gt;
* [http://files.ettus.com/manual/ UHD Manual]&lt;br /&gt;
&lt;br /&gt;
===Other resources===&lt;br /&gt;
* [https://www.xilinx.com/support/documentation/ip_documentation/ug761_axi_reference_guide.pdf Xilinx - AXI reference guide]&lt;br /&gt;
* [https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux UHD + GNU Radio Application Note (Linux)]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/pybombs/wiki PyBOMBS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=3317</id>
		<title>Getting Started with RFNoC Development</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=3317"/>
				<updated>2017-01-17T01:29:18Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* Create development environment using PyBOMBS */ Added ref to pybombs config foo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-823'''&lt;br /&gt;
&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-07-12&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Martin Braun&amp;lt;br&amp;gt; Nicolas Cuervo&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2017-01-10&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Team&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Added “Digital Gain” example&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This application note guides a user through basic information on the RFNoC architecture, installing necessary software to develop custom RFNoC blocks, also called Computation Engines (CE), and walks through the steps of creating a custom RFNoC block using an example.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
First sections deal with installing tools and validating correct tool installation in order to do RFNoC development. Later sections deal with creating a custom RFNoC block, using the built-in testbench architecture, building an FPGA image with the custom block and finally testing out the new block within GNU Radio.&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
The RFNoC code base is open source, including code that executes on the host, as well as code targeted to the USRP hardware (FPGA and microcontroller firmware). As dual-licensed software, RFNoC is available under the open-source GNU Public License version 3 (GPLv3), as well as an alternative, less-restrictive license offered only by Ettus Research. For more information on our licensing policy, please contact [mailto:info@ettus.com info@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
In order to build custom USRP FPGA images and RFNoC blocks the following hardware and software are needed.&lt;br /&gt;
&lt;br /&gt;
* '''Ubuntu 14.04 or 16.04(preferred):''' Currently PyBOMBS (which can be used to install the ''Software build tools''), works most reliably in Ubuntu, and thus, we recommend using this distribution. Also, a majority of the scripts used during the build process are Linux (Ubuntu) specific. A PC with multiple cores and 8GB+ of RAM is recommended.&lt;br /&gt;
&lt;br /&gt;
* '''Xilinx Vivado tools (ver. 2015.4):''' The specific version depends on the branch and state of the FPGA code. The default install location is &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;. Once all of the Software build tools are installed the specific version for the downloaded code can be found in the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{DEVICE}&amp;lt;/code&amp;gt; directory. Further information can be found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here].&lt;br /&gt;
&lt;br /&gt;
* '''Software build tools:''' If UHD can be or has been compiled from source on the development PC then all the necessary software build components are present (PyBOMBS can be used to set all this up and instructions on how to do so are given in a following step).&lt;br /&gt;
&lt;br /&gt;
* X3xx series or E3xx series device or any future USRP&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
* The edition of Xilinx Vivado that is required will depend on the USRP device.&lt;br /&gt;
** X3xx series devices: Design or System editions.&lt;br /&gt;
** E3xx series devices: Design, System or the free WebPack edition.&lt;br /&gt;
* Other operating systems can be used, but the exact steps on how to proceed are not given in this Application Note.&lt;br /&gt;
* In some Linux distributions (e.g. Ubuntu) &amp;lt;code&amp;gt;dash&amp;lt;/code&amp;gt; is set as default shell, which may cause some issues. It is recommended to set the shell to &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; by running the following commands in the terminal. Choose &amp;lt;code&amp;gt;&amp;lt;No&amp;gt;&amp;lt;/code&amp;gt; when prompted by the first command and the second command will validate the that bash will be used.&lt;br /&gt;
&lt;br /&gt;
    $ sudo dpkg-reconfigure dash&lt;br /&gt;
    $ ll /bin/sh&lt;br /&gt;
&lt;br /&gt;
==Creating a development environment==&lt;br /&gt;
While this Application Note goes through the process of integrating GNU Radio into the RFNoC development flow, it is by no means required to use or develop within the RFNoC framework, but it makes it a great deal easier to use a framework on top of RFNoC for aspects such as visualization and other features. GNU Radio is freely available and more information about it can be found [http://gnuradio.org/ here].&lt;br /&gt;
&lt;br /&gt;
The following software packages are required in order to setup a development environment/sandbox:&lt;br /&gt;
&lt;br /&gt;
* UHD&lt;br /&gt;
* GNU Radio &lt;br /&gt;
* gr-ettus&lt;br /&gt;
&lt;br /&gt;
===Create development environment using PyBOMBS===&lt;br /&gt;
The cleanest way to set this up is to install everything into a dedicated directory. [http://gnuradio.org/redmine/projects/pybombs/wiki PyBOMBS] is the simplest way to do this. If not already installed, PyBOMBS can be setup with the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ sudo apt-get install git&lt;br /&gt;
    $ sudo apt-get install python-setuptools python-dev python-pip build-essential &lt;br /&gt;
    &lt;br /&gt;
    $ sudo pip install git+https://github.com/gnuradio/pybombs.git&lt;br /&gt;
    $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git&lt;br /&gt;
    $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git&lt;br /&gt;
&lt;br /&gt;
These commands will do the following:&lt;br /&gt;
* Install &amp;lt;code&amp;gt;Git&amp;lt;/code&amp;gt;&lt;br /&gt;
* Install &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; and other Python dependencies&lt;br /&gt;
* Install the latest &amp;lt;code&amp;gt;PyBOMBS&amp;lt;/code&amp;gt; from its Git repository&lt;br /&gt;
* Add the &amp;lt;code&amp;gt;gr-recipes&amp;lt;/code&amp;gt; recipes which are used to install GNU Radio specific software&lt;br /&gt;
* Add the &amp;lt;code&amp;gt;ettus&amp;lt;/code&amp;gt; recipes which are used to install Ettus Research specific software&lt;br /&gt;
&lt;br /&gt;
From here, PyBOMBS can be used to setup and install the development environment/sandbox by running the following command:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs prefix init ~/rfnoc -R rfnoc -a rfnoc&lt;br /&gt;
&lt;br /&gt;
This will do the following:&lt;br /&gt;
&lt;br /&gt;
* Create a directory in the user’s home directory called &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; (any valid directory name will work)&lt;br /&gt;
&lt;br /&gt;
* Give the prefix an alias of &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; ( &amp;lt;code&amp;gt;[-a alias]&amp;lt;/code&amp;gt;, e.g. &amp;lt;code&amp;gt;–a rfnoc&amp;lt;/code&amp;gt; ), which would be the name given to this path. This name will be used in further steps that use PyBOMBS. When creating the first prefix and omitting the alias, the prefix will be setup as the default.&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; prefix recipe ( as opposed to a package recipe like &amp;lt;code&amp;gt;gqrx&amp;lt;/code&amp;gt; ) to clone UHD, FPGA, GNU Radio, and gr-ettus sources into the &amp;lt;code&amp;gt;~/rfnoc&amp;lt;/code&amp;gt; directory as well as compile and install all the software&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' A user can specify how many cores are used by builds when using PyBOMBS. The default is set to 4. For example, this will set the number of cores used to 3:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs config makewidth 3&lt;br /&gt;
&lt;br /&gt;
The value will be written into a configuration file and then applied to subsequent PyBOMBS commands. This value can temporarily be overridden for a specific build by specifying the &amp;lt;code&amp;gt;--config makewidth=X&amp;lt;/code&amp;gt; argument, where “&amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;” is an integer number. If the user only has 4 cores it is recommend to use this argument in the pybombs command to limit the number of cores to &amp;lt;4 (e.g. 3) so that the computer stays responsive. Following are 2 examples, one using less cores and the other using more cores:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs --config makewidth=3 prefix init ~/rfnoc -R rfnoc -a rfnoc &lt;br /&gt;
    $ pybombs --config makewidth=7 prefix init ~/rfnoc -R rfnoc -a rfnoc&lt;br /&gt;
&lt;br /&gt;
Then, it is necessary to setup the PyBOMBS environment, so that the system/terminal session will have the environmental variables pointing to this newly created prefix, which is done with the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/rfnoc&lt;br /&gt;
    $ source ./setup_env.sh&lt;br /&gt;
&lt;br /&gt;
Once the previous command is run, this terminal session will have access to the environmental variables that allow the complete use of the set of software that was just installed with PyBOMBS. If access to the software is needed in other terminals the same command must be run within them.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Throughout the rest of this document the term &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; will used at the beginning of different directories. For example, &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&amp;lt;/code&amp;gt; is a directory that contains useful scripts for compiling. The term &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; is used to denote the folders that precede the &amp;lt;code&amp;gt;/src&amp;lt;/code&amp;gt; directory. Examples of what &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; could be: &amp;lt;code&amp;gt;/home/user/rfnoc&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/home/user/myDevfolder/&amp;lt;/code&amp;gt;. On many Linux environments using &amp;lt;code&amp;gt;~/&amp;lt;/code&amp;gt; at the beginning of the target directory path is equivalent to the user’s home directory.( i.e &amp;lt;code&amp;gt;~/&amp;lt;/code&amp;gt; is equal to &amp;lt;code&amp;gt;/home/user/&amp;lt;/code&amp;gt;). So &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; could also look like &amp;lt;code&amp;gt;~/rfnoc&amp;lt;/code&amp;gt;  or &amp;lt;code&amp;gt;~/myDevfolder/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Create development environment manually===&lt;br /&gt;
As an alternative to using PyBOMBS, manually installing and configuring the software is done by following the individual install notes for [http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGRFromSource GNU Radio], [https://files.ettus.com/manual/page_build_guide.html UHD] and [https://github.com/EttusResearch/gr-ettus gr-ettus] and by making sure they are reachable by linkers and compilers.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The Application Note found [https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux here] goes through the process of manually installing UHD and GNU Radio on Linux platforms.&lt;br /&gt;
&lt;br /&gt;
To manually download the software, use these &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt; commands, which will select the correct branches:&lt;br /&gt;
&lt;br /&gt;
    $ git clone --recursive -b rfnoc-devel https://github.com/EttusResearch/uhd.git &lt;br /&gt;
    $ git clone --recursive -b maint https://github.com/gnuradio/gnuradio.git # master branch is also fine instead of maint&lt;br /&gt;
    $ git clone -b master https://github.com/EttusResearch/gr-ettus.git &lt;br /&gt;
    $ git clone -b rfnoc-devel https://github.com/EttusResearch/fpga.git&lt;br /&gt;
&lt;br /&gt;
If UHD, GNU Radio and/or gr-ettus are already installed, it would be sufficient to checkout the branches mentioned and update them them (&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;). Thereafter, rebuild each of the repositories (rebuild order: UHD, GNU Radio, gr-ettus).&lt;br /&gt;
&lt;br /&gt;
===Verify Environment===&lt;br /&gt;
Running the command “&amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;” with the “&amp;lt;code&amp;gt;--version&amp;lt;/code&amp;gt;” flag will verify that the installation has been completed successfully.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The version string output from this command may differ, however it should be similar to the output below.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe --version&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-161- g83150fdd&lt;br /&gt;
    &lt;br /&gt;
    4.0.0.rfnoc-devel-161-g83150fdd&lt;br /&gt;
&lt;br /&gt;
===Testing the default FPGA image and building from existing blocks===&lt;br /&gt;
&lt;br /&gt;
It is recommended to spend a moment looking at the Ettus Research default image, which is pre-built with a set of RFNoC blocks, as well as building a custom image with a unique set of pre-built RFNoC blocks. To get the default image(s), run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_images_downloader&lt;br /&gt;
&lt;br /&gt;
Ettus Research will be updating the default image(s) occasionally, and &amp;lt;code&amp;gt;uhd_images_downloader&amp;lt;/code&amp;gt; can be run anytime after running &amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt; and re-installing to pull the most current images. Images are stored in the &amp;lt;code&amp;gt;{USER_PREFIX}/share/uhd/images&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
The following images have the corresponding RFNoC blocks (Computation Engines):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Image Name&lt;br /&gt;
!Included Blocks&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x300_fpga_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x300_fpga_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;2x DDC, 2x DUC&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x300_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x300_fpga_RFNOC_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DUC, DDC (one channel), fosphor, window, fft, 2x AXI FIFOs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DUC, DDC (one channel), fosphor, window, fft, 2x AXI FIFOs, Keep One in N, FIR, Siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_e310_fpga.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_e310_fpga_sg3.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;1x DDC, 1x DUC&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_e310_fpga_RFNOC.bit (sg1 version)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_e310_fpga_RFNOC_sg3.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;fosphor, window, fft, 2x AXI FIFOs, FIR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Instructions on flashing the image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
  &lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device.&lt;br /&gt;
&lt;br /&gt;
By following the steps above the following should now be available:&lt;br /&gt;
* UHD/RFNoC code downloaded and installed&lt;br /&gt;
* FPGA code available&lt;br /&gt;
* A valid RFNoC image on your X3xx or E3xx series device&lt;br /&gt;
&lt;br /&gt;
====Inspect default images====&lt;br /&gt;
Run the following command, with a USRP connected to your PC, to verify current image on the USRP.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
If an RFNoC image was successfully loaded onto the USRP, there will be a lot of output text (RFNoC code is currently very verbose). The final lines of the output should be similar to the following for an USRP X310 ( e.g. &amp;lt;code&amp;gt;usrp_x310_fpga_HG&amp;lt;/code&amp;gt; ):&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * DDC_1&lt;br /&gt;
    |   |   |   * DUC_0&lt;br /&gt;
    |   |   |   * DUC_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Final output for &amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt; image:&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * DUC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * Window_0&lt;br /&gt;
    |   |   |   * FIR_0&lt;br /&gt;
    |   |   |   * SigGen_0&lt;br /&gt;
    |   |   |   * KeepOneInN_0&lt;br /&gt;
    |   |   |   * fosphor_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The actual names and number of blocks can differ. The list of blocks should start with the &amp;lt;code&amp;gt;DmaFIFO_x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Radio_x&amp;lt;/code&amp;gt;, and then a couple more lines of block IDs should follow.&lt;br /&gt;
&lt;br /&gt;
====Build custom image with pre-built RFNoC blocks====&lt;br /&gt;
Because of the growing number of RFNoC blocks, the user has the option to build an FPGA image with a set of pre-built RFNoC blocks of their choosing. The following steps describe the process for doing this and by so doing will also validate proper tool installation. Because compilation can take a couple of hours, it is recommended the user begin this process while continuing the rest of this guide.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA compilations can run in the background, however they are very resource intensive. If the user intents to use the same computer that is compiling to walk through the rest of this Application Note, it is recommended that the computer has plenty of resources.&lt;br /&gt;
&lt;br /&gt;
The script to initiate a compile is called &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt;, and is located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&amp;lt;/code&amp;gt; directory. Run the help menu by typing:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts &lt;br /&gt;
    $ ./uhd_image_builder.py --help&lt;br /&gt;
&lt;br /&gt;
A more detailed discussion of this script is given in an upcoming section. For now, compiling an FPGA image that has 2 RFNoC blocks (&amp;lt;code&amp;gt;window&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fft&amp;lt;/code&amp;gt;) and some &amp;lt;code&amp;gt;FIFOs&amp;lt;/code&amp;gt;, is done by running the script with the following arguments.&lt;br /&gt;
&lt;br /&gt;
Example for an X310 USRP:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py window fft -d x310 -t X310_RFNOC_HG -m 5 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
Example for an E310 USRP with Speed Grade 3 (sg3) FPGA:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py window fft -d e310 -t E310_RFNOC_sg3 -m 5 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
At the end of a successful compilation process, write the new image to a USRP. If the image was compiled for a USRP X310, the following command will load the new image. Update the &amp;lt;code&amp;gt;{IP_Address}&amp;lt;/code&amp;gt; of the USRP and &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; to the appropriate values for your configuration before running the command.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args “type=x300,addr={IP_ADDRESS}” --fpga-path {USER_PREFIX}/src/uhd-fpga/usrp3/top/x300/build/usrp_x310_fpga_RFNOC_HG.bit&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. Additional instructions on flashing a custom image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
&lt;br /&gt;
After the image has been successfully written to the USRP, power-cycle it and run the “&amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;” utility to view the newly compiled blocks.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
The final lines of output for the image built for the X310 is as follows:&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * Window_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
===Getting started with UHD + RFNoC===&lt;br /&gt;
The following new examples included within the &amp;lt;code&amp;gt;rfnoc-devel&amp;lt;/code&amp;gt; branch of UHD, are a good reference on how to use RFNoC from UHD.&lt;br /&gt;
&lt;br /&gt;
The following example is based off of &amp;lt;code&amp;gt;rx_samples_to_file.cpp&amp;lt;/code&amp;gt;. The example can be configured to place an RFNoC block in between the radio and host.&lt;br /&gt;
&lt;br /&gt;
    rfnoc_rx_to_file.cpp&lt;br /&gt;
&lt;br /&gt;
This next example chains a null source to another block and streams the data to the host.&lt;br /&gt;
&lt;br /&gt;
    rfnoc_nullsource_ce_rx.cpp&lt;br /&gt;
&lt;br /&gt;
These examples demonstrate the core features and flexibility of RFNoC.&lt;br /&gt;
&lt;br /&gt;
For more information on UHD and UHD development please refer to the [https://kb.ettus.com/UHD UHD Software Resource page], [https://kb.ettus.com/Getting_Started_with_UHD_and_C%2B%2B Getting Started with UHD and C++ Application Note] or directly to the [http://files.ettus.com/manual/ UHD user manual].&lt;br /&gt;
&lt;br /&gt;
===Getting started with GNU Radio + RFNoC===&lt;br /&gt;
A good way of getting started with RFNoC in a more tangible fashion is to use GNU Radio. The &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; out-of-tree module (OOT) allows a user to use RFNoC blocks in their local GNU Radio / GNU Radio Companion (GRC) installation. This GNU Radio OOT contains blocks that allow you to configure your FPGA through GRC.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' As blocks in the &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; OOT mature, they will be upstreamed to &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt;. Also, &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; is a container used by Ettus Research to disseminate experimental or under-development features for &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt;. It is not a replacement for &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; (in fact, the latter is a requirement for &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;).&lt;br /&gt;
    &lt;br /&gt;
Examples can be run from &amp;lt;code&amp;gt;gr-ettus/examples/rfnoc&amp;lt;/code&amp;gt;, provided that the appropriate RFNoC blocks and compiled into the FPGA image currently running on the USRP.&lt;br /&gt;
&lt;br /&gt;
A couple of rules for building GNU Radio flowgraphs:&lt;br /&gt;
&lt;br /&gt;
* You always need a &amp;lt;code&amp;gt;Device3&amp;lt;/code&amp;gt; object in your flow graph (it does not get connected, see screenshot below).&lt;br /&gt;
* You should have at least two RFNoC blocks connected together, going &amp;lt;code&amp;gt;GNU Radio Block&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;RFNoC Block&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;GNU Radio Block&amp;lt;/code&amp;gt; is not recommended (it will work, but with suboptimal performance).&lt;br /&gt;
&lt;br /&gt;
The GNU Radio flowgraph &amp;lt;code&amp;gt;rfnoc_ddc.grc&amp;lt;/code&amp;gt; is an example that can be run using the default RFNoC image. Below are screenshots of the flowgraph and what it produces.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 1.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Copy Block: In the RFNoC domain, streams of data can not be split as easily as they are in the GNU Radio domain. The “copy” block depicted in the screenshot above serves the function as a stream splitter . It’s main purpose, when “enabled”, is to copy the samples it is getting at its input and putting then into the output, but here it is also serving as a boundary between a RFNoC-domain and a GNURadio-domain. In the flowgraph above. after this boundary is passed, the data stream can easily be split into the two sinks to have them run simultaneously (standard GNU Radio functionality). It is possible to connect the GNU Radio blocks directly to RFNoC blocks without a “copy” block, but only one would work at a time (the other ones would have to be disabled). Another way to split data streams from the RFNoC- domain is to use the ”RFNoC: split stream” block, which would split the streams in the RFNoC domain, but this is not very useful here as we are, in any case, moving into the GNURadio-domain.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 2.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
For more information on GNURadio development please refer to the [http://gnuradio.org/doc/doxygen/ GNURadio user's manual and API].&lt;br /&gt;
&lt;br /&gt;
==Starting a custom RFNoC block using RFNoC Modtool==&lt;br /&gt;
The figure below shows the basic structure of the RFNoC Stack. Corresponding code is needed in each of the three sections in order to build a custom RFNoC block with GNU Radio integration. A tool called RFNoC Modtool was created in order to minimize the effort needed to implement a new RFNoC block. RFNoC Modtool creates a custom GNU Radio OOT module with the basic structure and the necessary files for each of these sections. RFNoC Modtool is currently a part of the GNU Radio OOT module &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 3.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
===RFNoC Modtool Utilization===&lt;br /&gt;
'''NOTE:''' Console outputs may vary depending on the version of UHD the user is running. However, functionality should be the same or similar.&lt;br /&gt;
&lt;br /&gt;
Because the RFNoC Modtool has similar functionality to the &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt; [ [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules gr_modtool] ] provided by GNU Radio, those that have worked with &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt; in the past will find the RFNoC Modtool familiar.&lt;br /&gt;
&lt;br /&gt;
To check the usage of the tool, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool help&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    Usage:&lt;br /&gt;
    rfnocmodtool &amp;lt;command&amp;gt; [options] -- Run &amp;lt;command&amp;gt; with the given options.&lt;br /&gt;
    rfnocmodtool help -- Show a list of commands.&lt;br /&gt;
    rfnocmodtool help &amp;lt;command&amp;gt; -- Shows the help for a given command. &lt;br /&gt;
    &lt;br /&gt;
    List of possible commands:&lt;br /&gt;
    &lt;br /&gt;
    Name      Aliases          Description&lt;br /&gt;
    =====================================================================&lt;br /&gt;
    disable   dis              Disable block (comments out CMake entries for files) &lt;br /&gt;
    info      getinfo,inf      Return information about a given module &lt;br /&gt;
    remove    rm,del           Remove block (delete files and remove Makefile entries) &lt;br /&gt;
    makexml   mx               Make XML file for GRC block bindings &lt;br /&gt;
    add       insert           Add block to the out-of-tree module. &lt;br /&gt;
    newmod    nm,create        Create a new out-of-tree module &lt;br /&gt;
    rename    mv               Rename a block in the out-of-tree module.&lt;br /&gt;
&lt;br /&gt;
===Creating an RFNoC OOT Module===&lt;br /&gt;
&lt;br /&gt;
To start generating an RFNoC OOT module navigate to the source location ( i.e. &amp;lt;code&amp;gt;cd ~/{USER_PREFIX}/src&amp;lt;/code&amp;gt; ) and type:&lt;br /&gt;
    $ rfnocmodtool newmod [NAME OF THE MODULE]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;code&amp;gt;[NAME OF THE MODULE]&amp;lt;/code&amp;gt; is a name the user gives the new module. In the following, a module is created with the name “&amp;lt;code&amp;gt;tutorial&amp;lt;/code&amp;gt;”. If the user does not write the name of the module following the &amp;lt;code&amp;gt;newmod&amp;lt;/code&amp;gt; command the tool will ask for it interactively. Running this command will create a folder containing the basic folders that you may need for a functional module.&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod tutorial&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    Creating out-of-tree module in ./rfnoc-tutorial... Done.&lt;br /&gt;
    Use 'rfnocmodtool add' to add a new block to this currently empty module.&lt;br /&gt;
&lt;br /&gt;
To see what files and directories were created run:&lt;br /&gt;
&lt;br /&gt;
    $ ls rfnoc-tutorial/&lt;br /&gt;
    apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In contrast with &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt;, this includes a folder called &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt;, which is where the UHD/FPGA files are located.&lt;br /&gt;
&lt;br /&gt;
===Adding custom blocks to OOT Module===&lt;br /&gt;
In order to add blocks to your module, navigate to the folder just created and use the &amp;lt;code&amp;gt;add&amp;lt;/code&amp;gt; command of &amp;lt;code&amp;gt;rfnocmodtool&amp;lt;/code&amp;gt;. Continuing with the example above, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ cd rfnoc-tutorial&lt;br /&gt;
    $ rfnocmodtool add [NAME OF THE BLOCK]&lt;br /&gt;
&lt;br /&gt;
For demonstrative purposes, a block named &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; will be created. The &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block will multiply samples that pass through it by a constant. As before, if the name is not given, the tool will ask the user for the name. There are several arguments that can be passed to the tool, but running the tool without any of these arguments will give the following interactive parsing output:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool add gain&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    RFNoC module name identified: tutorial&lt;br /&gt;
    Block/code identifier: gain&lt;br /&gt;
    Enter valid argument list, including default arguments: &lt;br /&gt;
    Add Python QA code? [Y/n] Y&lt;br /&gt;
    Add C++ QA code? [y/N] N&lt;br /&gt;
    Block NoC ID (Hexadecimal): 1111222233334444&lt;br /&gt;
    Skip Block Controllers Generation? [UHD block ctrl files] [y/N] N&lt;br /&gt;
    Skip Block interface files Generation? [GRC block ctrl files] [y/N] N&lt;br /&gt;
&lt;br /&gt;
Hitting &amp;lt;code&amp;gt;enter&amp;lt;/code&amp;gt; on each one of the options will take the default values.&lt;br /&gt;
&lt;br /&gt;
The following is a description of the valid argument list items:&lt;br /&gt;
&lt;br /&gt;
* '''Add Python QA code:''' Not used.&lt;br /&gt;
&lt;br /&gt;
* '''Add C++ QA code:''' Not used.&lt;br /&gt;
&lt;br /&gt;
* '''NoC ID:''' This ID is a Hexadecimal number which serves as identification between the hardware part and the software part of the design. It can be as long as 16 0-9 A-F digits. If a NoC ID is not provided, it will be set to a random number.&lt;br /&gt;
&lt;br /&gt;
* '''Block Controllers Generation:''' The block controllers are the C++ control that the user can apply to the UHD-part of the design. In these files, the user can add more control over this layer of the design. Depending on the complexity of the block it may be possible to add all necessary control using NoCScript (more details on NoCScript can be found in the section labeled UHD Integration). In this case the cpp/hpp block control files generation are not needed. Default is to generate as their existence will be ignored if not edited.&lt;br /&gt;
&lt;br /&gt;
* '''Block Interface:''' Add more design specific functionality to the design at the GNU Radio interface by generating these block-interface files and adding necessary logic.  Depending on the complexity of the block it may be possible to add all necessary control using NoC-Script. In this case the block-interface files are not needed. Default is to generate as their existence will be ignored if not edited.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' If the user does not intend to use the block controllers or is not sure if they are needed, the presence of them in the design will do no harm. It is recommended to add them. This leaves the possibility to add more functions inside them in a future stage of development. &lt;br /&gt;
&lt;br /&gt;
After finishing the parsing, the following files will be generated/edited:&lt;br /&gt;
&lt;br /&gt;
    Adding file 'lib/gain_impl.h'...&lt;br /&gt;
    Adding file 'lib/gain_impl.cc'...&lt;br /&gt;
    Adding file 'include/tutorial/gain.h'...&lt;br /&gt;
    Adding file 'include/tutorial/gain_block_ctrl.hpp'...&lt;br /&gt;
    Adding file 'lib/gain_block_ctrl_impl.cpp'...&lt;br /&gt;
    Editing swig/tutorial_swig.i...&lt;br /&gt;
    Adding file 'python/qa_gain.py'...&lt;br /&gt;
    Editing python/CMakeLists.txt...&lt;br /&gt;
    Adding file 'grc/tutorial_gain.xml'...&lt;br /&gt;
    Adding file 'rfnoc/blocks/gain.xml'...&lt;br /&gt;
    Adding file 'rfnoc/fpga-src/noc_block_gain.v'...&lt;br /&gt;
    rfnoc/testbenches/noc_block_gain_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
==Creating FPGA portion of custom RFNoC Block==&lt;br /&gt;
===RFNoC FPGA User Interface (API)===&lt;br /&gt;
RFNoC blocks or Computation Engines (CEs) in the FPGA use a NoC Shell instance to interface with the rest of RFNoC. NoC Shell implements RFNoC's core functionality: packet muxing and demuxing, flow control, and the settings register bus (i.e. write/read control/status registers). The NoC Shell has an interface to the RFNoC AXI stream crossbar and a user interface. NoC Shell AXI stream interfaces expect CHDR packets with a proper header. See the manual for information on [https://files.ettus.com/manual/page_rtp.html CHDR and SID].&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' AXI Stream is an ARM AMBA standard interface. Xilinx has an [http://www.xilinx.com/support/documentation/ip_documentation/ug761_axi_reference_guide.pdf AXI Reference Guide] with more details on this standard.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 4.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
Many designs will want to use an AXI Stream interface with only sample data. However, as stated earlier, the NoC Shell block expects CHDR packets. To ease interfacing user code, the AXI Wrapper block provides the necessary logic to strip and insert the CHDR header, effectively converting packetized sample data into streaming sample data and vice versa. The example RFNoC blocks &amp;lt;code&amp;gt;noc_block_fft.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noc_block_fir.v&amp;lt;/code&amp;gt; show how AXI Wrapper is used to implement existing Xilinx AXI Stream based IP within a computation engine.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' AXI Wrapper also supports AXI Stream buses for configuration. These buses are driven via the setting register bus and do not have back pressure. They also consume two user register addresses per bus.&lt;br /&gt;
&lt;br /&gt;
The primary user interface consists of four AXI stream interfaces ( &amp;lt;code&amp;gt;tready, tvalid, tlast, tdata&amp;lt;/code&amp;gt; ) and a settings register bus ( 8-bit, valid user register addresses: &amp;lt;code&amp;gt;128-255&amp;lt;/code&amp;gt; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
AXI Stream signals:&lt;br /&gt;
* '''m_axis_data_tdata:''' Input sample data packets &lt;br /&gt;
** Data coming from host or another CE&lt;br /&gt;
* '''s_axis_data_tdata:''' Output sample data packets &lt;br /&gt;
** Data going to another CE or host&lt;br /&gt;
* '''m_axis_data_tready:''' Input signal to CE&lt;br /&gt;
** Used to notify CE that downstream CE is ready for data &lt;br /&gt;
* '''s_axis_data_tready:''' Output signal to CE&lt;br /&gt;
** Used to notify upstream CE that CE is ready for data &lt;br /&gt;
* '''m_axis_data_tvalid:''' Input signal to CE&lt;br /&gt;
** Used to indicate upstream CE has valid data &lt;br /&gt;
* '''s_axis_data_tvalid:''' Output signal to CE&lt;br /&gt;
** Used to indicate to downstream CE that CE has valid data &lt;br /&gt;
* '''m_axis_data_tlast:''' Input signal to CE&lt;br /&gt;
** Used to delimit packets from upstream CE &lt;br /&gt;
* '''s_axis_data_tlast:''' Output signal to CE&lt;br /&gt;
** Used to delimit packets to downstream CE&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; |[[File:rfnoc gsg an 5.png|right|500px|]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 6.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Settings Bus signals:&lt;br /&gt;
* '''set_stb:''' Assert to write '''set_data''' to register at '''set_addr'''ess&lt;br /&gt;
* '''set_addr:''' Register address to set&lt;br /&gt;
* '''set_data:''' Data to set&lt;br /&gt;
* '''rb_data:''' Data to read back&lt;br /&gt;
* '''rb_strobe:''' Assert to read '''rb_data''' from register at '''set_addr'''ess&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; |[[File:rfnoc gsg an 7.png|right|500px|]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
For the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; example block the following architecture is desired (the blue signal has both “I” and “Q” data):&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 8.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;lt;code&amp;gt;rfnoc-tutorial/rfnoc/fpga-src/noc_block_gain.v&amp;lt;/code&amp;gt; that contains the RFNoC block skeleton code that was created when the &amp;lt;code&amp;gt;$ rfnocmodtool add gain&amp;lt;/code&amp;gt; command was run and modify the following sections.&lt;br /&gt;
&lt;br /&gt;
For the setting register that will hold the constant value as well as the read back register:&lt;br /&gt;
&lt;br /&gt;
    '''localparam [7:0] SR_GAIN = SR_USER_REG_BASE;'''&lt;br /&gt;
    localparam [7:0] SR_TEST_REG_1 = SR_USER_REG_BASE + 8'd1;&lt;br /&gt;
    &lt;br /&gt;
    '''wire [15:0] gain;'''&lt;br /&gt;
    '''setting_reg #('''&lt;br /&gt;
      '''.my_addr(SR_GAIN), .awidth(8), .width(16))'''&lt;br /&gt;
    '''sr_gain ('''&lt;br /&gt;
      '''.clk(ce_clk), .rst(ce_rst),'''&lt;br /&gt;
      '''.strobe(set_stb), .addr(set_addr), .in(set_data), .out(gain), .changed());'''&lt;br /&gt;
    &lt;br /&gt;
     always @(posedge ce_clk) begin&lt;br /&gt;
        case(rb_addr)&lt;br /&gt;
          '''8'd0 : rb_data &amp;lt;= {48'd0, gain};'''&lt;br /&gt;
          8'd1 : rb_data &amp;lt;= {32'd0, test_reg_1};&lt;br /&gt;
          default : rb_data &amp;lt;= 64'h0BADC0DE0BADC0DE;&lt;br /&gt;
        endcase&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And for the processing section:&lt;br /&gt;
&lt;br /&gt;
    assign m_axis_data_tready = s_axis_data_tready;&lt;br /&gt;
    assign s_axis_data_tvalid = m_axis_data_tvalid;&lt;br /&gt;
    assign s_axis_data_tlast = m_axis_data_tlast;&lt;br /&gt;
    &lt;br /&gt;
    '''wire [15:0] i = m_axis_data_tdata[31:16];'''&lt;br /&gt;
    '''wire [15:0] q = m_axis_data_tdata[15:0];'''&lt;br /&gt;
    &lt;br /&gt;
    '''wire [31:0] i_mult_gain = i*gain;'''&lt;br /&gt;
    '''wire [31:0] q_mult_gain = q*gain;'''&lt;br /&gt;
    &lt;br /&gt;
    '''assign s_axis_data_tdata = {i_mult_gain[15:0], q_mult_gain[15:0]};'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''  Because the multiplication process can occur in the same clock cycle there is no need for handshaking with the AXI &amp;lt;code&amp;gt;tready, tvalid  and tlast&amp;lt;/code&amp;gt; signals and therefore they are simply passed through the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; RFNoC block.&lt;br /&gt;
&lt;br /&gt;
===Creating and running HDL testbenches===&lt;br /&gt;
In order to make the coding iteration process more efficient, it is recommended to create testbenches for all RFNoC blocks before compiling them into the FPGA image. This allows for flaw and/or bug detection early in the design. RFNoC Modtool provides the structure and files ( e.g. &amp;lt;code&amp;gt;noc_block_{USER_BLOCK_NAME}_tb&amp;lt;/code&amp;gt; ) for the testbenches of each of the OOT blocks that are added with the &amp;lt;code&amp;gt;$ rfnocmodtool add&amp;lt;/code&amp;gt; command. &lt;br /&gt;
&lt;br /&gt;
Below is a figure that shows the structure of the testbench created by the RFNoC Modtool.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 9.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
From the [[Getting Started with RFNoC Development#Adding_custom_blocks_to_OOT_Module|Adding custom blocks to OOT Module section]] where the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block was initially created, the last files generated were:&lt;br /&gt;
&lt;br /&gt;
    rfnoc/testbenches/noc_block_gain_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;noc_block_gain_tb&amp;lt;/code&amp;gt; is a folder generated to contain all the files related to the test bench of the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block. Each time a new OOT block is created, a new folder will be generated as well. &lt;br /&gt;
&lt;br /&gt;
Inside of this folder are the following three files:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt:&amp;lt;/code&amp;gt; this is an empty file used, so far, only to increase the scope of the compilers.&lt;br /&gt;
* &amp;lt;code&amp;gt;noc_block_gain_tb.sv:&amp;lt;/code&amp;gt; this is a ''System Verilog'' file, in which user custom tests are to be located.  This is the '''only''' file that needs to be modified.&lt;br /&gt;
* &amp;lt;code&amp;gt;Makefile:&amp;lt;/code&amp;gt; This file determines the directives that run the simulation.&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;lt;code&amp;gt;rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv&amp;lt;/code&amp;gt; and modify the following lines:&lt;br /&gt;
&lt;br /&gt;
    initial begin : tb_main&lt;br /&gt;
      string s;&lt;br /&gt;
      logic [31:0] random_word;&lt;br /&gt;
      logic [63:0] readback;&lt;br /&gt;
      '''logic [15:0] gain;'''&lt;br /&gt;
    &lt;br /&gt;
    `TEST_CASE_START(&amp;quot;Write / readback user registers&amp;quot;);&lt;br /&gt;
    random_word = $random();&lt;br /&gt;
    '''tb_streamer.write_user_reg(sid_noc_block_gain, noc_block_gain.SR_GAIN, random_word[15:0]);&lt;br /&gt;
    tb_streamer.read_user_reg(sid_noc_block_gain, 0, readback);&lt;br /&gt;
    $sformat(s, &amp;quot;User register 0 incorrect readback! Expected: %0d, Actual %0d&amp;quot;, readback[15:0], random_word[15:0]);&lt;br /&gt;
    `ASSERT_ERROR(readback[15:0] == random_word[15:0], s);'''&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    `TEST_CASE_START(&amp;quot;Test sequence&amp;quot;);&lt;br /&gt;
    '''gain = 100;'''&lt;br /&gt;
    '''tb_streamer.write_user_reg(sid_noc_block_gain, noc_block_gain.SR_GAIN, gain);'''&lt;br /&gt;
      fork&lt;br /&gt;
        begin&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    tb_streamer.recv(recv_payload,md);&lt;br /&gt;
      for (int i = 0; i &amp;lt; SPP/2; i++) begin&lt;br /&gt;
        '''expected_value = i*gain;'''&lt;br /&gt;
&lt;br /&gt;
Create a &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory, verify directory location is &amp;lt;code&amp;gt;rfnoc-tutorial&amp;lt;/code&amp;gt; and run:&lt;br /&gt;
&lt;br /&gt;
    $ mkdir build &amp;amp;&amp;amp; cd build/&lt;br /&gt;
&lt;br /&gt;
The next step is to run &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt;. If PyBOMBS was used to create the development sandbox, &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt; will automatically detect the location of the &amp;lt;code&amp;gt;fpga&amp;lt;/code&amp;gt; repository. If PyBOMBS was not used, the user must provide the location of where the &amp;lt;code&amp;gt;fpga&amp;lt;/code&amp;gt; repository is installed.&lt;br /&gt;
&lt;br /&gt;
If PyBOMBS used, run:&lt;br /&gt;
&lt;br /&gt;
    $ cmake ../&lt;br /&gt;
&lt;br /&gt;
If PyBOMBS not used, run:&lt;br /&gt;
&lt;br /&gt;
    $ cmake [-DUHD_FPGA_DIR=/PATH/TO/FPGA/REPOSITORY] ../&lt;br /&gt;
&lt;br /&gt;
Final output from the &amp;lt;code&amp;gt;$ cmake ../&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
    -- Configuring done&lt;br /&gt;
    -- Generating done&lt;br /&gt;
    -- Build files have been written to: /home/widow/rfnoc/src/rfnoc-tutorial/build&lt;br /&gt;
&lt;br /&gt;
The following command will modify the necessary files and set the correct path to the simulation tools. From now on, every time a new block is added, this command will be run automatically. Remember, only run the following command once for each OOT module (not RFNoC block, but OOT module) created:&lt;br /&gt;
&lt;br /&gt;
    $ make test_tb&lt;br /&gt;
    Scanning dependencies of target test_tb&lt;br /&gt;
    Built target test_tb&lt;br /&gt;
&lt;br /&gt;
Testbenches can be executed by running the command:&lt;br /&gt;
&lt;br /&gt;
    $ make noc_block_[name_of_your_block]_tb &lt;br /&gt;
&lt;br /&gt;
The gain block testbench can be run by running the following command:&lt;br /&gt;
&lt;br /&gt;
    $ make noc_block_gain_tb&lt;br /&gt;
&lt;br /&gt;
The simulation will start.  Final output should look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ========================================================&lt;br /&gt;
    TESTBENCH STARTED: noc_block_gain&lt;br /&gt;
    ========================================================&lt;br /&gt;
    [TEST CASE   1] (t=000000000) BEGIN: Wait for Reset...&lt;br /&gt;
    [TEST CASE   1] (t=000001002) DONE... Passed&lt;br /&gt;
    [TEST CASE   2] (t=000001002) BEGIN: Check NoC ID...&lt;br /&gt;
    Read GAIN NOC ID: 1111222233334444&lt;br /&gt;
    [TEST CASE   2] (t=000001238) DONE... Passed&lt;br /&gt;
    [TEST CASE   3] (t=000001238) BEGIN: Connect RFNoC blocks...&lt;br /&gt;
    Connecting noc_block_tb (SID: 1:0) to noc_block_gain (SID: 0:0)&lt;br /&gt;
    Connecting noc_block_gain (SID: 0:0) to noc_block_tb (SID: 1:0)&lt;br /&gt;
    [TEST CASE   3] (t=000005457) DONE... Passed&lt;br /&gt;
    [TEST CASE   4] (t=000005457) BEGIN: Write / readback user registers...&lt;br /&gt;
    [TEST CASE   4] (t=000006888) DONE... Passed&lt;br /&gt;
    [TEST CASE   5] (t=000006888) BEGIN: Test sequence...&lt;br /&gt;
    [TEST CASE   5] (t=000007633) DONE... Passed&lt;br /&gt;
    ========================================================&lt;br /&gt;
    '''TESTBENCH FINISHED: noc_block_gain'''&lt;br /&gt;
    ''' - Time elapsed:   7700 ns'''             &lt;br /&gt;
    ''' - Tests Expected: 5'''&lt;br /&gt;
    ''' - Tests Run:      5'''&lt;br /&gt;
    ''' - Tests Passed:   5'''&lt;br /&gt;
    '''Result: PASSED'''   &lt;br /&gt;
    ========================================================&lt;br /&gt;
    $finish called at time : 7700 ns : File &amp;quot;/home/widow/rfnoc/src/rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv&amp;quot; Line 10&lt;br /&gt;
    INFO: [USF-XSim-96] XSim completed. Design snapshot 'noc_block_gain_tb_behav' loaded.&lt;br /&gt;
    INFO: [USF-XSim-97] XSim simulation ran for 1000000000us&lt;br /&gt;
    launch_simulation: Time (s): cpu = 00:00:10 ; elapsed = 00:00:12 . Memory (MB): peak = 966.387 ; gain = 54.848 ; free physical = 3080 ; free virtual = 29888&lt;br /&gt;
    # if [string equal $vivado_mode &amp;quot;batch&amp;quot;] {&lt;br /&gt;
    #     puts &amp;quot;BUILDER: Closing project&amp;quot;&lt;br /&gt;
    #     close_project&lt;br /&gt;
    # } else {&lt;br /&gt;
    #     puts &amp;quot;BUILDER: In GUI mode. Leaving project open.&amp;quot;&lt;br /&gt;
    # }&lt;br /&gt;
    BUILDER: Closing project&lt;br /&gt;
    ****** Webtalk v2015.4 (64-bit)&lt;br /&gt;
      **** SW Build 1412921 on Wed Nov 18 09:44:32 MST 2015&lt;br /&gt;
      **** IP Build 1412160 on Tue Nov 17 13:47:24 MST 2015&lt;br /&gt;
        ** Copyright 1986-2015 Xilinx, Inc. All Rights Reserved.&lt;br /&gt;
    &lt;br /&gt;
    source /home/widow/rfnoc/src/rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/xsim_proj/xsim_proj.hw/webtalk/labtool_webtalk.tcl -notrace&lt;br /&gt;
    INFO: [Common 17-206] Exiting Webtalk at Tue Jan 10 23:26:20 2017...&lt;br /&gt;
    INFO: [Common 17-206] Exiting Vivado at Tue Jan 10 23:26:22 2017...&lt;br /&gt;
    Built target noc_block_gain_tb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With every custom block created, a &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; directive will be available to run the simulation from the &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
===Building the FPGA image with a custom user block===&lt;br /&gt;
In this section steps are given on how to initiate an FPGA build while incorporating the user’s custom RFNoC block. The first sections give general information on building RFNoC images. The remaining two sections show how to initiate FPGA builds using a command line interface and using a graphical interface (coming out soon), respectively.&lt;br /&gt;
&lt;br /&gt;
====Discussion on number of blocks in an FPGA image====&lt;br /&gt;
There is a maximum number of blocks that can be added for each device. The maximum amount of computation engines (CEs/RFNoC blocks) that each device can use is 16, but the amount of custom blocks that can be added depends on the device. &lt;br /&gt;
&lt;br /&gt;
If using a device from the X3xx series, from the 16 CEs, there are 6 that will be always added and are not subject to direct customization: 1 CE for the AXI bus, 1 CE for the Ethernet Interface, 2 Radios and 2 Dma FIFOS. Because of this, the application will only allow a number of 10 custom blocks on the X3xx series. &lt;br /&gt;
&lt;br /&gt;
If using a device from the E3xx series, 2 CE engines are always added and are not subject to direct customization: 1 CE for the AXI bus and 1 Radio. This would virtually allow 14 slots for custom blocks. However, given the size of the FPGA on the E3xx series of devices, the application only allows a number of 6 custom blocks. &lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Blocks with higher resource utilization may fill up the FPGA and force the user to include less blocks.&lt;br /&gt;
&lt;br /&gt;
Verify the current maximum values by running the &amp;lt;code&amp;gt;uhd_images_builder.py&amp;lt;/code&amp;gt; utility from the scripts directory.&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&lt;br /&gt;
    $ uhd_image_builder.py --help&lt;br /&gt;
&lt;br /&gt;
====Discussion on FPGA image targets====&lt;br /&gt;
RFNoC target names follow the pattern &amp;lt;code&amp;gt;{DEVICE}_RFNoC_{BUILD_TYPE}&amp;lt;/code&amp;gt; with the following build types: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HG:&amp;lt;/code&amp;gt; 1GigE on SFP+ Port0, 10Gig on SFP+ Port&lt;br /&gt;
* &amp;lt;code&amp;gt;XG:&amp;lt;/code&amp;gt; 10GigE on both SFP+ ports&lt;br /&gt;
* &amp;lt;code&amp;gt;HLS:&amp;lt;/code&amp;gt; Vivado High Level Synthesis enabled&lt;br /&gt;
* &amp;lt;code&amp;gt;sgX:&amp;lt;/code&amp;gt; Speed grade for E300 devices (1 or 3)&lt;br /&gt;
&lt;br /&gt;
Some examples are:&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_XG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_XG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_HLS_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_HLS_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;E310_RFNOC&amp;lt;/code&amp;gt; (this is for the speed grade 1 FPGA version of E310, append &amp;lt;code&amp;gt;_sg3&amp;lt;/code&amp;gt; for speed grade 3)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' E310, E312 and E313 all have the same FPGA hardware and therefore will use the &amp;lt;code&amp;gt;E310_RFNOC_{BUILD_TYPE}&amp;lt;/code&amp;gt; target. USRP E3xx devices have either &amp;lt;code&amp;gt;sg1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sg3&amp;lt;/code&amp;gt; hardware, please visit [http://files.ettus.com/e3xx_images/README here] to find out how to differentiate.&lt;br /&gt;
&lt;br /&gt;
Additional information about the build targets can be found at the build instructions for USRP3, found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here].&lt;br /&gt;
&lt;br /&gt;
====Image building using the command line====&lt;br /&gt;
The script &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; is used to generate the NoC block instantiation file and build the FPGA image. Run the help menu by typing:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&lt;br /&gt;
    $ ./uhd_image_builder.py --help&lt;br /&gt;
         &lt;br /&gt;
    usage: uhd_image_builder.py [-h] [-I INCLUDE_DIR [INCLUDE_DIR ...]]&lt;br /&gt;
                                [-m MAX_NUM_BLOCKS] [--fill-with-fifos]&lt;br /&gt;
                                [-o OUTFILE] [-d DEVICE] [-t TARGET] [-g] [-c]&lt;br /&gt;
                                [blocks [blocks ...]]&lt;br /&gt;
    &lt;br /&gt;
    Generate the NoC block instantiation file&lt;br /&gt;
    &lt;br /&gt;
    positional arguments:&lt;br /&gt;
      blocks                List block names to instantiate.&lt;br /&gt;
    &lt;br /&gt;
    optional arguments:&lt;br /&gt;
      -h, --help            show this help message and exit&lt;br /&gt;
      -I INCLUDE_DIR [INCLUDE_DIR ...], --include-dir INCLUDE_DIR [INCLUDE_DIR ...]&lt;br /&gt;
                            Path directory of the RFNoC Out-of-Tree module&lt;br /&gt;
      -m MAX_NUM_BLOCKS, --max-num-blocks MAX_NUM_BLOCKS&lt;br /&gt;
                            Maximum number of blocks (Max. Allowed for x310|x300:&lt;br /&gt;
                            10, for e300: 6)&lt;br /&gt;
      --fill-with-fifos     If the number of blocks provided was smaller than the&lt;br /&gt;
                            max number, fill the rest with FIFOs&lt;br /&gt;
      -o OUTFILE, --outfile OUTFILE&lt;br /&gt;
                            Output /path/filename - By running this directive, you&lt;br /&gt;
                            won't build your IP&lt;br /&gt;
      -d DEVICE, --device DEVICE&lt;br /&gt;
                            Device to be programmed [x300, x310, e310]&lt;br /&gt;
      -t TARGET, --target TARGET&lt;br /&gt;
                            Build target - image type [X3X0_RFNOC_HG,&lt;br /&gt;
                            X3X0_RFNOC_XG, E310_RFNOC_sg3...]&lt;br /&gt;
      -g, --GUI             Open Vivado GUI during the FPGA building process&lt;br /&gt;
      -c, --clean-all       Cleans the IP before a new build&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are details on the usage of the script which is followed by an example:&lt;br /&gt;
&lt;br /&gt;
'''Blocks:''' The first arguments are the names of RFNoC blocks that the user wants to have compiled into the new image which are separated by a space. They can be custom blocks from the user’s OOT module or from the ones that are provided from Ettus, or a combination. Blocks provided by Ettus Research are listed (among other sources necessary for the FPGA build) in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/lib/rfnoc/Makefile.srcs&amp;lt;/code&amp;gt; file. &lt;br /&gt;
&lt;br /&gt;
These blocks can be identified by the following pattern: &lt;br /&gt;
&lt;br /&gt;
    noc_block_{NAME}.v&lt;br /&gt;
&lt;br /&gt;
However, as all the RFNoC blocks have the same &amp;lt;code&amp;gt;noc_block_&amp;lt;/code&amp;gt; prefix, for simplicity this prefix is omitted when listing the blocks in the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; utility. As an example of the incorrect and correct way of adding blocks, consider the following examples when adding the &amp;lt;code&amp;gt;noc_block_null_source_sink&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noc_block_siggen&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
Incorrect method:  &lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py noc_block_null_source_sink noc_block_siggen ...&lt;br /&gt;
&lt;br /&gt;
Correct method:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py null_source_sink siggen ...&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Blocks generated by the RFNoC Modtool follow the same naming convention.&lt;br /&gt;
&lt;br /&gt;
There is an increasing list of pre-built blocks. Here is a sample:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;axi_fifo_loopback&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;axi_dma_fifo&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fir_filter&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fft&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;null_source_sink&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;schmidl_cox&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;packet_resizer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;split_stream&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;vector_iir&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;addsub&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;window&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;keep_one_in_n&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;pfb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;export_io&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;conv_encoder_qpsk&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;logpwr&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fosphor&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;moving_avg&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ddc&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;duc&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RFNoC related blocks generally reside in &amp;lt;code&amp;gt;fpga/usrp3/lib/rfnoc/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!Block&lt;br /&gt;
!Filename&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FIFO&lt;br /&gt;
|noc_block_axi_fifo_loopback.v&lt;br /&gt;
|Simple FIFO loopback / passthrough block.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FFT&lt;br /&gt;
|noc_block_fft.v&lt;br /&gt;
|Xilinx coregen based Fast Fourier Transform up to length 4096.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FIR&lt;br /&gt;
|noc_block_fir_filter.v&lt;br /&gt;
|Xilinx coregen based Finite Impulse Response Filter, 41 taps, reconfigurable tap coefficients.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|Window&lt;br /&gt;
|noc_block_window.v&lt;br /&gt;
|Windowing block for use with FFT block.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Vector IIR&lt;br /&gt;
|noc_block_vector_iir.v&lt;br /&gt;
|Single pole IIR with configurable coefficients that filters data along vectors (i.e. parallel streams of samples). Useful with FFT output.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Keep One in N&lt;br /&gt;
|noc_block_keep_one_in_n.v&lt;br /&gt;
|Keeps one packet every N packets.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|AddSub&lt;br /&gt;
|noc_block_addsub.v&lt;br /&gt;
|Example of using multiple block ports in a single RFNoC block to add and subtract streams.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Null Source Sink&lt;br /&gt;
|noc_block_null_source_sink.v&lt;br /&gt;
|Generates dummy packets and can consume packets at a configurable rate. Useful for testing.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Packet Resizer&lt;br /&gt;
|noc_block_packet_resizer.v&lt;br /&gt;
|Resizes input packets to a configurable size (larger or smaller than source packets).&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Split Stream&lt;br /&gt;
|noc_block_split_stream.v&lt;br /&gt;
|Replicates an input stream to a configurable number of output streams.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' There is a restriction on the amount of blocks that can added into the FPGA image, see the section in this Application Note labeled [[Getting_Started_with_RFNoC_Development#Discussion_on_number_of_blocks_in_an_FPGA_image|Discussion on number of blocks in an FPGA image]] for more information. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-I INCLUDE_DIR:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; directive provides the path to the users &amp;lt;code&amp;gt;rfnoc/fpga-src&amp;lt;/code&amp;gt; directory which contains the custom blocks. This path is needed by the Xilinx Vivado tool. Inside the &amp;lt;code&amp;gt;fpga-src&amp;lt;/code&amp;gt; directory there is a file called &amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt; that contains the path of the OOT module and a list of all the custom OOT blocks. This is an auto generated file, which is amended every time a new block is added to the OOT module. Manually modifying this file is not recommended. If there are multiple OOT modules with various custom blocks that reside in different directories the way to include them all is by separating the different paths by a space (e.g. &amp;lt;code&amp;gt;-I /first/OOT/path/ /second/OOT/path/&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-d DEVICE:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; directive directs the script on which USRP device the build is for. If no &amp;lt;code&amp;gt;–d&amp;lt;/code&amp;gt; is included the default is &amp;lt;code&amp;gt;–d x310&amp;lt;/code&amp;gt;. Generation-3 USRPs and above all support RFNoC.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-t TARGET:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;–t&amp;lt;/code&amp;gt; directive directs the script on which type of image to build for the chosen device. With each USRP device there are several build options to choose from. Detailed information about the build targets can be found at the build instructions for USRP3, found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here]. If &amp;lt;code&amp;gt;-t&amp;lt;/code&amp;gt; is not included, a default target will be chosen for the given device. For example, the default &amp;lt;code&amp;gt;X310_RFNOC_HG&amp;lt;/code&amp;gt; target builds for the &amp;lt;code&amp;gt;–d x310&amp;lt;/code&amp;gt; device. More details on targets can be found in the section of this Application Note labeled [[Getting Started with RFNoC Development#Discussion_on_FPGA_image_targets|Discussion on FPGA image targets]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-m MAX_NUM_BLOCKS:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;–m&amp;lt;/code&amp;gt; directive specifies the max number of RFNoC blocks to build on the FPGA image. An RFNoC image does not need to fill all available slots with RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--fill-with-fifos:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;--fill-with-fifos&amp;lt;/code&amp;gt; directive will fill the empty RFNoC block slots with FIFOS. As an example, if a user indicates three RFNoC blocks by name and also specifies &amp;lt;code&amp;gt;–m 5&amp;lt;/code&amp;gt; then the other two slots will be filed with FIFOs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-o OUTFILE:&amp;lt;/code&amp;gt; With the &amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; directive, the RFNoC blocks instantiation file is generated and saved at the desired path with the given name for the user to inspect. The FPGA image will NOT build if this directive is provided. The purpose of the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script is to auto generate an instantiation file and populate the source files needed for the Xilinx Vivado tool to build the FPGA image, however, it may be desirable to only see the effect of adding a custom OOT module in the &amp;lt;code&amp;gt;fpga/&amp;lt;/code&amp;gt; directory, or for inspecting the instantiation file. When the directive is not provided the &amp;lt;code&amp;gt;rfnoc_ce_auto_inst_x3x0.v&amp;lt;/code&amp;gt; file is overwritten and the FPGA image build process will start automatically (standard use).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-g, --GUI:&amp;lt;/code&amp;gt; Open Vivado GUI during the FPGA building process&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-c, --clean-all:&amp;lt;/code&amp;gt; Cleans the IP before a new build&lt;br /&gt;
&lt;br /&gt;
Here is how to create an X310 FPGA image incorporating the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block that was created earlier in this Application Note:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts     &lt;br /&gt;
    $ ./uhd_image_builder.py gain ddc fft -I {USER_PREFIX}/src/rfnoc-tutorial/rfnoc/fpga-src/ -d x310 -t X310_RFNOC_HG -m 6 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end of a successful compilation process, write the new image to a USRP. The following command will load the new image. Update the &amp;lt;code&amp;gt;{IP_Address}&amp;lt;/code&amp;gt; of the USRP and &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; to the appropriate values for your configuration before running the command.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args “type=x300,addr={IP_ADDRESS}” --fpga-path {USER_PREFIX}/src/uhd-fpga/usrp3/top/x300/build/usrp_x310_fpga_RFNOC_HG.bit&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' &lt;br /&gt;
* The FPGA image building process may take over an hour.&lt;br /&gt;
&lt;br /&gt;
* FPGA images are specific to the USRP device NOT the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. Additional instructions on flashing a custom image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
&lt;br /&gt;
* [Environment setup] - The &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script will also set up the Xilinx Vivado environment by automatically running the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{device}&amp;lt;/code&amp;gt; directory. The &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script assumes that Xilinx Vivado is installed in the default location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.  If the installation is in a different directory the &amp;lt;code&amp;gt;setupenv_base.sh&amp;lt;/code&amp;gt; script will need to be modified. The script is located at: &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts/setupenv_base.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Besides the custom &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block, a &amp;lt;code&amp;gt;DDC&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FFT&amp;lt;/code&amp;gt; block are also being added along with three &amp;lt;code&amp;gt;FIFOs&amp;lt;/code&amp;gt;.  The &amp;lt;code&amp;gt;DDC&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;FFT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FIFO&amp;lt;/code&amp;gt; blocks are already in the script's path and therefore do not need their path specified (they ship with the Ettus Research FPGA code). The reason three FIFOs are added is because the max number of blocks was specified to be 6 ( &amp;lt;code&amp;gt;-m 6&amp;lt;/code&amp;gt; ) and since only 3 blocks were specifically named the other three slots are filled with FIFOs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 10.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Instructions on flashing the image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series. FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. &lt;br /&gt;
&lt;br /&gt;
Once the newly compiled image is loaded onto a USRP X3xx running the following command will show what RFNoC blocks are available on the FPGA:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * '''Block_0'''&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The reason the custom block is called &amp;lt;code&amp;gt;Block_0&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;gain_0&amp;lt;/code&amp;gt; is because there is still host side software/files that need updated in order for this block to populate it’s proper name. A following section (UHD Integration) will step through the process of updating those host side files.&lt;br /&gt;
&lt;br /&gt;
====Using a graphical interface====&lt;br /&gt;
A graphical user interface for FPGA generation and building is shipped along with the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script. This intuitive application aids in setting up a custom FPGA build. &lt;br /&gt;
&lt;br /&gt;
This utility is located in the same &amp;lt;code&amp;gt;scripts&amp;lt;/code&amp;gt; directory as &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
To run it, enter the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts/&lt;br /&gt;
    $ ./uhd_image_builder_gui&lt;br /&gt;
&lt;br /&gt;
The application will then be launched:&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 11.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''1. Select build target:''' In this panel the available build targets are listed. This list may vary depending on which branch of the FPGA repository this user is using. Only RFNoC targets are listed. The build type descriptions are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HG:&amp;lt;/code&amp;gt; 1GigE on SFP+ Port0, 10Gig on SFP+ Port1&lt;br /&gt;
* &amp;lt;code&amp;gt;XG:&amp;lt;/code&amp;gt; 10GigE on both SFP+ ports&lt;br /&gt;
* &amp;lt;code&amp;gt;HLS:&amp;lt;/code&amp;gt; Vivado High Level Synthesis enabled&lt;br /&gt;
* &amp;lt;code&amp;gt;sgX:&amp;lt;/code&amp;gt; Speed grade for E300 devices (1 or 3)&lt;br /&gt;
&lt;br /&gt;
'''2. List of blocks available:''' In this panel the available blocks are listed that can be included into a custom design. This list separates the RFNoC blocks provided by Ettus Research and the OOT modules and corresponding blocks that the user adds. Given the hardware differences between the X3xx and E3xx devices, this list will dynamically change when a different device is selected from the panel on the left. This implies that it is necessary to add the OOT modules for each device independently. This is accomplished by using the &amp;lt;code&amp;gt;Add OOT Blocks&amp;lt;/code&amp;gt; feature of the application, details of which are explained at #7 (&amp;lt;code&amp;gt;Add OOT Blocks&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
'''3. Blocks in current design:''' This panel will be populated by adding elements from the available blocks. All the blocks listed in here will be compiled into the FPGA custom image. There is a maximum number of blocks that can be added for each device. See the section in this App Note labeled Discussion on number of blocks in an FPGA image for more information. &lt;br /&gt;
&lt;br /&gt;
'''4. Add button (&amp;gt;&amp;gt;):''' Manually add the blocks from the central panel into your design.&lt;br /&gt;
&lt;br /&gt;
'''5. Remove button (&amp;lt;&amp;lt;):''' Remove blocks from the current design (far-left panel)&lt;br /&gt;
&lt;br /&gt;
'''6. Fill with FIFOs:''' By checking this box, the design will fill any available/unspecified block slots with FIFOs. The number of FIFO blocks that will be instantiated is based on the rules of amount of blocks explained at #3. When less than the max amount of blocks are needed for certain implementation, many users choose to fill their design with FIFO blocks. &lt;br /&gt;
&lt;br /&gt;
'''7. Open Vivado GUI:''' Open Vivado GUI during the FPGA building process. This allows the user to save a Vivado project with all IP and work within the Vivado GUI for development.&lt;br /&gt;
&lt;br /&gt;
'''8. Clean IP:''' Cleans the IP before a new build (recompiles all IP).&lt;br /&gt;
&lt;br /&gt;
'''9. Add OOT blocks:''' Manually add RFNoC Modtool-generated OOT modules by pointing the application to the &amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt; file, which is located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/{USER-OOT-moddir}/rfnoc/fpga-srcs/&amp;lt;/code&amp;gt; directory. After adding this file, blocks will appear under “&amp;lt;code&amp;gt;OOT blocks for XXXX devices&amp;lt;/code&amp;gt;”&lt;br /&gt;
&lt;br /&gt;
'''10. Import from GRC:''' If the user has a GNU Radio flowgraph with RFNoC blocks already in it, this application can read what RFNoC blocks are in the flowgraph and populate the &amp;lt;code&amp;gt;Blocks in current design&amp;lt;/code&amp;gt; section of the application with the necessary RFNoC blocks. '''NOTE:''' All RFNoC blocks pulled from a &amp;lt;code&amp;gt;.grc&amp;lt;/code&amp;gt; file must be in the of &amp;lt;code&amp;gt;List of blocks available&amp;lt;/code&amp;gt; before beginning the build.&lt;br /&gt;
&lt;br /&gt;
'''11. Show Instantiation File:''' The application auto-generates the instantiation file that is going to be used by Vivado to build the FPGA image. This instantiation file can be viewed and edited before starting the build by clicking this button. &lt;br /&gt;
&lt;br /&gt;
'''12. Generate .bit file:''' Start the build by clicking this button. &lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' See the latter end of the previous section for additional information on what to expect once the compile has started as well as final output.&lt;br /&gt;
&lt;br /&gt;
==Creating Software/Host portion of custom RFNoC Block==&lt;br /&gt;
Now that the FPGA portion is complete the next step is to add software integration to UHD and GNU Radio as depicted in the RFNoC Stack below.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 12.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
===UHD integration===&lt;br /&gt;
Despite the data processing happening on the FPGA, the host software still has a lot of responsibilities in order for an RFNoC application to function. For example, it needs to know which settings registers are available within an RFNoC block, or what kind of input and output a block has. All of this information goes into the &amp;lt;code&amp;gt;Block Declaration&amp;lt;/code&amp;gt;, which is an XML file that is readable by UHD. Often, some simple logic needs to be embedded in the XML file, which we can do by using a simple scripting language called Noc-Script. Changes to the block declaration file are immediately imported into UHD every time an application is executed, and therefore, no software development toolchain needs to be set up.&lt;br /&gt;
&lt;br /&gt;
The list of things declared by the block declaration file includes:&lt;br /&gt;
&lt;br /&gt;
* Block name and Noc-ID&lt;br /&gt;
* Registers&lt;br /&gt;
* Inputs and outputs (including types)&lt;br /&gt;
&lt;br /&gt;
In some cases, additional C++ code is required to properly control a block from software. In this case, a &amp;lt;code&amp;gt;Block Controller&amp;lt;/code&amp;gt; file is required as well as the declaration file. In most cases, the default block controller provided by UHD is sufficient, so no C++ code needs to be written. Writing custom block controllers requires more effort, and means having to set up a programming toolchain. A common reason to write custom C++ block controllers is if setting a register requires a lot of computation, which is not feasible to do within a block declaration file (e.g., using Noc-Script).&lt;br /&gt;
&lt;br /&gt;
Skeleton code for both the block declaration and the block controller (if required) can be generated through RFNoC Modtool.&lt;br /&gt;
&lt;br /&gt;
Because the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block does not require anything other than simply reading and writing to a single register the default block controller will suffice for this example. However, we will need to add information about the register.&lt;br /&gt;
&lt;br /&gt;
Open the &amp;lt;code&amp;gt;gain.xml&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;/rfnoc-tutorial/rfnoc/blocks&amp;lt;/code&amp;gt; directory and add the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;&amp;lt;!--Default XML file--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;nocblock&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;gain&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;blockname&amp;gt;gain&amp;lt;/blockname&amp;gt;&lt;br /&gt;
      &amp;lt;ids&amp;gt;&lt;br /&gt;
        &amp;lt;id revision=&amp;quot;0&amp;quot;&amp;gt;1111222233334444&amp;lt;/id&amp;gt;&lt;br /&gt;
      &amp;lt;/ids&amp;gt;&lt;br /&gt;
      '''&amp;lt;nowiki&amp;gt;&amp;lt;!-- Registers --&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;registers&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;setreg&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;name&amp;gt;GAIN&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;address&amp;gt;128&amp;lt;/address&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;/setreg&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;/registers&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;nowiki&amp;gt;&amp;lt;!-- Args --&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;args&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;arg&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;name&amp;gt;gain&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;double&amp;lt;/type&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;value&amp;gt;1.0&amp;lt;/value&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;check&amp;gt;GE($gain, 0.0) AND LE($gain, 32767.0)&amp;lt;/check&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;check_message&amp;gt;Invalid gain.&amp;lt;/check_message&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;action&amp;gt;'''&lt;br /&gt;
            '''SR_WRITE(&amp;quot;GAIN&amp;quot;, IROUND($gain))'''&lt;br /&gt;
          '''&amp;lt;/action&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;/arg&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;/args&amp;gt;'''&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!--One input, one output. If this is used, better have all the info the C++ file.--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;ports&amp;gt;&lt;br /&gt;
        &amp;lt;sink&amp;gt;&lt;br /&gt;
          '''&amp;lt;name&amp;gt;in0&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;sc16&amp;lt;/type&amp;gt;'''&lt;br /&gt;
        &amp;lt;/sink&amp;gt;&lt;br /&gt;
        &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
          '''&amp;lt;name&amp;gt;out0&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;sc16&amp;lt;/type&amp;gt;'''&lt;br /&gt;
        &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;/ports&amp;gt;&lt;br /&gt;
    &amp;lt;/nocblock&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GNU Radio Integration===&lt;br /&gt;
GNU Radio is built around the concept of blocks, similarly to RFNoC. When mapping RFNoC into an application, the simple constraint is made that every RFNoC block maps to a single GNU Radio block. Thus, when creating mixed GNU Radio/RFNoC applications, there is a very clear 1:1 mapping between what’s happening in RFNoC and GNU Radio.&lt;br /&gt;
&lt;br /&gt;
Since most RFNoC blocks behave very similar to one another from GNU Radio’s perspective, it is generally not required to write C++ code for another block. Rather, a default block provided by RFNoC can be used with appropriate configuration. However, in some cases it may be desirable or even necessary to write a custom GNU Radio block for more specific controlling of the underlying RFNoC block. GNU Radio allows writing blocks in either C++ or Python, but since UHD and RFNoC do not have a Python API, a custom wrapper for an RFNoC block needs to be written in C++. RFNoC Modtool will create skeleton files for these purpose.&lt;br /&gt;
&lt;br /&gt;
The most popular and effective way to use GNU Radio is through the graphical interface, the GNU Radio Companion (GRC). GRC requires a separate description of every GNU Radio block in order to become available in the graphical UI, and the same is true for an RFNoC block that is wrapped in a GNU Radio block (even if the generic RFNoC block wrapper is used). For GNU Radio 3.7 and earlier, GRC bindings for blocks are written as XML files with interspersed Cheetah or Python statements. For a more detailed tutorial on how to write these files, refer to the [http://gnuradio.org/redmine/projects/gnuradio/wiki GNU Radio Documentation] and associated [http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials tutorials].&lt;br /&gt;
&lt;br /&gt;
====GNU Radio Block Code====&lt;br /&gt;
&lt;br /&gt;
* C++ or Python, although RFNoC blocks need to be written in C++ (if at all)&lt;br /&gt;
* How does GNU Radio interface to RFNoC?&lt;br /&gt;
** via C++ infrastructure code in &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; provides a base RFNoC block class&lt;br /&gt;
** Users extend base class for their RFNoC blocks&lt;br /&gt;
** Many blocks can use base class “as is”&lt;br /&gt;
** No C++ or Python code!&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-tutorial/lib/gain_impl.cc&amp;lt;/code&amp;gt;&lt;br /&gt;
** The gain block does not need anything additional&lt;br /&gt;
&lt;br /&gt;
====GNU Radio Companion Bindings====&lt;br /&gt;
* XML&lt;br /&gt;
* Describes GNU Radio blocks to GRC&lt;br /&gt;
* No recompilation&lt;br /&gt;
* Requirement of GNU Radio Companion&lt;br /&gt;
* Not strictly necessary for GNU Radio&lt;br /&gt;
* Tutorial on how to write them:&lt;br /&gt;
** [http://gnuradio.org/redmine/projects/gnuradio/wiki/GNURadioCompanion http://gnuradio.org/redmine/projects/gnuradio/wiki/GNURadioCompanion ]&lt;br /&gt;
* Skeleton file generated by RFNoC Modtool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Open the &amp;lt;code&amp;gt;tutorial-gain.xml&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;rfnoc-tutorial/grc&amp;lt;/code&amp;gt; directory and edit as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;block&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;RFNoC: gain&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;key&amp;gt;tutorial_gain&amp;lt;/key&amp;gt;&lt;br /&gt;
      &amp;lt;category&amp;gt;tutorial&amp;lt;/category&amp;gt;&lt;br /&gt;
      &amp;lt;import&amp;gt;import tutorial&amp;lt;/import&amp;gt;&lt;br /&gt;
      &amp;lt;make&amp;gt;tutorial.gain(&lt;br /&gt;
        self.device3,&lt;br /&gt;
        uhd.stream_args( \# TX Stream Args&lt;br /&gt;
            cpu_format=&amp;quot;'''fc32'''&amp;quot;,&lt;br /&gt;
            otw_format=&amp;quot;'''sc16'''&amp;quot;,&lt;br /&gt;
            args=&amp;quot;gr_vlen={0},{1}&amp;quot;.format(${grvlen}, &amp;quot;&amp;quot; if $grvlen == 1 else &amp;quot;spp={0}&amp;quot;.format($grvlen)),&lt;br /&gt;
        ),&lt;br /&gt;
        uhd.stream_args( \# RX Stream Args&lt;br /&gt;
            cpu_format=&amp;quot;'''fc32'''&amp;quot;,&lt;br /&gt;
            otw_format=&amp;quot;'''sc16'''&amp;quot;,&lt;br /&gt;
            args=&amp;quot;gr_vlen={0},{1}&amp;quot;.format(${grvlen}, &amp;quot;&amp;quot; if $grvlen == 1 else &amp;quot;spp={0}&amp;quot;.format($grvlen)),&lt;br /&gt;
        ),&lt;br /&gt;
        $block_index, $device_index,&lt;br /&gt;
    )&lt;br /&gt;
    '''self.$(id).set_arg(&amp;quot;gain&amp;quot;, $gain)'''&lt;br /&gt;
      '''&amp;lt;/make&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;callback&amp;gt;set_arg(&amp;quot;gain&amp;quot;, $gain)&amp;lt;/callback&amp;gt;'''&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'param' node for every Parameter you want settable from the GUI.&lt;br /&gt;
           Sub-nodes:&lt;br /&gt;
           * name&lt;br /&gt;
           * key (makes the value accessible as $keyname, e.g. in the make node)&lt;br /&gt;
           * type --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
         .  &lt;br /&gt;
         .&lt;br /&gt;
         .&lt;br /&gt;
    &lt;br /&gt;
        &amp;lt;option&amp;gt;&lt;br /&gt;
          &amp;lt;name&amp;gt;Byte&amp;lt;/name&amp;gt;&lt;br /&gt;
          &amp;lt;key&amp;gt;u8&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;/option&amp;gt;&lt;br /&gt;
      &amp;lt;/param&amp;gt;&lt;br /&gt;
      &amp;lt;param&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;'''Gain'''&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;'''gain'''&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;value&amp;gt;'''1.0'''&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''real'''&amp;lt;/type&amp;gt;&lt;br /&gt;
      &amp;lt;/param&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'sink' node per input. Sub-nodes:&lt;br /&gt;
           * name (an identifier for the GUI)&lt;br /&gt;
           * type&lt;br /&gt;
           * vlen&lt;br /&gt;
           * optional (set to 1 for optional inputs) --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;sink&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;in&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''complex'''&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;vlen&amp;gt;$grvlen&amp;lt;/vlen&amp;gt;&lt;br /&gt;
        &amp;lt;domain&amp;gt;rfnoc&amp;lt;/domain&amp;gt;&lt;br /&gt;
      &amp;lt;/sink&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'source' node per output. Sub-nodes:&lt;br /&gt;
           * name (an identifier for the GUI)&lt;br /&gt;
           * type&lt;br /&gt;
           * vlen&lt;br /&gt;
           * optional (set to 1 for optional inputs) --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;out&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''complex'''&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;vlen&amp;gt;$grvlen&amp;lt;/vlen&amp;gt;&lt;br /&gt;
        &amp;lt;domain&amp;gt;rfnoc&amp;lt;/domain&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Indentation spacing is important in the &amp;lt;code&amp;gt;&amp;lt;make&amp;gt;&amp;lt;/code&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
===Compile, Install and Verify===&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/rfnoc-tutorial/build&lt;br /&gt;
    $ make install&lt;br /&gt;
    &lt;br /&gt;
    $ uhd_usrp_probe &lt;br /&gt;
    &lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * '''gain_0'''&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' In the case where the &amp;lt;code&amp;gt;gain_0&amp;lt;/code&amp;gt; does not appear but &amp;lt;code&amp;gt;Block_0&amp;lt;/code&amp;gt; does: Most likely, the XML block declaration file (see [[Getting_Started_with_RFNoC_Development#UHD_integration|UHD Integration]] section) for the block contains a NoC-ID that does not match with any NoC-ID defined in the hardware part of the design. The user has to be certain that the description files are up-to-date and that the NoC-ID matches in the SW and HW side. See the [[Getting_Started_with_RFNoC_Development#UHD_integration|UHD Integration]] section to update those host side files.&lt;br /&gt;
&lt;br /&gt;
==Testing out the custom block==&lt;br /&gt;
At this point the custom &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; RFNoc Block (Computation Engine) can be used within a GNU Radio flowgraph. Below is an example GRC flowgraph using our new block as well as the output application it produces. &lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 13.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Copy Block: In the RFNoC domain, streams of data can not be split as easily as they are in the GNU Radio domain. The “copy” block depicted in the screenshot above serves the function as a stream splitter . It’s main purpose, when “enabled”, is to copy the samples it is getting at its input and putting then into the output, but here it is also serving as a boundary between a RFNoC-domain and a GNURadio-domain. In the flowgraph above. after this boundary is passed, the data stream can easily be split into the two sinks to have them run simultaneously (standard GNU Radio functionality). It is possible to connect the GNU Radio blocks directly to RFNoC blocks without a “copy” block, but only one would work at a time (the other ones would have to be disabled). Another way to split data streams from the RFNoC-domain is to use the ”RFNoC: split stream” block, which would split the streams in the RFNoC domain, but this is not very useful here as we are, in any case, moving into the GNURadio-domain.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 14.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
===Xilinx Vivado===&lt;br /&gt;
====Compile issues====&lt;br /&gt;
=====Synthesis is failing=====&lt;br /&gt;
Verify all the correct Xilinx [[Getting Started with RFNoC Development#Prerequisites|prerequisite software]] is installed.&lt;br /&gt;
&lt;br /&gt;
Additional helpful information can be found in the following Xilinx forum posts:&lt;br /&gt;
* https://forums.xilinx.com/t5/Synthesis/Synthesis-failed-without-reporting-any-error/td-p/686000&lt;br /&gt;
* https://forums.xilinx.com/t5/Installation-and-Licensing/Vivado-on-Linux-synthesis-fails-with-no-error-message/td-p/732143&lt;br /&gt;
&lt;br /&gt;
====Environment Setup====&lt;br /&gt;
The &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script will also set up the Xilinx Vivado environment by automatically running the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{device}&amp;lt;/code&amp;gt; directory. The &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script assumes that Xilinx Vivado is installed in the default location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;. If the installation is in a different directory, then the &amp;lt;code&amp;gt;setupenv_base.sh&amp;lt;/code&amp;gt; script will need to be modified. The script is located at: &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3_rfnoc/tools/scripts/setupenv_base.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Links and Additional Resources==&lt;br /&gt;
===RFNoC additional resources===&lt;br /&gt;
* [https://kb.ettus.com/RFNoC RFNoC Primary Application Note]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Intro.pdf RFNoC Introduction]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_FPGA.pdf RFNoC Deep Dive: FPGA]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Host.pdf RFNoC Deep Dive: Host side]&lt;br /&gt;
* [https://www.youtube.com/watch?v=8cPd3t88djE Video: RFNoC presented at Wireless @ Virginia Tech, 2015 ]&lt;br /&gt;
** Explaining the slides of Intro, FPGA and Host presentations above (in that order).&lt;br /&gt;
&lt;br /&gt;
===GNU Radio resources===&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules GNU Radio OutOfTree Modules tutorial]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGRFromSource GNU Radio Installation]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/Tutorials GNU Radio Tutorials]&lt;br /&gt;
&lt;br /&gt;
===UHD resources===&lt;br /&gt;
* [https://kb.ettus.com/UHD UHD Software Resources Page]&lt;br /&gt;
* [http://files.ettus.com/manual/md_usrp3_build_instructions.html USRP3 build instructions]&lt;br /&gt;
* [http://files.ettus.com/manual/ UHD Manual]&lt;br /&gt;
&lt;br /&gt;
===Other resources===&lt;br /&gt;
* [https://www.xilinx.com/support/documentation/ip_documentation/ug761_axi_reference_guide.pdf Xilinx - AXI reference guide]&lt;br /&gt;
* [https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux UHD + GNU Radio Application Note (Linux)]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/pybombs/wiki PyBOMBS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=3316</id>
		<title>Getting Started with RFNoC Development</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=3316"/>
				<updated>2017-01-17T01:24:17Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: /* Create development environment using PyBOMBS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-823'''&lt;br /&gt;
&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-07-12&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Martin Braun&amp;lt;br&amp;gt; Nicolas Cuervo&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2017-01-10&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Team&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Added “Digital Gain” example&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This application note guides a user through basic information on the RFNoC architecture, installing necessary software to develop custom RFNoC blocks, also called Computation Engines (CE), and walks through the steps of creating a custom RFNoC block using an example.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
First sections deal with installing tools and validating correct tool installation in order to do RFNoC development. Later sections deal with creating a custom RFNoC block, using the built-in testbench architecture, building an FPGA image with the custom block and finally testing out the new block within GNU Radio.&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
The RFNoC code base is open source, including code that executes on the host, as well as code targeted to the USRP hardware (FPGA and microcontroller firmware). As dual-licensed software, RFNoC is available under the open-source GNU Public License version 3 (GPLv3), as well as an alternative, less-restrictive license offered only by Ettus Research. For more information on our licensing policy, please contact [mailto:info@ettus.com info@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
In order to build custom USRP FPGA images and RFNoC blocks the following hardware and software are needed.&lt;br /&gt;
&lt;br /&gt;
* '''Ubuntu 14.04 or 16.04(preferred):''' Currently PyBOMBS (which can be used to install the ''Software build tools''), works most reliably in Ubuntu, and thus, we recommend using this distribution. Also, a majority of the scripts used during the build process are Linux (Ubuntu) specific. A PC with multiple cores and 8GB+ of RAM is recommended.&lt;br /&gt;
&lt;br /&gt;
* '''Xilinx Vivado tools (ver. 2015.4):''' The specific version depends on the branch and state of the FPGA code. The default install location is &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;. Once all of the Software build tools are installed the specific version for the downloaded code can be found in the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{DEVICE}&amp;lt;/code&amp;gt; directory. Further information can be found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here].&lt;br /&gt;
&lt;br /&gt;
* '''Software build tools:''' If UHD can be or has been compiled from source on the development PC then all the necessary software build components are present (PyBOMBS can be used to set all this up and instructions on how to do so are given in a following step).&lt;br /&gt;
&lt;br /&gt;
* X3xx series or E3xx series device or any future USRP&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
* The edition of Xilinx Vivado that is required will depend on the USRP device.&lt;br /&gt;
** X3xx series devices: Design or System editions.&lt;br /&gt;
** E3xx series devices: Design, System or the free WebPack edition.&lt;br /&gt;
* Other operating systems can be used, but the exact steps on how to proceed are not given in this Application Note.&lt;br /&gt;
* In some Linux distributions (e.g. Ubuntu) &amp;lt;code&amp;gt;dash&amp;lt;/code&amp;gt; is set as default shell, which may cause some issues. It is recommended to set the shell to &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; by running the following commands in the terminal. Choose &amp;lt;code&amp;gt;&amp;lt;No&amp;gt;&amp;lt;/code&amp;gt; when prompted by the first command and the second command will validate the that bash will be used.&lt;br /&gt;
&lt;br /&gt;
    $ sudo dpkg-reconfigure dash&lt;br /&gt;
    $ ll /bin/sh&lt;br /&gt;
&lt;br /&gt;
==Creating a development environment==&lt;br /&gt;
While this Application Note goes through the process of integrating GNU Radio into the RFNoC development flow, it is by no means required to use or develop within the RFNoC framework, but it makes it a great deal easier to use a framework on top of RFNoC for aspects such as visualization and other features. GNU Radio is freely available and more information about it can be found [http://gnuradio.org/ here].&lt;br /&gt;
&lt;br /&gt;
The following software packages are required in order to setup a development environment/sandbox:&lt;br /&gt;
&lt;br /&gt;
* UHD&lt;br /&gt;
* GNU Radio &lt;br /&gt;
* gr-ettus&lt;br /&gt;
&lt;br /&gt;
===Create development environment using PyBOMBS===&lt;br /&gt;
The cleanest way to set this up is to install everything into a dedicated directory. [http://gnuradio.org/redmine/projects/pybombs/wiki PyBOMBS] is the simplest way to do this. If not already installed, PyBOMBS can be setup with the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ sudo apt-get install git&lt;br /&gt;
    $ sudo apt-get install python-setuptools python-dev python-pip build-essential &lt;br /&gt;
    &lt;br /&gt;
    $ sudo pip install git+https://github.com/gnuradio/pybombs.git&lt;br /&gt;
    $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git&lt;br /&gt;
    $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git&lt;br /&gt;
&lt;br /&gt;
These commands will do the following:&lt;br /&gt;
* Install &amp;lt;code&amp;gt;Git&amp;lt;/code&amp;gt;&lt;br /&gt;
* Install &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; and other Python dependencies&lt;br /&gt;
* Install the latest &amp;lt;code&amp;gt;PyBOMBS&amp;lt;/code&amp;gt; from its Git repository&lt;br /&gt;
* Add the &amp;lt;code&amp;gt;gr-recipes&amp;lt;/code&amp;gt; recipes which are used to install GNU Radio specific software&lt;br /&gt;
* Add the &amp;lt;code&amp;gt;ettus&amp;lt;/code&amp;gt; recipes which are used to install Ettus Research specific software&lt;br /&gt;
&lt;br /&gt;
From here, PyBOMBS can be used to setup and install the development environment/sandbox by running the following command:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs prefix init ~/rfnoc -R rfnoc -a rfnoc&lt;br /&gt;
&lt;br /&gt;
This will do the following:&lt;br /&gt;
&lt;br /&gt;
* Create a directory in the user’s home directory called &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; (any valid directory name will work)&lt;br /&gt;
&lt;br /&gt;
* Give the prefix an alias of &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; ( &amp;lt;code&amp;gt;[-a alias]&amp;lt;/code&amp;gt;, e.g. &amp;lt;code&amp;gt;–a rfnoc&amp;lt;/code&amp;gt; ), which would be the name given to this path. This name will be used in further steps that use PyBOMBS. When creating the first prefix and omitting the alias, the prefix will be setup as the default.&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; prefix recipe ( as opposed to a package recipe like &amp;lt;code&amp;gt;gqrx&amp;lt;/code&amp;gt; ) to clone UHD, FPGA, GNU Radio, and gr-ettus sources into the &amp;lt;code&amp;gt;~/rfnoc&amp;lt;/code&amp;gt; directory as well as compile and install all the software&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' A user can specify how many cores are used during compile time by specifying the &amp;lt;code&amp;gt;--config makewidth=X&amp;lt;/code&amp;gt; argument, where “&amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;” is an integer number. The default is set to 4. If the user only has 4 cores it is recommend to use this argument in the pybombs command to limit the number of cores to &amp;lt;4 (e.g. 3) so that the computer stays responsive. Following are 2 examples, one using less cores and the other using more cores:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs --config makewidth=3 prefix init ~/rfnoc -R rfnoc -a rfnoc &lt;br /&gt;
    $ pybombs --config makewidth=7 prefix init ~/rfnoc -R rfnoc -a rfnoc&lt;br /&gt;
&lt;br /&gt;
Then, it is necessary to setup the PyBOMBS environment, so that the system/terminal session will have the environmental variables pointing to this newly created prefix, which is done with the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/rfnoc&lt;br /&gt;
    $ source ./setup_env.sh&lt;br /&gt;
&lt;br /&gt;
Once the previous command is run, this terminal session will have access to the environmental variables that allow the complete use of the set of software that was just installed with PyBOMBS. If access to the software is needed in other terminals the same command must be run within them.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Throughout the rest of this document the term &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; will used at the beginning of different directories. For example, &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&amp;lt;/code&amp;gt; is a directory that contains useful scripts for compiling. The term &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; is used to denote the folders that precede the &amp;lt;code&amp;gt;/src&amp;lt;/code&amp;gt; directory. Examples of what &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; could be: &amp;lt;code&amp;gt;/home/user/rfnoc&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/home/user/myDevfolder/&amp;lt;/code&amp;gt;. On many Linux environments using &amp;lt;code&amp;gt;~/&amp;lt;/code&amp;gt; at the beginning of the target directory path is equivalent to the user’s home directory.( i.e &amp;lt;code&amp;gt;~/&amp;lt;/code&amp;gt; is equal to &amp;lt;code&amp;gt;/home/user/&amp;lt;/code&amp;gt;). So &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; could also look like &amp;lt;code&amp;gt;~/rfnoc&amp;lt;/code&amp;gt;  or &amp;lt;code&amp;gt;~/myDevfolder/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Create development environment manually===&lt;br /&gt;
As an alternative to using PyBOMBS, manually installing and configuring the software is done by following the individual install notes for [http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGRFromSource GNU Radio], [https://files.ettus.com/manual/page_build_guide.html UHD] and [https://github.com/EttusResearch/gr-ettus gr-ettus] and by making sure they are reachable by linkers and compilers.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The Application Note found [https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux here] goes through the process of manually installing UHD and GNU Radio on Linux platforms.&lt;br /&gt;
&lt;br /&gt;
To manually download the software, use these &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt; commands, which will select the correct branches:&lt;br /&gt;
&lt;br /&gt;
    $ git clone --recursive -b rfnoc-devel https://github.com/EttusResearch/uhd.git &lt;br /&gt;
    $ git clone --recursive -b maint https://github.com/gnuradio/gnuradio.git # master branch is also fine instead of maint&lt;br /&gt;
    $ git clone -b master https://github.com/EttusResearch/gr-ettus.git &lt;br /&gt;
    $ git clone -b rfnoc-devel https://github.com/EttusResearch/fpga.git&lt;br /&gt;
&lt;br /&gt;
If UHD, GNU Radio and/or gr-ettus are already installed, it would be sufficient to checkout the branches mentioned and update them them (&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;). Thereafter, rebuild each of the repositories (rebuild order: UHD, GNU Radio, gr-ettus).&lt;br /&gt;
&lt;br /&gt;
===Verify Environment===&lt;br /&gt;
Running the command “&amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;” with the “&amp;lt;code&amp;gt;--version&amp;lt;/code&amp;gt;” flag will verify that the installation has been completed successfully.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The version string output from this command may differ, however it should be similar to the output below.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe --version&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-161- g83150fdd&lt;br /&gt;
    &lt;br /&gt;
    4.0.0.rfnoc-devel-161-g83150fdd&lt;br /&gt;
&lt;br /&gt;
===Testing the default FPGA image and building from existing blocks===&lt;br /&gt;
&lt;br /&gt;
It is recommended to spend a moment looking at the Ettus Research default image, which is pre-built with a set of RFNoC blocks, as well as building a custom image with a unique set of pre-built RFNoC blocks. To get the default image(s), run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_images_downloader&lt;br /&gt;
&lt;br /&gt;
Ettus Research will be updating the default image(s) occasionally, and &amp;lt;code&amp;gt;uhd_images_downloader&amp;lt;/code&amp;gt; can be run anytime after running &amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt; and re-installing to pull the most current images. Images are stored in the &amp;lt;code&amp;gt;{USER_PREFIX}/share/uhd/images&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
The following images have the corresponding RFNoC blocks (Computation Engines):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Image Name&lt;br /&gt;
!Included Blocks&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x300_fpga_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x300_fpga_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;2x DDC, 2x DUC&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x300_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x300_fpga_RFNOC_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DUC, DDC (one channel), fosphor, window, fft, 2x AXI FIFOs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DUC, DDC (one channel), fosphor, window, fft, 2x AXI FIFOs, Keep One in N, FIR, Siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_e310_fpga.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_e310_fpga_sg3.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;1x DDC, 1x DUC&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_e310_fpga_RFNOC.bit (sg1 version)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_e310_fpga_RFNOC_sg3.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;fosphor, window, fft, 2x AXI FIFOs, FIR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Instructions on flashing the image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
  &lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device.&lt;br /&gt;
&lt;br /&gt;
By following the steps above the following should now be available:&lt;br /&gt;
* UHD/RFNoC code downloaded and installed&lt;br /&gt;
* FPGA code available&lt;br /&gt;
* A valid RFNoC image on your X3xx or E3xx series device&lt;br /&gt;
&lt;br /&gt;
====Inspect default images====&lt;br /&gt;
Run the following command, with a USRP connected to your PC, to verify current image on the USRP.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
If an RFNoC image was successfully loaded onto the USRP, there will be a lot of output text (RFNoC code is currently very verbose). The final lines of the output should be similar to the following for an USRP X310 ( e.g. &amp;lt;code&amp;gt;usrp_x310_fpga_HG&amp;lt;/code&amp;gt; ):&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * DDC_1&lt;br /&gt;
    |   |   |   * DUC_0&lt;br /&gt;
    |   |   |   * DUC_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Final output for &amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt; image:&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * DUC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * Window_0&lt;br /&gt;
    |   |   |   * FIR_0&lt;br /&gt;
    |   |   |   * SigGen_0&lt;br /&gt;
    |   |   |   * KeepOneInN_0&lt;br /&gt;
    |   |   |   * fosphor_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The actual names and number of blocks can differ. The list of blocks should start with the &amp;lt;code&amp;gt;DmaFIFO_x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Radio_x&amp;lt;/code&amp;gt;, and then a couple more lines of block IDs should follow.&lt;br /&gt;
&lt;br /&gt;
====Build custom image with pre-built RFNoC blocks====&lt;br /&gt;
Because of the growing number of RFNoC blocks, the user has the option to build an FPGA image with a set of pre-built RFNoC blocks of their choosing. The following steps describe the process for doing this and by so doing will also validate proper tool installation. Because compilation can take a couple of hours, it is recommended the user begin this process while continuing the rest of this guide.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA compilations can run in the background, however they are very resource intensive. If the user intents to use the same computer that is compiling to walk through the rest of this Application Note, it is recommended that the computer has plenty of resources.&lt;br /&gt;
&lt;br /&gt;
The script to initiate a compile is called &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt;, and is located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&amp;lt;/code&amp;gt; directory. Run the help menu by typing:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts &lt;br /&gt;
    $ ./uhd_image_builder.py --help&lt;br /&gt;
&lt;br /&gt;
A more detailed discussion of this script is given in an upcoming section. For now, compiling an FPGA image that has 2 RFNoC blocks (&amp;lt;code&amp;gt;window&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fft&amp;lt;/code&amp;gt;) and some &amp;lt;code&amp;gt;FIFOs&amp;lt;/code&amp;gt;, is done by running the script with the following arguments.&lt;br /&gt;
&lt;br /&gt;
Example for an X310 USRP:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py window fft -d x310 -t X310_RFNOC_HG -m 5 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
Example for an E310 USRP with Speed Grade 3 (sg3) FPGA:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py window fft -d e310 -t E310_RFNOC_sg3 -m 5 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
At the end of a successful compilation process, write the new image to a USRP. If the image was compiled for a USRP X310, the following command will load the new image. Update the &amp;lt;code&amp;gt;{IP_Address}&amp;lt;/code&amp;gt; of the USRP and &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; to the appropriate values for your configuration before running the command.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args “type=x300,addr={IP_ADDRESS}” --fpga-path {USER_PREFIX}/src/uhd-fpga/usrp3/top/x300/build/usrp_x310_fpga_RFNOC_HG.bit&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. Additional instructions on flashing a custom image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
&lt;br /&gt;
After the image has been successfully written to the USRP, power-cycle it and run the “&amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;” utility to view the newly compiled blocks.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
The final lines of output for the image built for the X310 is as follows:&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * Window_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
===Getting started with UHD + RFNoC===&lt;br /&gt;
The following new examples included within the &amp;lt;code&amp;gt;rfnoc-devel&amp;lt;/code&amp;gt; branch of UHD, are a good reference on how to use RFNoC from UHD.&lt;br /&gt;
&lt;br /&gt;
The following example is based off of &amp;lt;code&amp;gt;rx_samples_to_file.cpp&amp;lt;/code&amp;gt;. The example can be configured to place an RFNoC block in between the radio and host.&lt;br /&gt;
&lt;br /&gt;
    rfnoc_rx_to_file.cpp&lt;br /&gt;
&lt;br /&gt;
This next example chains a null source to another block and streams the data to the host.&lt;br /&gt;
&lt;br /&gt;
    rfnoc_nullsource_ce_rx.cpp&lt;br /&gt;
&lt;br /&gt;
These examples demonstrate the core features and flexibility of RFNoC.&lt;br /&gt;
&lt;br /&gt;
For more information on UHD and UHD development please refer to the [https://kb.ettus.com/UHD UHD Software Resource page], [https://kb.ettus.com/Getting_Started_with_UHD_and_C%2B%2B Getting Started with UHD and C++ Application Note] or directly to the [http://files.ettus.com/manual/ UHD user manual].&lt;br /&gt;
&lt;br /&gt;
===Getting started with GNU Radio + RFNoC===&lt;br /&gt;
A good way of getting started with RFNoC in a more tangible fashion is to use GNU Radio. The &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; out-of-tree module (OOT) allows a user to use RFNoC blocks in their local GNU Radio / GNU Radio Companion (GRC) installation. This GNU Radio OOT contains blocks that allow you to configure your FPGA through GRC.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' As blocks in the &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; OOT mature, they will be upstreamed to &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt;. Also, &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; is a container used by Ettus Research to disseminate experimental or under-development features for &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt;. It is not a replacement for &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; (in fact, the latter is a requirement for &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;).&lt;br /&gt;
    &lt;br /&gt;
Examples can be run from &amp;lt;code&amp;gt;gr-ettus/examples/rfnoc&amp;lt;/code&amp;gt;, provided that the appropriate RFNoC blocks and compiled into the FPGA image currently running on the USRP.&lt;br /&gt;
&lt;br /&gt;
A couple of rules for building GNU Radio flowgraphs:&lt;br /&gt;
&lt;br /&gt;
* You always need a &amp;lt;code&amp;gt;Device3&amp;lt;/code&amp;gt; object in your flow graph (it does not get connected, see screenshot below).&lt;br /&gt;
* You should have at least two RFNoC blocks connected together, going &amp;lt;code&amp;gt;GNU Radio Block&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;RFNoC Block&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;GNU Radio Block&amp;lt;/code&amp;gt; is not recommended (it will work, but with suboptimal performance).&lt;br /&gt;
&lt;br /&gt;
The GNU Radio flowgraph &amp;lt;code&amp;gt;rfnoc_ddc.grc&amp;lt;/code&amp;gt; is an example that can be run using the default RFNoC image. Below are screenshots of the flowgraph and what it produces.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 1.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Copy Block: In the RFNoC domain, streams of data can not be split as easily as they are in the GNU Radio domain. The “copy” block depicted in the screenshot above serves the function as a stream splitter . It’s main purpose, when “enabled”, is to copy the samples it is getting at its input and putting then into the output, but here it is also serving as a boundary between a RFNoC-domain and a GNURadio-domain. In the flowgraph above. after this boundary is passed, the data stream can easily be split into the two sinks to have them run simultaneously (standard GNU Radio functionality). It is possible to connect the GNU Radio blocks directly to RFNoC blocks without a “copy” block, but only one would work at a time (the other ones would have to be disabled). Another way to split data streams from the RFNoC- domain is to use the ”RFNoC: split stream” block, which would split the streams in the RFNoC domain, but this is not very useful here as we are, in any case, moving into the GNURadio-domain.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 2.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
For more information on GNURadio development please refer to the [http://gnuradio.org/doc/doxygen/ GNURadio user's manual and API].&lt;br /&gt;
&lt;br /&gt;
==Starting a custom RFNoC block using RFNoC Modtool==&lt;br /&gt;
The figure below shows the basic structure of the RFNoC Stack. Corresponding code is needed in each of the three sections in order to build a custom RFNoC block with GNU Radio integration. A tool called RFNoC Modtool was created in order to minimize the effort needed to implement a new RFNoC block. RFNoC Modtool creates a custom GNU Radio OOT module with the basic structure and the necessary files for each of these sections. RFNoC Modtool is currently a part of the GNU Radio OOT module &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 3.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
===RFNoC Modtool Utilization===&lt;br /&gt;
'''NOTE:''' Console outputs may vary depending on the version of UHD the user is running. However, functionality should be the same or similar.&lt;br /&gt;
&lt;br /&gt;
Because the RFNoC Modtool has similar functionality to the &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt; [ [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules gr_modtool] ] provided by GNU Radio, those that have worked with &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt; in the past will find the RFNoC Modtool familiar.&lt;br /&gt;
&lt;br /&gt;
To check the usage of the tool, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool help&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    Usage:&lt;br /&gt;
    rfnocmodtool &amp;lt;command&amp;gt; [options] -- Run &amp;lt;command&amp;gt; with the given options.&lt;br /&gt;
    rfnocmodtool help -- Show a list of commands.&lt;br /&gt;
    rfnocmodtool help &amp;lt;command&amp;gt; -- Shows the help for a given command. &lt;br /&gt;
    &lt;br /&gt;
    List of possible commands:&lt;br /&gt;
    &lt;br /&gt;
    Name      Aliases          Description&lt;br /&gt;
    =====================================================================&lt;br /&gt;
    disable   dis              Disable block (comments out CMake entries for files) &lt;br /&gt;
    info      getinfo,inf      Return information about a given module &lt;br /&gt;
    remove    rm,del           Remove block (delete files and remove Makefile entries) &lt;br /&gt;
    makexml   mx               Make XML file for GRC block bindings &lt;br /&gt;
    add       insert           Add block to the out-of-tree module. &lt;br /&gt;
    newmod    nm,create        Create a new out-of-tree module &lt;br /&gt;
    rename    mv               Rename a block in the out-of-tree module.&lt;br /&gt;
&lt;br /&gt;
===Creating an RFNoC OOT Module===&lt;br /&gt;
&lt;br /&gt;
To start generating an RFNoC OOT module navigate to the source location ( i.e. &amp;lt;code&amp;gt;cd ~/{USER_PREFIX}/src&amp;lt;/code&amp;gt; ) and type:&lt;br /&gt;
    $ rfnocmodtool newmod [NAME OF THE MODULE]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;code&amp;gt;[NAME OF THE MODULE]&amp;lt;/code&amp;gt; is a name the user gives the new module. In the following, a module is created with the name “&amp;lt;code&amp;gt;tutorial&amp;lt;/code&amp;gt;”. If the user does not write the name of the module following the &amp;lt;code&amp;gt;newmod&amp;lt;/code&amp;gt; command the tool will ask for it interactively. Running this command will create a folder containing the basic folders that you may need for a functional module.&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod tutorial&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    Creating out-of-tree module in ./rfnoc-tutorial... Done.&lt;br /&gt;
    Use 'rfnocmodtool add' to add a new block to this currently empty module.&lt;br /&gt;
&lt;br /&gt;
To see what files and directories were created run:&lt;br /&gt;
&lt;br /&gt;
    $ ls rfnoc-tutorial/&lt;br /&gt;
    apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In contrast with &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt;, this includes a folder called &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt;, which is where the UHD/FPGA files are located.&lt;br /&gt;
&lt;br /&gt;
===Adding custom blocks to OOT Module===&lt;br /&gt;
In order to add blocks to your module, navigate to the folder just created and use the &amp;lt;code&amp;gt;add&amp;lt;/code&amp;gt; command of &amp;lt;code&amp;gt;rfnocmodtool&amp;lt;/code&amp;gt;. Continuing with the example above, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ cd rfnoc-tutorial&lt;br /&gt;
    $ rfnocmodtool add [NAME OF THE BLOCK]&lt;br /&gt;
&lt;br /&gt;
For demonstrative purposes, a block named &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; will be created. The &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block will multiply samples that pass through it by a constant. As before, if the name is not given, the tool will ask the user for the name. There are several arguments that can be passed to the tool, but running the tool without any of these arguments will give the following interactive parsing output:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool add gain&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    RFNoC module name identified: tutorial&lt;br /&gt;
    Block/code identifier: gain&lt;br /&gt;
    Enter valid argument list, including default arguments: &lt;br /&gt;
    Add Python QA code? [Y/n] Y&lt;br /&gt;
    Add C++ QA code? [y/N] N&lt;br /&gt;
    Block NoC ID (Hexadecimal): 1111222233334444&lt;br /&gt;
    Skip Block Controllers Generation? [UHD block ctrl files] [y/N] N&lt;br /&gt;
    Skip Block interface files Generation? [GRC block ctrl files] [y/N] N&lt;br /&gt;
&lt;br /&gt;
Hitting &amp;lt;code&amp;gt;enter&amp;lt;/code&amp;gt; on each one of the options will take the default values.&lt;br /&gt;
&lt;br /&gt;
The following is a description of the valid argument list items:&lt;br /&gt;
&lt;br /&gt;
* '''Add Python QA code:''' Not used.&lt;br /&gt;
&lt;br /&gt;
* '''Add C++ QA code:''' Not used.&lt;br /&gt;
&lt;br /&gt;
* '''NoC ID:''' This ID is a Hexadecimal number which serves as identification between the hardware part and the software part of the design. It can be as long as 16 0-9 A-F digits. If a NoC ID is not provided, it will be set to a random number.&lt;br /&gt;
&lt;br /&gt;
* '''Block Controllers Generation:''' The block controllers are the C++ control that the user can apply to the UHD-part of the design. In these files, the user can add more control over this layer of the design. Depending on the complexity of the block it may be possible to add all necessary control using NoCScript (more details on NoCScript can be found in the section labeled UHD Integration). In this case the cpp/hpp block control files generation are not needed. Default is to generate as their existence will be ignored if not edited.&lt;br /&gt;
&lt;br /&gt;
* '''Block Interface:''' Add more design specific functionality to the design at the GNU Radio interface by generating these block-interface files and adding necessary logic.  Depending on the complexity of the block it may be possible to add all necessary control using NoC-Script. In this case the block-interface files are not needed. Default is to generate as their existence will be ignored if not edited.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' If the user does not intend to use the block controllers or is not sure if they are needed, the presence of them in the design will do no harm. It is recommended to add them. This leaves the possibility to add more functions inside them in a future stage of development. &lt;br /&gt;
&lt;br /&gt;
After finishing the parsing, the following files will be generated/edited:&lt;br /&gt;
&lt;br /&gt;
    Adding file 'lib/gain_impl.h'...&lt;br /&gt;
    Adding file 'lib/gain_impl.cc'...&lt;br /&gt;
    Adding file 'include/tutorial/gain.h'...&lt;br /&gt;
    Adding file 'include/tutorial/gain_block_ctrl.hpp'...&lt;br /&gt;
    Adding file 'lib/gain_block_ctrl_impl.cpp'...&lt;br /&gt;
    Editing swig/tutorial_swig.i...&lt;br /&gt;
    Adding file 'python/qa_gain.py'...&lt;br /&gt;
    Editing python/CMakeLists.txt...&lt;br /&gt;
    Adding file 'grc/tutorial_gain.xml'...&lt;br /&gt;
    Adding file 'rfnoc/blocks/gain.xml'...&lt;br /&gt;
    Adding file 'rfnoc/fpga-src/noc_block_gain.v'...&lt;br /&gt;
    rfnoc/testbenches/noc_block_gain_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
==Creating FPGA portion of custom RFNoC Block==&lt;br /&gt;
===RFNoC FPGA User Interface (API)===&lt;br /&gt;
RFNoC blocks or Computation Engines (CEs) in the FPGA use a NoC Shell instance to interface with the rest of RFNoC. NoC Shell implements RFNoC's core functionality: packet muxing and demuxing, flow control, and the settings register bus (i.e. write/read control/status registers). The NoC Shell has an interface to the RFNoC AXI stream crossbar and a user interface. NoC Shell AXI stream interfaces expect CHDR packets with a proper header. See the manual for information on [https://files.ettus.com/manual/page_rtp.html CHDR and SID].&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' AXI Stream is an ARM AMBA standard interface. Xilinx has an [http://www.xilinx.com/support/documentation/ip_documentation/ug761_axi_reference_guide.pdf AXI Reference Guide] with more details on this standard.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 4.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
Many designs will want to use an AXI Stream interface with only sample data. However, as stated earlier, the NoC Shell block expects CHDR packets. To ease interfacing user code, the AXI Wrapper block provides the necessary logic to strip and insert the CHDR header, effectively converting packetized sample data into streaming sample data and vice versa. The example RFNoC blocks &amp;lt;code&amp;gt;noc_block_fft.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noc_block_fir.v&amp;lt;/code&amp;gt; show how AXI Wrapper is used to implement existing Xilinx AXI Stream based IP within a computation engine.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' AXI Wrapper also supports AXI Stream buses for configuration. These buses are driven via the setting register bus and do not have back pressure. They also consume two user register addresses per bus.&lt;br /&gt;
&lt;br /&gt;
The primary user interface consists of four AXI stream interfaces ( &amp;lt;code&amp;gt;tready, tvalid, tlast, tdata&amp;lt;/code&amp;gt; ) and a settings register bus ( 8-bit, valid user register addresses: &amp;lt;code&amp;gt;128-255&amp;lt;/code&amp;gt; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
AXI Stream signals:&lt;br /&gt;
* '''m_axis_data_tdata:''' Input sample data packets &lt;br /&gt;
** Data coming from host or another CE&lt;br /&gt;
* '''s_axis_data_tdata:''' Output sample data packets &lt;br /&gt;
** Data going to another CE or host&lt;br /&gt;
* '''m_axis_data_tready:''' Input signal to CE&lt;br /&gt;
** Used to notify CE that downstream CE is ready for data &lt;br /&gt;
* '''s_axis_data_tready:''' Output signal to CE&lt;br /&gt;
** Used to notify upstream CE that CE is ready for data &lt;br /&gt;
* '''m_axis_data_tvalid:''' Input signal to CE&lt;br /&gt;
** Used to indicate upstream CE has valid data &lt;br /&gt;
* '''s_axis_data_tvalid:''' Output signal to CE&lt;br /&gt;
** Used to indicate to downstream CE that CE has valid data &lt;br /&gt;
* '''m_axis_data_tlast:''' Input signal to CE&lt;br /&gt;
** Used to delimit packets from upstream CE &lt;br /&gt;
* '''s_axis_data_tlast:''' Output signal to CE&lt;br /&gt;
** Used to delimit packets to downstream CE&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; |[[File:rfnoc gsg an 5.png|right|500px|]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 6.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Settings Bus signals:&lt;br /&gt;
* '''set_stb:''' Assert to write '''set_data''' to register at '''set_addr'''ess&lt;br /&gt;
* '''set_addr:''' Register address to set&lt;br /&gt;
* '''set_data:''' Data to set&lt;br /&gt;
* '''rb_data:''' Data to read back&lt;br /&gt;
* '''rb_strobe:''' Assert to read '''rb_data''' from register at '''set_addr'''ess&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; |[[File:rfnoc gsg an 7.png|right|500px|]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
For the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; example block the following architecture is desired (the blue signal has both “I” and “Q” data):&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 8.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;lt;code&amp;gt;rfnoc-tutorial/rfnoc/fpga-src/noc_block_gain.v&amp;lt;/code&amp;gt; that contains the RFNoC block skeleton code that was created when the &amp;lt;code&amp;gt;$ rfnocmodtool add gain&amp;lt;/code&amp;gt; command was run and modify the following sections.&lt;br /&gt;
&lt;br /&gt;
For the setting register that will hold the constant value as well as the read back register:&lt;br /&gt;
&lt;br /&gt;
    '''localparam [7:0] SR_GAIN = SR_USER_REG_BASE;'''&lt;br /&gt;
    localparam [7:0] SR_TEST_REG_1 = SR_USER_REG_BASE + 8'd1;&lt;br /&gt;
    &lt;br /&gt;
    '''wire [15:0] gain;'''&lt;br /&gt;
    '''setting_reg #('''&lt;br /&gt;
      '''.my_addr(SR_GAIN), .awidth(8), .width(16))'''&lt;br /&gt;
    '''sr_gain ('''&lt;br /&gt;
      '''.clk(ce_clk), .rst(ce_rst),'''&lt;br /&gt;
      '''.strobe(set_stb), .addr(set_addr), .in(set_data), .out(gain), .changed());'''&lt;br /&gt;
    &lt;br /&gt;
     always @(posedge ce_clk) begin&lt;br /&gt;
        case(rb_addr)&lt;br /&gt;
          '''8'd0 : rb_data &amp;lt;= {48'd0, gain};'''&lt;br /&gt;
          8'd1 : rb_data &amp;lt;= {32'd0, test_reg_1};&lt;br /&gt;
          default : rb_data &amp;lt;= 64'h0BADC0DE0BADC0DE;&lt;br /&gt;
        endcase&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And for the processing section:&lt;br /&gt;
&lt;br /&gt;
    assign m_axis_data_tready = s_axis_data_tready;&lt;br /&gt;
    assign s_axis_data_tvalid = m_axis_data_tvalid;&lt;br /&gt;
    assign s_axis_data_tlast = m_axis_data_tlast;&lt;br /&gt;
    &lt;br /&gt;
    '''wire [15:0] i = m_axis_data_tdata[31:16];'''&lt;br /&gt;
    '''wire [15:0] q = m_axis_data_tdata[15:0];'''&lt;br /&gt;
    &lt;br /&gt;
    '''wire [31:0] i_mult_gain = i*gain;'''&lt;br /&gt;
    '''wire [31:0] q_mult_gain = q*gain;'''&lt;br /&gt;
    &lt;br /&gt;
    '''assign s_axis_data_tdata = {i_mult_gain[15:0], q_mult_gain[15:0]};'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''  Because the multiplication process can occur in the same clock cycle there is no need for handshaking with the AXI &amp;lt;code&amp;gt;tready, tvalid  and tlast&amp;lt;/code&amp;gt; signals and therefore they are simply passed through the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; RFNoC block.&lt;br /&gt;
&lt;br /&gt;
===Creating and running HDL testbenches===&lt;br /&gt;
In order to make the coding iteration process more efficient, it is recommended to create testbenches for all RFNoC blocks before compiling them into the FPGA image. This allows for flaw and/or bug detection early in the design. RFNoC Modtool provides the structure and files ( e.g. &amp;lt;code&amp;gt;noc_block_{USER_BLOCK_NAME}_tb&amp;lt;/code&amp;gt; ) for the testbenches of each of the OOT blocks that are added with the &amp;lt;code&amp;gt;$ rfnocmodtool add&amp;lt;/code&amp;gt; command. &lt;br /&gt;
&lt;br /&gt;
Below is a figure that shows the structure of the testbench created by the RFNoC Modtool.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 9.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
From the [[Getting Started with RFNoC Development#Adding_custom_blocks_to_OOT_Module|Adding custom blocks to OOT Module section]] where the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block was initially created, the last files generated were:&lt;br /&gt;
&lt;br /&gt;
    rfnoc/testbenches/noc_block_gain_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;noc_block_gain_tb&amp;lt;/code&amp;gt; is a folder generated to contain all the files related to the test bench of the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block. Each time a new OOT block is created, a new folder will be generated as well. &lt;br /&gt;
&lt;br /&gt;
Inside of this folder are the following three files:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt:&amp;lt;/code&amp;gt; this is an empty file used, so far, only to increase the scope of the compilers.&lt;br /&gt;
* &amp;lt;code&amp;gt;noc_block_gain_tb.sv:&amp;lt;/code&amp;gt; this is a ''System Verilog'' file, in which user custom tests are to be located.  This is the '''only''' file that needs to be modified.&lt;br /&gt;
* &amp;lt;code&amp;gt;Makefile:&amp;lt;/code&amp;gt; This file determines the directives that run the simulation.&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;lt;code&amp;gt;rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv&amp;lt;/code&amp;gt; and modify the following lines:&lt;br /&gt;
&lt;br /&gt;
    initial begin : tb_main&lt;br /&gt;
      string s;&lt;br /&gt;
      logic [31:0] random_word;&lt;br /&gt;
      logic [63:0] readback;&lt;br /&gt;
      '''logic [15:0] gain;'''&lt;br /&gt;
    &lt;br /&gt;
    `TEST_CASE_START(&amp;quot;Write / readback user registers&amp;quot;);&lt;br /&gt;
    random_word = $random();&lt;br /&gt;
    '''tb_streamer.write_user_reg(sid_noc_block_gain, noc_block_gain.SR_GAIN, random_word[15:0]);&lt;br /&gt;
    tb_streamer.read_user_reg(sid_noc_block_gain, 0, readback);&lt;br /&gt;
    $sformat(s, &amp;quot;User register 0 incorrect readback! Expected: %0d, Actual %0d&amp;quot;, readback[15:0], random_word[15:0]);&lt;br /&gt;
    `ASSERT_ERROR(readback[15:0] == random_word[15:0], s);'''&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    `TEST_CASE_START(&amp;quot;Test sequence&amp;quot;);&lt;br /&gt;
    '''gain = 100;'''&lt;br /&gt;
    '''tb_streamer.write_user_reg(sid_noc_block_gain, noc_block_gain.SR_GAIN, gain);'''&lt;br /&gt;
      fork&lt;br /&gt;
        begin&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    tb_streamer.recv(recv_payload,md);&lt;br /&gt;
      for (int i = 0; i &amp;lt; SPP/2; i++) begin&lt;br /&gt;
        '''expected_value = i*gain;'''&lt;br /&gt;
&lt;br /&gt;
Create a &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory, verify directory location is &amp;lt;code&amp;gt;rfnoc-tutorial&amp;lt;/code&amp;gt; and run:&lt;br /&gt;
&lt;br /&gt;
    $ mkdir build &amp;amp;&amp;amp; cd build/&lt;br /&gt;
&lt;br /&gt;
The next step is to run &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt;. If PyBOMBS was used to create the development sandbox, &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt; will automatically detect the location of the &amp;lt;code&amp;gt;fpga&amp;lt;/code&amp;gt; repository. If PyBOMBS was not used, the user must provide the location of where the &amp;lt;code&amp;gt;fpga&amp;lt;/code&amp;gt; repository is installed.&lt;br /&gt;
&lt;br /&gt;
If PyBOMBS used, run:&lt;br /&gt;
&lt;br /&gt;
    $ cmake ../&lt;br /&gt;
&lt;br /&gt;
If PyBOMBS not used, run:&lt;br /&gt;
&lt;br /&gt;
    $ cmake [-DUHD_FPGA_DIR=/PATH/TO/FPGA/REPOSITORY] ../&lt;br /&gt;
&lt;br /&gt;
Final output from the &amp;lt;code&amp;gt;$ cmake ../&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
    -- Configuring done&lt;br /&gt;
    -- Generating done&lt;br /&gt;
    -- Build files have been written to: /home/widow/rfnoc/src/rfnoc-tutorial/build&lt;br /&gt;
&lt;br /&gt;
The following command will modify the necessary files and set the correct path to the simulation tools. From now on, every time a new block is added, this command will be run automatically. Remember, only run the following command once for each OOT module (not RFNoC block, but OOT module) created:&lt;br /&gt;
&lt;br /&gt;
    $ make test_tb&lt;br /&gt;
    Scanning dependencies of target test_tb&lt;br /&gt;
    Built target test_tb&lt;br /&gt;
&lt;br /&gt;
Testbenches can be executed by running the command:&lt;br /&gt;
&lt;br /&gt;
    $ make noc_block_[name_of_your_block]_tb &lt;br /&gt;
&lt;br /&gt;
The gain block testbench can be run by running the following command:&lt;br /&gt;
&lt;br /&gt;
    $ make noc_block_gain_tb&lt;br /&gt;
&lt;br /&gt;
The simulation will start.  Final output should look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ========================================================&lt;br /&gt;
    TESTBENCH STARTED: noc_block_gain&lt;br /&gt;
    ========================================================&lt;br /&gt;
    [TEST CASE   1] (t=000000000) BEGIN: Wait for Reset...&lt;br /&gt;
    [TEST CASE   1] (t=000001002) DONE... Passed&lt;br /&gt;
    [TEST CASE   2] (t=000001002) BEGIN: Check NoC ID...&lt;br /&gt;
    Read GAIN NOC ID: 1111222233334444&lt;br /&gt;
    [TEST CASE   2] (t=000001238) DONE... Passed&lt;br /&gt;
    [TEST CASE   3] (t=000001238) BEGIN: Connect RFNoC blocks...&lt;br /&gt;
    Connecting noc_block_tb (SID: 1:0) to noc_block_gain (SID: 0:0)&lt;br /&gt;
    Connecting noc_block_gain (SID: 0:0) to noc_block_tb (SID: 1:0)&lt;br /&gt;
    [TEST CASE   3] (t=000005457) DONE... Passed&lt;br /&gt;
    [TEST CASE   4] (t=000005457) BEGIN: Write / readback user registers...&lt;br /&gt;
    [TEST CASE   4] (t=000006888) DONE... Passed&lt;br /&gt;
    [TEST CASE   5] (t=000006888) BEGIN: Test sequence...&lt;br /&gt;
    [TEST CASE   5] (t=000007633) DONE... Passed&lt;br /&gt;
    ========================================================&lt;br /&gt;
    '''TESTBENCH FINISHED: noc_block_gain'''&lt;br /&gt;
    ''' - Time elapsed:   7700 ns'''             &lt;br /&gt;
    ''' - Tests Expected: 5'''&lt;br /&gt;
    ''' - Tests Run:      5'''&lt;br /&gt;
    ''' - Tests Passed:   5'''&lt;br /&gt;
    '''Result: PASSED'''   &lt;br /&gt;
    ========================================================&lt;br /&gt;
    $finish called at time : 7700 ns : File &amp;quot;/home/widow/rfnoc/src/rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv&amp;quot; Line 10&lt;br /&gt;
    INFO: [USF-XSim-96] XSim completed. Design snapshot 'noc_block_gain_tb_behav' loaded.&lt;br /&gt;
    INFO: [USF-XSim-97] XSim simulation ran for 1000000000us&lt;br /&gt;
    launch_simulation: Time (s): cpu = 00:00:10 ; elapsed = 00:00:12 . Memory (MB): peak = 966.387 ; gain = 54.848 ; free physical = 3080 ; free virtual = 29888&lt;br /&gt;
    # if [string equal $vivado_mode &amp;quot;batch&amp;quot;] {&lt;br /&gt;
    #     puts &amp;quot;BUILDER: Closing project&amp;quot;&lt;br /&gt;
    #     close_project&lt;br /&gt;
    # } else {&lt;br /&gt;
    #     puts &amp;quot;BUILDER: In GUI mode. Leaving project open.&amp;quot;&lt;br /&gt;
    # }&lt;br /&gt;
    BUILDER: Closing project&lt;br /&gt;
    ****** Webtalk v2015.4 (64-bit)&lt;br /&gt;
      **** SW Build 1412921 on Wed Nov 18 09:44:32 MST 2015&lt;br /&gt;
      **** IP Build 1412160 on Tue Nov 17 13:47:24 MST 2015&lt;br /&gt;
        ** Copyright 1986-2015 Xilinx, Inc. All Rights Reserved.&lt;br /&gt;
    &lt;br /&gt;
    source /home/widow/rfnoc/src/rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/xsim_proj/xsim_proj.hw/webtalk/labtool_webtalk.tcl -notrace&lt;br /&gt;
    INFO: [Common 17-206] Exiting Webtalk at Tue Jan 10 23:26:20 2017...&lt;br /&gt;
    INFO: [Common 17-206] Exiting Vivado at Tue Jan 10 23:26:22 2017...&lt;br /&gt;
    Built target noc_block_gain_tb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With every custom block created, a &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; directive will be available to run the simulation from the &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
===Building the FPGA image with a custom user block===&lt;br /&gt;
In this section steps are given on how to initiate an FPGA build while incorporating the user’s custom RFNoC block. The first sections give general information on building RFNoC images. The remaining two sections show how to initiate FPGA builds using a command line interface and using a graphical interface (coming out soon), respectively.&lt;br /&gt;
&lt;br /&gt;
====Discussion on number of blocks in an FPGA image====&lt;br /&gt;
There is a maximum number of blocks that can be added for each device. The maximum amount of computation engines (CEs/RFNoC blocks) that each device can use is 16, but the amount of custom blocks that can be added depends on the device. &lt;br /&gt;
&lt;br /&gt;
If using a device from the X3xx series, from the 16 CEs, there are 6 that will be always added and are not subject to direct customization: 1 CE for the AXI bus, 1 CE for the Ethernet Interface, 2 Radios and 2 Dma FIFOS. Because of this, the application will only allow a number of 10 custom blocks on the X3xx series. &lt;br /&gt;
&lt;br /&gt;
If using a device from the E3xx series, 2 CE engines are always added and are not subject to direct customization: 1 CE for the AXI bus and 1 Radio. This would virtually allow 14 slots for custom blocks. However, given the size of the FPGA on the E3xx series of devices, the application only allows a number of 6 custom blocks. &lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Blocks with higher resource utilization may fill up the FPGA and force the user to include less blocks.&lt;br /&gt;
&lt;br /&gt;
Verify the current maximum values by running the &amp;lt;code&amp;gt;uhd_images_builder.py&amp;lt;/code&amp;gt; utility from the scripts directory.&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&lt;br /&gt;
    $ uhd_image_builder.py --help&lt;br /&gt;
&lt;br /&gt;
====Discussion on FPGA image targets====&lt;br /&gt;
RFNoC target names follow the pattern &amp;lt;code&amp;gt;{DEVICE}_RFNoC_{BUILD_TYPE}&amp;lt;/code&amp;gt; with the following build types: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HG:&amp;lt;/code&amp;gt; 1GigE on SFP+ Port0, 10Gig on SFP+ Port&lt;br /&gt;
* &amp;lt;code&amp;gt;XG:&amp;lt;/code&amp;gt; 10GigE on both SFP+ ports&lt;br /&gt;
* &amp;lt;code&amp;gt;HLS:&amp;lt;/code&amp;gt; Vivado High Level Synthesis enabled&lt;br /&gt;
* &amp;lt;code&amp;gt;sgX:&amp;lt;/code&amp;gt; Speed grade for E300 devices (1 or 3)&lt;br /&gt;
&lt;br /&gt;
Some examples are:&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_XG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_XG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_HLS_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_HLS_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;E310_RFNOC&amp;lt;/code&amp;gt; (this is for the speed grade 1 FPGA version of E310, append &amp;lt;code&amp;gt;_sg3&amp;lt;/code&amp;gt; for speed grade 3)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' E310, E312 and E313 all have the same FPGA hardware and therefore will use the &amp;lt;code&amp;gt;E310_RFNOC_{BUILD_TYPE}&amp;lt;/code&amp;gt; target. USRP E3xx devices have either &amp;lt;code&amp;gt;sg1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sg3&amp;lt;/code&amp;gt; hardware, please visit [http://files.ettus.com/e3xx_images/README here] to find out how to differentiate.&lt;br /&gt;
&lt;br /&gt;
Additional information about the build targets can be found at the build instructions for USRP3, found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here].&lt;br /&gt;
&lt;br /&gt;
====Image building using the command line====&lt;br /&gt;
The script &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; is used to generate the NoC block instantiation file and build the FPGA image. Run the help menu by typing:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&lt;br /&gt;
    $ ./uhd_image_builder.py --help&lt;br /&gt;
         &lt;br /&gt;
    usage: uhd_image_builder.py [-h] [-I INCLUDE_DIR [INCLUDE_DIR ...]]&lt;br /&gt;
                                [-m MAX_NUM_BLOCKS] [--fill-with-fifos]&lt;br /&gt;
                                [-o OUTFILE] [-d DEVICE] [-t TARGET] [-g] [-c]&lt;br /&gt;
                                [blocks [blocks ...]]&lt;br /&gt;
    &lt;br /&gt;
    Generate the NoC block instantiation file&lt;br /&gt;
    &lt;br /&gt;
    positional arguments:&lt;br /&gt;
      blocks                List block names to instantiate.&lt;br /&gt;
    &lt;br /&gt;
    optional arguments:&lt;br /&gt;
      -h, --help            show this help message and exit&lt;br /&gt;
      -I INCLUDE_DIR [INCLUDE_DIR ...], --include-dir INCLUDE_DIR [INCLUDE_DIR ...]&lt;br /&gt;
                            Path directory of the RFNoC Out-of-Tree module&lt;br /&gt;
      -m MAX_NUM_BLOCKS, --max-num-blocks MAX_NUM_BLOCKS&lt;br /&gt;
                            Maximum number of blocks (Max. Allowed for x310|x300:&lt;br /&gt;
                            10, for e300: 6)&lt;br /&gt;
      --fill-with-fifos     If the number of blocks provided was smaller than the&lt;br /&gt;
                            max number, fill the rest with FIFOs&lt;br /&gt;
      -o OUTFILE, --outfile OUTFILE&lt;br /&gt;
                            Output /path/filename - By running this directive, you&lt;br /&gt;
                            won't build your IP&lt;br /&gt;
      -d DEVICE, --device DEVICE&lt;br /&gt;
                            Device to be programmed [x300, x310, e310]&lt;br /&gt;
      -t TARGET, --target TARGET&lt;br /&gt;
                            Build target - image type [X3X0_RFNOC_HG,&lt;br /&gt;
                            X3X0_RFNOC_XG, E310_RFNOC_sg3...]&lt;br /&gt;
      -g, --GUI             Open Vivado GUI during the FPGA building process&lt;br /&gt;
      -c, --clean-all       Cleans the IP before a new build&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are details on the usage of the script which is followed by an example:&lt;br /&gt;
&lt;br /&gt;
'''Blocks:''' The first arguments are the names of RFNoC blocks that the user wants to have compiled into the new image which are separated by a space. They can be custom blocks from the user’s OOT module or from the ones that are provided from Ettus, or a combination. Blocks provided by Ettus Research are listed (among other sources necessary for the FPGA build) in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/lib/rfnoc/Makefile.srcs&amp;lt;/code&amp;gt; file. &lt;br /&gt;
&lt;br /&gt;
These blocks can be identified by the following pattern: &lt;br /&gt;
&lt;br /&gt;
    noc_block_{NAME}.v&lt;br /&gt;
&lt;br /&gt;
However, as all the RFNoC blocks have the same &amp;lt;code&amp;gt;noc_block_&amp;lt;/code&amp;gt; prefix, for simplicity this prefix is omitted when listing the blocks in the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; utility. As an example of the incorrect and correct way of adding blocks, consider the following examples when adding the &amp;lt;code&amp;gt;noc_block_null_source_sink&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noc_block_siggen&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
Incorrect method:  &lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py noc_block_null_source_sink noc_block_siggen ...&lt;br /&gt;
&lt;br /&gt;
Correct method:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py null_source_sink siggen ...&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Blocks generated by the RFNoC Modtool follow the same naming convention.&lt;br /&gt;
&lt;br /&gt;
There is an increasing list of pre-built blocks. Here is a sample:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;axi_fifo_loopback&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;axi_dma_fifo&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fir_filter&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fft&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;null_source_sink&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;schmidl_cox&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;packet_resizer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;split_stream&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;vector_iir&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;addsub&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;window&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;keep_one_in_n&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;pfb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;export_io&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;conv_encoder_qpsk&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;logpwr&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fosphor&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;moving_avg&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ddc&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;duc&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RFNoC related blocks generally reside in &amp;lt;code&amp;gt;fpga/usrp3/lib/rfnoc/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!Block&lt;br /&gt;
!Filename&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FIFO&lt;br /&gt;
|noc_block_axi_fifo_loopback.v&lt;br /&gt;
|Simple FIFO loopback / passthrough block.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FFT&lt;br /&gt;
|noc_block_fft.v&lt;br /&gt;
|Xilinx coregen based Fast Fourier Transform up to length 4096.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FIR&lt;br /&gt;
|noc_block_fir_filter.v&lt;br /&gt;
|Xilinx coregen based Finite Impulse Response Filter, 41 taps, reconfigurable tap coefficients.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|Window&lt;br /&gt;
|noc_block_window.v&lt;br /&gt;
|Windowing block for use with FFT block.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Vector IIR&lt;br /&gt;
|noc_block_vector_iir.v&lt;br /&gt;
|Single pole IIR with configurable coefficients that filters data along vectors (i.e. parallel streams of samples). Useful with FFT output.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Keep One in N&lt;br /&gt;
|noc_block_keep_one_in_n.v&lt;br /&gt;
|Keeps one packet every N packets.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|AddSub&lt;br /&gt;
|noc_block_addsub.v&lt;br /&gt;
|Example of using multiple block ports in a single RFNoC block to add and subtract streams.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Null Source Sink&lt;br /&gt;
|noc_block_null_source_sink.v&lt;br /&gt;
|Generates dummy packets and can consume packets at a configurable rate. Useful for testing.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Packet Resizer&lt;br /&gt;
|noc_block_packet_resizer.v&lt;br /&gt;
|Resizes input packets to a configurable size (larger or smaller than source packets).&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Split Stream&lt;br /&gt;
|noc_block_split_stream.v&lt;br /&gt;
|Replicates an input stream to a configurable number of output streams.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' There is a restriction on the amount of blocks that can added into the FPGA image, see the section in this Application Note labeled [[Getting_Started_with_RFNoC_Development#Discussion_on_number_of_blocks_in_an_FPGA_image|Discussion on number of blocks in an FPGA image]] for more information. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-I INCLUDE_DIR:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; directive provides the path to the users &amp;lt;code&amp;gt;rfnoc/fpga-src&amp;lt;/code&amp;gt; directory which contains the custom blocks. This path is needed by the Xilinx Vivado tool. Inside the &amp;lt;code&amp;gt;fpga-src&amp;lt;/code&amp;gt; directory there is a file called &amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt; that contains the path of the OOT module and a list of all the custom OOT blocks. This is an auto generated file, which is amended every time a new block is added to the OOT module. Manually modifying this file is not recommended. If there are multiple OOT modules with various custom blocks that reside in different directories the way to include them all is by separating the different paths by a space (e.g. &amp;lt;code&amp;gt;-I /first/OOT/path/ /second/OOT/path/&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-d DEVICE:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; directive directs the script on which USRP device the build is for. If no &amp;lt;code&amp;gt;–d&amp;lt;/code&amp;gt; is included the default is &amp;lt;code&amp;gt;–d x310&amp;lt;/code&amp;gt;. Generation-3 USRPs and above all support RFNoC.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-t TARGET:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;–t&amp;lt;/code&amp;gt; directive directs the script on which type of image to build for the chosen device. With each USRP device there are several build options to choose from. Detailed information about the build targets can be found at the build instructions for USRP3, found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here]. If &amp;lt;code&amp;gt;-t&amp;lt;/code&amp;gt; is not included, a default target will be chosen for the given device. For example, the default &amp;lt;code&amp;gt;X310_RFNOC_HG&amp;lt;/code&amp;gt; target builds for the &amp;lt;code&amp;gt;–d x310&amp;lt;/code&amp;gt; device. More details on targets can be found in the section of this Application Note labeled [[Getting Started with RFNoC Development#Discussion_on_FPGA_image_targets|Discussion on FPGA image targets]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-m MAX_NUM_BLOCKS:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;–m&amp;lt;/code&amp;gt; directive specifies the max number of RFNoC blocks to build on the FPGA image. An RFNoC image does not need to fill all available slots with RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--fill-with-fifos:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;--fill-with-fifos&amp;lt;/code&amp;gt; directive will fill the empty RFNoC block slots with FIFOS. As an example, if a user indicates three RFNoC blocks by name and also specifies &amp;lt;code&amp;gt;–m 5&amp;lt;/code&amp;gt; then the other two slots will be filed with FIFOs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-o OUTFILE:&amp;lt;/code&amp;gt; With the &amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; directive, the RFNoC blocks instantiation file is generated and saved at the desired path with the given name for the user to inspect. The FPGA image will NOT build if this directive is provided. The purpose of the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script is to auto generate an instantiation file and populate the source files needed for the Xilinx Vivado tool to build the FPGA image, however, it may be desirable to only see the effect of adding a custom OOT module in the &amp;lt;code&amp;gt;fpga/&amp;lt;/code&amp;gt; directory, or for inspecting the instantiation file. When the directive is not provided the &amp;lt;code&amp;gt;rfnoc_ce_auto_inst_x3x0.v&amp;lt;/code&amp;gt; file is overwritten and the FPGA image build process will start automatically (standard use).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-g, --GUI:&amp;lt;/code&amp;gt; Open Vivado GUI during the FPGA building process&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-c, --clean-all:&amp;lt;/code&amp;gt; Cleans the IP before a new build&lt;br /&gt;
&lt;br /&gt;
Here is how to create an X310 FPGA image incorporating the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block that was created earlier in this Application Note:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts     &lt;br /&gt;
    $ ./uhd_image_builder.py gain ddc fft -I {USER_PREFIX}/src/rfnoc-tutorial/rfnoc/fpga-src/ -d x310 -t X310_RFNOC_HG -m 6 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end of a successful compilation process, write the new image to a USRP. The following command will load the new image. Update the &amp;lt;code&amp;gt;{IP_Address}&amp;lt;/code&amp;gt; of the USRP and &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; to the appropriate values for your configuration before running the command.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args “type=x300,addr={IP_ADDRESS}” --fpga-path {USER_PREFIX}/src/uhd-fpga/usrp3/top/x300/build/usrp_x310_fpga_RFNOC_HG.bit&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' &lt;br /&gt;
* The FPGA image building process may take over an hour.&lt;br /&gt;
&lt;br /&gt;
* FPGA images are specific to the USRP device NOT the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. Additional instructions on flashing a custom image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
&lt;br /&gt;
* [Environment setup] - The &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script will also set up the Xilinx Vivado environment by automatically running the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{device}&amp;lt;/code&amp;gt; directory. The &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script assumes that Xilinx Vivado is installed in the default location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.  If the installation is in a different directory the &amp;lt;code&amp;gt;setupenv_base.sh&amp;lt;/code&amp;gt; script will need to be modified. The script is located at: &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts/setupenv_base.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Besides the custom &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block, a &amp;lt;code&amp;gt;DDC&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FFT&amp;lt;/code&amp;gt; block are also being added along with three &amp;lt;code&amp;gt;FIFOs&amp;lt;/code&amp;gt;.  The &amp;lt;code&amp;gt;DDC&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;FFT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FIFO&amp;lt;/code&amp;gt; blocks are already in the script's path and therefore do not need their path specified (they ship with the Ettus Research FPGA code). The reason three FIFOs are added is because the max number of blocks was specified to be 6 ( &amp;lt;code&amp;gt;-m 6&amp;lt;/code&amp;gt; ) and since only 3 blocks were specifically named the other three slots are filled with FIFOs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 10.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Instructions on flashing the image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series. FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. &lt;br /&gt;
&lt;br /&gt;
Once the newly compiled image is loaded onto a USRP X3xx running the following command will show what RFNoC blocks are available on the FPGA:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * '''Block_0'''&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The reason the custom block is called &amp;lt;code&amp;gt;Block_0&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;gain_0&amp;lt;/code&amp;gt; is because there is still host side software/files that need updated in order for this block to populate it’s proper name. A following section (UHD Integration) will step through the process of updating those host side files.&lt;br /&gt;
&lt;br /&gt;
====Using a graphical interface====&lt;br /&gt;
A graphical user interface for FPGA generation and building is shipped along with the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script. This intuitive application aids in setting up a custom FPGA build. &lt;br /&gt;
&lt;br /&gt;
This utility is located in the same &amp;lt;code&amp;gt;scripts&amp;lt;/code&amp;gt; directory as &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
To run it, enter the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts/&lt;br /&gt;
    $ ./uhd_image_builder_gui&lt;br /&gt;
&lt;br /&gt;
The application will then be launched:&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 11.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''1. Select build target:''' In this panel the available build targets are listed. This list may vary depending on which branch of the FPGA repository this user is using. Only RFNoC targets are listed. The build type descriptions are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HG:&amp;lt;/code&amp;gt; 1GigE on SFP+ Port0, 10Gig on SFP+ Port1&lt;br /&gt;
* &amp;lt;code&amp;gt;XG:&amp;lt;/code&amp;gt; 10GigE on both SFP+ ports&lt;br /&gt;
* &amp;lt;code&amp;gt;HLS:&amp;lt;/code&amp;gt; Vivado High Level Synthesis enabled&lt;br /&gt;
* &amp;lt;code&amp;gt;sgX:&amp;lt;/code&amp;gt; Speed grade for E300 devices (1 or 3)&lt;br /&gt;
&lt;br /&gt;
'''2. List of blocks available:''' In this panel the available blocks are listed that can be included into a custom design. This list separates the RFNoC blocks provided by Ettus Research and the OOT modules and corresponding blocks that the user adds. Given the hardware differences between the X3xx and E3xx devices, this list will dynamically change when a different device is selected from the panel on the left. This implies that it is necessary to add the OOT modules for each device independently. This is accomplished by using the &amp;lt;code&amp;gt;Add OOT Blocks&amp;lt;/code&amp;gt; feature of the application, details of which are explained at #7 (&amp;lt;code&amp;gt;Add OOT Blocks&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
'''3. Blocks in current design:''' This panel will be populated by adding elements from the available blocks. All the blocks listed in here will be compiled into the FPGA custom image. There is a maximum number of blocks that can be added for each device. See the section in this App Note labeled Discussion on number of blocks in an FPGA image for more information. &lt;br /&gt;
&lt;br /&gt;
'''4. Add button (&amp;gt;&amp;gt;):''' Manually add the blocks from the central panel into your design.&lt;br /&gt;
&lt;br /&gt;
'''5. Remove button (&amp;lt;&amp;lt;):''' Remove blocks from the current design (far-left panel)&lt;br /&gt;
&lt;br /&gt;
'''6. Fill with FIFOs:''' By checking this box, the design will fill any available/unspecified block slots with FIFOs. The number of FIFO blocks that will be instantiated is based on the rules of amount of blocks explained at #3. When less than the max amount of blocks are needed for certain implementation, many users choose to fill their design with FIFO blocks. &lt;br /&gt;
&lt;br /&gt;
'''7. Open Vivado GUI:''' Open Vivado GUI during the FPGA building process. This allows the user to save a Vivado project with all IP and work within the Vivado GUI for development.&lt;br /&gt;
&lt;br /&gt;
'''8. Clean IP:''' Cleans the IP before a new build (recompiles all IP).&lt;br /&gt;
&lt;br /&gt;
'''9. Add OOT blocks:''' Manually add RFNoC Modtool-generated OOT modules by pointing the application to the &amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt; file, which is located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/{USER-OOT-moddir}/rfnoc/fpga-srcs/&amp;lt;/code&amp;gt; directory. After adding this file, blocks will appear under “&amp;lt;code&amp;gt;OOT blocks for XXXX devices&amp;lt;/code&amp;gt;”&lt;br /&gt;
&lt;br /&gt;
'''10. Import from GRC:''' If the user has a GNU Radio flowgraph with RFNoC blocks already in it, this application can read what RFNoC blocks are in the flowgraph and populate the &amp;lt;code&amp;gt;Blocks in current design&amp;lt;/code&amp;gt; section of the application with the necessary RFNoC blocks. '''NOTE:''' All RFNoC blocks pulled from a &amp;lt;code&amp;gt;.grc&amp;lt;/code&amp;gt; file must be in the of &amp;lt;code&amp;gt;List of blocks available&amp;lt;/code&amp;gt; before beginning the build.&lt;br /&gt;
&lt;br /&gt;
'''11. Show Instantiation File:''' The application auto-generates the instantiation file that is going to be used by Vivado to build the FPGA image. This instantiation file can be viewed and edited before starting the build by clicking this button. &lt;br /&gt;
&lt;br /&gt;
'''12. Generate .bit file:''' Start the build by clicking this button. &lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' See the latter end of the previous section for additional information on what to expect once the compile has started as well as final output.&lt;br /&gt;
&lt;br /&gt;
==Creating Software/Host portion of custom RFNoC Block==&lt;br /&gt;
Now that the FPGA portion is complete the next step is to add software integration to UHD and GNU Radio as depicted in the RFNoC Stack below.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 12.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
===UHD integration===&lt;br /&gt;
Despite the data processing happening on the FPGA, the host software still has a lot of responsibilities in order for an RFNoC application to function. For example, it needs to know which settings registers are available within an RFNoC block, or what kind of input and output a block has. All of this information goes into the &amp;lt;code&amp;gt;Block Declaration&amp;lt;/code&amp;gt;, which is an XML file that is readable by UHD. Often, some simple logic needs to be embedded in the XML file, which we can do by using a simple scripting language called Noc-Script. Changes to the block declaration file are immediately imported into UHD every time an application is executed, and therefore, no software development toolchain needs to be set up.&lt;br /&gt;
&lt;br /&gt;
The list of things declared by the block declaration file includes:&lt;br /&gt;
&lt;br /&gt;
* Block name and Noc-ID&lt;br /&gt;
* Registers&lt;br /&gt;
* Inputs and outputs (including types)&lt;br /&gt;
&lt;br /&gt;
In some cases, additional C++ code is required to properly control a block from software. In this case, a &amp;lt;code&amp;gt;Block Controller&amp;lt;/code&amp;gt; file is required as well as the declaration file. In most cases, the default block controller provided by UHD is sufficient, so no C++ code needs to be written. Writing custom block controllers requires more effort, and means having to set up a programming toolchain. A common reason to write custom C++ block controllers is if setting a register requires a lot of computation, which is not feasible to do within a block declaration file (e.g., using Noc-Script).&lt;br /&gt;
&lt;br /&gt;
Skeleton code for both the block declaration and the block controller (if required) can be generated through RFNoC Modtool.&lt;br /&gt;
&lt;br /&gt;
Because the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block does not require anything other than simply reading and writing to a single register the default block controller will suffice for this example. However, we will need to add information about the register.&lt;br /&gt;
&lt;br /&gt;
Open the &amp;lt;code&amp;gt;gain.xml&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;/rfnoc-tutorial/rfnoc/blocks&amp;lt;/code&amp;gt; directory and add the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;&amp;lt;!--Default XML file--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;nocblock&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;gain&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;blockname&amp;gt;gain&amp;lt;/blockname&amp;gt;&lt;br /&gt;
      &amp;lt;ids&amp;gt;&lt;br /&gt;
        &amp;lt;id revision=&amp;quot;0&amp;quot;&amp;gt;1111222233334444&amp;lt;/id&amp;gt;&lt;br /&gt;
      &amp;lt;/ids&amp;gt;&lt;br /&gt;
      '''&amp;lt;nowiki&amp;gt;&amp;lt;!-- Registers --&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;registers&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;setreg&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;name&amp;gt;GAIN&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;address&amp;gt;128&amp;lt;/address&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;/setreg&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;/registers&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;nowiki&amp;gt;&amp;lt;!-- Args --&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;args&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;arg&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;name&amp;gt;gain&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;double&amp;lt;/type&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;value&amp;gt;1.0&amp;lt;/value&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;check&amp;gt;GE($gain, 0.0) AND LE($gain, 32767.0)&amp;lt;/check&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;check_message&amp;gt;Invalid gain.&amp;lt;/check_message&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;action&amp;gt;'''&lt;br /&gt;
            '''SR_WRITE(&amp;quot;GAIN&amp;quot;, IROUND($gain))'''&lt;br /&gt;
          '''&amp;lt;/action&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;/arg&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;/args&amp;gt;'''&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!--One input, one output. If this is used, better have all the info the C++ file.--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;ports&amp;gt;&lt;br /&gt;
        &amp;lt;sink&amp;gt;&lt;br /&gt;
          '''&amp;lt;name&amp;gt;in0&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;sc16&amp;lt;/type&amp;gt;'''&lt;br /&gt;
        &amp;lt;/sink&amp;gt;&lt;br /&gt;
        &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
          '''&amp;lt;name&amp;gt;out0&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;sc16&amp;lt;/type&amp;gt;'''&lt;br /&gt;
        &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;/ports&amp;gt;&lt;br /&gt;
    &amp;lt;/nocblock&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GNU Radio Integration===&lt;br /&gt;
GNU Radio is built around the concept of blocks, similarly to RFNoC. When mapping RFNoC into an application, the simple constraint is made that every RFNoC block maps to a single GNU Radio block. Thus, when creating mixed GNU Radio/RFNoC applications, there is a very clear 1:1 mapping between what’s happening in RFNoC and GNU Radio.&lt;br /&gt;
&lt;br /&gt;
Since most RFNoC blocks behave very similar to one another from GNU Radio’s perspective, it is generally not required to write C++ code for another block. Rather, a default block provided by RFNoC can be used with appropriate configuration. However, in some cases it may be desirable or even necessary to write a custom GNU Radio block for more specific controlling of the underlying RFNoC block. GNU Radio allows writing blocks in either C++ or Python, but since UHD and RFNoC do not have a Python API, a custom wrapper for an RFNoC block needs to be written in C++. RFNoC Modtool will create skeleton files for these purpose.&lt;br /&gt;
&lt;br /&gt;
The most popular and effective way to use GNU Radio is through the graphical interface, the GNU Radio Companion (GRC). GRC requires a separate description of every GNU Radio block in order to become available in the graphical UI, and the same is true for an RFNoC block that is wrapped in a GNU Radio block (even if the generic RFNoC block wrapper is used). For GNU Radio 3.7 and earlier, GRC bindings for blocks are written as XML files with interspersed Cheetah or Python statements. For a more detailed tutorial on how to write these files, refer to the [http://gnuradio.org/redmine/projects/gnuradio/wiki GNU Radio Documentation] and associated [http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials tutorials].&lt;br /&gt;
&lt;br /&gt;
====GNU Radio Block Code====&lt;br /&gt;
&lt;br /&gt;
* C++ or Python, although RFNoC blocks need to be written in C++ (if at all)&lt;br /&gt;
* How does GNU Radio interface to RFNoC?&lt;br /&gt;
** via C++ infrastructure code in &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; provides a base RFNoC block class&lt;br /&gt;
** Users extend base class for their RFNoC blocks&lt;br /&gt;
** Many blocks can use base class “as is”&lt;br /&gt;
** No C++ or Python code!&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-tutorial/lib/gain_impl.cc&amp;lt;/code&amp;gt;&lt;br /&gt;
** The gain block does not need anything additional&lt;br /&gt;
&lt;br /&gt;
====GNU Radio Companion Bindings====&lt;br /&gt;
* XML&lt;br /&gt;
* Describes GNU Radio blocks to GRC&lt;br /&gt;
* No recompilation&lt;br /&gt;
* Requirement of GNU Radio Companion&lt;br /&gt;
* Not strictly necessary for GNU Radio&lt;br /&gt;
* Tutorial on how to write them:&lt;br /&gt;
** [http://gnuradio.org/redmine/projects/gnuradio/wiki/GNURadioCompanion http://gnuradio.org/redmine/projects/gnuradio/wiki/GNURadioCompanion ]&lt;br /&gt;
* Skeleton file generated by RFNoC Modtool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Open the &amp;lt;code&amp;gt;tutorial-gain.xml&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;rfnoc-tutorial/grc&amp;lt;/code&amp;gt; directory and edit as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;block&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;RFNoC: gain&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;key&amp;gt;tutorial_gain&amp;lt;/key&amp;gt;&lt;br /&gt;
      &amp;lt;category&amp;gt;tutorial&amp;lt;/category&amp;gt;&lt;br /&gt;
      &amp;lt;import&amp;gt;import tutorial&amp;lt;/import&amp;gt;&lt;br /&gt;
      &amp;lt;make&amp;gt;tutorial.gain(&lt;br /&gt;
        self.device3,&lt;br /&gt;
        uhd.stream_args( \# TX Stream Args&lt;br /&gt;
            cpu_format=&amp;quot;'''fc32'''&amp;quot;,&lt;br /&gt;
            otw_format=&amp;quot;'''sc16'''&amp;quot;,&lt;br /&gt;
            args=&amp;quot;gr_vlen={0},{1}&amp;quot;.format(${grvlen}, &amp;quot;&amp;quot; if $grvlen == 1 else &amp;quot;spp={0}&amp;quot;.format($grvlen)),&lt;br /&gt;
        ),&lt;br /&gt;
        uhd.stream_args( \# RX Stream Args&lt;br /&gt;
            cpu_format=&amp;quot;'''fc32'''&amp;quot;,&lt;br /&gt;
            otw_format=&amp;quot;'''sc16'''&amp;quot;,&lt;br /&gt;
            args=&amp;quot;gr_vlen={0},{1}&amp;quot;.format(${grvlen}, &amp;quot;&amp;quot; if $grvlen == 1 else &amp;quot;spp={0}&amp;quot;.format($grvlen)),&lt;br /&gt;
        ),&lt;br /&gt;
        $block_index, $device_index,&lt;br /&gt;
    )&lt;br /&gt;
    '''self.$(id).set_arg(&amp;quot;gain&amp;quot;, $gain)'''&lt;br /&gt;
      '''&amp;lt;/make&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;callback&amp;gt;set_arg(&amp;quot;gain&amp;quot;, $gain)&amp;lt;/callback&amp;gt;'''&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'param' node for every Parameter you want settable from the GUI.&lt;br /&gt;
           Sub-nodes:&lt;br /&gt;
           * name&lt;br /&gt;
           * key (makes the value accessible as $keyname, e.g. in the make node)&lt;br /&gt;
           * type --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
         .  &lt;br /&gt;
         .&lt;br /&gt;
         .&lt;br /&gt;
    &lt;br /&gt;
        &amp;lt;option&amp;gt;&lt;br /&gt;
          &amp;lt;name&amp;gt;Byte&amp;lt;/name&amp;gt;&lt;br /&gt;
          &amp;lt;key&amp;gt;u8&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;/option&amp;gt;&lt;br /&gt;
      &amp;lt;/param&amp;gt;&lt;br /&gt;
      &amp;lt;param&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;'''Gain'''&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;'''gain'''&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;value&amp;gt;'''1.0'''&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''real'''&amp;lt;/type&amp;gt;&lt;br /&gt;
      &amp;lt;/param&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'sink' node per input. Sub-nodes:&lt;br /&gt;
           * name (an identifier for the GUI)&lt;br /&gt;
           * type&lt;br /&gt;
           * vlen&lt;br /&gt;
           * optional (set to 1 for optional inputs) --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;sink&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;in&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''complex'''&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;vlen&amp;gt;$grvlen&amp;lt;/vlen&amp;gt;&lt;br /&gt;
        &amp;lt;domain&amp;gt;rfnoc&amp;lt;/domain&amp;gt;&lt;br /&gt;
      &amp;lt;/sink&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'source' node per output. Sub-nodes:&lt;br /&gt;
           * name (an identifier for the GUI)&lt;br /&gt;
           * type&lt;br /&gt;
           * vlen&lt;br /&gt;
           * optional (set to 1 for optional inputs) --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;out&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''complex'''&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;vlen&amp;gt;$grvlen&amp;lt;/vlen&amp;gt;&lt;br /&gt;
        &amp;lt;domain&amp;gt;rfnoc&amp;lt;/domain&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Indentation spacing is important in the &amp;lt;code&amp;gt;&amp;lt;make&amp;gt;&amp;lt;/code&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
===Compile, Install and Verify===&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/rfnoc-tutorial/build&lt;br /&gt;
    $ make install&lt;br /&gt;
    &lt;br /&gt;
    $ uhd_usrp_probe &lt;br /&gt;
    &lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * '''gain_0'''&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' In the case where the &amp;lt;code&amp;gt;gain_0&amp;lt;/code&amp;gt; does not appear but &amp;lt;code&amp;gt;Block_0&amp;lt;/code&amp;gt; does: Most likely, the XML block declaration file (see [[Getting_Started_with_RFNoC_Development#UHD_integration|UHD Integration]] section) for the block contains a NoC-ID that does not match with any NoC-ID defined in the hardware part of the design. The user has to be certain that the description files are up-to-date and that the NoC-ID matches in the SW and HW side. See the [[Getting_Started_with_RFNoC_Development#UHD_integration|UHD Integration]] section to update those host side files.&lt;br /&gt;
&lt;br /&gt;
==Testing out the custom block==&lt;br /&gt;
At this point the custom &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; RFNoc Block (Computation Engine) can be used within a GNU Radio flowgraph. Below is an example GRC flowgraph using our new block as well as the output application it produces. &lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 13.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Copy Block: In the RFNoC domain, streams of data can not be split as easily as they are in the GNU Radio domain. The “copy” block depicted in the screenshot above serves the function as a stream splitter . It’s main purpose, when “enabled”, is to copy the samples it is getting at its input and putting then into the output, but here it is also serving as a boundary between a RFNoC-domain and a GNURadio-domain. In the flowgraph above. after this boundary is passed, the data stream can easily be split into the two sinks to have them run simultaneously (standard GNU Radio functionality). It is possible to connect the GNU Radio blocks directly to RFNoC blocks without a “copy” block, but only one would work at a time (the other ones would have to be disabled). Another way to split data streams from the RFNoC-domain is to use the ”RFNoC: split stream” block, which would split the streams in the RFNoC domain, but this is not very useful here as we are, in any case, moving into the GNURadio-domain.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 14.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
===Xilinx Vivado===&lt;br /&gt;
====Compile issues====&lt;br /&gt;
=====Synthesis is failing=====&lt;br /&gt;
Verify all the correct Xilinx [[Getting Started with RFNoC Development#Prerequisites|prerequisite software]] is installed.&lt;br /&gt;
&lt;br /&gt;
Additional helpful information can be found in the following Xilinx forum posts:&lt;br /&gt;
* https://forums.xilinx.com/t5/Synthesis/Synthesis-failed-without-reporting-any-error/td-p/686000&lt;br /&gt;
* https://forums.xilinx.com/t5/Installation-and-Licensing/Vivado-on-Linux-synthesis-fails-with-no-error-message/td-p/732143&lt;br /&gt;
&lt;br /&gt;
====Environment Setup====&lt;br /&gt;
The &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script will also set up the Xilinx Vivado environment by automatically running the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{device}&amp;lt;/code&amp;gt; directory. The &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script assumes that Xilinx Vivado is installed in the default location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;. If the installation is in a different directory, then the &amp;lt;code&amp;gt;setupenv_base.sh&amp;lt;/code&amp;gt; script will need to be modified. The script is located at: &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3_rfnoc/tools/scripts/setupenv_base.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Links and Additional Resources==&lt;br /&gt;
===RFNoC additional resources===&lt;br /&gt;
* [https://kb.ettus.com/RFNoC RFNoC Primary Application Note]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Intro.pdf RFNoC Introduction]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_FPGA.pdf RFNoC Deep Dive: FPGA]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Host.pdf RFNoC Deep Dive: Host side]&lt;br /&gt;
* [https://www.youtube.com/watch?v=8cPd3t88djE Video: RFNoC presented at Wireless @ Virginia Tech, 2015 ]&lt;br /&gt;
** Explaining the slides of Intro, FPGA and Host presentations above (in that order).&lt;br /&gt;
&lt;br /&gt;
===GNU Radio resources===&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules GNU Radio OutOfTree Modules tutorial]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGRFromSource GNU Radio Installation]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/Tutorials GNU Radio Tutorials]&lt;br /&gt;
&lt;br /&gt;
===UHD resources===&lt;br /&gt;
* [https://kb.ettus.com/UHD UHD Software Resources Page]&lt;br /&gt;
* [http://files.ettus.com/manual/md_usrp3_build_instructions.html USRP3 build instructions]&lt;br /&gt;
* [http://files.ettus.com/manual/ UHD Manual]&lt;br /&gt;
&lt;br /&gt;
===Other resources===&lt;br /&gt;
* [https://www.xilinx.com/support/documentation/ip_documentation/ug761_axi_reference_guide.pdf Xilinx - AXI reference guide]&lt;br /&gt;
* [https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux UHD + GNU Radio Application Note (Linux)]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/pybombs/wiki PyBOMBS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=3315</id>
		<title>Getting Started with RFNoC Development</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=3315"/>
				<updated>2017-01-17T01:22:33Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: Minor: PyBOMBS clarification&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-823'''&lt;br /&gt;
&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-07-12&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Martin Braun&amp;lt;br&amp;gt; Nicolas Cuervo&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2017-01-10&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Team&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Added “Digital Gain” example&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This application note guides a user through basic information on the RFNoC architecture, installing necessary software to develop custom RFNoC blocks, also called Computation Engines (CE), and walks through the steps of creating a custom RFNoC block using an example.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
First sections deal with installing tools and validating correct tool installation in order to do RFNoC development. Later sections deal with creating a custom RFNoC block, using the built-in testbench architecture, building an FPGA image with the custom block and finally testing out the new block within GNU Radio.&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
The RFNoC code base is open source, including code that executes on the host, as well as code targeted to the USRP hardware (FPGA and microcontroller firmware). As dual-licensed software, RFNoC is available under the open-source GNU Public License version 3 (GPLv3), as well as an alternative, less-restrictive license offered only by Ettus Research. For more information on our licensing policy, please contact [mailto:info@ettus.com info@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
In order to build custom USRP FPGA images and RFNoC blocks the following hardware and software are needed.&lt;br /&gt;
&lt;br /&gt;
* '''Ubuntu 14.04 or 16.04(preferred):''' Currently PyBOMBS (which can be used to install the ''Software build tools''), works most reliably in Ubuntu, and thus, we recommend using this distribution. Also, a majority of the scripts used during the build process are Linux (Ubuntu) specific. A PC with multiple cores and 8GB+ of RAM is recommended.&lt;br /&gt;
&lt;br /&gt;
* '''Xilinx Vivado tools (ver. 2015.4):''' The specific version depends on the branch and state of the FPGA code. The default install location is &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;. Once all of the Software build tools are installed the specific version for the downloaded code can be found in the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{DEVICE}&amp;lt;/code&amp;gt; directory. Further information can be found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here].&lt;br /&gt;
&lt;br /&gt;
* '''Software build tools:''' If UHD can be or has been compiled from source on the development PC then all the necessary software build components are present (PyBOMBS can be used to set all this up and instructions on how to do so are given in a following step).&lt;br /&gt;
&lt;br /&gt;
* X3xx series or E3xx series device or any future USRP&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
* The edition of Xilinx Vivado that is required will depend on the USRP device.&lt;br /&gt;
** X3xx series devices: Design or System editions.&lt;br /&gt;
** E3xx series devices: Design, System or the free WebPack edition.&lt;br /&gt;
* Other operating systems can be used, but the exact steps on how to proceed are not given in this Application Note.&lt;br /&gt;
* In some Linux distributions (e.g. Ubuntu) &amp;lt;code&amp;gt;dash&amp;lt;/code&amp;gt; is set as default shell, which may cause some issues. It is recommended to set the shell to &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; by running the following commands in the terminal. Choose &amp;lt;code&amp;gt;&amp;lt;No&amp;gt;&amp;lt;/code&amp;gt; when prompted by the first command and the second command will validate the that bash will be used.&lt;br /&gt;
&lt;br /&gt;
    $ sudo dpkg-reconfigure dash&lt;br /&gt;
    $ ll /bin/sh&lt;br /&gt;
&lt;br /&gt;
==Creating a development environment==&lt;br /&gt;
While this Application Note goes through the process of integrating GNU Radio into the RFNoC development flow, it is by no means required to use or develop within the RFNoC framework, but it makes it a great deal easier to use a framework on top of RFNoC for aspects such as visualization and other features. GNU Radio is freely available and more information about it can be found [http://gnuradio.org/ here].&lt;br /&gt;
&lt;br /&gt;
The following software packages are required in order to setup a development environment/sandbox:&lt;br /&gt;
&lt;br /&gt;
* UHD&lt;br /&gt;
* GNU Radio &lt;br /&gt;
* gr-ettus&lt;br /&gt;
&lt;br /&gt;
===Create development environment using PyBOMBS===&lt;br /&gt;
The cleanest way to set this up is to install everything into a dedicated directory. [http://gnuradio.org/redmine/projects/pybombs/wiki PyBOMBS] is the simplest way to do this. If not already installed, PyBOMBS can be setup with the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ sudo apt-get install git&lt;br /&gt;
    $ sudo apt-get install python-setuptools python-dev build-essential &lt;br /&gt;
    $ sudo easy_install pip&lt;br /&gt;
    &lt;br /&gt;
    $ sudo pip install git+https://github.com/gnuradio/pybombs.git&lt;br /&gt;
    $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git&lt;br /&gt;
    $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git&lt;br /&gt;
&lt;br /&gt;
These commands will do the following:&lt;br /&gt;
* Install &amp;lt;code&amp;gt;Git&amp;lt;/code&amp;gt;&lt;br /&gt;
* Install &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;&lt;br /&gt;
* Install the latest &amp;lt;code&amp;gt;PyBOMBS&amp;lt;/code&amp;gt; from its Git repository&lt;br /&gt;
* Add the &amp;lt;code&amp;gt;gr-recipes&amp;lt;/code&amp;gt; recipes which are used to install GNU Radio specific software&lt;br /&gt;
* Add the &amp;lt;code&amp;gt;ettus&amp;lt;/code&amp;gt; recipes which are used to install Ettus Research specific software&lt;br /&gt;
&lt;br /&gt;
From here, PyBOMBS can be used to setup and install the development environment/sandbox by running the following command:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs prefix init ~/rfnoc -R rfnoc -a rfnoc&lt;br /&gt;
&lt;br /&gt;
This will do the following:&lt;br /&gt;
&lt;br /&gt;
* Create a directory in the user’s home directory called &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; (any valid directory name will work)&lt;br /&gt;
&lt;br /&gt;
* Give the prefix an alias of &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; ( &amp;lt;code&amp;gt;[-a alias]&amp;lt;/code&amp;gt;, e.g. &amp;lt;code&amp;gt;–a rfnoc&amp;lt;/code&amp;gt; ), which would be the name given to this path. This name will be used in further steps that use PyBOMBS. When creating the first prefix and omitting the alias, the prefix will be setup as the default.&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt; prefix recipe ( as opposed to a package recipe like &amp;lt;code&amp;gt;gqrx&amp;lt;/code&amp;gt; ) to clone UHD, FPGA, GNU Radio, and gr-ettus sources into the &amp;lt;code&amp;gt;~/rfnoc&amp;lt;/code&amp;gt; directory as well as compile and install all the software&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' A user can specify how many cores are used during compile time by specifying the &amp;lt;code&amp;gt;--config makewidth=X&amp;lt;/code&amp;gt; argument, where “&amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;” is an integer number. The default is set to 4. If the user only has 4 cores it is recommend to use this argument in the pybombs command to limit the number of cores to &amp;lt;4 (e.g. 3) so that the computer stays responsive. Following are 2 examples, one using less cores and the other using more cores:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs --config makewidth=3 prefix init ~/rfnoc -R rfnoc -a rfnoc &lt;br /&gt;
    $ pybombs --config makewidth=7 prefix init ~/rfnoc -R rfnoc -a rfnoc&lt;br /&gt;
&lt;br /&gt;
Then, it is necessary to setup the PyBOMBS environment, so that the system/terminal session will have the environmental variables pointing to this newly created prefix, which is done with the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/rfnoc&lt;br /&gt;
    $ source ./setup_env.sh&lt;br /&gt;
&lt;br /&gt;
Once the previous command is run, this terminal session will have access to the environmental variables that allow the complete use of the set of software that was just installed with PyBOMBS. If access to the software is needed in other terminals the same command must be run within them.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Throughout the rest of this document the term &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; will used at the beginning of different directories. For example, &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&amp;lt;/code&amp;gt; is a directory that contains useful scripts for compiling. The term &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; is used to denote the folders that precede the &amp;lt;code&amp;gt;/src&amp;lt;/code&amp;gt; directory. Examples of what &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; could be: &amp;lt;code&amp;gt;/home/user/rfnoc&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/home/user/myDevfolder/&amp;lt;/code&amp;gt;. On many Linux environments using &amp;lt;code&amp;gt;~/&amp;lt;/code&amp;gt; at the beginning of the target directory path is equivalent to the user’s home directory.( i.e &amp;lt;code&amp;gt;~/&amp;lt;/code&amp;gt; is equal to &amp;lt;code&amp;gt;/home/user/&amp;lt;/code&amp;gt;). So &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; could also look like &amp;lt;code&amp;gt;~/rfnoc&amp;lt;/code&amp;gt;  or &amp;lt;code&amp;gt;~/myDevfolder/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Create development environment manually===&lt;br /&gt;
As an alternative to using PyBOMBS, manually installing and configuring the software is done by following the individual install notes for [http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGRFromSource GNU Radio], [https://files.ettus.com/manual/page_build_guide.html UHD] and [https://github.com/EttusResearch/gr-ettus gr-ettus] and by making sure they are reachable by linkers and compilers.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The Application Note found [https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux here] goes through the process of manually installing UHD and GNU Radio on Linux platforms.&lt;br /&gt;
&lt;br /&gt;
To manually download the software, use these &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt; commands, which will select the correct branches:&lt;br /&gt;
&lt;br /&gt;
    $ git clone --recursive -b rfnoc-devel https://github.com/EttusResearch/uhd.git &lt;br /&gt;
    $ git clone --recursive -b maint https://github.com/gnuradio/gnuradio.git # master branch is also fine instead of maint&lt;br /&gt;
    $ git clone -b master https://github.com/EttusResearch/gr-ettus.git &lt;br /&gt;
    $ git clone -b rfnoc-devel https://github.com/EttusResearch/fpga.git&lt;br /&gt;
&lt;br /&gt;
If UHD, GNU Radio and/or gr-ettus are already installed, it would be sufficient to checkout the branches mentioned and update them them (&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;). Thereafter, rebuild each of the repositories (rebuild order: UHD, GNU Radio, gr-ettus).&lt;br /&gt;
&lt;br /&gt;
===Verify Environment===&lt;br /&gt;
Running the command “&amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;” with the “&amp;lt;code&amp;gt;--version&amp;lt;/code&amp;gt;” flag will verify that the installation has been completed successfully.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The version string output from this command may differ, however it should be similar to the output below.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe --version&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-161- g83150fdd&lt;br /&gt;
    &lt;br /&gt;
    4.0.0.rfnoc-devel-161-g83150fdd&lt;br /&gt;
&lt;br /&gt;
===Testing the default FPGA image and building from existing blocks===&lt;br /&gt;
&lt;br /&gt;
It is recommended to spend a moment looking at the Ettus Research default image, which is pre-built with a set of RFNoC blocks, as well as building a custom image with a unique set of pre-built RFNoC blocks. To get the default image(s), run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_images_downloader&lt;br /&gt;
&lt;br /&gt;
Ettus Research will be updating the default image(s) occasionally, and &amp;lt;code&amp;gt;uhd_images_downloader&amp;lt;/code&amp;gt; can be run anytime after running &amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt; and re-installing to pull the most current images. Images are stored in the &amp;lt;code&amp;gt;{USER_PREFIX}/share/uhd/images&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
The following images have the corresponding RFNoC blocks (Computation Engines):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Image Name&lt;br /&gt;
!Included Blocks&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x300_fpga_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x300_fpga_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;2x DDC, 2x DUC&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x300_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x300_fpga_RFNOC_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DUC, DDC (one channel), fosphor, window, fft, 2x AXI FIFOs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_XG.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DUC, DDC (one channel), fosphor, window, fft, 2x AXI FIFOs, Keep One in N, FIR, Siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_e310_fpga.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_e310_fpga_sg3.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;1x DDC, 1x DUC&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;code&amp;gt;usrp_e310_fpga_RFNOC.bit (sg1 version)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;usrp_e310_fpga_RFNOC_sg3.bit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;fosphor, window, fft, 2x AXI FIFOs, FIR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Instructions on flashing the image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
  &lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device.&lt;br /&gt;
&lt;br /&gt;
By following the steps above the following should now be available:&lt;br /&gt;
* UHD/RFNoC code downloaded and installed&lt;br /&gt;
* FPGA code available&lt;br /&gt;
* A valid RFNoC image on your X3xx or E3xx series device&lt;br /&gt;
&lt;br /&gt;
====Inspect default images====&lt;br /&gt;
Run the following command, with a USRP connected to your PC, to verify current image on the USRP.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
If an RFNoC image was successfully loaded onto the USRP, there will be a lot of output text (RFNoC code is currently very verbose). The final lines of the output should be similar to the following for an USRP X310 ( e.g. &amp;lt;code&amp;gt;usrp_x310_fpga_HG&amp;lt;/code&amp;gt; ):&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * DDC_1&lt;br /&gt;
    |   |   |   * DUC_0&lt;br /&gt;
    |   |   |   * DUC_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Final output for &amp;lt;code&amp;gt;usrp_x310_fpga_RFNOC_HG.bit&amp;lt;/code&amp;gt; image:&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * DUC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * Window_0&lt;br /&gt;
    |   |   |   * FIR_0&lt;br /&gt;
    |   |   |   * SigGen_0&lt;br /&gt;
    |   |   |   * KeepOneInN_0&lt;br /&gt;
    |   |   |   * fosphor_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The actual names and number of blocks can differ. The list of blocks should start with the &amp;lt;code&amp;gt;DmaFIFO_x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Radio_x&amp;lt;/code&amp;gt;, and then a couple more lines of block IDs should follow.&lt;br /&gt;
&lt;br /&gt;
====Build custom image with pre-built RFNoC blocks====&lt;br /&gt;
Because of the growing number of RFNoC blocks, the user has the option to build an FPGA image with a set of pre-built RFNoC blocks of their choosing. The following steps describe the process for doing this and by so doing will also validate proper tool installation. Because compilation can take a couple of hours, it is recommended the user begin this process while continuing the rest of this guide.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA compilations can run in the background, however they are very resource intensive. If the user intents to use the same computer that is compiling to walk through the rest of this Application Note, it is recommended that the computer has plenty of resources.&lt;br /&gt;
&lt;br /&gt;
The script to initiate a compile is called &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt;, and is located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&amp;lt;/code&amp;gt; directory. Run the help menu by typing:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts &lt;br /&gt;
    $ ./uhd_image_builder.py --help&lt;br /&gt;
&lt;br /&gt;
A more detailed discussion of this script is given in an upcoming section. For now, compiling an FPGA image that has 2 RFNoC blocks (&amp;lt;code&amp;gt;window&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fft&amp;lt;/code&amp;gt;) and some &amp;lt;code&amp;gt;FIFOs&amp;lt;/code&amp;gt;, is done by running the script with the following arguments.&lt;br /&gt;
&lt;br /&gt;
Example for an X310 USRP:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py window fft -d x310 -t X310_RFNOC_HG -m 5 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
Example for an E310 USRP with Speed Grade 3 (sg3) FPGA:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py window fft -d e310 -t E310_RFNOC_sg3 -m 5 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
At the end of a successful compilation process, write the new image to a USRP. If the image was compiled for a USRP X310, the following command will load the new image. Update the &amp;lt;code&amp;gt;{IP_Address}&amp;lt;/code&amp;gt; of the USRP and &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; to the appropriate values for your configuration before running the command.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args “type=x300,addr={IP_ADDRESS}” --fpga-path {USER_PREFIX}/src/uhd-fpga/usrp3/top/x300/build/usrp_x310_fpga_RFNOC_HG.bit&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. Additional instructions on flashing a custom image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
&lt;br /&gt;
After the image has been successfully written to the USRP, power-cycle it and run the “&amp;lt;code&amp;gt;uhd_usrp_probe&amp;lt;/code&amp;gt;” utility to view the newly compiled blocks.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe&lt;br /&gt;
&lt;br /&gt;
The final lines of output for the image built for the X310 is as follows:&lt;br /&gt;
&lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * Window_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
===Getting started with UHD + RFNoC===&lt;br /&gt;
The following new examples included within the &amp;lt;code&amp;gt;rfnoc-devel&amp;lt;/code&amp;gt; branch of UHD, are a good reference on how to use RFNoC from UHD.&lt;br /&gt;
&lt;br /&gt;
The following example is based off of &amp;lt;code&amp;gt;rx_samples_to_file.cpp&amp;lt;/code&amp;gt;. The example can be configured to place an RFNoC block in between the radio and host.&lt;br /&gt;
&lt;br /&gt;
    rfnoc_rx_to_file.cpp&lt;br /&gt;
&lt;br /&gt;
This next example chains a null source to another block and streams the data to the host.&lt;br /&gt;
&lt;br /&gt;
    rfnoc_nullsource_ce_rx.cpp&lt;br /&gt;
&lt;br /&gt;
These examples demonstrate the core features and flexibility of RFNoC.&lt;br /&gt;
&lt;br /&gt;
For more information on UHD and UHD development please refer to the [https://kb.ettus.com/UHD UHD Software Resource page], [https://kb.ettus.com/Getting_Started_with_UHD_and_C%2B%2B Getting Started with UHD and C++ Application Note] or directly to the [http://files.ettus.com/manual/ UHD user manual].&lt;br /&gt;
&lt;br /&gt;
===Getting started with GNU Radio + RFNoC===&lt;br /&gt;
A good way of getting started with RFNoC in a more tangible fashion is to use GNU Radio. The &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; out-of-tree module (OOT) allows a user to use RFNoC blocks in their local GNU Radio / GNU Radio Companion (GRC) installation. This GNU Radio OOT contains blocks that allow you to configure your FPGA through GRC.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' As blocks in the &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; OOT mature, they will be upstreamed to &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt;. Also, &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; is a container used by Ettus Research to disseminate experimental or under-development features for &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt;. It is not a replacement for &amp;lt;code&amp;gt;gr-uhd&amp;lt;/code&amp;gt; (in fact, the latter is a requirement for &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;).&lt;br /&gt;
    &lt;br /&gt;
Examples can be run from &amp;lt;code&amp;gt;gr-ettus/examples/rfnoc&amp;lt;/code&amp;gt;, provided that the appropriate RFNoC blocks and compiled into the FPGA image currently running on the USRP.&lt;br /&gt;
&lt;br /&gt;
A couple of rules for building GNU Radio flowgraphs:&lt;br /&gt;
&lt;br /&gt;
* You always need a &amp;lt;code&amp;gt;Device3&amp;lt;/code&amp;gt; object in your flow graph (it does not get connected, see screenshot below).&lt;br /&gt;
* You should have at least two RFNoC blocks connected together, going &amp;lt;code&amp;gt;GNU Radio Block&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;RFNoC Block&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;GNU Radio Block&amp;lt;/code&amp;gt; is not recommended (it will work, but with suboptimal performance).&lt;br /&gt;
&lt;br /&gt;
The GNU Radio flowgraph &amp;lt;code&amp;gt;rfnoc_ddc.grc&amp;lt;/code&amp;gt; is an example that can be run using the default RFNoC image. Below are screenshots of the flowgraph and what it produces.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 1.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Copy Block: In the RFNoC domain, streams of data can not be split as easily as they are in the GNU Radio domain. The “copy” block depicted in the screenshot above serves the function as a stream splitter . It’s main purpose, when “enabled”, is to copy the samples it is getting at its input and putting then into the output, but here it is also serving as a boundary between a RFNoC-domain and a GNURadio-domain. In the flowgraph above. after this boundary is passed, the data stream can easily be split into the two sinks to have them run simultaneously (standard GNU Radio functionality). It is possible to connect the GNU Radio blocks directly to RFNoC blocks without a “copy” block, but only one would work at a time (the other ones would have to be disabled). Another way to split data streams from the RFNoC- domain is to use the ”RFNoC: split stream” block, which would split the streams in the RFNoC domain, but this is not very useful here as we are, in any case, moving into the GNURadio-domain.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 2.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
For more information on GNURadio development please refer to the [http://gnuradio.org/doc/doxygen/ GNURadio user's manual and API].&lt;br /&gt;
&lt;br /&gt;
==Starting a custom RFNoC block using RFNoC Modtool==&lt;br /&gt;
The figure below shows the basic structure of the RFNoC Stack. Corresponding code is needed in each of the three sections in order to build a custom RFNoC block with GNU Radio integration. A tool called RFNoC Modtool was created in order to minimize the effort needed to implement a new RFNoC block. RFNoC Modtool creates a custom GNU Radio OOT module with the basic structure and the necessary files for each of these sections. RFNoC Modtool is currently a part of the GNU Radio OOT module &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 3.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
===RFNoC Modtool Utilization===&lt;br /&gt;
'''NOTE:''' Console outputs may vary depending on the version of UHD the user is running. However, functionality should be the same or similar.&lt;br /&gt;
&lt;br /&gt;
Because the RFNoC Modtool has similar functionality to the &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt; [ [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules gr_modtool] ] provided by GNU Radio, those that have worked with &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt; in the past will find the RFNoC Modtool familiar.&lt;br /&gt;
&lt;br /&gt;
To check the usage of the tool, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool help&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    Usage:&lt;br /&gt;
    rfnocmodtool &amp;lt;command&amp;gt; [options] -- Run &amp;lt;command&amp;gt; with the given options.&lt;br /&gt;
    rfnocmodtool help -- Show a list of commands.&lt;br /&gt;
    rfnocmodtool help &amp;lt;command&amp;gt; -- Shows the help for a given command. &lt;br /&gt;
    &lt;br /&gt;
    List of possible commands:&lt;br /&gt;
    &lt;br /&gt;
    Name      Aliases          Description&lt;br /&gt;
    =====================================================================&lt;br /&gt;
    disable   dis              Disable block (comments out CMake entries for files) &lt;br /&gt;
    info      getinfo,inf      Return information about a given module &lt;br /&gt;
    remove    rm,del           Remove block (delete files and remove Makefile entries) &lt;br /&gt;
    makexml   mx               Make XML file for GRC block bindings &lt;br /&gt;
    add       insert           Add block to the out-of-tree module. &lt;br /&gt;
    newmod    nm,create        Create a new out-of-tree module &lt;br /&gt;
    rename    mv               Rename a block in the out-of-tree module.&lt;br /&gt;
&lt;br /&gt;
===Creating an RFNoC OOT Module===&lt;br /&gt;
&lt;br /&gt;
To start generating an RFNoC OOT module navigate to the source location ( i.e. &amp;lt;code&amp;gt;cd ~/{USER_PREFIX}/src&amp;lt;/code&amp;gt; ) and type:&lt;br /&gt;
    $ rfnocmodtool newmod [NAME OF THE MODULE]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;code&amp;gt;[NAME OF THE MODULE]&amp;lt;/code&amp;gt; is a name the user gives the new module. In the following, a module is created with the name “&amp;lt;code&amp;gt;tutorial&amp;lt;/code&amp;gt;”. If the user does not write the name of the module following the &amp;lt;code&amp;gt;newmod&amp;lt;/code&amp;gt; command the tool will ask for it interactively. Running this command will create a folder containing the basic folders that you may need for a functional module.&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod tutorial&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    Creating out-of-tree module in ./rfnoc-tutorial... Done.&lt;br /&gt;
    Use 'rfnocmodtool add' to add a new block to this currently empty module.&lt;br /&gt;
&lt;br /&gt;
To see what files and directories were created run:&lt;br /&gt;
&lt;br /&gt;
    $ ls rfnoc-tutorial/&lt;br /&gt;
    apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In contrast with &amp;lt;code&amp;gt;gr_modtool&amp;lt;/code&amp;gt;, this includes a folder called &amp;lt;code&amp;gt;rfnoc&amp;lt;/code&amp;gt;, which is where the UHD/FPGA files are located.&lt;br /&gt;
&lt;br /&gt;
===Adding custom blocks to OOT Module===&lt;br /&gt;
In order to add blocks to your module, navigate to the folder just created and use the &amp;lt;code&amp;gt;add&amp;lt;/code&amp;gt; command of &amp;lt;code&amp;gt;rfnocmodtool&amp;lt;/code&amp;gt;. Continuing with the example above, run the following:&lt;br /&gt;
&lt;br /&gt;
    $ cd rfnoc-tutorial&lt;br /&gt;
    $ rfnocmodtool add [NAME OF THE BLOCK]&lt;br /&gt;
&lt;br /&gt;
For demonstrative purposes, a block named &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; will be created. The &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block will multiply samples that pass through it by a constant. As before, if the name is not given, the tool will ask the user for the name. There are several arguments that can be passed to the tool, but running the tool without any of these arguments will give the following interactive parsing output:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool add gain&lt;br /&gt;
    linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_4.0.0.rfnoc-devel-162-g335a1317&lt;br /&gt;
    &lt;br /&gt;
    RFNoC module name identified: tutorial&lt;br /&gt;
    Block/code identifier: gain&lt;br /&gt;
    Enter valid argument list, including default arguments: &lt;br /&gt;
    Add Python QA code? [Y/n] Y&lt;br /&gt;
    Add C++ QA code? [y/N] N&lt;br /&gt;
    Block NoC ID (Hexadecimal): 1111222233334444&lt;br /&gt;
    Skip Block Controllers Generation? [UHD block ctrl files] [y/N] N&lt;br /&gt;
    Skip Block interface files Generation? [GRC block ctrl files] [y/N] N&lt;br /&gt;
&lt;br /&gt;
Hitting &amp;lt;code&amp;gt;enter&amp;lt;/code&amp;gt; on each one of the options will take the default values.&lt;br /&gt;
&lt;br /&gt;
The following is a description of the valid argument list items:&lt;br /&gt;
&lt;br /&gt;
* '''Add Python QA code:''' Not used.&lt;br /&gt;
&lt;br /&gt;
* '''Add C++ QA code:''' Not used.&lt;br /&gt;
&lt;br /&gt;
* '''NoC ID:''' This ID is a Hexadecimal number which serves as identification between the hardware part and the software part of the design. It can be as long as 16 0-9 A-F digits. If a NoC ID is not provided, it will be set to a random number.&lt;br /&gt;
&lt;br /&gt;
* '''Block Controllers Generation:''' The block controllers are the C++ control that the user can apply to the UHD-part of the design. In these files, the user can add more control over this layer of the design. Depending on the complexity of the block it may be possible to add all necessary control using NoCScript (more details on NoCScript can be found in the section labeled UHD Integration). In this case the cpp/hpp block control files generation are not needed. Default is to generate as their existence will be ignored if not edited.&lt;br /&gt;
&lt;br /&gt;
* '''Block Interface:''' Add more design specific functionality to the design at the GNU Radio interface by generating these block-interface files and adding necessary logic.  Depending on the complexity of the block it may be possible to add all necessary control using NoC-Script. In this case the block-interface files are not needed. Default is to generate as their existence will be ignored if not edited.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' If the user does not intend to use the block controllers or is not sure if they are needed, the presence of them in the design will do no harm. It is recommended to add them. This leaves the possibility to add more functions inside them in a future stage of development. &lt;br /&gt;
&lt;br /&gt;
After finishing the parsing, the following files will be generated/edited:&lt;br /&gt;
&lt;br /&gt;
    Adding file 'lib/gain_impl.h'...&lt;br /&gt;
    Adding file 'lib/gain_impl.cc'...&lt;br /&gt;
    Adding file 'include/tutorial/gain.h'...&lt;br /&gt;
    Adding file 'include/tutorial/gain_block_ctrl.hpp'...&lt;br /&gt;
    Adding file 'lib/gain_block_ctrl_impl.cpp'...&lt;br /&gt;
    Editing swig/tutorial_swig.i...&lt;br /&gt;
    Adding file 'python/qa_gain.py'...&lt;br /&gt;
    Editing python/CMakeLists.txt...&lt;br /&gt;
    Adding file 'grc/tutorial_gain.xml'...&lt;br /&gt;
    Adding file 'rfnoc/blocks/gain.xml'...&lt;br /&gt;
    Adding file 'rfnoc/fpga-src/noc_block_gain.v'...&lt;br /&gt;
    rfnoc/testbenches/noc_block_gain_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
==Creating FPGA portion of custom RFNoC Block==&lt;br /&gt;
===RFNoC FPGA User Interface (API)===&lt;br /&gt;
RFNoC blocks or Computation Engines (CEs) in the FPGA use a NoC Shell instance to interface with the rest of RFNoC. NoC Shell implements RFNoC's core functionality: packet muxing and demuxing, flow control, and the settings register bus (i.e. write/read control/status registers). The NoC Shell has an interface to the RFNoC AXI stream crossbar and a user interface. NoC Shell AXI stream interfaces expect CHDR packets with a proper header. See the manual for information on [https://files.ettus.com/manual/page_rtp.html CHDR and SID].&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' AXI Stream is an ARM AMBA standard interface. Xilinx has an [http://www.xilinx.com/support/documentation/ip_documentation/ug761_axi_reference_guide.pdf AXI Reference Guide] with more details on this standard.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 4.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
Many designs will want to use an AXI Stream interface with only sample data. However, as stated earlier, the NoC Shell block expects CHDR packets. To ease interfacing user code, the AXI Wrapper block provides the necessary logic to strip and insert the CHDR header, effectively converting packetized sample data into streaming sample data and vice versa. The example RFNoC blocks &amp;lt;code&amp;gt;noc_block_fft.v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noc_block_fir.v&amp;lt;/code&amp;gt; show how AXI Wrapper is used to implement existing Xilinx AXI Stream based IP within a computation engine.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' AXI Wrapper also supports AXI Stream buses for configuration. These buses are driven via the setting register bus and do not have back pressure. They also consume two user register addresses per bus.&lt;br /&gt;
&lt;br /&gt;
The primary user interface consists of four AXI stream interfaces ( &amp;lt;code&amp;gt;tready, tvalid, tlast, tdata&amp;lt;/code&amp;gt; ) and a settings register bus ( 8-bit, valid user register addresses: &amp;lt;code&amp;gt;128-255&amp;lt;/code&amp;gt; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
AXI Stream signals:&lt;br /&gt;
* '''m_axis_data_tdata:''' Input sample data packets &lt;br /&gt;
** Data coming from host or another CE&lt;br /&gt;
* '''s_axis_data_tdata:''' Output sample data packets &lt;br /&gt;
** Data going to another CE or host&lt;br /&gt;
* '''m_axis_data_tready:''' Input signal to CE&lt;br /&gt;
** Used to notify CE that downstream CE is ready for data &lt;br /&gt;
* '''s_axis_data_tready:''' Output signal to CE&lt;br /&gt;
** Used to notify upstream CE that CE is ready for data &lt;br /&gt;
* '''m_axis_data_tvalid:''' Input signal to CE&lt;br /&gt;
** Used to indicate upstream CE has valid data &lt;br /&gt;
* '''s_axis_data_tvalid:''' Output signal to CE&lt;br /&gt;
** Used to indicate to downstream CE that CE has valid data &lt;br /&gt;
* '''m_axis_data_tlast:''' Input signal to CE&lt;br /&gt;
** Used to delimit packets from upstream CE &lt;br /&gt;
* '''s_axis_data_tlast:''' Output signal to CE&lt;br /&gt;
** Used to delimit packets to downstream CE&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; |[[File:rfnoc gsg an 5.png|right|500px|]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 6.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Settings Bus signals:&lt;br /&gt;
* '''set_stb:''' Assert to write '''set_data''' to register at '''set_addr'''ess&lt;br /&gt;
* '''set_addr:''' Register address to set&lt;br /&gt;
* '''set_data:''' Data to set&lt;br /&gt;
* '''rb_data:''' Data to read back&lt;br /&gt;
* '''rb_strobe:''' Assert to read '''rb_data''' from register at '''set_addr'''ess&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;vertical-align:top&amp;quot; |[[File:rfnoc gsg an 7.png|right|500px|]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
For the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; example block the following architecture is desired (the blue signal has both “I” and “Q” data):&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 8.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;lt;code&amp;gt;rfnoc-tutorial/rfnoc/fpga-src/noc_block_gain.v&amp;lt;/code&amp;gt; that contains the RFNoC block skeleton code that was created when the &amp;lt;code&amp;gt;$ rfnocmodtool add gain&amp;lt;/code&amp;gt; command was run and modify the following sections.&lt;br /&gt;
&lt;br /&gt;
For the setting register that will hold the constant value as well as the read back register:&lt;br /&gt;
&lt;br /&gt;
    '''localparam [7:0] SR_GAIN = SR_USER_REG_BASE;'''&lt;br /&gt;
    localparam [7:0] SR_TEST_REG_1 = SR_USER_REG_BASE + 8'd1;&lt;br /&gt;
    &lt;br /&gt;
    '''wire [15:0] gain;'''&lt;br /&gt;
    '''setting_reg #('''&lt;br /&gt;
      '''.my_addr(SR_GAIN), .awidth(8), .width(16))'''&lt;br /&gt;
    '''sr_gain ('''&lt;br /&gt;
      '''.clk(ce_clk), .rst(ce_rst),'''&lt;br /&gt;
      '''.strobe(set_stb), .addr(set_addr), .in(set_data), .out(gain), .changed());'''&lt;br /&gt;
    &lt;br /&gt;
     always @(posedge ce_clk) begin&lt;br /&gt;
        case(rb_addr)&lt;br /&gt;
          '''8'd0 : rb_data &amp;lt;= {48'd0, gain};'''&lt;br /&gt;
          8'd1 : rb_data &amp;lt;= {32'd0, test_reg_1};&lt;br /&gt;
          default : rb_data &amp;lt;= 64'h0BADC0DE0BADC0DE;&lt;br /&gt;
        endcase&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And for the processing section:&lt;br /&gt;
&lt;br /&gt;
    assign m_axis_data_tready = s_axis_data_tready;&lt;br /&gt;
    assign s_axis_data_tvalid = m_axis_data_tvalid;&lt;br /&gt;
    assign s_axis_data_tlast = m_axis_data_tlast;&lt;br /&gt;
    &lt;br /&gt;
    '''wire [15:0] i = m_axis_data_tdata[31:16];'''&lt;br /&gt;
    '''wire [15:0] q = m_axis_data_tdata[15:0];'''&lt;br /&gt;
    &lt;br /&gt;
    '''wire [31:0] i_mult_gain = i*gain;'''&lt;br /&gt;
    '''wire [31:0] q_mult_gain = q*gain;'''&lt;br /&gt;
    &lt;br /&gt;
    '''assign s_axis_data_tdata = {i_mult_gain[15:0], q_mult_gain[15:0]};'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''  Because the multiplication process can occur in the same clock cycle there is no need for handshaking with the AXI &amp;lt;code&amp;gt;tready, tvalid  and tlast&amp;lt;/code&amp;gt; signals and therefore they are simply passed through the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; RFNoC block.&lt;br /&gt;
&lt;br /&gt;
===Creating and running HDL testbenches===&lt;br /&gt;
In order to make the coding iteration process more efficient, it is recommended to create testbenches for all RFNoC blocks before compiling them into the FPGA image. This allows for flaw and/or bug detection early in the design. RFNoC Modtool provides the structure and files ( e.g. &amp;lt;code&amp;gt;noc_block_{USER_BLOCK_NAME}_tb&amp;lt;/code&amp;gt; ) for the testbenches of each of the OOT blocks that are added with the &amp;lt;code&amp;gt;$ rfnocmodtool add&amp;lt;/code&amp;gt; command. &lt;br /&gt;
&lt;br /&gt;
Below is a figure that shows the structure of the testbench created by the RFNoC Modtool.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 9.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
From the [[Getting Started with RFNoC Development#Adding_custom_blocks_to_OOT_Module|Adding custom blocks to OOT Module section]] where the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block was initially created, the last files generated were:&lt;br /&gt;
&lt;br /&gt;
    rfnoc/testbenches/noc_block_gain_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_gain_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;noc_block_gain_tb&amp;lt;/code&amp;gt; is a folder generated to contain all the files related to the test bench of the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block. Each time a new OOT block is created, a new folder will be generated as well. &lt;br /&gt;
&lt;br /&gt;
Inside of this folder are the following three files:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt:&amp;lt;/code&amp;gt; this is an empty file used, so far, only to increase the scope of the compilers.&lt;br /&gt;
* &amp;lt;code&amp;gt;noc_block_gain_tb.sv:&amp;lt;/code&amp;gt; this is a ''System Verilog'' file, in which user custom tests are to be located.  This is the '''only''' file that needs to be modified.&lt;br /&gt;
* &amp;lt;code&amp;gt;Makefile:&amp;lt;/code&amp;gt; This file determines the directives that run the simulation.&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;lt;code&amp;gt;rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv&amp;lt;/code&amp;gt; and modify the following lines:&lt;br /&gt;
&lt;br /&gt;
    initial begin : tb_main&lt;br /&gt;
      string s;&lt;br /&gt;
      logic [31:0] random_word;&lt;br /&gt;
      logic [63:0] readback;&lt;br /&gt;
      '''logic [15:0] gain;'''&lt;br /&gt;
    &lt;br /&gt;
    `TEST_CASE_START(&amp;quot;Write / readback user registers&amp;quot;);&lt;br /&gt;
    random_word = $random();&lt;br /&gt;
    '''tb_streamer.write_user_reg(sid_noc_block_gain, noc_block_gain.SR_GAIN, random_word[15:0]);&lt;br /&gt;
    tb_streamer.read_user_reg(sid_noc_block_gain, 0, readback);&lt;br /&gt;
    $sformat(s, &amp;quot;User register 0 incorrect readback! Expected: %0d, Actual %0d&amp;quot;, readback[15:0], random_word[15:0]);&lt;br /&gt;
    `ASSERT_ERROR(readback[15:0] == random_word[15:0], s);'''&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    `TEST_CASE_START(&amp;quot;Test sequence&amp;quot;);&lt;br /&gt;
    '''gain = 100;'''&lt;br /&gt;
    '''tb_streamer.write_user_reg(sid_noc_block_gain, noc_block_gain.SR_GAIN, gain);'''&lt;br /&gt;
      fork&lt;br /&gt;
        begin&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    tb_streamer.recv(recv_payload,md);&lt;br /&gt;
      for (int i = 0; i &amp;lt; SPP/2; i++) begin&lt;br /&gt;
        '''expected_value = i*gain;'''&lt;br /&gt;
&lt;br /&gt;
Create a &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory, verify directory location is &amp;lt;code&amp;gt;rfnoc-tutorial&amp;lt;/code&amp;gt; and run:&lt;br /&gt;
&lt;br /&gt;
    $ mkdir build &amp;amp;&amp;amp; cd build/&lt;br /&gt;
&lt;br /&gt;
The next step is to run &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt;. If PyBOMBS was used to create the development sandbox, &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt; will automatically detect the location of the &amp;lt;code&amp;gt;fpga&amp;lt;/code&amp;gt; repository. If PyBOMBS was not used, the user must provide the location of where the &amp;lt;code&amp;gt;fpga&amp;lt;/code&amp;gt; repository is installed.&lt;br /&gt;
&lt;br /&gt;
If PyBOMBS used, run:&lt;br /&gt;
&lt;br /&gt;
    $ cmake ../&lt;br /&gt;
&lt;br /&gt;
If PyBOMBS not used, run:&lt;br /&gt;
&lt;br /&gt;
    $ cmake [-DUHD_FPGA_DIR=/PATH/TO/FPGA/REPOSITORY] ../&lt;br /&gt;
&lt;br /&gt;
Final output from the &amp;lt;code&amp;gt;$ cmake ../&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
    -- Configuring done&lt;br /&gt;
    -- Generating done&lt;br /&gt;
    -- Build files have been written to: /home/widow/rfnoc/src/rfnoc-tutorial/build&lt;br /&gt;
&lt;br /&gt;
The following command will modify the necessary files and set the correct path to the simulation tools. From now on, every time a new block is added, this command will be run automatically. Remember, only run the following command once for each OOT module (not RFNoC block, but OOT module) created:&lt;br /&gt;
&lt;br /&gt;
    $ make test_tb&lt;br /&gt;
    Scanning dependencies of target test_tb&lt;br /&gt;
    Built target test_tb&lt;br /&gt;
&lt;br /&gt;
Testbenches can be executed by running the command:&lt;br /&gt;
&lt;br /&gt;
    $ make noc_block_[name_of_your_block]_tb &lt;br /&gt;
&lt;br /&gt;
The gain block testbench can be run by running the following command:&lt;br /&gt;
&lt;br /&gt;
    $ make noc_block_gain_tb&lt;br /&gt;
&lt;br /&gt;
The simulation will start.  Final output should look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ========================================================&lt;br /&gt;
    TESTBENCH STARTED: noc_block_gain&lt;br /&gt;
    ========================================================&lt;br /&gt;
    [TEST CASE   1] (t=000000000) BEGIN: Wait for Reset...&lt;br /&gt;
    [TEST CASE   1] (t=000001002) DONE... Passed&lt;br /&gt;
    [TEST CASE   2] (t=000001002) BEGIN: Check NoC ID...&lt;br /&gt;
    Read GAIN NOC ID: 1111222233334444&lt;br /&gt;
    [TEST CASE   2] (t=000001238) DONE... Passed&lt;br /&gt;
    [TEST CASE   3] (t=000001238) BEGIN: Connect RFNoC blocks...&lt;br /&gt;
    Connecting noc_block_tb (SID: 1:0) to noc_block_gain (SID: 0:0)&lt;br /&gt;
    Connecting noc_block_gain (SID: 0:0) to noc_block_tb (SID: 1:0)&lt;br /&gt;
    [TEST CASE   3] (t=000005457) DONE... Passed&lt;br /&gt;
    [TEST CASE   4] (t=000005457) BEGIN: Write / readback user registers...&lt;br /&gt;
    [TEST CASE   4] (t=000006888) DONE... Passed&lt;br /&gt;
    [TEST CASE   5] (t=000006888) BEGIN: Test sequence...&lt;br /&gt;
    [TEST CASE   5] (t=000007633) DONE... Passed&lt;br /&gt;
    ========================================================&lt;br /&gt;
    '''TESTBENCH FINISHED: noc_block_gain'''&lt;br /&gt;
    ''' - Time elapsed:   7700 ns'''             &lt;br /&gt;
    ''' - Tests Expected: 5'''&lt;br /&gt;
    ''' - Tests Run:      5'''&lt;br /&gt;
    ''' - Tests Passed:   5'''&lt;br /&gt;
    '''Result: PASSED'''   &lt;br /&gt;
    ========================================================&lt;br /&gt;
    $finish called at time : 7700 ns : File &amp;quot;/home/widow/rfnoc/src/rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/noc_block_gain_tb.sv&amp;quot; Line 10&lt;br /&gt;
    INFO: [USF-XSim-96] XSim completed. Design snapshot 'noc_block_gain_tb_behav' loaded.&lt;br /&gt;
    INFO: [USF-XSim-97] XSim simulation ran for 1000000000us&lt;br /&gt;
    launch_simulation: Time (s): cpu = 00:00:10 ; elapsed = 00:00:12 . Memory (MB): peak = 966.387 ; gain = 54.848 ; free physical = 3080 ; free virtual = 29888&lt;br /&gt;
    # if [string equal $vivado_mode &amp;quot;batch&amp;quot;] {&lt;br /&gt;
    #     puts &amp;quot;BUILDER: Closing project&amp;quot;&lt;br /&gt;
    #     close_project&lt;br /&gt;
    # } else {&lt;br /&gt;
    #     puts &amp;quot;BUILDER: In GUI mode. Leaving project open.&amp;quot;&lt;br /&gt;
    # }&lt;br /&gt;
    BUILDER: Closing project&lt;br /&gt;
    ****** Webtalk v2015.4 (64-bit)&lt;br /&gt;
      **** SW Build 1412921 on Wed Nov 18 09:44:32 MST 2015&lt;br /&gt;
      **** IP Build 1412160 on Tue Nov 17 13:47:24 MST 2015&lt;br /&gt;
        ** Copyright 1986-2015 Xilinx, Inc. All Rights Reserved.&lt;br /&gt;
    &lt;br /&gt;
    source /home/widow/rfnoc/src/rfnoc-tutorial/rfnoc/testbenches/noc_block_gain_tb/xsim_proj/xsim_proj.hw/webtalk/labtool_webtalk.tcl -notrace&lt;br /&gt;
    INFO: [Common 17-206] Exiting Webtalk at Tue Jan 10 23:26:20 2017...&lt;br /&gt;
    INFO: [Common 17-206] Exiting Vivado at Tue Jan 10 23:26:22 2017...&lt;br /&gt;
    Built target noc_block_gain_tb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With every custom block created, a &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; directive will be available to run the simulation from the &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
===Building the FPGA image with a custom user block===&lt;br /&gt;
In this section steps are given on how to initiate an FPGA build while incorporating the user’s custom RFNoC block. The first sections give general information on building RFNoC images. The remaining two sections show how to initiate FPGA builds using a command line interface and using a graphical interface (coming out soon), respectively.&lt;br /&gt;
&lt;br /&gt;
====Discussion on number of blocks in an FPGA image====&lt;br /&gt;
There is a maximum number of blocks that can be added for each device. The maximum amount of computation engines (CEs/RFNoC blocks) that each device can use is 16, but the amount of custom blocks that can be added depends on the device. &lt;br /&gt;
&lt;br /&gt;
If using a device from the X3xx series, from the 16 CEs, there are 6 that will be always added and are not subject to direct customization: 1 CE for the AXI bus, 1 CE for the Ethernet Interface, 2 Radios and 2 Dma FIFOS. Because of this, the application will only allow a number of 10 custom blocks on the X3xx series. &lt;br /&gt;
&lt;br /&gt;
If using a device from the E3xx series, 2 CE engines are always added and are not subject to direct customization: 1 CE for the AXI bus and 1 Radio. This would virtually allow 14 slots for custom blocks. However, given the size of the FPGA on the E3xx series of devices, the application only allows a number of 6 custom blocks. &lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Blocks with higher resource utilization may fill up the FPGA and force the user to include less blocks.&lt;br /&gt;
&lt;br /&gt;
Verify the current maximum values by running the &amp;lt;code&amp;gt;uhd_images_builder.py&amp;lt;/code&amp;gt; utility from the scripts directory.&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&lt;br /&gt;
    $ uhd_image_builder.py --help&lt;br /&gt;
&lt;br /&gt;
====Discussion on FPGA image targets====&lt;br /&gt;
RFNoC target names follow the pattern &amp;lt;code&amp;gt;{DEVICE}_RFNoC_{BUILD_TYPE}&amp;lt;/code&amp;gt; with the following build types: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HG:&amp;lt;/code&amp;gt; 1GigE on SFP+ Port0, 10Gig on SFP+ Port&lt;br /&gt;
* &amp;lt;code&amp;gt;XG:&amp;lt;/code&amp;gt; 10GigE on both SFP+ ports&lt;br /&gt;
* &amp;lt;code&amp;gt;HLS:&amp;lt;/code&amp;gt; Vivado High Level Synthesis enabled&lt;br /&gt;
* &amp;lt;code&amp;gt;sgX:&amp;lt;/code&amp;gt; Speed grade for E300 devices (1 or 3)&lt;br /&gt;
&lt;br /&gt;
Some examples are:&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_XG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_XG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X310_RFNOC_HLS_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;X300_RFNOC_HLS_HG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;E310_RFNOC&amp;lt;/code&amp;gt; (this is for the speed grade 1 FPGA version of E310, append &amp;lt;code&amp;gt;_sg3&amp;lt;/code&amp;gt; for speed grade 3)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' E310, E312 and E313 all have the same FPGA hardware and therefore will use the &amp;lt;code&amp;gt;E310_RFNOC_{BUILD_TYPE}&amp;lt;/code&amp;gt; target. USRP E3xx devices have either &amp;lt;code&amp;gt;sg1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sg3&amp;lt;/code&amp;gt; hardware, please visit [http://files.ettus.com/e3xx_images/README here] to find out how to differentiate.&lt;br /&gt;
&lt;br /&gt;
Additional information about the build targets can be found at the build instructions for USRP3, found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here].&lt;br /&gt;
&lt;br /&gt;
====Image building using the command line====&lt;br /&gt;
The script &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; is used to generate the NoC block instantiation file and build the FPGA image. Run the help menu by typing:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts&lt;br /&gt;
    $ ./uhd_image_builder.py --help&lt;br /&gt;
         &lt;br /&gt;
    usage: uhd_image_builder.py [-h] [-I INCLUDE_DIR [INCLUDE_DIR ...]]&lt;br /&gt;
                                [-m MAX_NUM_BLOCKS] [--fill-with-fifos]&lt;br /&gt;
                                [-o OUTFILE] [-d DEVICE] [-t TARGET] [-g] [-c]&lt;br /&gt;
                                [blocks [blocks ...]]&lt;br /&gt;
    &lt;br /&gt;
    Generate the NoC block instantiation file&lt;br /&gt;
    &lt;br /&gt;
    positional arguments:&lt;br /&gt;
      blocks                List block names to instantiate.&lt;br /&gt;
    &lt;br /&gt;
    optional arguments:&lt;br /&gt;
      -h, --help            show this help message and exit&lt;br /&gt;
      -I INCLUDE_DIR [INCLUDE_DIR ...], --include-dir INCLUDE_DIR [INCLUDE_DIR ...]&lt;br /&gt;
                            Path directory of the RFNoC Out-of-Tree module&lt;br /&gt;
      -m MAX_NUM_BLOCKS, --max-num-blocks MAX_NUM_BLOCKS&lt;br /&gt;
                            Maximum number of blocks (Max. Allowed for x310|x300:&lt;br /&gt;
                            10, for e300: 6)&lt;br /&gt;
      --fill-with-fifos     If the number of blocks provided was smaller than the&lt;br /&gt;
                            max number, fill the rest with FIFOs&lt;br /&gt;
      -o OUTFILE, --outfile OUTFILE&lt;br /&gt;
                            Output /path/filename - By running this directive, you&lt;br /&gt;
                            won't build your IP&lt;br /&gt;
      -d DEVICE, --device DEVICE&lt;br /&gt;
                            Device to be programmed [x300, x310, e310]&lt;br /&gt;
      -t TARGET, --target TARGET&lt;br /&gt;
                            Build target - image type [X3X0_RFNOC_HG,&lt;br /&gt;
                            X3X0_RFNOC_XG, E310_RFNOC_sg3...]&lt;br /&gt;
      -g, --GUI             Open Vivado GUI during the FPGA building process&lt;br /&gt;
      -c, --clean-all       Cleans the IP before a new build&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are details on the usage of the script which is followed by an example:&lt;br /&gt;
&lt;br /&gt;
'''Blocks:''' The first arguments are the names of RFNoC blocks that the user wants to have compiled into the new image which are separated by a space. They can be custom blocks from the user’s OOT module or from the ones that are provided from Ettus, or a combination. Blocks provided by Ettus Research are listed (among other sources necessary for the FPGA build) in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/lib/rfnoc/Makefile.srcs&amp;lt;/code&amp;gt; file. &lt;br /&gt;
&lt;br /&gt;
These blocks can be identified by the following pattern: &lt;br /&gt;
&lt;br /&gt;
    noc_block_{NAME}.v&lt;br /&gt;
&lt;br /&gt;
However, as all the RFNoC blocks have the same &amp;lt;code&amp;gt;noc_block_&amp;lt;/code&amp;gt; prefix, for simplicity this prefix is omitted when listing the blocks in the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; utility. As an example of the incorrect and correct way of adding blocks, consider the following examples when adding the &amp;lt;code&amp;gt;noc_block_null_source_sink&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noc_block_siggen&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
Incorrect method:  &lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py noc_block_null_source_sink noc_block_siggen ...&lt;br /&gt;
&lt;br /&gt;
Correct method:&lt;br /&gt;
&lt;br /&gt;
    $ ./uhd_image_builder.py null_source_sink siggen ...&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Blocks generated by the RFNoC Modtool follow the same naming convention.&lt;br /&gt;
&lt;br /&gt;
There is an increasing list of pre-built blocks. Here is a sample:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;axi_fifo_loopback&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;axi_dma_fifo&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fir_filter&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fft&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;null_source_sink&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;schmidl_cox&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;packet_resizer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;split_stream&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;vector_iir&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;addsub&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;window&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;keep_one_in_n&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;pfb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;export_io&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;conv_encoder_qpsk&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;siggen&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;logpwr&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fosphor&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;moving_avg&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ddc&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;duc&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RFNoC related blocks generally reside in &amp;lt;code&amp;gt;fpga/usrp3/lib/rfnoc/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!Block&lt;br /&gt;
!Filename&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FIFO&lt;br /&gt;
|noc_block_axi_fifo_loopback.v&lt;br /&gt;
|Simple FIFO loopback / passthrough block.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FFT&lt;br /&gt;
|noc_block_fft.v&lt;br /&gt;
|Xilinx coregen based Fast Fourier Transform up to length 4096.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|FIR&lt;br /&gt;
|noc_block_fir_filter.v&lt;br /&gt;
|Xilinx coregen based Finite Impulse Response Filter, 41 taps, reconfigurable tap coefficients.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|Window&lt;br /&gt;
|noc_block_window.v&lt;br /&gt;
|Windowing block for use with FFT block.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Vector IIR&lt;br /&gt;
|noc_block_vector_iir.v&lt;br /&gt;
|Single pole IIR with configurable coefficients that filters data along vectors (i.e. parallel streams of samples). Useful with FFT output.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Keep One in N&lt;br /&gt;
|noc_block_keep_one_in_n.v&lt;br /&gt;
|Keeps one packet every N packets.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|AddSub&lt;br /&gt;
|noc_block_addsub.v&lt;br /&gt;
|Example of using multiple block ports in a single RFNoC block to add and subtract streams.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Null Source Sink&lt;br /&gt;
|noc_block_null_source_sink.v&lt;br /&gt;
|Generates dummy packets and can consume packets at a configurable rate. Useful for testing.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Packet Resizer&lt;br /&gt;
|noc_block_packet_resizer.v&lt;br /&gt;
|Resizes input packets to a configurable size (larger or smaller than source packets).&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|Split Stream&lt;br /&gt;
|noc_block_split_stream.v&lt;br /&gt;
|Replicates an input stream to a configurable number of output streams.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' There is a restriction on the amount of blocks that can added into the FPGA image, see the section in this Application Note labeled [[Getting_Started_with_RFNoC_Development#Discussion_on_number_of_blocks_in_an_FPGA_image|Discussion on number of blocks in an FPGA image]] for more information. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-I INCLUDE_DIR:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; directive provides the path to the users &amp;lt;code&amp;gt;rfnoc/fpga-src&amp;lt;/code&amp;gt; directory which contains the custom blocks. This path is needed by the Xilinx Vivado tool. Inside the &amp;lt;code&amp;gt;fpga-src&amp;lt;/code&amp;gt; directory there is a file called &amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt; that contains the path of the OOT module and a list of all the custom OOT blocks. This is an auto generated file, which is amended every time a new block is added to the OOT module. Manually modifying this file is not recommended. If there are multiple OOT modules with various custom blocks that reside in different directories the way to include them all is by separating the different paths by a space (e.g. &amp;lt;code&amp;gt;-I /first/OOT/path/ /second/OOT/path/&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-d DEVICE:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; directive directs the script on which USRP device the build is for. If no &amp;lt;code&amp;gt;–d&amp;lt;/code&amp;gt; is included the default is &amp;lt;code&amp;gt;–d x310&amp;lt;/code&amp;gt;. Generation-3 USRPs and above all support RFNoC.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-t TARGET:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;–t&amp;lt;/code&amp;gt; directive directs the script on which type of image to build for the chosen device. With each USRP device there are several build options to choose from. Detailed information about the build targets can be found at the build instructions for USRP3, found [http://files.ettus.com/manual/md_usrp3_build_instructions.html here]. If &amp;lt;code&amp;gt;-t&amp;lt;/code&amp;gt; is not included, a default target will be chosen for the given device. For example, the default &amp;lt;code&amp;gt;X310_RFNOC_HG&amp;lt;/code&amp;gt; target builds for the &amp;lt;code&amp;gt;–d x310&amp;lt;/code&amp;gt; device. More details on targets can be found in the section of this Application Note labeled [[Getting Started with RFNoC Development#Discussion_on_FPGA_image_targets|Discussion on FPGA image targets]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-m MAX_NUM_BLOCKS:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;–m&amp;lt;/code&amp;gt; directive specifies the max number of RFNoC blocks to build on the FPGA image. An RFNoC image does not need to fill all available slots with RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--fill-with-fifos:&amp;lt;/code&amp;gt; The &amp;lt;code&amp;gt;--fill-with-fifos&amp;lt;/code&amp;gt; directive will fill the empty RFNoC block slots with FIFOS. As an example, if a user indicates three RFNoC blocks by name and also specifies &amp;lt;code&amp;gt;–m 5&amp;lt;/code&amp;gt; then the other two slots will be filed with FIFOs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-o OUTFILE:&amp;lt;/code&amp;gt; With the &amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; directive, the RFNoC blocks instantiation file is generated and saved at the desired path with the given name for the user to inspect. The FPGA image will NOT build if this directive is provided. The purpose of the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script is to auto generate an instantiation file and populate the source files needed for the Xilinx Vivado tool to build the FPGA image, however, it may be desirable to only see the effect of adding a custom OOT module in the &amp;lt;code&amp;gt;fpga/&amp;lt;/code&amp;gt; directory, or for inspecting the instantiation file. When the directive is not provided the &amp;lt;code&amp;gt;rfnoc_ce_auto_inst_x3x0.v&amp;lt;/code&amp;gt; file is overwritten and the FPGA image build process will start automatically (standard use).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-g, --GUI:&amp;lt;/code&amp;gt; Open Vivado GUI during the FPGA building process&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-c, --clean-all:&amp;lt;/code&amp;gt; Cleans the IP before a new build&lt;br /&gt;
&lt;br /&gt;
Here is how to create an X310 FPGA image incorporating the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block that was created earlier in this Application Note:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts     &lt;br /&gt;
    $ ./uhd_image_builder.py gain ddc fft -I {USER_PREFIX}/src/rfnoc-tutorial/rfnoc/fpga-src/ -d x310 -t X310_RFNOC_HG -m 6 --fill-with-fifos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end of a successful compilation process, write the new image to a USRP. The following command will load the new image. Update the &amp;lt;code&amp;gt;{IP_Address}&amp;lt;/code&amp;gt; of the USRP and &amp;lt;code&amp;gt;{USER_PREFIX}&amp;lt;/code&amp;gt; to the appropriate values for your configuration before running the command.&lt;br /&gt;
&lt;br /&gt;
    $ uhd_image_loader --args “type=x300,addr={IP_ADDRESS}” --fpga-path {USER_PREFIX}/src/uhd-fpga/usrp3/top/x300/build/usrp_x310_fpga_RFNOC_HG.bit&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' &lt;br /&gt;
* The FPGA image building process may take over an hour.&lt;br /&gt;
&lt;br /&gt;
* FPGA images are specific to the USRP device NOT the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. Additional instructions on flashing a custom image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series.&lt;br /&gt;
&lt;br /&gt;
* [Environment setup] - The &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script will also set up the Xilinx Vivado environment by automatically running the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{device}&amp;lt;/code&amp;gt; directory. The &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script assumes that Xilinx Vivado is installed in the default location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;.  If the installation is in a different directory the &amp;lt;code&amp;gt;setupenv_base.sh&amp;lt;/code&amp;gt; script will need to be modified. The script is located at: &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts/setupenv_base.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Besides the custom &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block, a &amp;lt;code&amp;gt;DDC&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FFT&amp;lt;/code&amp;gt; block are also being added along with three &amp;lt;code&amp;gt;FIFOs&amp;lt;/code&amp;gt;.  The &amp;lt;code&amp;gt;DDC&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;FFT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FIFO&amp;lt;/code&amp;gt; blocks are already in the script's path and therefore do not need their path specified (they ship with the Ettus Research FPGA code). The reason three FIFOs are added is because the max number of blocks was specified to be 6 ( &amp;lt;code&amp;gt;-m 6&amp;lt;/code&amp;gt; ) and since only 3 blocks were specifically named the other three slots are filled with FIFOs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 10.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Instructions on flashing the image to a device can be found [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_load_fpga_imgs here] for X3xx series and [http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_load_fpga_imgs here] for E3xx series. FPGA images are specific to the USRP device '''NOT''' the USRP series. For example, a USRP X300 FPGA image will '''NOT''' work on a USRP X310 and vice versa. Loading an image that does not correspond to a USRP device will likely brick the device. &lt;br /&gt;
&lt;br /&gt;
Once the newly compiled image is loaded onto a USRP X3xx running the following command will show what RFNoC blocks are available on the FPGA:&lt;br /&gt;
&lt;br /&gt;
    $ uhd_usrp_probe &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * '''Block_0'''&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' The reason the custom block is called &amp;lt;code&amp;gt;Block_0&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;gain_0&amp;lt;/code&amp;gt; is because there is still host side software/files that need updated in order for this block to populate it’s proper name. A following section (UHD Integration) will step through the process of updating those host side files.&lt;br /&gt;
&lt;br /&gt;
====Using a graphical interface====&lt;br /&gt;
A graphical user interface for FPGA generation and building is shipped along with the &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script. This intuitive application aids in setting up a custom FPGA build. &lt;br /&gt;
&lt;br /&gt;
This utility is located in the same &amp;lt;code&amp;gt;scripts&amp;lt;/code&amp;gt; directory as &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
To run it, enter the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/uhd-fpga/usrp3/tools/scripts/&lt;br /&gt;
    $ ./uhd_image_builder_gui&lt;br /&gt;
&lt;br /&gt;
The application will then be launched:&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 11.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''1. Select build target:''' In this panel the available build targets are listed. This list may vary depending on which branch of the FPGA repository this user is using. Only RFNoC targets are listed. The build type descriptions are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HG:&amp;lt;/code&amp;gt; 1GigE on SFP+ Port0, 10Gig on SFP+ Port1&lt;br /&gt;
* &amp;lt;code&amp;gt;XG:&amp;lt;/code&amp;gt; 10GigE on both SFP+ ports&lt;br /&gt;
* &amp;lt;code&amp;gt;HLS:&amp;lt;/code&amp;gt; Vivado High Level Synthesis enabled&lt;br /&gt;
* &amp;lt;code&amp;gt;sgX:&amp;lt;/code&amp;gt; Speed grade for E300 devices (1 or 3)&lt;br /&gt;
&lt;br /&gt;
'''2. List of blocks available:''' In this panel the available blocks are listed that can be included into a custom design. This list separates the RFNoC blocks provided by Ettus Research and the OOT modules and corresponding blocks that the user adds. Given the hardware differences between the X3xx and E3xx devices, this list will dynamically change when a different device is selected from the panel on the left. This implies that it is necessary to add the OOT modules for each device independently. This is accomplished by using the &amp;lt;code&amp;gt;Add OOT Blocks&amp;lt;/code&amp;gt; feature of the application, details of which are explained at #7 (&amp;lt;code&amp;gt;Add OOT Blocks&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
'''3. Blocks in current design:''' This panel will be populated by adding elements from the available blocks. All the blocks listed in here will be compiled into the FPGA custom image. There is a maximum number of blocks that can be added for each device. See the section in this App Note labeled Discussion on number of blocks in an FPGA image for more information. &lt;br /&gt;
&lt;br /&gt;
'''4. Add button (&amp;gt;&amp;gt;):''' Manually add the blocks from the central panel into your design.&lt;br /&gt;
&lt;br /&gt;
'''5. Remove button (&amp;lt;&amp;lt;):''' Remove blocks from the current design (far-left panel)&lt;br /&gt;
&lt;br /&gt;
'''6. Fill with FIFOs:''' By checking this box, the design will fill any available/unspecified block slots with FIFOs. The number of FIFO blocks that will be instantiated is based on the rules of amount of blocks explained at #3. When less than the max amount of blocks are needed for certain implementation, many users choose to fill their design with FIFO blocks. &lt;br /&gt;
&lt;br /&gt;
'''7. Open Vivado GUI:''' Open Vivado GUI during the FPGA building process. This allows the user to save a Vivado project with all IP and work within the Vivado GUI for development.&lt;br /&gt;
&lt;br /&gt;
'''8. Clean IP:''' Cleans the IP before a new build (recompiles all IP).&lt;br /&gt;
&lt;br /&gt;
'''9. Add OOT blocks:''' Manually add RFNoC Modtool-generated OOT modules by pointing the application to the &amp;lt;code&amp;gt;Makefile.srcs&amp;lt;/code&amp;gt; file, which is located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/{USER-OOT-moddir}/rfnoc/fpga-srcs/&amp;lt;/code&amp;gt; directory. After adding this file, blocks will appear under “&amp;lt;code&amp;gt;OOT blocks for XXXX devices&amp;lt;/code&amp;gt;”&lt;br /&gt;
&lt;br /&gt;
'''10. Import from GRC:''' If the user has a GNU Radio flowgraph with RFNoC blocks already in it, this application can read what RFNoC blocks are in the flowgraph and populate the &amp;lt;code&amp;gt;Blocks in current design&amp;lt;/code&amp;gt; section of the application with the necessary RFNoC blocks. '''NOTE:''' All RFNoC blocks pulled from a &amp;lt;code&amp;gt;.grc&amp;lt;/code&amp;gt; file must be in the of &amp;lt;code&amp;gt;List of blocks available&amp;lt;/code&amp;gt; before beginning the build.&lt;br /&gt;
&lt;br /&gt;
'''11. Show Instantiation File:''' The application auto-generates the instantiation file that is going to be used by Vivado to build the FPGA image. This instantiation file can be viewed and edited before starting the build by clicking this button. &lt;br /&gt;
&lt;br /&gt;
'''12. Generate .bit file:''' Start the build by clicking this button. &lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' See the latter end of the previous section for additional information on what to expect once the compile has started as well as final output.&lt;br /&gt;
&lt;br /&gt;
==Creating Software/Host portion of custom RFNoC Block==&lt;br /&gt;
Now that the FPGA portion is complete the next step is to add software integration to UHD and GNU Radio as depicted in the RFNoC Stack below.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 12.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
===UHD integration===&lt;br /&gt;
Despite the data processing happening on the FPGA, the host software still has a lot of responsibilities in order for an RFNoC application to function. For example, it needs to know which settings registers are available within an RFNoC block, or what kind of input and output a block has. All of this information goes into the &amp;lt;code&amp;gt;Block Declaration&amp;lt;/code&amp;gt;, which is an XML file that is readable by UHD. Often, some simple logic needs to be embedded in the XML file, which we can do by using a simple scripting language called Noc-Script. Changes to the block declaration file are immediately imported into UHD every time an application is executed, and therefore, no software development toolchain needs to be set up.&lt;br /&gt;
&lt;br /&gt;
The list of things declared by the block declaration file includes:&lt;br /&gt;
&lt;br /&gt;
* Block name and Noc-ID&lt;br /&gt;
* Registers&lt;br /&gt;
* Inputs and outputs (including types)&lt;br /&gt;
&lt;br /&gt;
In some cases, additional C++ code is required to properly control a block from software. In this case, a &amp;lt;code&amp;gt;Block Controller&amp;lt;/code&amp;gt; file is required as well as the declaration file. In most cases, the default block controller provided by UHD is sufficient, so no C++ code needs to be written. Writing custom block controllers requires more effort, and means having to set up a programming toolchain. A common reason to write custom C++ block controllers is if setting a register requires a lot of computation, which is not feasible to do within a block declaration file (e.g., using Noc-Script).&lt;br /&gt;
&lt;br /&gt;
Skeleton code for both the block declaration and the block controller (if required) can be generated through RFNoC Modtool.&lt;br /&gt;
&lt;br /&gt;
Because the &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; block does not require anything other than simply reading and writing to a single register the default block controller will suffice for this example. However, we will need to add information about the register.&lt;br /&gt;
&lt;br /&gt;
Open the &amp;lt;code&amp;gt;gain.xml&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;/rfnoc-tutorial/rfnoc/blocks&amp;lt;/code&amp;gt; directory and add the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;&amp;lt;!--Default XML file--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;nocblock&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;gain&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;blockname&amp;gt;gain&amp;lt;/blockname&amp;gt;&lt;br /&gt;
      &amp;lt;ids&amp;gt;&lt;br /&gt;
        &amp;lt;id revision=&amp;quot;0&amp;quot;&amp;gt;1111222233334444&amp;lt;/id&amp;gt;&lt;br /&gt;
      &amp;lt;/ids&amp;gt;&lt;br /&gt;
      '''&amp;lt;nowiki&amp;gt;&amp;lt;!-- Registers --&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;registers&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;setreg&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;name&amp;gt;GAIN&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;address&amp;gt;128&amp;lt;/address&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;/setreg&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;/registers&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;nowiki&amp;gt;&amp;lt;!-- Args --&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;args&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;arg&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;name&amp;gt;gain&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;double&amp;lt;/type&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;value&amp;gt;1.0&amp;lt;/value&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;check&amp;gt;GE($gain, 0.0) AND LE($gain, 32767.0)&amp;lt;/check&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;check_message&amp;gt;Invalid gain.&amp;lt;/check_message&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;action&amp;gt;'''&lt;br /&gt;
            '''SR_WRITE(&amp;quot;GAIN&amp;quot;, IROUND($gain))'''&lt;br /&gt;
          '''&amp;lt;/action&amp;gt;'''&lt;br /&gt;
        '''&amp;lt;/arg&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;/args&amp;gt;'''&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!--One input, one output. If this is used, better have all the info the C++ file.--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;ports&amp;gt;&lt;br /&gt;
        &amp;lt;sink&amp;gt;&lt;br /&gt;
          '''&amp;lt;name&amp;gt;in0&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;sc16&amp;lt;/type&amp;gt;'''&lt;br /&gt;
        &amp;lt;/sink&amp;gt;&lt;br /&gt;
        &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
          '''&amp;lt;name&amp;gt;out0&amp;lt;/name&amp;gt;'''&lt;br /&gt;
          '''&amp;lt;type&amp;gt;sc16&amp;lt;/type&amp;gt;'''&lt;br /&gt;
        &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;/ports&amp;gt;&lt;br /&gt;
    &amp;lt;/nocblock&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GNU Radio Integration===&lt;br /&gt;
GNU Radio is built around the concept of blocks, similarly to RFNoC. When mapping RFNoC into an application, the simple constraint is made that every RFNoC block maps to a single GNU Radio block. Thus, when creating mixed GNU Radio/RFNoC applications, there is a very clear 1:1 mapping between what’s happening in RFNoC and GNU Radio.&lt;br /&gt;
&lt;br /&gt;
Since most RFNoC blocks behave very similar to one another from GNU Radio’s perspective, it is generally not required to write C++ code for another block. Rather, a default block provided by RFNoC can be used with appropriate configuration. However, in some cases it may be desirable or even necessary to write a custom GNU Radio block for more specific controlling of the underlying RFNoC block. GNU Radio allows writing blocks in either C++ or Python, but since UHD and RFNoC do not have a Python API, a custom wrapper for an RFNoC block needs to be written in C++. RFNoC Modtool will create skeleton files for these purpose.&lt;br /&gt;
&lt;br /&gt;
The most popular and effective way to use GNU Radio is through the graphical interface, the GNU Radio Companion (GRC). GRC requires a separate description of every GNU Radio block in order to become available in the graphical UI, and the same is true for an RFNoC block that is wrapped in a GNU Radio block (even if the generic RFNoC block wrapper is used). For GNU Radio 3.7 and earlier, GRC bindings for blocks are written as XML files with interspersed Cheetah or Python statements. For a more detailed tutorial on how to write these files, refer to the [http://gnuradio.org/redmine/projects/gnuradio/wiki GNU Radio Documentation] and associated [http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials tutorials].&lt;br /&gt;
&lt;br /&gt;
====GNU Radio Block Code====&lt;br /&gt;
&lt;br /&gt;
* C++ or Python, although RFNoC blocks need to be written in C++ (if at all)&lt;br /&gt;
* How does GNU Radio interface to RFNoC?&lt;br /&gt;
** via C++ infrastructure code in &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gr-ettus&amp;lt;/code&amp;gt; provides a base RFNoC block class&lt;br /&gt;
** Users extend base class for their RFNoC blocks&lt;br /&gt;
** Many blocks can use base class “as is”&lt;br /&gt;
** No C++ or Python code!&lt;br /&gt;
* &amp;lt;code&amp;gt;rfnoc-tutorial/lib/gain_impl.cc&amp;lt;/code&amp;gt;&lt;br /&gt;
** The gain block does not need anything additional&lt;br /&gt;
&lt;br /&gt;
====GNU Radio Companion Bindings====&lt;br /&gt;
* XML&lt;br /&gt;
* Describes GNU Radio blocks to GRC&lt;br /&gt;
* No recompilation&lt;br /&gt;
* Requirement of GNU Radio Companion&lt;br /&gt;
* Not strictly necessary for GNU Radio&lt;br /&gt;
* Tutorial on how to write them:&lt;br /&gt;
** [http://gnuradio.org/redmine/projects/gnuradio/wiki/GNURadioCompanion http://gnuradio.org/redmine/projects/gnuradio/wiki/GNURadioCompanion ]&lt;br /&gt;
* Skeleton file generated by RFNoC Modtool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Open the &amp;lt;code&amp;gt;tutorial-gain.xml&amp;lt;/code&amp;gt; file located in the &amp;lt;code&amp;gt;rfnoc-tutorial/grc&amp;lt;/code&amp;gt; directory and edit as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;block&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;RFNoC: gain&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;key&amp;gt;tutorial_gain&amp;lt;/key&amp;gt;&lt;br /&gt;
      &amp;lt;category&amp;gt;tutorial&amp;lt;/category&amp;gt;&lt;br /&gt;
      &amp;lt;import&amp;gt;import tutorial&amp;lt;/import&amp;gt;&lt;br /&gt;
      &amp;lt;make&amp;gt;tutorial.gain(&lt;br /&gt;
        self.device3,&lt;br /&gt;
        uhd.stream_args( \# TX Stream Args&lt;br /&gt;
            cpu_format=&amp;quot;'''fc32'''&amp;quot;,&lt;br /&gt;
            otw_format=&amp;quot;'''sc16'''&amp;quot;,&lt;br /&gt;
            args=&amp;quot;gr_vlen={0},{1}&amp;quot;.format(${grvlen}, &amp;quot;&amp;quot; if $grvlen == 1 else &amp;quot;spp={0}&amp;quot;.format($grvlen)),&lt;br /&gt;
        ),&lt;br /&gt;
        uhd.stream_args( \# RX Stream Args&lt;br /&gt;
            cpu_format=&amp;quot;'''fc32'''&amp;quot;,&lt;br /&gt;
            otw_format=&amp;quot;'''sc16'''&amp;quot;,&lt;br /&gt;
            args=&amp;quot;gr_vlen={0},{1}&amp;quot;.format(${grvlen}, &amp;quot;&amp;quot; if $grvlen == 1 else &amp;quot;spp={0}&amp;quot;.format($grvlen)),&lt;br /&gt;
        ),&lt;br /&gt;
        $block_index, $device_index,&lt;br /&gt;
    )&lt;br /&gt;
    '''self.$(id).set_arg(&amp;quot;gain&amp;quot;, $gain)'''&lt;br /&gt;
      '''&amp;lt;/make&amp;gt;'''&lt;br /&gt;
      '''&amp;lt;callback&amp;gt;set_arg(&amp;quot;gain&amp;quot;, $gain)&amp;lt;/callback&amp;gt;'''&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'param' node for every Parameter you want settable from the GUI.&lt;br /&gt;
           Sub-nodes:&lt;br /&gt;
           * name&lt;br /&gt;
           * key (makes the value accessible as $keyname, e.g. in the make node)&lt;br /&gt;
           * type --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
         .  &lt;br /&gt;
         .&lt;br /&gt;
         .&lt;br /&gt;
    &lt;br /&gt;
        &amp;lt;option&amp;gt;&lt;br /&gt;
          &amp;lt;name&amp;gt;Byte&amp;lt;/name&amp;gt;&lt;br /&gt;
          &amp;lt;key&amp;gt;u8&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;/option&amp;gt;&lt;br /&gt;
      &amp;lt;/param&amp;gt;&lt;br /&gt;
      &amp;lt;param&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;'''Gain'''&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;'''gain'''&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;value&amp;gt;'''1.0'''&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''real'''&amp;lt;/type&amp;gt;&lt;br /&gt;
      &amp;lt;/param&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'sink' node per input. Sub-nodes:&lt;br /&gt;
           * name (an identifier for the GUI)&lt;br /&gt;
           * type&lt;br /&gt;
           * vlen&lt;br /&gt;
           * optional (set to 1 for optional inputs) --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;sink&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;in&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''complex'''&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;vlen&amp;gt;$grvlen&amp;lt;/vlen&amp;gt;&lt;br /&gt;
        &amp;lt;domain&amp;gt;rfnoc&amp;lt;/domain&amp;gt;&lt;br /&gt;
      &amp;lt;/sink&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;!-- Make one 'source' node per output. Sub-nodes:&lt;br /&gt;
           * name (an identifier for the GUI)&lt;br /&gt;
           * type&lt;br /&gt;
           * vlen&lt;br /&gt;
           * optional (set to 1 for optional inputs) --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;out&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;'''complex'''&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;vlen&amp;gt;$grvlen&amp;lt;/vlen&amp;gt;&lt;br /&gt;
        &amp;lt;domain&amp;gt;rfnoc&amp;lt;/domain&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Indentation spacing is important in the &amp;lt;code&amp;gt;&amp;lt;make&amp;gt;&amp;lt;/code&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
===Compile, Install and Verify===&lt;br /&gt;
&lt;br /&gt;
    $ cd {USER_PREFIX}/src/rfnoc-tutorial/build&lt;br /&gt;
    $ make install&lt;br /&gt;
    &lt;br /&gt;
    $ uhd_usrp_probe &lt;br /&gt;
    &lt;br /&gt;
    |   |     _____________________________________________________&lt;br /&gt;
    |   |    /&lt;br /&gt;
    |   |   |       RFNoC blocks on this device:&lt;br /&gt;
    |   |   |   &lt;br /&gt;
    |   |   |   * DmaFIFO_0&lt;br /&gt;
    |   |   |   * Radio_0&lt;br /&gt;
    |   |   |   * Radio_1&lt;br /&gt;
    |   |   |   * '''gain_0'''&lt;br /&gt;
    |   |   |   * DDC_0&lt;br /&gt;
    |   |   |   * FFT_0&lt;br /&gt;
    |   |   |   * FIFO_0&lt;br /&gt;
    |   |   |   * FIFO_1&lt;br /&gt;
    |   |   |   * FIFO_2&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' In the case where the &amp;lt;code&amp;gt;gain_0&amp;lt;/code&amp;gt; does not appear but &amp;lt;code&amp;gt;Block_0&amp;lt;/code&amp;gt; does: Most likely, the XML block declaration file (see [[Getting_Started_with_RFNoC_Development#UHD_integration|UHD Integration]] section) for the block contains a NoC-ID that does not match with any NoC-ID defined in the hardware part of the design. The user has to be certain that the description files are up-to-date and that the NoC-ID matches in the SW and HW side. See the [[Getting_Started_with_RFNoC_Development#UHD_integration|UHD Integration]] section to update those host side files.&lt;br /&gt;
&lt;br /&gt;
==Testing out the custom block==&lt;br /&gt;
At this point the custom &amp;lt;code&amp;gt;gain&amp;lt;/code&amp;gt; RFNoc Block (Computation Engine) can be used within a GNU Radio flowgraph. Below is an example GRC flowgraph using our new block as well as the output application it produces. &lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 13.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Copy Block: In the RFNoC domain, streams of data can not be split as easily as they are in the GNU Radio domain. The “copy” block depicted in the screenshot above serves the function as a stream splitter . It’s main purpose, when “enabled”, is to copy the samples it is getting at its input and putting then into the output, but here it is also serving as a boundary between a RFNoC-domain and a GNURadio-domain. In the flowgraph above. after this boundary is passed, the data stream can easily be split into the two sinks to have them run simultaneously (standard GNU Radio functionality). It is possible to connect the GNU Radio blocks directly to RFNoC blocks without a “copy” block, but only one would work at a time (the other ones would have to be disabled). Another way to split data streams from the RFNoC-domain is to use the ”RFNoC: split stream” block, which would split the streams in the RFNoC domain, but this is not very useful here as we are, in any case, moving into the GNURadio-domain.&lt;br /&gt;
&lt;br /&gt;
[[File:rfnoc gsg an 14.png|center|800px|]]&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
===Xilinx Vivado===&lt;br /&gt;
====Compile issues====&lt;br /&gt;
=====Synthesis is failing=====&lt;br /&gt;
Verify all the correct Xilinx [[Getting Started with RFNoC Development#Prerequisites|prerequisite software]] is installed.&lt;br /&gt;
&lt;br /&gt;
Additional helpful information can be found in the following Xilinx forum posts:&lt;br /&gt;
* https://forums.xilinx.com/t5/Synthesis/Synthesis-failed-without-reporting-any-error/td-p/686000&lt;br /&gt;
* https://forums.xilinx.com/t5/Installation-and-Licensing/Vivado-on-Linux-synthesis-fails-with-no-error-message/td-p/732143&lt;br /&gt;
&lt;br /&gt;
====Environment Setup====&lt;br /&gt;
The &amp;lt;code&amp;gt;uhd_image_builder.py&amp;lt;/code&amp;gt; script will also set up the Xilinx Vivado environment by automatically running the &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; located in the &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3/top/{device}&amp;lt;/code&amp;gt; directory. The &amp;lt;code&amp;gt;setupenv.sh&amp;lt;/code&amp;gt; script assumes that Xilinx Vivado is installed in the default location of &amp;lt;code&amp;gt;/opt/Xilinx/Vivado&amp;lt;/code&amp;gt;. If the installation is in a different directory, then the &amp;lt;code&amp;gt;setupenv_base.sh&amp;lt;/code&amp;gt; script will need to be modified. The script is located at: &amp;lt;code&amp;gt;{USER_PREFIX}/src/uhd-fpga/usrp3_rfnoc/tools/scripts/setupenv_base.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Links and Additional Resources==&lt;br /&gt;
===RFNoC additional resources===&lt;br /&gt;
* [https://kb.ettus.com/RFNoC RFNoC Primary Application Note]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Intro.pdf RFNoC Introduction]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_FPGA.pdf RFNoC Deep Dive: FPGA]&lt;br /&gt;
* [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Host.pdf RFNoC Deep Dive: Host side]&lt;br /&gt;
* [https://www.youtube.com/watch?v=8cPd3t88djE Video: RFNoC presented at Wireless @ Virginia Tech, 2015 ]&lt;br /&gt;
** Explaining the slides of Intro, FPGA and Host presentations above (in that order).&lt;br /&gt;
&lt;br /&gt;
===GNU Radio resources===&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules GNU Radio OutOfTree Modules tutorial]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGRFromSource GNU Radio Installation]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/gnuradio/wiki/Tutorials GNU Radio Tutorials]&lt;br /&gt;
&lt;br /&gt;
===UHD resources===&lt;br /&gt;
* [https://kb.ettus.com/UHD UHD Software Resources Page]&lt;br /&gt;
* [http://files.ettus.com/manual/md_usrp3_build_instructions.html USRP3 build instructions]&lt;br /&gt;
* [http://files.ettus.com/manual/ UHD Manual]&lt;br /&gt;
&lt;br /&gt;
===Other resources===&lt;br /&gt;
* [https://www.xilinx.com/support/documentation/ip_documentation/ug761_axi_reference_guide.pdf Xilinx - AXI reference guide]&lt;br /&gt;
* [https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux UHD + GNU Radio Application Note (Linux)]&lt;br /&gt;
* [http://gnuradio.org/redmine/projects/pybombs/wiki PyBOMBS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=UHD&amp;diff=3126</id>
		<title>UHD</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=UHD&amp;diff=3126"/>
				<updated>2016-12-02T02:17:11Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ettus Research USRP™ family of Software Defined Radios (SDRs) are versatile devices that allow users to transmit and receive many different and custom waveforms at various frequencies and settings on a common hardware platform. Commercial, academic, and military customers employ the flexible and reusable USRP hardware for research, wireless exploration, and field deployments.&lt;br /&gt;
&lt;br /&gt;
The USRP comes in many form factors and configurations. The main categories of USRPs are:&lt;br /&gt;
&lt;br /&gt;
*Bus (B) Series – Connected to a host computer via a USB connection&lt;br /&gt;
*Network(N) Series – Connected to a host computer via an Ethernet connection&lt;br /&gt;
*High Performance (X) Series – Connection can be Ethernet or a x4 PCI-Express connection&lt;br /&gt;
*Embedded (E) Series – Meant to run stand-alone (without a host computer).&lt;br /&gt;
&lt;br /&gt;
The USRP Hardware Driver (UHD) is a user-space library that runs on a general purpose processor (GPP) and communicates with and controls all of the USRP device family. The B, N and X series USRPs send and receive samples from a host computer as illustrated in figure 1. And since our embedded series USRPs house an internal GPP you can run these radios without the need of a host computer (stand-alone mode).&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 1.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
USRPs are transceivers, meaning that they can both transmit and receive RF signals. UHD provides the necessary control used to transport user waveform samples to and from USRP hardware as well as control various parameters (e.g. sampling rate, center frequency, gains, etc) of the radio.&lt;br /&gt;
&lt;br /&gt;
UHD GPP driver and firmware code is written in C/C++ while the code developed for the FPGA (Field Programmable Gate Array) is written in Verilog. There is a C/C++ API that can interface to other software frameworks, as in the case of GNU Radio, or a user can simply build custom signal processing applications directly on top of the UHD C/C++ API. Figure 2 illustrates this concept:&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 2.png|700px|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;Figure 2. UHD components&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Open Source==&lt;br /&gt;
The majority of the UHD code base is open source, including code that executes on the host, as well as code targeted to the USRP hardware (FPGA and microcontroller firmware).  As dual-licensed software, UHD is available under the open-source GNU Public License version 3 (GPLv3), as well as an alternate, less-restrictive license offered only by Ettus Research. For more information on our licensing policy, please contact [mailto:info@ettus.com info@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Release Cycle==&lt;br /&gt;
Due to the open source nature of UHD, the entire development process is also open, and it is possible to track UHD’s development through our [https://github.com/EttusResearch/uhd Git] version control system. Users can make a choice if they prefer the latest development code, which is most feature-rich but can be unstable at times, or the more thoroughly tested code that does not include the latest development.&lt;br /&gt;
Versioned releases (e.g., UHD version 3.9.2) happen approximately every two months, and usually only include bugfixes compared to the previous version (e.g., UHD 3.9.2 has the same feature set as 3.9.1, but is more stable). These bugfix releases are done off of the maint branch, which is where all the bugfix development happens.&lt;br /&gt;
&lt;br /&gt;
New feature development is done on the master branch. This branch should not be considered stable, even though we use continuous integration systems to monitor its state. However, it is possible that APIs or dependency requirements change on the master branch.&lt;br /&gt;
&lt;br /&gt;
At the end of a feature development cycle, the master branch is frozen, and only bugfixes are accepted into the master branch. Once the master branch is considered stable, the maint branch is reset to master, and a new versioned release is produced from the previous master branch. This is indicated by a major version number jump (e.g., when going from 3.8.3 to 3.9.0). Major version releases occur 1-2 times per year, and usually accompany new product releases.&lt;br /&gt;
&lt;br /&gt;
Aside from the maint and master branches, new feature branches are sometimes published (temporarily) to give insight into upcoming features, and earlier access to new development.&lt;br /&gt;
&lt;br /&gt;
==Code Portability==&lt;br /&gt;
The UHD software API supports application development on all USRP SDR products. Using a common software interface is critical, enabling code portability and, allowing applications to transition seamlessly to other USRP SDR systems when development requirements expand or new systems become available. Hence, it enables a significant reduction in development effort by allowing you to preserve and reuse your legacy code. UHD can be installed on Linux, Windows, or a Mac. Installation packages for these platforms as well as instructions for building from source can be found [http://files.ettus.com/manual/page_install.html here].    &lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 3.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
&lt;br /&gt;
===Python===&lt;br /&gt;
Compatible with Python 2.7 and above (Python 3 is supported). Note Python is required for building, and some utilities that ship with UHD are written in Python. It is not, in general, required for running UHD applications.&lt;br /&gt;
&lt;br /&gt;
===Linux Notes===&lt;br /&gt;
This is dependent on the distribution you are using, but most, if not all, of the dependencies should be available in the package repositories for your package manager.&lt;br /&gt;
&lt;br /&gt;
===Mac OS X Notes===&lt;br /&gt;
Install the Xcode app to get the build tools (GCC and Make). Use MacPorts to get the Boost and Mako dependencies. Other dependencies can be downloaded as DMG installers from the web or installed via MacPorts. See the UHD OS X build instructions for more information: Build Instructions (Mac OS X)&lt;br /&gt;
&lt;br /&gt;
===Windows Notes===&lt;br /&gt;
The dependencies can be acquired through installable EXE files. Usually, the Windows installer can be found on the project's website. Some projects do not host Windows installers, and if this is the case, follow the auxiliary download URL for the Windows installer (below).&lt;br /&gt;
&lt;br /&gt;
===Git===&lt;br /&gt;
* Required to check out the repository (not necessary if building from tarballs).&lt;br /&gt;
* On Windows, install Cygwin with Git support to checkout the repository or install msysGit from http://code.google.com/p/msysgit/downloads/list.&lt;br /&gt;
&lt;br /&gt;
===Build Dependencies===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| UHD Version  || GCC    || Clang  || MS Visual C++  || CMake  || Boost   || LibUSB || Mako     || Doxygen              || Python || Xilinx Vivado&lt;br /&gt;
|-&lt;br /&gt;
| 3.9.X        || &amp;gt;= 4.4 || &amp;gt;= 3.3 || &amp;gt;= 2012 (11.0) || &amp;gt;= 2.8 || &amp;gt;= 1.46 || &amp;gt;= 1.0 || &amp;gt;= 0.5.0 || &amp;gt;= 1.8 (recommended) || &amp;gt;= 2.7 || == 2014.4&lt;br /&gt;
|-&lt;br /&gt;
| 3.9.10.X     || &amp;gt;= 4.8 || &amp;gt;= 3.3 || &amp;gt;= 2012 (11.0) || &amp;gt;= 2.8 || &amp;gt;= 1.53 || &amp;gt;= 1.0 || &amp;gt;= 0.5.0 || &amp;gt;= 1.8 (recommended) || &amp;gt;= 2.7 || == 2015.4&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other compilers (or lower versions) may work, but are unsupported.&lt;br /&gt;
&lt;br /&gt;
Note on MSVC: The free [https://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx Visual Studio Express Edition for Desktop] works.&lt;br /&gt;
&lt;br /&gt;
Note on Boost: Older versions of UHD may not work with newer versions of Boost, as the Boost API sometimes changes (and we can't retroactively change old versions). For example, UHD 3.8.X (and older) won't work with Boost 1.60.&lt;br /&gt;
&lt;br /&gt;
==Sample streaming==&lt;br /&gt;
UHD handles the control for transporting I and Q samples (see [http://www.ni.com/tutorial/4805/en/ here] for information on I and Q samples) by using standard interface methods such as Ethernet, USB and PCI-Express. Samples can be sent in a continuous stream as in figure 4a or in bursts, figure 4b. In addition the user has the ability to specify when samples are received or transmitted by using built in burst and timed commands.&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 4.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Figure 4. a) Continuous Sample Streaming. b)  Burst Sample Mode (SOB = Start of Burst while EOB = End of Burst).&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RF Frequency Fine Tuning==&lt;br /&gt;
USRP RF front ends may support a certain frequency step size that does not meet all or many of a user’s requirements.  For this reason, UHD includes Digital Up-Conversion (DUC) and Digital Down-Conversion (DDC) DSP blocks in the FPGA for fine tuning the RF frequency (see [http://files.ettus.com/manual/page_general.html#general_tuning_process here]). This allows users to:&lt;br /&gt;
*Have a sub-Hz RF frequency step size &lt;br /&gt;
*Mitigate the DC problem that exists on Direct Conversion (Zero IF) hardware (see [http://files.ettus.com/manual/page_general.html#general_tuning here]).&lt;br /&gt;
*Fast tune inside the available bandwidth&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 5.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
==Sample Rate==&lt;br /&gt;
Different SDR configurations, waveforms, and applications require different sample rates. For example, a user may wish to monitor 100 MHz of instantaneous RF bandwidth, but their host PC may only be capable of analyzing 20 MHz of real-time bandwidth.  For this and other cases, UHD allows users to set various sample rates to meet their custom application. Within the FPGA, UHD includes decimation and interpolation blocks in order to perform these sample rate translations. &lt;br /&gt;
&lt;br /&gt;
==IQ Corrections==&lt;br /&gt;
Inherent to all direct conversion (zero IF) RF architectures is the effect of IQ imbalance. A video entitled “Effects of Quadrature Impairments on 802.11ac EVM”, found [http://www.ni.com/rf-academy/wireless/ here], demonstrates this attribute. Find additional information [http://www.ni.com/tutorial/5657/en/ here]. In summary, any given signal on a device using a direct conversion architecture has two paths for TX and two paths for RX. One path is the In-phase or “I” and the other is Quadrature “Q”, also referred to as Real and Imaginary.&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 6.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because of slight differences due to variances in components, temperature, and other factors, the I and Q signal paths are subject to different conditions, thus altering the original signal that existed at initial capture. When the phase or amplitude of either the I or Q get altered the results show up as signals not actually present in the original signal.&lt;br /&gt;
For example, note the following IQ impairment simulation in this GNU Radio Flowgraph created in GNU Radio Companion.&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 7.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By using the “HW Impairments” block, you can simulate what happens when the I and Q signal paths are disrupted. In figure 8a there are no impairments added. However, when the amplitude of the I path is increased slightly, you get the artifact as show in figure 8b&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 8.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is possible to mitigate some of these unwanted effects in the digital domain. UHD contains function blocks within the FPGA to compensate for IQ impairments; these blocks appeared in figure 1 as IQC blocks. A user can customize the parameters of these blocks based on empirical measurement or allow UHD to perform an automatic analysis and provide parameters based on a built-in IQ correction algorithm. See the following functions in the [http://files.ettus.com/manual/page_calibration.html UHD manual] for more information:&lt;br /&gt;
&lt;br /&gt;
*uhd_cal_rx_iq_balance: - mimimizes RX IQ imbalance vs. LO frequency&lt;br /&gt;
*uhd_cal_tx_dc_offset: - mimimizes TX DC offset vs. LO frequency&lt;br /&gt;
*uhd_cal_tx_iq_balance: - mimimizes TX IQ imbalance vs. LO frequency&lt;br /&gt;
&lt;br /&gt;
==Multiple USRPs==&lt;br /&gt;
UHD makes scaling the number of channels on a USRP system simple by treating them all as one composite device, see figure 9 below. In the case of the X300/X310, when USRPs are used in this multi-USRP configuration users can use an [https://www.ettus.com/product/details/OctoClock-G external clocking source] (having both a 10 MHz clock reference and a PPS signal) to synchronize all the devices together.&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 9.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As an example, in an 8 channel receive system the “USRP Source” block in GNU Radio Companion would look like figure 10 below&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 10.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
==GPIO – General Purpose Input Output==&lt;br /&gt;
General Purpose Input Output (GPIO) pins can be controlled manually through UHD or can be set from UHD to be automatically triggered when events such as TX or RX occur. An example of where or how to use this automatic triggering: when a user connects an RF amplifier to the TX or RX port of the USRP, the amplifier can be powered on only when the USRP is transmitting. You can find out more about the aux GPIO on the E3x0/X3x0 [http://files.ettus.com/manual/page_gpio_api.html here].&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 11.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
==RF Front End Expansion==&lt;br /&gt;
While mostly a function of HW, the USRP can interface with different RF front ends from 3rd parties. By using the BasicRX and BasicTX daughterboards, a user can send or receive a Baseband or IF (Intermediate Frequency) analog signal to 3rd party front ends.&lt;br /&gt;
&lt;br /&gt;
==GNU Radio==&lt;br /&gt;
In addition to leading development of the gr-uhd module that integrates the USRP family (UHD) into GNU Radio, Ettus Research frequently contributes to the GNU Radio project. Although USRP radios are often associated with the GNU Radio software framework, many USRP applications (such as [http://www.openbts.org OpenBTS]) run without GNU Radio. For more information on GNU Radio see [https://www.ettus.com/sdr-software/detail/gnu-radio here].&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
UHD aids commercial, academic, military, hobbyists and other SDR users with rapid prototyping or deployment of wireless protocols by providing a flexible feature rich SDR API.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
&lt;br /&gt;
Github: https://github.com/EttusResearch/uhd&lt;br /&gt;
&lt;br /&gt;
Manual: http://files.ettus.com/manual/index.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Software Resources]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=UHD&amp;diff=3125</id>
		<title>UHD</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=UHD&amp;diff=3125"/>
				<updated>2016-12-02T02:15:36Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: Flipped deps table, added note on Boost&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ettus Research USRP™ family of Software Defined Radios (SDRs) are versatile devices that allow users to transmit and receive many different and custom waveforms at various frequencies and settings on a common hardware platform. Commercial, academic, and military customers employ the flexible and reusable USRP hardware for research, wireless exploration, and field deployments.&lt;br /&gt;
&lt;br /&gt;
The USRP comes in many form factors and configurations. The main categories of USRPs are:&lt;br /&gt;
&lt;br /&gt;
*Bus (B) Series – Connected to a host computer via a USB connection&lt;br /&gt;
*Network(N) Series – Connected to a host computer via an Ethernet connection&lt;br /&gt;
*High Performance (X) Series – Connection can be Ethernet or a x4 PCI-Express connection&lt;br /&gt;
*Embedded (E) Series – Meant to run stand-alone (without a host computer).&lt;br /&gt;
&lt;br /&gt;
The USRP Hardware Driver (UHD) is a user-space library that runs on a general purpose processor (GPP) and communicates with and controls all of the USRP device family. The B, N and X series USRPs send and receive samples from a host computer as illustrated in figure 1. And since our embedded series USRPs house an internal GPP you can run these radios without the need of a host computer (stand-alone mode).&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 1.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
USRPs are transceivers, meaning that they can both transmit and receive RF signals. UHD provides the necessary control used to transport user waveform samples to and from USRP hardware as well as control various parameters (e.g. sampling rate, center frequency, gains, etc) of the radio.&lt;br /&gt;
&lt;br /&gt;
UHD GPP driver and firmware code is written in C/C++ while the code developed for the FPGA (Field Programmable Gate Array) is written in Verilog. There is a C/C++ API that can interface to other software frameworks, as in the case of GNU Radio, or a user can simply build custom signal processing applications directly on top of the UHD C/C++ API. Figure 2 illustrates this concept:&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 2.png|700px|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;Figure 2. UHD components&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Open Source==&lt;br /&gt;
The majority of the UHD code base is open source, including code that executes on the host, as well as code targeted to the USRP hardware (FPGA and microcontroller firmware).  As dual-licensed software, UHD is available under the open-source GNU Public License version 3 (GPLv3), as well as an alternate, less-restrictive license offered only by Ettus Research. For more information on our licensing policy, please contact [mailto:info@ettus.com info@ettus.com].&lt;br /&gt;
&lt;br /&gt;
==Release Cycle==&lt;br /&gt;
Due to the open source nature of UHD, the entire development process is also open, and it is possible to track UHD’s development through our [https://github.com/EttusResearch/uhd Git] version control system. Users can make a choice if they prefer the latest development code, which is most feature-rich but can be unstable at times, or the more thoroughly tested code that does not include the latest development.&lt;br /&gt;
Versioned releases (e.g., UHD version 3.9.2) happen approximately every two months, and usually only include bugfixes compared to the previous version (e.g., UHD 3.9.2 has the same feature set as 3.9.1, but is more stable). These bugfix releases are done off of the maint branch, which is where all the bugfix development happens.&lt;br /&gt;
&lt;br /&gt;
New feature development is done on the master branch. This branch should not be considered stable, even though we use continuous integration systems to monitor its state. However, it is possible that APIs or dependency requirements change on the master branch.&lt;br /&gt;
&lt;br /&gt;
At the end of a feature development cycle, the master branch is frozen, and only bugfixes are accepted into the master branch. Once the master branch is considered stable, the maint branch is reset to master, and a new versioned release is produced from the previous master branch. This is indicated by a major version number jump (e.g., when going from 3.8.3 to 3.9.0). Major version releases occur 1-2 times per year, and usually accompany new product releases.&lt;br /&gt;
&lt;br /&gt;
Aside from the maint and master branches, new feature branches are sometimes published (temporarily) to give insight into upcoming features, and earlier access to new development.&lt;br /&gt;
&lt;br /&gt;
==Code Portability==&lt;br /&gt;
The UHD software API supports application development on all USRP SDR products. Using a common software interface is critical, enabling code portability and, allowing applications to transition seamlessly to other USRP SDR systems when development requirements expand or new systems become available. Hence, it enables a significant reduction in development effort by allowing you to preserve and reuse your legacy code. UHD can be installed on Linux, Windows, or a Mac. Installation packages for these platforms as well as instructions for building from source can be found [http://files.ettus.com/manual/page_install.html here].    &lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 3.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
&lt;br /&gt;
===Python===&lt;br /&gt;
Compatible with Python 2.7 and above (Python 3 is supported). Note Python is required for building, and some utilities that ship with UHD are written in Python. It is not, in general, required for running UHD applications.&lt;br /&gt;
&lt;br /&gt;
===Linux Notes===&lt;br /&gt;
This is dependent on the distribution you are using, but most, if not all, of the dependencies should be available in the package repositories for your package manager.&lt;br /&gt;
&lt;br /&gt;
===Mac OS X Notes===&lt;br /&gt;
Install the Xcode app to get the build tools (GCC and Make). Use MacPorts to get the Boost and Mako dependencies. Other dependencies can be downloaded as DMG installers from the web or installed via MacPorts. See the UHD OS X build instructions for more information: Build Instructions (Mac OS X)&lt;br /&gt;
&lt;br /&gt;
===Windows Notes===&lt;br /&gt;
The dependencies can be acquired through installable EXE files. Usually, the Windows installer can be found on the project's website. Some projects do not host Windows installers, and if this is the case, follow the auxiliary download URL for the Windows installer (below).&lt;br /&gt;
&lt;br /&gt;
===Git===&lt;br /&gt;
* Required to check out the repository (not necessary if building from tarballs).&lt;br /&gt;
* On Windows, install Cygwin with Git support to checkout the repository or install msysGit from http://code.google.com/p/msysgit/downloads/list.&lt;br /&gt;
&lt;br /&gt;
===Build Dependencies===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| UHD Version  || GCC    || Clang  || MS Visual C++  || CMake  || Boost   || LibUSB || Mako     || Doxygen              || Python || Xilinx Vivado&lt;br /&gt;
|-&lt;br /&gt;
| 3.9.X        || &amp;gt;= 4.4 || &amp;gt;= 3.3 || &amp;gt;= 2012 (11.0) || &amp;gt;= 2.8 || &amp;gt;= 1.46 || &amp;gt;= 1.0 || &amp;gt;= 0.5.0 || &amp;gt;= 1.8 (recommended) || &amp;gt;= 2.7 || == 2014.4&lt;br /&gt;
|-&lt;br /&gt;
| 3.9.10.X     || &amp;gt;= 4.8 || &amp;gt;= 3.3 || &amp;gt;= 2012 (11.0) || &amp;gt;= 2.8 || &amp;gt;= 1.53 || &amp;gt;= 1.0 || &amp;gt;= 0.5.0 || &amp;gt;= 1.8 (recommended) || &amp;gt;= 2.7 || == 2015.4&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other compilers (or lower versions) may work, but are unsupported.&lt;br /&gt;
&lt;br /&gt;
Note on MSVC: The free [https://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx Visual Studio Express Edition for Desktop] works.&lt;br /&gt;
&lt;br /&gt;
Note on Boost: Older versions of UHD may not work with newer versions of Boost, as the Boost API sometimes changes (and we can't retroactively change old versions).&lt;br /&gt;
&lt;br /&gt;
==Sample streaming==&lt;br /&gt;
UHD handles the control for transporting I and Q samples (see [http://www.ni.com/tutorial/4805/en/ here] for information on I and Q samples) by using standard interface methods such as Ethernet, USB and PCI-Express. Samples can be sent in a continuous stream as in figure 4a or in bursts, figure 4b. In addition the user has the ability to specify when samples are received or transmitted by using built in burst and timed commands.&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 4.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Figure 4. a) Continuous Sample Streaming. b)  Burst Sample Mode (SOB = Start of Burst while EOB = End of Burst).&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RF Frequency Fine Tuning==&lt;br /&gt;
USRP RF front ends may support a certain frequency step size that does not meet all or many of a user’s requirements.  For this reason, UHD includes Digital Up-Conversion (DUC) and Digital Down-Conversion (DDC) DSP blocks in the FPGA for fine tuning the RF frequency (see [http://files.ettus.com/manual/page_general.html#general_tuning_process here]). This allows users to:&lt;br /&gt;
*Have a sub-Hz RF frequency step size &lt;br /&gt;
*Mitigate the DC problem that exists on Direct Conversion (Zero IF) hardware (see [http://files.ettus.com/manual/page_general.html#general_tuning here]).&lt;br /&gt;
*Fast tune inside the available bandwidth&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 5.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
==Sample Rate==&lt;br /&gt;
Different SDR configurations, waveforms, and applications require different sample rates. For example, a user may wish to monitor 100 MHz of instantaneous RF bandwidth, but their host PC may only be capable of analyzing 20 MHz of real-time bandwidth.  For this and other cases, UHD allows users to set various sample rates to meet their custom application. Within the FPGA, UHD includes decimation and interpolation blocks in order to perform these sample rate translations. &lt;br /&gt;
&lt;br /&gt;
==IQ Corrections==&lt;br /&gt;
Inherent to all direct conversion (zero IF) RF architectures is the effect of IQ imbalance. A video entitled “Effects of Quadrature Impairments on 802.11ac EVM”, found [http://www.ni.com/rf-academy/wireless/ here], demonstrates this attribute. Find additional information [http://www.ni.com/tutorial/5657/en/ here]. In summary, any given signal on a device using a direct conversion architecture has two paths for TX and two paths for RX. One path is the In-phase or “I” and the other is Quadrature “Q”, also referred to as Real and Imaginary.&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 6.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because of slight differences due to variances in components, temperature, and other factors, the I and Q signal paths are subject to different conditions, thus altering the original signal that existed at initial capture. When the phase or amplitude of either the I or Q get altered the results show up as signals not actually present in the original signal.&lt;br /&gt;
For example, note the following IQ impairment simulation in this GNU Radio Flowgraph created in GNU Radio Companion.&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 7.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By using the “HW Impairments” block, you can simulate what happens when the I and Q signal paths are disrupted. In figure 8a there are no impairments added. However, when the amplitude of the I path is increased slightly, you get the artifact as show in figure 8b&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 8.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is possible to mitigate some of these unwanted effects in the digital domain. UHD contains function blocks within the FPGA to compensate for IQ impairments; these blocks appeared in figure 1 as IQC blocks. A user can customize the parameters of these blocks based on empirical measurement or allow UHD to perform an automatic analysis and provide parameters based on a built-in IQ correction algorithm. See the following functions in the [http://files.ettus.com/manual/page_calibration.html UHD manual] for more information:&lt;br /&gt;
&lt;br /&gt;
*uhd_cal_rx_iq_balance: - mimimizes RX IQ imbalance vs. LO frequency&lt;br /&gt;
*uhd_cal_tx_dc_offset: - mimimizes TX DC offset vs. LO frequency&lt;br /&gt;
*uhd_cal_tx_iq_balance: - mimimizes TX IQ imbalance vs. LO frequency&lt;br /&gt;
&lt;br /&gt;
==Multiple USRPs==&lt;br /&gt;
UHD makes scaling the number of channels on a USRP system simple by treating them all as one composite device, see figure 9 below. In the case of the X300/X310, when USRPs are used in this multi-USRP configuration users can use an [https://www.ettus.com/product/details/OctoClock-G external clocking source] (having both a 10 MHz clock reference and a PPS signal) to synchronize all the devices together.&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 9.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As an example, in an 8 channel receive system the “USRP Source” block in GNU Radio Companion would look like figure 10 below&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 10.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
==GPIO – General Purpose Input Output==&lt;br /&gt;
General Purpose Input Output (GPIO) pins can be controlled manually through UHD or can be set from UHD to be automatically triggered when events such as TX or RX occur. An example of where or how to use this automatic triggering: when a user connects an RF amplifier to the TX or RX port of the USRP, the amplifier can be powered on only when the USRP is transmitting. You can find out more about the aux GPIO on the E3x0/X3x0 [http://files.ettus.com/manual/page_gpio_api.html here].&lt;br /&gt;
&lt;br /&gt;
[[File:Uhd intro figure 11.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
==RF Front End Expansion==&lt;br /&gt;
While mostly a function of HW, the USRP can interface with different RF front ends from 3rd parties. By using the BasicRX and BasicTX daughterboards, a user can send or receive a Baseband or IF (Intermediate Frequency) analog signal to 3rd party front ends.&lt;br /&gt;
&lt;br /&gt;
==GNU Radio==&lt;br /&gt;
In addition to leading development of the gr-uhd module that integrates the USRP family (UHD) into GNU Radio, Ettus Research frequently contributes to the GNU Radio project. Although USRP radios are often associated with the GNU Radio software framework, many USRP applications (such as [http://www.openbts.org OpenBTS]) run without GNU Radio. For more information on GNU Radio see [https://www.ettus.com/sdr-software/detail/gnu-radio here].&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
UHD aids commercial, academic, military, hobbyists and other SDR users with rapid prototyping or deployment of wireless protocols by providing a flexible feature rich SDR API.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
&lt;br /&gt;
Github: https://github.com/EttusResearch/uhd&lt;br /&gt;
&lt;br /&gt;
Manual: http://files.ettus.com/manual/index.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Software Resources]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=2879</id>
		<title>Getting Started with RFNoC Development</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=2879"/>
				<updated>2016-07-12T20:47:07Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This application note gives a brief introduction into the steps required to start developing RFNoC blocks on your computer.&lt;br /&gt;
First, you need to make sure that you have all the tools required to do RFNoC development.&lt;br /&gt;
Then, we will set up a development sandbox in which you can do your RFNoC development.&lt;br /&gt;
Finally, we will run through the basic steps required to actually write custom RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
&lt;br /&gt;
For any of this to work, you need to make sure you have all the tools to do both software and FPGA development.&lt;br /&gt;
Confirm you have the following tools installed:&lt;br /&gt;
&lt;br /&gt;
* Xilinx Vivado. The specific version depends on the branch and state of the FPGA code and is very important. Make sure to install the correct version, you can look up the required version on the local version of the manual.&lt;br /&gt;
* Software build tools. If you can compile UHD from source, you have all the necessary components (If you're using PyBOMBS, this is definitely the case).&lt;br /&gt;
&lt;br /&gt;
Please make sure these tools are available before proceeding to the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a development environment =&lt;br /&gt;
&lt;br /&gt;
In the following, we will assume that GNU Radio is used as a helper tool for RFNoC development. Note that GNU Radio is by no means required to use or develop RFNoC, but it makes it a great deal easier to use a framework on top of RFNoC for visualization etc., and GNU Radio is freely available and well suited for the task. In order to get your development environment set up, you will need the following software packages:&lt;br /&gt;
&lt;br /&gt;
* UHD&lt;br /&gt;
* GNU Radio&lt;br /&gt;
* gr-ettus&lt;br /&gt;
&lt;br /&gt;
The cleanest way to set this up is to install everything into a dedicated directory. PyBOMBS is the simplest way to do this.&lt;br /&gt;
If you haven't already downloaded and installed PyBOMBS, you can do so by running the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ sudo pip install git+https://github.com/gnuradio/pybombs.git&lt;br /&gt;
    $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git&lt;br /&gt;
    $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git&lt;br /&gt;
&lt;br /&gt;
From here, the easiest way to set up a PyBOMBS development environment is to run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs prefix init ~/prefix/rfnoc -R rfnoc [-a alias]&lt;br /&gt;
&lt;br /&gt;
This will do the following:&lt;br /&gt;
&lt;br /&gt;
* Create a directory in ~/prefix/rfnoc (you can choose a different directory, of course)&lt;br /&gt;
* Clone UHD, FPGA, GNU Radio, and gr-ettus sources into that directory&lt;br /&gt;
* Compile and install all the software&lt;br /&gt;
&lt;br /&gt;
Then, you need to enable the prefix:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/prefix/rfnoc&lt;br /&gt;
    $ source ./setup_env.sh&lt;br /&gt;
&lt;br /&gt;
PyBOMBS is by no means a requirement for doing any of these steps. If you wish to install the software manually, follow the individual install notes for GNU Radio, UHD and gr-ettus and make sure they are reachable by linkers and compilers.&lt;br /&gt;
&lt;br /&gt;
To manually download the software, use these git clone commands, which will select the correct branches:&lt;br /&gt;
&lt;br /&gt;
    $ git clone --recursive -b rfnoc-radio-redo https://github.com/EttusResearch/uhd.git&lt;br /&gt;
    $ git clone -b maint https://github.com/gnuradio/gnuradio.git # master branch is also fine&lt;br /&gt;
    $ git clone -b radio-redo https://github.com/EttusResearch/gr-ettus.git&lt;br /&gt;
&lt;br /&gt;
If you already have UHD, GNU Radio and/or gr-ettus installed, it would be sufficient to checkout the branches mentioned and update them them (git pull). Thereafter, rebuild each of the repositories (first UHD, then GNU Radio, then gr-ettus).&lt;br /&gt;
&lt;br /&gt;
= RFNoC Framework =&lt;br /&gt;
&lt;br /&gt;
First, let's review briefly the RFNoC framework structure. The colourful image down here shows the basic structure of the RFNoC Stack.&lt;br /&gt;
&lt;br /&gt;
    [[File:rfnoc_stack.png|RFNoC Stack|600px|left|RFNoC Stack|link=https://kb.ettus.com/images/3/34/rfnoc_stack.png]]&lt;br /&gt;
&lt;br /&gt;
From the stack there are clearly 5 different elements which a RFNoC developer has to take into account when creating an out-of-tree block. How these elements interact with each other is explained in more detail at [2][3][4]. However, from here we could easily infer that there are, at least, 3 components our out-of-tree block needs to address:&lt;br /&gt;
&lt;br /&gt;
;1. Does it have a complete FPGA Integration?&lt;br /&gt;
:A Verilog file that describes the hardware implementation is what allows us to take advantage of the powerful FPGA that is being shipped with the current and next gen USRPs. For the current stage of development, the .v file has to not only implement the custom desired functionality but also a efficient interaction with the AXI bus and other FPGA blocks. In addition, the file has to be located in an specific location so that the building process can find it and use it as a resource for the IP generation.&lt;br /&gt;
&lt;br /&gt;
;2. Does it have a block declaration/control?&lt;br /&gt;
:Now that the design has the hardware implementation in Verilog, we would like to take the samples (or other data items) out of the USRP and receive them at our host. The block has to have a block declaration file which defines, at least, its inputs and outputs and the NoC-ID, which is the method of identification between the HW part of our design and the SW part. Now, we might add some control over the samples that are being streamed into the block, and for that we have two options that depend on the complexity of the control that we want to apply: if as developers we can add control using NoC-Script, that could easily be added into the XML file. But if we need more exhaustive control and multiple data stream treatment, we might want to add more coding into it. Block controllers can be added as C++ in the UHD host, carefully generating the headers and adding them in the correct include folder and in the same manner, develop our control and add it in the library folder.&lt;br /&gt;
&lt;br /&gt;
;3. Does it have GNU Radio integration?&lt;br /&gt;
: (Note: This is only required if using GNU Radio. Other frameworks might have similar requirements). GNU Radio is where the application runs, and where more control over the host is applied, by adding block-specific settings, such as sample rate or bandwidths. In addition, is where we have the our block ready to connect it to other several blocks (which can be also RFNoC blocks). That means that we are almost done with our design. In order to do so, we have to add a new XML file that allows us to bind our design with GNU Radio, and where we can edit the type on our I/Os, add variables for posterior signal processing, and a bunch of other design-specific parameters. In the same XML file we could add, just as we could have done at the block controllers, more block control by the means of NoC-Script. If we choose to do that, we could point our design to a &amp;quot;generic&amp;quot; implementation to control our GRC block. If we, otherwise, need even more control, we could choose to generate block code, that afterwards has to be located at gr-ettus: the headers as an include, the implementations as libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So, you may think that this is just normal protocol of the RFNoC OOT block generation method. But, in order to answer this three questions with your OOT design, you have to take care of correct FPGA interfacing, correct API instantiation and right includes and correct location where to put your files... while you also put effort to the development of your custom design! Here at Ettus, we think that you should put all your effort in your custom design and let the '''RFNoC modtool''' do the dirty work.&lt;br /&gt;
&lt;br /&gt;
= RFNoC Modtool =&lt;br /&gt;
&lt;br /&gt;
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 specific for the RFNoC modtool.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
With the use of this tool, the questions stated in the last section would result in something like:&lt;br /&gt;
;1. Does it have a complete FPGA Integration?&lt;br /&gt;
: If not, start your design in the pregenerated verilog file, which also provides most of the standard AXI interface already done.&lt;br /&gt;
&lt;br /&gt;
;2. Does it have a block declaration/control?&lt;br /&gt;
: Well, it has the files now, so write your functions if you need them. Don't even worry about modifying the files to add your NoC-ID: the tool will do that for you with the ID of your choice.&lt;br /&gt;
&lt;br /&gt;
;3 Does it have GNU Radio integration?&lt;br /&gt;
:It has it now. You just need to put additional control, in case you need it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Don't worry about relocating your files, they are where they need to be: '''in your custom location.''' The tool generates the files so that the whole building process takes into account your design regardless of the location of your OOT module in your machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tool Installation ==&lt;br /&gt;
&lt;br /&gt;
The tool is currently shipped within gr-ettus (radio-redo branch), so by installing gr-ettus, rfnocmodtool automatically becomes available.&lt;br /&gt;
&lt;br /&gt;
== Tool Utilization ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool help&lt;br /&gt;
    &lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
    Usage:&lt;br /&gt;
    rfnocmodtool &amp;lt;command&amp;gt; [options] -- Run &amp;lt;command&amp;gt; with the given options.&lt;br /&gt;
    rfnocmodtool help -- Show a list of commands.&lt;br /&gt;
    rfnocmodtool help &amp;lt;command&amp;gt; -- Shows the help for a given command. &lt;br /&gt;
    &lt;br /&gt;
    List of possible commands:&lt;br /&gt;
    &lt;br /&gt;
    Name      Aliases          Description&lt;br /&gt;
    =====================================================================&lt;br /&gt;
    disable   dis              Disable block (comments out CMake entries for files) &lt;br /&gt;
    info      getinfo,inf      Return information about a given module &lt;br /&gt;
    remove    rm,del           Remove block (delete files and remove Makefile entries) &lt;br /&gt;
    makexml   mx               Make XML file for GRC block bindings &lt;br /&gt;
    add       insert           Add block to the out-of-tree module. &lt;br /&gt;
    newmod    nm,create        Create a new out-of-tree module &lt;br /&gt;
    rename    mv               Rename a block in the out-of-tree module. &lt;br /&gt;
&lt;br /&gt;
If you have used the gr_modtool provided by GNURadio, you'll be familiar with this usage.&lt;br /&gt;
&lt;br /&gt;
== Creating an RFNoC OOT Module ==&lt;br /&gt;
&lt;br /&gt;
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 your prefixes source location (~/prefix/rfnoc/src) and type:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod [NAME OF THE MODULE]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod example&lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
    &lt;br /&gt;
    Creating out-of-tree module in ./rfnoc-example... Done.&lt;br /&gt;
    Use 'rfnocmodtool add' to add a new block to this currently empty module.&lt;br /&gt;
    &lt;br /&gt;
    $ ls rfnoc-example/&lt;br /&gt;
    $ apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig&lt;br /&gt;
&lt;br /&gt;
In contrast with gr_modtool, this includes a folder called 'rfnoc', which is where we put the UHD/FPGA files (more details below).&lt;br /&gt;
&lt;br /&gt;
=== Adding custom blocks ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodule add [NAME OF THE BLOCK]&lt;br /&gt;
&lt;br /&gt;
For demonstrative purposes, lets create a block named 'copy'. As for the new module, the tool will ask you for the name of the block if you not put it in the first line. There is a bunch of directives that you could pass to the tool, but if you run it without any of these directives you should expect the following interactive parsing output:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool add copy&lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
    &lt;br /&gt;
    RFNoC module name identified: example&lt;br /&gt;
    Block/code identifier: copy&lt;br /&gt;
    Enter valid argument list, including default arguments: &lt;br /&gt;
    Add Python QA code? [Y/n] &lt;br /&gt;
    Add C++ QA code? [y/N] &lt;br /&gt;
    Block NoC ID (Hexadecimal): FFFF&lt;br /&gt;
    Skip Block Controllers Generation? [y/N] &lt;br /&gt;
    Skip Block interface Generation? [y/N] &lt;br /&gt;
&lt;br /&gt;
The tool is going to ask you about a valid argument list, in case you have that clear at this stage of your design, and for the generation of QA codes which are, such as in the case of gr_modtool, optional. Right after that, specific RFNoC questions appear:&lt;br /&gt;
&lt;br /&gt;
* NoC ID: This ID is a Hexadecimal number which serves as identification between the hardware part and the software part of the design. It can be as long as 16 0-9 A-F digits. If you don't provide the NoC ID, it will be set to a random number.&lt;br /&gt;
* Block Controllers Generation: The block controllers are the C++ control that you can apply to the UHD-part of the design. In these files, you can add more control over this layer of your design. However, if you can manage to add the control you need over NoC-Script, you can omit the cpp/hpp block control files generation, reason why this is optional.&lt;br /&gt;
* Block Interface: Analogously to the block controllers, you may want to add more design specific functionality to your design at the GNURadio interface. To do that, you add the logic into the block-interface files. In the same manner, if your control can be managed by adding NoC-Script to your xml file, you can disregard the generation of files.&lt;br /&gt;
&lt;br /&gt;
Also, it is important to notice that if you don't intend to use the block controllers or you are not sure if you would, the presence of them in your design would do no harm. So, if in doubt, just add them. You may or may not add more functions inside them in a future stage of development of your OOT module. After finishing the parsing, the following files are going to be generated/edited:&lt;br /&gt;
&lt;br /&gt;
    Adding file 'lib/copy_impl.h'...&lt;br /&gt;
    Adding file 'lib/copy_impl.cc'...&lt;br /&gt;
    Adding file 'include/example/copy.h'...&lt;br /&gt;
    Adding file 'include/example/copy_block_ctrl.hpp'...&lt;br /&gt;
    Adding file 'lib/copy_block_ctrl_impl.cpp'...&lt;br /&gt;
    Editing swig/example_swig.i...&lt;br /&gt;
    Adding file 'python/qa_copy.py'...&lt;br /&gt;
    Editing python/CMakeLists.txt...&lt;br /&gt;
    Adding file 'grc/example_copy.xml'...&lt;br /&gt;
    Adding file 'rfnoc/blocks/copy.xml'...&lt;br /&gt;
    Adding file 'rfnoc/fpga-src/noc_block_copy.v'...&lt;br /&gt;
    rfnoc/testbenches/noc_block_copy_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_copy_tb/noc_block_copy_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_copy_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_copy_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
And, at this stage, you are all set up to start adding your custom functionalities.&lt;br /&gt;
&lt;br /&gt;
=== Building the FPGA image ===&lt;br /&gt;
&lt;br /&gt;
After you are done with your block development, you may want to generate the fpga image to actually run your implementation. A small script to help you do this is provided within the fpga repository that you installed in the [[Getting_Started_with_RFNoC_Development#Creating a development environment|Creating a development environment]] section.&lt;br /&gt;
&lt;br /&gt;
The script is called 'make.py', and it is located at {INSTALL_PREFIX}/fpga/usrp3/tools/scripts. You can run the help by typing:&lt;br /&gt;
&lt;br /&gt;
    make.py --help&lt;br /&gt;
    &lt;br /&gt;
    Generate the NoC block instantiation file&lt;br /&gt;
    &lt;br /&gt;
    positional arguments:&lt;br /&gt;
      blocks                List block names to instantiate.&lt;br /&gt;
    &lt;br /&gt;
    optional arguments:&lt;br /&gt;
      -h, --help            show this help message and exit&lt;br /&gt;
      -I INCLUDE_DIR, --include-dir INCLUDE_DIR&lt;br /&gt;
                            Path directory of the RFNoC Out-of-Tree module fpga srcs&lt;br /&gt;
                            {OOT_moddir}/rfnoc/fpga-src&lt;br /&gt;
      -m MAX_NUM_BLOCKS, --max-num-blocks MAX_NUM_BLOCKS&lt;br /&gt;
                            Maximum number of blocks (Max. Allowed for x310|x300:&lt;br /&gt;
                            11, for e300:6)&lt;br /&gt;
      --fill-with-fifos     If the number of blocks provided was smaller than the&lt;br /&gt;
                            max number, fill the rest with FIFOs&lt;br /&gt;
      -o OUTFILE, --outfile OUTFILE&lt;br /&gt;
                            Output /path/filename - By running this directive, you&lt;br /&gt;
                            won't build your IP&lt;br /&gt;
      -d DEVICE, --device DEVICE&lt;br /&gt;
                            Device to be programmed [x300, x310, e310]&lt;br /&gt;
      -t TARGET, --target TARGET&lt;br /&gt;
                            Build target - image type [X3X0_RFNOC_HG,&lt;br /&gt;
                            X3X0_RFNOC_XG, E310_RFNOC_sg3...]&lt;br /&gt;
&lt;br /&gt;
There are also a good amount of arguments that you can pass to this script. For example, let's create an FPGA image using the 'copy' block we created earlier:&lt;br /&gt;
&lt;br /&gt;
    make.py fft copy fft window -I {OOT_moddir/rfnoc-example}/rfnoc/fpga-src/ -d x310 -t X310_RFNOC_HG -m 5 --fill-with-fifos [-o rfnoc_inst.v]&lt;br /&gt;
&lt;br /&gt;
We're also adding an FFT and Window block, which are already in the script's path (they ship with the the Ettus FPGA code).&lt;br /&gt;
&lt;br /&gt;
Here's how the script is used:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Blocks:'''  The first arguments are the names of blocks that you want to have in your image separated by a space. They can be from the blocks that you have from your OOT module or from the ones that are provided from Ettus, or a combination of those as well. There are two things to keep in mind while listing blocks here:&lt;br /&gt;
** So far, there is a restriction on the amount of blocks that you can add into the FPGA image: 10 for the X3X0 devices, and 14 for the E3X0 (if space permits).&lt;br /&gt;
&lt;br /&gt;
:Although the amount of blocks is constantly increasing (thanks to the constant development and contribution of the community), a brief overview of the blocks from which you can choose can be found at [7].&lt;br /&gt;
&lt;br /&gt;
* '''Include_dir: ''' To add your custom block to the FPGA Image, you just have to tell the Vivado builder where to find it. Here, with the -I directive you give the /Path/to/your/fpga-src, which is inside the rfnoc/ folder of your RFNoC OOT module. It is important to notice that inside this folder there is also a file called 'Makefile.srcs', in which you can find the path of your OOT and a list of all the OOT blocks that you have developed in your custom module. This is an autogenerated file, which is populated everytime that you add a block. Manually modifying this block may result in inconveniences.&lt;br /&gt;
&lt;br /&gt;
* '''Device''': Generation-3 USRP devices support RFNoC, but the nextGen USRPs will support RFNoC as well. Having this in mind, with this -d directive you tell the script in which device you intend to use the image. By omitting this directive, the script will choose the X310 device as default. In the example, however, we chose explicitly the -d x310&lt;br /&gt;
&lt;br /&gt;
* '''Target''': there are several build options, and you can choose the one that suits better with your design with the -t directive. Detailed information about the build targets can be found at the build instructions for USRP3, found under [6]. If -t is not given, a default target will be chosen for the given device. In the example, the -t  X310_RFNOC_HG builds our design intended for the USRP X310 device, with 1GigE on SFP+ Port0, 10Gig on SFP+ Port1, and a DRAM TX FIFO.&lt;br /&gt;
&lt;br /&gt;
* '''amount of blocks:''' if your RFNoC image doesn't really have the need of several RFNoC blocks, you can set the number of blocks to be inserted in the FPGA by running the -m directive. In the example command, 5 blocks are being added to the .bit file.&lt;br /&gt;
&lt;br /&gt;
* '''Fill with FIFOs: ''' You can list a number of blocks smaller than the maximum allowed (or than the number fixed with -m). In addition, you can fill the rest of free slots with FIFO blocks. In the example, one FIFO block is going to be added to the FPGA image.&lt;br /&gt;
&lt;br /&gt;
* '''Output file: ''' the purpose of the whole 'make.py' script is to autogenerate an instantiation file and populate the source files needed for Vivado to build the FPGA satisfactorily. But sometimes you may only want to see the effect of adding your OOT module on the fpga/ directory, or how the instantiation file would look like. With the -o directive, you generate the instantiation file and save it at the desired path with the given name. In the example, it is saved at the tmp/ directory with the name verilog_CE.v. Keep in mind that if you don't give the -o directory, the rfnoc_ce_auto_inst_x3x0.v file will be overwritten and the FPGA image build process will start automatically.&lt;br /&gt;
&lt;br /&gt;
''The FPGA image building process may take over an hour.''&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' [Environment setup] - The script will also set up your Vivado environment by automatically running the 'setupenv.sh' located at /top/{device}. So you don't have to run this script before running the make.py. In addition, keep in mind that the setupenv.sh assumes that your Vivado is installed in the default location /opt/Xilinx/Vivado. If you chose a different installation directory, you may want to modify the setupenv.sh script.&lt;br /&gt;
&lt;br /&gt;
=== Creating and running testbenches ===&lt;br /&gt;
&lt;br /&gt;
In order to make the iteration process much quicker, we encourage you to design test benches for each of your RFNoC blocks before implementing them into the FPGA image. By doing so, you can detect bugs or flaws in a relatively early stage of your design. RFNoC modtool provides the structure for the testbenches for each of the out-of-tree blocks that you add with the &amp;quot;rfnocmodtool add&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
You can see that in the [[Getting_Started_with_RFNoC_Development#Adding custom blocks|Adding custom blocks]] section, the last files generated are:&lt;br /&gt;
&lt;br /&gt;
   rfnoc/testbenches/noc_block_copy_tb folder created&lt;br /&gt;
   Adding file 'rfnoc/testbenches/noc_block_copy_tb/noc_block_copy_tb.sv'...&lt;br /&gt;
   Adding file 'rfnoc/testbenches/noc_block_copy_tb/Makefile'...&lt;br /&gt;
   Adding file 'rfnoc/testbenches/noc_block_copy_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
The ''noc_block_copy_tb'' is a folder generated to contain all the files related to the test bench of the ''copy'' block. Each time that you create a new OOT block, a new folder will be generated as well. Inside of this folder, three files are located:&lt;br /&gt;
&lt;br /&gt;
* '''CMakeLists.txt:''' this is an empty file used, so far, only to increase the scope of the compilers.&lt;br /&gt;
* '''noc_block_copy_tb.sv: ''' this is a ''System Verilog'' file, in which your custom tests are to be located. This is the '''only''' file that you have to modify according with your design.&lt;br /&gt;
* '''Makefile: ''' This file determinates the directives that run the simulation.&lt;br /&gt;
&lt;br /&gt;
This files require the Vivado tools to work, so you have to have this tool installed (preferably at the default location,'' /opt/Xilinx''). Also, you would have to set up the Vivado environmental variables. Until now, you had to do this by hand, which is somewhat cumbersome. Now, with the use of the structure given by RFNoC modtool, the only thing that you have to do is build your own OOT module, which you have to do anyways! The builders will look up for the default locations of Vivado and the fpga repository and will set up your test benches so that they are ready to use, and you can fully focus on your design. To do so, simply create a build directory:&lt;br /&gt;
&lt;br /&gt;
    mkdir build &amp;amp;&amp;amp; cd build/&lt;br /&gt;
&lt;br /&gt;
and then run cmake. If you are using PyBOMBS, cmake will detect automatically the location of the ''fpga'' repository. If you are installing by source, you'd have to provide the location where you installed it.&lt;br /&gt;
&lt;br /&gt;
    cmake [-DUHD_FPGA_DIR=/PATH/TO/FPGA/REPOSITORY]&lt;br /&gt;
&lt;br /&gt;
Then, and only for the first time, you have to run the following command:&lt;br /&gt;
&lt;br /&gt;
    make test_tb&lt;br /&gt;
&lt;br /&gt;
This command will modify your files by setting the correct path to the simulation tools. From now on, every time that you add a new block, this command will be run automatically.&lt;br /&gt;
&lt;br /&gt;
Now you are ready to run the test bench! you don't have to go to the testbench directory, you can run it right there at the OOT main 'build/' directory! just run ''make noc_block_[name_of_your_block]_tb'', which in this example case is:&lt;br /&gt;
&lt;br /&gt;
    make noc_block_copy_tb&lt;br /&gt;
&lt;br /&gt;
And the simulation will start. With every block that you create, also a make directive will be available for you to run the simulation right there at the main build directory.&lt;br /&gt;
&lt;br /&gt;
= Other Resources =&lt;br /&gt;
[1] [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules GNURadio OutOfTree Modules tutorial]&lt;br /&gt;
&lt;br /&gt;
[2] [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Intro.pdf Introduction to RFNoC]&lt;br /&gt;
&lt;br /&gt;
[3] [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_FPGA.pdf RFNoC Deep Dive: FPGA]&lt;br /&gt;
&lt;br /&gt;
[4] [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Host.pdf RFNoC Deep Dive: Host side]&lt;br /&gt;
&lt;br /&gt;
[5] [https://www.youtube.com/watch?v=8cPd3t88djE Video: RFNoC presented at Wireless @ Virginia Tech, 2015] Explaining the slides of [2][3][4] (In that order)&lt;br /&gt;
&lt;br /&gt;
[6] [http://files.ettus.com/manual/md_usrp3_build_instructions.html USRP3 build instructions]&lt;br /&gt;
&lt;br /&gt;
[7] [https://kb.ettus.com/RFNoC_Getting_Started_Guides Knowledge base guide: RFNoC getting started]&lt;br /&gt;
&lt;br /&gt;
[[Category:Software Resources]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=2876</id>
		<title>Getting Started with RFNoC Development</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=2876"/>
				<updated>2016-07-06T23:35:36Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NOT FINISHED DONT READ! =&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This application note gives a brief introduction into the steps required to start developing RFNoC blocks on your computer.&lt;br /&gt;
First, you need to make sure that you have all the tools required to do RFNoC development.&lt;br /&gt;
Then, we will set up a development sandbox in which you can do your RFNoC development.&lt;br /&gt;
Finally, we will run through the basic steps required to actually write custom RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
For any of this to work, you need to make sure you have all the tools to do both software and FPGA development.&lt;br /&gt;
Confirm you have the following tools installed:&lt;br /&gt;
&lt;br /&gt;
* Xilinx Vivado. The specific version depends on the branch and state of the FPGA code and is very important. Make sure to install the correct version.&lt;br /&gt;
* Software build tools. If you can compile UHD from source, you have all the necessary components (If you're using PyBOMBS&lt;br /&gt;
&lt;br /&gt;
Please make sure these tools are available before proceeding to the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a development environment =&lt;br /&gt;
&lt;br /&gt;
In the following, we will assume that GNU Radio is used as a helper tool for RFNoC development. Note that GNU Radio is by no means required to use or develop RFNoC, but it makes it a great deal easier. So in order to get your development environment set up, you will need the following software packages:&lt;br /&gt;
&lt;br /&gt;
* UHD&lt;br /&gt;
* GNU Radio&lt;br /&gt;
* gr-ettus&lt;br /&gt;
&lt;br /&gt;
The cleanest way to set this up is to install everything into a dedicated directory. PyBOMBS is the simplest way to do this.&lt;br /&gt;
If you haven't already downloaded and installed PyBOMBS, you can do so by running the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ sudo pip install git+https://github.com/gnuradio/pybombs.git&lt;br /&gt;
    $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git&lt;br /&gt;
    $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git&lt;br /&gt;
&lt;br /&gt;
From here, the easiest way to set up a PyBOMBS development environment is to run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs prefix init ~/prefix/rfnoc -R rfnoc [-a alias]&lt;br /&gt;
&lt;br /&gt;
This will do the following:&lt;br /&gt;
&lt;br /&gt;
* Create a directory in ~/prefix/rfnoc&lt;br /&gt;
* Clone UHD, FPGA, GNU Radio, and gr-ettus sources into that directory&lt;br /&gt;
* Compile and install all the software&lt;br /&gt;
&lt;br /&gt;
Then, enable the prefix:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/prefix/rfnoc&lt;br /&gt;
    $ source ./setup_env.sh&lt;br /&gt;
&lt;br /&gt;
PyBOMBS is by no means required to do any of these steps. If you wish to install the software manually, follow the individual install notes for GNU Radio, UHD and gr-ettus and make sure they are reachable by linkers and compilers.&lt;br /&gt;
&lt;br /&gt;
To manually download the software, use these git clone commands, which will select the correct branches:&lt;br /&gt;
&lt;br /&gt;
    $ git clone --recursive -b rfnoc-radio-redo https://github.com/EttusResearch/uhd.git&lt;br /&gt;
    $ git clone -b maint https://github.com/gnuradio/gnuradio.git # master branch is also fine&lt;br /&gt;
    $ git clone -b radio-redo https://github.com/EttusResearch/gr-ettus.git&lt;br /&gt;
&lt;br /&gt;
If you have already UHD, GNU Radio 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).&lt;br /&gt;
&lt;br /&gt;
= RFNoC Framework =&lt;br /&gt;
&lt;br /&gt;
First, let's review briefly the RFNoC framework structure. The colourful image down here shows the basic structure of the RFNoC Stack.&lt;br /&gt;
&lt;br /&gt;
    [[File:rfnoc_stack.png|RFNoC Stack|600px|left|RFNoC Stack|link=https://kb.ettus.com/images/3/34/rfnoc_stack.png]]&lt;br /&gt;
&lt;br /&gt;
From the stack there are clearly 5 different elements which a RFNoC developer has to take into account when creating an out-of-tree block. How these elements interact with each other is explained in more detail at [2][3][4]. However, from here we could easily infer that there are, at least, 3 questions that our out-of-tree design had to answer until this day:&lt;br /&gt;
&lt;br /&gt;
;1. Does it have a complete FPGA Integration?&lt;br /&gt;
:A verilog file that describes the hardware implementation is what allows us to take advantage of the powerful FPGA that is being shipped with the current and next gen USRPs. For the current stage of development, the .v file has to not only implement the custom desired functionality but also a efficient interaction with the AXI bus and other FPGA blocks. In addition, the file has to be located in an specific location so that the building process can find it and use it as a resource for the IP generation.&lt;br /&gt;
&lt;br /&gt;
;2. Does it have a block declaration/control?&lt;br /&gt;
:Now that the design has the hardware implementation in Verilog, we would like to take the samples (or other data items) out of the USRP and receive them at our host. The block has to have a clear declaration which defines, at least, its inputs and outputs (which are self explanatory) and the NoC-ID, which is the method of identification between the HW part of our design and the SW part. Now, we might add some control over the samples that are being streamed into the block, and for that we have two options that depend on the complexity of the control that we want to apply: if as developers we can add control using NoC-Script, that could easily be added into the XML file. But if we need more exhaustive control and multiple data stream treatment, we might want to add more coding into it. Block controllers can be added as C++ in the UHD host, carefully generating the headers and adding them in the correct include folder and in the same manner, develop our control and add it in the library folder.&lt;br /&gt;
&lt;br /&gt;
;3. Does it have GNURadio integration?&lt;br /&gt;
: (Note: This is only required if using GNU Radio. Other frameworks might have similar requirements). GNURadio is where the application runs, and where more control over the host is applied, by adding block-specific settings, such as sample rate or bandwidths. In addition, is where we have the our block ready to connect it to other several blocks (which can be also RFNoC blocks). That means that we are almost done with our design. In order to do so, we have to add a new XML file that allows us to bind our design with GNURadio, and where we can edit the type on our I/Os, add variables for posterior signal processing, and a bunch of other design-specific parameters. In the same XML file we could add, just as we could have done at the block controllers, more block control by the means of NoC-Script. If we choose to do that, we could point our design to a &amp;quot;generic&amp;quot; implementation to control our GRC block. If we, otherwise, need even more control, we could choose to generate block code, that afterwards has to be located at gr-ettus: the headers as an include, the implementations as libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So, you may think that this is just normal protocol of the RFNoC OOT block generation method. But, in order to answer this three questions with your OOT design, you have to take care of correct FPGA interfacing, correct API instantiation and right includes and correct location where to put your files... while you also put effort to the development of your custom design! Here at Ettus, we think that you should put all your effort in your custom design and let the '''RFNoC modtool''' do the dirty work.&lt;br /&gt;
&lt;br /&gt;
= RFNoC Modtool =&lt;br /&gt;
&lt;br /&gt;
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 specific for the RFNoC modtool.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
With the use of this tool, the questions stated in the last section would result in something like:&lt;br /&gt;
;1. Does it have a complete FPGA Integration?&lt;br /&gt;
: If not, start your design in the pregenerated verilog file, which also provides most of the standard AXI interface already done.&lt;br /&gt;
&lt;br /&gt;
;2. Does it have a block declaration/control?&lt;br /&gt;
: Well, it has the files now, so write your functions if you need them. Don't even worry about modifying the files to add your NoC-ID: the tool will do that for you with the ID of your choice.&lt;br /&gt;
&lt;br /&gt;
;3 Does it have GNURadio integration?&lt;br /&gt;
:It has it now. You just need to put additional control, in case you need it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Don't worry about relocating your files, they are where they need to be: '''in your custom location.''' The tool generates the files so that the whole building process takes into account your design regardless of the location of your OOT module in your machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tool Installation ==&lt;br /&gt;
&lt;br /&gt;
The tool is currently shipped within gr-ettus (radio-redo branch), so by installing gr-ettus, rfnocmodtool automatically becomes available.&lt;br /&gt;
&lt;br /&gt;
== Tool Utilization ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool help&lt;br /&gt;
    &lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
    Usage:&lt;br /&gt;
    rfnocmodtool &amp;lt;command&amp;gt; [options] -- Run &amp;lt;command&amp;gt; with the given options.&lt;br /&gt;
    rfnocmodtool help -- Show a list of commands.&lt;br /&gt;
    rfnocmodtool help &amp;lt;command&amp;gt; -- Shows the help for a given command. &lt;br /&gt;
    &lt;br /&gt;
    List of possible commands:&lt;br /&gt;
    &lt;br /&gt;
    Name      Aliases          Description&lt;br /&gt;
    =====================================================================&lt;br /&gt;
    disable   dis              Disable block (comments out CMake entries for files) &lt;br /&gt;
    info      getinfo,inf      Return information about a given module &lt;br /&gt;
    remove    rm,del           Remove block (delete files and remove Makefile entries) &lt;br /&gt;
    makexml   mx               Make XML file for GRC block bindings &lt;br /&gt;
    add       insert           Add block to the out-of-tree module. &lt;br /&gt;
    newmod    nm,create        Create a new out-of-tree module &lt;br /&gt;
    rename    mv               Rename a block in the out-of-tree module. &lt;br /&gt;
&lt;br /&gt;
If you have used the gr_modtool provided by GNURadio, you'll be familiar with this usage.&lt;br /&gt;
&lt;br /&gt;
== Creating an RFNoC OOT Module ==&lt;br /&gt;
&lt;br /&gt;
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 your prefixes source location (~/prefix/rfnoc/src) and type:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod [NAME OF THE MODULE]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod example&lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
    &lt;br /&gt;
    Creating out-of-tree module in ./rfnoc-example... Done.&lt;br /&gt;
    Use 'rfnocmodtool add' to add a new block to this currently empty module.&lt;br /&gt;
    &lt;br /&gt;
    $ ls rfnoc-example/&lt;br /&gt;
    $ apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig&lt;br /&gt;
&lt;br /&gt;
In contrast with gr_modtool, this includes a folder called 'rfnoc', which is where we put the UHD/FPGA files (more details below).&lt;br /&gt;
&lt;br /&gt;
=== Adding custom blocks ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodule add [NAME OF THE BLOCK]&lt;br /&gt;
&lt;br /&gt;
For demonstrative purposes, lets create a block named 'copy'. As for the new module, the tool will ask you for the name of the block if you not put it in the first line. There is a bunch of directives that you could pass to the tool, but if you run it without any of these directives you should expect the following interactive parsing output:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool add copy&lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
    &lt;br /&gt;
    RFNoC module name identified: example&lt;br /&gt;
    Block/code identifier: copy&lt;br /&gt;
    Enter valid argument list, including default arguments: &lt;br /&gt;
    Add Python QA code? [Y/n] &lt;br /&gt;
    Add C++ QA code? [y/N] &lt;br /&gt;
    Block NoC ID (Hexadecimal): FFFF&lt;br /&gt;
    Skip Block Controllers Generation? [y/N] &lt;br /&gt;
    Skip Block interface Generation? [y/N] &lt;br /&gt;
&lt;br /&gt;
The tool is going to ask you about a valid argument list, in case you have that clear at this stage of your design, and for the generation of QA codes which are, such as in the case of gr_modtool, optional. Right after that, specific RFNoC questions appear:&lt;br /&gt;
&lt;br /&gt;
* NoC ID: This ID is a Hexadecimal number which serves as identification between the hardware part and the software part of the design. It can be as long as 16 0-9 A-F digits. If you don't provide the NoC ID, it will be set to a random number.&lt;br /&gt;
* Block Controllers Generation: The block controllers are the C++ control that you can apply to the UHD-part of the design. In these files, you can add more control over this layer of your design. However, if you can manage to add the control you need over NoC-Script, you can omit the cpp/hpp block control files generation, reason why this is optional.&lt;br /&gt;
* Block Interface: Analogously to the block controllers, you may want to add more design specific functionality to your design at the GNURadio interface. To do that, you add the logic into the block-interface files. In the same manner, if your control can be managed by adding NoC-Script to your xml file, you can disregard the generation of files.&lt;br /&gt;
&lt;br /&gt;
Also, it is important to notice that if you don't intend to use the block controllers or you are not sure if you would, the presence of them in your design would do no harm. So, if in doubt, just add them. You may or may not add more functions inside them in a future stage of development of your OOT module. After finishing the parsing, the following files are going to be generated/edited:&lt;br /&gt;
&lt;br /&gt;
    Adding file 'lib/copy_impl.h'...&lt;br /&gt;
    Adding file 'lib/copy_impl.cc'...&lt;br /&gt;
    Adding file 'include/example/copy.h'...&lt;br /&gt;
    Adding file 'include/example/copy_block_ctrl.hpp'...&lt;br /&gt;
    Adding file 'lib/copy_block_ctrl_impl.cpp'...&lt;br /&gt;
    Editing swig/example_swig.i...&lt;br /&gt;
    Adding file 'python/qa_copy.py'...&lt;br /&gt;
    Editing python/CMakeLists.txt...&lt;br /&gt;
    Adding file 'grc/example_copy.xml'...&lt;br /&gt;
    Adding file 'rfnoc/blocks/copy.xml'...&lt;br /&gt;
    Adding file 'rfnoc/fpga-src/noc_block_copy.v'...&lt;br /&gt;
    rfnoc/testbenches/noc_block_copy_tb folder created&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_copy_tb/noc_block_copy_tb.sv'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_copy_tb/Makefile'...&lt;br /&gt;
    Adding file 'rfnoc/testbenches/noc_block_copy_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
And, at this stage, you are all set up to start adding your custom functionalities.&lt;br /&gt;
&lt;br /&gt;
=== Building the FPGA image ===&lt;br /&gt;
&lt;br /&gt;
After you are done with your block development, you may want to generate the fpga image to actually run your implementation. A small script to help you do this is provided within the fpga repository that you installed in the [[Getting_Started_with_RFNoC_Development#Creating a development environment|Creating a development environment]] section.&lt;br /&gt;
&lt;br /&gt;
The script is called 'make.py', and it is located at {INSTALL_PREFIX}/fpga/usrp3/tools/scripts. You can run the help by typing:&lt;br /&gt;
&lt;br /&gt;
    make.py --help&lt;br /&gt;
    &lt;br /&gt;
    Generate the NoC block instantiation file&lt;br /&gt;
    &lt;br /&gt;
    positional arguments:&lt;br /&gt;
      blocks                List block names to instantiate.&lt;br /&gt;
    &lt;br /&gt;
    optional arguments:&lt;br /&gt;
      -h, --help            show this help message and exit&lt;br /&gt;
      -I INCLUDE_DIR, --include-dir INCLUDE_DIR&lt;br /&gt;
                            Path directory of the RFNoC Out-of-Tree module fpga srcs&lt;br /&gt;
                            {OOT_moddir}/rfnoc/fpga-src&lt;br /&gt;
      -m MAX_NUM_BLOCKS, --max-num-blocks MAX_NUM_BLOCKS&lt;br /&gt;
                            Maximum number of blocks (Max. Allowed for x310|x300:&lt;br /&gt;
                            11, for e300:6)&lt;br /&gt;
      --fill-with-fifos     If the number of blocks provided was smaller than the&lt;br /&gt;
                            max number, fill the rest with FIFOs&lt;br /&gt;
      -o OUTFILE, --outfile OUTFILE&lt;br /&gt;
                            Output /path/filename - By running this directive, you&lt;br /&gt;
                            won't build your IP&lt;br /&gt;
      -d DEVICE, --device DEVICE&lt;br /&gt;
                            Device to be programmed [x300, x310, e310]&lt;br /&gt;
      -t TARGET, --target TARGET&lt;br /&gt;
                            Build target - image type [X3X0_RFNOC_HG,&lt;br /&gt;
                            X3X0_RFNOC_XG, E310_RFNOC_sg3...]&lt;br /&gt;
&lt;br /&gt;
As it can be seen, there is also a good amount of arguments that you can pass to this script. Let's analyse an example of this: suppose that the OOT module that we created on the last step is ready to be burned into the FPGA, and for that we are going to use this command:&lt;br /&gt;
&lt;br /&gt;
    make.py fft copy fft window -I {OOT_moddir/rfnoc-example}/rfnoc/fpga-src/ -d x310 -t X310_RFNOC_HG -m 5 --fill-with-fifos -o ~/tmp/verilog_CE.v&lt;br /&gt;
&lt;br /&gt;
and this command already gives us a lot of insight on how to use this script.&lt;br /&gt;
&lt;br /&gt;
* '''Blocks:''' right after the script name you list the blocks that you want to have in your image separated by a space. They can be from the blocks that you have from your OOT module or from the ones that are provided from Ettus, or a combination of those as well. There are two things to keep in mind while listing blocks here:&lt;br /&gt;
** So far, there is a restriction on the amount of blocks that you can add into the FPGA image: 11 for the X3X0 devices, and 6 for the E3X0. &lt;br /&gt;
** The FPGAs provided in the USRPs are powerful and have rather high capacity. However, if the overall logic connections needed to implement the blocks that you listed is rather huge, then your FPGA may run out space and your synthesis may fail. For the example, we list two fft blocks and one window block (which are blocks provided with the installation) and one copy block (which is part of our custom design).&lt;br /&gt;
&lt;br /&gt;
:Although the amount of blocks is constantly increasing (thanks to the constant development and contribution of the community), a brief overview of the blocks from which you can choose can be found at [7].&lt;br /&gt;
&lt;br /&gt;
* '''Include_dir: '''Sure, you can add your custom block to the FPGA Image, you just have to tell the Vivado builder where to find it. Here, with the -I directive you give the /Path/to/your/fpga-src, which is inside the rfnoc/ folder of your RFNoC OOT module. It is important to notice that inside this folder there is also a file called 'Makefile.srcs', in which you can find the path of your OOT and a list of all the OOT blocks that you have developed in your custom module. This is an autogenerated file, which is populated everytime that you add a block. Manually modifying this block may result in inconveniences.&lt;br /&gt;
&lt;br /&gt;
* '''Device''': nowadays the USRP3 devices support RFNoC, but the nextGen USRPs will support RFNoC as well. Having this in mind, with this -d directive you tell the script in which device you intend to use the image. By omitting this directive, the script will choose the X310 device as default. In the example, however, we chose explicitly the -d x310&lt;br /&gt;
&lt;br /&gt;
* '''Target''': there are several build options, and you can choose the one that suits better with your design with the -t directive. Detailed information about the build targets can be found at the build instructions for USRP3, found under [6]. If not -t is given, a default target will be chosen for the given device. In the example, the -t  X310_RFNOC_HG builds our design intended for the USRP X310 device, with 1GigE on SFP+ Port0, 10Gig on SFP+ Port1. DRAM TX FIFO.&lt;br /&gt;
&lt;br /&gt;
* '''amount of blocks:''' if your RFNoC image doesn't really have the need of several RFNoC blocks, you can set the number of blocks to be inserted in the FPGA by running the -m directive. In the example command, 5 blocks are being added to the .bit.&lt;br /&gt;
&lt;br /&gt;
* '''Fill with FIFOs: ''' You can list a number of blocks smaller than the maximum allowed (or than the number fixed with -m). In addition, you can fill the rest of free slots with FIFO blocks. In the example, one FIFO block is going to be added to the FPGA image.&lt;br /&gt;
&lt;br /&gt;
* '''Output file: ''' the purpose of the whole 'make.py' script is to autogenerate an instantiation file and populate the source files needed for Vivado to build the FPGA satisfactorily. But sometimes you may only want to see the effect of adding your OOT module on the fpga/ directory, or how the instantiation file would look like. With the -o directive, you generate the instantiation file and save it at the desired path with the given name. In the example, it is saved at the tmp/ directory with the name verilog_CE.v. Keep in mind that if you don't give the -o directory, the rfnoc_ce_auto_inst_x3x0.v file will be overwritten and the FPGA image build process will start automatically.&lt;br /&gt;
&lt;br /&gt;
''The FPGA image building process may take over an hour.''&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' [Environment setup] - The script will also set up your Vivado environment by automatically running the 'setupenv.sh' located at /top/{device}. So you don't have to run this script before running the make.py. In addition, keep in mind that the setupenv.sh assumes that your Vivado is installed in the default location /opt/Xilinx/Vivado. If you chose a different installation directory, you may want to modify the setupenv.sh script.&lt;br /&gt;
&lt;br /&gt;
=== Creating and running testbenches ===&lt;br /&gt;
&lt;br /&gt;
In order to make the iteration process much quicker, we encourage you to design test benches for each of your RFNoC blocks before implementing them into the FPGA image. By doing so, you can detect bugs or flaws in a relatively early stage of your design. RFNoC modtool provides the structure for the testbenches for each of the out-of-tree blocks that you add with the &amp;quot;rfnocmodtool add&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
You can see that in the [[Getting_Started_with_RFNoC_Development#Adding custom blocks|Adding custom blocks]] section, the last files generated are:&lt;br /&gt;
&lt;br /&gt;
   rfnoc/testbenches/noc_block_copy_tb folder created&lt;br /&gt;
   Adding file 'rfnoc/testbenches/noc_block_copy_tb/noc_block_copy_tb.sv'...&lt;br /&gt;
   Adding file 'rfnoc/testbenches/noc_block_copy_tb/Makefile'...&lt;br /&gt;
   Adding file 'rfnoc/testbenches/noc_block_copy_tb/CMakeLists.txt'...&lt;br /&gt;
&lt;br /&gt;
The ''noc_block_copy_tb'' is a folder generated to contain all the files related to the test bench of the ''copy'' block. Each time that you create a new OOT block, a new folder will be generated as well. Inside of this folder, three files are located:&lt;br /&gt;
&lt;br /&gt;
* '''CMakeLists.txt:''' this is an empty file used, so far, only to increase the scope of the compilers.&lt;br /&gt;
* '''noc_block_copy_tb.sv: ''' this is a ''System Verilog'' file, in which your custom tests are to be located. This is the '''only''' file that you have to modify according with your design.&lt;br /&gt;
* '''Makefile: ''' This file determinates the directives that run the simulation.&lt;br /&gt;
&lt;br /&gt;
This files require the Vivado tools to work, so you have to have this tool installed (preferably at the default location,'' /opt/Xilinx''). Also, you would have to set up the Vivado environmental variables. Until now, you had to do this by hand, which is somewhat cumbersome. Now, with the use of the structure given by RFNoC modtool, the only thing that you have to do is build your own OOT module, which you have to do anyways! The builders will look up for the default locations of Vivado and the fpga repository and will set up your test benches so that they are ready to use, and you can fully focus on your design. To do so, simply create a build directory:&lt;br /&gt;
&lt;br /&gt;
    mkdir build &amp;amp;&amp;amp; cd build/&lt;br /&gt;
&lt;br /&gt;
and then run cmake. If you are using PyBOMBS, cmake will detect automatically the location of the ''fpga'' repository. If you are installing by source, you'd have to provide the location where you installed it.&lt;br /&gt;
&lt;br /&gt;
    cmake [-DUHD_FPGA_DIR=/PATH/TO/FPGA/REPOSITORY]&lt;br /&gt;
&lt;br /&gt;
Then, and only for one time, you have to run the following command:&lt;br /&gt;
&lt;br /&gt;
    make test_tb&lt;br /&gt;
&lt;br /&gt;
This command will modify your files by setting the correct path to the simulation tools. From now on, every time that you add a new block, this command will be run automatically.&lt;br /&gt;
&lt;br /&gt;
Now you are ready to run the test bench! you don't have to go to the testbench directory, you can run it right there at the OOT main 'build/' directory! just run ''make noc_block_[name_of_your_block]_tb'', which in this example case is:&lt;br /&gt;
&lt;br /&gt;
    make noc_block_copy_tb&lt;br /&gt;
&lt;br /&gt;
And the simulation will start. With every block that you create, also a make directive will be available for you to run the simulation right there at the main build directory.&lt;br /&gt;
&lt;br /&gt;
= Other Resources =&lt;br /&gt;
[1] [http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules GNURadio OutOfTree Modules tutorial]&lt;br /&gt;
&lt;br /&gt;
[2] [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Intro.pdf Introduction to RFNoC]&lt;br /&gt;
&lt;br /&gt;
[3] [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_FPGA.pdf RFNoC Deep Dive: FPGA]&lt;br /&gt;
&lt;br /&gt;
[4] [https://www.ettus.com/content/files/RFNoC_Wireless_at_VT_Host.pdf RFNoC Deep Dive: Host side]&lt;br /&gt;
&lt;br /&gt;
[5] [https://www.youtube.com/watch?v=8cPd3t88djE Video: RFNoC presented at Wireless @ Virginia Tech, 2015] Explaining the slides of [2][3][4] (In that order)&lt;br /&gt;
&lt;br /&gt;
[6] [http://files.ettus.com/manual/md_usrp3_build_instructions.html USRP3 build instructions]&lt;br /&gt;
&lt;br /&gt;
[7] [https://kb.ettus.com/RFNoC_Getting_Started_Guides Knowledge base guide: RFNoC getting started]&lt;br /&gt;
&lt;br /&gt;
[[Category:Software Resources]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Software_Development_on_the_E310_and_E312&amp;diff=2856</id>
		<title>Software Development on the E310 and E312</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Software_Development_on_the_E310_and_E312&amp;diff=2856"/>
				<updated>2016-06-23T22:53:01Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Application Note Number==&lt;br /&gt;
'''AN-311'''&lt;br /&gt;
&lt;br /&gt;
==Revision History==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date&lt;br /&gt;
!Author&lt;br /&gt;
!Details&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| 2016-05-24   &lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Martin Braun&amp;lt;br&amp;gt; Nicolas Cuervo&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;| Initial creation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This application note will cover the software development process on the USRP E310 and E312.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
Note: Linux only.&lt;br /&gt;
&lt;br /&gt;
When developing software for the embedded series, the recommended workflow is to set up a cross-compiling environment. Software is *not* compiled on the device, but on a separate machine (a more powerful machine that can compile much faster).&lt;br /&gt;
&lt;br /&gt;
E310/E312 manual page with supplemental info:&lt;br /&gt;
&lt;br /&gt;
* http://files.ettus.com/manual/page_usrp_e3x0.html&lt;br /&gt;
&lt;br /&gt;
Also useful:&lt;br /&gt;
&lt;br /&gt;
* http://gnuradio.org/redmine/projects/gnuradio/wiki/Embedded&lt;br /&gt;
&lt;br /&gt;
PyBOMBS documentation:&lt;br /&gt;
* http://gnuradio.org/redmine/projects/pybombs/wiki&lt;br /&gt;
* https://github.com/gnuradio/pybombs&lt;br /&gt;
&lt;br /&gt;
== Preparing the device ==&lt;br /&gt;
&lt;br /&gt;
It's best to start from scratch for any kind of embedded development, so the first step is to download the latest release for the device. For the E310/E312, this means downloading the latest SD card images from the website: http://files.ettus.com/e3xx_images/ and installing it to the SD card according to the manual.&lt;br /&gt;
&lt;br /&gt;
Once the latest image is flashed, turn on the device.&lt;br /&gt;
&lt;br /&gt;
=== Network setup ===&lt;br /&gt;
&lt;br /&gt;
For the following tutorial, it is necessary that you can SSH into the embedded device from your development machine and vice versa. For information on how to set up networking on the embedded device, consult the manual.&lt;br /&gt;
&lt;br /&gt;
In the following, we will assume that the hostname of the development machine is &amp;lt;code&amp;gt;desktop&amp;lt;/code&amp;gt;, the hostname of the embedded device is &amp;lt;code&amp;gt;e3xx&amp;lt;/code&amp;gt; and the username on the development machine is &amp;lt;code&amp;gt;dev&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the development machine you should be able to run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ ssh root@e3xx&lt;br /&gt;
&lt;br /&gt;
And on the embedded device you should be able to run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ ssh dev@desktop&lt;br /&gt;
&lt;br /&gt;
You might need to access the embedded device through a serial console to set up networking. Consult the device's manual for details.&lt;br /&gt;
&lt;br /&gt;
== Preparing the development machine ==&lt;br /&gt;
&lt;br /&gt;
This procedure can be done by using PyBOMBS or manually installing all the elements from source.&lt;br /&gt;
&lt;br /&gt;
=== Preparation using PyBOMBS ===&lt;br /&gt;
&lt;br /&gt;
PyBOMBS (Python Build Overlay Managed Bundle System) has currently a recipe that automates the installation of all the elements necessary to cross-compile for the E3XX. In order to use this method, first download and install PyBOMBS:&lt;br /&gt;
&lt;br /&gt;
    $ sudo pip install git+https://github.com/gnuradio/pybombs.git &lt;br /&gt;
&lt;br /&gt;
After you have PyBOMBS installed, download and install the necessary recipes to set up the machine:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git&lt;br /&gt;
    $ pybombs recipes add gr-etcetera git+https://github.com/gnuradio/gr-etcetera.git&lt;br /&gt;
    $ pybombs recipes add ettus https://github.com/EttusResearch/ettus-pybombs.git&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Ettus&amp;quot; recipe provides the necessary elements for the E3XX, the gr-recipes repository provides all the other packages (GNU Radio, out of tree modules, etc.). More information about the recipes and PyBOMBS in general can be found at the PyBOMBS manual (links provided in the &amp;quot;Overview&amp;quot; section).&lt;br /&gt;
&lt;br /&gt;
On some distributions (e.g. Ubuntu), PyBOMBS can run into shell issues. To avoid those problems, it is recommended to run the following command before continuing, and choose &amp;quot;no&amp;quot; in the prompted dialogue:&lt;br /&gt;
&lt;br /&gt;
    $ sudo dpkg-reconfigure dash&lt;br /&gt;
&lt;br /&gt;
Now you can proceed to install the SDK, UHD, GNU Radio and gr-ettus with this simple command:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs prefix init /path/to/prefix -R e3xx-radio-redo [-a alias]&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;/path/to/prefix&amp;quot; has to be previously created (for example ~/prefix/ or ~/prefix/e300). Keep in mind that this command will take a while to finish, due to the size and amount of files that need to be downloaded, cloned and installed.&lt;br /&gt;
&lt;br /&gt;
After the installation is finished, proceed to the [[Software_Development_on_the_E310_and_E312#Running the new UHD via sshfs|Running the new UHD via sshfs]] section.&lt;br /&gt;
&lt;br /&gt;
=== Preparation from Source ===&lt;br /&gt;
On your development machine, you will need to create a directory in which the development will take place. This directory is called the '''prefix''', and in the following, we will assume it is in &amp;lt;code&amp;gt;~/prefix&amp;lt;/code&amp;gt;. If you have not created it before, run the following command: &lt;br /&gt;
&lt;br /&gt;
    $ mkdir ~/prefix&lt;br /&gt;
&lt;br /&gt;
==== Installing the SDK ====&lt;br /&gt;
&lt;br /&gt;
Since you're cross-compiling (i.e., compiling for a different architecture than the development machine's) you require an SDK to do the development. Go the page where you downloaded the device image, and make sure you get the corresponding SDK.&lt;br /&gt;
&lt;br /&gt;
SDKs have filenames such as &amp;lt;code&amp;gt;oecore-x86_64-armv7ahf-vfp-neon-toolchain-nodistro.0.sh&amp;lt;/code&amp;gt;. The files are quite big, so it can take a while to download them.&lt;br /&gt;
&lt;br /&gt;
The SDKs contain the compiler toolchain, but also contain libraries etc. that already exist on the embedded device. This way, when compiling and linking, you know that what you compile on your development machine will also work on the device.&lt;br /&gt;
&lt;br /&gt;
To install the SDK, execute the downloaded file:&lt;br /&gt;
&lt;br /&gt;
    $ sh ./oecore-x86_64-armv7ahf-vfp-neon-toolchain-nodistro.0.sh&lt;br /&gt;
&lt;br /&gt;
Depending on your setup, you may have to use the following command:&lt;br /&gt;
&lt;br /&gt;
    $ bash ./oecore-x86_64-armv7ahf-vfp-neon-toolchain-nodistro.0.sh&lt;br /&gt;
&lt;br /&gt;
(If that's the case, you may want to run the sudo dpkg-configure dash command, see the PyBOMBS section).&lt;br /&gt;
It will ask you where to install it to. Choose the prefix path (&amp;lt;code&amp;gt;~/prefix&amp;lt;/code&amp;gt;).&lt;br /&gt;
Unzipping and installing takes a while. After it's done, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
    $ ls ~/prefix&lt;br /&gt;
    environment-setup-armv7ahf-vfp-neon-oe-linux-gnueabi&lt;br /&gt;
    site-config-armv7ahf-vfp-neon-oe-linux-gnueabi&lt;br /&gt;
    sysroots/&lt;br /&gt;
    usr/&lt;br /&gt;
    version-armv7ahf-vfp-neon-oe-linux-gnueabi&lt;br /&gt;
&lt;br /&gt;
(The exact contents of the directory may differ).&lt;br /&gt;
&lt;br /&gt;
==== Setting up the environment ====&lt;br /&gt;
&lt;br /&gt;
Before running any of the following commands, you need to set up the environment as outlined on the device manual.&lt;br /&gt;
You need to source the environment file:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/prefix&lt;br /&gt;
    $ source ./environment-setup-armv7ahf-vfp-neon-oe-linux-gnueabi&lt;br /&gt;
    $ echo $CC # This is just to confirm it worked.&lt;br /&gt;
    arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=hard -mfpu=neon --sysroot=~/prefix/e300/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi&lt;br /&gt;
&lt;br /&gt;
As you can see, it will change all kinds of paths to use different compilers and libraries.&lt;br /&gt;
Note that during this shell session, you won't be able to run a lot of other things on your development machines, so you should dedicate a separate shell window for this.&lt;br /&gt;
&lt;br /&gt;
Your development machine is now ready to cross-compile.&lt;br /&gt;
&lt;br /&gt;
== Compiling and installing UHD ==&lt;br /&gt;
&lt;br /&gt;
To cross-compile software, the SDK and the environment settings are usually not sufficient.&lt;br /&gt;
Your software requires a toolchain setup at configuration time to build correctly. UHD brings&lt;br /&gt;
support for this out of the box, so let's use UHD as an example on how to build custom software.&lt;br /&gt;
First, let's make sure you have the source code for UHD in your prefix (it can be elsewhere, but&lt;br /&gt;
for this example we'll keep *everything* inside the prefix directory).&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/prefix&lt;br /&gt;
    $ mkdir src/ # Let's create a src/ subdirectory which we'll use throughout the tutorial&lt;br /&gt;
    $ git clone https://github.com/EttusResearch/uhd.git&lt;br /&gt;
    $ cd src/uhd/host&lt;br /&gt;
    $ mkdir build&lt;br /&gt;
    $ cd build&lt;br /&gt;
&lt;br /&gt;
Now, before we do the next step, confirm that you have the correct environment loaded (see the step&lt;br /&gt;
before). We now need to configure the build setup to cross-compile correctly.&lt;br /&gt;
&lt;br /&gt;
    $ cmake -DCMAKE_TOOLCHAIN_FILE=../host/cmake/Toolchains/oe-sdk_cross.cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_E300=ON ..&lt;br /&gt;
&lt;br /&gt;
The exact command may differ (consult the device manual). However, two things are notable:&lt;br /&gt;
&lt;br /&gt;
* We specify a toolchain file. This is how CMake knows how to set up a cross-compile, if the environment variables are set up correctly.&lt;br /&gt;
* Second, we specify the install prefix as &amp;lt;code&amp;gt;/usr&amp;lt;/code&amp;gt;. This might seem odd, but it's actually the prefix *on the device*, not on our development machine.&lt;br /&gt;
&lt;br /&gt;
Now that we have it all set up, we can compile:&lt;br /&gt;
&lt;br /&gt;
    $ make -j4&lt;br /&gt;
&lt;br /&gt;
This step might take longer than you're used to -- that's because cross-compiling is slightly slower than native compiles. However, it's much, much faster than trying to compile on the device.&lt;br /&gt;
&lt;br /&gt;
Installing is also slightly different than usual:&lt;br /&gt;
&lt;br /&gt;
    $ make install DESTDIR=~/prefix&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;DESTDIR&amp;lt;/code&amp;gt; part will make sure it gets installed into the prefix, and doesn't try to actually install to &amp;lt;code&amp;gt;/usr/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Running the new UHD via sshfs ==&lt;br /&gt;
&lt;br /&gt;
The cleanest way to test your newly built UHD is to mount the prefix onto your embedded device.&lt;br /&gt;
From your development machine, log onto the embedded device and mount the prefix:&lt;br /&gt;
&lt;br /&gt;
    $ ssh root@e3xx # After this, we're logged onto the embedded device&lt;br /&gt;
    $ pwd # Check where we are&lt;br /&gt;
    /home/root&lt;br /&gt;
    $ mkdir usr # Create a directory to mount our prefix, this only needs doing once&lt;br /&gt;
    $ sshfs dev@desktop:prefix/ usr/ # This will mount the prefix on the development machine to ~/usr&lt;br /&gt;
    $ ls usr/ # The actual output of this may differ&lt;br /&gt;
    environment-setup-armv7ahf-vfp-neon-oe-linux-gnueabi&lt;br /&gt;
    site-config-armv7ahf-vfp-neon-oe-linux-gnueabi&lt;br /&gt;
    sysroots/&lt;br /&gt;
    usr/&lt;br /&gt;
    version-armv7ahf-vfp-neon-oe-linux-gnueabi&lt;br /&gt;
&lt;br /&gt;
The output of the final &amp;lt;code&amp;gt;ls&amp;lt;/code&amp;gt; command should be the same as before when doing &amp;lt;code&amp;gt;ls ~/prefix&amp;lt;/code&amp;gt; on the development machine.&lt;br /&gt;
Nearly there! Now, we need to update the environment variables and paths in our ssh session on the embedded device.&lt;br /&gt;
We will add a new file called &amp;lt;code&amp;gt;set_env&amp;lt;/code&amp;gt; into the prefix with the following contents (if you prepared your development machine with PyBOMBS, this file should be already included):&lt;br /&gt;
&lt;br /&gt;
    LOCALPREFIX=~/usr&lt;br /&gt;
    export PATH=$LOCALPREFIX/bin:$PATH&lt;br /&gt;
    export LD_LOAD_LIBRARY=$LOCALPREFIX/lib:$LD_LOAD_LIBRARY&lt;br /&gt;
    export LD_LIBRARY_PATH=$LOCALPREFIX/lib:$LD_LIBRARY_PATH&lt;br /&gt;
    export PYTHONPATH=$LOCALPREFIX/lib/python2.7/site-packages:$PYTHONPATH&lt;br /&gt;
    export PKG_CONFIG_PATH=$LOCALPREFIX/lib/pkgconfig:$PKG_CONFIG_PATH&lt;br /&gt;
    export GRC_BLOCKS_PATH=$LOCALPREFIX/share/gnuradio/grc/blocks:$GRC_BLOCKS_PATH&lt;br /&gt;
    export UHD_RFNOC_DIR=$LOCALPREFIX/share/uhd/rfnoc/&lt;br /&gt;
    export UHD_IMAGES_DIR=$LOCALPREFIX/share/uhd/images&lt;br /&gt;
&lt;br /&gt;
You can see the contents is very simple -- all it does is point the most important paths into our prefix.&lt;br /&gt;
Going back to the SSH session on the embedded device, you should be able to source that file now:&lt;br /&gt;
&lt;br /&gt;
    $ which uhd_find_devices # This will point to the old UHD, which we do not want&lt;br /&gt;
    /usr/bin/uhd_find_devices&lt;br /&gt;
    $ source ./set_env&lt;br /&gt;
    $ which uhd_find_devices # Now it should point to the new version&lt;br /&gt;
    /home/root/usr/bin/uhd_find_devices&lt;br /&gt;
&lt;br /&gt;
The last command is to make sure you're actually using the newly compiled UHD, because all of the SD card images already ship a version of UHD.&lt;br /&gt;
In the example above, it worked, and we're ready to go!&lt;br /&gt;
&lt;br /&gt;
The examples get installed to &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt;, so if you want to try your newly compiled UHD, you can do so by running, e.g., the following command:&lt;br /&gt;
&lt;br /&gt;
    $ ~/prefix/lib/uhd/examples/benchmark_rate --tx_rate 1e6&lt;br /&gt;
&lt;br /&gt;
Or anything else in the &amp;lt;code&amp;gt;examples&amp;lt;/code&amp;gt; subdirectory.&lt;br /&gt;
&lt;br /&gt;
At this point, it should be clear why the prefix/sshfs approach is so useful. Everything that is related to the install is stored in the same directory, you can zip it up and move it another computer if you like, and the embedded device doesn't actually store any of the development files. As soon as you unmount the sshfs mount, and reset the environment, it will be back in its default state.&lt;br /&gt;
&lt;br /&gt;
== Compiling and installing GNU Radio ==&lt;br /&gt;
&lt;br /&gt;
    [[File:cmake_gr.png|thumb|left|Output example of CMakeGUI for the build of GNU Radio.|link=https://kb.ettus.com/images/f/f9/cmake_gr.png]]&lt;br /&gt;
&lt;br /&gt;
In principle, the work flow for GNU Radio is just the same as for UHD. However, GNU Radio depends on UHD, and you want it to use the new UHD instead of the one that ships with the device (and is in your SDK).&lt;br /&gt;
There are two ways to go ahead: You could either also install UHD into your SDK, but the downside is that you then taint your SDK and it's a non-reversible operation.&lt;br /&gt;
&lt;br /&gt;
A much easier way is to simply point your GNU Radio configuration to the new UHD libs instead of the old ones.&lt;br /&gt;
Again, clone the repo into &amp;lt;code&amp;gt;~/prefix/src/gnuradio&amp;lt;/code&amp;gt;, and then run the following command (again, you need to make sure the environment is set up correctly):&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/prefix&lt;br /&gt;
    $ source ./environment-setup-armv7ahf-vfp-neon-oe-linux-gnueabi # To be sure that our environment is correctly set up &lt;br /&gt;
    $ cd src/&lt;br /&gt;
    $ git clone --recursive https://github.com/gnuradio/gnuradio.git&lt;br /&gt;
    $ cd gnuradio&lt;br /&gt;
    $ mkdir build-arm&lt;br /&gt;
    $ cd build-arm&lt;br /&gt;
    $ cmake -Wno-dev -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/oe-sdk_cross.cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_GR_VOCODER=OFF -DENABLE_GR_ATSC=OFF -DENABLE_GR_DTV=OFF -DENABLE_DOXYGEN=OFF ../&lt;br /&gt;
    $ make -j4 # This may take a while&lt;br /&gt;
    $ make -j4 install DESTDIR=~/prefix&lt;br /&gt;
&lt;br /&gt;
To confirm that this worked, it can help to open the CMake configuration in a GUI and check that the UHD-related variables point to the correct libraries. To see more detailed information about the compile, click the &amp;quot;Advanced&amp;quot; checkbox. By doing so, a several number of configuration options appear, which can be not only read but also modified. Notice that the path for UHD_includes and UHD_libraries should point to the UHD source folder installed in the step before. If they are still pointing to the UHD that comes with the device (which is [$PREFIX$}/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/lib/cmake/uhd) they should be modified by changing the path directly on the CMake GUI or by adding recompiling since cmake from terminal by adding the directives accordingly, as follows: &lt;br /&gt;
    $ cmake -Wno-dev -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/oe-sdk_cross.cmake \-DCMAKE_INSTALL_PREFIX=/usr -DENABLE_GR_VOCODER=OFF -DENABLE_GR_ATSC=OFF -DENABLE_GR_DTV=OFF -DENABLE_DOXYGEN=OFF -DUHD_DIR=~/prefix/usr/lib/cmake/uhd/ -DUHD_INCLUDE_DIRS=~/prefix/usr/include -DUHD_LIBRARIES=~/prefix/usr/lib/libuhd.so ../&lt;br /&gt;
&lt;br /&gt;
=== Using GNU Radio Companion ===&lt;br /&gt;
&lt;br /&gt;
Since the embedded devices usually don't have a screen, GNU Radio Companion (GRC) is not a useful tool on the device. However, the development machine can be used to generate flow graphs and compile to Python. Some best practices:&lt;br /&gt;
&lt;br /&gt;
* Save both the .grc file and the generated .py file into the prefix&lt;br /&gt;
* Set the 'No GUI' option for Python files that are to be executed on the embedded device&lt;br /&gt;
* Run the Python scripts generated from GRC on the command line on the embedded device&lt;br /&gt;
* If you need visualization, run a separate flow graph on the development machine with the visualization GUI widgets. Use UDP sinks/sources or ZeroMQ blocks to pass data from the embedded device to the development machine.&lt;br /&gt;
&lt;br /&gt;
=== Compiling and installing out-of-tree modules (e.g. gr-ettus) ===&lt;br /&gt;
&lt;br /&gt;
Again, the process is very similar to building GNU Radio. You must make sure that all the correct libraries are linked to, and that it doesn't accidentally pick up libraries from the SDK (e.g. GNU Radio libraries).&lt;br /&gt;
&lt;br /&gt;
    # TODO add screenshot cmake-gui on how this should look like&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Notes]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=2820</id>
		<title>Getting Started with RFNoC Development</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=2820"/>
				<updated>2016-06-21T23:15:08Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NOT FINISHED DONT READ! =&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This application note gives a brief introduction into the steps required to start developing RFNoC blocks on your computer.&lt;br /&gt;
First, you need to make sure that you have all the tools required to do RFNoC development.&lt;br /&gt;
Then, we will set up a development sandbox in which you can do your RFNoC development.&lt;br /&gt;
Finally, we will run through the basic steps required to actually write custom RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
For any of this to work, you need to make sure you have all the tools to do both software and FPGA development.&lt;br /&gt;
Confirm you have the following tools installed:&lt;br /&gt;
&lt;br /&gt;
* Xilinx Vivado. The specific version depends on the branch and state of the FPGA code and is very important. Make sure to install the correct version.&lt;br /&gt;
* Software build tools. If you can compile UHD from source, you have all the necessary components (If you're using PyBOMBS&lt;br /&gt;
&lt;br /&gt;
Please make sure these tools are available before proceeding to the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a development environment ==&lt;br /&gt;
&lt;br /&gt;
In the following, we will assume that GNU Radio is used as a helper tool for RFNoC development. Note that GNU Radio is by no means required to use or develop RFNoC, but it makes it a great deal easier. So in order to get your development environment set up, you will need the following software packages:&lt;br /&gt;
&lt;br /&gt;
- UHD&lt;br /&gt;
- GNU Radio&lt;br /&gt;
- gr-ettus&lt;br /&gt;
&lt;br /&gt;
The cleanest way to set this up is to install everything into a dedicated directory. PyBOMBS is the simplest way to do this.&lt;br /&gt;
If you haven't already downloaded and installed PyBOMBS, you can do so by running the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ sudo pip install git+https://github.com/gnuradio/pybombs.git&lt;br /&gt;
    $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git&lt;br /&gt;
    $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git&lt;br /&gt;
&lt;br /&gt;
From here, the easiest way to set up a PyBOMBS development environment is to run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs prefix init ~/prefix/rfnoc -R rfnoc [-a alias]&lt;br /&gt;
&lt;br /&gt;
This will do the following:&lt;br /&gt;
&lt;br /&gt;
- Create a directory in ~/prefix/rfnoc&lt;br /&gt;
- Clone UHD, FPGA, GNU Radio, and gr-ettus sources into that directory&lt;br /&gt;
- Compile and install all the software&lt;br /&gt;
&lt;br /&gt;
Then, enable the prefix:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/prefix/rfnoc&lt;br /&gt;
    $ source ./setup_env.sh&lt;br /&gt;
&lt;br /&gt;
PyBOMBS is by no means required to do any of these steps. If you wish to install the software manually, follow the individual install notes for GNU Radio, UHD and gr-ettus and make sure they are reachable by linkers and compilers.&lt;br /&gt;
&lt;br /&gt;
To manually download the software, use these git clone commands, which will select the correct branches:&lt;br /&gt;
&lt;br /&gt;
    $ git clone --recursive -b rfnoc-radio-redo https://github.com/EttusResearch/uhd.git&lt;br /&gt;
    $ git clone -b maint https://github.com/gnuradio/gnuradio.git # master branch is also fine&lt;br /&gt;
    $ git clone -b radio-redo https://github.com/EttusResearch/gr-ettus.git&lt;br /&gt;
&lt;br /&gt;
If you have already UHD, GNU Radio 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).&lt;br /&gt;
&lt;br /&gt;
== rfnocmodtool ==&lt;br /&gt;
&lt;br /&gt;
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 specific for the RFNoC modtool.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== Tool Installation ===&lt;br /&gt;
&lt;br /&gt;
The tool is currently shipped within gr-ettus (radio-redo branch), so by installing gr-ettus, rfnocmodtool automatically becomes available.&lt;br /&gt;
&lt;br /&gt;
=== Tool Utilization ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool help&lt;br /&gt;
&lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
&lt;br /&gt;
    Usage:&lt;br /&gt;
    rfnocmodtool &amp;lt;command&amp;gt; [options] -- Run &amp;lt;command&amp;gt; with the given options.&lt;br /&gt;
    rfnocmodtool help -- Show a list of commands.&lt;br /&gt;
    rfnocmodtool help &amp;lt;command&amp;gt; -- Shows the help for a given command. &lt;br /&gt;
&lt;br /&gt;
    List of possible commands:&lt;br /&gt;
&lt;br /&gt;
    Name      Aliases          Description&lt;br /&gt;
    =====================================================================&lt;br /&gt;
    disable   dis              Disable block (comments out CMake entries for files) &lt;br /&gt;
    info      getinfo,inf      Return information about a given module &lt;br /&gt;
    remove    rm,del           Remove block (delete files and remove Makefile entries) &lt;br /&gt;
    makexml   mx               Make XML file for GRC block bindings &lt;br /&gt;
    add       insert           Add block to the out-of-tree module. &lt;br /&gt;
    newmod    nm,create        Create a new out-of-tree module &lt;br /&gt;
    rename    mv               Rename a block in the out-of-tree module. &lt;br /&gt;
&lt;br /&gt;
If you have used the gr_modtool provided by GNURadio, you'll be familiar with this usage.&lt;br /&gt;
&lt;br /&gt;
== Creating an RFNoC OOT Module ==&lt;br /&gt;
&lt;br /&gt;
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 your prefixes source location (~/prefix/rfnoc/src) and type:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod [NAME OF THE MODULE]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod example&lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
&lt;br /&gt;
    Creating out-of-tree module in ./rfnoc-example... Done.&lt;br /&gt;
    Use 'rfnocmodtool add' to add a new block to this currently empty module.&lt;br /&gt;
&lt;br /&gt;
    $ ls rfnoc-example/&lt;br /&gt;
    $ apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig&lt;br /&gt;
&lt;br /&gt;
In contrast with gr_modtool, this includes a folder called 'rfnoc', which is where we put the UHD/FPGA files (more details below).&lt;br /&gt;
&lt;br /&gt;
=== Adding custom blocks ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodule add [NAME OF THE BLOCK]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Other Resources =&lt;br /&gt;
[1] GNURadio OutOfTree Modules: http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules &lt;br /&gt;
&lt;br /&gt;
https://github.com/EttusResearch/uhd/wiki/RFNoC:-Getting-Started&lt;br /&gt;
&lt;br /&gt;
https://github.com/EttusResearch/uhd/wiki/RFNoC:--Specification&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software Resources]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=2819</id>
		<title>Getting Started with RFNoC Development</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=2819"/>
				<updated>2016-06-21T23:12:36Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NOT FINISHED DONT READ! =&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This application note gives a brief introduction into the steps required to start developing RFNoC blocks on your computer.&lt;br /&gt;
First, you need to make sure that you have all the tools required to do RFNoC development.&lt;br /&gt;
Then, we will set up a development sandbox in which you can do your RFNoC development.&lt;br /&gt;
Finally, we will run through the basic steps required to actually write custom RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
For any of this to work, you need to make sure you have all the tools to do both software and FPGA development.&lt;br /&gt;
Confirm you have the following tools installed:&lt;br /&gt;
&lt;br /&gt;
- Xilinx Vivado. The specific version depends on the branch and state of the FPGA code and is very important. Make sure to install the correct version.&lt;br /&gt;
- Software build tools. If you can compile UHD from source, you have all the necessary components (If you're using PyBOMBS&lt;br /&gt;
&lt;br /&gt;
Please make sure these tools are available before proceeding to the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a development environment ==&lt;br /&gt;
&lt;br /&gt;
In the following, we will assume that GNU Radio is used as a helper tool for RFNoC development. Note that GNU Radio is by no means required to use or develop RFNoC, but it makes it a great deal easier. So in order to get your development environment set up, you will need the following software packages:&lt;br /&gt;
&lt;br /&gt;
- UHD&lt;br /&gt;
- GNU Radio&lt;br /&gt;
- gr-ettus&lt;br /&gt;
&lt;br /&gt;
The cleanest way to set this up is to install everything into a dedicated directory. PyBOMBS is the simplest way to do this.&lt;br /&gt;
If you haven't already downloaded and installed PyBOMBS, you can do so by running the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ sudo pip install git+https://github.com/gnuradio/pybombs.git&lt;br /&gt;
    $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git&lt;br /&gt;
    $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git&lt;br /&gt;
&lt;br /&gt;
From here, the easiest way to set up a PyBOMBS development environment is to run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs prefix init ~/prefix/rfnoc -R rfnoc [-a alias]&lt;br /&gt;
&lt;br /&gt;
This will do the following:&lt;br /&gt;
&lt;br /&gt;
- Create a directory in ~/prefix/rfnoc&lt;br /&gt;
- Clone UHD, FPGA, GNU Radio, and gr-ettus sources into that directory&lt;br /&gt;
- Compile and install all the software&lt;br /&gt;
&lt;br /&gt;
Then, enable the prefix:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/prefix/rfnoc&lt;br /&gt;
    $ source ./setup_env.sh&lt;br /&gt;
&lt;br /&gt;
PyBOMBS is by no means required to do any of these steps. If you wish to install the software manually, follow the individual install notes for GNU Radio, UHD and gr-ettus and make sure they are reachable by linkers and compilers.&lt;br /&gt;
&lt;br /&gt;
To manually download the software, use these git clone commands, which will select the correct branches:&lt;br /&gt;
&lt;br /&gt;
    $ git clone --recursive -b rfnoc-radio-redo https://github.com/EttusResearch/uhd.git&lt;br /&gt;
    $ git clone -b maint https://github.com/gnuradio/gnuradio.git # master branch is also fine&lt;br /&gt;
    $ git clone -b radio-redo https://github.com/EttusResearch/gr-ettus.git&lt;br /&gt;
&lt;br /&gt;
If you have already UHD, GNU Radio 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).&lt;br /&gt;
&lt;br /&gt;
== rfnocmodtool ==&lt;br /&gt;
&lt;br /&gt;
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 specific for the RFNoC modtool.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== Tool Installation ===&lt;br /&gt;
&lt;br /&gt;
The tool is currently shipped within gr-ettus (radio-redo branch), so by installing gr-ettus, rfnocmodtool automatically becomes available.&lt;br /&gt;
&lt;br /&gt;
=== Tool Utilization ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool help&lt;br /&gt;
&lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
&lt;br /&gt;
    Usage:&lt;br /&gt;
    rfnocmodtool &amp;lt;command&amp;gt; [options] -- Run &amp;lt;command&amp;gt; with the given options.&lt;br /&gt;
    rfnocmodtool help -- Show a list of commands.&lt;br /&gt;
    rfnocmodtool help &amp;lt;command&amp;gt; -- Shows the help for a given command. &lt;br /&gt;
&lt;br /&gt;
    List of possible commands:&lt;br /&gt;
&lt;br /&gt;
    Name      Aliases          Description&lt;br /&gt;
    =====================================================================&lt;br /&gt;
    disable   dis              Disable block (comments out CMake entries for files) &lt;br /&gt;
    info      getinfo,inf      Return information about a given module &lt;br /&gt;
    remove    rm,del           Remove block (delete files and remove Makefile entries) &lt;br /&gt;
    makexml   mx               Make XML file for GRC block bindings &lt;br /&gt;
    add       insert           Add block to the out-of-tree module. &lt;br /&gt;
    newmod    nm,create        Create a new out-of-tree module &lt;br /&gt;
    rename    mv               Rename a block in the out-of-tree module. &lt;br /&gt;
&lt;br /&gt;
If you have used the gr_modtool provided by GNURadio, you'll be familiar with this usage.&lt;br /&gt;
&lt;br /&gt;
== Creating an RFNoC OOT Module ==&lt;br /&gt;
&lt;br /&gt;
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 your prefixes source location (~/prefix/rfnoc/src) and type:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod [NAME OF THE MODULE]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod example&lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
&lt;br /&gt;
    Creating out-of-tree module in ./rfnoc-example... Done.&lt;br /&gt;
    Use 'rfnocmodtool add' to add a new block to this currently empty module.&lt;br /&gt;
&lt;br /&gt;
    $ ls rfnoc-example/&lt;br /&gt;
    $ apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig&lt;br /&gt;
&lt;br /&gt;
In contrast with gr_modtool, this includes a folder called 'rfnoc', which is where we put the UHD/FPGA files (more details below).&lt;br /&gt;
&lt;br /&gt;
=== Adding custom blocks ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodule add [NAME OF THE BLOCK]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Other Resources =&lt;br /&gt;
[1] GNURadio OutOfTree Modules: http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules &lt;br /&gt;
&lt;br /&gt;
https://github.com/EttusResearch/uhd/wiki/RFNoC:-Getting-Started&lt;br /&gt;
&lt;br /&gt;
https://github.com/EttusResearch/uhd/wiki/RFNoC:--Specification&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software Resources]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=2818</id>
		<title>Getting Started with RFNoC Development</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=2818"/>
				<updated>2016-06-21T23:12:14Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: Widened scope&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NOT FINISHED DONT READ! =&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This application note gives a brief introduction into the steps required to start developing RFNoC blocks on your computer.&lt;br /&gt;
First, you need to make sure that you have all the tools required to do RFNoC development.&lt;br /&gt;
Then, we will set up a development sandbox in which you can do your RFNoC development.&lt;br /&gt;
Finally, we will run through the basic steps required to actually write custom RFNoC blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
For any of this to work, you need to make sure you have all the tools to do both software and FPGA development.&lt;br /&gt;
Confirm you have the following tools installed:&lt;br /&gt;
&lt;br /&gt;
- Xilinx Vivado. The specific version depends on the branch and state of the FPGA code and is very important. Make sure to install the correct version.&lt;br /&gt;
- Software build tools. If you can compile UHD from source, you have all the necessary components (If you're using PyBOMBS&lt;br /&gt;
&lt;br /&gt;
Please make sure these tools are available before proceeding to the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a development environment ==&lt;br /&gt;
&lt;br /&gt;
In the following, we will assume that GNU Radio is used as a helper tool for RFNoC development. Note that GNU Radio is by no means required to use or develop RFNoC, but it makes it a great deal easier. So in order to get your development environment set up, you will need the following software packages:&lt;br /&gt;
&lt;br /&gt;
- UHD&lt;br /&gt;
- GNU Radio&lt;br /&gt;
- gr-ettus&lt;br /&gt;
&lt;br /&gt;
The cleanest way to set this up is to install everything into a dedicated directory. PyBOMBS is the simplest way to do this.&lt;br /&gt;
If you haven't already downloaded and installed PyBOMBS, you can do so by running the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ sudo pip install git+https://github.com/gnuradio/pybombs.git&lt;br /&gt;
    $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git&lt;br /&gt;
    $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git&lt;br /&gt;
&lt;br /&gt;
From here, the easiest way to set up a PyBOMBS development environment is to run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs prefix init ~/prefix/rfnoc -R rfnoc [-a alias]&lt;br /&gt;
&lt;br /&gt;
This will do the following:&lt;br /&gt;
&lt;br /&gt;
- Create a directory in ~/prefix/rfnoc&lt;br /&gt;
- Clone UHD, FPGA, GNU Radio, and gr-ettus sources into that directory&lt;br /&gt;
- Compile and install all the software&lt;br /&gt;
&lt;br /&gt;
Then, enable the prefix:&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/prefix/rfnoc&lt;br /&gt;
    $ source ./setup_env.sh&lt;br /&gt;
&lt;br /&gt;
PyBOMBS is by no means required to do any of these steps. If you wish to install the software manually, follow the individual install notes for GNU Radio, UHD and gr-ettus and make sure they are reachable by linkers and compilers.&lt;br /&gt;
&lt;br /&gt;
To manually download the software, use these git clone commands, which will select the correct branches:&lt;br /&gt;
&lt;br /&gt;
    $ git clone --recursive -b rfnoc-radio-redo https://github.com/EttusResearch/uhd.git&lt;br /&gt;
    $ git clone -b maint https://github.com/gnuradio/gnuradio.git # master branch is also fine&lt;br /&gt;
    $ git clone -b radio-redo https://github.com/EttusResearch/gr-ettus.git&lt;br /&gt;
&lt;br /&gt;
If you have already UHD, GNU Radio 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).&lt;br /&gt;
&lt;br /&gt;
== rfnocmodtool ==&lt;br /&gt;
&lt;br /&gt;
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 specific for the RFNoC modtool.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== Tool Installation ===&lt;br /&gt;
&lt;br /&gt;
The tool is currently shipped within gr-ettus (radio-redo branch), so by installing gr-ettus, rfnocmodtool automatically becomes available.&lt;br /&gt;
&lt;br /&gt;
=== Tool Utilization ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool help&lt;br /&gt;
&lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
&lt;br /&gt;
    Usage:&lt;br /&gt;
    rfnocmodtool &amp;lt;command&amp;gt; [options] -- Run &amp;lt;command&amp;gt; with the given options.&lt;br /&gt;
    rfnocmodtool help -- Show a list of commands.&lt;br /&gt;
    rfnocmodtool help &amp;lt;command&amp;gt; -- Shows the help for a given command. &lt;br /&gt;
&lt;br /&gt;
    List of possible commands:&lt;br /&gt;
&lt;br /&gt;
    Name      Aliases          Description&lt;br /&gt;
    =====================================================================&lt;br /&gt;
    disable   dis              Disable block (comments out CMake entries for files) &lt;br /&gt;
    info      getinfo,inf      Return information about a given module &lt;br /&gt;
    remove    rm,del           Remove block (delete files and remove Makefile entries) &lt;br /&gt;
    makexml   mx               Make XML file for GRC block bindings &lt;br /&gt;
    add       insert           Add block to the out-of-tree module. &lt;br /&gt;
    newmod    nm,create        Create a new out-of-tree module &lt;br /&gt;
    rename    mv               Rename a block in the out-of-tree module. &lt;br /&gt;
&lt;br /&gt;
If you have used the gr_modtool provided by GNURadio, you'll be familiar with this usage.&lt;br /&gt;
&lt;br /&gt;
== Creating an RFNoC OOT Module ==&lt;br /&gt;
&lt;br /&gt;
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 your prefixes source location (~/prefix/rfnoc/src) and type:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod [NAME OF THE MODULE]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod example&lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
&lt;br /&gt;
    Creating out-of-tree module in ./rfnoc-example... Done.&lt;br /&gt;
    Use 'rfnocmodtool add' to add a new block to this currently empty module.&lt;br /&gt;
&lt;br /&gt;
    $ ls rfnoc-example/&lt;br /&gt;
    $ apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig&lt;br /&gt;
&lt;br /&gt;
In contrast with gr_modtool, this includes a folder called 'rfnoc', which is where we put the UHD/FPGA files (more details below).&lt;br /&gt;
&lt;br /&gt;
=== Adding custom blocks ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodule add [NAME OF THE BLOCK]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Other Resources==&lt;br /&gt;
[1] GNURadio OutOfTree Modules: http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules &lt;br /&gt;
&lt;br /&gt;
https://github.com/EttusResearch/uhd/wiki/RFNoC:-Getting-Started&lt;br /&gt;
&lt;br /&gt;
https://github.com/EttusResearch/uhd/wiki/RFNoC:--Specification&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software Resources]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	<entry>
		<id>https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=2816</id>
		<title>Getting Started with RFNoC Development</title>
		<link rel="alternate" type="text/html" href="https://kb.ettus.com/index.php?title=Getting_Started_with_RFNoC_Development&amp;diff=2816"/>
				<updated>2016-06-21T22:26:24Z</updated>
		
		<summary type="html">&lt;p&gt;MartinBraun: MartinBraun moved page RFNoC-modtool to Getting Started with RFNoC Development: Old title was misleading&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NOT FINISHED DONT READ! =&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;vertical-align:top; width: 60%;&amp;quot;|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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Tool Installation ==&lt;br /&gt;
&lt;br /&gt;
The tool is currently shipped within gr-ettus (radio-redo branch), so you can install it using PyBOMBS or from source.&lt;br /&gt;
&lt;br /&gt;
=== gr-ettus Installation using PyBOMBS ===&lt;br /&gt;
&lt;br /&gt;
If you haven't already downloaded and installed PyBOMBS, you can do it by running the following commands:&lt;br /&gt;
&lt;br /&gt;
    $ sudo pip install git+https://github.com/gnuradio/pybombs.git&lt;br /&gt;
    $ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git&lt;br /&gt;
    $ pybombs recipes add ettus git+https://github.com/EttusResearch/ettus-pybombs.git&lt;br /&gt;
&lt;br /&gt;
From here, the easiest way to set up a PyBOMBS development environment is to run the following command:&lt;br /&gt;
&lt;br /&gt;
    $ pybombs prefix init /path/to/prefix -R rfnoc [-a alias]&lt;br /&gt;
&lt;br /&gt;
This will do the following:&lt;br /&gt;
&lt;br /&gt;
- Create a directory in /path/to/prefix&lt;br /&gt;
- Clone UHD, FPGA, GNU Radio, and gr-ettus sources into that directory&lt;br /&gt;
- Start the builds for the software&lt;br /&gt;
&lt;br /&gt;
=== gr-ettus Installation by source ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ git clone --recursive -b rfnoc-radio-redo https://github.com/EttusResearch/uhd.git&lt;br /&gt;
    $ git clone -b maint https://github.com/gnuradio/gnuradio.git&lt;br /&gt;
    $ git clone -b radio-redo https://github.com/EttusResearch/gr-ettus.git&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
== Tool Utilization ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool --help&lt;br /&gt;
&lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
&lt;br /&gt;
    Usage:&lt;br /&gt;
    rfnocmodtool &amp;lt;command&amp;gt; [options] -- Run &amp;lt;command&amp;gt; with the given options.&lt;br /&gt;
    rfnocmodtool help -- Show a list of commands.&lt;br /&gt;
    rfnocmodtool help &amp;lt;command&amp;gt; -- Shows the help for a given command. &lt;br /&gt;
&lt;br /&gt;
    List of possible commands:&lt;br /&gt;
&lt;br /&gt;
    Name      Aliases          Description&lt;br /&gt;
    =====================================================================&lt;br /&gt;
    disable   dis              Disable block (comments out CMake entries for files) &lt;br /&gt;
    info      getinfo,inf      Return information about a given module &lt;br /&gt;
    remove    rm,del           Remove block (delete files and remove Makefile entries) &lt;br /&gt;
    makexml   mx               Make XML file for GRC block bindings &lt;br /&gt;
    add       insert           Add block to the out-of-tree module. &lt;br /&gt;
    newmod    nm,create        Create a new out-of-tree module &lt;br /&gt;
    rename    mv               Rename a block in the out-of-tree module. &lt;br /&gt;
&lt;br /&gt;
If you have used the gr_modtool provided by GNURadio, you'd be familiar with this usage.&lt;br /&gt;
&lt;br /&gt;
=== Creating a RFNoC OOT Module ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod [NAME OF THE MODULE]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodtool newmod example&lt;br /&gt;
    linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.rfnoc-radio-redo-0-fd4d734e&lt;br /&gt;
&lt;br /&gt;
    Creating out-of-tree module in ./rfnoc-example... Done.&lt;br /&gt;
    Use 'rfnocmodtool add' to add a new block to this currently empty module.&lt;br /&gt;
&lt;br /&gt;
    $ ls rfnoc-example/&lt;br /&gt;
    $ apps  cmake  CMakeLists.txt  docs  examples  grc  include  lib  MANIFEST.md  python  README.md  rfnoc  swig&lt;br /&gt;
&lt;br /&gt;
In contrast with gr_modtool, this includes al folder called 'rfnoc', which is where we put the UHD/FPGA files (more details below).&lt;br /&gt;
&lt;br /&gt;
=== Adding custom blocks ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    $ rfnocmodule add [NAME OF THE BLOCK]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Other Resources==&lt;br /&gt;
[1] GNURadio OutOfTree Modules: http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules &lt;br /&gt;
&lt;br /&gt;
https://github.com/EttusResearch/uhd/wiki/RFNoC:-Getting-Started&lt;br /&gt;
&lt;br /&gt;
https://github.com/EttusResearch/uhd/wiki/RFNoC:--Specification&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software Resources]]&lt;/div&gt;</summary>
		<author><name>MartinBraun</name></author>	</entry>

	</feed>