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
b29cda08
Commit
b29cda08
authored
Aug 01, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvements to Cba data-structure.
parent
f6a7f695
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
13 deletions
+18
-13
src/base/cba/cba.h
+6
-2
src/base/cba/cbaCom.c
+3
-5
src/base/cba/cbaReadBlif.c
+1
-1
src/base/cba/cbaReadVer.c
+7
-4
src/base/cba/cbaWriteVer.c
+1
-1
No files found.
src/base/cba/cba.h
View file @
b29cda08
...
@@ -692,8 +692,12 @@ static inline Cba_Ntk_t * Cba_NtkDupOrder( Cba_Man_t * pMan, Cba_Ntk_t * p, Vec_
...
@@ -692,8 +692,12 @@ static inline Cba_Ntk_t * Cba_NtkDupOrder( Cba_Man_t * pMan, Cba_Ntk_t * p, Vec_
}
}
static
inline
void
Cba_NtkDupAttrs
(
Cba_Ntk_t
*
pNew
,
Cba_Ntk_t
*
p
)
static
inline
void
Cba_NtkDupAttrs
(
Cba_Ntk_t
*
pNew
,
Cba_Ntk_t
*
p
)
{
{
// Vec_IntRemapArray( &p->vObjCopy, &p->vOrder, &pNew->vOrder, Cba_NtkPioOrderNum(pNew) );
int
i
,
iObj
;
// Vec_IntRemapArray( &p->vObjCopy, &p->vSeq, &pNew->vSeq, Cba_NtkBoxSeqNum(pNew) );
assert
(
Vec_IntSize
(
&
pNew
->
vOrder
)
==
0
);
Cba_NtkForEachPioOrder
(
p
,
iObj
,
i
)
Vec_IntPush
(
&
pNew
->
vOrder
,
Cba_ObjCopy
(
p
,
iObj
)
);
// Vec_IntRemapArray( &p->vObjCopy, &p->vOrder, &pNew->vOrder, Cba_NtkPioOrderNum(p) );
// Vec_IntRemapArray( &p->vObjCopy, &p->vSeq, &pNew->vSeq, Cba_NtkBoxSeqNum(p) );
// transfer object attributes
// transfer object attributes
Vec_IntRemapArray
(
&
p
->
vObjCopy
,
&
p
->
vObjFunc
,
&
pNew
->
vObjFunc
,
Cba_NtkObjNum
(
pNew
)
+
1
);
Vec_IntRemapArray
(
&
p
->
vObjCopy
,
&
p
->
vObjFunc
,
&
pNew
->
vObjFunc
,
Cba_NtkObjNum
(
pNew
)
+
1
);
Vec_IntRemapArray
(
&
p
->
vObjCopy
,
&
p
->
vObjName
,
&
pNew
->
vObjName
,
Cba_NtkObjNum
(
pNew
)
+
1
);
Vec_IntRemapArray
(
&
p
->
vObjCopy
,
&
p
->
vObjName
,
&
pNew
->
vObjName
,
Cba_NtkObjNum
(
pNew
)
+
1
);
...
...
src/base/cba/cbaCom.c
View file @
b29cda08
...
@@ -100,7 +100,6 @@ int Cba_CommandRead( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -100,7 +100,6 @@ int Cba_CommandRead( Abc_Frame_t * pAbc, int argc, char ** argv )
{
{
FILE
*
pFile
;
FILE
*
pFile
;
Cba_Man_t
*
p
=
NULL
;
Cba_Man_t
*
p
=
NULL
;
Vec_Ptr_t
*
vDes
=
NULL
;
char
*
pFileName
=
NULL
;
char
*
pFileName
=
NULL
;
int
c
,
fUseAbc
=
0
,
fUsePtr
=
0
,
fVerbose
=
0
;
int
c
,
fUseAbc
=
0
,
fUsePtr
=
0
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
...
@@ -603,9 +602,8 @@ usage:
...
@@ -603,9 +602,8 @@ usage:
******************************************************************************/
******************************************************************************/
int
Cba_CommandTest
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Cba_CommandTest
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
extern
void
Prs_ManReadBlifTest
();
extern
void
Prs_ManReadVerilogTest
();
//Cba_Man_t * p = Cba_AbcGetMan(pAbc);
Cba_Man_t
*
p
=
Cba_AbcGetMan
(
pAbc
);
int
c
,
fVerbose
=
0
;
int
c
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"vh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"vh"
)
)
!=
EOF
)
...
@@ -628,7 +626,7 @@ int Cba_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -628,7 +626,7 @@ int Cba_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
return 0;
}
}
*/
*/
Prs_ManRead
Blif
Test
();
Prs_ManRead
Verilog
Test
();
return
0
;
return
0
;
usage:
usage:
Abc_Print
(
-
2
,
"usage: @test [-vh]
\n
"
);
Abc_Print
(
-
2
,
"usage: @test [-vh]
\n
"
);
...
...
src/base/cba/cbaReadBlif.c
View file @
b29cda08
...
@@ -604,7 +604,7 @@ Cba_Man_t * Prs_ManBuildCbaBlif( char * pFileName, Vec_Ptr_t * vDes )
...
@@ -604,7 +604,7 @@ Cba_Man_t * Prs_ManBuildCbaBlif( char * pFileName, Vec_Ptr_t * vDes )
// create networks
// create networks
Vec_PtrForEachEntry
(
Prs_Ntk_t
*
,
vDes
,
pPrsNtk
,
i
)
Vec_PtrForEachEntry
(
Prs_Ntk_t
*
,
vDes
,
pPrsNtk
,
i
)
{
{
printf
(
"Elaboration module
\"
%s
\"
...
\n
"
,
Prs_NtkName
(
pPrsNtk
)
,
vDes
);
printf
(
"Elaboration module
\"
%s
\"
...
\n
"
,
Prs_NtkName
(
pPrsNtk
)
);
fError
=
Prs_CreateBlifNtk
(
Cba_ManNtk
(
p
,
i
+
1
),
pPrsNtk
);
fError
=
Prs_CreateBlifNtk
(
Cba_ManNtk
(
p
,
i
+
1
),
pPrsNtk
);
if
(
fError
)
if
(
fError
)
break
;
break
;
...
...
src/base/cba/cbaReadVer.c
View file @
b29cda08
...
@@ -122,6 +122,7 @@ static const char * s_VerilogModules[100] =
...
@@ -122,6 +122,7 @@ static const char * s_VerilogModules[100] =
};
};
static
const
char
*
s_KnownModules
[
100
]
=
static
const
char
*
s_KnownModules
[
100
]
=
{
{
NULL
,
"VERIFIC_"
,
"VERIFIC_"
,
"add_"
,
"add_"
,
"mult_"
,
"mult_"
,
...
@@ -189,7 +190,7 @@ static inline int Prs_ManIsVerilogModule( Prs_Man_t * p, char * pName )
...
@@ -189,7 +190,7 @@ static inline int Prs_ManIsVerilogModule( Prs_Man_t * p, char * pName )
static
inline
int
Prs_ManIsKnownModule
(
Prs_Man_t
*
p
,
char
*
pName
)
static
inline
int
Prs_ManIsKnownModule
(
Prs_Man_t
*
p
,
char
*
pName
)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
s_KnownModules
[
i
];
i
++
)
for
(
i
=
1
;
s_KnownModules
[
i
];
i
++
)
if
(
!
strncmp
(
pName
,
s_KnownModules
[
i
],
strlen
(
s_KnownModules
[
i
]))
)
if
(
!
strncmp
(
pName
,
s_KnownModules
[
i
],
strlen
(
s_KnownModules
[
i
]))
)
return
i
;
return
i
;
return
0
;
return
0
;
...
@@ -839,7 +840,7 @@ Vec_Ptr_t * Prs_ManReadVerilog( char * pFileName )
...
@@ -839,7 +840,7 @@ Vec_Ptr_t * Prs_ManReadVerilog( char * pFileName )
return
NULL
;
return
NULL
;
Prs_NtkAddVerilogDirectives
(
p
);
Prs_NtkAddVerilogDirectives
(
p
);
Prs_ManReadDesign
(
p
);
Prs_ManReadDesign
(
p
);
//
Prs_ManPrintModules( p );
Prs_ManPrintModules
(
p
);
if
(
Prs_ManErrorPrint
(
p
)
)
if
(
Prs_ManErrorPrint
(
p
)
)
ABC_SWAP
(
Vec_Ptr_t
*
,
vPrs
,
p
->
vNtks
);
ABC_SWAP
(
Vec_Ptr_t
*
,
vPrs
,
p
->
vNtks
);
Prs_ManFree
(
p
);
Prs_ManFree
(
p
);
...
@@ -850,15 +851,17 @@ void Prs_ManReadVerilogTest( char * pFileName )
...
@@ -850,15 +851,17 @@ void Prs_ManReadVerilogTest( char * pFileName )
{
{
abctime
clk
=
Abc_Clock
();
abctime
clk
=
Abc_Clock
();
extern
void
Prs_ManWriteVerilog
(
char
*
pFileName
,
Vec_Ptr_t
*
p
);
extern
void
Prs_ManWriteVerilog
(
char
*
pFileName
,
Vec_Ptr_t
*
p
);
Vec_Ptr_t
*
vPrs
=
Prs_ManReadVerilog
(
"c/hie/dump/1/netlist_1.v"
);
//
Vec_Ptr_t * vPrs = Prs_ManReadVerilog( "c/hie/dump/1/netlist_1.v" );
// Vec_Ptr_t * vPrs = Prs_ManReadVerilog( "aga/me/me_wide.v" );
// Vec_Ptr_t * vPrs = Prs_ManReadVerilog( "aga/me/me_wide.v" );
// Vec_Ptr_t * vPrs = Prs_ManReadVerilog( "aga/ray/ray_wide.v" );
// Vec_Ptr_t * vPrs = Prs_ManReadVerilog( "aga/ray/ray_wide.v" );
Vec_Ptr_t
*
vPrs
=
Prs_ManReadVerilog
(
"aga/design/r4000/r4000_all_out.v"
);
if
(
!
vPrs
)
return
;
if
(
!
vPrs
)
return
;
printf
(
"Finished reading %d networks. "
,
Vec_PtrSize
(
vPrs
)
);
printf
(
"Finished reading %d networks. "
,
Vec_PtrSize
(
vPrs
)
);
printf
(
"NameIDs = %d. "
,
Abc_NamObjNumMax
(
Prs_ManNameMan
(
vPrs
))
);
printf
(
"NameIDs = %d. "
,
Abc_NamObjNumMax
(
Prs_ManNameMan
(
vPrs
))
);
printf
(
"Memory = %.2f MB. "
,
1
.
0
*
Prs_ManMemory
(
vPrs
)
/
(
1
<<
20
)
);
printf
(
"Memory = %.2f MB. "
,
1
.
0
*
Prs_ManMemory
(
vPrs
)
/
(
1
<<
20
)
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
Prs_ManWriteVerilog
(
"c/hie/dump/1/netlist_1_out_new.v"
,
vPrs
);
Prs_ManWriteVerilog
(
"aga/design/r4000/r4000_all_out_out.v"
,
vPrs
);
// Prs_ManWriteVerilog( "c/hie/dump/1/netlist_1_out_new.v", vPrs );
// Prs_ManWriteVerilog( "aga/me/me_wide_out.v", vPrs );
// Prs_ManWriteVerilog( "aga/me/me_wide_out.v", vPrs );
// Prs_ManWriteVerilog( "aga/ray/ray_wide_out.v", vPrs );
// Prs_ManWriteVerilog( "aga/ray/ray_wide_out.v", vPrs );
// Abc_NamPrint( p->pStrs );
// Abc_NamPrint( p->pStrs );
...
...
src/base/cba/cbaWriteVer.c
View file @
b29cda08
...
@@ -146,7 +146,7 @@ static void Prs_ManWriteVerilogIoOrder( FILE * pFile, Prs_Ntk_t * p, Vec_Int_t *
...
@@ -146,7 +146,7 @@ static void Prs_ManWriteVerilogIoOrder( FILE * pFile, Prs_Ntk_t * p, Vec_Int_t *
{
{
int
i
,
NameId
;
int
i
,
NameId
;
Vec_IntForEachEntry
(
vOrder
,
NameId
,
i
)
Vec_IntForEachEntry
(
vOrder
,
NameId
,
i
)
fprintf
(
pFile
,
"%s%s"
,
Prs_NtkStr
(
p
,
NameId
),
i
==
Vec_IntSize
(
vOrder
)
-
1
?
""
:
", "
);
fprintf
(
pFile
,
"%s%s"
,
Prs_NtkStr
(
p
,
Abc_Lit2Var2
(
NameId
)
),
i
==
Vec_IntSize
(
vOrder
)
-
1
?
""
:
", "
);
}
}
static
void
Prs_ManWriteVerilogNtk
(
FILE
*
pFile
,
Prs_Ntk_t
*
p
)
static
void
Prs_ManWriteVerilogNtk
(
FILE
*
pFile
,
Prs_Ntk_t
*
p
)
{
{
...
...
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