A default assignment assigns a value only if the variable is undefined.
default <variable_name>=<value_or_expression>;
The scope of a default variable is restricted to driver-scoped with a static lifetime. A value must be assigned to a variable declared as default. The value cannot be blank. An example of declaring a default variable is:
default x = 5;
Default variables assigned in an ASL script can be overridden by the value of the variables specified during the startup of an adapter with the -D option.
Any variable assignment not defined as default can override the default value and, if one exists, the value that was assigned by using the -d option.
The following code fragment prints the number 1 if there is no integer value to assign to y.
x = 1; default y = 1; START do { print("x=".x); print("y=".y); stop(); } Output with the -D option: $ sm_adapter -Dx=2 -Dy=2 default.asl x=1 y=2 Output without the -D option: $ sm_adapter default.asl x=1 y=1