abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cmdPlugin.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [cmdPlugin.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Command processing package.]
8 
9  Synopsis [Integrating external binary.]
10 
11  Author [Alan Mishchenko, Niklas Een]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - September 29, 2010.]
16 
17  Revision [$Id: cmdPlugin.c,v 1.00 2010/09/29 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #ifdef WIN32
22 #include <io.h>
23 #include <process.h>
24 #else
25 #include <unistd.h>
26 #endif
27 
28 #include "base/abc/abc.h"
29 #include "base/main/mainInt.h"
30 #include "cmd.h"
31 #include "cmdInt.h"
32 #include "misc/util/utilSignal.h"
33 
35 
36 ////////////////////////////////////////////////////////////////////////
37 /// DECLARATIONS ///
38 ////////////////////////////////////////////////////////////////////////
39 
40 /*
41 
42 -------- Original Message --------
43 Subject: ABC/ZZ integration
44 Date: Wed, 29 Sep 2010 00:34:32 -0700
45 From: Niklas Een <niklas@een.se>
46 To: Alan Mishchenko <alanmi@EECS.Berkeley.EDU>
47 
48 Hi Alan,
49 
50 Since the interface is file-based, it is important that we generate
51 good, unique filenames (we may run multiple instances of ABC in the
52 same directory), so I have attached some portable code for doing that
53 (tmpFile.c). You can integrate it appropriately.
54 
55 This is how my interface is meant to work:
56 
57 (1) As part of your call to Bip, give it first argument "-abc".
58  This will alter Bip's behavior slightly.
59 
60 (2) To list the commands, call 'bip -list-commands'.
61  My commands begin with a comma (so that's my prefix).
62 
63 (3) All commands expect an input file and an output file.
64  The input file should be in AIGER format.
65  The output will be a text file.
66  Example:
67  bip -input=tmp.aig -output=tmp.out ,pdr -check -prop=5
68 
69  So you just auto-generate the two temporary files (output file is
70  closed and left empty) and stitch the ABC command line at the end.
71  All you need to check for is if the ABC line begins with a comma.
72 
73 (4) The result written to the output file will contain a number
74  of object. Each object is on a separate line of the form:
75 
76  <object name>: <object data>
77 
78 That is: name, colon, space, data, newline. If you see a name you don't
79 recognize, just skip that line (so you will ignore future extensions by me).
80 I currently define the following objects:
81 
82  result:
83  counter-example:
84  proof-invariant:
85  bug-free-depth:
86  abstraction:
87 
88 "result:" is one of "proved", "failed", "undetermined" (=reached resource limit), "error"
89 (only used by the abstraction command, and only if resource limit was so tight that the
90 abstraction was still empty -- no abstraction is returned in this special case).
91 
92 "counter-example:" -- same format as before
93 
94 "proof-invariant:" contains an text-encoded single-output AIG. If you want
95 you can parse it and validate the invariant.
96 
97 "bug-free-depth:" the depth up to which the procedure has checked for counter-example.
98 Starts at -1 (not even the initial states have been verified).
99 
100 "abstraction:" -- same format as before
101 
102 (5) I propose that you add a command "load_plugin <path/binary>". That way Bob can put
103 Bip where ever he likes and just modify his abc_rc file.
104 
105 The intention is that ABC can read this file and act on it without knowing what
106 particular command was used. If there is an abstraction, you will always apply it.
107 If there is a "bug-free-depth" you will store that data somewhere so that Bob can query
108 it through the Python interface, and so on. If we need different actions for different
109 command, then we add a new object for the new action.
110 
111 // N.
112 
113 */
114 
115 ////////////////////////////////////////////////////////////////////////
116 /// FUNCTION DEFINITIONS ///
117 ////////////////////////////////////////////////////////////////////////
118 
119 /**Function*************************************************************
120 
121  Synopsis []
122 
123  Description []
124 
125  SideEffects []
126 
127  SeeAlso []
128 
129 ***********************************************************************/
130 char * Abc_GetBinaryName( Abc_Frame_t * pAbc, int argc, char ** argv )
131 {
132  char * pTemp;
133  int i;
134  Vec_PtrForEachEntry( char *, pAbc->vPlugInComBinPairs, pTemp, i )
135  {
136  i++;
137  if ( strcmp( pTemp, argv[0] ) == 0 )
138  return (char *)Vec_PtrEntry( pAbc->vPlugInComBinPairs, i );
139  }
140  assert( 0 );
141  return NULL;
142 }
143 
144 /**Function*************************************************************
145 
146  Synopsis [Read flop map.]
147 
148  Description []
149 
150  SideEffects []
151 
152  SeeAlso []
153 
154 ***********************************************************************/
155 Vec_Str_t * Abc_ManReadFile( char * pFileName )
156 {
157  FILE * pFile;
158  Vec_Str_t * vStr;
159  int c;
160  pFile = fopen( pFileName, "r" );
161  if ( pFile == NULL )
162  {
163  printf( "Cannot open file \"%s\".\n", pFileName );
164  return NULL;
165  }
166  vStr = Vec_StrAlloc( 100 );
167  while ( (c = fgetc(pFile)) != EOF )
168  Vec_StrPush( vStr, (char)c );
169  Vec_StrPush( vStr, '\0' );
170  fclose( pFile );
171  return vStr;
172 }
173 
174 /**Function*************************************************************
175 
176  Synopsis [Read flop map.]
177 
178  Description []
179 
180  SideEffects []
181 
182  SeeAlso []
183 
184 ***********************************************************************/
185 Vec_Int_t * Abc_ManReadBinary( char * pFileName, char * pToken )
186 {
187  Vec_Int_t * vMap = NULL;
188  Vec_Str_t * vStr;
189  char * pStr;
190  int i, Length;
191  vStr = Abc_ManReadFile( pFileName );
192  if ( vStr == NULL )
193  return NULL;
194  pStr = Vec_StrArray( vStr );
195  pStr = strstr( pStr, pToken );
196  if ( pStr != NULL )
197  {
198  pStr += strlen( pToken );
199  vMap = Vec_IntAlloc( 100 );
200  Length = strlen( pStr );
201  for ( i = 0; i < Length; i++ )
202  {
203  if ( pStr[i] == '0' || pStr[i] == '?' )
204  Vec_IntPush( vMap, 0 );
205  else if ( pStr[i] == '1' )
206  Vec_IntPush( vMap, 1 );
207  if ( ('a' <= pStr[i] && pStr[i] <= 'z') ||
208  ('A' <= pStr[i] && pStr[i] <= 'Z') )
209  break;
210  }
211  }
212  Vec_StrFree( vStr );
213  return vMap;
214 }
215 
216 /**Function*************************************************************
217 
218  Synopsis [Read flop map.]
219 
220  Description []
221 
222  SideEffects []
223 
224  SeeAlso []
225 
226 ***********************************************************************/
227 int Abc_ManReadInteger( char * pFileName, char * pToken )
228 {
229  int Result = -1;
230  Vec_Str_t * vStr;
231  char * pStr;
232  vStr = Abc_ManReadFile( pFileName );
233  if ( vStr == NULL )
234  return -1;
235  pStr = Vec_StrArray( vStr );
236  pStr = strstr( pStr, pToken );
237  if ( pStr != NULL )
238  Result = atoi( pStr + strlen(pToken) );
239  Vec_StrFree( vStr );
240  return Result;
241 }
242 
243 /**Function*************************************************************
244 
245  Synopsis [Read flop map.]
246 
247  Description []
248 
249  SideEffects []
250 
251  SeeAlso []
252 
253 ***********************************************************************/
254 int Abc_ManReadStatus( char * pFileName, char * pToken )
255 {
256  int Result = -1;
257  Vec_Str_t * vStr;
258  char * pStr;
259  vStr = Abc_ManReadFile( pFileName );
260  if ( vStr == NULL )
261  return -1;
262  pStr = Vec_StrArray( vStr );
263  pStr = strstr( pStr, pToken );
264  if ( pStr != NULL )
265  {
266  if ( strncmp(pStr+8, "proved", 6) == 0 )
267  Result = 1;
268  else if ( strncmp(pStr+8, "failed", 6) == 0 )
269  Result = 0;
270  }
271  Vec_StrFree( vStr );
272  return Result;
273 }
274 
275 /**Function*************************************************************
276 
277  Synopsis [Work-around to insert 0s for PIs without fanout.]
278 
279  Description []
280 
281  SideEffects []
282 
283  SeeAlso []
284 
285 ***********************************************************************/
287 {
288  Vec_Int_t * vCexNew;
289  Gia_Obj_t * pObj;
290  int i, k;
291 
292  // start with register outputs
293  vCexNew = Vec_IntAlloc( Vec_IntSize(vCex) );
294  Gia_ManForEachRo( pGia, pObj, i )
295  Vec_IntPush( vCexNew, 0 );
296 
297  ABC_FREE( pGia->pRefs );
298  Gia_ManCreateRefs( pGia );
299  k = Gia_ManRegNum( pGia );
300  while ( 1 )
301  {
302  Gia_ManForEachPi( pGia, pObj, i )
303  {
304  if ( Gia_ObjRefNum(pGia, pObj) == 0 )
305  Vec_IntPush( vCexNew, 0 );
306  else
307  {
308  if ( k == Vec_IntSize(vCex) )
309  break;
310  Vec_IntPush( vCexNew, Vec_IntEntry(vCex, k++) );
311  }
312  }
313  if ( k == Vec_IntSize(vCex) )
314  break;
315  }
316  return vCexNew;
317 }
318 
319 /**Function*************************************************************
320 
321  Synopsis [Procedure to convert the AIG from text into binary form.]
322 
323  Description []
324 
325  SideEffects []
326 
327  SeeAlso []
328 
329 ***********************************************************************/
330 static unsigned textToBin(char* text, unsigned long text_sz)
331 {
332  char* dst = text;
333  const char* src = text;
334  unsigned sz, i;
335  sscanf(src, "%u ", &sz);
336  while(*src++ != ' ');
337  for ( i = 0; i < sz; i += 3 )
338  {
339  dst[0] = (char)( (unsigned)src[0] - '0') | (((unsigned)src[1] - '0') << 6);
340  dst[1] = (char)(((unsigned)src[1] - '0') >> 2) | (((unsigned)src[2] - '0') << 4);
341  dst[2] = (char)(((unsigned)src[2] - '0') >> 4) | (((unsigned)src[3] - '0') << 2);
342  src += 4;
343  dst += 3;
344  }
345  return sz;
346 }
347 
348 /**Function*************************************************************
349 
350  Synopsis [Derives AIG from the text string in the file.]
351 
352  Description []
353 
354  SideEffects []
355 
356  SeeAlso []
357 
358 ***********************************************************************/
359 Gia_Man_t * Abc_ManReadAig( char * pFileName, char * pToken )
360 {
361  Gia_Man_t * pGia = NULL;
362  unsigned nBinaryPart;
363  Vec_Str_t * vStr;
364  char * pStr, * pEnd;
365  vStr = Abc_ManReadFile( pFileName );
366  if ( vStr == NULL )
367  return NULL;
368  pStr = Vec_StrArray( vStr );
369  pStr = strstr( pStr, pToken );
370  if ( pStr != NULL )
371  {
372  // skip token
373  pStr += strlen(pToken);
374  // skip spaces
375  while ( *pStr == ' ' )
376  pStr++;
377  // set the end at newline
378  for ( pEnd = pStr; *pEnd; pEnd++ )
379  if ( *pEnd == '\r' || *pEnd == '\n' )
380  {
381  *pEnd = 0;
382  break;
383  }
384  // convert into binary AIGER
385  nBinaryPart = textToBin( pStr, strlen(pStr) );
386  // dump it into file
387  if ( 0 )
388  {
389  FILE * pFile = fopen( "test.aig", "wb" );
390  fwrite( pStr, 1, nBinaryPart, pFile );
391  fclose( pFile );
392  }
393  // derive AIG
394  pGia = Gia_AigerReadFromMemory( pStr, nBinaryPart, 0, 0 );
395  }
396  Vec_StrFree( vStr );
397  return pGia;
398 
399 }
400 
401 /**Function*************************************************************
402 
403  Synopsis []
404 
405  Description []
406 
407  SideEffects []
408 
409  SeeAlso []
410 
411 ***********************************************************************/
412 int Cmd_CommandAbcPlugIn( Abc_Frame_t * pAbc, int argc, char ** argv )
413 {
414  char * pFileIn, * pFileOut;
415  char * pFileNameBinary;
416  Vec_Str_t * vCommand;
417  Vec_Int_t * vCex;
418  FILE * pFile;
419  Gia_Man_t * pGia;
420  int i, fd;
421  abctime clk;
422  int fLeaveFiles;
423 /*
424  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
425  if ( pNtk == NULL )
426  {
427  Abc_Print( -1, "Current network does not exist\n" );
428  return 1;
429  }
430  if ( !Abc_NtkIsStrash( pNtk) )
431  {
432  Abc_Print( -1, "The current network is not an AIG. Cannot continue.\n" );
433  return 1;
434  }
435 */
436 
437  if ( pAbc->pGia == NULL )
438  {
439  if (argc == 2 && strcmp(argv[1], "-h") == 0)
440  {
441  // Run command to produce help string:
442  vCommand = Vec_StrAlloc( 100 );
443  pFileNameBinary = Abc_GetBinaryName( pAbc, argc, argv );
444  Vec_StrAppend( vCommand, pFileNameBinary );
445  Vec_StrAppend( vCommand, " -abc " );
446  Vec_StrAppend( vCommand, argv[0] );
447  Vec_StrAppend( vCommand, " -h" );
448  Vec_StrPush( vCommand, 0 );
449  Util_SignalSystem( Vec_StrArray(vCommand) );
450  Vec_StrFree( vCommand );
451  }
452  else
453  {
454  Abc_Print( -1, "Current AIG does not exist (try command &ps).\n" );
455  }
456  return 1;
457  }
458 
459  // check if there is the binary
460  pFileNameBinary = Abc_GetBinaryName( pAbc, argc, argv );
461  if ( (pFile = fopen( pFileNameBinary, "r" )) == NULL )
462  {
463  Abc_Print( -1, "Cannot run the binary \"%s\".\n\n", pFileNameBinary );
464  return 1;
465  }
466  fclose( pFile );
467 
468  // create temp file
469  fd = Util_SignalTmpFile( "__abctmp_", ".aig", &pFileIn );
470  if ( fd == -1 )
471  {
472  Abc_Print( -1, "Cannot create a temporary file.\n" );
473  return 1;
474  }
475 #ifdef WIN32
476  _close( fd );
477 #else
478  close( fd );
479 #endif
480 
481  // create temp file
482  fd = Util_SignalTmpFile( "__abctmp_", ".out", &pFileOut );
483  if ( fd == -1 )
484  {
485  ABC_FREE( pFileIn );
486  Abc_Print( -1, "Cannot create a temporary file.\n" );
487  return 1;
488  }
489 #ifdef WIN32
490  _close( fd );
491 #else
492  close( fd );
493 #endif
494 
495 
496  // write current network into a file
497 /*
498  {
499  extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
500  Aig_Man_t * pAig;
501  pAig = Abc_NtkToDar( pNtk, 0, 1 );
502  Ioa_WriteAiger( pAig, pFileIn, 0, 0 );
503  Aig_ManStop( pAig );
504  }
505 */
506  // check what to do with the files
507  fLeaveFiles = 0;
508  if ( strcmp( argv[argc-1], "!" ) == 0 )
509  {
510  Abc_Print( 0, "Input file \"%s\" and output file \"%s\" are not deleted.\n", pFileIn, pFileOut );
511  fLeaveFiles = 1;
512  argc--;
513  }
514 
515  // create input file
516  Gia_AigerWrite( pAbc->pGia, pFileIn, 0, 0 );
517 
518  // create command line
519  vCommand = Vec_StrAlloc( 100 );
520  Vec_StrAppend( vCommand, pFileNameBinary );
521  // add input/output file
522  Vec_StrAppend( vCommand, " -abc" );
523 // Vec_StrAppend( vCommand, " -input=C:/_projects/abc/_TEST/hwmcc/139442p0.aig" );
524  Vec_StrAppend( vCommand, " -input=" );
525  Vec_StrAppend( vCommand, pFileIn );
526  Vec_StrAppend( vCommand, " -output=" );
527  Vec_StrAppend( vCommand, pFileOut );
528  // add other arguments
529  for ( i = 0; i < argc; i++ )
530  {
531  Vec_StrAppend( vCommand, " " );
532  Vec_StrAppend( vCommand, argv[i] );
533  }
534  Vec_StrPush( vCommand, 0 );
535 
536  // run the command line
537 //printf( "Running command line: %s\n", Vec_StrArray(vCommand) );
538 
539  clk = Abc_Clock();
540  if ( Util_SignalSystem( Vec_StrArray(vCommand) ) )
541  {
542  Abc_Print( -1, "The following command has returned non-zero exit status:\n" );
543  Abc_Print( -1, "\"%s\"\n", Vec_StrArray(vCommand) );
544  return 1;
545  }
546  clk = Abc_Clock() - clk;
547  Vec_StrFree( vCommand );
548 
549  // check if the output file exists
550  if ( (pFile = fopen( pFileOut, "r" )) == NULL )
551  {
552  Abc_Print( -1, "There is no output file \"%s\".\n", pFileOut );
553  return 1;
554  }
555  fclose( pFile );
556 
557  // process the output
558  if ( Extra_FileSize(pFileOut) > 0 )
559  {
560  // get status
561  pAbc->Status = Abc_ManReadStatus( pFileOut, "result:" );
562  // get bug-free depth
563  pAbc->nFrames = Abc_ManReadInteger( pFileOut, "bug-free-depth:" );
564  // get abstraction
565  pAbc->pGia->vFlopClasses = Abc_ManReadBinary( pFileOut, "abstraction:" );
566  // get counter-example
567  vCex = Abc_ManReadBinary( pFileOut, "counter-example:" );
568  if ( vCex )
569  {
570  int nFrames, nRemain;
571 
572  nFrames = (Vec_IntSize(vCex) - Gia_ManRegNum(pAbc->pGia)) / Gia_ManPiNum(pAbc->pGia);
573  nRemain = (Vec_IntSize(vCex) - Gia_ManRegNum(pAbc->pGia)) % Gia_ManPiNum(pAbc->pGia);
574  if ( nRemain != 0 )
575  {
576  Vec_Int_t * vTemp;
577  Abc_Print( 1, "Adjusting counter-example by adding zeros for PIs without fanout.\n" );
578  // expand the counter-example to include PIs without fanout
579  vCex = Abc_ManExpandCex( pAbc->pGia, vTemp = vCex );
580  Vec_IntFree( vTemp );
581  }
582 
583  nFrames = (Vec_IntSize(vCex) - Gia_ManRegNum(pAbc->pGia)) / Gia_ManPiNum(pAbc->pGia);
584  nRemain = (Vec_IntSize(vCex) - Gia_ManRegNum(pAbc->pGia)) % Gia_ManPiNum(pAbc->pGia);
585  if ( nRemain != 0 )
586  Abc_Print( 1, "Counter example has a wrong length.\n" );
587  else
588  {
589  Abc_Print( 1, "Problem is satisfiable. Found counter-example in frame %d. ", nFrames-1 );
590  Abc_PrintTime( 1, "Time", clk );
591  ABC_FREE( pAbc->pCex );
592  pAbc->pCex = Abc_CexCreate( Gia_ManRegNum(pAbc->pGia), Gia_ManPiNum(pAbc->pGia), Vec_IntArray(vCex), nFrames-1, 0, 0 );
593 
594 // Abc_CexPrint( pAbc->pCex );
595 
596 // if ( !Gia_ManVerifyCex( pAbc->pGia, pAbc->pCex, 0 ) )
597 // Abc_Print( 1, "Generated counter-example is INVALID.\n" );
598 
599  // remporary work-around to detect the output number - October 18, 2010
600  pAbc->pCex->iPo = Gia_ManFindFailedPoCex( pAbc->pGia, pAbc->pCex, 0 );
601  if ( pAbc->pCex->iPo == -1 )
602  {
603  Abc_Print( 1, "Generated counter-example is INVALID.\n" );
604  ABC_FREE( pAbc->pCex );
605  }
606  else
607  {
608  Abc_Print( 1, "Returned counter-example successfully verified in ABC.\n" );
609  }
610  }
611  Vec_IntFreeP( &vCex );
612  }
613  // get AIG if present
614  pGia = Abc_ManReadAig( pFileOut, "aig:" );
615  if ( pGia != NULL )
616  {
617  Gia_ManStopP( &pAbc->pGia );
618  pAbc->pGia = pGia;
619  }
620  }
621 
622  // clean up
623  Util_SignalTmpFileRemove( pFileIn, fLeaveFiles );
624  Util_SignalTmpFileRemove( pFileOut, fLeaveFiles );
625 
626  ABC_FREE( pFileIn );
627  ABC_FREE( pFileOut );
628  return 0;
629 }
630 
631 /**Function*************************************************************
632 
633  Synopsis []
634 
635  Description []
636 
637  SideEffects []
638 
639  SeeAlso []
640 
641 ***********************************************************************/
642 int Cmd_CommandAbcLoadPlugIn( Abc_Frame_t * pAbc, int argc, char ** argv )
643 {
644  FILE * pFile;
645  char pBuffer[1000];
646  char * pCommandLine;
647  char * pTempFile;
648  char * pStrDirBin, * pStrSection;
649  int fd, RetValue;
650 
651  if ( argc != 3 )
652  {
653  Abc_Print( -1, "Wrong number of arguments.\n" );
654  goto usage;
655  }
656  // collect arguments
657  pStrDirBin = argv[argc-2];
658  pStrSection = argv[argc-1];
659 
660  // check if the file exists
661  if ( (pFile = fopen( pStrDirBin, "r" )) == NULL )
662  {
663 // Abc_Print( -1, "Cannot run the binary \"%s\".\n", pStrDirBin );
664 // goto usage;
665  return 0;
666  }
667  fclose( pFile );
668 
669  // create temp file
670  fd = Util_SignalTmpFile( "__abctmp_", ".txt", &pTempFile );
671  if ( fd == -1 )
672  {
673  Abc_Print( -1, "Cannot create a temporary file.\n" );
674  goto usage;
675  }
676 #ifdef WIN32
677  _close( fd );
678 #else
679  close( fd );
680 #endif
681 
682  // get command list
683  pCommandLine = ABC_ALLOC( char, 100 + strlen(pStrDirBin) + strlen(pTempFile) );
684 // sprintf( pCommandLine, "%s -abc -list-commands > %s", pStrDirBin, pTempFile );
685  sprintf( pCommandLine, "%s -abc -list-commands > %s", pStrDirBin, pTempFile );
686  RetValue = Util_SignalSystem( pCommandLine );
687  if ( RetValue == -1 )
688  {
689  Abc_Print( -1, "Command \"%s\" did not succeed.\n", pCommandLine );
690  ABC_FREE( pCommandLine );
691  ABC_FREE( pTempFile );
692  goto usage;
693  }
694  ABC_FREE( pCommandLine );
695 
696  // create commands
697  pFile = fopen( pTempFile, "r" );
698  if ( pFile == NULL )
699  {
700  Abc_Print( -1, "Cannot open file with the list of commands.\n" );
701  ABC_FREE( pTempFile );
702  goto usage;
703  }
704  while ( fgets( pBuffer, 1000, pFile ) != NULL )
705  {
706  if ( pBuffer[strlen(pBuffer)-1] == '\n' )
707  pBuffer[strlen(pBuffer)-1] = 0;
708  Cmd_CommandAdd( pAbc, pStrSection, pBuffer, Cmd_CommandAbcPlugIn, 1 );
709 // plugin_commands.push(Pair(cmd_name, binary_name));
710  Vec_PtrPush( pAbc->vPlugInComBinPairs, Extra_UtilStrsav(pBuffer) );
711  Vec_PtrPush( pAbc->vPlugInComBinPairs, Extra_UtilStrsav(pStrDirBin) );
712 // printf( "Creating command %s with binary %s\n", pBuffer, pStrDirBin );
713  }
714  fclose( pFile );
715  Util_SignalTmpFileRemove( pTempFile, 0 );
716  ABC_FREE( pTempFile );
717  return 0;
718 usage:
719  Abc_Print( -2, "usage: load_plugin <plugin_dir\\binary_name> <section_name>\n" );
720  Abc_Print( -2, "\t loads external binary as a plugin\n" );
721  Abc_Print( -2, "\t-h : print the command usage\n");
722  return 1;
723 }
724 
725 ////////////////////////////////////////////////////////////////////////
726 /// END OF FILE ///
727 ////////////////////////////////////////////////////////////////////////
728 
729 
731 
static int * Vec_IntArray(Vec_Int_t *p)
Definition: vecInt.h:328
void Gia_ManCreateRefs(Gia_Man_t *p)
Definition: giaUtil.c:715
int Util_SignalTmpFile(const char *prefix, const char *suffix, char **out_name)
INCLUDES ///.
Definition: utilSignal.c:53
int Cmd_CommandAbcLoadPlugIn(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: cmdPlugin.c:642
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static char * Vec_StrArray(Vec_Str_t *p)
Definition: vecStr.h:272
Gia_Man_t * Gia_AigerReadFromMemory(char *pContents, int nFileSize, int fSkipStrash, int fCheck)
Definition: giaAiger.c:176
Gia_Man_t * Abc_ManReadAig(char *pFileName, char *pToken)
Definition: cmdPlugin.c:359
int Cmd_CommandAbcPlugIn(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: cmdPlugin.c:412
int Abc_ManReadStatus(char *pFileName, char *pToken)
Definition: cmdPlugin.c:254
static int Gia_ObjRefNum(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:521
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
void Cmd_CommandAdd(Abc_Frame_t *pAbc, const char *sGroup, const char *sName, Cmd_CommandFuncType pFunc, int fChanges)
Definition: cmdApi.c:63
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
static Vec_Str_t * Vec_StrAlloc(int nCap)
Definition: bblif.c:495
static abctime Abc_Clock()
Definition: abc_global.h:279
static void Vec_StrPush(Vec_Str_t *p, char Entry)
Definition: vecStr.h:535
int * pRefs
Definition: gia.h:114
Definition: gia.h:75
int Gia_ManFindFailedPoCex(Gia_Man_t *pAig, Abc_Cex_t *p, int nOutputs)
Definition: giaCex.c:87
void Gia_ManStopP(Gia_Man_t **p)
Definition: giaMan.c:177
char * Extra_UtilStrsav(const char *s)
int strcmp()
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
Vec_Str_t * Abc_ManReadFile(char *pFileName)
Definition: cmdPlugin.c:155
static unsigned textToBin(char *text, unsigned long text_sz)
Definition: cmdPlugin.c:330
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
Vec_Int_t * Abc_ManReadBinary(char *pFileName, char *pToken)
Definition: cmdPlugin.c:185
static void Vec_StrAppend(Vec_Str_t *p, const char *pString)
Definition: vecStr.h:645
Vec_Int_t * Abc_ManExpandCex(Gia_Man_t *pGia, Vec_Int_t *vCex)
Definition: cmdPlugin.c:286
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
void Util_SignalTmpFileRemove(const char *fname, int fLeave)
Definition: utilSignal.c:58
char * strstr()
int Extra_FileSize(char *pFileName)
static void Vec_StrFree(Vec_Str_t *p)
Definition: bblif.c:616
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
char * sprintf()
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
int Abc_ManReadInteger(char *pFileName, char *pToken)
Definition: cmdPlugin.c:227
#define Gia_ManForEachPi(p, pObj, i)
Definition: gia.h:1034
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact)
Definition: giaAiger.c:1024
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define ABC_FREE(obj)
Definition: abc_global.h:232
Definition: gia.h:95
int strncmp()
#define Gia_ManForEachRo(p, pObj, i)
Definition: gia.h:1038
#define assert(ex)
Definition: util_old.h:213
int strlen()
ABC_NAMESPACE_IMPL_START int Util_SignalSystem(const char *cmd)
DECLARATIONS ///.
Definition: utilSignal.c:46
ABC_NAMESPACE_IMPL_START char * Abc_GetBinaryName(Abc_Frame_t *pAbc, int argc, char **argv)
DECLARATIONS ///.
Definition: cmdPlugin.c:130
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
ABC_INT64_T abctime
Definition: abc_global.h:278
Abc_Cex_t * Abc_CexCreate(int nRegs, int nPis, int *pArray, int iFrame, int iPo, int fSkipRegs)
Definition: utilCex.c:110
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387