ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cmdAuto.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "misc/util/abc_global.h"
#include "misc/extra/extra.h"
#include "aig/gia/gia.h"
#include "sat/satoko/satoko.h"
Include dependency graph for cmdAuto.c:

Go to the source code of this file.

Macros

#define CMD_AUTO_LINE_MAX   1000
 DECLARATIONS ///.
 
#define CMD_AUTO_ARG_MAX   100
 

Functions

int Gia_ManSatokoCallOne (Gia_Man_t *p, satoko_opts_t *opts, int iOutput)
 
void Cmd_RunAutoTunerPrintOptions (satoko_opts_t *pOpts)
 FUNCTION DEFINITIONS ///.
 
int Cmd_RunAutoTunerEvalSimple (Vec_Ptr_t *vAigs, satoko_opts_t *pOpts)
 
int Cmd_RunAutoTunerEval (Vec_Ptr_t *vAigs, satoko_opts_t *pOpts, int nCores)
 
char * Cmd_DeriveConvertIntoString (int argc, char **argv)
 
satoko_opts_tCmd_DeriveOptionFromSettings (int argc, char **argv)
 
void Cmf_CreateOptions_rec (Vec_Wec_t *vPars, int iPar, char Argv[CMD_AUTO_ARG_MAX][20], int Argc, Vec_Ptr_t *vOpts)
 
Vec_Ptr_tCmf_CreateOptions (Vec_Wec_t *vPars)
 
Vec_Wec_tCmd_ReadParamChoices (char *pConfig)
 
Vec_Ptr_tCmd_ReadFiles (char *pFileList)
 
void Cmd_RunAutoTuner (char *pConfig, char *pFileList, int nCores)
 

Macro Definition Documentation

◆ CMD_AUTO_ARG_MAX

#define CMD_AUTO_ARG_MAX   100

Definition at line 48 of file cmdAuto.c.

◆ CMD_AUTO_LINE_MAX

#define CMD_AUTO_LINE_MAX   1000

DECLARATIONS ///.

CFile****************************************************************

FileName [cmdAuto.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Command processing package.]

Synopsis [Autotuner.]

Author [Alan Mishchenko, Bruno Schmitt]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
cmdAuto.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]

Definition at line 47 of file cmdAuto.c.

Function Documentation

◆ Cmd_DeriveConvertIntoString()

char * Cmd_DeriveConvertIntoString ( int argc,
char ** argv )

Function*************************************************************

Synopsis [Derives all possible param stucts according to the config file.]

Description []

SideEffects []

SeeAlso []

Definition at line 227 of file cmdAuto.c.

228{
229 char pBuffer[CMD_AUTO_LINE_MAX] = {0};
230 int i;
231 for ( i = 0; i < argc; i++ )
232 {
233 strcat( pBuffer, argv[i] );
234 strcat( pBuffer, " " );
235 }
236 return Abc_UtilStrsav(pBuffer);
237}
#define CMD_AUTO_LINE_MAX
DECLARATIONS ///.
Definition cmdAuto.c:47
char * strcat()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cmd_DeriveOptionFromSettings()

satoko_opts_t * Cmd_DeriveOptionFromSettings ( int argc,
char ** argv )

Definition at line 238 of file cmdAuto.c.

239{
240 int c;
241 satoko_opts_t opts, * pOpts;
242 satoko_default_opts(&opts);
244#ifdef SATOKO_ACT_VAR_FIXED
245 while ( ( c = Extra_UtilGetopt( argc, argv, "CPDEFGHIJKLMNOQRSTUhv" ) ) != EOF )
246#else
247 while ( ( c = Extra_UtilGetopt( argc, argv, "CPDEFGHIJKLMNOQRShv" ) ) != EOF )
248#endif
249 {
250 switch ( c )
251 {
252 case 'C':
253 if ( globalUtilOptind >= argc )
254 {
255 Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
256 return NULL;
257 }
258 opts.conf_limit = atoi(argv[globalUtilOptind]);
260 if ( opts.conf_limit < 0 )
261 return NULL;
262 break;
263 case 'P':
264 if ( globalUtilOptind >= argc )
265 {
266 Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
267 return NULL;
268 }
269 opts.prop_limit = atoi(argv[globalUtilOptind]);
271 if ( opts.prop_limit < 0 )
272 return NULL;
273 break;
274 case 'D':
275 if ( globalUtilOptind >= argc )
276 {
277 Abc_Print( -1, "Command line switch \"-D\" should be followed by an float.\n" );
278 return NULL;
279 }
280 opts.f_rst = atof(argv[globalUtilOptind]);
282 if ( opts.f_rst < 0 )
283 return NULL;
284 break;
285 case 'E':
286 if ( globalUtilOptind >= argc )
287 {
288 Abc_Print( -1, "Command line switch \"-E\" should be followed by an float.\n" );
289 return NULL;
290 }
291 opts.b_rst = atof(argv[globalUtilOptind]);
293 if ( opts.b_rst < 0 )
294 return NULL;
295 break;
296 case 'F':
297 if ( globalUtilOptind >= argc )
298 {
299 Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
300 return NULL;
301 }
302 opts.fst_block_rst = (unsigned)atoi(argv[globalUtilOptind]);
304 break;
305 case 'G':
306 if ( globalUtilOptind >= argc )
307 {
308 Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
309 return NULL;
310 }
311 opts.sz_lbd_bqueue = (unsigned)atoi(argv[globalUtilOptind]);
313 break;
314 case 'H':
315 if ( globalUtilOptind >= argc )
316 {
317 Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
318 return NULL;
319 }
320 opts.sz_trail_bqueue = (unsigned)atoi(argv[globalUtilOptind]);
322 break;
323 case 'I':
324 if ( globalUtilOptind >= argc )
325 {
326 Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
327 return NULL;
328 }
329 opts.n_conf_fst_reduce = (unsigned)atoi(argv[globalUtilOptind]);
331 break;
332 case 'J':
333 if ( globalUtilOptind >= argc )
334 {
335 Abc_Print( -1, "Command line switch \"-J\" should be followed by an integer.\n" );
336 return NULL;
337 }
338 opts.inc_reduce = (unsigned)atoi(argv[globalUtilOptind]);
340 break;
341 case 'K':
342 if ( globalUtilOptind >= argc )
343 {
344 Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
345 return NULL;
346 }
347 opts.inc_special_reduce = (unsigned)atoi(argv[globalUtilOptind]);
349 break;
350 case 'L':
351 if ( globalUtilOptind >= argc )
352 {
353 Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
354 return NULL;
355 }
356 opts.lbd_freeze_clause = (unsigned)atoi(argv[globalUtilOptind]);
358 break;
359 case 'M':
360 if ( globalUtilOptind >= argc )
361 {
362 Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
363 return NULL;
364 }
365 opts.learnt_ratio = atof(argv[globalUtilOptind]) / 100;
367 if ( opts.learnt_ratio < 0 )
368 return NULL;
369 break;
370 case 'N':
371 if ( globalUtilOptind >= argc )
372 {
373 Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
374 return NULL;
375 }
376 opts.garbage_max_ratio = atof(argv[globalUtilOptind]) / 100;
378 if ( opts.garbage_max_ratio < 0 )
379 return NULL;
380 break;
381 case 'O':
382 if ( globalUtilOptind >= argc )
383 {
384 Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
385 return NULL;
386 }
387 opts.clause_max_sz_bin_resol = (unsigned)atoi(argv[globalUtilOptind]);
389 break;
390 case 'Q':
391 if ( globalUtilOptind >= argc )
392 {
393 Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
394 return NULL;
395 }
396 opts.clause_min_lbd_bin_resol = (unsigned)atoi(argv[globalUtilOptind]);
398 break;
399 case 'R':
400 if ( globalUtilOptind >= argc )
401 {
402 Abc_Print( -1, "Command line switch \"-R\" should be followed by an float.\n" );
403 return NULL;
404 }
405 opts.clause_decay = atof(argv[globalUtilOptind]);
407 if ( opts.clause_decay < 0 )
408 return NULL;
409 break;
410 case 'S':
411 if ( globalUtilOptind >= argc )
412 {
413 Abc_Print( -1, "Command line switch \"-S\" should be followed by an float.\n" );
414 return NULL;
415 }
416 opts.var_decay = atof(argv[globalUtilOptind]);
418 if ( opts.var_decay < 0 )
419 return NULL;
420 break;
421#ifdef SATOKO_ACT_VAR_FIXED
422 case 'T':
423 if ( globalUtilOptind >= argc )
424 {
425 Abc_Print( -1, "Command line switch \"-T\" should be followed by an float.\n" );
426 return NULL;
427 }
428 opts.var_act_limit = (unsigned)strtol(argv[globalUtilOptind], NULL, 16);
430 break;
431 case 'U':
432 if ( globalUtilOptind >= argc )
433 {
434 Abc_Print( -1, "Command line switch \"-U\" should be followed by an float.\n" );
435 return NULL;
436 }
437 opts.var_act_rescale = (unsigned)strtol(argv[globalUtilOptind], NULL, 16);
439 break;
440#endif
441 case 'h':
442 return NULL;
443 case 'v':
444 opts.verbose ^= 1;
445 break;
446
447 default:
448 return NULL;
449 }
450 }
451 // return a copy of this parameter structure
452 pOpts = ABC_ALLOC( satoko_opts_t, 1 );
453 memcpy( pOpts, &opts, sizeof(satoko_opts_t) );
454 return pOpts;
455}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
int globalUtilOptind
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
ABC_DLL void Extra_UtilGetoptReset()
struct satoko_opts satoko_opts_t
Definition satoko.h:37
void satoko_default_opts(satoko_opts_t *)
Definition solver_api.c:161
unsigned clause_min_lbd_bin_resol
Definition satoko.h:66
double f_rst
Definition satoko.h:44
long prop_limit
Definition satoko.h:41
float garbage_max_ratio
Definition satoko.h:67
act_t var_act_limit
Definition satoko.h:61
double var_decay
Definition satoko.h:58
unsigned sz_lbd_bqueue
Definition satoko.h:47
unsigned fst_block_rst
Definition satoko.h:46
unsigned var_act_rescale
Definition satoko.h:60
unsigned clause_max_sz_bin_resol
Definition satoko.h:65
unsigned inc_reduce
Definition satoko.h:52
float clause_decay
Definition satoko.h:59
unsigned lbd_freeze_clause
Definition satoko.h:54
unsigned sz_trail_bqueue
Definition satoko.h:48
double b_rst
Definition satoko.h:45
unsigned inc_special_reduce
Definition satoko.h:53
char verbose
Definition satoko.h:68
long conf_limit
Definition satoko.h:40
float learnt_ratio
Definition satoko.h:55
unsigned n_conf_fst_reduce
Definition satoko.h:51
char * memcpy()
double atof()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cmd_ReadFiles()

