Commit 7d5b1c57 by Alan Mishchenko

Restoring constraint manager to read old constraint file by default (use…

Restoring constraint manager to read old constraint file by default (use 'read_constr -n' to read new format).
parent 80773b95
...@@ -1823,13 +1823,17 @@ int Scl_CommandReadConstr( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -1823,13 +1823,17 @@ int Scl_CommandReadConstr( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
FILE * pFile; FILE * pFile;
char * pFileName; char * pFileName;
int fUseNewFormat = 0;
int c, fVerbose = 0; int c, fVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "nvh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
case 'n':
fVerbose ^= 1;
break;
case 'v': case 'v':
fVerbose ^= 1; fVerbose ^= 1;
break; break;
...@@ -1850,25 +1854,29 @@ int Scl_CommandReadConstr( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -1850,25 +1854,29 @@ int Scl_CommandReadConstr( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1; return 1;
} }
fclose( pFile ); fclose( pFile );
// Abc_SclReadTimingConstr( pAbc, pFileName, fVerbose );
if ( pNtk == NULL ) if ( !fUseNewFormat )
{ Abc_SclReadTimingConstr( pAbc, pFileName, fVerbose );
fprintf( pAbc->Err, "There is no current network.\n" ); else
return 1;
}
// input constraint manager
if ( pNtk )
{ {
Scl_Con_t * pCon = Scl_ConRead( pFileName, Abc_NtkNameMan(pNtk, 0), Abc_NtkNameMan(pNtk, 1) ); if ( pNtk == NULL )
if ( pCon ) Scl_ConUpdateMan( pAbc, pCon ); {
fprintf( pAbc->Err, "There is no current network.\n" );
return 1;
}
// input constraint manager
if ( pNtk )
{
Scl_Con_t * pCon = Scl_ConRead( pFileName, Abc_NtkNameMan(pNtk, 0), Abc_NtkNameMan(pNtk, 1) );
if ( pCon ) Scl_ConUpdateMan( pAbc, pCon );
}
} }
return 0; return 0;
usage: usage:
fprintf( pAbc->Err, "usage: read_constr [-vh] <file>\n" ); fprintf( pAbc->Err, "usage: read_constr [-nvh] <file>\n" );
fprintf( pAbc->Err, "\t read file with timing constraints for standard-cell designs\n" ); fprintf( pAbc->Err, "\t read file with timing constraints for standard-cell designs\n" );
fprintf( pAbc->Err, "\t-n : toggle using new constraint file format [default = %s]\n", fUseNewFormat? "yes": "no" );
fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" ); fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" ); fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
fprintf( pAbc->Err, "\t<file> : the name of a file to read\n" ); fprintf( pAbc->Err, "\t<file> : the name of a file to read\n" );
......
...@@ -254,21 +254,21 @@ void Abc_SclReadTimingConstr( Abc_Frame_t * pAbc, char * pFileName, int fVerbose ...@@ -254,21 +254,21 @@ void Abc_SclReadTimingConstr( Abc_Frame_t * pAbc, char * pFileName, int fVerbose
pToken = strtok( Buffer, " \t\r\n" ); pToken = strtok( Buffer, " \t\r\n" );
if ( pToken == NULL ) if ( pToken == NULL )
continue; continue;
// if ( !strcmp(pToken, "set_driving_cell") ) if ( !strcmp(pToken, "set_driving_cell") )
if ( !strcmp(pToken, "default_input_cell") ) // if ( !strcmp(pToken, "default_input_cell") )
{ {
Abc_FrameSetDrivingCell( Abc_UtilStrsav(strtok(NULL, " \t\r\n")) ); Abc_FrameSetDrivingCell( Abc_UtilStrsav(strtok(NULL, " \t\r\n")) );
if ( fVerbose ) if ( fVerbose )
printf( "Setting driving cell to be \"%s\".\n", Abc_FrameReadDrivingCell() ); printf( "Setting driving cell to be \"%s\".\n", Abc_FrameReadDrivingCell() );
} }
// else if ( !strcmp(pToken, "set_load") ) else if ( !strcmp(pToken, "set_load") )
else if ( !strcmp(pToken, "default_output_load") ) // else if ( !strcmp(pToken, "default_output_load") )
{ {
Abc_FrameSetMaxLoad( atof(strtok(NULL, " \t\r\n")) ); Abc_FrameSetMaxLoad( atof(strtok(NULL, " \t\r\n")) );
if ( fVerbose ) if ( fVerbose )
printf( "Setting driving cell to be %f.\n", Abc_FrameReadMaxLoad() ); printf( "Setting driving cell to be %f.\n", Abc_FrameReadMaxLoad() );
} }
// else printf( "Unrecognized token \"%s\".\n", pToken ); else printf( "Unrecognized token \"%s\".\n", pToken );
} }
fclose( pFile ); fclose( pFile );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment