Low-Level Optimizations
Once you have coded a module or system and are ready to compile it to VHDL, you will be presented with a list of optimizations to choose from upon calling “Build.” On the second page of this compilation wizard you will find the low-level optimizations.
Before we explain what each of these optimizations does in more detail, let’s look at how we use the low-level optimizations page first. To view the low-level optimizations page, click “Build” under the ROCCC menu or toolbar with a ROCCC module or system open in the editor. A compilation wizard will pop up with various pages to cycle through by pressing “Next” at the bottom. The second page is the Low-Level Optimizations page. From here you will be able to pick and choose which low-level optimizations you want to use during the compilation of this component.
Using the Low-Level Optimizations Page

This page works identical to the high-level optimizations page. The table on the top left of this page will have what optimizations are available to select from. The table on the top right will show which optimizations you currently have selected and in which order they will be executed. The bottom table will be used for filling in any arguments any of the optimizations will need.
To add one of these optimizations to the selected list, click an optimization on the left table and press the “Add” button in the top middle of the page. This will put the selected optimization into the selected flags list.

Since none of the current low-level optimizations take in any arguments we will ignore the bottom table for now.

The rest of the pages in this compilation wizard deal with other forms of optimizations that we will look into in further tutorials such as pipelining, and stream management. To compile this module or system with the selected optimizations, select “Finish” on the bottom right and the component will begin to compile.

So now that you know the basics of how to add optimizations, let’s take an in depth look at each one and how they work.
Optimization Descriptions
ArithmeticBalancing
Converts chains of arithmetic operations into parallel arithmetic operations.
Example:

Explanation:
The optimization finds expressions composed of a single operator performed in serial, and changes the order that the sub-expressions are calculated in to minimize the time to calculate the expression. Only associative and commutative operators are balanced. Currently, addition, multiplication, and bit-wise AND, OR, and XOR are balanced. For example, the statement “a = b + c + d + e” in software will be calculated serially. By performing arithmetic balancing, the statement is changed into “a = (b + c) + (d + e),” with “b + c” and “d + e” calculated in parallel.
Floating point operators are not strictly associative and commutative, and order of execution matters when dealing with overflow. Because of this, this optimization may change the final result when using floating point values.
How To Call:
All that needs to be done to call this optimization is add it to the selected flags list. No arguments are needed.
CopyReduction
Reschedules pipelined operations in an attempt to minimize registers created.
Example:

Explanation:
ROCCC automatically inserts copy registers in between pipeline stages if a value is not used immediately after it is calculated. If an operation could correctly be calculated in several different pipeline stages, one of those stages will minimize the total bits that are copied (both coming into that operation from previous stages, and leaving that operation to later stages that use the calculated value).
This optimization attempts to find a placement for operations that minimizes the total number of copied bits.
How To Call:
All that needs to be done to call this optimization is add it to the selected flags list. No arguments are needed.
FanoutTreeGeneration
Guarantees that no variable will have a higher fanout than the specified max fanout.
Example:

Explanation:
Fanout tree generation will guarantee that no fanout will be greater than the specified max fanout. This is done by creating a series of smaller trees of registered fanouts to move the values to their requested destinations. The fanout amount of the individual smaller trees will be less than or equal to the specified max fanout. The fanout amount chosen for the trees will be the best possible value to try to keep each level of the tree to have the same fanout amount.
How To Call:
Add the FanoutTreeGeneration flag to the optimizations list and specify the maximum fanout value for the optimization argument.
MaximizePrecision
Temporary arithmetic results use maximum precision when enabled and possible truncate at every step when not.
Example:

Explanation:
Normally, chains of integer operations have their output be the bit size of the inputs. Turning on this optimization will maintain the precision throughout the operation chain by increasing the bit size of the results as necessary so that no data is lost.
How To Call:
Simply add this flag to the selected optimizations list and it will be called, no arguments needed.