fpga
Add-On Required: This feature requires the Wireless Testbench™ Support Package for NI™ USRP™ Radios add-on.
Description
This object represents a connection from MATLAB® to the DUT (user logic) on the FPGA on an NI™ USRP™ radio device.
To interact with the DUT, use this object with the functions listed in Object Functions:
Add RFNoC interfaces by using the
addRFNoCRegisterInterface
andaddRFNoCStreamInterface
functions.Map
hdlcoder.DUTPort
(HDL Coder) objects to your interfaces by using themapPort
function.Read and write DUT ports by using the
readPort
andwritePort
functions.
The diagram shows the internal architecture of an NI
USRP radio. The fpga
object enables you
to configure register ports and data streaming ports on your DUT, and then
read and write data to them.
To use this object, first create a connection to your NI
USRP radio device using the usrp
System object™. Then, use the usrp
System object and fpga
object functions. The
diagram shows the sequence.
Create a
usrp
System objectdevice
with a saved radio configuration,"MyRadio"
.If you have not yet loaded your bitstream onto your radio device, use the
programFPGA
to do so.Configure the hardware interfaces with the
describeFPGA
function.
For details, see the
usrp
call sequence in Object Functions on theusrp
reference page.Create an
fpga
object with theusrp
System objectdevice
.Add interfaces to the
fpga
object that correspond to the interfaces in your DUT.Add one RFNoC register interface for all DUT register ports by using the
addRFNoCRegisterInterface
function.Add an RFNoC streaming interface for each DUT streaming port by using the
addRFNoCStreamInterface
function.Create an
hdlcoder.DUTPort
(HDL Coder) object to represent each of your DUT port names. Use this to specify the properties of the port.Use the
mapPort
function to map the DUT ports to the RFNoC interfaces.
Call the
setup
function on theusrp
System objectdevice
to start the radio front end.Read and write data to the DUT by using the
readPort
andwritePort
functions.Call the
release
function to release the hardware resources.
The MATLAB code you need to get started is included in the host interface script that you generate in Run and Verify Hardware Implementation of the targeting workflow.
Creation
Syntax
Description
Input Arguments
Object Functions
Use the object functions to interact with your FPGA or SoC device.
addRFNoCRegisterInterface | Add RFNoC register interface to your DUT |
addRFNoCStreamInterface | Add RFNoC streaming interface to your DUT |
mapPort | Map DUT port to RFNoC interface |
writePort | Write input data to DUT port |
readPort | Read output data from DUT port |
release | Release the hardware resources associated with
fpga object |
Examples
Version History
Introduced in R2024a