Vec_Ptr_t * Cmd_ReadFiles ( char * pFileList)

Definition at line 595 of file cmdAuto.c.

596{
597 Gia_Man_t * pGia;
598 Vec_Ptr_t * vAigs;
599 char pBuffer[CMD_AUTO_LINE_MAX];
600 FILE * pFile = fopen( pFileList, "rb" );
601 if ( pFile == NULL )
602 { printf( "File containing list of files \"%s\" cannot be opened.\n", pFileList ); return NULL; }
603 vAigs = Vec_PtrAlloc( 100 );
604 while ( fgets( pBuffer, CMD_AUTO_LINE_MAX, pFile ) != NULL )
605 {
606 // get the command from the file
607 if ( Cmf_IsSpace(pBuffer[0]) || pBuffer[0] == '#')
608 continue;
609 // skip trailing spaces
610 while ( Cmf_IsSpace(pBuffer[strlen(pBuffer)-1]) )
611 pBuffer[strlen(pBuffer)-1] = 0;
612 // read the file
613 pGia = Gia_AigerRead( pBuffer, 0, 0, 0 );
614 if ( pGia == NULL )
615 {
616 printf( "Cannot read AIG from file \"%s\".\n", pBuffer );
617 continue;
618 }
619 Vec_PtrPush( vAigs, pGia );
620 }
621 fclose( pFile );
622 return vAigs;
623}
Gia_Man_t * Gia_AigerRead(char *pFileName, int fGiaSimple, int fSkipStrash, int fCheck)
Definition giaAiger.c:1017
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
int strlen()
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cmd_ReadParamChoices()

Vec_Wec_t * Cmd_ReadParamChoices ( char * pConfig)

Definition at line 547 of file cmdAuto.c.

