Deciding which recipe to use¶
The InTime optimization flow executes Tcl scripts called Recipes. These are different optimization approaches for different design conditions. (For an overview of the InTime flow, see the intime flow page.)
How to run a Recipe¶
To start a recipe in the InTime GUI, just click the Optimize button.
In Tcl command line mode, use the following commands.
# List the available recipes:
plunify> flow recipes list
"intime_default" "placement_seed_exploration" ...
# Run the InTime Default recipe:
plunify> flow load_recipe intime_default
plunify> flow run_recipe intime_default
What is a Parent Revision?¶
Multiple recipes can be executed in a hierarchical manner where the a result of the current round (usually the result with the best WNS or TNS) becomes the starting point (usually called the "Parent Revision") of the next round. If the same recipe is running multiple rounds, the parent revision is selected automatically based on the goal target (either WNS or TNS) of the recipe.
To select a recipe, right-click on the best strategy/result so far and set the result as the parent revision of the next round as shown below
Once the custom parent revision has been set, it will be marked with a star as shown below
Tcl Mode
The flow set parent_revision_name
and flow set parent_revision_job_id
commands can be used.
Understanding InTime Optimization Phases¶
The FPGA tools offers many build parameters that affect an FPGA design at a global as well as localized block level. InTime determines the optimum build parameters and constraints for your design. To deal with an enormous design space, InTime uses machine learning techniques and domain-specific heuristics to predict and narrow down the best parameters and constraints. To maximize performance closure effectiveness, it is necessary to generate sufficient data points from build results and learn from past results. There are two phases to the optimization process: Phase 1 is the “Learning” cycle and Phase 2, the “Last-Mile”.
Phase 1: Learning
In this phase, the recommended methodology is to progressively optimize a design over several rounds of synthesis and place-and-route builds in an iterative “build-and-learn” cycle.
Phase 2: Last-Mile
The second phase begins when at least one of the Learning results is close to meeting your performance target or if results have stopped improving in Phase 1. In the former, the optimization relies on specific techniques that stimulate relatively non-deterministic (compared to those in Phase 1) variations in the results. There are two types of optimizations in this phase:
1. Random - Running placement exploration, effort levels and exploiting clock uncertainties.
2. Incremental - Using a particular build to run iterative physical optimizations.
Using this approach, run Phase 1 recipes to improve the TNS or WNS first, followed by Phase 2 recipes. The ideal effect is highlighted in the chart below.
For more information, refer to our whitepapers here.
List of Recipes¶
Here is a list of recipes and their aliases. Alias are used in Tcl commands to invoke recipes. Depending on the FPGA vendor and device type, not all recipes will be available.
Recipe Name | Alias | Vendor |
---|---|---|
Auto Floorplan | auto_floorplan | *AMD, *Intel, *Microchip |
Auto Pilot | auto_pilot | AMD, Intel, Microchip |
Auto Placement | auto_placement | Intel |
Clock Exploration | clock_exploration | AMD, Intel, Microchip |
Clock Route Exploration | clock_route_exploration | Intel |
Clock Margin Exploration | clock_margin_exploration | AMD |
Compile With a Guide File | vivado_incremental_compilation | AMD |
Custom Flow | custom_flow | AMD, Intel |
Deep Dive | deep_dive | AMD, Intel |
Effort Level Exploration | effort_level_placement | Intel |
Extra Opt Exploration | extra_opt_exploration | AMD, Intel |
Fanout Exploration | fanout_exploration | Intel |
Hot Start | hot_start | AMD, Intel |
InTime Default | intime_default | AMD, Intel, Microchip |
Just Compile My Design | just_compile_my_design | AMD, Intel, Microchip |
Just Synthesize My Design | just_synthesize_my_design | AMD, Intel |
Max Delay Exploration | max_delay_exploration | AMD, Intel |
Placement and Router Effort Level Exploration | effort_level_placement_router | Intel |
Placement Exploration | placement_exploration | AMD, Microchip |
Placement Seed Exploration | placement_seed_exploration | Intel, Microchip |
Region Exploration | region_exploration | Microchip |
Rerun Strategies | rerun_strategies | AMD, Intel, Microchip |
Rerun Best results | rerun_best | AMD, Intel, Microchip |
Seeded Effort Level Exploration | seeded_effort_level_exploration | Intel |
Synthesis Exploration | synthesis_exploration | AMD |
Note
InTime Default Extra has been replaced by specific Auto Pilot templates - refer to this page Router Effort Level Exploration, SSI Exploration have been deprecated.
* Not all devices are supported at this time. AMD: most multi-die devices are supported. Microchip: only certain families.
Phase 1: Learning Recipes¶
Also referred to as educated recipes, InTime machine learning capabilities to learn from previous results' and produce smarter strategies on subsequent runs. There are multiple Learning recipes.
Recipe Availability
Different recipes may be available across different FPGA vendor tools.
Auto Floorplan¶
If your design has placement and/or routing difficulties, run this recipe first. Auto Floorplan analyzes the inherent congestion (user-induced or otherwise), connectivity and timing criticality of the design instances before generating floorplans to solve the issues.
Clock Exploration¶
This recipe selects certain clocks and varies their clock constraints in intermediate compilation stages in order to improve design performance. The user's original constraints are not affected for final timing analysis.
Hot Start¶
This recipe uses Placement and Routing settings to generate the initial strategies for a project that is being optimized for the first time. The intention is to limit the design space and improve the timing performance in fewer number of compilations.
Tip
Only for Vivado. 50% of the total number of strategies will be generated using a new Hot Start algorithm (from InTime 3.1 onwards). Use the flow property strategy_cls_multiplier to control the number of strategies.
Tip
Only for Quartus. Some generated strategy names may have a "amf_" prefix. This means that InTime has applied fanout optimization on the design.
InTime Default¶
This is a recipe which runs multiple iterations (or rounds). This can be configured under Flow Properties. It will optimize Synthesis, Placement and Routing settings, creating a large variation in results.
The expected project history after running this with a default flow configuration (2 rounds, 3 runs per round) can be seen in the project history shown below. Note that after each round, the recipe will set the best result (TNS) from the current round(s) as the parent of the new round. In the example below, the best result is "cal_speed_tns_low_1" strategy. InTime automatically uses it as the "Parent" for the next round.
The effects of machine learning on a design can also be visualized using the Multiple Job Analysis plot in InTime's Results Analysis mode.
Tip
50% of the total number of strategies will be generated using a new Default algorithm (from InTime 3.1 onwards). Use the flow property strategy_xp_multiplier to control the number of strategies.
Deep Dive¶
This recipe analyzes existing results and explores regions close to the good results so far. Instead of exploring too many settings, this recipe will lock down settings that are already good and only explore a subset of settings. In the figure below, deep dive recipe gives better results over the default recipe.
Note that there must be a sufficient number of results in order for Deep Dive to work properly.
Fanout Exploration¶
This recipe discovers appropriate fanout limits for high fanout nets in the design.
Synthesis Exploration¶
This recipe analyzes the current synthesis results and determines the optimal synthesis setting combinations for the design.
Phase 2: Last-Mile Recipes¶
Once the Learning recipes have produced a good result that is very close to achieving your design goals, it is time for Phase 2.
If there are older results from other recipes, you can select a parent revision from it.
Recipe Availability
Not all recipes may be available across different FPGA vendor tools. Some recipes only exist for certain FPGA tools.
Clock Route Exploration¶
This recipe randomly assigns Global/Regional/Periphery clock routing resources to all or to user-specified clocks in the design. Using different clock routing can improve power and timing performance.
Extra Opt Exploration¶
This recipe iteratively runs placement, physical synthesis, and routing with different switches to guide the results towards the design goal. In a typical scenario, iteratively placing a design makes the tools work harder on optimizing it, improving the timing performance in the process.
Placement Exploration¶
This recipe finds and change the location of a register to stimulate placement variations. The effect is seemingly random like running placement seeds, which Vivado does not provide anymore.
Clock Margin Exploration¶
This recipe varies the clock uncertainty to trigger variations in the timing. By default, InTime will control the degree of clock margin, increasing or decreasing the value by 0.05ns each time - this value can be configured by the user via the flow set strategy_clock_increment_value <Percentage value where 0.05 represents 5%>
.
Placement Seed Exploration¶
This recipe explores the effect of placement seeds on the design goal. This recipe changes the placement seed setting on the parent revision.
Effort Level Exploration¶
This recipe explores the effect of different effort levels on the design goal. This recipe changes the effort level setting on the parent revision.
Seeded Effort Level Exploration¶
This recipe performs exploration of seeds on best effort level results using the following steps:
Step 1: Explore placement effort levels on design (20 in total).
Step 2: Select the results in the round and set as parent.
Step 3: Run "Placement Seed Exploration" recipe on each of them.
If multiple rounds are specified, this recipe will execute step 2 and 3 on the 2nd best, 3rd best result and so on.
The expected project history after running this recipe with a custom parent revision can be seen in the project history shown in jobs 43, 44 and 45) for a flow configuration with rounds = 2
and runs_per_round = 3
.
Tip
When running this recipe, the runs_per_round
property specifies the number of seeds that will be run on the top rounds
effort levels found.
Region Exploration¶
This recipes examines the placement of the modules in the design and find more efficient regions for them, taking into account the timing and packing statistics. For example, the design may be squeezed into a flatter shape in order to be closer to critical resources.
General Recipes¶
There are general recipes which have different use-cases as described in the description of each recipe.
Just Compile My Design¶
This recipe simply builds the current active revision or design run in your project. Note that this happens on the run target specified by the initial_compilation
property.
Compile with a Guide File¶
This recipe uses an existing Design Checkpoint file as a reference, and applies incremental compilation behaviour to re-run placement and routing for logic that has changed compared to the reference netlist. When this recipe is selected, checkboxes will appear next to strategies in your project build history. Check to select the strategy (pick only one) to use as a reference.
Note
When running this recipe, make sure the Design Checkpoint (DCP) exists. InTime typically saves the generated DCP in the working folders, e.g. "plunify.jobs/
Rerun Strategies¶
This recipe allows the user to re-run previously built strategies. A typical use-case is when the design changes after timing closure was achieved using a previous InTime strategy. Although the design has changed, good strategies can be re-run using this recipe.
When this recipe is selected, checkboxes will appear next to strategies in your project build history. Check to select the strategies to rerun. This is illustrated in
The expected project history after running this recipe with the selection shown in the above figure is shown below (job 42).
Rerun Best Results¶
This recipe automatically chooses the best results out of the current history (after filtering training data) and reruns them. The purpose is to run only the best strategies for a new or modified version of the design.
Advanced Recipes¶
Auto Pilot¶
This recipe is available from InTime version 3.0 onwards. Auto Pilot is a "manager recipe" that reads a pre-defined template file (in JSON format) describing a sequence of optimization steps. The user can customize a specific sequence of recipes, e.g. "Hot Start", followed by "Default" and finally, "Placement Exploration", with specific criteria such as TNS or WNS attaining a particular value. For example, a user can run multiple rounds of Default recipe until TNS < -100 ns (the "criteria").
{
"cookbook": [
{
"id": "1",
"name": "InTime Default",
"recipe_name": "intime_default",
"flow": {
"run_target": "local",
"strategy_max_runtime": "12",
"runs_per_round": "5",
"rounds": "1",
"concurrent_runs": "1",
"goal": "speed_tns",
"goal_based_target": "0",
"control_stop_when_goal_met": "false"
},
"decisions": [
{
"next_recipe_id": "3",
"criteria": "TNS < -79.72"
},
{
"next_recipe_id": "2",
"criteria": "WNS < -0.27"
},
],
"max_same_recipe_attempts": "99",
"max_retry_if_fail": "10"
},
{
"id": "2",
"name": "Hot Start",
"recipe_name": "hot_start",
...
...
...
In the above example, "InTime Default" is the first recipe to execute. After execution, InTime examines every result and decides next steps according to the following logic. 1. If a result meets the overall goal of TNS == 0 ("goal": "speed_tns", "goal_based_target": "0"), Auto Pilot completes. 2. Otherwise, evaluate the two conditions in the "decisions" array. 3. If a result meets a specified "criteria", that result will become the parent for the corresponding next recipe (as specified in "next_recipe_id").
Note: - If the "decisions" array is empty, there will be no next recipe to execute. - If the "critera" in the "decisions" array is an empty string, every result will become a parent for the corresponding next recipe.
Additional Auto Pilot Example¶
Here is another example.
...
...
...
{
"cookbook": [
{
"id": "1",
"name": "Hot Start",
"recipe_name": "hot_start",
"flow": {
"run_target": "private_cloud",
"strategy_max_runtime": "24",
"runs_per_round": "40",
"rounds": "1",
"concurrent_runs": "5",
"goal": "speed_tns",
"goal_based_target": "0",
"control_stop_when_goal_met": "true"
},
"decisions": [
{
"next_recipe_id": "2",
"criteria": "WNS > -0.250"
},
{
"next_recipe_id": "3",
"criteria": "WNS <= -0.250"
}
],
"max_same_recipe_attempts": "1",
"max_retry_if_fail": "1"
},
{
"id": "2",
"name": "Extra Opt Exploration",
"recipe_name": "extra_opt_exploration",
"flow": {
"run_target": "private_cloud",
"strategy_max_runtime": "24",
"runs_per_round": "15",
"rounds": "1",
"concurrent_runs": "5",
"goal": "speed_tns",
"goal_based_target": "0",
"control_stop_when_goal_met": "true"
},
"decisions": [],
"max_same_recipe_attempts": "2",
"max_retry_if_fail": "2"
},
{
"id": "3",
"name": "Placement Exploration",
"recipe_name": "vivado_placement_exploration",
"flow": {
"run_target": "private_cloud",
"strategy_max_runtime": "24",
"runs_per_round": "40",
"rounds": "1",
"concurrent_runs": "5",
"goal": "speed_tns",
"goal_based_target": "0",
"control_stop_when_goal_met": "true"
},
"decisions": [
{
"next_recipe_id": "2",
"criteria": "WNS > -0.250"
}
],
"max_same_recipe_attempts": "3",
"max_retry_if_fail": "3"
}
],
"recipe_start_id": "1"
}
...
...
...
This Auto Pilot Template, shown in an InTime-generated flowchart, defines a flow where the "Hot Start" recipe executes first, followed by "Placement Exploration" and then "Extra Opt Exploration".
Hot Start 1. If the overall goal of TNS == 0 is met, stop. 2. If WNS > -250ps, run ‘Extra Opt Exploration’ 3. If WNS <= -250ps, run ‘Placement Exploration’
Placement Exploration 1. If the overall goal of TNS == 0 is met, stop. 2. If WNS > -250ps, run ‘Extra Opt Exploration’
Extra Opt Exploration 1. If the overall goal of TNS == 0 is met, stop. 2. No further recipes will be run.
Run Auto Pilot in Tcl¶
Note
View detected Auto Pilot templates with the "flow auto_pilot_templates" command.
To run Auto Pilot in Tcl by specifying the desired template's alias (the "tcl_alias" field of a template):
flow set auto_pilot_alias <Template's Tcl alias e.g. timing>
flow load_recipe auto_pilot
flow run_recipe auto_pilot
To run Auto Pilot in Tcl by specifying the actual template file:
flow set auto_pilot_json <path to JSON file e.g. /home/user/.plunify/auto_pilot_templates/mytemplate.json>
flow load_recipe auto_pilot
flow run_recipe auto_pilot
Create A Template¶
Please refer to Create Auto Pilot Templates. Note that templates must be saved in <user_home>/.plunify/auto_pilot_templates/
Note
Sample template files are pre-installed within InTime. To customize one, make a backup copy first.
Custom Flow Recipe¶
This recipe runs the InTime flow once with the specified flow configuration. Unlike the other InTime recipes, no properties in the flow configuration are controlled by the recipe, giving full control to the user. When using custom strategy algorithms, this recipe should be used in order to gain control over the strategy_algorithm
property which is normally locked and controlled by other InTime recipes.
To learn more about how to use this, refer to the Custom Strategies page.