UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 22973

8.1 AccelDSP Synthesis Tool - Is there a way to lint check MATLAB code to help with debugging?

Description

Is there a way to lint check MATLAB code to help with debugging?

Solution

MATLAB includes a command called "mlint" that can be entered from the MATLAB console tab within AccelDSP. The mlint command operates off of files in the current directory (where your project files are located) and it reports back on unused variables, mismatched argument lists, and such. The following is an example: 

 

>> mlint('design_function.m') 

 

L 1 (C 43-58): Function name 'des_function' will be known to MATLAB by its file name: 'design_function'. 

L 1 (C 79-86): Input variable 'load' appears never to be used. 

L 6 (C 1-11): The value assigned here to variable 'COUNT' might never be used. 

L 9 (C 12-22): Persistent variable 'num' may never be used. 

L 28 (C 5-22): The value assigned here to variable 'count_plus_one' might never be used. 

L 150 (C 32): Use && instead of & as the AND operator in (scalar) conditional statements. 

 

To open a window with an M-Lint Code Check Report on the entire project directory, enter: 

mlintrpt

AR# 22973
Date Created 09/04/2007
Last Updated 05/20/2014
Status Archive
Type General Article