# tcl for synopsys 这个tcl是只用于snps的tcl环境,其它家可能不能用。 ## - filter expression ### - 表达式匹配 expression ```tcl get_cells * -filter "full_name =~ *abc*" # 这个例子是获取full_name与*abc*相匹配的cells ``` filter可以使用如下的表达式\ ![:edastudy:pasted:20230608-084822.png](:edastudy:pasted:20230608-084822.png?nolink) ### - attribute function match ```tcl get_cells * -filter "defined(full_name)" # 这个例子是获取所有define了full_name属性的cells ``` ![:edastudy:pasted:20230608-084915.png](:edastudy:pasted:20230608-084915.png?nolink) ## - lsc ```tcl set fp [open "abc.log" w]; foreach_in_collection tmp [get_pins -hierarchical *Q] { set tt [get_attribute [get_pins $tmp] FULL_NAME]; puts $fp $tt; } close $fp; ``` ## - cc ```tcl list get_attribute object_list attribute_name [-bus] [-quiet] [-return_null_values] ``` ```tcl proc cc {coll} { foreach_in_collection item $coll { puts [get_attribute $item full_name] } } # 用于将coll list打印为行形式。 cc [get_cells] ```