0% found this document useful (0 votes)
192 views

TCL Interview Preparation

The document contains advanced TCL interview questions tailored for physical design engineers, covering topics such as associative arrays, loops, timing extraction, error handling, and optimization techniques. It includes practical examples and commands for various tasks in EDA tools like Innovus and PrimeTime. The questions also address specific challenges like DRC violations, power analysis, and multi-voltage design considerations.

Uploaded by

Nitya Mishra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
192 views

TCL Interview Preparation

The document contains advanced TCL interview questions tailored for physical design engineers, covering topics such as associative arrays, loops, timing extraction, error handling, and optimization techniques. It includes practical examples and commands for various tasks in EDA tools like Innovus and PrimeTime. The questions also address specific challenges like DRC violations, power analysis, and multi-voltage design considerations.

Uploaded by

Nitya Mishra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

ADVANCED TCL

INTERVIEW QUESTIONS
FOR PHYSICAL DESIGN
ENGINEERS

Prasanthi Chanda
1. What are associative arrays in TCL, and how are they
useful in physical design?
Associative arrays (also called dictionaries or hash
tables) in TCL allow storing data in key-value pairs. This
is useful in physical design for mapping pin names to
locations, tracking congestion areas, and storing design
constraints.

set pin_location(x1) "10 20"


set pin_location(x2) "30 40"

puts "Pin x1 is at $pin_location(x1)"

2. How do you use TCL loops to iterate through a list of


cells in an Innovus/ICC2 design?
You can use foreach or for loops to iterate through cell
instances in a design.

foreach cell [get_cells -filter "is_standard_cell==true"] {


puts "Cell: $cell"
}
3. How can you extract timing information using TCL in
PrimeTime?
Use report_timing in PrimeTime and parse the output
using TCL.

set timing_report [report_timing -from U1/D -to U2/Q -


delay_type max]
puts $timing_report

4. How do you pass command-line arguments in a TCL


script?
The argv variable stores command-line arguments.

set file_name [lindex $argv 0]


puts "Processing file: $file_name"

5. How do you extract power numbers from Innovus


using TCL?

report_power > power_report.txt


6. How can you check and fix DRC violations using TCL
in Innovus?

set violations [get_drc_violations]


foreach vio $violations {
puts "Violation: $vio"
}
fix_drc_violations

7. What is the difference between uplevel and upvar in


TCL?
uplevel executes a command in a different stack
frame.
upvar links a variable from a different stack frame.

proc modify_var {var_name} {


upvar $var_name var
set var "Modified"
}
set x "Original"
modify_var x
puts $x ;# Output: "Modified"
8. How do you write a TCL procedure that calculates
wire length in ICC2?

proc calc_wire_length {net_name} {


set length [get_net_length $net_name]
return $length
}
puts "Wire Length: [calc_wire_length my_net]"

9. How do you handle errors in a TCL script?


Use catch to handle runtime errors.

set result [catch {open myfile.txt r} fileID]


if {$result != 0} {
puts "Error: Could not open file"
}

10. How do you optimize large TCL scripts for runtime


efficiency?
Use cached variables instead of redundant get_cells
calls.
Avoid nested loops; use hash tables for quick lookups.
Use parallel execution when supported (e.g.,
parallel_exec in ICC2).
11. How do you optimize TCL scripts for handling large
designs efficiently?
To optimize TCL scripts for large designs, follow these
techniques:
Minimize the use of get_cells and get_nets by caching
results in lists.
Use regex-based filtering (-regexp) instead of looping over
all objects.
Use indexed lookup tables (associative arrays) instead of
repeated searches.
Avoid unnecessary printing and file I/O operations inside
loops.

set std_cells [get_cells -filter {is_std_cell == true}]


foreach cell $std_cells {
puts "Processing cell: $cell"
}

12. How do you perform a batch run of multiple TCL


scripts in an EDA tool?
Use a master TCL script that sources multiple scripts
sequentially.
foreach script {floorplan.tcl placement.tcl routing.tcl
timing.tcl} {
puts "Running $script..."
source $script
}

13. How do you extract and modify net attributes using


