forked from li3939108/DEF-Parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefwWriter.h
1455 lines (1196 loc) · 61.4 KB
/
defwWriter.h
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
/* ************************************************************************** */
/* ************************************************************************** */
/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */
/* ************************************************************************** */
/* ************************************************************************** */
/* Copyright 2013, Cadence Design Systems */
/* */
/* This file is part of the Cadence LEF/DEF Open Source */
/* Distribution, Product Version 5.8. */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
/* implied. See the License for the specific language governing */
/* permissions and limitations under the License. */
/* */
/* For updates, support, or to become part of the LEF/DEF Community, */
/* check www.openeda.org for details. */
/* */
/* $Author: dell $ */
/* $Revision: #7 $ */
/* $Date: 2015/01/27 $ */
/* $State: $ */
/* ************************************************************************** */
/* ************************************************************************** */
#ifndef CDEFWWRITER_H
#define CDEFWWRITER_H
#include <stdio.h>
#include "defiTypedefs.h"
/* Return codes for writing functions: */
#define DEFW_OK 0
#define DEFW_UNINITIALIZED 1
#define DEFW_BAD_ORDER 2
#define DEFW_BAD_DATA 3
#define DEFW_ALREADY_DEFINED 4
#define DEFW_WRONG_VERSION 5
#define DEFW_OBSOLETE 6
#define DEFW_TOO_MANY_STMS 7
/* section is smaller than the actual numbe */
/* of statements defined in that section */
/* orient
0 = N
1 = W
2 = S
3 = E
4 = FN
5 = FW
6 = FS
7 = FE
*/
/* This routine will write a new line */
EXTERN int defwNewLine ();
/* The DEF writer initialization. Must be called first.
* Either this routine or defwInitCbk should be call only.
* Can't call both routines in one program.
* This routine is for user who does not want to use the callback machanism.
* Returns 0 if successful. */
EXTERN int defwInit (FILE* f, int vers1, int version2, const char* caseSensitive, const char* dividerChar, const char* busBitChars, const char* designName, const char* technology, const char* array, const char* floorplan, double units);
/* The DEF writer initialization. Must be called first.
* Either this routine or defwInit should be call only.
* Can't call both routines in one program.
* This routine is for user who choose to use the callback machanism.
* If user uses the callback for the writer, they need to provide
* callbacks for Version, NamesCaseSensitive, BusBitChars and DividerChar.
* These sections are required by the def. If any of these callbacks
* are missing, defaults will be used.
* Returns 0 if successful. */
EXTERN int defwInitCbk (FILE* f);
/* This routine must be called after the defwInit.
* This routine is required.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwVersion (int vers1, int vers2);
/* This routine must be called after the defwInit.
* This routine is required.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwCaseSensitive (const char* caseSensitive);
/* This routine must be called after the defwInit.
* This routine is required.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwBusBitChars (const char* busBitChars);
/* This routine must be called after the defwInit.
* This routine is required.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwDividerChar (const char* dividerChar);
/* This routine must be called after the defwInit.
* This routine is required.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwDesignName (const char* name);
/* This routine must be called after the defwInit.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwTechnology (const char* technology);
/* This routine must be called after the defwInit.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwArray (const char* array);
/* This routine must be called after the defwInit.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwFloorplan (const char* floorplan);
/* This routine must be called after the defwInit.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwUnits (int units);
/* This routine must be called after the defwInit.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called 0 to many times. */
EXTERN int defwHistory (const char* string);
/* This routine must be called after the history routines (if any).
* This routine is optional.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwStartPropDef ();
/* This routine must be called after defwStartPropDef.
* This routine can be called multiple times.
* It adds integer property definition to the statement.
* Returns 0 if successfull.
* The objType can be LIBRARY or VIA or MACRO or PIN. */
/* NONDEFAULTRULE | MACRO | PIN */
EXTERN int defwIntPropDef (const char* objType, const char* propName, double leftRange, double rightRange, int propValue);
/* This routine must be called after defwStartPropDef.
* This routine can be called multiple times.
* It adds real property definition to the statement.
* Returns 0 if successfull.
* The objType can be LIBRARY or VIA or MACRO or PIN. */
/* NONDEFAULTRULE | MACRO | PIN */
EXTERN int defwRealPropDef (const char* objType, const char* propName, double leftRange, double rightRange, double propValue);
/* This routine must be called after defwStartPropDef.
* This routine can be called multiple times.
* It adds string property definition to the statement.
* Returns 0 if successfull.
* The objType can be LIBRARY or VIA or MACRO or PIN. */
/* NONDEFAULTRULE | MACRO | PIN */
EXTERN int defwStringPropDef (const char* objType, const char* propName, double leftRange, double rightRange, const char* propValue);
/* This routine must be called after all the properties have been
* added to the file.
* If you called defwPropertyDefinitions then this routine is NOT optional.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwEndPropDef ();
/* This routine can be called after defwRow, defwRegion, defwComponent,
* defwPin, defwSpecialNet, defwNet, and defwGroup
* This routine is optional, it adds string property to the statement.
* Returns 0 if successful.
* This routine can be called 0 to many times */
EXTERN int defwStringProperty (const char* propName, const char* propValue);
/* This routine can be called after defwRow, defwRegion, defwComponent,
* defwPin, defwSpecialNet, defwNet, and defwGroup
* This routine is optional, it adds real property to the statement.
* Returns 0 if successful.
* This routine can be called 0 to many times */
EXTERN int defwRealProperty (const char* propName, double propValue);
/* This routine can be called after defwRow, defwRegion, defwComponent,
* defwPin, defwSpecialNet, defwNet, and defwGroup
* This routine is optional, it adds int property to the statement.
* Returns 0 if successful.
* This routine can be called 0 to many times */
EXTERN int defwIntProperty (const char* propName, int propValue);
/* This routine must be called after the property definitions (if any).
* This routine is optional.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwDieArea (int xl, int yl, int xh, int yh);
/* This routine must be called after the property definitions (if any).
* This routine is optional.
* This routine is the same as defwDieArea, but accept more than 2 points
* This is a 5.6 syntax
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwDieAreaList (int num_points, int* xl, int* yh);
/* This routine must be called after the Die Area (if any).
* This routine is optional.
* Returns 0 if successful.
* The integer "orient" and operation of the do is explained in
* the documentation.
* In 5.6, the DO syntax is optional and the STEP syntax is optional in DO */
EXTERN int defwRow (const char* rowName, const char* rowType, int x_orig, int y_orig, int orient, int do_count, int do_increment, int xstep, int ystep);
/* This routine must be called after the Die Area (if any).
* This routine is optional.
* Returns 0 if successful.
* This routine is the same as defwRow, excpet orient is a char* */
EXTERN int defwRowStr (const char* rowName, const char* rowType, int x_orig, int y_orig, const char* orient, int do_count, int do_increment, int xstep, int ystep);
/* This routine must be called after the defwRow (if any).
* This routine is optional.
* Returns 0 if successful.
* The operation of the do is explained in the documentation. */
EXTERN int defwTracks (const char* master, int doStart, int doCount, int doStep, int numLayers, const char** layers, int mask, int sameMask);
/* This routine must be called after the defwTracks (if any).
* This routine is optional.
* Returns 0 if successful.
* The operation of the do is explained in the documentation. */
EXTERN int defwGcellGrid (const char* master, int doStart, int doCount, int doStep);
/* This routine must be called after the defwTracks (if any).
* This section of routines is optional.
* Returns 0 if successful.
* The routine starts the default capacitance section. All of the
* capacitances must follow.
* The count is the number of defwDefaultCap calls to follow.
* The routine can be called only once.
* This api is obsolete in 5.4. */
EXTERN int defwStartDefaultCap (int count);
/* This routine is called once for each default cap. The calls must
* be preceeded by a call to defwStartDefaultCap and must be
* terminated by a call to defwEndDefaultCap.
* Returns 0 if successful.
* This api is obsolete in 5.4. */
EXTERN int defwDefaultCap (int pins, double cap);
/* This routine must be called after the defwDefaultCap calls (if any).
* Returns 0 if successful.
* If the count in StartDefaultCap is not the same as the number of
* calls to DefaultCap then DEFW_BAD_DATA will return returned.
* The routine can be called only once.
* This api is obsolete in 5.4. */
EXTERN int defwEndDefaultCap ();
/* This routine must be called after the defwDefaultCap calls (if any).
* The operation of the do is explained in the documentation.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called many times. */
EXTERN int defwCanPlace (const char* master, int xOrig, int yOrig, int orient, int doCnt, int doInc, int xStep, int yStep);
/* This routine must be called after the defwDefaultCap calls (if any).
* The operation of the do is explained in the documentation.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called many times.
* This routine is the same as defwCanPlace, except orient is a char* */
EXTERN int defwCanPlaceStr (const char* master, int xOrig, int yOrig, const char* orient, int doCnt, int doInc, int xStep, int yStep);
/* This routine must be called after the defwCanPlace calls (if any).
* The operation of the do is explained in the documentation.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called many times. */
EXTERN int defwCannotOccupy (const char* master, int xOrig, int yOrig, int orient, int doCnt, int doInc, int xStep, int yStep);
/* This routine must be called after the defwCanPlace calls (if any).
* The operation of the do is explained in the documentation.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called many times.
* This routine is the same as defwCannotOccupy, except orient is a char* */
EXTERN int defwCannotOccupyStr (const char* master, int xOrig, int yOrig, const char* orient, int doCnt, int doInc, int xStep, int yStep);
/* This routine must be called after defwCannotOccupy (if any).
* This section of routines is optional.
* Returns 0 if successful.
* The routine starts the via section. All of the vias must follow.
* The count is the number of defwVia calls to follow.
* The routine can be called only once. */
EXTERN int defwStartVias (int count);
/* These routines enter each via into the file.
* These routines must be called after the defwStartVias call.
* defwViaName should be called first, follow either by defwViaPattern or
* defwViaLayer. At the end of each via, defwOneViaEnd should be called
* These routines are for [- viaName [+ PATTERNNAME patternName + RECT layerName
* pt pt]...;]...
* Returns 0 if successful.
* The routines can be called many times. */
EXTERN int defwViaName (const char* name);
EXTERN int defwViaPattern (const char* patternName);
/* This routine can be called multiple times. */
/* mask is 5.8 syntax */
EXTERN int defwViaRect (const char* layerName, int xl, int yl, int xh, int yh, int mask);
/* This is a 5.6 syntax
* This routine can be called multiple times. */
/* mask is 5.8 syntax */
EXTERN int defwViaPolygon (const char* layerName, int num_polys, double* xl, double* yl, int mask);
/* These routine must be called after defwViaName.
* Either this routine or defwViaPattern can be called after each
* defwViaName is called.
* This is a 5.6 syntax
* Returns 0 if successful
* The routine can be called only once per defwViaName called. */
EXTERN int defwViaViarule (const char* viaRuleName, double xCutSize, double yCutSize, const char* botMetalLayer, const char* cutLayer, const char* topMetalLayer, double xCutSpacing, double yCutSpacing, double xBotEnc, double yBotEnc, double xTopEnc, double yTopEnc);
/* This routine can call only after defwViaViarule.
* It can only be called once.
* This is a 5.6 syntax.
* Returns 0 if successful. */
EXTERN int defwViaViaruleRowCol (int numCutRows, int numCutCols);
/* This routine can call only after defwViaViarule.
* It can only be called once.
* This is a 5.6 syntax.
* Returns 0 if successful. */
EXTERN int defwViaViaruleOrigin (int xOffset, int yOffset);
/* This routine can call only after defwViaViarule.
* It can only be called once.
* This is a 5.6 syntax.
* Returns 0 if successful. */
EXTERN int defwViaViaruleOffset (int xBotOffset, int yBotOffset, int xTopOffset, int yTopOffset);
/* This routine can call only after defwViaViarule.
* It can only be called once.
* This is a 5.6 syntax.
* Returns 0 if successful. */
EXTERN int defwViaViarulePattern (const char* cutPattern);
EXTERN int defwOneViaEnd ();
/* This routine must be called after the defwVia calls.
* Returns 0 if successful.
* If the count in StartVias is not the same as the number of
* calls to Via or ViaPattern then DEFW_BAD_DATA will return returned.
* The routine can be called only once. */
EXTERN int defwEndVias ();
/* This routine must be called after via section (if any).
* This section of routines is optional.
* Returns 0 if successful.
* The routine starts the region section. All of the regions must follow.
* The count is the number of defwRegion calls to follow.
* The routine can be called only once. */
EXTERN int defwStartRegions (int count);
/* This routine enter each region into the file.
* This routine must be called after the defwStartRegions call.
* Returns 0 if successful.
* The routine can be called many times. */
EXTERN int defwRegionName (const char* name);
/* This routine enter the region point to the region name.
* This routine must be called after the defwRegionName call.
* Returns 0 if successful.
* The routine can be called many times. */
EXTERN int defwRegionPoints (int xl, int yl, int xh, int yh);
/* This routine enter the region type, FENCE | GUIDE.
* This routine must be called after the defwRegionName call.
* This is a 5.4.1 syntax.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwRegionType (const char* type);
/* This routine must be called after the defwRegion calls.
* Returns 0 if successful.
* If the count in StartRegions is not the same as the number of
* calls to Region or RegionPattern then DEFW_BAD_DATA will return returned.
* The routine can be called only once. */
EXTERN int defwEndRegions ();
/* This is a 5.8 syntax.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwComponentMaskShiftLayers (const char** layerNames, int numLayerName);
/* This routine must be called after the regions section (if any).
* This section of routines is NOT optional.
* Returns 0 if successful.
* The routine starts the components section. All of the components
* must follow.
* The count is the number of defwComponent calls to follow.
* The routine can be called only once. */
EXTERN int defwStartComponents (int count);
/* This routine enter each component into the file.
* This routine must be called after the defwStartComponents call.
* The optional fields will be ignored if they are set to zero
* (except for weight which must be set to -1.0).
* Returns 0 if successful.
* The routine can be called many times. */
/* USER | TIMING */
/* foreignx, foreigny & orients */
/* PLACED | UNPLACED */
/* xh, yh or region */
EXTERN int defwComponent (const char* instance, const char* master, int numNetName, const char** netNames, const char* eeq, const char* genName, const char* genParemeters, const char* source, int numForeign, const char** foreigns, int* foreignX, int* foreignY, int* foreignOrients, const char* status, int statusX, int statusY, int statusOrient, double weight, const char* region, int xl, int yl, int xh, int yh);
/* This routine enter each component into the file.
* This routine must be called after the defwStartComponents call.
* The optional fields will be ignored if they are set to zero
* (except for weight which must be set to -1.0).
* Returns 0 if successful.
* The routine can be called many times.
* This routine is the same as defwComponent, except orient is a char** */
/* */
/* USER | TIMING */
/* foreignx, foreigny & orients */
/* PLACED | UNPLACED */
/* xh, yh or region */
EXTERN int defwComponentStr (const char* instance, const char* master, int numNetName, const char** netNames, const char* eeq, const char* genName, const char* genParemeters, const char* source, int numForeign, const char** foreigns, int* foreignX, int* foreignY, const char** foreignOrients, const char* status, int statusX, int statusY, const char* statusOrient, double weight, const char* region, int xl, int yl, int xh, int yh);
/* This is a 5.8 syntax.
* Returns 0 if successful.
* The routine can be called only once. */
EXTERN int defwComponentMaskShift (int shiftLayerMasks);
/* This routine must be called after either the defwComponent or
* defwComponentStr.
* This routine can only called once per component.
* Either this routine or defwComponentHaloSoft can be called, but not both
* This routine is optional.
* This is a 5.6 syntax.
* Returns 0 if successful. */
EXTERN int defwComponentHalo (int left, int bottom, int right, int top);
/* This routine must be called after either the defwComponent or
* defwComponentStr.
* This routine can only called once per component.
* This routine is just like defwComponentHalo, except it writes the option SOFT
* Either this routine or defwComponentHalo can be called, but not both
* This routine is optional.
* This is a 5.7 syntax.
* Returns 0 if successful. */
EXTERN int defwComponentHaloSoft (int left, int bottom, int right, int top);
/* This routine must be called after either the defwComponent or
* defwComponentStr.
* This routine can only called once per component.
* This routine is optional.
* This is a 5.7 syntax.
* Returns 0 if successful. */
EXTERN int defwComponentRouteHalo (int haloDist, const char* minLayer, const char* maxLayer);
/* This routine must be called after the defwComponent calls.
* Returns 0 if successful.
* If the count in StartComponents is not the same as the number of
* calls to Component then DEFW_BAD_DATA will return returned.
* The routine can be called only once. */
EXTERN int defwEndComponents ();
/* This routine must be called after the components section (if any).
* This section of routines is optional.
* Returns 0 if successful.
* The routine starts the pins section. All of the pins must follow.
* The count is the number of defwPin calls to follow.
* The routine can be called only once. */
EXTERN int defwStartPins (int count);
/* This routine enter each pin into the file.
* This routine must be called after the defwStartPins call.
* The optional fields will be ignored if they are set to zero.
* Returns 0 if successful.
* The routine can be called many times.
* NOTE: Use defwPinLayer to write out layer with SPACING or DESIGNRULEWIDTH */
/* INOUT | FEEDTHRU */
/* GROUND | CLOCK | TIEOFF | ANALOG */
/* COVER */
EXTERN int defwPin (const char* name, const char* net, int special, const char* direction, const char* use, const char* status, int statusX, int statusY, int orient, const char* layer, int xl, int yl, int xh, int yh);
/* This routine enter each pin into the file.
* This routine must be called after the defwStartPins call.
* The optional fields will be ignored if they are set to zero.
* Returns 0 if successful.
* The routine can be called many times.
* This routine is the same as defwPin, except orient is a char*
* NOTE: Use defwPinLayer to write out layer with SPACING or DESIGNRULEWIDTH */
/* INOUT | FEEDTHRU */
/* GROUND | CLOCK | TIEOFF | ANALOG */
/* COVER */
EXTERN int defwPinStr (const char* name, const char* net, int special, const char* direction, const char* use, const char* status, int statusX, int statusY, const char* orient, const char* layer, int xl, int yl, int xh, int yh);
/* This routine should be called if the layer has either SPACING or
* DESIGNRULEWIDTH. If this routine is used and the pin has only one
* layer, the layer in defwPin or defwPinStr has to be null, otherwise
* the layer will be written out twice.
* This routine must be called after defwPin or defwPinStr.
* This is a 5.6 syntax.
* This routine is optional.
* Returns 0 if successful.
* This routine can be called multiple times within a pin. */
EXTERN int defwPinLayer (const char* layerName, int spacing, int designRuleWidth, int xl, int yl, int xh, int yh, int mask);
/* This routine must be called after defwPin or defwPinStr.
* This routine is to write out layer with polygon.
* This is a 5.6 syntax.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called multiple times within a pin. */
EXTERN int defwPinPolygon (const char* layerName, int spacing, int designRuleWidth, int num_polys, double* xl, double* yl, int mask);
/* This routine must be called after defwPin or defwPinStr.
* This routine is to write out layer with via.
* This is a 5.7 syntax.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called multiple times within a pin. */
EXTERN int defwPinVia (const char* viaName, int xl, int yl, int mask);
/* This routine must be called after defwPin or defwPinStr.
* This routine is to write out pin with port.
* This is a 5.7 syntax.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called multiple times within a pin. */
EXTERN int defwPinPort ();
/* This routine is called after defwPinPort.
* This is a 5.7 syntax.
* This routine is optional.
* Returns 0 if successful.
* This routine can be called multiple times within a pin. */
EXTERN int defwPinPortLayer (const char* layerName, int spacing, int designRuleWidth, int xl, int yl, int xh, int yh, int mask);
/* This routine must be called after defwPinPort.
* This is a 5.7 syntax.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called multiple times within a pin. */
EXTERN int defwPinPortPolygon (const char* layerName, int spacing, int designRuleWidth, int num_polys, double* xl, double* yl, int mask);
/* This routine must be called after defwPinPort.
* This is a 5.7 syntax.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called multiple times within a pin. */
EXTERN int defwPinPortVia (const char* viaName, int xl, int yl, int mask);
/* This routine must be called after defwPinPort.
* This is a 5.7 syntax.
* This routine is optional.
* Returns 0 if successful.
* The routine can be called many times.
* NOTE: Use defwPinLayer to write out layer with SPACING or DESIGNRULEWIDTH */
EXTERN int defwPinPortLocation (const char* status, int statusX, int statusY, const char* orient);
/* This routine must be called after defwPin.
* Returns 0 if successful.
* This is a 5.6 syntax.
* The routine can be called only once per pin. */
EXTERN int defwPinNetExpr (const char* pinExpr);
/* This routine must be called after defwPin.
* Returns 0 if successful.
* This is a 5.6 syntax.
* The routine can be called only once per pin. */
EXTERN int defwPinSupplySensitivity (const char* pinName);
/* This routine must be called after defwPin.
* Returns 0 if successful.
* This is a 5.6 syntax.
* The routine can be called only once per pin. */
EXTERN int defwPinGroundSensitivity (const char* pinName);
/* This routine must be called after defwPin.
* Returns 0 if successful.
* This is a 5.4 syntax.
* The routine can be called multiple times. */
EXTERN int defwPinAntennaPinPartialMetalArea (int value, const char* layerName);
/* This routine must be called after defwPin.
* Returns 0 if successful.
* This is a 5.4 syntax.
* The routine can be called multiple times. */
EXTERN int defwPinAntennaPinPartialMetalSideArea (int value, const char* layerName);
/* This routine must be called after defwPin.
* Returns 0 if successful.
* This is a 5.4 syntax.
* The routine can be called multiple times. */
EXTERN int defwPinAntennaPinPartialCutArea (int value, const char* layerName);
/* This routine must be called after defwPin.
* Returns 0 if successful.
* This is a 5.4 syntax.
* The routine can be called multiple times. */
EXTERN int defwPinAntennaPinDiffArea (int value, const char* layerName);
/* This routine must be called after defwPin.
* Returns 0 if successful.
* This is a 5.5 syntax.
* The oxide can be either OXIDE1, OXIDE2, OXIDE3, or OXIDE4.
* Each oxide value can be called only once after defwPin. */
EXTERN int defwPinAntennaModel (const char* oxide);
/* This routine must be called after defwPin.
* Returns 0 if successful.
* This is a 5.4 syntax.
* The routine can be called multiple times. */
EXTERN int defwPinAntennaPinGateArea (int value, const char* layerName);
/* This routine must be called after defwPin.
* Returns 0 if successful.
* This is a 5.4 syntax.
* The routine can be called multiple times. */
EXTERN int defwPinAntennaPinMaxAreaCar (int value, const char* layerName);
/* This routine must be called after defwPin.
* Returns 0 if successful.
* This is a 5.4 syntax.
* The routine can be called multiple times. */
EXTERN int defwPinAntennaPinMaxSideAreaCar (int value, const char* layerName);
/* This routine must be called after defwPin.
* Returns 0 if successful.
* This is a 5.4 syntax.
* The routine can be called multiple times. */
EXTERN int defwPinAntennaPinMaxCutCar (int value, const char* layerName);
/* This routine must be called after the defwPin calls.
* Returns 0 if successful.
* If the count in StartPins is not the same as the number of
* calls to Pin then DEFW_BAD_DATA will return returned.
* The routine can be called only once. */
EXTERN int defwEndPins ();
/* This routine must be called after the pin section (if any).
* This section of routines is optional.
* Returns 0 if successful.
* The routine starts the pinproperties section. All of the pinproperties
* must follow.
* The count is the number of defwPinProp calls to follow.
* The routine can be called only once. */
EXTERN int defwStartPinProperties (int count);
/* This routine enter each pinproperty into the file.
* This routine must be called after the defwStartPinProperties call.
* The optional fields will be ignored if they are set to zero.
* Returns 0 if successful.
* The routine can be called many times. */
EXTERN int defwPinProperty (const char* name, const char* pinName);
/* This routine must be called after the defwPinProperty calls.
* Returns 0 if successful.
* If the count in StartPins is not the same as the number of
* calls to Pin then DEFW_BAD_DATA will return returned.
* The routine can be called only once. */
EXTERN int defwEndPinProperties ();
/* Routines to enter a special net or nets into the file.
* You must first call defwStartSpecialNets with the number of
* nets. This section is required, even if you do not have any nets.
* For each net you should call defwSpecialNet followed by
* one or more defwSpecialNetConnection calls.
* After the connections come the options. Options are
* NOT required.
* Each net is completed by calling defwSpecialNetEndOneNet().
* The nets section is finished by calling defwEndNets(). */
EXTERN int defwStartSpecialNets (int count);
/* This routine must be called after the defwStartSpecialNets it is for
* - netName */
EXTERN int defwSpecialNet (const char* name);
/* This routine is for compNameRegExpr, pinName, and SYNTHESIZED */
/* It can be called multiple times */
EXTERN int defwSpecialNetConnection (const char* inst, const char* pin, int synthesized);
/* This routine is for + FIXEDBUMP
* This is a 5.4.1 syntax */
EXTERN int defwSpecialNetFixedbump ();
/* This routine is for + VOLTAGE volts */
EXTERN int defwSpecialNetVoltage (double v);
/* This routine is for + SPACING layerName spacing [RANGE minwidth maxwidth */
EXTERN int defwSpecialNetSpacing (const char* layer, int spacing, double minwidth, double maxwidth);
/* This routine is for + WIDTH layerName width */
EXTERN int defwSpecialNetWidth (const char* layer, int width);
/* This routine is for + SOURCE {NETLIST | DIST | USER | TIMING} */
EXTERN int defwSpecialNetSource (const char* name);
/* This routine is for + ORIGINAL netName */
EXTERN int defwSpecialNetOriginal (const char* name);
/* This routine is for + PATTERN {STEINER | BALANCED | WIREDLOGIC | TRUNK} */
EXTERN int defwSpecialNetPattern (const char* name);
/* This routine is for + USE {SIGNAL | POWER | GROUND | CLOCK | TIEOFF |
ANALOG | SCAN | RESET} */
EXTERN int defwSpecialNetUse (const char* name);
/* This routine is for + WEIGHT weight */
EXTERN int defwSpecialNetWeight (double value);
/* This routine is for + ESTCAP wireCapacitance */
EXTERN int defwSpecialNetEstCap (double value);
/* Paths are a special type of option. A path must begin
* with a defwSpecialNetPathStart and end with a defwSpecialNetPathEnd().
* The individual parts of the path can be entered in
* any order. */
EXTERN int defwSpecialNetPathStart (const char* typ);
/* SHIELD | NEW */
EXTERN int defwSpecialNetShieldNetName (const char* name);
EXTERN int defwSpecialNetPathLayer (const char* name);
EXTERN int defwSpecialNetPathWidth (int width);
/* This routine is optional.
* This is a 5.6 syntax. */
EXTERN int defwSpecialNetPathStyle (int styleNum);
EXTERN int defwSpecialNetPathShape (const char* shapeType);
/* FOLLOWPIN | IOWIRE | COREWIRE | BLOCKWIRE | FILLWIRE | BLOCKAGEWIR */
/* This routine is optional.
This is a 5.8 syntax.
* Returns 0 if successful. */
EXTERN int defwSpecialNetPathMask (int colorMask);
/* x and y location of the path */
EXTERN int defwSpecialNetPathPoint (int numPts, double* pointx, double* pointy);
EXTERN int defwSpecialNetPathVia (const char* name);
/* This routine is called after defwSpecialNetPath
* This is a 5.4.1 syntax */
EXTERN int defwSpecialNetPathViaData (int numX, int numY, int stepX, int stepY);
/* x and y location of the path */
EXTERN int defwSpecialNetPathPointWithWireExt (int numPts, double* pointx, double* pointy, double* optValue);
EXTERN int defwSpecialNetPathEnd ();
/* This is a 5.6 syntax
* This routine can be called multiple times. */
EXTERN int defwSpecialNetPolygon (const char* layerName, int num_polys, double* xl, double* yl);
/* This is a 5.6 syntax
* This routine can be called multiple times. */
EXTERN int defwSpecialNetRect (const char* layerName, int xl, int yl, int xh, int yh);
EXTERN int defwSpecialNetVia (const char* layerName);
EXTERN int defwSpecialNetViaWithOrient (const char* layerName, int orient);
EXTERN int defwSpecialNetViaPoints (int num_points, double* xl, double* yl);
/* This routine is called at the end of each net */
EXTERN int defwSpecialNetEndOneNet ();
/* 5.3 for special net */
/* Shields are a special type of option. A shield must begin
* with a defwSpecialNetShieldStart and end with a defwSpecialNetShieldEnd().
* The individual parts of the shield can be entered in
* any order. */
EXTERN int defwSpecialNetShieldStart (const char* name);
EXTERN int defwSpecialNetShieldLayer (const char* name);
EXTERN int defwSpecialNetShieldWidth (int width);
EXTERN int defwSpecialNetShieldShape (const char* shapeType);
/* FOLLOWPIN | IOWIRE | COREWIRE | BLOCKWIRE | FILLWIRE | BLOCKAGEWIR */
/* x and y location of the path */
EXTERN int defwSpecialNetShieldPoint (int numPts, double* pointx, double* pointy);
EXTERN int defwSpecialNetShieldVia (const char* name);
/* A 5.4.1 syntax */
EXTERN int defwSpecialNetShieldViaData (int numX, int numY, int stepX, int stepY);
EXTERN int defwSpecialNetShieldEnd ();
/* end 5.3 */
/* This routine is called at the end of the special net section */
EXTERN int defwEndSpecialNets ();
/* Routines to enter a net or nets into the file.
* You must first call defwNets with the number of nets.
* This section is required, even if you do not have any nets.
* For each net you should call defwNet followed by one or
* more defwNetConnection calls.
* After the connections come the options. Options are
* NOT required.
* Each net is completed by calling defwNetEndOneNet().
* The nets section is finished by calling defwEndNets(). */
EXTERN int defwStartNets (int count);
/* This routine must be called after the defwStartNets, it is for - netName */
EXTERN int defwNet (const char* name);
/* This routine is for { compName | PIN } pinName [+ SYNTHESIZED] */
/* It can be called multiple times */
EXTERN int defwNetConnection (const char* inst, const char* pin, int synthesized);
/* This routine is for MUSTJOIN, compName, pinName */
EXTERN int defwNetMustjoinConnection (const char* inst, const char* pin);
/* This routine is for + VPIN vpinName [LAYER layerName pt pt
* [{ PLACED | FIXED | COVER } pt orient] */
EXTERN int defwNetVpin (const char* vpinName, const char* layerName, int layerXl, int layerYl, int layerXh, int layerYh, const char* status, int statusX, int statusY, int orient);
/* This routine is for + VPIN vpinName [LAYER layerName pt pt
* [{ PLACED | FIXED | COVER } pt orient]
* This routine is the same as defwNetVpin, except orient is a char* */
EXTERN int defwNetVpinStr (const char* vpinName, const char* layerName, int layerXl, int layerYl, int layerXh, int layerYh, const char* status, int statusX, int statusY, const char* orient);
/* This routine can be called either within net or subnet.
* it is for NONDEFAULTRULE rulename */
EXTERN int defwNetNondefaultRule (const char* name);
/* This routine is for + XTALK num */
EXTERN int defwNetXtalk (int xtalk);
/* This routine is for + FIXEDBUMP
* This is a 5.4.1 syntax */
EXTERN int defwNetFixedbump ();
/* This routine is for + FREQUENCY
* This is a 5.4.1 syntax */
EXTERN int defwNetFrequency (double frequency);
/* This routine is for + SOURCE {NETLIST | DIST | USER | TEST | TIMING} */
EXTERN int defwNetSource (const char* name);
/* This routine is for + ORIGINAL netname */
EXTERN int defwNetOriginal (const char* name);
/* This routine is for + USE {SIGNAL | POWER | GROUND | CLOCK | TIEOFF |
* ANALOG} */
EXTERN int defwNetUse (const char* name);
/* This routine is for + PATTERN {STEINER | BALANCED | WIREDLOGIC} */
EXTERN int defwNetPattern (const char* name);
/* This routine is for + ESTCAP wireCapacitance */
EXTERN int defwNetEstCap (double value);
/* This routine is for + WEIGHT weight */
EXTERN int defwNetWeight (double value);
/* 5.3 for net */
/* This routine is for + SHIELDNET weight */
EXTERN int defwNetShieldnet (const char* name);
/* Noshield are a special type of option. A noshield must begin
* with a defwNetNoshieldStart and end with a defwNetNoshieldEnd().
* The individual parts of the noshield can be entered in
* any order. */
EXTERN int defwNetNoshieldStart (const char* name);
/* x and y location of the path */
EXTERN int defwNetNoshieldPoint (int numPts, const char** pointx, const char** pointy);
EXTERN int defwNetNoshieldVia (const char* name);
EXTERN int defwNetNoshieldEnd ();
/* end 5.3 */
/* Subnet are a special type of option. A subnet must begin
* with a defwNetSubnetStart and end with a defwNetSubnetEnd().
* Routines to call within the subnet are: defwNetSubnetPin,
* defwNetNondefaultRule and defwNetPathStart... */
EXTERN int defwNetSubnetStart (const char* name);
/* This routine is called after the defwNetSubnet, it is for
* [({compName | PIN} pinName) | (VPIN vpinName)]... */
EXTERN int defwNetSubnetPin (const char* compName, const char* pinName);
EXTERN int defwNetSubnetEnd ();
/* Paths are a special type of option. A path must begin
* with a defwNetPathStart and end with a defwPathEnd().
* The individual parts of the path can be entered in
* any order. */
EXTERN int defwNetPathStart (const char* typ);
/* NOSHIELD | NEW */
EXTERN int defwNetPathWidth (int w);
EXTERN int defwNetPathLayer (const char* name, int isTaper, const char* rulename);
/*rulename can be assigned */
/* This routine is optional.
* This is a 5.6 syntax. */
EXTERN int defwNetPathStyle (int styleNum);
/* This routine is optional.
* This is a 5.8 syntax. */
EXTERN int defwNetPathMask (int maskNum);
EXTERN int defwNetPathRect (int deltaX1, int deltaY1, int deltaX2, int deltaY2);
EXTERN int defwNetPathVirtual (int x, int y);
/* x and y location of the path */
EXTERN int defwNetPathPoint (int numPts, double* pointx, double* pointy);
EXTERN int defwNetPathPointWithExt (int numPts, double* pointx, double* pointy, double* optValue);
EXTERN int defwNetPathVia (const char* name);
EXTERN int defwNetPathViaWithOrient (const char* name, int orient);
EXTERN int defwNetPathViaWithOrientStr (const char* name, const char* orient);
EXTERN int defwNetPathEnd ();
/* This routine is called at the end of each net */
EXTERN int defwNetEndOneNet ();
/* This routine is called at the end of the net section */
EXTERN int defwEndNets ();
/* This section of routines is optional.
* Returns 0 if successful.
* The routine starts the I/O Timing section. All of the iotimings options
* must follow.
* The count is the number of defwIOTiming calls to follow.
* The routine can be called only once.
* This api is obsolete in 5.4. */
EXTERN int defwStartIOTimings (int count);
/* This routine can be called after defwStaratIOTiming
* It is for - - {(comp pin) | (PIN name)}
* This api is obsolete in 5.4. */
EXTERN int defwIOTiming (const char* inst, const char* pin);
/* This routine is for + { RISE | FALL } VARIABLE min max
* This api is obsolete in 5.4. */
EXTERN int defwIOTimingVariable (const char* riseFall, int num1, int num2);
/* This routine is for + { RISE | FALL } SLEWRATE min max
* This api is obsolete in 5.4. */
EXTERN int defwIOTimingSlewrate (const char* riseFall, int num1, int num2);
/* This routine is for + DRIVECELL macroName [[FROMPIN pinName] TOPIN pinName]
* [PARALLEL numDrivers]
* This api is obsolete in 5.4. */
EXTERN int defwIOTimingDrivecell (const char* name, const char* fromPin, const char* toPin, int numDrivers);
/* This routine is for + CAPACITANCE capacitance
* This api is obsolete in 5.4. */
EXTERN int defwIOTimingCapacitance (double num);
/* This api is obsolete in 5.4. */
EXTERN int defwEndIOTimings ();
/* Routines to enter scan chains. This section is optional
* The section must start with a defwStartScanchains() call and
* end with a defwEndScanchain() call.
* Each scan chain begins with a defwScanchain() call.
* The rest of the calls follow. */
EXTERN int defwStartScanchains (int count);
/* This routine can be called after defwStartScanchains
* It is for - chainName */
EXTERN int defwScanchain (const char* name);
/* This routine is for + COMMONSCANPINS [IN pin] [OUT pin] */
EXTERN int defwScanchainCommonscanpins (const char* inst1, const char* pin1, const char* inst2, const char* pin2);
/* This routine is for + PARTITION paratitionName [MAXBITS maxBits] */
/* This is 5.4.1 syntax */
EXTERN int defwScanchainPartition (const char* name, int maxBits);
/* This routine is for + START {fixedInComp | PIN } [outPin] */
EXTERN int defwScanchainStart (const char* inst, const char* pin);
/* This routine is for + STOP {fixedOutComp | PIN } [inPin] */
EXTERN int defwScanchainStop (const char* inst, const char* pin);
/* This routine is for + FLOATING {floatingComp [IN pin] [OUT pin]}
* This is a 5.4.1 syntax */
EXTERN int defwScanchainFloating (const char* name, const char* inst1, const char* pin1, const char* inst2, const char* pin2);