IO Data Source

Play back recorded data

  • Library:
  • SoC Blockset / Processor Testbench

Description

The IO Data Source block enables you to import recorded hardware IO data and play it back in your Simulink® model. The block converts the input data into a message signal that you can give as input to the TCP Read, UDP Read, Stream Read, or Register Read block, depending on the device type you choose to use. The playback of hardware IO data in your Simulink model helps you develop models with better accuracy than models developed using randomly generated data during simulation.

When you develop models that use real hardware IO data during deployment, you can choose to use randomly generated synthetic data as hardware IO data in simulation. As physical hardware data accounts to various effects like data loss, time delay etc. If you use synthetic data as hardware IO data in simulation for such models, it leads to unexpected results when you deploy it in the hardware board. Hence, to evaluate and verify such models, using real hardware IO data during simulation is recommended. For more information on how to record hardware IO data and save it to your host computer, see the soc.recorder object.

Ports

Input

expand all

Input data, specified as a numeric vector. The block converts this data into a bus signal of the specific device type specified by the Device type parameter. Match the data type of this input data with the data type you select in the Data type parameter. The output bus signal consists of data values, length of data and valid status of data in it.

Dependencies

To enable this port, set the Input source parameter to From input port.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | Boolean | fixed point

Data length specified as a scalar.

Dependencies

To enable this port, set the Input source parameter to From input port.

Data Types: uint32

When valid is 1, the block captures the input data from the data and length ports. When valid is 0, the block considers the input data as invalid and does not capture it.

Dependencies

To enable this port, set the Input source parameter to From input port.

Data Types: Boolean

When done is 1, the block ceases capturing the input data from the data and length ports. When done is 0, the block captures the input data from the data and length ports.

Dependencies

To enable this port, set the Device type parameter to Stream.

Data Types: Boolean

Output

expand all

Task event signal, returned as a bus signal. This bus signal indicates to the Task Manager block that a task needs to be executed.

Dependencies

To enable this port, select Show event port parameter.

Data Types: bus

Register data, returned as a message. The output of this port connects to the Register Data port of the Register Read block only.

Dependencies

To enable this port, set Device type parameter to Register.

Data Types: double

AXI Stream data, returned as a message. The output of this port connects to the Stream Data port of Stream Read block.

Dependencies

To enable this port, set the Device type parameter to Stream.

Data Types: double

UDP data, returned as a message. The output of this port connects to the UDP Data port of UDP Read block.

Dependencies

To enable this port, set the Device type parameter to UDP.

Data Types: double

TCP data, returned as a message. The output of this port connects to the TCP Data port of TCP Read block.

Dependencies

To enable this port, set the Device type parameter to TCP.

Data Types: double

Parameters

expand all

Set the source of input data for the block by selecting one of these values:

  • From file — Read data from a recorded data file.

  • From dialog — Input a one-dimensional array of data by using a function. Specify this function in Value parameter box.

  • From input port — Input data and signals using input ports on the block.

Specify a MATLAB® function that creates a row vector of numeric data. This row vector is captured as the input data for the block.

Dependencies

To enable this parameter, set the Input source parameter to From dialog.

Select the data type of the input data to be received by the data port.

Dependencies

To enable this parameter, set the Input source parameter to From file.

Select a device type to enable the corresponding output data port.

  • UDP — Enables the UDP Data output port.

  • TCP — Enables the TCP Data output port.

  • Register — Enables the Register Data output port.

  • Stream — Enables the Stream Data output port.

Dependencies

To enable this parameter, set the Input source parameter to From input port or From dialog.

Specify a discrete time interval in seconds at which the block outputs data.

Dependencies

To enable this parameter, set the Input source parameter to From dialog or From file.

Specify the size of the input data. The block reads this number of samples per frame during reading and playback in simulation.

Dependencies

To enable this parameter, set the Input source parameter to From file.

Specify the full path to the recorded data file on the host PC or browse and select the file on the host PC. This block supports only TGZ files created using SoC Blockset™ data recording API.

Dependencies

To enable this parameter, set the Input source parameter to From file.

Specify the source name of the dataset you want to use as the input source available within the recorded data specified in the Dataset name parameter. You can either type the name in the Source name box or click Select to select the name from the list of sources available in the recorded data file.

Dependencies

To enable this parameter, set the Input source parameter to From file.

Specify the number of data elements to store in the input data queue.

Dependencies

To enable this parameter, set the Device type parameter to Stream.

Select this parameter to enable the Event port. Clear this parameter, to disable the Event port.

Extended Capabilities

Introduced in R2019a