addRFNoCStreamInterface
Add-On Required: This feature requires the Wireless Testbench™ Support Package for NI™ USRP™ Radios add-on.
Description
addRFNoCStreamInterface(
adds an RFNoC streaming interface that you can use to control the DUT
ports mapped to data streaming interfaces in the generated IP core from
MATLAB® and specifies name-value arguments.dut
,Name=Value
)
Examples
Access DUT, Map RFNoC Streaming Interface, and Read Data
This example uses:
- Wireless TestbenchWireless Testbench
- Wireless Testbench Support Package for NI USRP RadiosWireless Testbench Support Package for NI USRP Radios
- HDL CoderHDL Coder
- HDL Coder Support Package for Xilinx FPGA and SoC DevicesHDL Coder Support Package for Xilinx FPGA and SoC Devices
Create a usrp
System object, specifying a radio setup configuration previously saved in the Radio Setup wizard.
device = usrp("MyRadio");
Configure your radio with the target interfaces.
describeFPGA(device,"ModelName_wthandoffinfo.mat");
Create an fpga
object to access your DUT on the FPGA of your radio.
dut = fpga(device);
Add an RFNoC streaming interface to your DUT.
addRFNoCStreamInterface(dut, ... "InterfaceID","RX_STREAM#0", ... "Streamer","0/RX_STREAM#0", ... "Direction","OUT", ... "FrameSize",1000, ... "DDRAllocation",1000, ... "Timeout",[]);
Create an hdlcoder.DUTPort
(HDL Coder) object for the DUT port and specify the properties.
DUTPort_Data_Out = hdlcoder.DUTPort("Data_Out", ... "Direction", "OUT", ... "DataType", "uint32", ... "IsComplex", false, ... "Dimension", [1 1], ... "IOInterface", "RX_STREAM#0");
Map the DUT port to the RFNoC interface that you added to your DUT.
mapPort(dut,DUTPort_Data_Out);
Connect to the radio and apply radio front end properties.
setup(device);
Call the usrp
System object as a function to start the radio front end. Request 1000 samples.
device(1000);
Read data from the DUT port.
[dataRx,numSamps,overflow] = readPort(dut,"Data_Out")
dataRx = 1000×1 uint32 column vector
4294901766
5
262150
4
4294901760
4294639613
131073
4294574078
4294639617
4294967294
⋮
numSamps = 1000
overflow = logical
0
Release the hardware resources.
release(dut);
Access DUT, Map RFNoC Streaming Interface, and Write Data
This example uses:
- Wireless TestbenchWireless Testbench
- Wireless Testbench Support Package for NI USRP RadiosWireless Testbench Support Package for NI USRP Radios
- HDL CoderHDL Coder
- HDL Coder Support Package for Xilinx FPGA and SoC DevicesHDL Coder Support Package for Xilinx FPGA and SoC Devices
Create a usrp
System object, specifying a radio setup configuration previously saved in the Radio Setup wizard.
device = usrp("MyRadio");
Configure your radio with the target interfaces.
describeFPGA(device,"ModelName_wthandoffinfo.mat");
Create an fpga
object to access your DUT on the FPGA of your radio.
dut = fpga(device);
Add an RFNoC streaming interface to your DUT. Specify a frame size and DDR allocation of dataLength
samples.
dataLength = 1000; addRFNoCStreamInterface(dut, ... "InterfaceID","TX_STREAM#0", ... "Streamer","0/TX_STREAM#0", ... "Direction","IN", ... "FrameSize",dataLength, ... "DDRAllocation",dataLength, ... "WriteMode","continuous");
Create an hdlcoder.DUTPort
(HDL Coder) object for the DUT port and specify the properties.
DUTPort_Data_In = hdlcoder.DUTPort("Data_In", ... "Direction", "IN", ... "DataType", "uint32", ... "IsComplex", false, ... "Dimension", [1 1], ... "IOInterface", "TX_STREAM#0");
Map the DUT port to the RFNoC interface that you added to your DUT.
mapPort(dut,DUTPort_Data_In);
Connect to the radio and apply radio front end properties.
setup(device);
Generate random data with length dataLength
and write it to the DUT port.
data = randn(dataLength,1);
numSamps = writePort(dut,"Data_In",data)
numSamps = 1000
Release the hardware resources.
release(dut);
Input Arguments
dut
— Target DUT on FPGA of target NI™ USRP™ radio device
fpga
object
Target DUT on the FPGA of a target NI
USRP radio device, specified as an fpga
object.
Name-Value Arguments
Specify
pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where
Name
is the argument name and
Value
is the corresponding value. Name-value
arguments must appear after other arguments, but the order of the pairs
does not matter.
Example: InterfaceID
="yourDUTSubsystemName"
,
Streamer
="0/RX_STREAM#0"
InterfaceID
— Name assigned to RFNoC streaming interface
string scalar
Name assigned to the RFNoC streaming interface, specified as a string scalar.
Example: "yourDUTSubsystemName"
Data Types: string
Streamer
— Name of RFNoC streamer
string scalar
Name of the RFNoC streamer, specified as a string. The RFNoC streamer name is generated from the interfaces that you assign in the Map Target Interfaces step of the targeting workflow. The format is:
Data_In0 —
"0/RX_STREAM#0"
Data_InN —
"0/RX_STREAM#N"
Data_Out0 —
"0/TX_STREAM#0"
Data_OutN —
"0/TX_STREAM#N"
Example: "0/RX_STREAM#2"
Data Types: string
Direction
— Interface direction
"IN"
| "OUT"
Interface direction, specified as one of the following options:
"IN"
— The interface is an input to the DUT."OUT"
— The interface is an output from the DUT.
Data Types: string
DDRAllocation
— Memory allocation in samples
even positive integer
Memory allocation in the PL DDR buffer in samples, specified
as an even positive integer. Set this to the same value as
FrameSize
.
Set this property only if you specified streaming connections to the PL DDR buffer in the Map Target Interfaces step of the targeting workflow.
Example: 250e6
Timeout
— Timeout in seconds
positive integer | empty array []
Timeout in seconds of the readPort
function, specified as a positive integer
or an empty array.
If you do not set this argument or set it to
[]
, the timeout is calculated based on the
frame size and sample rate, where
'Timeout'=1+(
and FrameSize
/SampleRate)SampleRate
is a property of the usrp
object.
Example: 5
Dependencies
Specify this argument only if the streaming interface is an output from the DUT.
WriteMode
— Write mode
"continuous"
| "once"
Write mode, specified as one of these options.
You can write data continuously only if the data streaming interface is connected to the PL DDR Buffer. You specify this connection in the Map Target Interfaces step of the targeting workflow.
Example: 5
Dependencies
Specify this argument only if the streaming interface is an input to the DUT.
Version History
Introduced in R2024a
See Also
Objects
Functions
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)