OpenSTA logo OpenSTA SCL Reference
Conditional Compilation

Conditional Compilation

Previous versions of SCL provided commands that enable you to define the circumstances for the compilation of a section of code. Conditional sections of code were marked with 'variants', these were specifiable on the '-V' option on the SCL compiler command line. In OpenSTA, SCL compilation happens automatically at test run time and there is currently no way of specifying what variants to supply - this renders this feature useless in the current OpenSTA. The documentation below shows the syntax that will not cause errors at compile but is otherwise useless, just in case we choose to resurrect this feature.

Conditional compilation commands may appear at any point within the Environment, Definitions, and Code: sections, including before the ENTRY command and between subroutines. They cannot appear part way through a command or statement. They may be nested to a depth of 10.

Command Definition:

#condition variant

condition

A conditional compilation command which starts or ends a section of code. This may be one of the following:

conditionmeaning
IFDEFCompile next section if variant requested
IFNDEFCompile next section if variant not requested
ELIFOtherwise compile next section if variant requested
ELSEOtherwise compile the next section
ENDIFEnd of variant section

The #IFDEF, #IFNDEF and #ELIF commands require the variant parameter, to specify the condition under which the following section of code will be compiled. The #ELSE and #ENDIF commands relate to the most recently specified variant.

variant

An OpenSTA Dataname which identifies a section of code that is only compiled under certain conditions. The compiler processes this variant in conjunction with the -V option on the SCL command line.

Examples:

#IFDEF variant1
	log "Only compiled if -V=variant1 is specified"
#ELIF variant2
	log "Only compiled if -V=variant2 is specified"
#ELSE
	log "Only compiled if neither variant is specified"
#ENDIF

<<<
prev page
^^^
section start
>>>
next page