74 fprintf( pAbc->Err,
"Cmd warning: redefining '%s'\n", sName );
82 pCommand->pFunc = pFunc;
83 pCommand->fChange = fChanges;
84 fStatus =
st__insert( pAbc->tCommands, pCommand->sName, (
char *)pCommand );
102 int piCountNew = (pNtk && Abc_NtkHasMapping(pNtk)) ? Abc_NtkCiNum(pNtk) : 0, piCount = 0;
103 int poCountNew = (pNtk && Abc_NtkHasMapping(pNtk)) ? Abc_NtkCoNum(pNtk) : 0, poCount = 0;
104 int ndCountNew = (pNtk && Abc_NtkHasMapping(pNtk)) ? Abc_NtkNodeNum(pNtk) : 0, ndCount = 0;
106 int DepthNew = (pNtk && Abc_NtkHasMapping(pNtk)) ?
Abc_NtkLevel(pNtk) : 0, Depth = 0;
107 if (
strstr(sCommand,
"#PS") )
109 printf(
"pi=%d ", piCountNew );
110 printf(
"po=%d ", poCountNew );
111 printf(
"fn=%d ", ndCountNew );
112 printf(
"ma=%.1f ", AreaNew );
113 printf(
"de=%d ", DepthNew );
117 if (
strstr(sCommand,
"#CEC") )
122 printf(
"proofStatus=%d\n", proofStatus );
125 if (
strstr(sCommand,
"#ASSERT") )
128 char * pNumb =
strrchr( (
char *)sCommand,
'=' );
129 if (
strstr(sCommand,
"_PI_") )
131 piCount = pNumb ? atoi(pNumb+1) : 0;
132 if (
strstr( sCommand,
"==" ) )
133 Status = piCountNew == piCount;
134 else if (
strstr( sCommand,
"<=" ) )
135 Status = piCountNew <= piCount;
138 else if (
strstr(sCommand,
"_PO_") )
140 poCount = pNumb ? atoi(pNumb+1) : 0;
141 if (
strstr( sCommand,
"==" ) )
142 Status = poCountNew == poCount;
143 else if (
strstr( sCommand,
"<=" ) )
144 Status = poCountNew <= poCount;
147 else if (
strstr(sCommand,
"_NODE_") )
149 ndCount = pNumb ? atoi(pNumb+1) : 0;
150 if (
strstr( sCommand,
"==" ) )
151 Status = ndCountNew == ndCount;
152 else if (
strstr( sCommand,
"<=" ) )
153 Status = ndCountNew <= ndCount;
156 else if (
strstr(sCommand,
"_AREA_") )
158 double Eplison = 1.0;
159 Area = pNumb ?
atof(pNumb+1) : 0;
160 if (
strstr( sCommand,
"==" ) )
161 Status = AreaNew >= Area - Eplison && AreaNew <= Area + Eplison;
162 else if (
strstr( sCommand,
"<=" ) )
163 Status = AreaNew <= Area + Eplison;
166 else if (
strstr(sCommand,
"_DEPTH_") )
168 Depth = pNumb ? atoi(pNumb+1) : 0;
169 if (
strstr( sCommand,
"==" ) )
170 Status = DepthNew == Depth;
171 else if (
strstr( sCommand,
"<=" ) )
172 Status = DepthNew <= Depth;
176 printf(
"%s\n", Status ?
"succeeded" :
"failed" );
195 int fStatus = 0, argc, loop;
196 const char * sCommandNext;
199 if ( !pAbc->fAutoexac && !pAbc->fSource )
201 sCommandNext = sCommand;
206 sCommandNext =
CmdSplitLine( pAbc, sCommandNext, &argc, &argv );
213 while ( fStatus == 0 && *sCommandNext !=
'\0' );
ABC_DLL double Abc_NtkGetMappedArea(Abc_Ntk_t *pNtk)
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
#define ABC_ALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
ABC_NAMESPACE_IMPL_START typedef signed char value
int Cmd_CommandExecute(Abc_Frame_t *pAbc, const char *sCommand)
void Cmd_CommandAdd(Abc_Frame_t *pAbc, const char *sGroup, const char *sName, Cmd_CommandFuncType pFunc, int fChanges)
ABC_NAMESPACE_IMPL_START int Cmd_CommandIsDefined(Abc_Frame_t *pAbc, const char *sName)
DECLARATIONS ///.
int Cmd_CommandHandleSpecial(Abc_Frame_t *pAbc, const char *sCommand)
void CmdCommandFree(Abc_Command *pCommand)
int CmdCommandDispatch(Abc_Frame_t *pAbc, int *argc, char ***argv)
const char * CmdSplitLine(Abc_Frame_t *pAbc, const char *sCommand, int *argc, char ***argv)
int CmdApplyAlias(Abc_Frame_t *pAbc, int *argc, char ***argv, int *loop)
void CmdFreeArgv(int argc, char **argv)
int(* Cmd_CommandFuncType)(Abc_Frame_t *, int, char **)
typedefABC_NAMESPACE_HEADER_START struct MvCommand Abc_Command
INCLUDES ///.
void Cmd_HistoryAddCommand(Abc_Frame_t *pAbc, const char *command)
FUNCTION DEFINITIONS ///.
int st__delete(st__table *table, const char **keyp, char **value)
int st__insert(st__table *table, const char *key, char *value)
#define st__is_member(table, key)