TCL API Reference
This page documents all TCL procedures provided by ruckus. Procedures are called from
your project’s ruckus.tcl file or from hook scripts.
For an explanation of $::DIR_PATH and the recursive loading model, see
The ruckus.tcl Recursive Loading Model.
Source-Loading Procedures
These procedures are defined in vivado/proc/code_loading.tcl.
Call them from your ruckus.tcl to populate the Vivado project with RTL, IP cores,
block designs, and constraints.
- loadSource()
loadSource [-path PATH] [-dir DIR] [-sim_only] [-lib LIBRARY] [-fileType TYPE]Add RTL source files to the Vivado project’s
sources_1fileset (orsim_1when-sim_onlyis given).- -path <path>
Absolute path to a single source file. Mutually exclusive with
-dir. Use$::DIR_PATHto construct the path relative to the currentruckus.tcl.
- -dir <dir>
Directory path. All supported files found in this directory are added. Mutually exclusive with
-path.
- -sim_only
Boolean flag. When present, files are added to the
sim_1fileset instead ofsources_1. Use for testbench files that should not be synthesised.
- -lib <library>
VHDL library name to assign to any
.vhdor.vhdlfiles loaded. Has no effect on Verilog or SystemVerilog files.
- -fileType <type>
Override the
FILE_TYPEproperty that Vivado assigns to loaded files.
Supported file extensions:
.vhd.vhdl.v.vh.sv.svh.dat.coe.mem.edif.dcpError behaviour: Calls
exit -1if the file is missing, the extension is unsupported, or both-pathand-dirare supplied.Note
If adding a
.dcpfile fails with a “Runs 36-335” error, ruckus prints a reminder to rungit lfs pull— large DCP files must be stored in Git LFS.Examples:
# Add a single HDL source file loadSource -path $::DIR_PATH/rtl/MyModule.vhd # Add all HDL sources in a directory loadSource -dir $::DIR_PATH/rtl/ # Add a simulation-only testbench loadSource -path $::DIR_PATH/tb/MyTb_tb.vhd -sim_only # Add a VHDL file and assign it to a named library loadSource -path $::DIR_PATH/rtl/surf/SurfPkg.vhd -lib surf
- loadIpCore()
loadIpCore [-path PATH] [-dir DIR]Import a Vivado IP core (
.xcior.xcix) into the project’ssources_1fileset viaimport_ip.- -path <path>
Absolute path to a single
.xcior.xcixfile.
- -dir <dir>
Directory path. All
.xci/.xcixfiles found there are imported.
The proc appends the resolved path(s) to the global
$::IP_LISTand$::IP_FILESvariables, which are used byBuildIpCores()later in the pipeline.Example:
loadIpCore -path $::DIR_PATH/ip/MyFifo.xci loadIpCore -dir $::DIR_PATH/ip/
- loadBlockDesign()
loadBlockDesign [-path PATH] [-dir DIR]Import or regenerate a Vivado block design (
.bdor.tcl).- -path <path>
Absolute path to a
.bdor.tclfile.
- -dir <dir>
Directory path. All
.bdand.tclfiles found there are processed.
``.bd`` files are imported via
import_files -norecurse.``.tcl`` files are sourced directly, regenerating the block design from script. Use the
.tclform when the block design is version-controlled as a script.The resolved
.bdpath is appended to$::BD_FILES.Example:
# Import a pre-built block design loadBlockDesign -path $::DIR_PATH/bd/system.bd # Regenerate a block design from its TCL script loadBlockDesign -path $::DIR_PATH/bd/system.tcl
- loadConstraints()
loadConstraints [-path PATH] [-dir DIR]Add timing or physical constraints to the project’s
constrs_1fileset.- -path <path>
Absolute path to a single
.xdcor.tclconstraint file.
- -dir <dir>
Directory path. All
.xdcand.tclfiles found there are added.
Example:
loadConstraints -path $::DIR_PATH/constraints/timing.xdc loadConstraints -dir $::DIR_PATH/constraints/
- loadRuckusTcl {filePath {flags ""}}
Recursively load a submodule’s
ruckus.tcl. This is the primary mechanism for composing firmware projects from multiple ruckus-aware modules.- Parameters:
filePath – Directory path containing the target
ruckus.tcl. Do not pass the file itself — ruckus appends/ruckus.tclinternally. Passing a file path (e.g.$::DIR_PATH/submodule/ruckus.tcl) will causeexit -1.flags – (Optional) Pass
"debug"to enable TCL tracing during the load. Omit or pass""for normal operation.
What it does:
Saves the current
$::DIR_PATHSets
$::DIR_PATHtofilePathSources
${filePath}/ruckus.tclRestores the original
$::DIR_PATHAppends
filePathto$::DIR_LIST
See The ruckus.tcl Recursive Loading Model for the full explanation of
$::DIR_PATHsemantics.Warning
Pass the directory, not the file.
loadRuckusTcl $::env(MODULES)/surfis correct.loadRuckusTcl $::env(MODULES)/surf/ruckus.tclwill fail withexit -1.Examples:
# Load a submodule (surf firmware library) loadRuckusTcl $::env(MODULES)/surf # Load with debug tracing enabled loadRuckusTcl $::env(MODULES)/surf "debug" # Load a subdirectory within the same project loadRuckusTcl $::DIR_PATH/shared
Vivado Pipeline Procedures
These procedures are called internally by ruckus during the Vivado build pipeline.
Users may call some of them from hook scripts or ruckus.tcl for project-level
control.
These procedures are defined in vivado/proc/.
- CheckVivadoVersion()
Check the active Vivado version against known-good and known-bad version lists.
- Returns:
Nothing on success. Raises
-code errorfor unsupported versions.
Checks
$::env(VIVADO_VERSION)against:Known-bad versions (2017.1, pre-2014.1) — raises an error.
Versions newer than 2025.2.0 — prints a warning (untested).
Defined in
vivado/proc/project_management.tcl. Called automatically at project open time fromvivado/project.tcl. Users may also call it fromruckus.tclto gate a project on a required Vivado version.Example:
# Call from ruckus.tcl for project-level version gating CheckVivadoVersion
- CheckTiming {{printTiming true}}
Evaluate implementation timing results and return pass/fail status.
- Parameters:
printTiming – (Optional, default
true) Whentrue, prints WNS/TNS/WHS/THS/TPWS/FAILED_NETS to stdout if timing failed.- Returns:
trueif timing passed or was overridden;falseif timing failed and no override is active.
Reads
STATS.*properties from theimpl_1run after route. Checks theTIG,TIG_SETUP,TIG_HOLD, andTIG_PULSEenvironment variables; if any override is set, a timing failure does not prevent bitstream generation.Defined in
vivado/proc/checking.tcl. Called internally frombuild.tclandpost_route.tcl. Thepost_route.tclTier-1 hook fires only whenCheckTimingreturnstrue.Example:
# Called with default printTiming=true (prints stats on failure) CheckTiming
- BuildIpCores()
Upgrade and synthesise all project IP cores.
- Returns:
Nothing.
Upgrades all IP cores in the project, then synthesises any whose synthesis run is stale. Uses
$::env(PARALLEL_SYNTH)parallel jobs.Defined in
vivado/proc/ip_management.tcl. Called automatically frombuild.tclbefore synthesis.Example:
BuildIpCores
- CreateFpgaBit()
Copy implementation output files to the
images/directory after a successful build.- Returns:
Nothing.
Copies output files according to output format variables:
.bitfile ifGEN_BIT_IMAGE!= 0Gzip of
.bitifGEN_BIT_IMAGE_GZIP!= 0.binfile ifGEN_BIN_IMAGE!= 0Gzip of
.binifGEN_BIN_IMAGE_GZIP!= 0
Calls
CreateXsaFile()andCreatePromMcs()internally.Defined in
vivado/proc/output_files.tcl. Not used for Versal devices (useCreateVersalOutputsinstead).Example:
CreateFpgaBit
- CreatePromMcs()
Generate an MCS PROM file if a
promgen.tclhook is present.- Returns:
Nothing.
Sources
$::env(PROJ_DIR)/vivado/promgen.tclif it exists; no-op otherwise. To customise MCS generation, createvivado/promgen.tclin your project directory.Defined in
vivado/proc/output_files.tcl. Called internally byCreateFpgaBit().Example:
CreatePromMcs
- CreateXsaFile()
Generate an XSA (or HDF) hardware platform file for embedded processor projects.
- Returns:
Nothing.
Generates a
.xsahardware platform file (Vivado 2019.2 and later) or.hdf(Vivado 2019.1 and older) whenGEN_XSA_IMAGE!= 0. Only relevant for projects containing embedded processors such as MicroBlaze.Defined in
vivado/proc/output_files.tcl. Called internally byCreateFpgaBit().Example:
CreateXsaFile