548{
549 Vec_Wec_t * vPars;
550 Vec_Int_t * vLine;
551 char * pThis, pBuffer[CMD_AUTO_LINE_MAX];
552 FILE * pFile = fopen( pConfig, "rb" );
553 if ( pFile == NULL )
554 { printf( "File containing list of files \"%s\" cannot be opened.\n", pConfig ); return NULL; }
555 vPars = Vec_WecAlloc( 100 );
556 while ( fgets( pBuffer, CMD_AUTO_LINE_MAX, pFile ) != NULL )
557 {
558 // get the command from the file
559 if ( Cmf_IsSpace(pBuffer[0]) || pBuffer[0] == '#')
560 continue;
561 // skip trailing spaces
562 while ( Cmf_IsSpace(pBuffer[strlen(pBuffer)-1]) )
563 pBuffer[strlen(pBuffer)-1] = 0;
564 // read the line
565 vLine = Vec_WecPushLevel( vPars );
566 for ( pThis = pBuffer; *pThis; )
567 {
568 if ( Cmf_IsLowerCaseChar(*pThis) )
569 {
570 Vec_IntPushTwo( vLine, (int)*pThis, Abc_Float2Int((float)-1.0) );
571 pThis++;
572 while ( Cmf_IsSpace(*pThis) )
573 pThis++;
574 continue;
575 }
576 if ( Cmf_IsUpperCaseChar(*pThis) )
577 {
578 char Param = *pThis++;
579 if ( !Cmf_IsDigit(*pThis) )
580 { printf( "Upper-case character (%c) should be followed by a number without space in line \"%s\".\n", Param, pBuffer ); return NULL; }
581 Vec_IntPushTwo( vLine, (int)Param, Abc_Float2Int(atof(pThis)) );
582 while ( Cmf_IsDigit(*pThis) )
583 pThis++;
584 while ( Cmf_IsSpace(*pThis) )
585 pThis++;
586 continue;
587 }
588 printf( "Expecting a leading lower-case or upper-case digit in line \"%s\".\n", pBuffer );
589 return NULL;
590 }
591 }
592 fclose( pFile );
593 return vPars;
594}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
Definition vecWec.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cmd_RunAutoTuner()

void Cmd_RunAutoTuner ( char * pConfig,
char * pFileList,
int nCores )

Function*************************************************************

Synopsis [Autotuner for SAT solver "satoko".]

Description []

SideEffects []

SeeAlso []

Definition at line 636 of file cmdAuto.c.

637{
638 abctime clk = Abc_Clock();
639 Vec_Wec_t * vPars = Cmd_ReadParamChoices( pConfig );
640 Vec_Ptr_t * vAigs = Cmd_ReadFiles( pFileList );
641 Vec_Ptr_t * vOpts = vPars ? Cmf_CreateOptions( vPars ) : NULL;
642 int i; char * pString, * pStringBest = NULL;
643 satoko_opts_t * pOpts, * pOptsBest = NULL;
644 int Result, ResultBest = 0x7FFFFFFF;
645 Gia_Man_t * pGia;
646 // iterate through all possible option settings
647 if ( vAigs && vOpts )
648 {
649 Vec_PtrForEachEntryDouble( satoko_opts_t *, char *, vOpts, pOpts, pString, i )
650 {
651 abctime clk = Abc_Clock();
652 printf( "Evaluating settings: %20s... \n", pString );
653 Result = Cmd_RunAutoTunerEval( vAigs, pOpts, nCores );
654 printf( "Cost = %6d. ", Result );
655 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
656 if ( ResultBest > Result )
657 {
658 ResultBest = Result;
659 pStringBest = pString;
660 pOptsBest = pOpts;
661 }
662 }
663 printf( "The best settings are: %20s \n", pStringBest );
664 printf( "Best cost = %6d. ", ResultBest );
665 Abc_PrintTime( 1, "Total time", Abc_Clock() - clk );
666 }
667 // cleanup
668 if ( vPars ) Vec_WecFree( vPars );
669 if ( vOpts ) Vec_PtrFreeFree( vOpts );
670 if ( vAigs )
671 {
672 Vec_PtrForEachEntry( Gia_Man_t *, vAigs, pGia, i )
673 Gia_ManStop( pGia );
674 Vec_PtrFree( vAigs );
675 }
676}
ABC_INT64_T abctime
Definition abc_global.h:332
Vec_Ptr_t * Cmd_ReadFiles(char *pFileList)
Definition cmdAuto.c:595
int Cmd_RunAutoTunerEval(Vec_Ptr_t *vAigs, satoko_opts_t *pOpts, int nCores)
Definition cmdAuto.c:112
Vec_Wec_t * Cmd_ReadParamChoices(char *pConfig)
Definition cmdAuto.c:547
Vec_Ptr_t * Cmf_CreateOptions(Vec_Wec_t *vPars)
Definition cmdAuto.c:506
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
#define Vec_PtrForEachEntryDouble(Type1, Type2, vVec, Entry1, Entry2, i)
Definition vecPtr.h:67
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:

