summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2009-04-13 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2009-04-13 08:01:00 -0700
commit77fab468ad32d15de5c065c211f6f74371670940 (patch)
tree2a39a0480942bb597048513f72b2a23b0fcacde8 /src/base
parentccd1b57264d3bf1514410747cdcf6e4731ac7f2a (diff)
downloadabc-77fab468ad32d15de5c065c211f6f74371670940.tar.gz
abc-77fab468ad32d15de5c065c211f6f74371670940.tar.bz2
abc-77fab468ad32d15de5c065c211f6f74371670940.zip
Version abc90413
Diffstat (limited to 'src/base')
-rw-r--r--src/base/abci/abc.c39
-rw-r--r--src/base/abci/abcXsim.c9
-rw-r--r--src/base/io/ioReadBlifMv.c3
3 files changed, 37 insertions, 14 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 8ac8b241..6beaf144 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -2575,7 +2575,7 @@ int Abc_CommandStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
}
if ( fComplOuts )
- Abc_NtkForEachCo( pNtkRes, pObj, c )
+ Abc_NtkForEachPo( pNtkRes, pObj, c )
Abc_ObjXorFaninC( pObj, 0 );
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
@@ -14914,8 +14914,9 @@ int Abc_CommandCycle( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Ntk_t * pNtk;
int c;
int nFrames;
+ int fUseXval;
int fVerbose;
- extern void Abc_NtkCycleInitState( Abc_Ntk_t * pNtk, int nFrames, int fVerbose );
+ extern void Abc_NtkCycleInitState( Abc_Ntk_t * pNtk, int nFrames, int fUseXval, int fVerbose );
extern void Abc_NtkCycleInitStateSop( Abc_Ntk_t * pNtk, int nFrames, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
@@ -14924,9 +14925,10 @@ int Abc_CommandCycle( Abc_Frame_t * pAbc, int argc, char ** argv )
// set defaults
nFrames = 100;
+ fUseXval = 0;
fVerbose = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "Fvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "Fxvh" ) ) != EOF )
{
switch ( c )
{
@@ -14941,6 +14943,9 @@ int Abc_CommandCycle( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( nFrames < 0 )
goto usage;
break;
+ case 'x':
+ fUseXval ^= 1;
+ break;
case 'v':
fVerbose ^= 1;
break;
@@ -14966,18 +14971,25 @@ int Abc_CommandCycle( Abc_Frame_t * pAbc, int argc, char ** argv )
fprintf( pErr, "The network is combinational.\n" );
return 0;
}
-
- if ( Abc_NtkIsStrash(pNtk) )
- Abc_NtkCycleInitState( pNtk, nFrames, fVerbose );
+ if ( fUseXval && !Abc_NtkIsStrash(pNtk) )
+ {
+ fprintf( pErr, "X-valued simulation only works for AIGs. Run \"strash\".\n" );
+ return 0;
+ }
+ if ( fUseXval )
+ Abc_NtkCycleInitState( pNtk, nFrames, 1, fVerbose );
+ else if ( Abc_NtkIsStrash(pNtk) )
+ Abc_NtkCycleInitState( pNtk, nFrames, 0, fVerbose );
else
Abc_NtkCycleInitStateSop( pNtk, nFrames, fVerbose );
return 0;
usage:
- fprintf( pErr, "usage: cycle [-F num] [-vh]\n" );
- fprintf( pErr, "\t cycles sequiential circuit for the given number of timeframes\n" );
+ fprintf( pErr, "usage: cycle [-F num] [-xvh]\n" );
+ fprintf( pErr, "\t cycles sequential circuit for the given number of timeframes\n" );
fprintf( pErr, "\t to derive a new initial state (which may be on the envelope)\n" );
fprintf( pErr, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
+ fprintf( pErr, "\t-x : use x-valued primary inputs [default = %s]\n", fUseXval? "yes": "no" );
fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
fprintf( pErr, "\t-h : print the command usage\n");
return 1;
@@ -16090,6 +16102,14 @@ int Abc_CommandDCec( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
}
+ if ( Abc_NtkLatchNum(pNtk1) || Abc_NtkLatchNum(pNtk2) )
+ {
+ if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+ if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+ printf( "Currently this command only works for networks without latches. Run \"comb\".\n" );
+ return 1;
+ }
+
// perform equivalence checking
if ( fSat && fMiter )
Abc_NtkDSat( pNtk1, nConfLimit, nInsLimit, 0, 0, fVerbose );
@@ -21934,6 +21954,7 @@ int Abc_CommandAbc9Put( Abc_Frame_t * pAbc, int argc, char ** argv )
{
pMan = Gia_ManToAig( pAbc->pAig, 0 );
pNtk = Abc_NtkFromAigPhase( pMan );
+ pNtk->pName = Extra_UtilStrsav(pMan->pName);
Aig_ManStop( pMan );
}
else
@@ -23059,7 +23080,7 @@ usage:
fprintf( stdout, "usage: &frames [-FL <num>] [-ivh]\n" );
fprintf( stdout, "\t unrolls the design for several timeframes\n" );
fprintf( stdout, "\t-F num : the number of frames to unroll [default = %d]\n", pPars->nFrames );
- fprintf( stdout, "\t-L num : the limit on fanout count of resets/enables to cofactor [default = %d]\n", nCofFanLit? "yes": "no" );
+ fprintf( stdout, "\t-L num : the limit on fanout count of resets/enables to cofactor [default = %d]\n", nCofFanLit );
fprintf( stdout, "\t-i : toggle initializing registers [default = %s]\n", pPars->fInit? "yes": "no" );
fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
fprintf( stdout, "\t-h : print the command usage\n");
diff --git a/src/base/abci/abcXsim.c b/src/base/abci/abcXsim.c
index e63b296a..76a82b51 100644
--- a/src/base/abci/abcXsim.c
+++ b/src/base/abci/abcXsim.c
@@ -181,15 +181,15 @@ void Abc_NtkXValueSimulate( Abc_Ntk_t * pNtk, int nFrames, int fXInputs, int fXS
Synopsis [Cycles the circuit to create a new initial state.]
- Description [Simulates the circuit with random input for the given
- number of timeframes to get a better initial state.]
+ Description [Simulates the circuit with random (or ternary) input
+ for the given number of timeframes to get a better initial state.]
SideEffects []
SeeAlso []
***********************************************************************/
-void Abc_NtkCycleInitState( Abc_Ntk_t * pNtk, int nFrames, int fVerbose )
+void Abc_NtkCycleInitState( Abc_Ntk_t * pNtk, int nFrames, int fUseXval, int fVerbose )
{
Abc_Obj_t * pObj;
int i, f;
@@ -198,13 +198,12 @@ void Abc_NtkCycleInitState( Abc_Ntk_t * pNtk, int nFrames, int fVerbose )
// initialize the values
Abc_ObjSetXsim( Abc_AigConst1(pNtk), XVS1 );
Abc_NtkForEachLatch( pNtk, pObj, i )
-// Abc_ObjSetXsim( Abc_ObjFanout0(pObj), Abc_LatchIsInit1(pObj)? XVS1 : XVS0 );
Abc_ObjSetXsim( Abc_ObjFanout0(pObj), Abc_LatchInit(pObj) );
// simulate for the given number of timeframes
for ( f = 0; f < nFrames; f++ )
{
Abc_NtkForEachPi( pNtk, pObj, i )
- Abc_ObjSetXsim( pObj, Abc_XsimRand2() );
+ Abc_ObjSetXsim( pObj, fUseXval? ABC_INIT_DC : Abc_XsimRand2() );
Abc_AigForEachAnd( pNtk, pObj, i )
Abc_ObjSetXsim( pObj, Abc_XsimAnd(Abc_ObjGetXsimFanin0(pObj), Abc_ObjGetXsimFanin1(pObj)) );
Abc_NtkForEachCo( pNtk, pObj, i )
diff --git a/src/base/io/ioReadBlifMv.c b/src/base/io/ioReadBlifMv.c
index eea601a8..95e7cd1d 100644
--- a/src/base/io/ioReadBlifMv.c
+++ b/src/base/io/ioReadBlifMv.c
@@ -941,6 +941,9 @@ static int Io_MvParseLineLatch( Io_MvMod_t * p, char * pLine )
Abc_LatchSetInit0( pObj );
else
{
+ if ( Vec_PtrSize(vTokens) > 6 )
+ printf( "Warning: Line %d has .latch directive with unrecognized entries (the total of %d entries).\n",
+ Io_MvGetLine(p->pMan, pToken), Vec_PtrSize(vTokens) );
if ( Vec_PtrSize(vTokens) > 3 )
Init = atoi( Vec_PtrEntryLast(vTokens) );
else