Jspice3
cdext.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

char * ctime ()
 
char * tmalloc ()
 
void txfree ()
 
char * strcpy ()
 
double sin ()
 
double cos ()
 
void CDLabelBB ()
 
FILE * OpenDevice ()
 
void UpdateProperties ()
 
void AEnd ()
 
int ABeginSymbol ()
 
void AEndSymbol ()
 
void ADeleteSymbol ()
 
int AEndCall ()
 
int AT ()
 
int ABeginCall ()
 
int APolygon ()
 
int AWire ()
 
int ABox ()
 
int ARoundFlash ()
 
int ALayer ()
 
int AUserExtension ()
 
void AComment ()
 
int CDInit ()
 
int CDPath ()
 
void CDSetLayer ()
 
void CDDebug ()
 
int CDOpen ()
 
void CDSymbol ()
 
int CDClose ()
 
int CDReflect ()
 
int CDPatchInstances ()
 
int CDMakeBox ()
 
int CDMakeLabel ()
 
int CDMakePolygon ()
 
int CDMakeWire ()
 
int CDMakeRoundFlash ()
 
int CDBeginMakeCall ()
 
int CDT ()
 
int CDEndMakeCall ()
 
void CDCheckPath ()
 
int CDInsertObject ()
 
void CDDeleteObjectDesc ()
 
void CDCall ()
 
void CDBox ()
 
void CDLabel ()
 
void CDPolygon ()
 
void CDWire ()
 
void CDRoundFlash ()
 
void CDInfo ()
 
void CDSetInfo ()
 
void CDType ()
 
int CDBB ()
 
void CDIntersect ()
 
int CDInitGen ()
 
void CDGen ()
 
void CDInitTGen ()
 
void CDTGen ()
 
int CDUpdate ()
 
int CDGenCIF ()
 
int CDTo ()
 
int CDFrom ()
 
int CDParseCIF ()
 
int CDUnmark ()
 
int CDError ()
 
void CDProperty ()
 
int CDCopyProperty ()
 
int CDAddProperty ()
 
int CDRemoveProperty ()
 
void CDPrptyListFree ()
 
void CDPrptyListPrint ()
 
void GenEnd ()
 
void GenBeginSymbol ()
 
void GenEndSymbol ()
 
void GenBeginCall ()
 
void GenEndCall ()
 
void GenTranslation ()
 
void GenRotation ()
 
void GenMirrorX ()
 
void GenMirrorY ()
 
void GenPolygon ()
 
void GenPolygonOffset ()
 
void GenWire ()
 
void GenWireOffset ()
 
void GenBox ()
 
void GenLayer ()
 
void GenUserExtension ()
 
void GenComment ()
 
void PCIF ()
 
int PCharacter ()
 
int PSetPath ()
 
int PAppendPath ()
 
char * PGetPath ()
 
FILE * POpen ()
 
void TInit ()
 
int TEmpty ()
 
int TFull ()
 
void TPush ()
 
void TPop ()
 
void TCurrent ()
 
void TLoadCurrent ()
 
void TTranslate ()
 
void TMY ()
 
void TMX ()
 
void TRotate ()
 
void TIdentity ()
 
void TPoint ()
 
void TPremultiply ()
 
void TInverse ()
 
void TInversePoint ()
 
void TStore ()
 
void TLoad ()
 
void TLoadInverse ()
 

Variables

struct buCDSymbolTable [CDNUMLAYERS+1]
 
struct d CDDesc
 
struct l CDLayer [CDNUMLAYERS+1]
 
char * CDStatusString
 
int CDStatusInt
 

Function Documentation

int ABeginCall ( )
int ABeginSymbol ( )
int ABox ( )
void AComment ( )
void ADeleteSymbol ( )
void AEnd ( )

Definition at line 34 of file actions.c.

35 {
36  /*
37  * The CIF parsing has ended.
38  */
39 #ifdef TRACEPARSER
40 GenEnd(stderr);
41 #endif
42 }
void GenEnd()
int AEndCall ( )

Definition at line 414 of file actions.c.

415 {
416 #ifdef TRACEPARSER
417 fprintf(stderr,";\n");
418 #endif
420  if(CDDesc.dFirstPass)
421  return(PSUCCEEDED);
422  if(CDDesc.dRoot)
424  else
426  }
429  return(PSUCCEEDED);
431  return(PFAILED);
432  while(CDDesc.dPrptyList != NULL){
433  struct prpty PrptyCopy;
436  return(PFAILED);
437  /* free storage of CDDesc.dPrptyList */
438  PrptyCopy = *CDDesc.dPrptyList;
441  CDDesc.dPrptyList = PrptyCopy.prpty_Succ;
442  }
443  }
444  return(PSUCCEEDED);
445 }
char dControl
Definition: cddefs.h:296
FILE * dSymbolFileDesc
Definition: cddefs.h:253
#define DCONTROLPCIF
Definition: cddefs.h:62
#define DCONTROLCDOPEN
Definition: cddefs.h:61
#define Or
Definition: cdmacs.h:15
int prpty_Value
Definition: cdprpty.h:67
#define PFAILED
Definition: cdparser.h:51
#define DCONTROLCDTO
Definition: cddefs.h:63
#define Not
Definition: cdmacs.h:16
struct d CDDesc
Definition: cd.c:73
int dRoot
Definition: cddefs.h:260
int CDEndMakeCall()
struct o * dPointer
Definition: cddefs.h:249
#define tfree(x)
Definition: cdmacs.h:22
int CDAddProperty()
#define NULL
Definition: spdefs.h:121
#define elif
Definition: cdmacs.h:10
char * prpty_String
Definition: cdprpty.h:63
#define PSUCCEEDED
Definition: cdparser.h:50
struct prpty * prpty_Succ
Definition: cdprpty.h:66
#define And
Definition: cdmacs.h:14
void GenEndCall()
int dFirstPass
Definition: cddefs.h:282
Definition: cdprpty.h:62
struct s * dSymbolDesc
Definition: cddefs.h:250
struct prpty * dPrptyList
Definition: cddefs.h:266
FILE * dRootFileDesc
Definition: cddefs.h:263
void AEndSymbol ( )

Definition at line 348 of file actions.c.

349 {
350  /*
351  * This routine performs the necessary actions to close a symbol
352  * definition.
353  *
354  * DCONTROLCDTO:
355  * Return on first pass (we are only building the symbol table).
356  * On the second pass, we terminate and close the KIC cell
357  * containing the respective CIF symbol.
358  *
359  * DCONTROLPCIF:
360  * We set the current cell desc in CDDesc.dSymbolDesc to that of
361  * the root symbol.
362  *
363  * DCONTROLCDOPEN:
364  * No action.
365  */
366 #ifdef TRACEPARSER
367 GenEndSymbol(stderr);
368 #endif
370  if(CDDesc.dFirstPass)
371  return;
374  fclose(CDDesc.dSymbolFileDesc);
375  CDDesc.dRoot = True;
376  }
379  CDDesc.dRoot = True;
380  }
385  /*
386  * Force the dummy call command at the end of the symbol
387  * to be ignored by ABeginCall.
388  */
389  CDDesc.dSymbolName[0] = EOS;
390  }
391 }
char dControl
Definition: cddefs.h:296
FILE * dSymbolFileDesc
Definition: cddefs.h:253
#define DCONTROLPCIF
Definition: cddefs.h:62
#define DCONTROLCDOPEN
Definition: cddefs.h:61
#define CDINFINITY
Definition: cddefs.h:70
#define DCONTROLCDTO
Definition: cddefs.h:63
long sLeft
Definition: cddefs.h:120
struct d CDDesc
Definition: cd.c:73
long sBottom
Definition: cddefs.h:120
int dRoot
Definition: cddefs.h:260
long sTop
Definition: cddefs.h:120
void GenEndSymbol()
long sRight
Definition: cddefs.h:120
#define elif
Definition: cdmacs.h:10
#define True
Definition: scedstub.c:16
char dSymbolName[FILENAMESIZE]
Definition: cddefs.h:305
#define EOS
Definition: cdmacs.h:9
int dFirstPass
Definition: cddefs.h:282
struct s * dSymbolDesc
Definition: cddefs.h:250
void GenEnd()
struct s * dRootCellDesc
Definition: cddefs.h:251
int ALayer ( )
int APolygon ( )
int ARoundFlash ( )
int AT ( )
int AUserExtension ( )
int AWire ( )
int CDAddProperty ( )
int CDBB ( )
int CDBeginMakeCall ( )
void CDBox ( )
void CDCall ( )
void CDCheckPath ( )
int CDClose ( )
int CDCopyProperty ( )
void CDDebug ( )
void CDDeleteObjectDesc ( )
int CDEndMakeCall ( )
int CDError ( )
int CDFrom ( )
void CDGen ( )
int CDGenCIF ( )
void CDInfo ( )
int CDInit ( )