◆ Cmd_RunAutoTunerEval()

int Cmd_RunAutoTunerEval ( Vec_Ptr_t * vAigs,
satoko_opts_t * pOpts,
int nCores )

Function*************************************************************

Synopsis [The main evaluation procedure for the set of AIGs.]

Description []

SideEffects []

SeeAlso []

Definition at line 112 of file cmdAuto.c.

113{
114 return Cmd_RunAutoTunerEvalSimple( vAigs, pOpts );
115}
int Cmd_RunAutoTunerEvalSimple(Vec_Ptr_t *vAigs, satoko_opts_t *pOpts)
Definition cmdAuto.c:88
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cmd_RunAutoTunerEvalSimple()

int Cmd_RunAutoTunerEvalSimple ( Vec_Ptr_t * vAigs,
satoko_opts_t * pOpts )

Function*************************************************************

Synopsis [The main evaluation procedure for an array of AIGs.]

Description []

SideEffects []

SeeAlso []

Definition at line 88 of file cmdAuto.c.

89{
90 Gia_Man_t * pGia;
91 int i, TotalCost = 0;
92 //printf( "Tuning with options: " );
93 //Cmd_RunAutoTunerPrintOptions( pOpts );
94 Vec_PtrForEachEntry( Gia_Man_t *, vAigs, pGia, i )
95 TotalCost += Gia_ManSatokoCallOne( pGia, pOpts, -1 );
96 return TotalCost;
97}
int Gia_ManSatokoCallOne(Gia_Man_t *p, satoko_opts_t *opts, int iOutput)
Definition giaSatoko.c:199
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cmd_RunAutoTunerPrintOptions()

void Cmd_RunAutoTunerPrintOptions ( satoko_opts_t * pOpts)

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Printing option structure.]

Description []

SideEffects []

SeeAlso []

Definition at line 67 of file cmdAuto.c.

68{
69 printf( "-C %d ", (int)pOpts->conf_limit );
70 printf( "-V %.3f ", (float)pOpts->var_decay );
71 printf( "-W %.3f ", (float)pOpts->clause_decay );
72 if ( pOpts->verbose )
73 printf( "-v" );
74 printf( "\n" );
75}

◆ Cmf_CreateOptions()

Vec_Ptr_t * Cmf_CreateOptions ( Vec_Wec_t * vPars)

Definition at line 506 of file cmdAuto.c.

507{
508 char Argv[CMD_AUTO_ARG_MAX][20];
509 int Symb, Num, i, Argc = 0;
510 Vec_Ptr_t * vOpts = Vec_PtrAlloc( 100 );
511 Vec_Int_t * vLine = Vec_WecEntry( vPars, 0 );
512 printf( "Creating all possible settings to be used by the autotuner:\n" );
513 sprintf( Argv[Argc++], "autotuner" );
514 Vec_IntForEachEntryDouble( vLine, Symb, Num, i )
515 {
516 float NumF = Abc_Int2Float(Num);
517 sprintf( Argv[Argc++], "-%c", Symb );
518 if ( NumF < 0.0 )
519 continue;
520 if ( NumF == (float)(int)NumF )
521 sprintf( Argv[Argc++], "%d", (int)NumF );
522 else
523 sprintf( Argv[Argc++], "%.3f", NumF );
524 }
525 Cmf_CreateOptions_rec( vPars, 1, Argv, Argc, vOpts );
526 printf( "Finished creating %d settings.\n\n", Vec_PtrSize(vOpts)/2 );
527 return vOpts;
528}
#define CMD_AUTO_ARG_MAX
Definition cmdAuto.c:48
void Cmf_CreateOptions_rec(Vec_Wec_t *vPars, int iPar, char Argv[CMD_AUTO_ARG_MAX][20], int Argc, Vec_Ptr_t *vOpts)
Definition cmdAuto.c:456
char * sprintf()
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
Definition vecInt.h:72
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cmf_CreateOptions_rec()

