ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
mioRead.c
Go to the documentation of this file.
1
18
19#include <ctype.h>
20#include "mioInt.h"
21#include "base/io/ioAbc.h"
22
24
25
29
33
34static Mio_Library_t * Mio_LibraryReadOne( char * FileName, int fExtendedFormat, st__table * tExcludeGate, int nFaninLimit, int fVerbose );
35 Mio_Library_t * Mio_LibraryReadBuffer( char * pBuffer, int fExtendedFormat, st__table * tExcludeGate, int nFaninLimit, int fVerbose );
36static int Mio_LibraryReadInternal( Mio_Library_t * pLib, char * pBuffer, int fExtendedFormat, st__table * tExcludeGate, int nFaninLimit, int fVerbose );
37static Mio_Gate_t * Mio_LibraryReadGate( char ** ppToken, int fExtendedFormat );
38static Mio_Pin_t * Mio_LibraryReadPin( char ** ppToken, int fExtendedFormat );
39static char * chomp( char *s );
40static void Mio_LibraryDetectSpecialGates( Mio_Library_t * pLib );
41static void Io_ReadFileRemoveComments( char * pBuffer, int * pnDots, int * pnLines );
42
54Mio_Library_t * Mio_LibraryRead( char * FileName, char * pBuffer, char * ExcludeFile, int nFaninLimit, int fVerbose )
55{
56 Mio_Library_t * pLib;
57 int num;
58 char * pBufferCopy;
59
60 st__table * tExcludeGate = 0;
61
62 if ( ExcludeFile )
63 {
64 tExcludeGate = st__init_table(strcmp, st__strhash);
65 if ( (num = Mio_LibraryReadExclude( ExcludeFile, tExcludeGate )) == -1 )
66 {
67 st__free_table( tExcludeGate );
68 tExcludeGate = 0;
69 return 0;
70 }
71 fprintf ( stdout, "Read %d gates from exclude file\n", num );
72 }
73
74 pBufferCopy = Abc_UtilStrsav(pBuffer);
75 if ( pBuffer == NULL )
76 pLib = Mio_LibraryReadOne( FileName, 0, tExcludeGate, nFaninLimit, fVerbose ); // try normal format first ..
77 else
78 {
79 pLib = Mio_LibraryReadBuffer( pBuffer, 0, tExcludeGate, nFaninLimit, fVerbose ); // try normal format first ..
80 if ( pLib )
81 pLib->pName = Abc_UtilStrsav( Extra_FileNameGenericAppend(FileName, ".genlib") );
82 }
83 if ( pLib == NULL )
84 {
85 if ( pBuffer == NULL )
86 pLib = Mio_LibraryReadOne( FileName, 1, tExcludeGate, nFaninLimit, fVerbose ); // try normal format first ..
87 else
88 {
89 pLib = Mio_LibraryReadBuffer( pBufferCopy, 1, tExcludeGate, nFaninLimit, fVerbose ); // try normal format first ..
90 if ( pLib )
91 pLib->pName = Abc_UtilStrsav( Extra_FileNameGenericAppend(FileName, ".genlib") );
92 }
93 if ( pLib != NULL )
94 printf ( "Warning: Read extended genlib format but ignoring extensions\n" );
95 }
96 ABC_FREE( pBufferCopy );
97 if ( tExcludeGate )
98 st__free_table( tExcludeGate );
99
100 pLib->pFileName = Abc_UtilStrsav( FileName );
101 return pLib;
102}
103
115char * Mio_ReadFile( char * FileName, int fAddEnd )
116{
117 char * pBuffer;
118 FILE * pFile;
119 int nFileSize;
120 int RetValue;
121
122 // open the BLIF file for binary reading
123 pFile = Io_FileOpen( FileName, "open_path", "rb", 1 );
124// pFile = fopen( FileName, "rb" );
125 // if we got this far, file should be okay otherwise would
126 // have been detected by caller
127 assert ( pFile != NULL );
128 // get the file size, in bytes
129 fseek( pFile, 0, SEEK_END );
130 nFileSize = ftell( pFile );
131 // move the file current reading position to the beginning
132 rewind( pFile );
133 // load the contents of the file into memory
134 pBuffer = ABC_ALLOC( char, nFileSize + 10 );
135 RetValue = fread( pBuffer, nFileSize, 1, pFile );
136 // terminate the string with '\0'
137 pBuffer[ nFileSize ] = '\0';
138 if ( fAddEnd )
139 strcat( pBuffer, "\n.end\n" );
140 // close file
141 fclose( pFile );
142 return pBuffer;
143}
144
156Mio_Library_t * Mio_LibraryReadBuffer( char * pBuffer, int fExtendedFormat, st__table * tExcludeGate, int nFaninLimit, int fVerbose )
157{
158 Mio_Library_t * pLib;
159
160 // allocate the genlib structure
161 pLib = ABC_CALLOC( Mio_Library_t, 1 );
163 pLib->pMmFlex = Mem_FlexStart();
164 pLib->vCube = Vec_StrAlloc( 100 );
165
166 Io_ReadFileRemoveComments( pBuffer, NULL, NULL );
167
168 // parse the contents of the file
169 if ( Mio_LibraryReadInternal( pLib, pBuffer, fExtendedFormat, tExcludeGate, nFaninLimit, fVerbose ) )
170 {
171 Mio_LibraryDelete( pLib );
172 return NULL;
173 }
174
175 // derive the functinality of gates
176 if ( Mio_LibraryParseFormulas( pLib ) )
177 {
178 printf( "Mio_LibraryRead: Had problems parsing formulas.\n" );
179 Mio_LibraryDelete( pLib );
180 return NULL;
181 }
182
183 // detect INV and NAND2
184 Mio_LibraryDetectSpecialGates( pLib );
185//Mio_WriteLibrary( stdout, pLib );
186 return pLib;
187}
188
200Mio_Library_t * Mio_LibraryReadOne( char * FileName, int fExtendedFormat, st__table * tExcludeGate, int nFaninLimit, int fVerbose )
201{
202 Mio_Library_t * pLib;
203 char * pBuffer;
204 // read the file and clean comments
205 // pBuffer = Io_ReadFileFileContents( FileName, NULL );
206 // we don't use above function but actually do the same thing explicitly
207 // to handle open_path expansion correctly
208 pBuffer = Mio_ReadFile( FileName, 1 );
209 if ( pBuffer == NULL )
210 return NULL;
211 pLib = Mio_LibraryReadBuffer( pBuffer, fExtendedFormat, tExcludeGate, nFaninLimit, fVerbose );
212 ABC_FREE( pBuffer );
213 if ( pLib )
214 pLib->pName = Abc_UtilStrsav( FileName );
215 return pLib;
216}
217
229int Mio_LibraryReadInternal( Mio_Library_t * pLib, char * pBuffer, int fExtendedFormat, st__table * tExcludeGate, int nFaninLimit, int fVerbose )
230{
231 Mio_Gate_t * pGate, ** ppGate;
232 char * pToken;
233 int nGates = 0;
234 int nDel = 0;
235
236 // start the linked list of gates
237 pLib->pGates = NULL;
238 ppGate = &pLib->pGates;
239
240 // read gates one by one
241 pToken = strtok( pBuffer, " \t\r\n" );
242 while ( pToken && (strcmp( pToken, MIO_STRING_GATE ) == 0 || strcmp( pToken, MIO_STRING_LATCH ) == 0) )
243 {
244 // skip latches
245 if ( strcmp( pToken, MIO_STRING_LATCH ) == 0 )
246 {
247 while ( pToken && strcmp( pToken, MIO_STRING_GATE ) != 0 && strcmp( pToken, ".end" ) != 0 )
248 {
249 if ( strcmp( pToken, MIO_STRING_LATCH ) == 0 )
250 {
251 pToken = strtok( NULL, " \t\r\n" );
252 printf( "Skipping latch \"%s\"...\n", pToken );
253 continue;
254 }
255 pToken = strtok( NULL, " \t\r\n" );
256 }
257 if ( !(pToken && strcmp( pToken, MIO_STRING_GATE ) == 0) )
258 break;
259 }
260
261 // derive the next gate
262 pGate = Mio_LibraryReadGate( &pToken, fExtendedFormat );
263 if ( pGate == NULL )
264 return 1;
265
266 // consider the fanin limit
267 if ( nFaninLimit )
268 {
269 Mio_Pin_t * pPin; int nIns = 0;
270 for ( pPin = Mio_GateReadPins(pGate); pPin; pPin = Mio_PinReadNext(pPin) )
271 nIns++;
272 if ( nIns > nFaninLimit )
273 {
274 Mio_GateDelete( pGate );
275 continue;
276 }
277 }
278
279 // skip the gate if its formula has problems
280 if ( !Mio_ParseCheckFormula(pGate, pGate->pForm) )
281 {
282 Mio_GateDelete( pGate );
283 continue;
284 }
285
286 // set the library
287 pGate->pLib = pLib;
288
289 // printf ("Processing: '%s'\n", pGate->pName);
290
291 if ( tExcludeGate && st__is_member( tExcludeGate, pGate->pName ) )
292 {
293 //printf ("Excluding: '%s'\n", pGate->pName);
294 Mio_GateDelete( pGate );
295 nDel++;
296 }
297 else
298 {
299 // add this gate to the list
300 *ppGate = pGate;
301 ppGate = &pGate->pNext;
302 nGates++;
303
304 // remember this gate by name
305 if ( ! st__is_member( pLib->tName2Gate, pGate->pName ) )
306 st__insert( pLib->tName2Gate, pGate->pName, (char *)pGate );
307 else
308 {
309 Mio_Gate_t * pBase = Mio_LibraryReadGateByName( pLib, pGate->pName, NULL );
310 if ( pBase->pTwin != NULL )
311 {
312 printf( "Gates with more than 2 outputs are not supported.\n" );
313 continue;
314 }
315 pBase->pTwin = pGate;
316 pGate->pTwin = pBase;
317// printf( "Gate \"%s\" appears two times. Creating a 2-output gate.\n", pGate->pName );
318 }
319 }
320 }
321
322 if ( nGates == 0 )
323 {
324 printf( "The library contains no gates.\n" );
325 return 1;
326 }
327
328 // check what is the last word read
329 if ( pToken && strcmp( pToken, ".end" ) != 0 )
330 return 1;
331
332 if ( nDel != 0 )
333 printf( "Actually excluded %d cells\n", nDel );
334
335 return 0;
336}
337
349char * Mio_LibraryCleanStr( char * p )
350{
351 int i, k;
352 int whitespace_state = 0;
353 char * pRes = Abc_UtilStrsav( p );
354 for ( i = k = 0; pRes[i]; i++ )
355 if ( pRes[i] != ' ' && pRes[i] != '\t' && pRes[i] != '\r' && pRes[i] != '\n' )
356 {
357 if ( pRes[i] != '(' && pRes[i] != ')' && pRes[i] != '+' && pRes[i] != '*' && pRes[i] != '|' && pRes[i] != '&' && pRes[i] != '^' && pRes[i] != '\'' && pRes[i] != '!' )
358 {
359 if (whitespace_state == 2)
360 pRes[k++] = ' ';
361 whitespace_state = 1;
362 }
363 else
364 whitespace_state = 0;
365 pRes[k++] = pRes[i];
366 }
367 else
368 whitespace_state = whitespace_state ? 2 : 0;
369 pRes[k] = 0;
370 return pRes;
371}
372
373Mio_Gate_t * Mio_LibraryReadGate( char ** ppToken, int fExtendedFormat )
374{
375 Mio_Gate_t * pGate;
376 Mio_Pin_t * pPin, ** ppPin;
377 char * pToken = *ppToken;
378
379 // allocate the gate structure
380 pGate = ABC_CALLOC( Mio_Gate_t, 1 );
381 pGate->Cell = -1;
382
383 // read the name
384 pToken = strtok( NULL, " \t\r\n" );
385 pGate->pName = Abc_UtilStrsav( pToken );
386
387 // read the area
388 pToken = strtok( NULL, " \t\r\n" );
389 pGate->dArea = atof( pToken );
390
391 // read the formula
392
393 // first the output name
394 pToken = strtok( NULL, "=" );
395 pGate->pOutName = chomp( pToken );
396
397 // then rest of the expression
398 pToken = strtok( NULL, ";" );
399// pGate->pForm = Mio_LibraryCleanStr( pToken );
400 pGate->pForm = Abc_UtilStrsav( pToken );
401
402 // read the pin info
403 // start the linked list of pins
404 pGate->pPins = NULL;
405 ppPin = &pGate->pPins;
406
407 // read gates one by one
408 pToken = strtok( NULL, " \t\r\n" );
409 while ( pToken && strcmp( pToken, MIO_STRING_PIN ) == 0 )
410 {
411 // derive the next gate
412 pPin = Mio_LibraryReadPin( &pToken, fExtendedFormat );
413 if ( pPin == NULL )
414 {
415 Mio_GateDelete( pGate );
416 *ppToken = pToken;
417 return NULL;
418 }
419 // add this pin to the list
420 *ppPin = pPin;
421 ppPin = &pPin->pNext;
422 // get the next token
423 pToken = strtok( NULL, " \t\r\n" );
424 }
425
426 *ppToken = pToken;
427 return pGate;
428}
429
430
431
443Mio_Pin_t * Mio_LibraryReadPin( char ** ppToken, int fExtendedFormat )
444{
445 Mio_Pin_t * pPin;
446 char * pToken = *ppToken;
447
448 // allocate the gate structure
449 pPin = ABC_CALLOC( Mio_Pin_t, 1 );
450
451 // read the name
452 pToken = strtok( NULL, " \t\r\n" );
453 pPin->pName = Abc_UtilStrsav( pToken );
454
455 // read the pin phase
456 pToken = strtok( NULL, " \t\r\n" );
457 if ( strcmp( pToken, MIO_STRING_UNKNOWN ) == 0 )
458 pPin->Phase = MIO_PHASE_UNKNOWN;
459 else if ( strcmp( pToken, MIO_STRING_INV ) == 0 )
460 pPin->Phase = MIO_PHASE_INV;
461 else if ( strcmp( pToken, MIO_STRING_NONINV ) == 0 )
462 pPin->Phase = MIO_PHASE_NONINV;
463 else
464 {
465 printf( "Cannot read pin phase specification\n" );
466 Mio_PinDelete( pPin );
467 *ppToken = pToken;
468 return NULL;
469 }
470
471 pToken = strtok( NULL, " \t\r\n" );
472 pPin->dLoadInput = atof( pToken );
473
474 pToken = strtok( NULL, " \t\r\n" );
475 pPin->dLoadMax = atof( pToken );
476
477 pToken = strtok( NULL, " \t\r\n" );
478 pPin->dDelayBlockRise = atof( pToken );
479
480 pToken = strtok( NULL, " \t\r\n" );
481 pPin->dDelayFanoutRise = atof( pToken );
482
483 pToken = strtok( NULL, " \t\r\n" );
484 pPin->dDelayBlockFall = atof( pToken );
485
486 pToken = strtok( NULL, " \t\r\n" );
487 pPin->dDelayFanoutFall = atof( pToken );
488
489 if ( fExtendedFormat )
490 {
491 /* In extended format, the field after dDelayFanoutRise
492 * is to be ignored
493 **/
494
495 pPin->dDelayBlockFall = pPin->dDelayFanoutFall;
496
497 pToken = strtok( NULL, " \t" );
498 pPin->dDelayFanoutFall = atof( pToken );
499
500 /* last field is ignored */
501 pToken = strtok( NULL, " \t\r\n" );
502 }
503
504 if ( pPin->dDelayBlockRise > pPin->dDelayBlockFall )
505 pPin->dDelayBlockMax = pPin->dDelayBlockRise;
506 else
507 pPin->dDelayBlockMax = pPin->dDelayBlockFall;
508
509 *ppToken = pToken;
510 return pPin;
511}
512
513
526char * chomp( char *s )
527{
528 char *a, *b, *c;
529 // remove leading spaces
530 for ( b = s; *b; b++ )
531 if ( !isspace(*b) )
532 break;
533 // strsav the string
534 a = strcpy( ABC_ALLOC(char, strlen(b)+1), b );
535 // remove trailing spaces
536 for ( c = a+strlen(a); c > a; c-- )
537 if ( *c == 0 || isspace(*c) )
538 *c = 0;
539 else
540 break;
541 return a;
542}
543
556{
557 double Diff = (*pp1)->dArea - (*pp2)->dArea;
558 if ( Diff < 0.0 )
559 return -1;
560 if ( Diff > 0.0 )
561 return 1;
562 return 0;
563}
564
577{
578 int Diff = strcmp( (*pp1)->pName, (*pp2)->pName );
579 if ( Diff < 0 )
580 return -1;
581 if ( Diff > 0 )
582 return 1;
583 return 0;
584}
585
598{
599 Mio_Gate_t ** ppGates, * pGate;
600 int i = 0;
601 ppGates = ABC_ALLOC( Mio_Gate_t *, pLib->nGates );
602 Mio_LibraryForEachGate( pLib, pGate )
603 {
604 pGate->Cell = i;
605 ppGates[i++] = pGate;
606 }
607 assert( i == pLib->nGates );
608 // sort gates by name
609 pLib->ppGates0 = ABC_ALLOC( Mio_Gate_t *, pLib->nGates );
610 for ( i = 0; i < pLib->nGates; i++ )
611 pLib->ppGates0[i] = ppGates[i];
612 qsort( (void *)ppGates, (size_t)pLib->nGates, sizeof(void *),
613 (int (*)(const void *, const void *)) Mio_LibraryCompareGatesByName );
614 for ( i = 0; i < pLib->nGates; i++ )
615 ppGates[i]->pNext = (i < pLib->nGates-1)? ppGates[i+1] : NULL;
616 pLib->pGates = ppGates[0];
617 pLib->ppGatesName = ppGates;
618}
619
631static inline Mio_Gate_t * Mio_GateCompare( Mio_Gate_t * pThis, Mio_Gate_t * pNew, word uTruth )
632{
633 if ( pNew->uTruth != uTruth )
634 return pThis;
635 if ( pThis == NULL )
636 return pNew;
637 if ( pThis->dArea > pNew->dArea || (pThis->dArea == pNew->dArea && strcmp(pThis->pName, pNew->pName) > 0) )
638 return pNew;
639 return pThis;
640}
641void Mio_LibraryDetectSpecialGates( Mio_Library_t * pLib )
642{
643 Mio_Gate_t * pGate;
644 word uFuncBuf, uFuncInv, uFuncNand2, uFuncAnd2, uFuncNor2, uFuncOr2;
645
646 Mio_LibrarySortGates( pLib );
647
648 uFuncBuf = ABC_CONST(0xAAAAAAAAAAAAAAAA);
649 uFuncAnd2 = ABC_CONST(0xAAAAAAAAAAAAAAAA) & ABC_CONST(0xCCCCCCCCCCCCCCCC);
650 uFuncOr2 = ABC_CONST(0xAAAAAAAAAAAAAAAA) | ABC_CONST(0xCCCCCCCCCCCCCCCC);
651 uFuncInv = ~uFuncBuf;
652 uFuncNand2 = ~uFuncAnd2;
653 uFuncNor2 = ~uFuncOr2;
654
655 // get smallest-area buffer
656 Mio_LibraryForEachGate( pLib, pGate )
657 pLib->pGateBuf = Mio_GateCompare( pLib->pGateBuf, pGate, uFuncBuf );
658 if ( pLib->pGateBuf == NULL )
659 {
660 printf( "Warnings: genlib library reader cannot detect the buffer gate.\n" );
661 printf( "Some parts of the supergate-based technology mapper may not work correctly.\n" );
662 }
663
664 // get smallest-area inverter
665 Mio_LibraryForEachGate( pLib, pGate )
666 pLib->pGateInv = Mio_GateCompare( pLib->pGateInv, pGate, uFuncInv );
667 if ( pLib->pGateInv == NULL )
668 {
669 printf( "Warnings: genlib library reader cannot detect the invertor gate.\n" );
670 printf( "Some parts of the supergate-based technology mapper may not work correctly.\n" );
671 }
672
673 // get smallest-area NAND2/AND2 gates
674 Mio_LibraryForEachGate( pLib, pGate )
675 {
676 pLib->pGateNand2 = Mio_GateCompare( pLib->pGateNand2, pGate, uFuncNand2 );
677 pLib->pGateAnd2 = Mio_GateCompare( pLib->pGateAnd2, pGate, uFuncAnd2 );
678 pLib->pGateNor2 = Mio_GateCompare( pLib->pGateNor2, pGate, uFuncNor2 );
679 pLib->pGateOr2 = Mio_GateCompare( pLib->pGateOr2, pGate, uFuncOr2 );
680 }
681 if ( pLib->pGateAnd2 == NULL && pLib->pGateNand2 == NULL && pLib->pGateNor2 == NULL && pLib->pGateOr2 == NULL )
682 {
683 printf( "Warnings: genlib library reader cannot detect the AND2, NAND2, OR2, and NOR2 gate.\n" );
684 printf( "Some parts of the supergate-based technology mapper may not work correctly.\n" );
685 }
686}
687
699int Mio_LibraryReadExclude( char * ExcludeFile, st__table * tExcludeGate )
700{
701 int nDel = 0;
702 FILE *pEx;
703 char buffer[128];
704
705 assert ( tExcludeGate );
706
707 if ( ExcludeFile )
708 {
709 pEx = fopen( ExcludeFile, "r" );
710
711 if ( pEx == NULL )
712 {
713 fprintf ( stdout, "Error: Could not open exclude file %s. Stop.\n", ExcludeFile );
714 return -1;
715 }
716
717 while (1 == fscanf( pEx, "%127s", buffer ))
718 {
719 //printf ("Read: '%s'\n", buffer );
720 st__insert( tExcludeGate, Abc_UtilStrsav( buffer ), (char *)0 );
721 nDel++;
722 }
723
724 fclose( pEx );
725 }
726
727 return nDel;
728}
729
743void Io_ReadFileRemoveComments( char * pBuffer, int * pnDots, int * pnLines )
744{
745 char * pCur;
746 int nDots, nLines;
747 // scan through the buffer and eliminate comments
748 // (in the BLIF file, comments are lines starting with "#")
749 nDots = nLines = 0;
750 for ( pCur = pBuffer; *pCur; pCur++ )
751 {
752 // if this is the beginning of comment
753 // clean it with spaces until the new line statement
754 if ( *pCur == '#' ) {
755 while ( *pCur != '\n' ) {
756 *pCur++ = ' ';
757 }
758 }
759 // count the number of new lines and dots
760 if ( *pCur == '\n' ) {
761 if (pCur > pBuffer) {
762 if (*(pCur - 1) == '\r') {
763 // DOS(R) file support
764 if (pCur > (pBuffer + 1)) {
765 if (*(pCur - 2) != '\\') {
766 nLines++;
767 }
768 else {
769 // rewind to backslash and overwrite with a space
770 *(pCur - 2) = ' ';
771 *(pCur - 1) = ' ';
772 *pCur = ' ';
773 }
774 }
775 } else {
776 // UNIX(TM) file support
777 if (*(pCur - 1) != '\\') {
778 nLines++;
779 }
780 else {
781 // rewind to backslash and overwrite with a space
782 *(pCur - 1) = ' ';
783 *pCur = ' ';
784 }
785 }
786 }
787 }
788 else if ( *pCur == '.' ) {
789 nDots++;
790 }
791 }
792
793 if ( pnDots )
794 *pnDots = nDots;
795 if ( pnLines )
796 *pnLines = nLines;
797}
798
802
803
805
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
#define ABC_FREE(obj)
Definition abc_global.h:267
#define ABC_CONST(number)
PARAMETERS ///.
Definition abc_global.h:240
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Cube * p
Definition exorList.c:222
char * Extra_FileNameGenericAppend(char *pBase, char *pSuffix)
FILE * Io_FileOpen(const char *FileName, const char *PathVar, const char *Mode, int fVerbose)
Definition ioUtil.c:828
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
Mem_Flex_t * Mem_FlexStart()
Definition mem.c:327
#define MIO_STRING_LATCH
Definition mioInt.h:44
#define MIO_STRING_UNKNOWN
Definition mioInt.h:48
#define MIO_STRING_PIN
Definition mioInt.h:45
#define MIO_STRING_GATE
INCLUDES ///.
Definition mioInt.h:43
#define MIO_STRING_NONINV
Definition mioInt.h:46
#define MIO_STRING_INV
Definition mioInt.h:47
char * Mio_LibraryCleanStr(char *p)
Definition mioRead.c:349
void Mio_LibrarySortGates(Mio_Library_t *pLib)
Definition mioRead.c:597
Mio_Library_t * Mio_LibraryReadBuffer(char *pBuffer, int fExtendedFormat, st__table *tExcludeGate, int nFaninLimit, int fVerbose)
Definition mioRead.c:156
int Mio_LibraryCompareGatesByArea(Mio_Gate_t **pp1, Mio_Gate_t **pp2)
Definition mioRead.c:555
int Mio_LibraryCompareGatesByName(Mio_Gate_t **pp1, Mio_Gate_t **pp2)
Definition mioRead.c:576
char * Mio_ReadFile(char *FileName, int fAddEnd)
Definition mioRead.c:115
Mio_Library_t * Mio_LibraryRead(char *FileName, char *pBuffer, char *ExcludeFile, int nFaninLimit, int fVerbose)
Definition mioRead.c:54
int Mio_LibraryReadExclude(char *ExcludeFile, st__table *tExcludeGate)
Definition mioRead.c:699
Mio_Pin_t * Mio_GateReadPins(Mio_Gate_t *pGate)
Definition mioApi.c:173
@ MIO_PHASE_INV
Definition mio.h:40
@ MIO_PHASE_NONINV
Definition mio.h:40
@ MIO_PHASE_UNKNOWN
Definition mio.h:40
int Mio_ParseCheckFormula(Mio_Gate_t *pGate, char *pForm)
Definition mioParse.c:444
struct Mio_LibraryStruct_t_ Mio_Library_t
Definition mio.h:42
void Mio_LibraryDelete(Mio_Library_t *pLib)
DECLARATIONS ///.
Definition mioUtils.c:51
Mio_Gate_t * Mio_LibraryReadGateByName(Mio_Library_t *pLib, char *pName, char *pOutName)
Definition mioApi.c:105
void Mio_PinDelete(Mio_Pin_t *pPin)
Definition mioUtils.c:114
#define Mio_LibraryForEachGate(Lib, Gate)
GLOBAL VARIABLES ///.
Definition mio.h:81
Mio_Pin_t * Mio_PinReadNext(Mio_Pin_t *pPin)
Definition mioApi.c:217
struct Mio_PinStruct_t_ Mio_Pin_t
Definition mio.h:44
void Mio_GateDelete(Mio_Gate_t *pGate)
Definition mioUtils.c:87
struct Mio_GateStruct_t_ Mio_Gate_t
Definition mio.h:43
int Mio_LibraryParseFormulas(Mio_Library_t *pLib)
FUNCTION DEFINITIONS ///.
Definition mioForm.c:58
int st__strhash(const char *string, int modulus)
Definition st.c:449
st__table * st__init_table(st__compare_func_type compare, st__hash_func_type hash)
Definition st.c:72
int st__insert(st__table *table, const char *key, char *value)
Definition st.c:171
void st__free_table(st__table *table)
Definition st.c:81
#define st__is_member(table, key)
Definition st.h:70
char * pOutName
Definition mioInt.h:103
Mio_Library_t * pLib
Definition mioInt.h:105
Mio_Pin_t * pPins
Definition mioInt.h:102
Mio_Gate_t * pTwin
Definition mioInt.h:108
Mio_Gate_t * pNext
Definition mioInt.h:107
Mio_Gate_t * pGateAnd2
Definition mioInt.h:74
Mio_Gate_t * pGateInv
Definition mioInt.h:72
Mio_Gate_t ** ppGates0
Definition mioInt.h:66
Mio_Gate_t * pGateNor2
Definition mioInt.h:75
Mio_Gate_t * pGateOr2
Definition mioInt.h:76
Mio_Gate_t * pGateNand2
Definition mioInt.h:73
Mio_Gate_t ** ppGatesName
Definition mioInt.h:67
Mio_Gate_t * pGates
Definition mioInt.h:68
st__table * tName2Gate
Definition mioInt.h:77
Vec_Str_t * vCube
Definition mioInt.h:79
Mio_Gate_t * pGateBuf
Definition mioInt.h:71
Mem_Flex_t * pMmFlex
Definition mioInt.h:78
double dDelayBlockMax
Definition mioInt.h:133
double dDelayBlockFall
Definition mioInt.h:131
Mio_Pin_t * pNext
Definition mioInt.h:134
double dDelayFanoutRise
Definition mioInt.h:130
double dLoadMax
Definition mioInt.h:128
Mio_PinPhase_t Phase
Definition mioInt.h:126
double dDelayBlockRise
Definition mioInt.h:129
double dLoadInput
Definition mioInt.h:127
double dDelayFanoutFall
Definition mioInt.h:132
Definition st.h:52
#define assert(ex)
Definition util_old.h:213
int strlen()
int strcmp()
char * strtok()
char * strcpy()
VOID_HACK rewind()
double atof()
char * strcat()
#define SEEK_END
Definition zconf.h:392