mirror of
https://github.com/YosysHQ/abc.git
synced 2026-09-08 03:46:07 +02:00
Version abc50905
This commit is contained in:
+58
-7
@@ -110,7 +110,7 @@ int CmdCommandDispatch( Abc_Frame_t * pAbc, int argc, char **argv )
|
||||
// get the backup network if the command is going to change the network
|
||||
if ( pCommand->fChange )
|
||||
{
|
||||
if ( pAbc->pNtkCur )
|
||||
if ( pAbc->pNtkCur && Abc_FrameIsFlagEnabled( "backup" ) )
|
||||
{
|
||||
pNetCopy = Abc_NtkDup( pAbc->pNtkCur );
|
||||
Abc_FrameSetCurrentNetwork( pAbc, pNetCopy );
|
||||
@@ -122,15 +122,10 @@ int CmdCommandDispatch( Abc_Frame_t * pAbc, int argc, char **argv )
|
||||
|
||||
// execute the command
|
||||
clk = util_cpu_time();
|
||||
pFunc = ( int (*)( Abc_Frame_t *, int, char ** ) ) pCommand->pFunc;
|
||||
pFunc = (int (*)(Abc_Frame_t *, int, char **))pCommand->pFunc;
|
||||
fError = (*pFunc)( pAbc, argc, argv );
|
||||
pAbc->TimeCommand += (util_cpu_time() - clk);
|
||||
|
||||
// if ( !fError && pCommand->fChange && pAbc->pNtkCur )
|
||||
// {
|
||||
// Cmd_HistoryAddSnapshot(pAbc, pAbc->pNet);
|
||||
// }
|
||||
|
||||
// automatic execution of arbitrary command after each command
|
||||
// usually this is a passive command ...
|
||||
if ( fError == 0 && !pAbc->fAutoexac )
|
||||
@@ -592,6 +587,62 @@ int CmdCommandPrintCompare( Abc_Command ** ppC1, Abc_Command ** ppC2 )
|
||||
assert( 0 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Comparision function used for sorting commands.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int CmdNamePrintCompare( char ** ppC1, char ** ppC2 )
|
||||
{
|
||||
return strcmp( *ppC1, *ppC2 );
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Comparision function used for sorting commands.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void CmdPrintTable( st_table * tTable, int fAliases )
|
||||
{
|
||||
st_generator * gen;
|
||||
char ** ppNames;
|
||||
char * key, * value;
|
||||
int nNames, i;
|
||||
|
||||
// collect keys in the array
|
||||
ppNames = ALLOC( char *, st_count(tTable) );
|
||||
nNames = 0;
|
||||
st_foreach_item( tTable, gen, &key, &value )
|
||||
ppNames[nNames++] = key;
|
||||
|
||||
// sort array by name
|
||||
qsort( (void *)ppNames, nNames, sizeof(char *),
|
||||
(int (*)(const void *, const void *))CmdNamePrintCompare );
|
||||
|
||||
// print in this order
|
||||
for ( i = 0; i < nNames; i++ )
|
||||
{
|
||||
st_lookup( tTable, ppNames[i], &value );
|
||||
if ( fAliases )
|
||||
CmdCommandAliasPrint( Abc_FrameGetGlobalFrame(), (Abc_Alias *)value );
|
||||
else
|
||||
fprintf( stdout, "%-15s %-15s\n", ppNames[i], value );
|
||||
}
|
||||
free( ppNames );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// END OF FILE ///
|
||||
|
||||
Reference in New Issue
Block a user