-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlc_shell_command.log
More file actions
7067 lines (7045 loc) · 306 KB
/
lc_shell_command.log
File metadata and controls
7067 lines (7045 loc) · 306 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#@ #
#@ # Running lc_shell Version U-2022.12 for linux64 -- Dec 11, 2022
#@ # Date: Sat Apr 4 03:29:04 2026
#@ # Run by: v72206@vcl-vm0-175
#@
source /CMC/tools/synopsys/lc_vU-2022.12/lc/U-2022.12/admin/setup//.synopsys_lc.setup
#@ # -- Starting source /CMC/tools/synopsys/lc_vU-2022.12/lc/U-2022.12/admin/setup//.synopsys_lc.setup
#@ #
#@ #
#@ # ".synopsys_lc.setup" Initialization File for
#@ #
#@ # Lc_Shell and Library_compiler
#@ #
#@ # The variables in this file define the behavior of many parts
#@ # of the Synopsys Synthesis Tools. Upon installation, they should
#@ # be reviewed and modified to fit your site's needs. Each engineer
#@ # can have a .synopsys file in his/her home directory or current
#@ # directory to override variable settings in this file.
#@ #
#@
#@ # System variables
#@ # system default value for sh_continue_on_error is "false"
#@ set sh_continue_on_error "true"
#@ # system default value for sh_source_uses_search_path is "false"
#@ set sh_source_uses_search_path "true"
#@
#@ # Enable customer support banner on fatal
#@ if { $sh_arch == "linux" || $sh_arch == "amd64" || $sh_arch == "linux64" || \
#@ $sh_arch == "sparcOS5" || $sh_arch == "sparc64" || \
#@ $sh_arch == "x86sol32" || $sh_arch == "x86sol64" || \
#@ $sh_arch == "rs6000" || $sh_arch == "aix64" } {
#@ setenv SYNOPSYS_TRACE ""
#@ }
#@
#@ #
#@ # Load the procedures which make up part of the user interface.
#@ #
#@ source $synopsys_root/auxx/syn/.lc_procs.tcl
#@ # -- Starting source /CMC/tools/synopsys/lc_vU-2022.12/lc/U-2022.12/auxx/syn/.lc_procs.tcl
#@ ##############################################################################
#@ #
#@ #
#@ # FILE: auxx/syn/.lc_procs.tcl
#@ #
#@ # ABSTRACT: These procedures are part of the lc_shell
#@ # user interface.
#@ # They are loaded by .synopsys_lc.setup.
#@ #
#@ ##############################################################################
#@ #
#@ #
#@
#@ ##############################################################################
#@ #
#@ #
#@ # PROCEDURE: add_model
#@ #
#@ # ABSTRACT: dummy call
#@ #
#@ ##############################################################################
#@ #
#@
#@ proc add_model { args } {
#@ return [uplevel #0 $cmd]
#@ }
#@
#@ ##############################################################################
#@ #
#@ # PROCEDURE: remove_design
#@ #
#@ # ABSTRACT: map remove_design to remove_lib
#@ #
#@ # HISTORY : 2014/05/09, Synopsys, initial
#@ #
#@ ##############################################################################
#@
#@ proc remove_design { args } {
#@ parse_proc_arguments -args $args ra
#@
#@ if {[info exists ra(-library)]} {
#@ set cmd [format {remove_lib %s} $ra(-library)]
#@ } elseif {[info exists ra(-all)]} {
#@ set cmd {remove_lib -all}
#@ } else {
#@ set cmd [format {remove_lib [list %s]} $args]
#@ }
#@
#@ return [uplevel #0 $cmd]
#@ }
#@
#@ define_proc_attributes remove_design -hide_body \
#@ -info " alias of remove_lib " \
#@ -define_args {\
#@ {file_names "" file_names list {optional hidden}}\
#@ }
#@ # -- End source /CMC/tools/synopsys/lc_vU-2022.12/lc/U-2022.12/auxx/syn/.lc_procs.tcl
#@ source $synopsys_root/auxx/lc/.lc_scripts.tcl
#@ # -- Starting source /CMC/tools/synopsys/lc_vU-2022.12/lc/U-2022.12/auxx/lc/.lc_scripts.tcl
#@ ##############################################################################
#@ #
#@ #
#@ # FILE: lc_scripts.tcl
#@ #
#@ # ABSTRACT: These procedures are part of the lc_shell
#@ # user interface.
#@ # They are loaded by .synopsys_lc.setup.
#@ #
#@ ##############################################################################
#@
#@ ##############################################################################
#@ # Proc: read in the csv file to list of list
#@ # Author: Synopsys
#@ # Date: 2015/11/01
#@ # -channel: the input csv file
#@ # -header: == 1: use first line as index; header == 0: use row number as index
#@ # -symbol: delimiter, default is ","
#@ ##############################################################################
#@ proc read_csv { channel { header 1 } { symbol , }} {
#@ set quote 0
#@ set data [ split [ read $channel nonewline ] "\n" ]
#@ foreach line $data {
#@ set quote [ expr { $quote + [ regexp -all \" $line ]}]
#@ if { [ expr { $quote % 2 }] == "0" } {
#@ set quote 0
#@ append row_temp $line
#@ set row_temp [ split $row_temp , ]
#@ foreach section $row_temp {
#@ set quote [ expr { $quote + [ regexp -all \" $section ]}]
#@ if { [ expr { $quote % 2 }] == "0" } {
#@ append cell_temp $section
#@ set cell_temp [ regsub {^\s*(.*\S)\s*$} $cell_temp {\1} ]
#@ set cell_temp [ regsub {^\s*$} $cell_temp {\1} ]
#@ set cell_temp [ regsub {"(.*)"} $cell_temp {\1} ]
#@ lappend cell $cell_temp
#@ unset cell_temp
#@ set quote 0
#@ } else {
#@ append cell_temp $section$symbol
#@ }
#@ }
#@ lappend final [ regsub -all {""} $cell \" ]
#@ unset cell
#@ unset row_temp
#@ } else {
#@ append row_temp $line\n
#@ }
#@ }
#@ # return list of list
#@ return $final
#@ }
#@
#@ # This proc is hidden
#@ define_proc_attributes read_csv -hidden
#@
#@ ##############################################################################
#@ # Proc: sort the db_filename
#@ # Author: Synopsys
#@ # Date: 2015/11/01
#@ # Return array: key is db name, value is a list of colomn number
#@ ##############################################################################
#@ proc sort_array_by_db_filename { final id } {
#@ set row [ llength $final ]
#@
#@ for { set i 1 } { $i < $row } { incr i } {
#@ set db_name [lindex [lindex $final $i] $id]
#@ set db_ids [array names db_map $db_name]
#@ if { [string length $db_ids] > 0} {
#@ set db_map($db_name) [concat $db_map($db_name) $i]
#@ } else {
#@ set db_map($db_name) $i
#@ }
#@ }
#@
#@ return [ array get db_map ]
#@ }
#@
#@ # This proc is hidden
#@ define_proc_attributes sort_array_by_db_filename -hidden
#@
#@ ##############################################################################
#@ # Proc: get nldm delay point index/value
#@ # Author: Synopsys
#@ # Date: 2015/11/01
#@ # Args: -matching_point: 1: fit; others: bucket;
#@ # Return: for fit mode, return 1 grid point
#@ # for bucket mode, return a list of grid points
#@ #
#@ # Support NLDM NLPM query
#@ #
#@ # For different dimension lookup table
#@ # fit bucket
#@ # 2-D: 1 (idx1,idx2,val) 4 * 3 (idx1,idx2,val)
#@ # 1-D: 1 (idx1,val) 2 * 2 (idx1,val)
#@ # 0-D: 1 (val) 1 (val)
#@ #
#@ # The return array always contain 3 items (fit mode) or 12 items (bucket mode)
#@ # The unused ones are left empty for 1-D/0-D lookup table
#@ # If find any error, return array contains same number itmes with empty value
#@ ##############################################################################
#@ proc get_nldm_delay_point { line header idx {matching_point 1} } {
#@
#@ set column [llength $header]
#@ for { set j 0 } { $j < $column } { incr j } {
#@ set rec([ lindex $header $j ],$idx) [ lindex $line $j ]
#@ }
#@
#@ # initial return array
#@ if { $matching_point ==1 } {
#@ set tb(idx1,$idx) ""
#@ set tb(idx2,$idx) ""
#@ set tb(value,$idx) ""
#@ } else {
#@ set tb(idx1_a,$idx) ""
#@ set tb(idx2_a,$idx) ""
#@ set tb(value_a,$idx) ""
#@ set tb(idx1_b,$idx) ""
#@ set tb(idx2_b,$idx) ""
#@ set tb(value_b,$idx) ""
#@ set tb(idx1_c,$idx) ""
#@ set tb(idx2_c,$idx) ""
#@ set tb(value_c,$idx) ""
#@ set tb(idx1_d,$idx) ""
#@ set tb(idx2_d,$idx) ""
#@ set tb(value_d,$idx) ""
#@ }
#@
#@ # check library
#@ if { [string length [array names rec library,$idx]] ==0 ||
#@ [string length $rec(library,$idx)] ==0} {
#@ echo "line [expr $idx+1]: Error! Must specify field 'library' for query."
#@ return [ array get tb ]
#@ }
#@ # check cell
#@ if { [string length [array names rec cell,$idx]] ==0 ||
#@ [string length $rec(cell,$idx)] ==0} {
#@ echo "line [expr $idx+1]: Error! Must specify field 'cell' for query."
#@ return [ array get tb ]
#@ }
#@
#@ # get the cell, save the collection into global array for fast access next time.
#@ global lc_cells
#@ set lib_cell_name [array names lc_cells $rec(library,$idx)/$rec(cell,$idx)]
#@ if { [string length $lib_cell_name] > 0} {
#@ set pcell $lc_cells($lib_cell_name)
#@ } else {
#@ set pcell [get_lib_cells $rec(library,$idx)/$rec(cell,$idx)]
#@ if { [sizeof_collection $pcell] == 1 } {
#@ set lc_cells($rec(library,$idx)/$rec(cell,$idx)) $pcell
#@ } else {
#@ echo "line [expr $idx+1]: Error! Can't find this cell group."
#@ return [array get tb ]
#@ }
#@ }
#@
#@ # check group
#@ if { [string length [array names rec group,$idx]] ==0 ||
#@ [string length $rec(group,$idx)] ==0} {
#@ echo "line [expr $idx+1]: Error! Must specify field 'group' for query."
#@ return [ array get tb ]
#@ }
#@
#@ # get value NOT from lookup table
#@ if { [string equal $rec(group,$idx) leakage_power] } {
#@ # leakage power
#@
#@ # set filter
#@ if { [string length [array names rec when_cond,$idx]] >0 &&
#@ [string length $rec(when_cond,$idx)] >0 } {
#@ set ft \(when==\"$rec(when_cond,$idx)\"\)
#@ }
#@ if { [string length [array names rec related_pg_pin,$idx]] >0 &&
#@ [string length $rec(related_pg_pin,$idx)] >0 } {
#@ if {[info exists ft]} {
#@ set ft $ft&&\(related_pg_pin==$rec(related_pg_pin,$idx)\)
#@ } else {
#@ set ft \(related_pg_pin==$rec(related_pg_pin,$idx)\)
#@ }
#@ }
#@
#@ # set options: of_object, class_type, filter
#@ lappend opts -of_objects $pcell -class_type leakage_power
#@ if {[info exists ft]} {
#@ lappend opts -filter $ft
#@ }
#@
#@ # get leakage power
#@ set arc [eval get_lib_objects $opts]
#@
#@ if {[sizeof_collection $arc] == 0} {
#@ echo "line [expr $idx+1]: Error! Can't find this timing/power group."
#@ return [array get tb ]
#@ } elseif {[sizeof_collection $arc] > 1} {
#@ # using the first one !!!
#@ echo "line [expr $idx+1]: Warning! Find multiple timing/power groups, use the first one!"
#@ set arc [index_collection $arc 0]
#@ }
#@
#@ set value [format %g [get_lib_attribute $arc value]]
#@
#@ if { $matching_point ==1 } {
#@ if {[info exists value]} {
#@ set tb(value,$idx) $value
#@ }
#@ } else {
#@ if {[info exists value]} {
#@ set tb(value_a,$idx) $value
#@ }
#@ }
#@
#@ return [ array get tb ]
#@ }
#@
#@ # get value from lookup table
#@ if { [string equal $rec(group,$idx) cell_rise] ||
#@ [string equal $rec(group,$idx) cell_fall] ||
#@ [string equal $rec(group,$idx) rise_constraint] ||
#@ [string equal $rec(group,$idx) fall_constraint] ||
#@ [string equal $rec(group,$idx) rise_propagation] ||
#@ [string equal $rec(group,$idx) fall_propagation] ||
#@ [string equal $rec(group,$idx) rise_transition] ||
#@ [string equal $rec(group,$idx) fall_transition] ||
#@ [string equal $rec(group,$idx) ocv_sigma_cell_rise] ||
#@ [string equal $rec(group,$idx) ocv_sigma_cell_fall] ||
#@ [string equal $rec(group,$idx) ocv_sigma_rise_constraint] ||
#@ [string equal $rec(group,$idx) ocv_sigma_fall_constraint] ||
#@ [string equal $rec(group,$idx) ocv_sigma_rise_transition] ||
#@ [string equal $rec(group,$idx) ocv_sigma_fall_transition] } {
#@ # NLDM timing
#@
#@ # set filter
#@ if { [string length [array names rec timing_type,$idx]] >0 &&
#@ [string length $rec(timing_type,$idx)] >0 } {
#@ set ft \(timing_type==$rec(timing_type,$idx)\)
#@ }
#@ if { [string length [array names rec timing_sense,$idx]] >0 &&
#@ [string length $rec(timing_sense,$idx)] >0 } {
#@ if {[info exists ft]} {
#@ set ft $ft&&\(timing_sense==$rec(timing_sense,$idx)\)
#@ } else {
#@ set ft \(timing_sense==$rec(timing_sense,$idx)\)
#@ }
#@ }
#@ if { [string length [array names rec when_cond,$idx]] >0 &&
#@ [string length $rec(when_cond,$idx)] >0 } {
#@ if {[info exists ft]} {
#@ set ft $ft&&\(when==\"$rec(when_cond,$idx)\"\)
#@ } else {
#@ set ft \(when==\"$rec(when_cond,$idx)\"\)
#@ }
#@ }
#@
#@ # set options: of_object, from pin, to pin, filter
#@ lappend opts -of_objects $pcell
#@ if { [string length [array names rec pin,$idx]] >0 &&
#@ [string length $rec(pin,$idx)] >0 } {
#@ lappend opts -to $rec(pin,$idx)
#@ }
#@ if { [string length [array names rec related_pin,$idx]] >0 &&
#@ [string length $rec(related_pin,$idx)] >0 } {
#@ lappend opts -from $rec(related_pin,$idx)
#@ }
#@ if {[info exists ft]} {
#@ lappend opts -filter $ft
#@ }
#@
#@ # get timing arc
#@ set arc [eval get_lib_timing_arcs $opts]
#@
#@ } elseif { [string equal $rec(group,$idx) rise_power] ||
#@ [string equal $rec(group,$idx) fall_power] } {
#@ # NLPM internal power
#@
#@ # set filter
#@ if { [string length [array names rec when_cond,$idx]] >0 &&
#@ [string length $rec(when_cond,$idx)] >0 } {
#@ set ft \(when==\"$rec(when_cond,$idx)\"\)
#@ }
#@ if { [string length [array names rec related_pg_pin,$idx]] >0 &&
#@ [string length $rec(related_pg_pin,$idx)] >0 } {
#@ if {[info exists ft]} {
#@ set ft $ft&&\(related_pg_pin==$rec(related_pg_pin,$idx)\)
#@ } else {
#@ set ft \(related_pg_pin==$rec(related_pg_pin,$idx)\)
#@ }
#@ }
#@ if { [string length [array names rec related_pin,$idx]] >0 &&
#@ [string length $rec(related_pin,$idx)] >0 } {
#@ if {[info exists ft]} {
#@ set ft $ft&&\(related_pin==$rec(related_pin,$idx)\)
#@ } else {
#@ set ft \(related_pin==$rec(related_pin,$idx)\)
#@ }
#@ }
#@
#@ # get pin
#@ if { [string length [array names rec pin,$idx]] >0 &&
#@ [string length $rec(pin,$idx)] >0 } {
#@ set pin [get_lib_objects -of_objects $pcell -class_type pin -filter name==$rec(pin,$idx)]
#@ if {[sizeof_collection $pin] != 1} {
#@ echo "line [expr $idx+1]: Error! Can't find this pin group."
#@ return [array get tb ]
#@ }
#@
#@ # set options: of_object, -class_type, filter
#@ lappend opts -of_objects $pin -class_type internal_power
#@ if {[info exists ft]} {
#@ lappend opts -filter $ft
#@ }
#@
#@ # get internal power
#@ set arc [eval get_lib_objects $opts]
#@ }
#@ }
#@
#@ if {[sizeof_collection $arc] == 0} {
#@ echo "line [expr $idx+1]: Error! Can't find this timing/power group."
#@ return [array get tb ]
#@ } elseif {[sizeof_collection $arc] > 1} {
#@ # using the first one !!!
#@ echo "line [expr $idx+1]: Warning! Find multiple timing/power groups, use the first one!"
#@ set arc [index_collection $arc 0]
#@ }
#@
#@ # get the lookup table
#@ set lt [get_lookup_table -of_object $arc $rec(group,$idx)]
#@
#@ if {[sizeof_collection $lt] == 0} {
#@ echo "line [expr $idx+1]: Error! Can't find this lookup table."
#@ return [array get tb ]
#@ } elseif {[sizeof_collection $lt] > 1} {
#@ # using the first one !!!
#@ echo "line [expr $idx+1]: Warning! Find multiple lookup table, use the first one!"
#@ set lt [index_collection $lt 0]
#@ }
#@
#@ # won't consider index pairing for now
#@ # input_slew == input_net_transition/input_transition_time
#@ # output_load == total_output_net_capacitance
#@ set index1 input_net_transition
#@ set index2 total_output_net_capacitance
#@
#@ set ids [lookup_table variables $lt]
#@
#@ if { [llength $ids] == 1} {
#@ set index1 [lindex $ids 0]
#@ } elseif { [llength $ids] == 2} {
#@ set index1 [lindex $ids 0]
#@ set index2 [lindex $ids 1]
#@ }
#@
#@ # constraint template could have issue here
#@ # constraint variable related_pin_transition/constrained_pin_transition
#@ # doesn't follow the input csv table index name input_slew/output_load
#@ # then we don't know how to pair them
#@ if { $index1=="total_output_net_capacitance" } {
#@ set tmp_index $index1
#@ set index1 $index2
#@ set index2 $tmp_index
#@ }
#@
#@ if { [string length [array names rec input_slew,$idx]] >0 &&
#@ [string length $rec(input_slew,$idx)] >0 } {
#@ lappend pointl $index1 $rec(input_slew,$idx)
#@ }
#@ if { [string length [array names rec output_load,$idx]] >0 &&
#@ [string length $rec(output_load,$idx)] >0 } {
#@ lappend pointl $index2 $rec(output_load,$idx)
#@ }
#@
#@ # lookup_table fit/bucket …
#@ if { $matching_point ==1 } {
#@ if {[info exists pointl]} {
#@ redirect -variable msg {echo [set m_list [lookup_table fit $lt -index $pointl]]}
#@ } else {
#@ redirect -variable msg {echo [set m_list [lookup_table fit $lt]]}
#@ }
#@ if {[info exists m_list]} {
#@ if {[llength $m_list] == 3} {
#@ set tb(idx1,$idx) [format %g [lindex $m_list 0] ]
#@ set tb(idx2,$idx) [format %g [lindex $m_list 1] ]
#@ set tb(value,$idx) [format %g [lindex $m_list 2] ]
#@ } elseif {[llength $m_list] == 2} {
#@ set tb(idx1,$idx) [format %g [lindex $m_list 0] ]
#@ set tb(value,$idx) [format %g [lindex $m_list 1] ]
#@ } elseif {[llength $m_list] == 1} {
#@ set tb(value,$idx) [format %g [lindex $m_list 0] ]
#@ }
#@ }
#@ } else {
#@ if {[info exists pointl]} {
#@ redirect -variable msg {echo [set m_list [lookup_table bucket $lt -index $pointl]]}
#@ } else {
#@ redirect -variable msg {echo [set m_list [lookup_table bucket $lt]]}
#@ }
#@ if {[info exists m_list]} {
#@ if {[llength $m_list] == 4} {
#@ set tb(idx1_a,$idx) [format %g [lindex [lindex $m_list 0] 0] ]
#@ set tb(idx2_a,$idx) [format %g [lindex [lindex $m_list 0] 1] ]
#@ set tb(value_a,$idx) [format %g [lindex [lindex $m_list 0] 2] ]
#@ set tb(idx1_b,$idx) [format %g [lindex [lindex $m_list 1] 0] ]
#@ set tb(idx2_b,$idx) [format %g [lindex [lindex $m_list 1] 1] ]
#@ set tb(value_b,$idx) [format %g [lindex [lindex $m_list 1] 2] ]
#@ set tb(idx1_c,$idx) [format %g [lindex [lindex $m_list 2] 0] ]
#@ set tb(idx2_c,$idx) [format %g [lindex [lindex $m_list 2] 1] ]
#@ set tb(value_c,$idx) [format %g [lindex [lindex $m_list 2] 2] ]
#@ set tb(idx1_d,$idx) [format %g [lindex [lindex $m_list 3] 0] ]
#@ set tb(idx2_d,$idx) [format %g [lindex [lindex $m_list 3] 1] ]
#@ set tb(value_d,$idx) [format %g [lindex [lindex $m_list 3] 2] ]
#@ } elseif {[llength $m_list] == 2} {
#@ set tb(idx1_a,$idx) [format %g [lindex [lindex $m_list 0] 0] ]
#@ set tb(value_a,$idx) [format %g [lindex [lindex $m_list 0] 1] ]
#@ set tb(idx1_b,$idx) [format %g [lindex [lindex $m_list 1] 0] ]
#@ set tb(value_b,$idx) [format %g [lindex [lindex $m_list 1] 1] ]
#@ } elseif {[llength $m_list] == 1} {
#@ set tb(value_a,$idx) [format %g [lindex $m_list 0] ]
#@ }
#@ }
#@ }
#@ if {[string match {[a-zA-Z]*} $msg]} {
#@ echo Line [expr $idx+1]: Error! [string trim $msg \n]
#@ }
#@
#@ return [ array get tb ]
#@ }
#@
#@ # This proc is hidden
#@ define_proc_attributes get_nldm_delay_point -hidden
#@
#@ ##############################################################################
#@ # Proc: get_lib_grid_points
#@ # Author: Synopsys
#@ # Date: 2015/11/01
#@ # -matching_point: 1 fit; 2 bucket
#@ # -input_csv_file: the input csv file contains the querry condition
#@ # -output_csv_file: the input csv file contains the querry condition and query result
#@ #
#@ # Modified: Synopsys 2015/12/10
#@ # change proc name from "check_qualified_data_point" to "get_lib_lookup_data"
#@ # Modified: Synopsys 2016/01/05
#@ # change proc name from "get_lib_lookup_data" to "get_lib_grid_points"
#@ ##############################################################################
#@ proc get_lib_grid_points {args} {
#@
#@ # get the args
#@ parse_proc_arguments -args $args ra
#@ set input_csv_file $ra(input_csv_file)
#@ set output_csv_file $ra(output_csv_file)
#@
#@ if { [string length [array names ra matching_point]] ==0 } {
#@ set matching_point 1
#@ } else {
#@ set matching_point $ra(matching_point)
#@ }
#@
#@ # get the input csv data, put in 2-D table (list of list)
#@ set in [open $input_csv_file r]
#@ set table [ read_csv $in ]
#@ close $in
#@
#@ # get row/column/header
#@ set row [ llength $table ]
#@ set header [ lindex $table 0 ]
#@ set column [ llength $header ]
#@
#@ # check each header index name is correct
#@ set all_header {db_filename instance library cell pin group related_pin timing_type timing_sense when_cond related_pg_pin input_slew output_load}
#@ foreach item $header {
#@ if {[lsearch -exact $all_header $item] <0 } {
#@ echo "Error: Can't use '$item' as index."
#@ echo "The allowed index names are 'db_filename instance library cell pin group related_pin timing_type timing_sense when_cond related_pg_pin input_slew output_load'."
#@ return;
#@ }
#@ }
#@
#@ # db_id is the colomn for "db_filename"
#@ set db_id [lsearch -exact $header db_filename]
#@ if { $db_id <0 } {
#@ echo "Error: User must specify 'db_filename' index in the input_csv_file."
#@ return
#@ }
#@ set lib_id [lsearch -exact $header library]
#@ if { $lib_id <0 } {
#@ echo "Error: User must specify 'library' index in the input_csv_file."
#@ return
#@ }
#@
#@ # db_map is the mapping from db_filename to "row number" list
#@ array set db_map [sort_array_by_db_filename $table $db_id]
#@ set db_names [array names db_map]
#@ global lc_cells
#@
#@ # set process meter
#@ incr row -1
#@ set count 1
#@ if { $row > 10000 } {
#@ set pct_instance [expr $row/100]
#@ } else {
#@ set pct_instance 100
#@ }
#@
#@ # check each db at a time for saving memory
#@ foreach db $db_names {
#@ redirect -variable msg {echo [read_db $db]}
#@ set idx_list $db_map($db)
#@ array set lc_cells {0 0}
#@ foreach idx $idx_list {
#@
#@ # echo process meter
#@ if { $count % $pct_instance == 0 } {
#@ echo "Processing Cell Instance $count : out of $row"
#@ #echo [eval date]
#@ }
#@
#@ # get the querry data
#@ set line [lindex $table $idx]
#@ array set result [get_nldm_delay_point $line $header $idx $matching_point]
#@
#@ # save the querry result
#@ if { $matching_point ==1 } {
#@ lappend line $result(idx1,$idx)
#@ lappend line $result(idx2,$idx)
#@ lappend line $result(value,$idx)
#@ } else {
#@ lappend line $result(idx1_a,$idx)
#@ lappend line $result(idx2_a,$idx)
#@ lappend line $result(value_a,$idx)
#@ lappend line $result(idx1_b,$idx)
#@ lappend line $result(idx2_b,$idx)
#@ lappend line $result(value_b,$idx)
#@ lappend line $result(idx1_c,$idx)
#@ lappend line $result(idx2_c,$idx)
#@ lappend line $result(value_c,$idx)
#@ lappend line $result(idx1_d,$idx)
#@ lappend line $result(idx2_d,$idx)
#@ lappend line $result(value_d,$idx)
#@ }
#@ set table [lreplace $table $idx $idx $line]
#@
#@ incr count
#@ }
#@ unset lc_cells
#@ set lib_name [lindex [lindex $table $idx] $lib_id]
#@ redirect -variable msg {echo [remove_lib $db:$lib_name]}
#@
#@ }
#@
#@ # write to output csv file
#@ set out [open $output_csv_file w+]
#@
#@ if { $matching_point ==1 } {
#@ lappend header idx1 idx2 value
#@ } else {
#@ lappend header idx1_a idx2_a value_a idx1_b idx2_b value_b idx1_c idx2_c value_c idx1_d idx2_d value_d
#@ }
#@ set table [lreplace $table 0 0 $header]
#@ set row [ llength $table ]
#@ set column [ llength $header ]
#@
#@ set symbol ,
#@ for { set i 0 } { $i < $row } { incr i } {
#@ puts -nonewline $out [lindex [lindex $table $i] 0]
#@ for { set j 1 } { $j < $column } { incr j } {
#@ puts -nonewline $out $symbol
#@ puts -nonewline $out [lindex [lindex $table $i] $j]
#@ }
#@ puts $out ""
#@ }
#@ close $out
#@
#@ }
#@
#@ define_proc_attributes get_lib_grid_points \
#@ -info " Get the qualified grid points based on query parameter" \
#@ -define_args {
#@ {input_csv_file "The input file name contains query parameter" input_csv_file string required}
#@ {output_csv_file "The output file name for query result" output_csv_file string required}
#@ {matching_point "Query method: '1' for 1-closest grid point (default), '4' for 4 bucket grid points" matching_point one_of_string {optional value_help {values {1 4}}}}
#@ }
#@
#@ ##############################################################################
#@ # proc: write_records_in_csv
#@ # Output the data extracted from SQL database to $out_file csv file
#@ # file_id: fild id from csv filenam $out_file
#@ # arr: collection from SQL query commands
#@ # num_col: number of columns in $out_file
#@ ##############################################################################
#@ proc write_records_in_csv {file_id arr num_col} {
#@ global out_file
#@ set sz [expr [llength $arr]/$num_col]
#@ for {set i 0} {$i < $sz} {incr i} {
#@ set val ""
#@ for {set j 0} {$j < $num_col} {incr j} {
#@ set val1 [lindex $arr [expr $i*$num_col+$j]]
#@ if {$j == 0} {
#@ set val $val1
#@ } else {
#@ set val [concat $val,$val1]
#@ }
#@ #puts stdout j=$j
#@ }
#@ puts $file_id $val
#@ #puts stdout i=$i
#@ }
#@ #puts stdout "$sz records written to $out_file"
#@ }
#@
#@ define_proc_attributes write_records_in_csv -hidden
#@
#@ # -- End source /CMC/tools/synopsys/lc_vU-2022.12/lc/U-2022.12/auxx/lc/.lc_scripts.tcl
#@ source $synopsys_root/auxx/lc/analyze_trend.tcl
#@ # -- Starting source /CMC/tools/synopsys/lc_vU-2022.12/lc/U-2022.12/auxx/lc/analyze_trend.tcl
#@ ##############################################################################
#@ # Proc: analyze_trend Author: Synopsys Date: 2015/12/09
#@ # analyze the input float array monotonicity trend
#@ # return a char like "-, /, \, V, ^, N, u, M, W, X"
#@ # float_list: input float list, must be at least 2 members
#@ # -relative_tolerance: relative tolerance, default is 0.01
#@ # -absolute_tolerance: absolute tolerance, default is 0.000001
#@ ##############################################################################
#@ proc analyze_trend { args } {
#@
#@ # get the args
#@ parse_proc_arguments -args $args ra
#@ set float_list $ra(float_list)
#@
#@ if { [string length [array names ra -relative_tolerance]] ==0 } {
#@ set rel_tol 0.01
#@ } else {
#@ set rel_tol $ra(-relative_tolerance)
#@ }
#@ if { [string length [array names ra -absolute_tolerance]] ==0 } {
#@ set abs_tol 0.000001
#@ } else {
#@ set abs_tol $ra(-absolute_tolerance)
#@ }
#@
#@ set count [llength $float_list]
#@ if {$count <= 1} {
#@ echo "Can't analysis: list must have at least 2 members."
#@ }
#@
#@ set trend 0
#@
#@ for { set i 0 } { $i < $count - 1 } { incr i } {
#@ set fa [lindex $float_list $i]
#@ set fb [lindex $float_list $i+1]
#@
#@ set gap [expr abs($fa-$fb)]
#@ set rel_gap [expr ($fa+$fb)*0.5*$rel_tol]
#@
#@ if {$gap <= $abs_tol || $gap <= $rel_gap} {
#@ switch -exact -- $trend {
#@ "0" { set trend "-" }
#@ "-" { set trend "-" }
#@ "\\" { set trend "\\" }
#@ "/" { set trend "/" }
#@ "V" { set trend "V" }
#@ "^" { set trend "^" }
#@ "N" { set trend "N" }
#@ "u" { set trend "u" }
#@ "M" { set trend "M" }
#@ "W" { set trend "W" }
#@ default { set trend "X" }
#@ }
#@ } elseif {$fa > $fb} {
#@ switch -exact -- $trend {
#@ "0" { set trend "\\" }
#@ "-" { set trend "\\" }
#@ "\\" { set trend "\\" }
#@ "/" { set trend "^" }
#@ "V" { set trend "u" }
#@ "^" { set trend "^" }
#@ "u" { set trend "u" }
#@ "N" { set trend "M" }
#@ "M" { set trend "M" }
#@ "W" { set trend "X" }
#@ default { set trend "X" }
#@ }
#@ } elseif {$fa < $fb} {
#@ switch -exact -- $trend {
#@ "0" { set trend "/" }
#@ "-" { set trend "/" }
#@ "\\" { set trend "V" }
#@ "/" { set trend "/" }
#@ "V" { set trend "V" }
#@ "^" { set trend "N" }
#@ "N" { set trend "N" }
#@ "u" { set trend "W" }
#@ "M" { set trend "X" }
#@ "W" { set trend "W" }
#@ default { set trend "X" }
#@ }
#@ }
#@ if {$trend == "X"} {break}
#@ }
#@
#@ return $trend
#@ }
#@
#@ define_proc_attributes analyze_trend \
#@ -info " Analyze the trend of a float list" \
#@ -define_args {
#@ {float_list "The list contains float array for analysis" float_list list required}
#@ {-relative_tolerance "The relative tolerance for the float equal comparing, default is 0.01." relative_tolerance float optional}
#@ {-absolute_tolerance "The absolute tolerance for the float equal comparing, default is 1e-6." absolute_tolerance float optional}
#@ }
#@
#@ # -- End source /CMC/tools/synopsys/lc_vU-2022.12/lc/U-2022.12/auxx/lc/analyze_trend.tcl
#@ source $synopsys_root/auxx/lc/get_scale.tcl
#@ # -- Starting source /CMC/tools/synopsys/lc_vU-2022.12/lc/U-2022.12/auxx/lc/get_scale.tcl
#@ ##############################################################################
#@ # Proc: get_time_scale Author: Synopsys Date: 2015/12/09
#@ # unified time unit is 1ns
#@ # return the scale value from the unit to the unified unit.
#@ ##############################################################################
#@ proc get_time_scale { unit } {
#@
#@ set val 0
#@
#@ scan $unit %f%s digit class
#@
#@ switch -exact -- $class {
#@ "fs" { set val 1e-6 }
#@ "ps" { set val 1e-3 }
#@ "ns" { set val 1 }
#@ "us" { set val 1e3 }
#@ "ms" { set val 1e6 }
#@ "s" { set val 1e9 }
#@ "ks" { set val 1e12 }
#@ default { echo "Error! The unit '$unit' is not a 'time' unit" }
#@ }
#@
#@ set val [expr $val * $digit]
#@
#@ return $val
#@ }
#@ # This proc is hidden
#@ define_proc_attributes get_time_scale -hidden
#@
#@ ##############################################################################
#@ # Proc: get_voltage_scale Author: Synopsys Date: 2015/12/09
#@ # unified voltage unit is 1v
#@ # return the scale value from the unit to the unified unit.
#@ ##############################################################################
#@ proc get_voltage_scale { unit } {
#@
#@ set val 0
#@
#@ scan $unit %f%s digit class
#@
#@ switch -exact -- $class {
#@ "fv" { set val 1e-15 }
#@ "pv" { set val 1e-12 }
#@ "nv" { set val 1e-9 }
#@ "uv" { set val 1e-6 }
#@ "mv" { set val 1e-3 }
#@ "v" { set val 1 }
#@ "kv" { set val 1e3 }
#@ default { echo "Error! The unit '$unit' is not a 'voltage' unit" }
#@ }
#@
#@ set val [expr $val * $digit]
#@
#@ return $val
#@ }
#@ # This proc is hidden
#@ define_proc_attributes get_voltage_scale -hidden
#@
#@ ##############################################################################
#@ # Proc: get_current_scale Author: Synopsys Date: 2015/12/09
#@ # unified current unit is 1a
#@ # return the scale value from the unit to the unified unit.
#@ ##############################################################################
#@ proc get_current_scale { unit } {
#@
#@ set val 0
#@
#@ scan $unit %f%s digit class
#@
#@ switch -exact -- $class {
#@ "fa" { set val 1e-15 }
#@ "pa" { set val 1e-12 }
#@ "na" { set val 1e-9 }
#@ "ua" { set val 1e-6 }
#@ "ma" { set val 1e-3 }
#@ "a" { set val 1 }
#@ "ka" { set val 1e3 }
#@ default { echo "Error! The unit '$unit' is not a 'current' unit" }
#@ }
#@
#@ set val [expr $val * $digit]
#@
#@ return $val
#@ }
#@ # This proc is hidden
#@ define_proc_attributes get_current_scale -hidden
#@
#@ ##############################################################################
#@ # Proc: get_power_scale Author: Synopsys Date: 2015/12/09
#@ # unified power unit is 1w
#@ # return the scale value from the unit to the unified unit.
#@ ##############################################################################
#@ proc get_power_scale { unit } {
#@
#@ set val 0
#@
#@ scan $unit %f%s digit class
#@
#@ switch -exact -- $class {
#@ "fw" { set val 1e-15 }
#@ "pw" { set val 1e-12 }
#@ "nw" { set val 1e-9 }
#@ "uw" { set val 1e-6 }
#@ "mw" { set val 1e-3 }
#@ "w" { set val 1 }
#@ "kw" { set val 1e3 }
#@ default { echo "Error! The unit '$unit' is not a 'power' unit" }
#@ }
#@
#@ set val [expr $val * $digit]
#@
#@ return $val
#@ }
#@ # This proc is hidden
#@ define_proc_attributes get_power_scale -hidden
#@
#@ ##############################################################################
#@ # Proc: get_resistance_scale Author: Synopsys Date: 2015/12/09
#@ # unified resistance unit is 1ohm
#@ # return the scale value from the unit to the unified unit.
#@ ##############################################################################
#@ proc get_resistance_scale { unit } {
#@
#@ set val 0
#@
#@ scan $unit %f%s digit class
#@
#@ switch -exact -- $class {
#@ "fohm" { set val 1e-15 }
#@ "pohm" { set val 1e-12 }
#@ "nohm" { set val 1e-9 }
#@ "uohm" { set val 1e-6 }
#@ "mohm" { set val 1e-3 }
#@ "ohm" { set val 1 }
#@ "kohm" { set val 1e3 }
#@ default { echo "Error! The unit '$unit' is not a 'resistance' unit" }
#@ }
#@
#@ set val [expr $val * $digit]
#@
#@ return $val
#@ }
#@ # This proc is hidden
#@ define_proc_attributes get_resistance_scale -hidden
#@
#@ ##############################################################################
#@ # Proc: get_capacitance_scale Author: Synopsys Date: 2015/12/09
#@ # unified capacitance unit is 1f
#@ # return the scale value from the unit to the unified unit.
#@ ##############################################################################
#@ proc get_capacitance_scale { unit } {
#@
#@ set val 0
#@
#@ scan $unit %f%s digit class
#@
#@ switch -exact -- $class {
#@ "ff" { set val 1e-15 }
#@ "pf" { set val 1e-12 }
#@ "nf" { set val 1e-9 }
#@ "uf" { set val 1e-6 }
#@ "mf" { set val 1e-3 }
#@ "f" { set val 1 }
#@ "kf" { set val 1e3 }
#@ default { echo "Error! The unit '$unit' is not a 'capacitance' unit" }
#@ }
#@
#@ set val [expr $val * $digit]
#@
#@ return $val
#@ }
#@ # This proc is hidden
#@ define_proc_attributes get_capacitance_scale -hidden
#@
#@ ##############################################################################
#@ # Proc: get_energy_scale Author: Synopsys Date: 2015/12/09
#@ # unified energy unit is 1j
#@ # return the scale value from the unit to the unified unit.
#@ ##############################################################################
#@ proc get_energy_scale { unit } {
#@