Definition at line 114 of file cd.c.

115 {
116  /*
117  * This must be the first CD routine called. It initializes
118  * the layer table, search path, symbol table, and transform
119  * stack. Returns True if error, False otherwise.
120  */
121  int Layer,Int1;
122  char *c,*PGetPath();
123 
125  for (Int1 = 0;Int1 < CDNUMLAYERS;++Int1)
126  CDSymbolTable[Int1] = NULL;
127  for (Layer = 1;Layer <= CDNUMLAYERS;++Layer) {
128  CDLayer[Layer].lTechnology = ' ';
129  CDLayer[Layer].lMask[0] = ' ';
130  CDLayer[Layer].lMask[1] = ' ';
131  CDLayer[Layer].lMask[2] = ' ';
133  }
134  c = PGetPath();
135  if (*c == '\0')
136  CDPath(".");
137  CDDebug(False);
140 
141  /* Vanilla operation. */
143 
144  /* Alocate arrays if not already done */
145  if (CDDesc.dSymTabNames == NULL) {
146  CDDesc.dSymTabNames = (char(*)[FILENAMESIZE])
148  if (CDDesc.dSymTabNames == NULL) {
150  return True;
151  }
152  CDDesc.dSymTabNumbers = (int *) tmalloc(CDNUMREMEMBER*sizeof(int));
153  if (CDDesc.dSymTabNumbers == NULL) {
155  return True;
156  }
157  }
158  TInit();
159  return False;
160 }
char dControl
Definition: cddefs.h:296
char lCDFrom
Definition: cddefs.h:316
#define DCONTROLVANILLA
Definition: cddefs.h:64
static char CDDiagnosticString[LARGEBUFFERSIZE]
Definition: cd.c:76
struct l CDLayer[CDNUMLAYERS+1]
Definition: cd.c:74
void TInit()
Definition: xforms.c:23
int * dSymTabNumbers
Definition: cddefs.h:273
struct bu * CDSymbolTable[CDNUMLAYERS+1]
Definition: cd.c:72
char * CDStatusString
Definition: cd.c:77
char * tmalloc()
char(* dSymTabNames)[FILENAMESIZE]
Definition: cddefs.h:272
#define NULL
Definition: spdefs.h:121
#define CDNUMREMEMBER
Definition: cddefs.h:98
#define True
Definition: scedstub.c:16
char lMask[3]
Definition: cddefs.h:314
static double c
Definition: vectors.c:16
#define CDMALLOCFAILED
Definition: cddefs.h:35
int dNumSymbolsAllocated
Definition: cddefs.h:288
int CDError(int ID)
Definition: cd.c:2993
#define CDNUMLAYERS
Definition: cddefs.h:93
int Layer
Definition: cd.c:1908
void CDDebug(int Debug)
Definition: cd.c:197
int CDStatusInt
Definition: cd.c:75
int CDPath(char *Path)
Definition: cd.c:164
char lTechnology
Definition: cddefs.h:313
#define False
Definition: scedstub.c:15
char * PGetPath()
Definition: paths.c:67
#define FILENAMESIZE
Definition: cddefs.h:21
struct d CDDesc
Definition: cd.c:73
struct prpty * dPrptyList
Definition: cddefs.h:266
int CDInitGen ( )
void CDInitTGen ( )
int CDInsertObject ( )
void CDIntersect ( )
void CDLabel ( )
void CDLabelBB ( )
int CDMakeBox ( )
int CDMakeLabel ( )
int CDMakePolygon ( )
int CDMakeRoundFlash ( )
int CDMakeWire ( )
int CDOpen ( )
int CDParseCIF ( )
int CDPatchInstances ( )
int CDPath ( )
void CDPolygon ( )
void CDProperty ( )
void CDPrptyListFree ( )
void CDPrptyListPrint ( )
int CDReflect ( )
int CDRemoveProperty ( )
void CDRoundFlash ( )
void CDSetInfo ( )
void CDSetLayer ( )
void CDSymbol ( )
int CDT ( )
void CDTGen ( )
int CDTo ( )
void CDType ( )
int CDUnmark ( )
int CDUpdate ( )
void CDWire ( )
double cos ( )
char* ctime ( )
void GenBeginCall ( )
void GenBeginSymbol ( )
void GenBox ( )
void GenComment ( )
void GenEnd ( )
void GenEndCall ( )
void GenEndSymbol ( )
void GenLayer ( )
void GenMirrorX ( )
void GenMirrorY ( )
void GenPolygon ( )
void GenPolygonOffset ( )
void GenRotation ( )
void GenTranslation ( )
void GenUserExtension ( )
void GenWire ( )
void GenWireOffset ( )
FILE* OpenDevice ( )
int PAppendPath ( )
int PCharacter ( )
void PCIF ( )
char* PGetPath ( )

