This chapter describes the functions that are globally available in all scripts written in the Antares DSL programming language.

Arithmetic Functions

/**
 * Computes the binary logarithm (base 2) of a given value.
 *
 * The result is rounded up to the next bigger integer value in order to
 * provide enough bits when used to calculate the number of necessary bits that
 * represent a number whose number of bits is given by [value].
 *
 * Examples:
 * - log2(8) = 3
 * - log2(10) = 4
 * - log2(16) = 4
 */
private fun log2(value: Long): Long

/**
 * Extracts [size] bits at position [pos] from [signal], where bit positions start with 0.
 * Example: bits(31, 3, 2) = 3.
 */
private fun bits(signal: Long, pos: Long, size: Long): Long