void Cmf_CreateOptions_rec ( Vec_Wec_t * vPars,
int iPar,
char Argv[CMD_AUTO_ARG_MAX][20],
int Argc,
Vec_Ptr_t * vOpts )

Definition at line 456 of file cmdAuto.c.

457{
458 Vec_Int_t * vLine;
459 int Symb, Num, i;
460 assert( Argc <= CMD_AUTO_ARG_MAX );
461 if ( Vec_WecSize(vPars) == iPar )
462 {
463 satoko_opts_t * pOpts;
464 char * pArgv[CMD_AUTO_ARG_MAX];
465 for ( i = 0; i < Argc; i++ )
466 pArgv[i] = Argv[i];
467 pOpts = Cmd_DeriveOptionFromSettings( Argc, pArgv );
468 if ( pOpts == NULL )
469 printf( "Cannot parse command line options...\n" );
470 else
471 {
472 Vec_PtrPush( vOpts, pOpts );
473 Vec_PtrPush( vOpts, Cmd_DeriveConvertIntoString(Argc, pArgv) );
474 printf( "Adding settings %s\n", (char *)Vec_PtrEntryLast(vOpts) );
475 }
476 return;
477 }
478 vLine = Vec_WecEntry( vPars, iPar );
479 // consider binary option
480 if ( Vec_IntSize(vLine) == 2 )
481 {
482 Symb = Vec_IntEntry( vLine, 0 );
483 Num = Vec_IntEntry( vLine, 1 );
484 assert( Abc_Int2Float(Num) == -1.0 );
485 // create one setting without this option
486 Cmf_CreateOptions_rec( vPars, iPar+1, Argv, Argc, vOpts );
487 // create another setting with this option
488 sprintf( Argv[Argc], "-%c", Symb );
489 Cmf_CreateOptions_rec( vPars, iPar+1, Argv, Argc+1, vOpts );
490 return;
491 }
492 // consider numeric option
493 Vec_IntForEachEntryDouble( vLine, Symb, Num, i )
494 {
495 float NumF = Abc_Int2Float(Num);
496 // create setting with this option
497 assert( NumF >= 0 );
498 sprintf( Argv[Argc], "-%c", Symb );
499 if ( NumF == (float)(int)NumF )
500 sprintf( Argv[Argc+1], "%d", (int)NumF );
501 else
502 sprintf( Argv[Argc+1], "%.3f", NumF );
503 Cmf_CreateOptions_rec( vPars, iPar+1, Argv, Argc+2, vOpts );
504 }
505}
satoko_opts_t * Cmd_DeriveOptionFromSettings(int argc, char **argv)
Definition cmdAuto.c:238
char * Cmd_DeriveConvertIntoString(int argc, char **argv)
Definition cmdAuto.c:227
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManSatokoCallOne()

int Gia_ManSatokoCallOne ( Gia_Man_t * p,
satoko_opts_t * opts,
int iOutput )
extern

Definition at line 199 of file giaSatoko.c.

200{
201 abctime clk = Abc_Clock();
202 satoko_t * pSat;
203 int status = SATOKO_UNSAT, Cost = 0;
204 pSat = Gia_ManSatokoCreate( p, opts );
205 if ( pSat )
206 {
207 status = satoko_solve( pSat );
208 Cost = satoko_stats(pSat)->n_conflicts;
209 satoko_destroy( pSat );
210 }
211 Gia_ManSatokoReport( iOutput, status, Abc_Clock() - clk );
212 return Cost;
213}
Cube * p
Definition exorList.c:222
satoko_t * Gia_ManSatokoCreate(Gia_Man_t *p, satoko_opts_t *opts)
Definition giaSatoko.c:188
void Gia_ManSatokoReport(int iOutput, int status, abctime clk)
Definition giaSatoko.c:83
int satoko_solve(satoko_t *)
Definition solver_api.c:314
@ SATOKO_UNSAT
Definition satoko.h:25
struct solver_t_ satoko_t
Definition satoko.h:35
void satoko_destroy(satoko_t *)
Definition solver_api.c:132
satoko_stats_t * satoko_stats(satoko_t *)
Definition solver_api.c:433
long n_conflicts
Definition satoko.h:81
Here is the call graph for this function:
Here is the caller graph for this function: