Main Content

readPort

Receive data from DUT ports

Since R2024b

Description

data = readPort(filobj,portName1) reads the data from control output port portName1 and assigns it to a variable named data.

example

[data1,data2,...] = readPort(filobj, portName1,portName2,...) reads the data from streaming data port portName1, portName2, ... and assigns them to data1, data2.

example

Examples

collapse all

Instantiate a FILFreeRunning object and use the readPort function to receive data from DUT ports.

First, instantiate the FIL object, and load the FPGA with the bitfile.

obj = DUT_fil;
programFPGA(obj);

Next, set the length of the frame that you want to read from the streaming data port. You can optionally specify a timeout value in seconds.

obj.ReadFrameLength =128;
obj.TimeOut = 3;

You can receive a scalar value from one control data port at a time. You can read from all streaming output ports at once.

This example reads a status from the control data port status, and then it reads a frame of 128 from streaming data ports dout1 and dout2.

statusValue = readPort(obj,"status");
[d1,d2] = readPort(obj,"dout1","dout2");

Input Arguments

collapse all

Instance of a hdlverifier.FILFreeRunning object.

Name of an output port, specified as a string.

Version History

Introduced in R2024b