Skip to content

Creating Tcl Scripts

InTime provides a set of Tcl commands for users to run InTime with a script.

Getting Started - Project Mode

Here is a sample InTime tcl script.

# Sample script for InTime Optimization. Works in Windows & Linux environments
# Adjust the run_target, runs_per_round and round variables according to your recipe
flow reset
flow set run_target private_cloud
flow set runs_per_round 40
flow set rounds 1
flow set concurrent_runs 10
flow set control_create_bitstreams false
flow run_recipe "hot_start"

Assuming you have saved the above as intimeflow.tcl To run InTime in commandline mode, execute the following command:

<InTime installation dir>/intime.sh -mode batch -platform minimal -project <your XPR or DCP> -vendor_toolchain vivado -vendor_toolchain_version <e.g. 2019.1.0> -s intimeflow.tcl

Explanation:

-mode batch: Run in batch mode
-platform minimal: Run in non-GUI mode
-project: The project to open
-vendor_toolchain: Name of the FPGA tool e.g. vivado
-vendor_toolchain_version: E.g. 2019.1.0
-s <Tcl script>: Tcl script to execute

Non-project mode

Below is a sample project to demonstrate how to use InTime in non-project mode. The Tcl file is a typical build script. It reads in a list of files.

# 
# Synthesis run script generated by Vivado
# 
read_verilog {
  alu.v
  data_mux.v
  ins_decode.v
  ins_rom.v
  io.v
  prgm_cntr.v
  reg_file.v
  spcl_regs.v
  eight_bit_uc.v
}
read_xdc eight_bit_uc.sdc
After that it executes the specified compilation steps. Note that in this case the "top" and "part" variables are specified
synth_design -top eight_bit_uc -part xc7k70tfbg484-2

write_checkpoint -force -noxdef eight_bit_uc_synth.dcp

set rc [catch {
  opt_design 
  write_checkpoint -force eight_bit_uc_opt.dcp
} RESULT]
if {$rc} {
  return -code error $RESULT
}

...
...

To use this build script, save it and treat it like a project file. Assuming you have saved the above as nonproj_intimeflow.tcl Execute the following command:

<InTime installation dir>/intime.sh -mode batch -platform minimal -project nonproj_intimeflow.tcl -vendor_toolchain vivado -vendor_toolchain_version <e.g. 2019.1.0> 

For more sample designs and explanation, please refer to our github.

Advanced Scripting

To learn how to automate multiple recipes in InTime, refer to this link.

Tcl Reference

For the full list of Tcl commands, please refer to the Tcl Reference