Definition at line 67 of file paths.c.

69 {
70  return (path);
71 }
static char * path
Definition: paths.c:13
FILE* POpen ( )
int PSetPath ( )
double sin ( )
char* strcpy ( )
void TCurrent ( )
int TEmpty ( )

Definition at line 38 of file xforms.c.

39 {
40  if (Transforms == NULL)
41  return(True);
42  else
43  return(False);
44 }
static struct tt * Transforms
Definition: xforms.c:20
#define NULL
Definition: spdefs.h:121
#define True
Definition: scedstub.c:16
#define False
Definition: scedstub.c:15
int TFull ( )

Definition at line 47 of file xforms.c.

48 {
49  return(False);
50 }
#define False
Definition: scedstub.c:15
void TIdentity ( )

Definition at line 189 of file xforms.c.

190 {
191  long *l;
192 
193  l = (long *)Transforms->ttMatrix;
194  *l++ = 1; *l++ = 0; *l++ = 0;
195  *l++ = 0; *l++ = 1; *l++ = 0;
196  *l++ = 0; *l++ = 0; *l++ = 1;
197 }
static struct tt * Transforms
Definition: xforms.c:20
Definition: cddefs.h:312
long ttMatrix[3][3]
Definition: xforms.c:17
void TInit ( )

Definition at line 23 of file xforms.c.

24 {
25  struct tt *Tmp;
26 
27  for (Tmp = Transforms; Tmp; Tmp = Transforms) {
28  Transforms = Tmp->ttNext;
29  tfree(Tmp);
30  }
31  Transforms = alloc(tt);
32  if (Transforms == NULL) MallocFailed();
34  TIdentity();
35 }
struct tt * ttNext
Definition: xforms.c:18
static struct tt * Transforms
Definition: xforms.c:20
Definition: xforms.c:16
#define alloc(type)
Definition: cdmacs.h:21
void MallocFailed()
Definition: scedintr.c:857
#define tfree(x)
Definition: cdmacs.h:22
#define NULL
Definition: spdefs.h:121
void TIdentity()
Definition: xforms.c:189
void TInverse ( )

Definition at line 271 of file xforms.c.

