5.9.2. Using the Signal Tap MATLAB* MEX Function to Capture Data
To set up the Intel® Quartus® Prime software and the MATLAB* environment to perform Signal Tap acquisitions:
- In the Intel® Quartus® Prime software, create an .stp file.
- 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.
- 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.
- 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:
- 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
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>
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:
When you finish acquiring data, close the JTAG connection with the following command:
For more information about the use of MATLAB* MEX functions in MATLAB*, refer to the MATLAB* Help.
Did you find the information on this page useful?