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
fd80bf20
Commit
fd80bf20
authored
Jul 16, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding another network duplicator.
parent
f8f37d26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
src/base/abc/abcNtk.c
+58
-0
No files found.
src/base/abc/abcNtk.c
View file @
fd80bf20
...
@@ -696,6 +696,64 @@ Abc_Ntk_t * Abc_NtkDouble( Abc_Ntk_t * pNtk )
...
@@ -696,6 +696,64 @@ Abc_Ntk_t * Abc_NtkDouble( Abc_Ntk_t * pNtk )
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Duplicate the bottom levels of the network.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Abc_Ntk_t
*
Abc_NtkBottom
(
Abc_Ntk_t
*
pNtk
,
int
Level
)
{
char
Buffer
[
500
];
Abc_Ntk_t
*
pNtkNew
;
Abc_Obj_t
*
pObj
,
*
pFanin
;
int
i
,
k
;
assert
(
Abc_NtkIsLogic
(
pNtk
)
);
assert
(
Abc_NtkLatchNum
(
pNtk
)
==
0
);
// start the network
pNtkNew
=
Abc_NtkAlloc
(
pNtk
->
ntkType
,
pNtk
->
ntkFunc
,
1
);
sprintf
(
Buffer
,
"%s%s"
,
pNtk
->
pName
,
"_bot"
);
pNtkNew
->
pName
=
Extra_UtilStrsav
(
Buffer
);
// clean the node copy fields
Abc_NtkCleanCopy
(
pNtk
);
// clone CIs/CIs/boxes
Abc_NtkForEachPi
(
pNtk
,
pObj
,
i
)
Abc_NtkDupObj
(
pNtkNew
,
pObj
,
1
);
// copy the internal nodes
// duplicate the nets and nodes (CIs/COs/latches already dupped)
Abc_NtkForEachObj
(
pNtk
,
pObj
,
i
)
if
(
pObj
->
pCopy
==
NULL
&&
Abc_ObjIsNode
(
pObj
)
&&
Abc_ObjLevel
(
pObj
)
<=
Level
)
Abc_NtkDupObj
(
pNtkNew
,
pObj
,
0
);
// reconnect all objects (no need to transfer attributes on edges)
Abc_NtkForEachObj
(
pNtk
,
pObj
,
i
)
Abc_ObjForEachFanin
(
pObj
,
pFanin
,
k
)
if
(
pObj
->
pCopy
&&
pFanin
->
pCopy
)
Abc_ObjAddFanin
(
pObj
->
pCopy
,
pFanin
->
pCopy
);
// create new primary outputs
Abc_NtkForEachNode
(
pNtk
,
pObj
,
i
)
Abc_ObjForEachFanin
(
pObj
,
pFanin
,
k
)
if
(
pObj
->
pCopy
==
NULL
&&
pFanin
->
pCopy
!=
NULL
&&
Abc_ObjIsNode
(
pFanin
)
)
{
Abc_Obj_t
*
pNodeNew
=
Abc_NtkCreatePo
(
pNtkNew
);
Abc_ObjAddFanin
(
pNodeNew
,
pFanin
->
pCopy
);
Abc_ObjAssignName
(
pNodeNew
,
Abc_ObjName
(
pNodeNew
),
NULL
);
}
// perform the final check
if
(
!
Abc_NtkCheck
(
pNtkNew
)
)
fprintf
(
stdout
,
"Abc_NtkBottom(): Network check has failed.
\n
"
);
return
pNtkNew
;
}
/**Function*************************************************************
Synopsis [Attaches the second network at the bottom of the first.]
Synopsis [Attaches the second network at the bottom of the first.]
Description [Returns the first network. Deletes the second network.]
Description [Returns the first network. Deletes the second network.]
...
...
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