272 {
273  /*
274  Compute the inverse transform of the current transform.
275  Because all transformations are Manhattan, the
276  det of the current transform matrix is always -1 or +1.
277  */
278 
279  long Det;
280 
281  Det =
282  Transforms->ttMatrix[0][0]*Transforms->ttMatrix[1][1] -
283  Transforms->ttMatrix[1][0]*Transforms->ttMatrix[0][1];
284 
285  if (Det == 1) {
286  InverseMatrix[0][0] = Transforms->ttMatrix[1][1];
287  InverseMatrix[0][1] = -Transforms->ttMatrix[0][1];
288  InverseMatrix[1][0] = -Transforms->ttMatrix[1][0];
289  InverseMatrix[1][1] = Transforms->ttMatrix[0][0];
290  InverseMatrix[2][0] =
291  Transforms->ttMatrix[1][0]*Transforms->ttMatrix[2][1] -
292  Transforms->ttMatrix[2][0]*Transforms->ttMatrix[1][1];
293  InverseMatrix[2][1] =
294  - Transforms->ttMatrix[0][0]*Transforms->ttMatrix[2][1] +
295  Transforms->ttMatrix[0][1]*Transforms->ttMatrix[2][0];
296  }
297  else {
298  InverseMatrix[0][0] = -Transforms->ttMatrix[1][1];
299  InverseMatrix[0][1] = Transforms->ttMatrix[0][1];
300  InverseMatrix[1][0] = Transforms->ttMatrix[1][0];
301  InverseMatrix[1][1] = -Transforms->ttMatrix[0][0];
302  InverseMatrix[2][0] =
303  - Transforms->ttMatrix[1][0]*Transforms->ttMatrix[2][1] +
304  Transforms->ttMatrix[2][0]*Transforms->ttMatrix[1][1];
305  InverseMatrix[2][1] =
306  Transforms->ttMatrix[0][0]*Transforms->ttMatrix[2][1] -
307  Transforms->ttMatrix[0][1]*Transforms->ttMatrix[2][0];
308  }
309  InverseMatrix[0][2] = 0;
310  InverseMatrix[1][2] = 0;
311  InverseMatrix[2][2] = 1;
312 }
static struct tt * Transforms
Definition: xforms.c:20
static long InverseMatrix[3][3]
Definition: xforms.c:268
long ttMatrix[3][3]
Definition: xforms.c:17
void TInversePoint ( )
void TLoad ( )

Definition at line 338 of file xforms.c.

339 {
340  memcpy((char *)Transforms->ttMatrix,
341  (char *)Storage,9*sizeof(long));
342 }
static struct tt * Transforms
Definition: xforms.c:20
static long Storage[3][3]
Definition: xforms.c:267
long ttMatrix[3][3]
Definition: xforms.c:17
void TLoadCurrent ( )
void TLoadInverse ( )

Definition at line 345 of file xforms.c.

346 {
347  memcpy((char *)Transforms->ttMatrix,
348  (char *)InverseMatrix,9*sizeof(long));
349 }
static struct tt * Transforms
Definition: xforms.c:20
static long InverseMatrix[3][3]
Definition: xforms.c:268
long ttMatrix[3][3]
Definition: xforms.c:17
char* tmalloc ( )
void TMX ( )

Definition at line 112 of file xforms.c.

113 {
114  Transforms->ttMatrix[0][0] = -Transforms->ttMatrix[0][0];
115  Transforms->ttMatrix[1][0] = -Transforms->ttMatrix[1][0];
116  Transforms->ttMatrix[2][0] = -Transforms->ttMatrix[2][0];
117 }
static struct tt * Transforms
Definition: xforms.c:20
long ttMatrix[3][3]
Definition: xforms.c:17
void TMY ( )

Definition at line 104 of file xforms.c.

105 {
106  Transforms->ttMatrix[0][1] = -Transforms->ttMatrix[0][1];
107  Transforms->ttMatrix[1][1] = -Transforms->ttMatrix[1][1];
108  Transforms->ttMatrix[2][1] = -Transforms->ttMatrix[2][1];
109 }
static struct tt * Transforms
Definition: xforms.c:20
long ttMatrix[3][3]
Definition: xforms.c:17
void TPoint ( )
void TPop ( )

Definition at line 64 of file xforms.c.

65 {
66  struct tt *Tmp;
67 
68  Tmp = Transforms;
69  Transforms = Tmp->ttNext;
70  tfree(Tmp);
71 }
struct tt * ttNext
Definition: xforms.c:18
static struct tt * Transforms
Definition: xforms.c:20
Definition: xforms.c:16
#define tfree(x)
Definition: cdmacs.h:22
void TPremultiply ( )

