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
6c932493
Commit
6c932493
authored
Mar 04, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvements to the CBA package.
parent
360cc99f
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
175 additions
and
70 deletions
+175
-70
src/base/cba/cba.h
+15
-14
src/base/cba/cbaBlast.c
+7
-6
src/base/cba/cbaCom.c
+30
-7
src/base/cba/cbaNtk.c
+28
-23
src/base/cba/cbaOper.c
+2
-2
src/base/cba/cbaPrsBuild.c
+9
-8
src/base/cba/cbaPtr.c
+65
-1
src/base/cba/cbaPtrAbc.c
+12
-7
src/base/cba/cbaWriteBlif.c
+1
-1
src/base/cba/cbaWriteVer.c
+6
-1
No files found.
src/base/cba/cba.h
View file @
6c932493
...
...
@@ -197,9 +197,9 @@ static inline char * Cba_ManName( Cba_Man_t * p ) { r
static
inline
char
*
Cba_ManSpec
(
Cba_Man_t
*
p
)
{
return
p
->
pSpec
;
}
static
inline
int
Cba_ManNtkNum
(
Cba_Man_t
*
p
)
{
return
p
->
nNtks
;
}
static
inline
int
Cba_ManPrimNum
(
Cba_Man_t
*
p
)
{
return
Abc_NamObjNumMax
(
p
->
pMods
)
-
Cba_ManNtkNum
(
p
);
}
static
inline
int
Cba_ManNtkIsOk
(
Cba_Man_t
*
p
,
int
i
)
{
return
i
>
=
0
&&
i
<
Cba_ManNtkNum
(
p
);
}
static
inline
int
Cba_ManNtkIsOk
(
Cba_Man_t
*
p
,
int
i
)
{
return
i
>
0
&&
i
<=
Cba_ManNtkNum
(
p
);
}
static
inline
Cba_Ntk_t
*
Cba_ManNtk
(
Cba_Man_t
*
p
,
int
i
)
{
return
Cba_ManNtkIsOk
(
p
,
i
)
?
p
->
pNtks
+
i
:
NULL
;
}
static
inline
int
Cba_ManNtkFindId
(
Cba_Man_t
*
p
,
char
*
pName
)
{
return
Abc_NamStrFind
(
p
->
pMods
,
pName
)
-
1
;
}
static
inline
int
Cba_ManNtkFindId
(
Cba_Man_t
*
p
,
char
*
pName
)
{
return
Abc_NamStrFind
(
p
->
pMods
,
pName
)
;
}
static
inline
Cba_Ntk_t
*
Cba_ManNtkFind
(
Cba_Man_t
*
p
,
char
*
pName
)
{
return
Cba_ManNtk
(
p
,
Cba_ManNtkFindId
(
p
,
pName
)
);
}
static
inline
Cba_Ntk_t
*
Cba_ManRoot
(
Cba_Man_t
*
p
)
{
return
Cba_ManNtk
(
p
,
p
->
iRoot
);
}
static
inline
char
*
Cba_ManStr
(
Cba_Man_t
*
p
,
int
i
)
{
return
Abc_NamStr
(
p
->
pStrs
,
i
);
}
...
...
@@ -233,7 +233,7 @@ static inline int Cba_NtkUserNum( Cba_Ntk_t * p ) { r
static
inline
int
Cba_NtkPi
(
Cba_Ntk_t
*
p
,
int
i
)
{
return
Vec_IntEntry
(
&
p
->
vInputs
,
i
);
}
static
inline
int
Cba_NtkPo
(
Cba_Ntk_t
*
p
,
int
i
)
{
return
Vec_IntEntry
(
&
p
->
vOutputs
,
i
);
}
static
inline
char
*
Cba_NtkStr
(
Cba_Ntk_t
*
p
,
int
i
)
{
return
Cba_ManStr
(
p
->
pDesign
,
i
);
}
static
inline
Cba_Ntk_t
*
Cba_NtkHostNtk
(
Cba_Ntk_t
*
p
)
{
return
p
->
iBoxNtk
>
=
0
?
Cba_ManNtk
(
p
->
pDesign
,
p
->
iBoxNtk
)
:
NULL
;
}
static
inline
Cba_Ntk_t
*
Cba_NtkHostNtk
(
Cba_Ntk_t
*
p
)
{
return
p
->
iBoxNtk
>
0
?
Cba_ManNtk
(
p
->
pDesign
,
p
->
iBoxNtk
)
:
NULL
;
}
static
inline
int
Cba_NtkHostObj
(
Cba_Ntk_t
*
p
)
{
return
p
->
iBoxObj
;
}
static
inline
void
Cba_NtkSetHost
(
Cba_Ntk_t
*
p
,
int
n
,
int
i
)
{
assert
(
p
->
iBoxNtk
==
-
1
);
p
->
iBoxNtk
=
n
;
p
->
iBoxObj
=
i
;
}
...
...
@@ -306,7 +306,7 @@ static inline int Cba_BoxBoNum( Cba_Ntk_t * p, int i ) { i
static
inline
int
Cba_BoxSize
(
Cba_Ntk_t
*
p
,
int
i
)
{
return
1
+
Cba_BoxBiNum
(
p
,
i
)
+
Cba_BoxBoNum
(
p
,
i
);
}
static
inline
int
Cba_BoxBi
(
Cba_Ntk_t
*
p
,
int
b
,
int
i
)
{
assert
(
Cba_ObjIsBox
(
p
,
b
));
return
b
-
1
-
i
;
}
static
inline
int
Cba_BoxBo
(
Cba_Ntk_t
*
p
,
int
b
,
int
i
)
{
assert
(
Cba_ObjIsBox
(
p
,
b
));
return
b
+
1
+
i
;
}
static
inline
int
Cba_BoxBiBox
(
Cba_Ntk_t
*
p
,
int
i
)
{
assert
(
Cba_ObjIsBi
(
p
,
i
));
return
i
+
1
+
Cba_ObjIndex
(
p
,
i
);
}
//
static inline int Cba_BoxBiBox( Cba_Ntk_t * p, int i ) { assert(Cba_ObjIsBi(p, i)); return i + 1 + Cba_ObjIndex(p, i); }
static
inline
int
Cba_BoxBoBox
(
Cba_Ntk_t
*
p
,
int
i
)
{
assert
(
Cba_ObjIsBo
(
p
,
i
));
return
i
-
1
-
Cba_ObjIndex
(
p
,
i
);
}
static
inline
int
Cba_BoxFanin
(
Cba_Ntk_t
*
p
,
int
b
,
int
i
)
{
return
Cba_ObjFanin
(
p
,
Cba_BoxBi
(
p
,
b
,
i
));
}
static
inline
int
Cba_BoxFaninBox
(
Cba_Ntk_t
*
p
,
int
b
,
int
i
)
{
return
Cba_BoxBoBox
(
p
,
Cba_BoxFanin
(
p
,
b
,
i
));
}
...
...
@@ -316,10 +316,10 @@ static inline int Cba_ObjPiRange( Cba_Ntk_t * p, int i ) { i
static
inline
int
Cba_BoxNtkId
(
Cba_Ntk_t
*
p
,
int
i
)
{
assert
(
Cba_ObjIsBox
(
p
,
i
));
return
Vec_IntEntry
(
&
p
->
vFanin
,
i
);
}
static
inline
void
Cba_BoxSetNtkId
(
Cba_Ntk_t
*
p
,
int
i
,
int
x
)
{
assert
(
Cba_ObjIsBox
(
p
,
i
)
&&
Cba_ManNtkIsOk
(
p
->
pDesign
,
x
));
Vec_IntSetEntry
(
&
p
->
vFanin
,
i
,
x
);}
static
inline
int
Cba_BoxBiNtkId
(
Cba_Ntk_t
*
p
,
int
i
)
{
assert
(
Cba_ObjIsBi
(
p
,
i
));
return
Cba_BoxNtkId
(
p
,
Cba_BoxBiBox
(
p
,
i
));
}
//
static inline int Cba_BoxBiNtkId( Cba_Ntk_t * p, int i ) { assert(Cba_ObjIsBi(p, i)); return Cba_BoxNtkId(p, Cba_BoxBiBox(p, i)); }
static
inline
int
Cba_BoxBoNtkId
(
Cba_Ntk_t
*
p
,
int
i
)
{
assert
(
Cba_ObjIsBo
(
p
,
i
));
return
Cba_BoxNtkId
(
p
,
Cba_BoxBoBox
(
p
,
i
));
}
static
inline
Cba_Ntk_t
*
Cba_BoxNtk
(
Cba_Ntk_t
*
p
,
int
i
)
{
return
Cba_ManNtk
(
p
->
pDesign
,
Cba_BoxNtkId
(
p
,
i
)
);
}
static
inline
Cba_Ntk_t
*
Cba_BoxBiNtk
(
Cba_Ntk_t
*
p
,
int
i
)
{
return
Cba_ManNtk
(
p
->
pDesign
,
Cba_BoxBiNtkId
(
p
,
i
)
);
}
//
static inline Cba_Ntk_t * Cba_BoxBiNtk( Cba_Ntk_t * p, int i ) { return Cba_ManNtk( p->pDesign, Cba_BoxBiNtkId(p, i) ); }
static
inline
Cba_Ntk_t
*
Cba_BoxBoNtk
(
Cba_Ntk_t
*
p
,
int
i
)
{
return
Cba_ManNtk
(
p
->
pDesign
,
Cba_BoxBoNtkId
(
p
,
i
)
);
}
static
inline
char
*
Cba_BoxNtkName
(
Cba_Ntk_t
*
p
,
int
i
)
{
return
Abc_NamStr
(
p
->
pDesign
->
pMods
,
Cba_BoxNtkId
(
p
,
i
)
);
}
...
...
@@ -332,7 +332,7 @@ static inline char * Cba_BoxNtkName( Cba_Ntk_t * p, int i ) { r
////////////////////////////////////////////////////////////////////////
#define Cba_ManForEachNtk( p, pNtk, i ) \
for ( i =
0; (i <
Cba_ManNtkNum(p)) && (((pNtk) = Cba_ManNtk(p, i)), 1); i++ )
for ( i =
1; (i <=
Cba_ManNtkNum(p)) && (((pNtk) = Cba_ManNtk(p, i)), 1); i++ )
#define Cba_NtkForEachPi( p, iObj, i ) \
for ( i = 0; (i < Cba_NtkPiNum(p)) && (((iObj) = Cba_NtkPi(p, i)), 1); i++ )
...
...
@@ -549,7 +549,7 @@ static inline void Cba_NtkAlloc( Cba_Ntk_t * pNew, int NameId, int nIns, int nOu
if
(
fFound
)
printf
(
"Network with name %s already exists.
\n
"
,
Cba_NtkStr
(
pNew
,
NameId
)
);
else
assert
(
NtkId
==
Cba_NtkId
(
pNew
)
+
1
);
assert
(
NtkId
==
Cba_NtkId
(
pNew
)
);
}
static
inline
void
Cba_NtkDup
(
Cba_Ntk_t
*
pNew
,
Cba_Ntk_t
*
p
)
{
...
...
@@ -650,7 +650,7 @@ static inline void Cba_NtkPrintStats( Cba_Ntk_t * p )
printf
(
"clp =%7d "
,
p
->
Count
);
printf
(
"obj =%7d "
,
Cba_NtkObjNum
(
p
)
);
printf
(
"%s "
,
Cba_NtkName
(
p
)
);
if
(
Cba_NtkHostNtk
(
p
)
)
if
(
Cba_NtkHostNtk
(
p
)
>
0
)
printf
(
"-> %s"
,
Cba_NtkName
(
Cba_NtkHostNtk
(
p
))
);
printf
(
"
\n
"
);
}
...
...
@@ -725,9 +725,9 @@ static inline Cba_Man_t * Cba_ManAlloc( char * pFileName, int nNtks )
pNew
->
pSpec
=
Abc_UtilStrsav
(
pFileName
);
pNew
->
pStrs
=
Abc_NamStart
(
1000
,
24
);
pNew
->
pMods
=
Abc_NamStart
(
1000
,
24
);
pNew
->
iRoot
=
0
;
pNew
->
iRoot
=
1
;
pNew
->
nNtks
=
nNtks
;
pNew
->
pNtks
=
ABC_CALLOC
(
Cba_Ntk_t
,
pNew
->
nNtks
);
pNew
->
pNtks
=
ABC_CALLOC
(
Cba_Ntk_t
,
pNew
->
nNtks
+
1
);
Cba_ManForEachNtk
(
pNew
,
pNtk
,
i
)
pNtk
->
pDesign
=
pNew
;
Cba_ManSetupTypes
(
pNew
->
pPrimNames
,
pNew
->
pPrimSymbs
);
...
...
@@ -741,9 +741,9 @@ static inline Cba_Man_t * Cba_ManStart( Cba_Man_t * p, int nNtks )
pNew
->
pSpec
=
Abc_UtilStrsav
(
Cba_ManSpec
(
p
)
);
pNew
->
pStrs
=
Abc_NamRef
(
p
->
pStrs
);
pNew
->
pMods
=
Abc_NamStart
(
1000
,
24
);
pNew
->
iRoot
=
0
;
pNew
->
iRoot
=
1
;
pNew
->
nNtks
=
nNtks
;
pNew
->
pNtks
=
ABC_CALLOC
(
Cba_Ntk_t
,
nNtks
);
pNew
->
pNtks
=
ABC_CALLOC
(
Cba_Ntk_t
,
nNtks
+
1
);
Cba_ManForEachNtk
(
pNew
,
pNtk
,
i
)
pNtk
->
pDesign
=
pNew
;
return
pNew
;
...
...
@@ -858,7 +858,7 @@ static inline void Cba_ManPrintStats( Cba_Man_t * p, int nModules, int fVerbose
Cba_ManBoxNum
(
p
);
Cba_ManForEachNtk
(
p
,
pNtk
,
i
)
{
if
(
i
==
nModules
)
if
(
i
==
nModules
+
1
)
break
;
printf
(
"Module %5d : "
,
i
);
Cba_NtkPrintStats
(
pNtk
);
...
...
@@ -986,6 +986,7 @@ extern Cba_Man_t * Cba_ManCollapse( Cba_Man_t * p );
extern
void
Cba_PtrFree
(
Vec_Ptr_t
*
vDes
);
extern
int
Cba_PtrMemory
(
Vec_Ptr_t
*
vDes
);
extern
void
Cba_PtrDumpBlif
(
char
*
pFileName
,
Vec_Ptr_t
*
vDes
);
extern
void
Cba_PtrDumpVerilog
(
char
*
pFileName
,
Vec_Ptr_t
*
vDes
);
extern
Vec_Ptr_t
*
Cba_PtrTransformTest
(
Vec_Ptr_t
*
vDes
);
/*=== cbaPtrAbc.c ============================================================*/
extern
Cba_Man_t
*
Cba_PtrTransformToCba
(
Vec_Ptr_t
*
vDes
);
...
...
src/base/cba/cbaBlast.c
View file @
6c932493
...
...
@@ -93,6 +93,7 @@ int Cba_ManAddBarbuf( Gia_Man_t * pNew, int iRes, Cba_Man_t * p, int iLNtk, int
if
(
vMap
&&
Abc_Lit2Var
(
iRes
)
<
Vec_IntSize
(
vMap
)
&&
(
iIdLit
=
Vec_IntEntry
(
vMap
,
Abc_Lit2Var
(
iRes
)))
>=
0
&&
Vec_IntEntry
(
&
p
->
vBuf2LeafNtk
,
Abc_Lit2Var
(
iIdLit
))
==
iLNtk
&&
Vec_IntEntry
(
&
p
->
vBuf2RootNtk
,
Abc_Lit2Var
(
iIdLit
))
==
iRNtk
)
return
Abc_LitNotCond
(
Vec_IntEntry
(
pNew
->
vBarBufs
,
Abc_Lit2Var
(
iIdLit
)),
Abc_LitIsCompl
(
iRes
)
^
Abc_LitIsCompl
(
iIdLit
)
);
assert
(
Cba_ManNtkIsOk
(
p
,
iLNtk
)
&&
Cba_ManNtkIsOk
(
p
,
iRNtk
)
);
Vec_IntPush
(
&
p
->
vBuf2LeafNtk
,
iLNtk
);
Vec_IntPush
(
&
p
->
vBuf2LeafObj
,
iLObj
);
Vec_IntPush
(
&
p
->
vBuf2RootNtk
,
iRNtk
);
...
...
@@ -277,9 +278,9 @@ void Cba_ManMarkNodesGia( Cba_Man_t * p, Gia_Man_t * pGia )
{
Gia_Obj_t
*
pObj
;
int
i
,
Count
=
0
;
assert
(
Vec_IntSize
(
&
p
->
vBuf2LeafNtk
)
==
Gia_ManBufNum
(
pGia
)
);
Gia_ManConst0
(
pGia
)
->
Value
=
0
;
Gia_ManConst0
(
pGia
)
->
Value
=
1
;
Gia_ManForEachPi
(
pGia
,
pObj
,
i
)
pObj
->
Value
=
0
;
pObj
->
Value
=
1
;
Gia_ManForEachAnd
(
pGia
,
pObj
,
i
)
{
if
(
Gia_ObjIsBuf
(
pObj
)
)
...
...
@@ -293,8 +294,8 @@ void Cba_ManMarkNodesGia( Cba_Man_t * p, Gia_Man_t * pGia )
assert
(
Count
==
Gia_ManBufNum
(
pGia
)
);
Gia_ManForEachPo
(
pGia
,
pObj
,
i
)
{
assert
(
Gia_ObjFanin0
(
pObj
)
->
Value
==
0
);
pObj
->
Value
=
0
;
assert
(
Gia_ObjFanin0
(
pObj
)
->
Value
==
1
);
pObj
->
Value
=
1
;
}
}
void
Cba_ManRemapBarbufs
(
Cba_Man_t
*
pNew
,
Cba_Man_t
*
p
)
...
...
@@ -444,7 +445,7 @@ void Cba_ManMarkNodesAbc( Cba_Man_t * p, Abc_Ntk_t * pNtk )
Abc_Obj_t
*
pObj
,
*
pFanin
;
int
i
,
k
,
Count
=
0
;
assert
(
Vec_IntSize
(
&
p
->
vBuf2LeafNtk
)
==
pNtk
->
nBarBufs2
);
Abc_NtkForEachPi
(
pNtk
,
pObj
,
i
)
pObj
->
iTemp
=
0
;
pObj
->
iTemp
=
1
;
Abc_NtkForEachNode
(
pNtk
,
pObj
,
i
)
{
if
(
Abc_ObjIsBarBuf
(
pObj
)
)
...
...
@@ -460,7 +461,7 @@ void Cba_ManMarkNodesAbc( Cba_Man_t * p, Abc_Ntk_t * pNtk )
{
if
(
!
Abc_NodeIsSeriousGate
(
Abc_ObjFanin0
(
pObj
))
)
continue
;
assert
(
Abc_ObjFanin0
(
pObj
)
->
iTemp
==
0
);
assert
(
Abc_ObjFanin0
(
pObj
)
->
iTemp
==
1
);
pObj
->
iTemp
=
Abc_ObjFanin0
(
pObj
)
->
iTemp
;
}
assert
(
Count
==
pNtk
->
nBarBufs2
);
...
...
src/base/cba/cbaCom.c
View file @
6c932493
...
...
@@ -144,15 +144,18 @@ int Cba_CommandRead( Abc_Frame_t * pAbc, int argc, char ** argv )
Cba_Man_t
*
p
=
NULL
;
Vec_Ptr_t
*
vDes
=
NULL
;
char
*
pFileName
=
NULL
;
int
c
,
fUseAbc
=
0
,
fVerbose
=
0
;
int
c
,
fUseAbc
=
0
,
f
UsePtr
=
0
,
f
Verbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"avh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"a
p
vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'a'
:
fUseAbc
^=
1
;
break
;
case
'p'
:
fUsePtr
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -179,7 +182,7 @@ int Cba_CommandRead( Abc_Frame_t * pAbc, int argc, char ** argv )
}
fclose
(
pFile
);
// perform reading
if
(
fUseAbc
)
if
(
fUseAbc
||
fUsePtr
)
{
extern
Vec_Ptr_t
*
Ptr_AbcDeriveDes
(
Abc_Ntk_t
*
pNtk
);
Abc_Ntk_t
*
pAbcNtk
=
Io_ReadNetlist
(
pFileName
,
Io_ReadFileType
(
pFileName
),
0
);
...
...
@@ -229,9 +232,10 @@ int Cba_CommandRead( Abc_Frame_t * pAbc, int argc, char ** argv )
Cba_AbcUpdateMan
(
pAbc
,
p
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: @read [-avh] <file_name>
\n
"
);
Abc_Print
(
-
2
,
"usage: @read [-a
p
vh] <file_name>
\n
"
);
Abc_Print
(
-
2
,
"
\t
reads hierarchical design in BLIF or Verilog
\n
"
);
Abc_Print
(
-
2
,
"
\t
-a : toggle using old ABC parser [default = %s]
\n
"
,
fUseAbc
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-p : toggle using Ptr construction [default = %s]
\n
"
,
fUsePtr
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
...
...
@@ -253,15 +257,19 @@ int Cba_CommandWrite( Abc_Frame_t * pAbc, int argc, char ** argv )
Cba_Man_t
*
p
=
Cba_AbcGetMan
(
pAbc
);
char
*
pFileName
=
NULL
;
int
fUseAssign
=
1
;
int
fUsePtr
=
0
;
int
c
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"avh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"a
p
vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'a'
:
fUseAssign
^=
1
;
break
;
case
'p'
:
fUsePtr
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -289,7 +297,21 @@ int Cba_CommandWrite( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
!
strcmp
(
Extra_FileNameExtension
(
pFileName
),
"blif"
)
)
Cba_ManWriteBlif
(
pFileName
,
p
);
else
if
(
!
strcmp
(
Extra_FileNameExtension
(
pFileName
),
"v"
)
)
Cba_ManWriteVerilog
(
pFileName
,
p
,
fUseAssign
);
{
if
(
fUsePtr
)
{
Vec_Ptr_t
*
vPtr
=
Cba_PtrDeriveFromCba
(
p
);
if
(
vPtr
==
NULL
)
printf
(
"Converting to Ptr has failed.
\n
"
);
else
{
Cba_PtrDumpVerilog
(
pFileName
,
vPtr
);
Cba_PtrFree
(
vPtr
);
}
}
else
Cba_ManWriteVerilog
(
pFileName
,
p
,
fUseAssign
);
}
else
if
(
!
strcmp
(
Extra_FileNameExtension
(
pFileName
),
"cba"
)
)
Cba_ManWriteCba
(
pFileName
,
p
);
else
...
...
@@ -299,9 +321,10 @@ int Cba_CommandWrite( Abc_Frame_t * pAbc, int argc, char ** argv )
}
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: @write [-avh]
\n
"
);
Abc_Print
(
-
2
,
"usage: @write [-a
p
vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
writes the design into a file in BLIF or Verilog
\n
"
);
Abc_Print
(
-
2
,
"
\t
-a : toggle using assign-statement for primitives [default = %s]
\n
"
,
fUseAssign
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-p : toggle using Ptr construction (mapped Verilog only) [default = %s]
\n
"
,
fUsePtr
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
...
...
src/base/cba/cbaNtk.c
View file @
6c932493
...
...
@@ -341,30 +341,33 @@ void Cba_ManAssignInternWordNamesNtk( Cba_Ntk_t * p, Vec_Int_t * vMap )
}
}
// transfer names to the interface
for
(
k
=
0
;
k
<
Cba_NtkInfoNum
(
p
);
k
++
)
if
(
Cba_NtkInfoNum
(
p
)
)
{
//char * pName = Cba_NtkName(p);
if
(
Cba_NtkInfoType
(
p
,
k
)
==
1
)
// PI
for
(
k
=
0
;
k
<
Cba_NtkInfoNum
(
p
);
k
++
)
{
iObj
=
Cba_NtkPi
(
p
,
nPis
);
assert
(
!
Cba_ObjBit
(
p
,
iObj
)
);
assert
(
Cba_ObjNameType
(
p
,
iObj
)
<=
CBA_NAME_WORD
);
Cba_NtkSetInfoName
(
p
,
k
,
Abc_Var2Lit2
(
Cba_ObjNameId
(
p
,
iObj
),
1
)
);
nPis
+=
Cba_NtkInfoRange
(
p
,
k
);
}
else
if
(
Cba_NtkInfoType
(
p
,
k
)
==
2
)
// PO
{
iObj
=
Cba_NtkPo
(
p
,
nPos
);
assert
(
!
Cba_ObjBit
(
p
,
iObj
)
);
iObj
=
Cba_ObjFanin
(
p
,
iObj
);
assert
(
Cba_ObjNameType
(
p
,
iObj
)
<=
CBA_NAME_WORD
);
Cba_NtkSetInfoName
(
p
,
k
,
Abc_Var2Lit2
(
Cba_ObjNameId
(
p
,
iObj
),
2
)
);
nPos
+=
Cba_NtkInfoRange
(
p
,
k
);
//char * pName = Cba_NtkName(p);
if
(
Cba_NtkInfoType
(
p
,
k
)
==
1
)
// PI
{
iObj
=
Cba_NtkPi
(
p
,
nPis
);
assert
(
!
Cba_ObjBit
(
p
,
iObj
)
);
assert
(
Cba_ObjNameType
(
p
,
iObj
)
<=
CBA_NAME_WORD
);
Cba_NtkSetInfoName
(
p
,
k
,
Abc_Var2Lit2
(
Cba_ObjNameId
(
p
,
iObj
),
1
)
);
nPis
+=
Cba_NtkInfoRange
(
p
,
k
);
}
else
if
(
Cba_NtkInfoType
(
p
,
k
)
==
2
)
// PO
{
iObj
=
Cba_NtkPo
(
p
,
nPos
);
assert
(
!
Cba_ObjBit
(
p
,
iObj
)
);
iObj
=
Cba_ObjFanin
(
p
,
iObj
);
assert
(
Cba_ObjNameType
(
p
,
iObj
)
<=
CBA_NAME_WORD
);
Cba_NtkSetInfoName
(
p
,
k
,
Abc_Var2Lit2
(
Cba_ObjNameId
(
p
,
iObj
),
2
)
);
nPos
+=
Cba_NtkInfoRange
(
p
,
k
);
}
else
assert
(
0
);
}
else
assert
(
0
);
assert
(
nPis
==
Cba_NtkPiNum
(
p
)
);
assert
(
nPos
==
Cba_NtkPoNum
(
p
)
);
}
assert
(
nPis
==
Cba_NtkPiNum
(
p
)
);
assert
(
nPos
==
Cba_NtkPoNum
(
p
)
);
// assign instance names
nDigits
=
Abc_Base10Log
(
Cba_NtkObjNum
(
p
)
);
Cba_NtkForEachBox
(
p
,
iObj
)
...
...
@@ -388,7 +391,7 @@ void Cba_ManAssignInternWordNamesNtk( Cba_Ntk_t * p, Vec_Int_t * vMap )
}
void
Cba_ManAssignInternWordNames
(
Cba_Man_t
*
p
)
{
Vec_Int_t
*
vMap
=
Vec_IntStart
(
Cba_ManObjNum
(
p
)
);
Vec_Int_t
*
vMap
=
Vec_IntStart
(
2
*
Cba_ManObjNum
(
p
)
);
Cba_Ntk_t
*
pNtk
;
int
i
;
Cba_ManForEachNtk
(
p
,
pNtk
,
i
)
Cba_ManAssignInternWordNamesNtk
(
pNtk
,
vMap
);
...
...
@@ -569,6 +572,8 @@ Cba_Man_t * Cba_ManCollapse( Cba_Man_t * p )
Cba_Ntk_t
*
pRoot
=
Cba_ManRoot
(
p
);
Cba_Ntk_t
*
pRootNew
=
Cba_ManRoot
(
pNew
);
Cba_NtkAlloc
(
pRootNew
,
Cba_NtkNameId
(
pRoot
),
Cba_NtkPiNum
(
pRoot
),
Cba_NtkPoNum
(
pRoot
),
Cba_ManClpObjNum
(
p
)
);
if
(
Vec_IntSize
(
&
pRoot
->
vInfo
)
)
Vec_IntAppend
(
&
pRootNew
->
vInfo
,
&
pRoot
->
vInfo
);
Cba_NtkForEachPi
(
pRoot
,
iObj
,
i
)
Vec_IntPush
(
vSigs
,
Cba_ObjAlloc
(
pRootNew
,
CBA_OBJ_PI
,
-
1
)
);
Cba_NtkCollapse_rec
(
pRootNew
,
pRoot
,
vSigs
);
...
...
@@ -582,10 +587,10 @@ Cba_Man_t * Cba_ManCollapse( Cba_Man_t * p )
{
Cba_NtkStartNames
(
pRootNew
);
Cba_NtkForEachPi
(
pRoot
,
iObj
,
i
)
Cba_ObjSetName
(
pRootNew
,
Cba_NtkPi
(
pRootNew
,
i
),
Cba_ObjName
Id
(
pRoot
,
iObj
)
);
Cba_ObjSetName
(
pRootNew
,
Cba_NtkPi
(
pRootNew
,
i
),
Cba_ObjName
(
pRoot
,
iObj
)
);
Cba_NtkForEachPoDriver
(
pRoot
,
iObj
,
i
)
if
(
!
Cba_ObjIsPi
(
pRoot
,
iObj
)
)
Cba_ObjSetName
(
pRootNew
,
Cba_ObjCopy
(
pRoot
,
iObj
),
Cba_ObjName
Id
(
pRoot
,
iObj
)
);
Cba_ObjSetName
(
pRootNew
,
Cba_ObjCopy
(
pRoot
,
iObj
),
Cba_ObjName
(
pRoot
,
iObj
)
);
}
return
pNew
;
}
...
...
src/base/cba/cbaOper.c
View file @
6c932493
...
...
@@ -350,8 +350,8 @@ int Cba_ObjClpMemory( Cba_Ntk_t * p, int iBox )
// collect address
}
// for each fanout of RAMBOX, makes ure address width is the same
Cba_BoxForEachFanoutBox
(
p
,
iBox
,
iNext
,
i
)
assert
(
Cba_ObjType
(
p
,
iNext
)
==
CBA_BOX_RAMR
);
//
Cba_BoxForEachFanoutBox( p, iBox, iNext, i )
//
assert( Cba_ObjType(p, iNext) == CBA_BOX_RAMR );
// create selectors and connect them
return
1
;
}
...
...
src/base/cba/cbaPrsBuild.c
View file @
6c932493
...
...
@@ -152,9 +152,10 @@ void Prs_ManRemapBoxes( Cba_Man_t * pNew, Vec_Ptr_t * vDes, Prs_Ntk_t * pNtk, Ve
{
int
NtkId
=
Prs_BoxNtk
(
pNtk
,
iBox
);
int
NtkIdNew
=
Cba_ManNtkFindId
(
pNew
,
Prs_NtkStr
(
pNtk
,
NtkId
)
);
assert
(
NtkIdNew
>
0
);
Prs_BoxSetNtk
(
pNtk
,
iBox
,
NtkIdNew
);
if
(
NtkIdNew
<
Cba_ManNtkNum
(
pNew
)
)
Prs_ManRemapOne
(
vSigs
,
Prs_ManNtk
(
vDes
,
NtkIdNew
),
vMap
);
if
(
NtkIdNew
<
=
Cba_ManNtkNum
(
pNew
)
)
Prs_ManRemapOne
(
vSigs
,
Prs_ManNtk
(
vDes
,
NtkIdNew
-
1
),
vMap
);
//else
// Prs_ManRemapGate( vSigs );
}
...
...
@@ -194,10 +195,10 @@ void Prs_ManBuildNtk( Cba_Ntk_t * pNew, Vec_Ptr_t * vDes, Prs_Ntk_t * pNtk, Vec_
Prs_NtkForEachBox
(
pNtk
,
vSigs
,
iBox
)
if
(
!
Prs_BoxIsNode
(
pNtk
,
iBox
)
)
{
pNtkBox
=
Prs_ManNtk
(
vDes
,
Prs_BoxNtk
(
pNtk
,
iBox
)
);
pNtkBox
=
Prs_ManNtk
(
vDes
,
Prs_BoxNtk
(
pNtk
,
iBox
)
-
1
);
if
(
pNtkBox
==
NULL
)
{
iObj
=
Cba_BoxAlloc
(
pNew
,
CBA_BOX_GATE
,
Vec_IntSize
(
vSigs
)
/
2
-
1
,
1
,
Prs_BoxNtk
(
pNtk
,
iBox
)
+
1
);
// +1 to map NtkId into gate name
iObj
=
Cba_BoxAlloc
(
pNew
,
CBA_BOX_GATE
,
Vec_IntSize
(
vSigs
)
/
2
-
1
,
1
,
Prs_BoxNtk
(
pNtk
,
iBox
)
);
Cba_ObjSetName
(
pNew
,
iObj
,
Abc_Var2Lit2
(
Prs_BoxName
(
pNtk
,
iBox
),
CBA_NAME_BIN
)
);
// consider box output
NameId
=
Vec_IntEntryLast
(
vSigs
);
...
...
@@ -250,7 +251,7 @@ void Prs_ManBuildNtk( Cba_Ntk_t * pNew, Vec_Ptr_t * vDes, Prs_Ntk_t * pNtk, Vec_
Prs_NtkForEachBox
(
pNtk
,
vSigs
,
iBox
)
if
(
!
Prs_BoxIsNode
(
pNtk
,
iBox
)
)
{
pNtkBox
=
Prs_ManNtk
(
vDes
,
Prs_BoxNtk
(
pNtk
,
iBox
)
);
pNtkBox
=
Prs_ManNtk
(
vDes
,
Prs_BoxNtk
(
pNtk
,
iBox
)
-
1
);
iObj
=
Vec_IntEntry
(
vBoxes
,
iBox
);
if
(
pNtkBox
==
NULL
)
{
...
...
@@ -352,16 +353,16 @@ Cba_Man_t * Prs_ManBuildCba( char * pFileName, Vec_Ptr_t * vDes )
Abc_NamDeref
(
pNew
->
pStrs
);
pNew
->
pStrs
=
Abc_NamRef
(
pNtk
->
pStrs
);
Vec_PtrForEachEntry
(
Prs_Ntk_t
*
,
vDes
,
pNtk
,
i
)
Cba_NtkAlloc
(
Cba_ManNtk
(
pNew
,
i
),
Prs_NtkId
(
pNtk
),
Prs_NtkPiNum
(
pNtk
),
Prs_NtkPoNum
(
pNtk
),
Prs_NtkCountObjects
(
pNtk
)
);
Cba_NtkAlloc
(
Cba_ManNtk
(
pNew
,
i
+
1
),
Prs_NtkId
(
pNtk
),
Prs_NtkPiNum
(
pNtk
),
Prs_NtkPoNum
(
pNtk
),
Prs_NtkCountObjects
(
pNtk
)
);
if
(
(
pNtk
->
fMapped
||
(
pNtk
->
fSlices
&&
Prs_ManIsMapped
(
pNtk
)))
&&
!
Cba_NtkBuildLibrary
(
pNew
)
)
Cba_ManFree
(
pNew
),
pNew
=
NULL
;
else
Vec_PtrForEachEntry
(
Prs_Ntk_t
*
,
vDes
,
pNtk
,
i
)
Prs_ManBuildNtk
(
Cba_ManNtk
(
pNew
,
i
),
vDes
,
pNtk
,
vMap
,
vTmp
);
Prs_ManBuildNtk
(
Cba_ManNtk
(
pNew
,
i
+
1
),
vDes
,
pNtk
,
vMap
,
vTmp
);
assert
(
Vec_IntCountEntry
(
vMap
,
-
1
)
==
Vec_IntSize
(
vMap
)
);
Vec_IntFree
(
vMap
);
Vec_IntFree
(
vTmp
);
// Vec_StrPrint( &Cba_ManNtk(pNew,
0
)->vType, 1 );
// Vec_StrPrint( &Cba_ManNtk(pNew,
1
)->vType, 1 );
return
pNew
;
}
...
...
src/base/cba/cbaPtr.c
View file @
6c932493
...
...
@@ -198,12 +198,76 @@ void Cba_PtrDumpBlif( char * pFileName, Vec_Ptr_t * vDes )
printf
(
"Cannot open output file
\"
%s
\"
.
\n
"
,
pFileName
);
return
;
}
fprintf
(
pFile
,
"// Design
\"
%s
\"
written
by
ABC on %s
\n\n
"
,
(
char
*
)
Vec_PtrEntry
(
vDes
,
0
),
Extra_TimeStamp
()
);
fprintf
(
pFile
,
"// Design
\"
%s
\"
written
via Ptr in
ABC on %s
\n\n
"
,
(
char
*
)
Vec_PtrEntry
(
vDes
,
0
),
Extra_TimeStamp
()
);
Vec_PtrForEachEntryStart
(
Vec_Ptr_t
*
,
vDes
,
vNtk
,
i
,
1
)
Cba_PtrDumpModuleBlif
(
pFile
,
vNtk
);
fclose
(
pFile
);
}
/**Function*************************************************************
Synopsis [Dumping Ptr into a Verilog file.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Cba_PtrDumpSignalsVerilog
(
FILE
*
pFile
,
Vec_Ptr_t
*
vSigs
,
int
fAlwaysComma
)
{
char
*
pSig
;
int
i
;
Vec_PtrForEachEntry
(
char
*
,
vSigs
,
pSig
,
i
)
fprintf
(
pFile
,
" %s%s"
,
pSig
,
(
fAlwaysComma
||
i
<
Vec_PtrSize
(
vSigs
)
-
1
)
?
","
:
""
);
}
void
Cba_PtrDumpBoxVerilog
(
FILE
*
pFile
,
Vec_Ptr_t
*
vBox
)
{
char
*
pName
;
int
i
;
fprintf
(
pFile
,
" %s"
,
(
char
*
)
Vec_PtrEntry
(
vBox
,
0
)
);
fprintf
(
pFile
,
" %s ("
,
(
char
*
)
Vec_PtrEntry
(
vBox
,
1
)
);
// write intance name in Verilog
Vec_PtrForEachEntryStart
(
char
*
,
vBox
,
pName
,
i
,
2
)
fprintf
(
pFile
,
".%s(%s)%s"
,
pName
,
(
char
*
)
Vec_PtrEntry
(
vBox
,
i
+
1
),
i
<
Vec_PtrSize
(
vBox
)
-
2
?
", "
:
""
),
i
++
;
fprintf
(
pFile
,
");
\n
"
);
}
void
Cba_PtrDumpBoxesVerilog
(
FILE
*
pFile
,
Vec_Ptr_t
*
vBoxes
)
{
Vec_Ptr_t
*
vBox
;
int
i
;
Vec_PtrForEachEntry
(
Vec_Ptr_t
*
,
vBoxes
,
vBox
,
i
)
Cba_PtrDumpBoxVerilog
(
pFile
,
vBox
);
}
void
Cba_PtrDumpModuleVerilog
(
FILE
*
pFile
,
Vec_Ptr_t
*
vNtk
)
{
fprintf
(
pFile
,
"module %s (
\n
"
,
(
char
*
)
Vec_PtrEntry
(
vNtk
,
0
)
);
Cba_PtrDumpSignalsVerilog
(
pFile
,
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vNtk
,
1
),
1
);
Cba_PtrDumpSignalsVerilog
(
pFile
,
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vNtk
,
2
),
0
);
fprintf
(
pFile
,
"
\n
);
\n
"
);
fprintf
(
pFile
,
" input"
);
Cba_PtrDumpSignalsVerilog
(
pFile
,
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vNtk
,
1
),
0
);
fprintf
(
pFile
,
";
\n
"
);
fprintf
(
pFile
,
" output"
);
Cba_PtrDumpSignalsVerilog
(
pFile
,
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vNtk
,
2
),
0
);
fprintf
(
pFile
,
";
\n
"
);
assert
(
Vec_PtrSize
((
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vNtk
,
3
))
==
0
);
// no nodes; only boxes
Cba_PtrDumpBoxesVerilog
(
pFile
,
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vNtk
,
4
)
);
fprintf
(
pFile
,
"endmodule
\n\n
"
);
}
void
Cba_PtrDumpVerilog
(
char
*
pFileName
,
Vec_Ptr_t
*
vDes
)
{
FILE
*
pFile
;
Vec_Ptr_t
*
vNtk
;
int
i
;
pFile
=
fopen
(
pFileName
,
"wb"
);
if
(
pFile
==
NULL
)
{
printf
(
"Cannot open output file
\"
%s
\"
.
\n
"
,
pFileName
);
return
;
}
fprintf
(
pFile
,
"// Design
\"
%s
\"
written via Ptr in ABC on %s
\n\n
"
,
(
char
*
)
Vec_PtrEntry
(
vDes
,
0
),
Extra_TimeStamp
()
);
Vec_PtrForEachEntryStart
(
Vec_Ptr_t
*
,
vDes
,
vNtk
,
i
,
1
)
Cba_PtrDumpModuleVerilog
(
pFile
,
vNtk
);
fclose
(
pFile
);
}
/**Function*************************************************************
...
...
src/base/cba/cbaPtrAbc.c
View file @
6c932493
...
...
@@ -269,7 +269,7 @@ int Ptr_ManCountNtk( Vec_Ptr_t * vNtk )
int
Cba_BoxCountOutputs
(
Cba_Ntk_t
*
pNtk
,
char
*
pBoxNtk
)
{
int
ModuleId
=
Cba_ManNtkFindId
(
pNtk
->
pDesign
,
pBoxNtk
);
if
(
ModuleId
==
-
1
)
if
(
ModuleId
==
0
)
return
1
;
return
Cba_NtkPoNumAlloc
(
Cba_ManNtk
(
pNtk
->
pDesign
,
ModuleId
)
);
}
...
...
@@ -306,7 +306,7 @@ int Cba_NtkDeriveFromPtr( Cba_Ntk_t * pNtk, Vec_Ptr_t * vNtk, Vec_Int_t * vMap,
assert
(
Vec_PtrSize
(
vBox
)
%
2
==
0
);
assert
(
nOutputs
>
0
&&
2
*
(
nOutputs
+
1
)
<=
Vec_PtrSize
(
vBox
)
);
iObj
=
Cba_BoxAlloc
(
pNtk
,
Ptr_NameToType
(
pBoxNtk
),
nInputs
,
nOutputs
,
NtkId
);
if
(
NtkId
>
=
0
)
if
(
NtkId
>
0
)
Cba_NtkSetHost
(
Cba_ManNtk
(
pNtk
->
pDesign
,
NtkId
),
Cba_NtkId
(
pNtk
),
iObj
);
Cba_ObjSetName
(
pNtk
,
iObj
,
Abc_Var2Lit2
(
Abc_NamStrFindOrAdd
(
pNtk
->
pDesign
->
pStrs
,
pBoxName
,
NULL
),
CBA_NAME_BIN
)
);
Cba_BoxForEachBo
(
pNtk
,
iObj
,
iTerm
,
k
)
...
...
@@ -362,7 +362,7 @@ Cba_Man_t * Cba_PtrTransformToCba( Vec_Ptr_t * vDes )
Cba_Ntk_t
*
pNtk
;
int
i
;
Cba_ManForEachNtk
(
pNew
,
pNtk
,
i
)
{
Vec_Ptr_t
*
vNtk
=
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vDes
,
i
+
1
);
Vec_Ptr_t
*
vNtk
=
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vDes
,
i
);
Vec_Ptr_t
*
vInputs
=
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vNtk
,
1
);
Vec_Ptr_t
*
vOutputs
=
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vNtk
,
2
);
int
NameId
=
Abc_NamStrFindOrAdd
(
pNew
->
pStrs
,
(
char
*
)
Vec_PtrEntry
(
vNtk
,
0
),
NULL
);
...
...
@@ -372,11 +372,11 @@ Cba_Man_t * Cba_PtrTransformToCba( Vec_Ptr_t * vDes )
// parse the networks
Cba_ManForEachNtk
(
pNew
,
pNtk
,
i
)
{
Vec_Ptr_t
*
vNtk
=
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vDes
,
i
+
1
);
Vec_Ptr_t
*
vNtk
=
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vDes
,
i
);
if
(
!
Cba_NtkDeriveFromPtr
(
pNtk
,
vNtk
,
vMap
,
vBox2Id
)
)
break
;
}
if
(
i
<
Cba_ManNtkNum
(
pNew
)
)
if
(
i
<
=
Cba_ManNtkNum
(
pNew
)
)
Cba_ManFree
(
pNew
),
pNew
=
NULL
;
Vec_IntFree
(
vBox2Id
);
Vec_IntFree
(
vMap
);
...
...
@@ -400,8 +400,8 @@ Vec_Ptr_t * Cba_NtkTransformToPtrBox( Cba_Ntk_t * p, int iBox )
int
i
,
iTerm
,
fUser
=
Cba_ObjIsBoxUser
(
p
,
iBox
);
Cba_Ntk_t
*
pBoxNtk
=
Cba_BoxNtk
(
p
,
iBox
);
Mio_Library_t
*
pLib
=
(
Mio_Library_t
*
)
p
->
pDesign
->
pMioLib
;
Mio_Gate_t
*
pGate
=
Mio_LibraryReadGateByName
(
pLib
,
Cba_BoxNtkName
(
p
,
iBox
),
NULL
)
;
Vec_Ptr_t
*
vBox
=
Vec_PtrAllocExact
(
Cba_BoxSize
(
p
,
iBox
)
);
Mio_Gate_t
*
pGate
=
pLib
?
Mio_LibraryReadGateByName
(
pLib
,
Cba_BoxNtkName
(
p
,
iBox
),
NULL
)
:
NULL
;
Vec_Ptr_t
*
vBox
=
Vec_PtrAllocExact
(
2
*
Cba_BoxSize
(
p
,
iBox
)
);
Vec_PtrPush
(
vBox
,
Cba_BoxNtkName
(
p
,
iBox
)
);
Vec_PtrPush
(
vBox
,
Cba_ObjNameStr
(
p
,
iBox
)
);
Cba_BoxForEachBi
(
p
,
iBox
,
iTerm
,
i
)
...
...
@@ -462,6 +462,11 @@ Vec_Ptr_t * Cba_PtrDeriveFromCba( Cba_Man_t * p )
Cba_Ntk_t
*
pTemp
;
int
i
;
if
(
p
==
NULL
)
return
NULL
;
if
(
p
->
pMioLib
==
NULL
)
{
printf
(
"Cannot transform CBA network into Ptr because it is not mapped.
\n
"
);
return
NULL
;
}
Cba_ManAssignInternWordNames
(
p
);
vDes
=
Vec_PtrAllocExact
(
1
+
Cba_ManNtkNum
(
p
)
);
Vec_PtrPush
(
vDes
,
p
->
pName
);
...
...
src/base/cba/cbaWriteBlif.c
View file @
6c932493
...
...
@@ -219,7 +219,7 @@ void Cba_ManWriteBlif( char * pFileName, Cba_Man_t * p )
printf
(
"Cannot open output file
\"
%s
\"
.
\n
"
,
pFileName
);
return
;
}
fprintf
(
pFile
,
"# Design
\"
%s
\"
written
by
ABC on %s
\n\n
"
,
Cba_ManName
(
p
),
Extra_TimeStamp
()
);
fprintf
(
pFile
,
"# Design
\"
%s
\"
written
via CBA package in
ABC on %s
\n\n
"
,
Cba_ManName
(
p
),
Extra_TimeStamp
()
);
Cba_ManAssignInternWordNames
(
p
);
Cba_ManForEachNtk
(
p
,
pNtk
,
i
)
Cba_ManWriteBlifNtk
(
pFile
,
pNtk
);
...
...
src/base/cba/cbaWriteVer.c
View file @
6c932493
...
...
@@ -397,7 +397,7 @@ static inline void Cba_ManWriteGate( Cba_Ntk_t * p, int iObj )
char
*
pGateName
=
Abc_NamStr
(
p
->
pDesign
->
pMods
,
Cba_BoxNtkId
(
p
,
iObj
));
Mio_Library_t
*
pLib
=
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
(
Abc_FrameGetGlobalFrame
()
);
Mio_Gate_t
*
pGate
=
Mio_LibraryReadGateByName
(
pLib
,
pGateName
,
NULL
);
Vec_StrPrintStr
(
vStr
,
" "
);
Vec_StrPrintStr
(
vStr
,
"
"
);
Vec_StrPrintStr
(
vStr
,
pGateName
);
Vec_StrPrintStr
(
vStr
,
" "
);
Vec_StrPrintStr
(
vStr
,
Cba_ObjName
(
p
,
iObj
)
?
Cba_ObjNameStr
(
p
,
iObj
)
:
""
);
...
...
@@ -669,6 +669,11 @@ void Cba_ManWriteVerilog( char * pFileName, Cba_Man_t * p, int fUseAssign )
// derive the stream
p
->
vOut
=
Vec_StrAlloc
(
10000
);
p
->
vOut2
=
Vec_StrAlloc
(
1000
);
Vec_StrPrintStr
(
p
->
vOut
,
"// Design
\"
"
);
Vec_StrPrintStr
(
p
->
vOut
,
Cba_ManName
(
p
)
);
Vec_StrPrintStr
(
p
->
vOut
,
"
\"
written via CBA package in ABC on "
);
Vec_StrPrintStr
(
p
->
vOut
,
Extra_TimeStamp
()
);
Vec_StrPrintStr
(
p
->
vOut
,
"
\n\n
"
);
Cba_ManAssignInternWordNames
(
p
);
Cba_ManForEachNtk
(
p
,
pNtk
,
i
)
Cba_ManWriteVerilogNtk
(
pNtk
,
fUseAssign
);
...
...
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