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
7a4a63d0
Commit
7a4a63d0
authored
Feb 16, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Several improvements to CBA data-structure.
parent
ff1fd41a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
124 additions
and
3 deletions
+124
-3
abclib.dsp
+4
-0
src/base/cba/cba.h
+0
-0
src/base/cba/cbaBlast.c
+25
-3
src/base/cba/cbaNtk.c
+61
-0
src/base/cba/cbaOper.c
+0
-0
src/base/cba/cbaPrs.h
+4
-0
src/base/cba/cbaReadBlif.c
+10
-0
src/base/cba/cbaReadVer.c
+20
-0
No files found.
abclib.dsp
View file @
7a4a63d0
...
...
@@ -803,6 +803,10 @@ SOURCE=.\src\base\cba\cbaNtk.c
# End Source File
# Begin Source File
SOURCE=.\src\base\cba\cbaOper.c
# End Source File
# Begin Source File
SOURCE=.\src\base\cba\cbaPrs.h
# End Source File
# Begin Source File
...
...
src/base/cba/cba.h
View file @
7a4a63d0
This diff is collapsed.
Click to expand it.
src/base/cba/cbaBlast.c
View file @
7a4a63d0
...
...
@@ -165,11 +165,12 @@ int Cba_ManExtract_rec( Gia_Man_t * pNew, Cba_Ntk_t * p, int i, int fBuffers, Ve
iRes
=
Abc_LitNot
(
pLits
[
0
]
);
else
assert
(
0
);
}
else
else
if
(
nLits
==
2
)
{
assert
(
nLits
==
2
);
if
(
Type
==
CBA_BOX_AND
)
iRes
=
Gia_ManHashAnd
(
pNew
,
pLits
[
0
],
pLits
[
1
]
);
else
if
(
Type
==
CBA_BOX_NAND
)
iRes
=
Abc_LitNot
(
Gia_ManHashAnd
(
pNew
,
pLits
[
0
],
pLits
[
1
]
)
);
else
if
(
Type
==
CBA_BOX_OR
)
iRes
=
Gia_ManHashOr
(
pNew
,
pLits
[
0
],
pLits
[
1
]
);
else
if
(
Type
==
CBA_BOX_NOR
)
...
...
@@ -180,9 +181,30 @@ int Cba_ManExtract_rec( Gia_Man_t * pNew, Cba_Ntk_t * p, int i, int fBuffers, Ve
iRes
=
Abc_LitNot
(
Gia_ManHashXor
(
pNew
,
pLits
[
0
],
pLits
[
1
]
)
);
else
if
(
Type
==
CBA_BOX_SHARP
)
iRes
=
Gia_ManHashAnd
(
pNew
,
pLits
[
0
],
Abc_LitNot
(
pLits
[
1
])
);
else
if
(
Type
==
CBA_BOX_SHARPL
)
iRes
=
Gia_ManHashAnd
(
pNew
,
Abc_LitNot
(
pLits
[
0
]),
pLits
[
1
]
);
else
assert
(
0
);
}
//printf("%d input\n", nLits );
else
if
(
nLits
==
3
)
{
if
(
Type
==
CBA_BOX_MUX
)
iRes
=
Gia_ManHashMux
(
pNew
,
pLits
[
0
],
pLits
[
1
],
pLits
[
2
]
);
else
if
(
Type
==
CBA_BOX_MAJ
)
iRes
=
Gia_ManHashMaj
(
pNew
,
pLits
[
0
],
pLits
[
1
],
pLits
[
2
]
);
else
if
(
Type
==
CBA_BOX_ADD
)
{
int
iRes0
=
Gia_ManHashAnd
(
pNew
,
pLits
[
1
],
pLits
[
2
]
);
int
iRes1
=
Gia_ManHashOr
(
pNew
,
pLits
[
1
],
pLits
[
2
]
);
assert
(
Cba_BoxBoNum
(
p
,
iBox
)
==
2
);
if
(
Cba_BoxBo
(
p
,
iBox
,
0
)
==
i
)
// sum
iRes
=
Gia_ManHashXor
(
pNew
,
pLits
[
0
],
Gia_ManHashAnd
(
pNew
,
Abc_LitNot
(
iRes0
),
iRes1
)
);
else
if
(
Cba_BoxBo
(
p
,
iBox
,
1
)
==
i
)
// cout
iRes
=
Gia_ManHashOr
(
pNew
,
iRes0
,
Gia_ManHashAnd
(
pNew
,
pLits
[
0
],
iRes1
)
);
else
assert
(
0
);
}
else
assert
(
0
);
}
else
assert
(
0
);
}
}
}
...
...
src/base/cba/cbaNtk.c
View file @
7a4a63d0
...
...
@@ -32,6 +32,67 @@ ABC_NAMESPACE_IMPL_START
/**Function*************************************************************
Synopsis [Replaces fanin iOld by iNew in all fanouts.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Cba_NtkUpdateFanout
(
Cba_Ntk_t
*
p
,
int
iOld
,
int
iNew
)
{
int
iCo
;
assert
(
Cba_ObjIsCi
(
p
,
iOld
)
);
assert
(
Cba_ObjIsCi
(
p
,
iNew
)
);
Cba_ObjForEachFanout
(
p
,
iOld
,
iCo
)
{
assert
(
Cba_ObjFanin
(
p
,
iCo
)
==
iOld
);
Cba_ObjCleanFanin
(
p
,
iCo
);
Cba_ObjSetFanin
(
p
,
iCo
,
iNew
);
}
Cba_ObjSetFanout
(
p
,
iNew
,
Cba_ObjFanout
(
p
,
iOld
)
);
Cba_ObjSetFanout
(
p
,
iOld
,
0
);
}
/**Function*************************************************************
Synopsis [Derives fanout.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Cba_NtkDeriveFanout
(
Cba_Ntk_t
*
p
)
{
int
iCi
,
iCo
;
assert
(
!
Cba_NtkHasFanouts
(
p
)
);
Cba_NtkStartFanouts
(
p
);
Cba_NtkForEachCo
(
p
,
iCo
)
{
assert
(
!
Cba_ObjNextFanout
(
p
,
iCo
)
);
iCi
=
Cba_ObjFanin
(
p
,
iCo
);
if
(
Cba_ObjFanout
(
p
,
iCi
)
)
Cba_ObjSetNextFanout
(
p
,
Cba_ObjFanout
(
p
,
iCi
),
iCo
);
Cba_ObjSetFanout
(
p
,
iCi
,
iCo
);
}
Cba_NtkForEachCo
(
p
,
iCo
)
if
(
!
Cba_ObjNextFanout
(
p
,
iCo
)
)
Cba_ObjSetFanout
(
p
,
Cba_ObjFanin
(
p
,
iCo
),
iCo
);
}
void
Cba_ManDeriveFanout
(
Cba_Man_t
*
p
)
{
Cba_Ntk_t
*
pNtk
;
int
i
;
Cba_ManForEachNtk
(
p
,
pNtk
,
i
)
Cba_NtkDeriveFanout
(
pNtk
);
}
/**Function*************************************************************
Synopsis [Assigns word-level names.]
Description []
...
...
src/base/cba/cbaOper.c
0 → 100644
View file @
7a4a63d0
This diff is collapsed.
Click to expand it.
src/base/cba/cbaPrs.h
View file @
7a4a63d0
...
...
@@ -55,6 +55,10 @@ struct Prs_Ntk_t_
int
iModuleName
;
unsigned
fMapped
:
1
;
unsigned
fSlices
:
1
;
unsigned
fHasC0s
:
1
;
unsigned
fHasC1s
:
1
;
unsigned
fHasCXs
:
1
;
unsigned
fHasCZs
:
1
;
Abc_Nam_t
*
pStrs
;
// interface
Vec_Int_t
vOrder
;
// order of signals
...
...
src/base/cba/cbaReadBlif.c
View file @
7a4a63d0
...
...
@@ -222,6 +222,16 @@ static inline int Prs_ManReadCube( Prs_Man_t * p )
static
inline
void
Prs_ManSaveCover
(
Prs_Man_t
*
p
)
{
int
iToken
;
if
(
Vec_StrSize
(
&
p
->
vCover
)
==
0
)
p
->
pNtk
->
fHasC0s
=
1
;
else
if
(
Vec_StrSize
(
&
p
->
vCover
)
==
2
)
{
if
(
Vec_StrEntryLast
(
&
p
->
vCover
)
==
'0'
)
p
->
pNtk
->
fHasC0s
=
1
;
else
if
(
Vec_StrEntryLast
(
&
p
->
vCover
)
==
'1'
)
p
->
pNtk
->
fHasC1s
=
1
;
else
assert
(
0
);
}
assert
(
Vec_StrSize
(
&
p
->
vCover
)
>
0
);
Vec_StrPush
(
&
p
->
vCover
,
'\0'
);
//iToken = Abc_NamStrFindOrAdd( p->pStrs, Vec_StrArray(&p->vCover), NULL );
...
...
src/base/cba/cbaReadVer.c
View file @
7a4a63d0
...
...
@@ -326,19 +326,39 @@ static inline int Prs_ManReadConstant( Prs_Man_t * p )
{
p
->
pCur
++
;
while
(
Prs_CharIsDigitB
(
*
p
->
pCur
)
)
{
if
(
*
p
->
pCur
==
'0'
)
p
->
pNtk
->
fHasC0s
=
1
;
else
if
(
*
p
->
pCur
==
'1'
)
p
->
pNtk
->
fHasC1s
=
1
;
else
if
(
*
p
->
pCur
==
'x'
)
p
->
pNtk
->
fHasCXs
=
1
;
else
if
(
*
p
->
pCur
==
'z'
)
p
->
pNtk
->
fHasCZs
=
1
;
p
->
pCur
++
;
}
}
else
if
(
Prs_ManIsChar
(
p
,
'h'
)
)
{
p
->
pCur
++
;
p
->
pNtk
->
fHasC0s
=
1
;
while
(
Prs_CharIsDigitH
(
*
p
->
pCur
)
)
{
if
(
*
p
->
pCur
!=
'0'
)
p
->
pNtk
->
fHasC1s
=
1
;
p
->
pCur
++
;
}
}
else
if
(
Prs_ManIsChar
(
p
,
'd'
)
)
{
p
->
pCur
++
;
p
->
pNtk
->
fHasC0s
=
1
;
while
(
Prs_ManIsDigit
(
p
)
)
{
if
(
*
p
->
pCur
!=
'0'
)
p
->
pNtk
->
fHasC1s
=
1
;
p
->
pCur
++
;
}
}
else
return
Prs_ManErrorSet
(
p
,
"Cannot read radix of constant."
,
0
);
return
Abc_NamStrFindOrAddLim
(
p
->
pStrs
,
pStart
,
p
->
pCur
,
NULL
);
...
...
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