Definition at line 216 of file xforms.c.

217 {
218  /*
219  * Form the instance transform.
220  * This is done by computing
221  * Transforms->ttMatrix * Transforms->ttNext->ttMatrix and
222  * placing the product in Transforms.ttMatrix.
223  * So, the scenario for transforming the coordinates of a master follows.
224  * TPush();
225  * TIdentity();
226  * Invoke TMX, Translate, etc. to build instance transform.
227  * Form the instance transform.
228  * TPremultiply();
229  * Invoke TPoint to transform master points to instance points.
230  * TPop();
231  */
232 
233  long Int1,Int2,Int3,Int4,Int5,Int6;
234  int SP;
235  struct tt *Next;
236 
237  Next = Transforms->ttNext;
238 
239  Int1 = Transforms->ttMatrix[0][0]*Next->ttMatrix[0][0] +
240  Transforms->ttMatrix[0][1]*Next->ttMatrix[1][0];
241 
242  Int2 = Transforms->ttMatrix[0][0]*Next->ttMatrix[0][1] +
243  Transforms->ttMatrix[0][1]*Next->ttMatrix[1][1];
244 
245  Int3 = Transforms->ttMatrix[1][0]*Next->ttMatrix[0][0] +
246  Transforms->ttMatrix[1][1]*Next->ttMatrix[1][0];
247 
248  Int4 = Transforms->ttMatrix[1][0]*Next->ttMatrix[0][1] +
249  Transforms->ttMatrix[1][1]*Next->ttMatrix[1][1];
250 
251  Int5 = Transforms->ttMatrix[2][0]*Next->ttMatrix[0][0] +
252  Transforms->ttMatrix[2][1]*Next->ttMatrix[1][0] +
253  Next->ttMatrix[2][0];
254 
255  Int6 = Transforms->ttMatrix[2][0]*Next->ttMatrix[0][1] +
256  Transforms->ttMatrix[2][1]*Next->ttMatrix[1][1] +
257  Next->ttMatrix[2][1];
258 
259  Transforms->ttMatrix[0][0] = Int1;
260  Transforms->ttMatrix[0][1] = Int2;
261  Transforms->ttMatrix[1][0] = Int3;
262  Transforms->ttMatrix[1][1] = Int4;
263  Transforms->ttMatrix[2][0] = Int5;
264  Transforms->ttMatrix[2][1] = Int6;
265 }
struct tt * ttNext
Definition: xforms.c:18
static struct tt * Transforms
Definition: xforms.c:20
Definition: xforms.c:16
long ttMatrix[3][3]
Definition: xforms.c:17
void TPush ( )

Definition at line 53 of file xforms.c.

54 {
55  struct tt *Tmp;
56 
57  Tmp = alloc(tt);
58  if (Tmp == NULL) MallocFailed();
59  Tmp->ttNext = Transforms;
60  Transforms = Tmp;
61 }
struct tt * ttNext
Definition: xforms.c:18
static struct tt * Transforms
Definition: xforms.c:20
Definition: xforms.c:16
#define alloc(type)
Definition: cdmacs.h:21
void MallocFailed()
Definition: scedintr.c:857
#define NULL
Definition: spdefs.h:121
void TRotate ( )
void TStore ( )

Definition at line 331 of file xforms.c.

332 {
333  memcpy((char *)Storage,
334  (char *)Transforms->ttMatrix,9*sizeof(long));
335 }
static struct tt * Transforms
Definition: xforms.c:20
static long Storage[3][3]
Definition: xforms.c:267
long ttMatrix[3][3]
Definition: xforms.c:17
void TTranslate ( )
void txfree ( )
void UpdateProperties ( )

Variable Documentation

struct d CDDesc

Definition at line 73 of file cd.c.

struct l CDLayer[CDNUMLAYERS+1]

Definition at line 74 of file cd.c.

int CDStatusInt

Definition at line 75 of file cd.c.

char* CDStatusString

Definition at line 77 of file cd.c.

struct bu* CDSymbolTable[CDNUMLAYERS+1]

Definition at line 72 of file cd.c.