The top-level globals
key can be used to set globals and environment variables. The globals
key uses the following structure:
globals:
version: 0.4
environment_variables:
ENVIRONMENT_VARIABLE_1: Value1
ENVIRONMENT_VARIABLE_2: Value2
...
expression_custom_functions:
- path_to_script_1.py
- path_to_script_2.py
Multiple globals
keys can exist in a specification using different prefixes and/or suffixes. For example,
globals1: ...
and globals2: ...
may exist as two distinct globals top-keys, and their contents will be
combined by the parser.
environment_variables
keyThis key contains a dictionary of environment variables that will be activated for Timeloop+Accelergy calls. The following settings are accepted:
\*ACCELERGY_COMPONENT_LIBRARIES\*: <PATH>
: Add a path to the search path for the Accelergy Library Plug-In. Files found in this path will be used to find estimations for primitive components. Prefixes and suffixes are allowed for this key, allowing multiple keys to specify multiple paths.TIMELOOP_HIDE_INCONSEQUENTIAL_STATS: 1
: Do not output zero-energy zero-access buffers and networks in Timeloop outputs.TIMELOOP_OUTPUT_STAT_DEFAULT_FLOAT: 0
: Disable default C++-style float representations.TIMELOOP_OUTPUT_STAT_SCIENTIFIC: 1
: Set to 1
to use scientific notation in Timeloop statistic outputs. Use with TIMELOOP_OUTPUT_STAT_DEFAULT_FLOAT: 0
.TIMELOOP_USE_ISL: 1
: Enable ISL-based mapping evaluation.expression_custom_functions
keyThis key contains a list of paths to Python scripts which include functions that may be useful for parsing expressions. The parser will import the pointed-to and make all functions in the top-level scope available to the parser. For example, the following is allowed:
In script.py:
def my_function(x):
return x + 5
In the YAML specification:
globals:
version: 0.4
expression_custom_functions:
- script.py
...
variables:
evaluated_value: my_function(5) # Imported my_function from script.py
For more information on parsing expressions, see the arithmetic parsing page.