Intel® Quartus® Prime Standard Edition User Guide: Debug Tools

ID 683552
Date 9/24/2018
Public
Document Table of Contents

5.9.2. Using the Signal Tap MATLAB* MEX Function to Capture Data

When you use MATLAB* for DSP design, you can acquire data from the Signal Tap Logic Analyzer directly into a matrix in the MATLAB* environment by calling the MATLAB* MEX function alt_signaltap_run, built into the Intel® Quartus® Prime software. If you use the MATLAB* MEX function in a loop, you can perform as many acquisitions in the same amount of time as you can when using Signal Tap in the Intel® Quartus® Prime software environment.
Note: The Signal Tap MATLAB* MEX function is available in the Windows* version and Linux version of the Intel® Quartus® Prime software. This function is compatible with MATLAB* Release 14 Original Release Version 7 and later.

To set up the Intel® Quartus® Prime software and the MATLAB* environment to perform Signal Tap acquisitions:

  1. In the Intel® Quartus® Prime software, create an .stp file.
  2. In the node list in the Data tab of the Signal Tap Logic Analyzer Editor, organize the signals and groups of signals into the order in which you want them to appear in the MATLAB* matrix.

    Each column of the imported matrix represents a single Signal Tap acquisition sample, while each row represents a signal or group of signals in the order you defined in the Data tab.

    Note: Signal groups that the Signal Tap Logic Analyzer acquires and transfers into the MATLAB* MEX function have a width limit of 32 signals. To use the MATLAB* MEX function with a bus or signal group that contains more than 32 signals, split the group into smaller groups that do not exceed the limit.
  3. Save the .stp file and compile your design. Program your device and run the Signal Tap Logic Analyzer to ensure your trigger conditions and signal acquisition work correctly.
  4. In the MATLAB* environment, add the Intel® Quartus® Prime binary directory to your path with the following command:
    addpath <Quartus install directory>\win

    You can view the help file for the MEX function by entering the following command in MATLAB* without any operators:

    alt_signaltap_run

  5. Use the MATLAB* MEX function to open the JTAG connection to the device and run the Signal Tap Logic Analyzer to acquire data. When you finish acquiring data, close the JTAG connection.

    To open the JTAG connection and begin acquiring captured data directly into a MATLAB* matrix called stp, use the following command:

    stp = alt_signaltap_run \
    ('<stp filename>'[,('signed'|'unsigned')[,'<instance names>'[, \
    '<signalset name>'[,'<trigger name>']]]]);

    When capturing data, you must assign a filename, for example, <stp filename> as a requirement of the MATLAB* MEX function. Other MATLAB* MEX function options are described in the table:

    Table 66.   Signal Tap MATLAB* MEX Function Options
    Option Usage Description
    signed

    unsigned

    'signed'

    'unsigned'

    The signed option turns signal group data into 32-bit two’s-complement signed integers. The MSB of the group as defined in the Signal Tap Data tab is the sign bit. The unsigned option keeps the data as an unsigned integer. The default is signed.
    <instance name> 'auto_signaltap_0' Specify a Signal Tap instance if more than one instance is defined. The default is the first instance in the .stp, auto_signaltap_0.
    <signal set name>

    <trigger name>

    'my_signalset'

    'my_trigger'

    Specify the signal set and trigger from the Signal Tap data log if multiple configurations are present in the .stp. The default is the active signal set and trigger in the file.

    During data acquisition, you can enable or disable verbose mode to see the status of the logic analyzer. To enable or disable verbose mode, use the following commands:

    alt_signaltap_run('VERBOSE_ON');-alt_signaltap_run('VERBOSE_OFF');

    When you finish acquiring data, close the JTAG connection with the following command:

    alt_signaltap_run('END_CONNECTION');

    For more information about the use of MATLAB* MEX functions in MATLAB*, refer to the MATLAB* Help.