TCL in ICC2?
Use get_net to extract net information and set_attribute to
modify it.

set nets [get_nets]


foreach net $nets {
set cap [get_attribute $net capacitance]
puts "Net: $net, Capacitance: $cap"
set_attribute $net capacitance [expr $cap * 0.9] ;#
Reduce capacitance by 10%
}
14. How do you check if a file exists before reading or
writing in TCL?
Use file exists to verify file presence.

set file "timing_report.txt"


if {[file exists $file]} {
set fid [open $file r]
puts "File exists. Reading..."
} else {
puts "File not found!"
}

15. How can you parallelize TCL execution for faster


runtime in ICC2?
Use parallel_exec to execute multiple commands in parallel.

parallel_exec -tasks {
{route_design}
{opt_design}
{report_timing}
}
16. How do you extract and analyze congestion reports
in Innovus using TCL?
Use report_congestion and parse the data.

set congestion_report [report_congestion -threshold 80]


puts "Congested regions: $congestion_report"

17. How can you capture user input dynamically in a


TCL script?
Use gets stdin to take input from the user.

puts "Enter clock frequency:"


gets stdin clk_freq
puts "Clock frequency set to: $clk_freq MHz"

18. How do you extract delay values for a specific path


using TCL in PrimeTime?
Use get_timing_paths to fetch delays.

set path_delay [get_timing_paths -from U1/D -to U2/Q -


max_paths 1 -delay_type max]
puts "Critical Path Delay: $path_delay"
19. How do you dynamically modify a constraint file
using TCL?
Use regsub to search and replace constraints inside a .sdc file.

set fid [open "design.sdc" r]


set data [read $fid]
close $fid

set data [regsub -all {create_clock -period \d+} $data


"create_clock -period 1.5"]

set fid [open "modified.sdc" w]


puts $fid $data
close $fid

20. How do you debug TCL scripts in physical design


tools?
Use puts statements for debugging.
Use trace to monitor variable changes.
Use catch to handle errors and prevent crashes.

trace add variable my_var write {puts "Value changed:


$my_var"}
set my_var 10 ;# Output: Value changed: 10
21. How do you extract and analyze setup and hold
timing violations using TCL in PrimeTime?
Use report_timing with appropriate options to capture violations.

report_timing -from [get_ports clk] -to [get_cells U1/Q] -


max_paths 1 -delay_type max -significant_digits 3
report_timing -from [get_ports clk] -to [get_cells U1/Q] -
max_paths 1 -delay_type min -significant_digits 3

22. How can you measure wirelength distribution in


ICC2 using TCL?
Use get_net_length for wirelength analysis.

foreach net [get_nets -of_objects [get_cells]] {


set length [get_net_length $net]
puts "Net: $net, Length: $length"
}

23. How do you store and retrieve structured data in


TCL using dictionaries?
Use TCL dictionaries for hierarchical data storage.
dict set design_info cells U1 area 10.5
dict set design_info cells U2 area 12.3
puts "Area of U1: [dict get $design_info cells U1 area]"

24. How do you write a TCL procedure to extract


fanout of a given net in Innovus?
Create a reusable procedure using proc.

proc get_fanout {net_name} {


set fanout [get_pins -of_objects [get_net $net_name]]
puts "Net: $net_name has fanout: [llength $fanout]"
}
get_fanout "net1"

25. How do you measure total dynamic power using


TCL in PrimeTime?
Extract switching power, internal power, and leakage power
using report_power.

report_power -analysis_effort high > power_report.log


set dynamic_power [exec grep "Total Dynamic Power"
power_report.log]
puts "Total Dynamic Power: $dynamic_power"
26. How do you identify and fix high-fanout nets using
TCL in ICC2?
Filter nets based on fanout count and apply buffering strategies.

foreach net [get_nets] {


set fanout [llength [get_pins -of_objects $net]]
if {$fanout > 50} {
puts "High Fanout Net: $net, Fanout: $fanout"
insert_buffer -net $net -lib_cell BUF_X4
}
}

27. How do you identify and fix DRC violations using


TCL in Innovus?
Use report_drc and apply fixes iteratively.

set drc_violations [report_drc -violations]


foreach violation $drc_violations {
puts "Fixing: $violation"
fix_drc -rule $violation
}
28. How do you optimize placement congestion using
TCL in ICC2?
Use congestion maps and adjust cell placement dynamically.

set congestion_map [report_congestion -detail]


foreach region $congestion_map {
if {[lindex $region 1] > 80} {
puts "High Congestion at: $region"
legalize_placement -region $region
}
}

29. How do you automate ECO (Engineering Change


Order) flow using TCL?
Modify the netlist dynamically and update constraints.

read_verilog modified_design.v
read_sdc new_constraints.sdc
set_fix_hold [get_timing_paths -setup_violation]
30. How do you create a TCL script for STA report
extraction in PrimeTime?
Automate timing report extraction and formatting.

set reports {"setup_timing.rpt" "hold_timing.rpt"}


foreach rpt $reports {
report_timing -delay_type [file rootname $rpt] > $rpt
}
puts "STA Reports Generated Successfully!"

31. How do you check if a design has any


unconstrained endpoints using TCL in PrimeTime?
Use report_constraints to find unconstrained endpoints.

set unconstrained [report_constraints -all_violators | grep


"Unconstrained Endpoints"]
puts "Unconstrained Endpoints:\n$unconstrained"
32. How do you generate a TCL script to batch-run
multiple SDC constraint files in PrimeTime?
Use loops to iterate through multiple SDC files and apply them
dynamically.

foreach sdc_file [glob *.sdc] {


puts "Applying Constraints: $sdc_file"
read_sdc $sdc_file
update_timing
}
puts "All SDC constraints applied successfully!"

33. How do you write a TCL script to extract metal


layers and via usage statistics in ICC2?
Use report_layer_usage to analyze metal and via congestion.

set layer_usage [report_layer_usage]


puts "Metal and Via Usage Report:\n$layer_usage"
34. How do you list all sequential cells and their clock
domains in Innovus?
Use get_cells to extract flip-flops and map them to clock
domains

foreach ff [get_cells -filter {is_sequential == true}] {


set clk [get_clocks -of_objects $ff]
puts "FF: $ff -> Clock: $clk"
}

35. How do you identify and relocate standard cells


causing congestion in ICC2?
Use report_congestion and move cells with high congestion.

set congestion_map [report_congestion -detail]


foreach region $congestion_map {
if {[lindex $region 1] > 75} {
puts "High Congestion at: $region"
legalize_placement -region $region
}
}
36. How do you measure total cell area and track
utilization in ICC2?
Extract area using report_design_area.

set area_info [report_design_area]


puts "Total Design Area:\n$area_info"

37. How do you debug skew and insertion delay for a


clock tree using TCL in PrimeTime?
Use report_clock_timing to extract skew details.

report_clock_timing -clock clk1 -skew


report_clock_timing -clock clk1 -insertion_delay

38. How do you extract all macro instances and their


orientations in Innovus?
Use get_cells to list macros and check their orientations.

foreach macro [get_cells -filter "is_macro == true"] {


set orient [get_attribute $macro orientation]
puts "Macro: $macro -> Orientation: $orient"
}
39. How do you write a TCL script to automatically
buffer nets with excessive wirelength?
Use get_nets and insert_buffer to add buffers to long nets.

foreach net [get_nets] {


set length [get_net_length $net]
if {$length > 1000} {
puts "Buffering net: $net"
insert_buffer -net $net -lib_cell BUF_X4
}
}

40. How do you perform power domain connectivity


checks in a multi-voltage design using TCL?
Use check_mv_connectivity in PrimeTime PX.

set mv_report [check_mv_connectivity]


puts "Multi-Voltage Connectivity Report:\n$mv_report"

41. How do you extract top 10 worst timing paths in


PrimeTime?
Use report_timing with sorting and limit the output.

report_timing -max_paths 10 -sort_by slack


42. How do you generate a list of all instance names
along with their cell type in Innovus?
Use get_cells and get_attribute.

foreach inst [get_cells] {


set cell_type [get_attribute $inst cell]
puts "Instance: $inst -> Cell Type: $cell_type"
}

43. How do you check whether a pin belongs to a power


or ground net?
Use get_nets and check net type.

set pin "U1/VDD"


set net [get_nets -of_objects $pin]
set net_type [get_attribute $net type]
puts "Pin: $pin -> Net Type: $net_type"

44. How do you detect hold violations and suggest


fixing methods in PrimeTime?
Use report_timing for hold analysis.

report_timing -delay_type min -max_paths 10 -sort_by slack


45. How do you identify and fix antenna violations in
ICC2?
Use check_antennas and apply diode insertion.

set violations [check_antennas]


foreach viol $violations {
fix_antennas -object $viol -diode LIBCELL_AntennaDiode
}

46. How do you extract wirelength of a specific net in


ICC2?
Use get_net_length.

set net_length [get_net_length -of_objects [get_nets


data_bus]]
puts "Net data_bus length: $net_length"

47. How do you remove floating nets in a design using


TCL?
Identify nets without drivers and delete them.

foreach net [get_nets -no_driver] {


puts "Floating net detected: $net"
delete_nets $net
}
48. How do you create a TCL procedure to automate
clock buffer insertion in ICC2?
Use insert_buffer inside a procedure.

proc insert_clock_buffer {net_name buffer_cell} {


insert_buffer -net $net_name -lib_cell $buffer_cell
puts "Inserted buffer $buffer_cell on net $net_name"
}
insert_clock_buffer "clk1" "CLKBUF_X4"

49. How do you extract and store the congestion


heatmap of a design?
Use report_congestion -detail and store output.

set congestion_data [report_congestion -detail]


set output_file [open "congestion_report.txt" w]
puts $output_file $congestion_data
close $output_file
puts "Congestion report saved!"

50. How do you analyze all multi-cycle paths in


PrimeTime?
Use report_timing with multi-cycle path filtering.

report_timing -delay_type max -path_type full_clock_expanded


-cycle_path
51. How do you generate a list of all leaf cells used in a
design?
Use get_lib_cells.

set cells [get_lib_cells]


puts "All leaf cells in design:\n$cells"

52. How do you check if a specific cell is placed inside a


blockage?
Use get_attributes on placement regions.

set cell "U5"


set placement_area [get_attribute $cell bbox]
set blockage_area [get_objects -filter {is_blockage == true}]
if {$placement_area in $blockage_area} {
puts "Warning: Cell $cell is placed inside a blockage!"
}

53. How do you write a TCL script to find the shortest


timing path?
Sort timing paths by delay.

report_timing -delay_type min -sort_by delay -max_paths 1


54. How do you detect and fix missing level shifters in a
multi-voltage design?
Use check_mv_connectivity.

set mv_violations [check_mv_connectivity]


puts "Missing level shifters:\n$mv_violations"

55. How do you check if a register is connected to a


gated clock?
Analyze the clock tree and report gated clocks.

foreach reg [get_cells -filter "is_sequential == true"] {


set clk [get_clocks -of_objects $reg]
if {[get_attribute $clk is_gated]} {
puts "Register $reg uses a gated clock!"
}
}

56. How do you create a TCL script to analyze fanout


violations?
Use report_fanout_violations.

report_fanout_violations -threshold 10
57. How do you generate a list of all clock groups in a
design?
Use get_clocks and group them.

set clocks [get_clocks]


puts "Clock groups: $clocks"

58. How do you check if a net is properly shielded to


reduce crosstalk?
Analyze shielding attributes of nets.

set net "net123"


set shielded [get_attribute $net is_shielded]
puts "Net $net shielding status: $shielded"

59. How do you validate timing constraints using TCL?


Use check_timing.

check_timing
60. How do you create a custom TCL function to
generate a timing report for multiple clocks?
Use a procedure looping through clocks.

proc report_all_clocks_timing {} {
foreach clk [get_clocks] {
puts "Timing report for clock: $clk"
report_timing -clock $clk
}
}
report_all_clocks_timing
Excellence in World class
VLSI Training & Placements

Do follow for updates & enquires

+91- 9182280927

You might also like