Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
fa5f05e3
Commit
fa5f05e3
authored
Oct 03, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deriving AIG after cell mapping.
parent
3f31a858
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
2 deletions
+69
-2
src/aig/gia/giaIf.c
+29
-0
src/base/cmd/cmd.c
+28
-1
src/base/io/ioReadBlifMv.c
+1
-1
src/map/if/if.h
+2
-0
src/map/if/ifTune.c
+9
-0
No files found.
src/aig/gia/giaIf.c
View file @
fa5f05e3
...
@@ -1425,6 +1425,22 @@ int Gia_ManFromIfLogicFindLut( If_Man_t * pIfMan, Gia_Man_t * pNew, If_Cut_t * p
...
@@ -1425,6 +1425,22 @@ int Gia_ManFromIfLogicFindLut( If_Man_t * pIfMan, Gia_Man_t * pNew, If_Cut_t * p
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
int
Gia_ManFromIfLogicFindCell
(
If_Man_t
*
pIfMan
,
Gia_Man_t
*
pNew
,
If_Cut_t
*
pCutBest
,
sat_solver
*
pSat
,
Vec_Int_t
*
vPiVars
,
Vec_Int_t
*
vPoVars
,
void
*
pNtkCell
,
Vec_Int_t
*
vLeaves
,
Vec_Int_t
*
vLits
,
Vec_Int_t
*
vCover
,
Vec_Int_t
*
vMapping
,
Vec_Int_t
*
vMapping2
,
Vec_Int_t
*
vPacking
)
{
return
0
;
}
/**Function*************************************************************
Synopsis [Converts IF into GIA manager.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Gia_Man_t
*
Gia_ManFromIfLogic
(
If_Man_t
*
pIfMan
)
Gia_Man_t
*
Gia_ManFromIfLogic
(
If_Man_t
*
pIfMan
)
{
{
Gia_Man_t
*
pNew
;
Gia_Man_t
*
pNew
;
...
@@ -1432,7 +1448,9 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
...
@@ -1432,7 +1448,9 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
If_Obj_t
*
pIfObj
,
*
pIfLeaf
;
If_Obj_t
*
pIfObj
,
*
pIfLeaf
;
Vec_Int_t
*
vMapping
,
*
vMapping2
,
*
vPacking
=
NULL
;
Vec_Int_t
*
vMapping
,
*
vMapping2
,
*
vPacking
=
NULL
;
Vec_Int_t
*
vLeaves
,
*
vLeaves2
,
*
vCover
,
*
vLits
;
Vec_Int_t
*
vLeaves
,
*
vLeaves2
,
*
vCover
,
*
vLits
;
Vec_Int_t
*
vPiVars
=
NULL
,
*
vPoVars
=
NULL
;
sat_solver
*
pSat
=
NULL
;
sat_solver
*
pSat
=
NULL
;
void
*
pNtkCell
=
NULL
;
int
i
,
k
,
Entry
;
int
i
,
k
,
Entry
;
assert
(
!
pIfMan
->
pPars
->
fDeriveLuts
||
pIfMan
->
pPars
->
fTruth
);
assert
(
!
pIfMan
->
pPars
->
fDeriveLuts
||
pIfMan
->
pPars
->
fTruth
);
// if ( pIfMan->pPars->fEnableCheck07 )
// if ( pIfMan->pPars->fEnableCheck07 )
...
@@ -1478,6 +1496,13 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
...
@@ -1478,6 +1496,13 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
pIfObj
->
iCopy
=
Gia_ManFromIfLogicCreateLut
(
pNew
,
If_CutTruthW
(
pIfMan
,
pCutBest
),
vLeaves
,
vCover
,
vMapping
,
vMapping2
);
pIfObj
->
iCopy
=
Gia_ManFromIfLogicCreateLut
(
pNew
,
If_CutTruthW
(
pIfMan
,
pCutBest
),
vLeaves
,
vCover
,
vMapping
,
vMapping2
);
pIfObj
->
iCopy
=
Abc_LitNotCond
(
pIfObj
->
iCopy
,
pCutBest
->
fCompl
);
pIfObj
->
iCopy
=
Abc_LitNotCond
(
pIfObj
->
iCopy
,
pCutBest
->
fCompl
);
}
}
else
if
(
pIfMan
->
pPars
->
fUseDsd
&&
pIfMan
->
pPars
->
fUseDsdTune
&&
pIfMan
->
pPars
->
fDeriveLuts
)
{
if
(
pSat
==
NULL
)
pSat
=
(
sat_solver
*
)
If_ManSatBuildFromCell
(
NULL
,
&
vPiVars
,
&
vPoVars
,
(
void
**
)
&
pNtkCell
);
pIfObj
->
iCopy
=
Gia_ManFromIfLogicFindCell
(
pIfMan
,
pNew
,
pCutBest
,
pSat
,
vPiVars
,
vPoVars
,
pNtkCell
,
vLeaves
,
vLits
,
vCover
,
vMapping
,
vMapping2
,
vPacking
);
pIfObj
->
iCopy
=
Abc_LitNotCond
(
pIfObj
->
iCopy
,
pCutBest
->
fCompl
);
}
else
if
(
(
pIfMan
->
pPars
->
fDeriveLuts
&&
pIfMan
->
pPars
->
fTruth
)
||
pIfMan
->
pPars
->
fUseDsd
||
pIfMan
->
pPars
->
fUseTtPerm
)
else
if
(
(
pIfMan
->
pPars
->
fDeriveLuts
&&
pIfMan
->
pPars
->
fTruth
)
||
pIfMan
->
pPars
->
fUseDsd
||
pIfMan
->
pPars
->
fUseTtPerm
)
{
{
word
*
pTruth
=
If_CutTruthW
(
pIfMan
,
pCutBest
);
word
*
pTruth
=
If_CutTruthW
(
pIfMan
,
pCutBest
);
...
@@ -1520,6 +1545,10 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
...
@@ -1520,6 +1545,10 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
Vec_IntFree
(
vCover
);
Vec_IntFree
(
vCover
);
Vec_IntFree
(
vLeaves
);
Vec_IntFree
(
vLeaves
);
Vec_IntFree
(
vLeaves2
);
Vec_IntFree
(
vLeaves2
);
Vec_IntFreeP
(
&
vPiVars
);
Vec_IntFreeP
(
&
vPoVars
);
if
(
pNtkCell
)
ABC_FREE
(
pNtkCell
);
if
(
pSat
!=
NULL
)
if
(
pSat
!=
NULL
)
sat_solver_delete
(
pSat
);
sat_solver_delete
(
pSat
);
// printf( "Mapping array size: IfMan = %d. Gia = %d. Increase = %.2f\n",
// printf( "Mapping array size: IfMan = %d. Gia = %d. Increase = %.2f\n",
...
...
src/base/cmd/cmd.c
View file @
fa5f05e3
...
@@ -1319,6 +1319,32 @@ int CmfFindNumber( char * pName )
...
@@ -1319,6 +1319,32 @@ int CmfFindNumber( char * pName )
/**Function*************************************************************
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
CnfDupFileUnzip
(
char
*
pOldName
)
{
extern
char
*
Io_MvLoadFileBz2
(
char
*
pFileName
,
int
*
pnFileSize
);
char
pNewName
[
1000
];
FILE
*
pFile
;
int
nFileSize
;
char
*
pBuffer
=
Io_MvLoadFileBz2
(
pOldName
,
&
nFileSize
);
assert
(
strlen
(
pOldName
)
<
1000
);
sprintf
(
pNewName
,
"%s.v"
,
pOldName
);
pFile
=
fopen
(
pNewName
,
"wb"
);
fwrite
(
pBuffer
,
nFileSize
,
1
,
pFile
);
fclose
(
pFile
);
ABC_FREE
(
pBuffer
);
}
/**Function*************************************************************
Synopsis [Command to print the contents of the current directory (Windows).]
Synopsis [Command to print the contents of the current directory (Windows).]
Description []
Description []
...
@@ -1446,8 +1472,9 @@ int CmdCommandRenameFiles( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -1446,8 +1472,9 @@ int CmdCommandRenameFiles( Abc_Frame_t * pAbc, int argc, char **argv )
{
{
pOldName
=
(
char
*
)
Vec_PtrEntry
(
vNames
,
pOrder
[
i
]
);
pOldName
=
(
char
*
)
Vec_PtrEntry
(
vNames
,
pOrder
[
i
]
);
sprintf
(
pNewName
,
"%s%0*d.%s"
,
pNameNew
?
pNameNew
:
""
,
nDigits
,
nBase
+
Vec_IntEntry
(
vNums
,
pOrder
[
i
]),
pNameExt
);
sprintf
(
pNewName
,
"%s%0*d.%s"
,
pNameNew
?
pNameNew
:
""
,
nDigits
,
nBase
+
Vec_IntEntry
(
vNums
,
pOrder
[
i
]),
pNameExt
);
printf
(
"%s -> %s
\n
"
,
pOldName
,
pNewName
);
rename
(
pOldName
,
pNewName
);
rename
(
pOldName
,
pNewName
);
printf
(
"%s -> %s
\n
"
,
pOldName
,
pNewName
);
// CnfDupFileUnzip( pOldName );
}
}
// cleanup
// cleanup
Vec_PtrFreeFree
(
vNames
);
Vec_PtrFreeFree
(
vNames
);
...
...
src/base/io/ioReadBlifMv.c
View file @
fa5f05e3
...
@@ -548,7 +548,7 @@ typedef struct buflist {
...
@@ -548,7 +548,7 @@ typedef struct buflist {
struct
buflist
*
next
;
struct
buflist
*
next
;
}
buflist
;
}
buflist
;
static
char
*
Io_MvLoadFileBz2
(
char
*
pFileName
,
int
*
pnFileSize
)
char
*
Io_MvLoadFileBz2
(
char
*
pFileName
,
int
*
pnFileSize
)
{
{
FILE
*
pFile
;
FILE
*
pFile
;
int
nFileSize
=
0
;
int
nFileSize
=
0
;
...
...
src/map/if/if.h
View file @
fa5f05e3
...
@@ -623,6 +623,8 @@ extern void If_ManComputeRequired( If_Man_t * p );
...
@@ -623,6 +623,8 @@ extern void If_ManComputeRequired( If_Man_t * p );
extern
void
If_CutRotatePins
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
);
extern
void
If_CutRotatePins
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
);
extern
int
If_CutComputeTruth
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
,
If_Cut_t
*
pCut0
,
If_Cut_t
*
pCut1
,
int
fCompl0
,
int
fCompl1
);
extern
int
If_CutComputeTruth
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
,
If_Cut_t
*
pCut0
,
If_Cut_t
*
pCut1
,
int
fCompl0
,
int
fCompl1
);
extern
int
If_CutComputeTruthPerm
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
,
If_Cut_t
*
pCut0
,
If_Cut_t
*
pCut1
,
int
fCompl0
,
int
fCompl1
);
extern
int
If_CutComputeTruthPerm
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
,
If_Cut_t
*
pCut0
,
If_Cut_t
*
pCut1
,
int
fCompl0
,
int
fCompl1
);
/*=== ifTune.c ===========================================================*/
extern
void
*
If_ManSatBuildFromCell
(
char
*
pStr
,
Vec_Int_t
**
pvPiVars
,
Vec_Int_t
**
pvPoVars
,
void
**
ppNtk
);
/*=== ifUtil.c ============================================================*/
/*=== ifUtil.c ============================================================*/
extern
void
If_ManCleanNodeCopy
(
If_Man_t
*
p
);
extern
void
If_ManCleanNodeCopy
(
If_Man_t
*
p
);
extern
void
If_ManCleanCutData
(
If_Man_t
*
p
);
extern
void
If_ManCleanCutData
(
If_Man_t
*
p
);
...
...
src/map/if/ifTune.c
View file @
fa5f05e3
...
@@ -621,6 +621,15 @@ sat_solver * Ifn_ManSatBuild( Ifn_Ntk_t * p, Vec_Int_t ** pvPiVars, Vec_Int_t **
...
@@ -621,6 +621,15 @@ sat_solver * Ifn_ManSatBuild( Ifn_Ntk_t * p, Vec_Int_t ** pvPiVars, Vec_Int_t **
Gia_ManStop
(
p2
);
Gia_ManStop
(
p2
);
return
pSat
;
return
pSat
;
}
}
void
*
If_ManSatBuildFromCell
(
char
*
pStr
,
Vec_Int_t
**
pvPiVars
,
Vec_Int_t
**
pvPoVars
,
void
**
ppNtk
)
{
Ifn_Ntk_t
*
p
=
Ifn_NtkParse
(
pStr
);
*
ppNtk
=
p
;
if
(
p
==
NULL
)
return
NULL
;
// Ifn_NtkPrint( p );
return
Ifn_ManSatBuild
(
p
,
pvPiVars
,
pvPoVars
);
}
/**Function*************************************************************
/**Function*************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment