USRP RFNoC image 开发示例

news/2024/11/18 3:39:02/

本文内容、所用开发板、配件等仅限与研发和学习使用,如有侵权,请联系我们进行删除!

目录

一、概要

二、实验环境

1. 软件环境

2. 硬件设备

三、Adding an FFT BLOCK

1. 修改 x310_rfnoc_image_core.yml 文件

2. rfnoc_image_builder 生成新的fpga image

3. uhd_image_loader 下载 fpga image 到 USRP

4. 实验结果

四、Adding an FFT Block to the Recive Chain

1. 修改 x310_rfnoc_image_core.yml 文件

2. rfnoc_image_builder 生成新的fpga image

3. uhd_image_loader 下载 fpga image 到 USRP

4. 实验结果

五、参考链接


一、概要

本文主要描述了如何对USRP X系列上的FPGA和射频片上网络(RFNoC™)的软件开发。它简要介绍了如何在默认的fpga image中添加自定义的rfnoc image和连接方式并生成编译生成新的fpga image,能够在主机上做软件开发。

二、实验环境

1. 软件环境

ubuntu 20.04 ;  gnuradio 3.8 ;  uhd 4.1.0

2. 硬件设备

USRP HM-X310

三、Adding an FFT BLOCK

1. 修改 x310_rfnoc_image_core.yml 文件

该文件位于 <uhd安装路径>/fpga/usrp3/top/x300下,请拷贝该文件并对副本进行修改,切勿直接修改原文件。

$ cd <repo>/fpga/usrp3/top/x300/
$ cp x310_rfnoc_image_core.yml <副本>.yml

修改后的内容为:

# General parameters
# -----------------------------------------
schema: rfnoc_imagebuilder_args         # Identifier for the schema used to validate this file
copyright: 'Ettus Research, A National Instruments Brand' # Copyright information used in file headers
license: 'SPDX-License-Identifier: LGPL-3.0-or-later' # License information used in file headers
version: '1.0'                          # File version
rfnoc_version: '1.0'                    # RFNoC protocol version
chdr_width: 64                          # Bit width of the CHDR bus for this image
device: 'x310'
default_target: 'X310_HG'# A list of all stream endpoints in design
# ----------------------------------------
stream_endpoints:ep0:                       # Stream endpoint namectrl: True                      # Endpoint passes control trafficdata: True                      # Endpoint passes data trafficbuff_size: 32768                # Ingress buffer size for dataep1:                       # Stream endpoint namectrl: False                     # Endpoint passes control trafficdata: True                      # Endpoint passes data trafficbuff_size: 0                    # Ingress buffer size for dataep2:                       # Stream endpoint namectrl: False                     # Endpoint passes control trafficdata: True                      # Endpoint passes data trafficbuff_size: 32768                # Ingress buffer size for dataep3:                       # Stream endpoint namectrl: False                     # Endpoint passes control trafficdata: True                      # Endpoint passes data trafficbuff_size: 0                    # Ingress buffer size for dataep4:                       # Stream endpoint namectrl: False                     # Endpoint passes control trafficdata: True                      # Endpoint passes data trafficbuff_size: 4096                 # Ingress buffer size for dataep5:                       # Stream endpoint namectrl: False                     # Endpoint passes control trafficdata: True                      # Endpoint passes data trafficbuff_size: 4096                 # Ingress buffer size for dataep_fft:ctrl: Falsedata: Truebuff_size: 32768# A list of all NoC blocks in design
# ----------------------------------
noc_blocks:duc0:                      # NoC block nameblock_desc: 'duc.yml'    # Block device descriptor fileparameters:NUM_PORTS: 1ddc0:block_desc: 'ddc.yml'parameters:NUM_PORTS: 2radio0:block_desc: 'radio_2x64.yml'duc1:block_desc: 'duc.yml'parameters:NUM_PORTS: 1ddc1:block_desc: 'ddc.yml'parameters:NUM_PORTS: 2radio1:block_desc: 'radio_2x64.yml'replay0:block_desc: 'replay.yml'parameters:NUM_PORTS: 2MEM_ADDR_W: 30fft0:block_desc: 'fft_1x64.yml'parameters:EN_FFT_SHIFT: 1
# A list of all static connections in design
# ------------------------------------------
# Format: A list of connection maps (list of key-value pairs) with the following keys
#         - srcblk  = Source block to connect
#         - srcport = Port on the source block to connect
#         - dstblk  = Destination block to connect
#         - dstport = Port on the destination block to connect
connections:# ep0 to radio0(0) - RFA TX- { srcblk: ep0,    srcport: out0,  dstblk: duc0,   dstport: in_0 }- { srcblk: duc0,   srcport: out_0, dstblk: radio0, dstport: in_0 }# radio0(0) to ep0 - RFA RX- { srcblk: radio0, srcport: out_0, dstblk: ddc0,   dstport: in_0 }- { srcblk: ddc0,   srcport: out_0, dstblk: ep0,    dstport: in0  }# radio0(1) to ep1 - RFA RX- { srcblk: radio0, srcport: out_1, dstblk: ddc0,   dstport: in_1 }- { srcblk: ddc0,   srcport: out_1, dstblk: ep1,    dstport: in0  }# ep2 to radio1(0) - RFB TX- { srcblk: ep2,    srcport: out0,  dstblk: duc1,   dstport: in_0 }- { srcblk: duc1,   srcport: out_0, dstblk: radio1, dstport: in_0 }# radio1(0) to ep2 - RFB RX- { srcblk: radio1, srcport: out_0, dstblk: ddc1,   dstport: in_0 }- { srcblk: ddc1,   srcport: out_0, dstblk: ep2,    dstport: in0  }# radio1(1) to ep3 - RFB RX- { srcblk: radio1, srcport: out_1, dstblk: ddc1,   dstport: in_1 }- { srcblk: ddc1,   srcport: out_1, dstblk: ep3,    dstport: in0  }# ep4 to replay0(0)- { srcblk: ep4,     srcport: out0,  dstblk: replay0, dstport: in_0 }# replay0(0) to ep4- { srcblk: replay0, srcport: out_0, dstblk: ep4,     dstport: in0  }# ep5 to replay0(1)- { srcblk: ep5,     srcport: out0,  dstblk: replay0, dstport: in_1 }# replay0(1) to ep5- { srcblk: replay0, srcport: out_1, dstblk: ep5,     dstport: in0  }# BSP Connections- { srcblk: radio0, srcport: ctrl_port, dstblk: _device_, dstport: ctrlport_radio0 }- { srcblk: radio1, srcport: ctrl_port, dstblk: _device_, dstport: ctrlport_radio1 }- { srcblk: replay0, srcport: axi_ram, dstblk: _device_, dstport: dram }- { srcblk: _device_, srcport: x300_radio0, dstblk: radio0, dstport: x300_radio }- { srcblk: _device_, srcport: x300_radio1, dstblk: radio1, dstport: x300_radio }- { srcblk: _device_, srcport: time_keeper, dstblk: radio0, dstport: time_keeper }- { srcblk: _device_, srcport: time_keeper, dstblk: radio1, dstport: time_keeper }- { srcblk: ep_fft, srcport: out0, dstblk: fft0, dstport: in_0 }- { srcblk: fft0, srcport: out_0, dstblk: ep_fft, dstport: in0 }
# A list of all clock domain connections in design
# ------------------------------------------
# Format: A list of connection maps (list of key-value pairs) with the following keys
#         - srcblk  = Source block to connect (Always "_device"_)
#         - srcport = Clock domain on the source block to connect
#         - dstblk  = Destination block to connect
#         - dstport = Clock domain on the destination block to connect
clk_domains:- { srcblk: _device_, srcport: radio, dstblk: radio0, dstport: radio }- { srcblk: _device_, srcport: ce,    dstblk: ddc0,   dstport: ce    }- { srcblk: _device_, srcport: ce,    dstblk: duc0,   dstport: ce    }- { srcblk: _device_, srcport: radio, dstblk: radio1, dstport: radio }- { srcblk: _device_, srcport: ce,    dstblk: ddc1,   dstport: ce    }- { srcblk: _device_, srcport: ce,    dstblk: duc1,   dstport: ce    }- { srcblk: _device_, srcport: dram,  dstblk: replay0, dstport: mem  }- { srcblk: _device_, srcport: ce,  dstblk: fft0, dstport: ce  }

2. rfnoc_image_builder 生成新的fpga image

在yml文件所处位置打开命令行终端,并运行如下命令生成对应的fpga image。

rfnoc_image_builder -F <uhd安装路径>/fpga/ -y x310_rfnoc_image_core -t X310_HG 

该命令运行时间较长,请耐心等待......

命令运行完成后会在 <uhd安装路径>/fpga/usrp3/top/x300 目录下, 产生[build-X310_HG]文件夹,里面有 .bin 文件。

3. uhd_image_loader 下载 fpga image 到 USRP

使用uhd_image_loader命令,将.bin文件下载到fpga中

uhd_image_loader --fpga-path="./x300.bin" --args="type=x300"

4. 实验结果

终端运行 uhd_usrp_probe, 可见成功添加了 0/FFT#0 rfnoc block, 并且在框架中是单独连接的。

四、Adding an FFT Block to the Recive Chain

1. 修改 x310_rfnoc_image_core.yml 文件

该文件位于 <uhd安装路径>/fpga/usrp3/top/x300下,请拷贝该文件并对副本进行修改,切勿直接修改原文件。

$ cd <repo>/fpga/usrp3/top/x300/
$ cp x310_rfnoc_image_core.yml <副本>.yml

通过上面的例子,我们已经成功的往fpga image中添加了自己的rfnoc block。但是,这个fft block 是单独并没有与其他的rfnoc block进行静态连接。接下来,我们需要稍微修改一下yml文件,将fft block与内置的ddc block连接,这样我们就可以通过usrp直接得道fft之后的数据了。

修改后的内容为:

# General parameters
# -----------------------------------------
schema: rfnoc_imagebuilder_args         # Identifier for the schema used to validate this file
copyright: 'Ettus Research, A National Instruments Brand' # Copyright information used in file headers
license: 'SPDX-License-Identifier: LGPL-3.0-or-later' # License information used in file headers
version: '1.0'                          # File version
rfnoc_version: '1.0'                    # RFNoC protocol version
chdr_width: 64                          # Bit width of the CHDR bus for this image
device: 'x310'
default_target: 'X310_HG'# A list of all stream endpoints in design
# ----------------------------------------
stream_endpoints:ep0:                       # Stream endpoint namectrl: True                      # Endpoint passes control trafficdata: True                      # Endpoint passes data trafficbuff_size: 32768                # Ingress buffer size for dataep1:                       # Stream endpoint namectrl: False                     # Endpoint passes control trafficdata: True                      # Endpoint passes data trafficbuff_size: 0                    # Ingress buffer size for dataep2:                       # Stream endpoint namectrl: False                     # Endpoint passes control trafficdata: True                      # Endpoint passes data trafficbuff_size: 32768                # Ingress buffer size for dataep3:                       # Stream endpoint namectrl: False                     # Endpoint passes control trafficdata: True                      # Endpoint passes data trafficbuff_size: 0                    # Ingress buffer size for dataep4:                       # Stream endpoint namectrl: False                     # Endpoint passes control trafficdata: True                      # Endpoint passes data trafficbuff_size: 4096                 # Ingress buffer size for dataep5:                       # Stream endpoint namectrl: False                     # Endpoint passes control trafficdata: True                      # Endpoint passes data trafficbuff_size: 4096                 # Ingress buffer size for data# A list of all NoC blocks in design
# ----------------------------------
noc_blocks:duc0:                      # NoC block nameblock_desc: 'duc.yml'    # Block device descriptor fileparameters:NUM_PORTS: 1ddc0:block_desc: 'ddc.yml'parameters:NUM_PORTS: 2radio0:block_desc: 'radio_2x64.yml'duc1:block_desc: 'duc.yml'parameters:NUM_PORTS: 1ddc1:block_desc: 'ddc.yml'parameters:NUM_PORTS: 2radio1:block_desc: 'radio_2x64.yml'replay0:block_desc: 'replay.yml'parameters:NUM_PORTS: 2MEM_ADDR_W: 30fft0:block_desc: 'fft_1x64.yml'parameters:EN_FFT_SHIFT: 1
# A list of all static connections in design
# ------------------------------------------
# Format: A list of connection maps (list of key-value pairs) with the following keys
#         - srcblk  = Source block to connect
#         - srcport = Port on the source block to connect
#         - dstblk  = Destination block to connect
#         - dstport = Port on the destination block to connect
connections:# ep0 to radio0(0) - RFA TX- { srcblk: ep0,    srcport: out0,  dstblk: duc0,   dstport: in_0 }- { srcblk: duc0,   srcport: out_0, dstblk: radio0, dstport: in_0 }# radio0(0) to ep0 - RFA RX- { srcblk: radio0, srcport: out_0, dstblk: ddc0,   dstport: in_0 }- { srcblk: ddc0,   srcport: out_0, dstblk: fft0,    dstport: in_0  }- { srcblk: fft0,   srcport: out_0, dstblk: ep0,    dstport: in0  }# radio0(1) to ep1 - RFA RX- { srcblk: radio0, srcport: out_1, dstblk: ddc0,   dstport: in_1 }- { srcblk: ddc0,   srcport: out_1, dstblk: ep1,    dstport: in0  }# ep2 to radio1(0) - RFB TX- { srcblk: ep2,    srcport: out0,  dstblk: duc1,   dstport: in_0 }- { srcblk: duc1,   srcport: out_0, dstblk: radio1, dstport: in_0 }# radio1(0) to ep2 - RFB RX- { srcblk: radio1, srcport: out_0, dstblk: ddc1,   dstport: in_0 }- { srcblk: ddc1,   srcport: out_0, dstblk: ep2,    dstport: in0  }# radio1(1) to ep3 - RFB RX- { srcblk: radio1, srcport: out_1, dstblk: ddc1,   dstport: in_1 }- { srcblk: ddc1,   srcport: out_1, dstblk: ep3,    dstport: in0  }# ep4 to replay0(0)- { srcblk: ep4,     srcport: out0,  dstblk: replay0, dstport: in_0 }# replay0(0) to ep4- { srcblk: replay0, srcport: out_0, dstblk: ep4,     dstport: in0  }# ep5 to replay0(1)- { srcblk: ep5,     srcport: out0,  dstblk: replay0, dstport: in_1 }# replay0(1) to ep5- { srcblk: replay0, srcport: out_1, dstblk: ep5,     dstport: in0  }# BSP Connections- { srcblk: radio0, srcport: ctrl_port, dstblk: _device_, dstport: ctrlport_radio0 }- { srcblk: radio1, srcport: ctrl_port, dstblk: _device_, dstport: ctrlport_radio1 }- { srcblk: replay0, srcport: axi_ram, dstblk: _device_, dstport: dram }- { srcblk: _device_, srcport: x300_radio0, dstblk: radio0, dstport: x300_radio }- { srcblk: _device_, srcport: x300_radio1, dstblk: radio1, dstport: x300_radio }- { srcblk: _device_, srcport: time_keeper, dstblk: radio0, dstport: time_keeper }- { srcblk: _device_, srcport: time_keeper, dstblk: radio1, dstport: time_keeper }# A list of all clock domain connections in design
# ------------------------------------------
# Format: A list of connection maps (list of key-value pairs) with the following keys
#         - srcblk  = Source block to connect (Always "_device"_)
#         - srcport = Clock domain on the source block to connect
#         - dstblk  = Destination block to connect
#         - dstport = Clock domain on the destination block to connect
clk_domains:- { srcblk: _device_, srcport: radio, dstblk: radio0, dstport: radio }- { srcblk: _device_, srcport: ce,    dstblk: ddc0,   dstport: ce    }- { srcblk: _device_, srcport: ce,    dstblk: duc0,   dstport: ce    }- { srcblk: _device_, srcport: radio, dstblk: radio1, dstport: radio }- { srcblk: _device_, srcport: ce,    dstblk: ddc1,   dstport: ce    }- { srcblk: _device_, srcport: ce,    dstblk: duc1,   dstport: ce    }- { srcblk: _device_, srcport: dram,  dstblk: replay0, dstport: mem  }- { srcblk: _device_, srcport: ce,  dstblk: fft0, dstport: ce  }

2. rfnoc_image_builder 生成新的fpga image

在yml文件所处位置打开命令行终端,并运行如下命令生成对应的fpga image。

rfnoc_image_builder -F <uhd安装路径>/fpga/ -y x310_rfnoc_image_core -t X310_HG 

该命令运行时间较长,请耐心等待......

命令运行完成后会在 <uhd安装路径>/fpga/usrp3/top/x300 目录下, 产生[build-X310_HG]文件夹,里面有 .bin 文件。

3. uhd_image_loader 下载 fpga image 到 USRP

使用uhd_image_loader命令,将.bin文件下载到fpga中

uhd_image_loader --fpga-path="./x300.bin" --args="type=x300"

4. 实验结果

终端运行 uhd_usrp_probe, 可见成功添加了 0/FFT#0 rfnoc block, 并且成的导入了 Rx 接收链路中。

五、参考链接

1. 北京海曼无限信息技术有限公司

2. Getting Started with RFNoC in UHD 4.0 - Ettus Knowledge Base


http://www.ppmy.cn/news/131469.html

相关文章

STM32 USB数据接收与数据发送过程

既然学习了USB&#xff0c;那就必须的搞懂USB设备与USB主机数据是怎么通讯的。这里主要讲设备端&#xff0c;因为我们的代码是做USB设备用的。 我们需要必须要定义了USB中断。起始在STM32的中断向量表中给USB两个中断&#xff0c;我们可以在stm32f10x.h中找到这两个中断&#…

STM32 USB CDC 虚拟多串口

转自: http://www.stmcu.org.cn/module/forum/thread-613510-1-1.html 楼主 发表于 2017-9-28 22:30:04 | 只看该作者 |只看大图 本帖最后由 creep 于 2017-9-28 22:37 编辑 之前一直使用STM32的CDC虚拟串口和上位机进行数据通信&#xff0c;通常只枚举一个串口基本…

STM32 USB复合设备实现

可实现用一个USB接口实现多个USB设备&#xff0c;如 HIDMSC&#xff1b; HIDCDC&#xff1b; HIDCDCMSC等等 使用HAL库&#xff0c;以HIDMSC为例 具体步骤&#xff1a; 文章目录 一、增加端点二、更改设备描述符三、HIDMSC内核配置1、新建结构体2、配置描述符3、实现函数 四、…

高通SDX55平台:adb功能异常

高通SDX55平台&#xff1a;adb功能异常 1. 问题描述2. 问题分析2.1 测试环境2.2 初步分析2.3 USB驱动初始化2.3.1 USB驱动加载流程2.3.1.1 USB_init初始化2.3.1.2 usb_hub_init2.3.1.3 usb设备插入后usbufs驱动加载 2.3.2 adb请求后usbfs设备驱动初始化流程 2.4 adb接口枚举流程…

STM32F750成功运行Linux

论坛发帖太分散了&#xff0c;在此记录一下我开发STM32F750 uClinux开发板的进程&#xff0c;这是第一篇&#xff0c;发表于2018年12月。 前段时间ST推出了Value Line的STM32F750和H750两个系列&#xff0c;看了一下选型表&#xff0c;F750有LQFP144封装&#xff0c;正好适合我…

【BK3633】规格书

目录&#xff1a; 1. 资源预览1.1 特性1.2 引脚 2 功能描述2.1 GPIO2.2 定时器2.2.1 PWM 定时器2.2.2 看门狗定时器和RTC定时器2.2.3 亚微秒事件定时器 2.3 ADC2.4 UART、I2C和SPI2.5 USB2.6 真随机数生成器2.7 I2S音频数字接口2.8 代码加密和系统安全2.9 到达角和离开角 3 电力…

【R】【课程笔记】06 金融波动模型

本文是课程《数据科学与金融计算》第6章的学习笔记&#xff0c;主要介绍GARCH类、SV类模型和高频波动模型&#xff0c;用于知识点总结和代码练习&#xff0c;Q&A为问题及解决方案。 往期回顾&#xff1a; 博文内容【R】【课程笔记】01 R软件基础知识数据类型、数据结构、…

matlab地心坐标系和GPS坐标系的转换

** 卑微小兰的第一篇&#xff1a;matlab地心坐标系和GPS坐标系的转换&#xff0c;emmm GPS坐标系和大地坐标系的正反变换 a6378137; f0.00669437999014;%第一偏心率平方 B40; L50; H60; Na/((1-f*(sind(B)))^0.5)%N为地心到该点的空间距离 X(NH)cosd(B)cosd(L); Y(NH)cosd(B)…