Games / Command flash cards / TCL for physical design

TCL for physical design following the Tcl manual

Choose a section to drill, or play every section mixed together. Each section lists the commands it covers, and any kinds of card it holds besides the plain one: a command whose meaning you pick.

SourceTCL (Tool Command Language) is the scripting language every place-and-route and timing tool embeds, so the same skills carry between them. These cards follow the official Tcl manual pages, and each answer links to the page for that command. The examples are in the style the OpenROAD-flow-scripts scripts use, since that is Tcl written for a real flow. Reference: the Tcl manual (Tcl on GitHub).

All sections

A mixed round drawn from every section. Due cards come first, then new cards in random order.

71cards across 10 sections
mixed round play

Variables and substitution

The three kinds of bracket, and why arithmetic needs its own command.

setexprincrappendunsetsubst
find the fault
9 cards play

Lists

Building and taking apart the data structure most tool scripts are made of.

listlindexllengthlappendlrangelsortlsearchlassignjoinsplitconcat
8 cards play

Control flow

Conditions and loops, and the brace rules that make them work.

ifforeachforwhileswitchbreakcontinue
find the fault
7 cards play

Procedures and scope

Writing reusable commands, and reaching variables outside them.

procreturnglobalupvaruplevelnamespace
name the commandfind the fault
8 cards play

Strings and patterns

Matching and rewriting the names that fill a physical-design script.

stringformatregexpregsub
7 cards play

Dictionaries and arrays

Keyed data, and the older array form still seen in tool scripts.

dictarray
6 cards play

Files, processes, and the environment

Reading and writing files, running other programs, and reading variables from make.

openclosegetsputsfileglobexecsourceenv
name the commandfind the fault
10 cards play

Errors and robustness

Failing deliberately, catching failures, and checking before acting.

catcherrortryinfoexit
6 cards play

Tool objects and collections

What a tool command hands back, and why it is not an ordinary list.

get_cellsforeach_in_collectionsizeof_collectionget_object_nameredirect
4 cards play

Tcl in tool scripts

The patterns that distinguish flow scripts from general-purpose Tcl.

setexprforeachcatchinfo
6 cards play