Quick start
Choose one public entrypoint. New scripts do not source implementation files directly.
ucs_common.tcl
Numbers, text, time, paths, files, and explicit output.
ucs_snps_common.tcl
Loads the common layer, then adds tool, collection, Error Browser, and GUI procedures.
# Pure Tcl source /path/to/common/tcl/ucs_common.tcl # Synopsys collection, Error Browser, and GUI work source /path/to/common/tcl/ucs_snps_common.tcl
Both entrypoints enforce the standard UCS license rule before registering protected public procedures. The encrypted customer release contains two independent self-contained files: ucs_common.tbc and ucs_snps_common.tbc.
Architecture
Public entrypoints are obvious; implementation modules have one responsibility each.
Two entrypoints
Users choose plain Tcl or Synopsys. Internal file names are not part of normal usage.
Explicit contracts
Procedures return useful data and fail clearly when a tool or GUI command is unavailable.
Related actions merged
One selection procedure handles net, pin, and cell. One display procedure handles module and port.
No project policy
No technology, user, project path, floorplan rule, or TileBuilder traversal is embedded.
Procedure catalog
Search by name, purpose, category, or supported tool.
| Procedure | Layer | Purpose |
|---|---|---|
| ucs_sum | Base | Sum a list or multiple numeric arguments. |
| ucs_min | Base | Return the minimum numeric value. |
| ucs_max | Base | Return the maximum numeric value. |
| ucs_split | Base | Split text with a configurable regular expression. |
| ucs_format_field | Base | Build a fixed-width, aligned text field. |
| ucs_now | Base | Return current time using a configurable format. |
| ucs_format_duration | Base | Convert seconds into a readable duration. |
| ucs_list_unique | Base | Remove duplicate list items while preserving order. |
| ucs_dict_get_default | Base | Read a dictionary key with a default value. |
| ucs_find_up | Base | Search parent directories for a relative path. |
| ucs_unique_path | Base | Create a non-conflicting output path. |
| ucs_read_text | Base | Read a complete text file. |
| ucs_write_text | Base | Write a complete text file. |
| ucs_write_line | Output | Write one line to explicit Tcl channels. |
| ucs_get_tool | Tool | Identify FC, ICC2, ICC, PT, DC, or FM. |
| ucs_require_tool | Tool | Require one of an explicit set of supported tools. |
| ucs_collection_names | Collection | Return collection object names without printing. |
| ucs_print_collection | Collection | Print Total once, then one object name per line. |
| ucs_error_mark | Error Browser | Validate and mark polygon violations in the FC/ICC2 Error Browser. |
| ucs_win | GUI | Show the current FC, ICC2, or PT window. |
| ucs_zoom_selected | GUI | Zoom to the current selection. |
| ucs_clear_highlights | GUI | Clear highlights, selection, and annotations. |
| ucs_zoom_fit | GUI | Fit the full design or a supplied collection. |
| ucs_layer_visibility | GUI | Show only or toggle a supplied layer collection. |
| ucs_get_drivers | GUI | Resolve the driver of a pin, net, or selection. |
| ucs_selection_nets | GUI | Resolve signal nets from selected objects. |
| ucs_highlight | GUI | Add polygon annotations for FC or ICC2 objects. |
| ucs_select | GUI | Select a net, pin, or cell through one interface. |
| ucs_show_item | GUI | Display a collection as a colored FC/ICC2 VM bucket. |
| ucs_show_objects | GUI | Display modules or ports through one interface. |
| ucs_color | GUI | Return a stable UCS display color. |
| ucs_reset_color | GUI | Reset the automatic color sequence. |
| ucs_set_view | GUI | Apply explicit Layout setting/value pairs. |
| ucs_clean_view | GUI | Apply the clean screenshot display profile. |
| ucs_capture_window | GUI | Save a window image without ImageMagick. |
| ucs_capture_design | GUI | Clean, fit, and capture a design in one call. |
Collections
Separate data access from presentation. Use names when another procedure needs the result; print only for an interactive review.
set names [ucs_collection_names [get_cells -hierarchical *]] ucs_print_collection [get_cells -hierarchical *] # Total 2 # top/u_cpu # top/u_gpu
ucs_print_collection returns the collection size, accepts an output channel, and prints the Total line once before iteration.
Error Browser
Checking policy stays in product code. The common procedure validates supplied geometry and writes it through one FC/ICC2 interface.
set violations {
{{0 0} {10 0} {10 5} {0 5}}
{{20 20} {30 20} {30 30} {20 30}}
}
set result [ucs_error_mark \
-cell UCS_FLOORPLAN \
-name MACRO_OVERLAP \
-info "Macro overlap" \
-error_list $violations]
puts "Marked [dict get $result count] polygons"
# Reuse the same Error Browser data for another error type.
ucs_error_mark -cell UCS_FLOORPLAN -name CHANNEL \
-error_list $channel_violations -incremental-cell may include the .err suffix; it is added only when absent. An empty -error_list is a no-op. Invalid coordinates and unsupported tools fail before data is changed.
GUI operations
FC and ICC2 share one public interface where commands match. Unsupported tools fail before changing the display.
Select and inspect
ucs_select net top/u_cpu/n_reset ucs_select pin top/u_cpu/U1/A ucs_select cell top/u_cpu/U1 ucs_zoom_selected ucs_win
Collection views
# Direct collection
ucs_show_item [get_cells {top/u_cpu/*}] CPU 1
# Related object groups
ucs_show_objects module {top/u_cpu top/u_gpu} 1
ucs_show_objects port {DATA ADDR}Window capture
ucs_clean_view
ucs_capture_window ./images/layout.png
# TileBuilder-inspired common operations
ucs_clear_highlights
ucs_zoom_fit [get_cells -physical_context u_cpu]
ucs_layer_visibility only [get_layers {M4 M5 M6}]
change_selection [ucs_get_drivers [get_selection]]
ucs_capture_design ./images/clean_layout.pngThe capture procedure uses gui_write_window_image only. Captioning or image conversion is outside common and remains optional in a product layer.
Examples
Pure Tcl formatting
source /path/to/common/tcl/ucs_common.tcl set runtime [ucs_format_duration 90061] set title [ucs_format_field 24 "Route Runtime" center "|" "|"] ucs_write_line "$title $runtime"
Tool guard
source /path/to/common/tcl/ucs_snps_common.tcl
set tool [ucs_require_tool {fc icc2}]
ucs_write_line "Running in $tool"Tool support
Support is attached to each action, not assumed for every Synopsys tool.
| Capability | FC | ICC2 | PT | Plain Tcl |
|---|---|---|---|---|
| Base and output | Yes | Yes | Yes | Yes |
| Collection helpers | Yes | Yes | Yes | No |
| Window show / zoom | Yes | Yes | Yes | No |
| Net / pin / cell selection | Yes | Yes | No | No |
| VM bucket display | Yes | Yes | No | No |
| Error Browser polygon marks | Yes | Yes | No | No |
| Window image | Yes | Yes | Yes | No |
Scope
Common stays small by defining an explicit boundary.
Included
- Pure Tcl transformations
- Explicit channel output
- Tool identification
- Collection presentation
- Error Browser polygon output
- Reusable GUI display primitives
- Shared UCS license validation at package load
Not included
- Floorplan checks or fixes
- Placement, routing, or DRC policy
- TileBuilder clock-tree traversal
- Technology or project constants
- Main-program debug and logging policy
Testing
Pure Tcl behavior and EDA-facing call contracts are tested separately.
tclsh update/common/tcl/tests/run_all.tcl
| Test | Coverage |
|---|---|
| test_common_utils.tcl | Numbers, text, formatting, paths, files, and stable errors. |
| test_snps_tool_utils.tcl | Tool detection, collection names, count, and aligned output. |
| test_snps_entrypoint.tcl | Synopsys public entrypoint loading and native command-attribute registration. |
| test_snps_error_utils.tcl | Single/multiple polygons, replacement/incremental behavior, empty input, validation, and tool guards. |
| test_snps_gui_utils.tcl | FC/ICC2 dispatch, merged selection/display APIs, settings, capture, and unsupported-tool errors. |
Mock tests validate UCS logic and command construction. Real FC, ICC2, and PT smoke tests remain required before promotion to verified.
Migration
The reorganization intentionally removes ambiguous aliases.
| Legacy actions | Current API |
|---|---|
| select_net / select_pin / select_inst | ucs_select |
| show_module / show_port | ucs_show_objects |
| show_item | ucs_show_item |
| ms_error_mark | ucs_error_mark |
| win / zoom_selected | ucs_win / ucs_zoom_selected |
| write_log / print_info | ucs_write_line |
UniversalChip Studio Support
Technical: tech@universalchipstudio.com
Business: support@universalchipstudio.com