Quartus® Prime Pro Edition User Guide: Scripting

ID 683432
Date 9/30/2024
Public
Document Table of Contents

2.9.4. Arithmetic

Use the expr command to perform arithmetic calculations. Use curly braces (“{ }”) to group the arguments of this command for greater efficiency and numeric precision.
set a 5
set b [expr { $a + sqrt(2) }]

The Quartus® Prime software supports all standard Tcl boolean and arithmetic operators, such as && (AND), || (OR), ! (NOT), and comparison operators such as < (less than), > (greater than), and == (equal to).