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
3202c258
Commit
3202c258
authored
Feb 05, 2018
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvements to NDR to represent hierarchical designs.
parent
00fb1d70
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
19 deletions
+21
-19
src/aig/miniaig/ndr.h
+0
-0
src/base/abci/abc.c
+2
-1
src/base/acb/acbAbc.c
+1
-1
src/base/wlc/wlcNdr.c
+18
-17
No files found.
src/aig/miniaig/ndr.h
View file @
3202c258
This diff is collapsed.
Click to expand it.
src/base/abci/abc.c
View file @
3202c258
...
...
@@ -64,6 +64,7 @@
#include "opt/nwk/nwkMerge.h"
#include "base/acb/acbPar.h"
#include "aig/miniaig/ndr.h"
#ifndef _WIN32
#include <unistd.h>
...
...
@@ -13050,7 +13051,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
// Cba_PrsReadBlifTest();
}
// Abc_NtkComputePaths( Abc_FrameReadNtk(pAbc) );
// Psl_FileTest
();
Ndr_ModuleTestHierarchy
();
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: test [-CKDNM] [-aovwh] <file_name>
\n
"
);
src/base/acb/acbAbc.c
View file @
3202c258
...
...
@@ -166,7 +166,7 @@ Acb_Ntk_t * Acb_NtkFromNdr( char * pFileName, void * pModule, Abc_Nam_t * pNames
Ndr_Data_t
*
p
=
(
Ndr_Data_t
*
)
pModule
;
Acb_Man_t
*
pMan
=
Acb_ManAlloc
(
pFileName
,
1
,
Abc_NamRef
(
pNames
),
NULL
,
NULL
,
NULL
);
int
k
,
NameId
=
Abc_NamStrFindOrAdd
(
pMan
->
pStrs
,
pMan
->
pName
,
NULL
);
int
Mod
=
0
,
Obj
,
Type
,
nArray
,
*
pArray
,
ObjId
;
int
Mod
=
2
,
Obj
,
Type
,
nArray
,
*
pArray
,
ObjId
;
Acb_Ntk_t
*
pNtk
=
Acb_NtkAlloc
(
pMan
,
NameId
,
Ndr_DataCiNum
(
p
,
Mod
),
Ndr_DataCoNum
(
p
,
Mod
),
Ndr_DataObjNum
(
p
,
Mod
)
);
Vec_Int_t
*
vMap
=
Vec_IntStart
(
nNameIdMax
);
Acb_NtkCleanObjWeights
(
pNtk
);
...
...
src/base/wlc/wlcNdr.c
View file @
3202c258
...
...
@@ -173,13 +173,14 @@ void * Wlc_NtkToNdr( Wlc_Ntk_t * pNtk )
Wlc_Obj_t
*
pObj
;
int
i
,
k
,
iFanin
,
iOutId
;
// create a new module
void
*
pModule
=
Ndr_ModuleCreate
(
1
);
void
*
pDesign
=
Ndr_Create
(
1
);
int
ModId
=
Ndr_AddModule
(
pDesign
,
1
);
// add primary inputs
Vec_Int_t
*
vFanins
=
Vec_IntAlloc
(
10
);
Wlc_NtkForEachPi
(
pNtk
,
pObj
,
i
)
{
iOutId
=
Wlc_ObjId
(
pNtk
,
pObj
);
Ndr_
ModuleAddObject
(
pModule
,
ABC_OPER_CI
,
0
,
Ndr_
AddObject
(
pDesign
,
ModId
,
ABC_OPER_CI
,
0
,
pObj
->
End
,
pObj
->
Beg
,
pObj
->
Signed
,
0
,
NULL
,
1
,
&
iOutId
,
NULL
);
// no fanins
}
...
...
@@ -194,7 +195,7 @@ void * Wlc_NtkToNdr( Wlc_Ntk_t * pNtk )
Vec_IntPush
(
vFanins
,
iFanin
);
if
(
pObj
->
Type
==
WLC_OBJ_CONST
)
pFunction
=
Ndr_ObjWriteConstant
(
(
unsigned
*
)
Wlc_ObjFanins
(
pObj
),
Wlc_ObjRange
(
pObj
)
);
Ndr_
ModuleAddObject
(
pModule
,
Ndr_TypeWlc2Ndr
(
pObj
->
Type
),
0
,
Ndr_
AddObject
(
pDesign
,
ModId
,
Ndr_TypeWlc2Ndr
(
pObj
->
Type
),
0
,
pObj
->
End
,
pObj
->
Beg
,
pObj
->
Signed
,
Vec_IntSize
(
vFanins
),
Vec_IntArray
(
vFanins
),
1
,
&
iOutId
,
pFunction
);
}
...
...
@@ -204,24 +205,24 @@ void * Wlc_NtkToNdr( Wlc_Ntk_t * pNtk )
if
(
!
Wlc_ObjIsPo
(
pObj
)
)
continue
;
Vec_IntFill
(
vFanins
,
1
,
iOutId
);
Ndr_
ModuleAddObject
(
pModule
,
ABC_OPER_CO
,
0
,
Ndr_
AddObject
(
pDesign
,
ModId
,
ABC_OPER_CO
,
0
,
pObj
->
End
,
pObj
->
Beg
,
pObj
->
Signed
,
1
,
Vec_IntArray
(
vFanins
),
0
,
NULL
,
NULL
);
}
Vec_IntFree
(
vFanins
);
return
p
Module
;
return
p
Design
;
}
void
Wlc_WriteNdr
(
Wlc_Ntk_t
*
pNtk
,
char
*
pFileName
)
{
void
*
p
Module
=
Wlc_NtkToNdr
(
pNtk
);
Ndr_
ModuleWrite
(
pFileName
,
pModule
);
Ndr_
ModuleDelete
(
pModule
);
void
*
p
Design
=
Wlc_NtkToNdr
(
pNtk
);
Ndr_
Write
(
pFileName
,
pDesign
);
Ndr_
Delete
(
pDesign
);
printf
(
"Dumped the current design into file
\"
%s
\"
.
\n
"
,
pFileName
);
}
void
Wlc_NtkToNdrTest
(
Wlc_Ntk_t
*
pNtk
)
{
// transform
void
*
p
Module
=
Wlc_NtkToNdr
(
pNtk
);
void
*
p
Design
=
Wlc_NtkToNdr
(
pNtk
);
// collect names
Wlc_Obj_t
*
pObj
;
int
i
;
...
...
@@ -230,11 +231,11 @@ void Wlc_NtkToNdrTest( Wlc_Ntk_t * pNtk )
ppNames
[
i
]
=
Wlc_ObjName
(
pNtk
,
i
);
// verify by writing Verilog
Ndr_
ModuleWriteVerilog
(
NULL
,
pModule
,
ppNames
);
Ndr_
ModuleWrite
(
"test.ndr"
,
pModule
);
Ndr_
WriteVerilog
(
NULL
,
pDesign
,
ppNames
);
Ndr_
Write
(
"test.ndr"
,
pDesign
);
// cleanup
Ndr_
ModuleDelete
(
pModule
);
Ndr_
Delete
(
pDesign
);
ABC_FREE
(
ppNames
);
}
...
...
@@ -305,8 +306,8 @@ Wlc_Ntk_t * Wlc_NtkFromNdr( void * pData )
{
Ndr_Data_t
*
p
=
(
Ndr_Data_t
*
)
pData
;
Wlc_Obj_t
*
pObj
;
Vec_Int_t
*
vName2Obj
,
*
vFanins
=
Vec_IntAlloc
(
100
);
Wlc_Ntk_t
*
pTemp
,
*
pNtk
=
Wlc_NtkAlloc
(
"top"
,
Ndr_DataObjNum
(
p
,
0
)
+
1
)
;
int
Mod
=
0
,
i
,
k
,
Obj
,
*
pArray
,
nDigits
,
fFound
,
NameId
,
NameIdMax
;
int
Mod
=
2
,
i
,
k
,
Obj
,
*
pArray
,
nDigits
,
fFound
,
NameId
,
NameIdMax
;
Wlc_Ntk_t
*
pTemp
,
*
pNtk
=
Wlc_NtkAlloc
(
"top"
,
Ndr_DataObjNum
(
p
,
Mod
)
+
1
)
;
//pNtk->pSpec = Abc_UtilStrsav( pFileName );
// construct network and save name IDs
Wlc_NtkCleanNameId
(
pNtk
);
...
...
@@ -384,11 +385,11 @@ Wlc_Ntk_t * Wlc_NtkFromNdr( void * pData )
***********************************************************************/
Wlc_Ntk_t
*
Wlc_ReadNdr
(
char
*
pFileName
)
{
void
*
pData
=
Ndr_
Module
Read
(
pFileName
);
void
*
pData
=
Ndr_Read
(
pFileName
);
Wlc_Ntk_t
*
pNtk
=
Wlc_NtkFromNdr
(
pData
);
//char * ppNames[10] = { NULL, "a", "b", "c", "d", "e", "f", "g", "h", "i" };
//Ndr_
Module
WriteVerilog( NULL, pData, ppNames );
Ndr_
Module
Delete
(
pData
);
//Ndr_WriteVerilog( NULL, pData, ppNames );
Ndr_Delete
(
pData
);
return
pNtk
;
}
void
Wlc_ReadNdrTest
()
...
...
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