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
This example uses:
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);
This example uses:
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
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"
Name assigned to the RFNoC streaming interface, specified as a string scalar.
Example: "yourDUTSubsystemName"
Data Types: string
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
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
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 of the readPort
function in seconds, specified as one of these options:
An empty array — The timeout is calculated based on the frame size and sample rate, where
'Timeout'=1+(andFrameSize/SampleRate)SampleRateis a property of theusrpobject.A positive integer — The timeout is equal to the value that you specify.
0— ThereadPortfunction returns the number of samples currently in the buffer without waiting for a full frame.
Example: 5
Dependencies
Specify this argument only if the streaming interface is an output from the DUT.
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.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)