Product Documentation
Cadence SKILL IDE User Guide
Product Version IC23.1, August 2023

Rule Access Macros

You can use the following macros in either the test statement or the rules commands of the SK_RULE macro:

Rule Access Macro Description

SK_ARGS()

Returns the list of the arguments to the function call under test. This macro takes no arguments. The list values returned by this macro should never be destructively altered (using rplaca etc.) because that would produce unknown effects.

SK_CUR_FILENAME()

Returns the name of file currently being checked in a SKILL Lint rule. For example:

SK_RULE( test
t
printf( "Current file being checked is: ’%s’\n"
SK_CUR_FILENAME() )
)

SK_NTH_ARG(n)

Returns the specified argument number (n) in the function call. n is zero-based: 0 is the first argument to the function call; 1 is the second argument, etc. You must not destructively alter the list values returned by this macro (for example, using rplaca) because that would produce unknown effects.

SK_FUNCTION()

Returns the name of the function call under test. You might want to establish the function name where the same rule is being used for several different functions. You must not destructively alter the list values returned by this macro (for example, using rplaca) because that would produce unknown effects.

SK_FORM([n])

Returns the entire function call under test as a list. If you specify n, this macro returns the call n levels up the call stack. For example, if an if is called in a foreach that is in a let, SK_FORM(2) returns the call to let.

SK_FORM(0) is the same as SK_FORM(). SK_ARGS is effectively the same as cdr(SK_FORM()) and SK_FUNCTION is effectively the same as car(SK_FORM()).

You must not destructively alter the list values returned by this macro (for example, using rplaca) because that would produce unknown effects.

Related Topics

SKILL Lint Rules

Rule Reporting Macros

Advanced Rule Macros


Return to top
 ⠀
X