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
ee261ef3
Commit
ee261ef3
authored
Jul 20, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Other changes to enable new features in the mapper (bug fix).
parent
bb86d914
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
125 additions
and
7 deletions
+125
-7
src/base/abc/abc.h
+1
-0
src/base/abc/abcNtk.c
+3
-0
src/base/abci/abcIf.c
+0
-0
src/base/io/ioReadBlifMv.c
+104
-0
src/map/if/if.h
+2
-1
src/map/if/ifMap.c
+15
-6
No files found.
src/base/abc/abc.h
View file @
ee261ef3
...
...
@@ -212,6 +212,7 @@ struct Abc_Ntk_t_
float
*
pLutTimes
;
// arrivals/requireds/slacks using LUT-delay model
Vec_Ptr_t
*
vOnehots
;
// names of one-hot-encoded registers
Vec_Int_t
*
vObjPerm
;
// permutation saved
Vec_Vec_t
*
vRealPos
;
// additional PO info
// node attributes
Vec_Ptr_t
*
vAttrs
;
// managers of various node attributes (node functionality, global BDDs, etc)
};
...
...
src/base/abc/abcNtk.c
View file @
ee261ef3
...
...
@@ -111,6 +111,7 @@ Abc_Ntk_t * Abc_NtkStartFrom( Abc_Ntk_t * pNtk, Abc_NtkType_t Type, Abc_NtkFunc_
pNtkNew
=
Abc_NtkAlloc
(
Type
,
Func
,
1
);
pNtkNew
->
nConstrs
=
pNtk
->
nConstrs
;
pNtkNew
->
nRealPos
=
pNtk
->
nRealPos
;
pNtkNew
->
vRealPos
=
pNtk
->
vRealPos
?
Vec_VecDup
(
pNtk
->
vRealPos
)
:
NULL
;
// duplicate the name and the spec
pNtkNew
->
pName
=
Extra_UtilStrsav
(
pNtk
->
pName
);
pNtkNew
->
pSpec
=
Extra_UtilStrsav
(
pNtk
->
pSpec
);
...
...
@@ -165,6 +166,7 @@ Abc_Ntk_t * Abc_NtkStartFromNoLatches( Abc_Ntk_t * pNtk, Abc_NtkType_t Type, Abc
pNtkNew
=
Abc_NtkAlloc
(
Type
,
Func
,
1
);
pNtkNew
->
nConstrs
=
pNtk
->
nConstrs
;
pNtkNew
->
nRealPos
=
pNtk
->
nRealPos
;
pNtkNew
->
vRealPos
=
pNtk
->
vRealPos
?
Vec_VecDup
(
pNtk
->
vRealPos
)
:
NULL
;
// duplicate the name and the spec
pNtkNew
->
pName
=
Extra_UtilStrsav
(
pNtk
->
pName
);
pNtkNew
->
pSpec
=
Extra_UtilStrsav
(
pNtk
->
pSpec
);
...
...
@@ -1045,6 +1047,7 @@ void Abc_NtkDelete( Abc_Ntk_t * pNtk )
Vec_VecFree
(
(
Vec_Vec_t
*
)
pNtk
->
vOnehots
);
Vec_PtrFreeP
(
&
pNtk
->
vLtlProperties
);
Vec_IntFreeP
(
&
pNtk
->
vObjPerm
);
Vec_VecFreeP
(
&
pNtk
->
vRealPos
);
ABC_FREE
(
pNtk
);
}
...
...
src/base/abci/abcIf.c
View file @
ee261ef3
This diff is collapsed.
Click to expand it.
src/base/io/ioReadBlifMv.c
View file @
ee261ef3
...
...
@@ -120,6 +120,8 @@ static Io_MvVar_t * Abc_NtkMvVarDup( Abc_Ntk_t * pNtk, Io_MvVar_t * pVar );
static
int
Io_MvCharIsSpace
(
char
s
)
{
return
s
==
' '
||
s
==
'\t'
||
s
==
'\r'
||
s
==
'\n'
;
}
static
int
Io_MvCharIsMvSymb
(
char
s
)
{
return
s
==
'('
||
s
==
')'
||
s
==
'{'
||
s
==
'}'
||
s
==
'-'
||
s
==
','
||
s
==
'!'
;
}
static
Vec_Vec_t
*
Io_MvExtractBoxInfo
(
Abc_Ntk_t
*
pNtk
);
extern
void
Abc_NtkStartMvVars
(
Abc_Ntk_t
*
pNtk
);
////////////////////////////////////////////////////////////////////////
...
...
@@ -233,6 +235,8 @@ Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck )
Vec_PtrForEachEntry
(
char
*
,
vGlobalLtlArray
,
pLtlProp
,
i
)
Vec_PtrPush
(
pNtk
->
vLtlProperties
,
pLtlProp
);
Vec_PtrFreeP
(
&
vGlobalLtlArray
);
pNtk
->
vRealPos
=
Io_MvExtractBoxInfo
(
pNtk
);
return
pNtk
;
}
...
...
@@ -2105,6 +2109,106 @@ static int Io_MvParseLineGateBlif( Io_MvMod_t * p, Vec_Ptr_t * vTokens )
return
1
;
}
/**Function*************************************************************
Synopsis [Box mapping procedures.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
void
Abc_MapBoxSetPrevNext
(
Vec_Ptr_t
*
vDrivers
,
Vec_Int_t
*
vMapIn
,
Vec_Int_t
*
vMapOut
,
int
Id
)
{
Abc_Obj_t
*
pNode
;
pNode
=
(
Abc_Obj_t
*
)
Vec_PtrEntry
(
vDrivers
,
Id
+
2
);
Vec_IntWriteEntry
(
vMapIn
,
Abc_ObjId
(
Abc_ObjFanin0
(
Abc_ObjFanin0
(
pNode
))),
Id
);
pNode
=
(
Abc_Obj_t
*
)
Vec_PtrEntry
(
vDrivers
,
Id
+
4
);
Vec_IntWriteEntry
(
vMapOut
,
Abc_ObjId
(
Abc_ObjFanin0
(
Abc_ObjFanin0
(
pNode
))),
Id
);
}
static
inline
int
Abc_MapBox2Next
(
Vec_Ptr_t
*
vDrivers
,
Vec_Int_t
*
vMapIn
,
Vec_Int_t
*
vMapOut
,
int
Id
)
{
Abc_Obj_t
*
pNode
=
(
Abc_Obj_t
*
)
Vec_PtrEntry
(
vDrivers
,
Id
+
4
);
return
Vec_IntEntry
(
vMapIn
,
Abc_ObjId
(
Abc_ObjFanin0
(
Abc_ObjFanin0
(
pNode
)))
);
}
static
inline
int
Abc_MapBox2Prev
(
Vec_Ptr_t
*
vDrivers
,
Vec_Int_t
*
vMapIn
,
Vec_Int_t
*
vMapOut
,
int
Id
)
{
Abc_Obj_t
*
pNode
=
(
Abc_Obj_t
*
)
Vec_PtrEntry
(
vDrivers
,
Id
+
2
);
return
Vec_IntEntry
(
vMapOut
,
Abc_ObjId
(
Abc_ObjFanin0
(
Abc_ObjFanin0
(
pNode
)))
);
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
Vec_Vec_t
*
Io_MvExtractBoxInfo
(
Abc_Ntk_t
*
pNtk
)
{
Vec_Int_t
*
vMapIn
,
*
vMapOut
,
*
vList
;
Vec_Ptr_t
*
vBoxInfo
,
*
vDrivers
;
Abc_Obj_t
*
pObj
;
int
i
,
boxId
;
// quit if there is no boxes
if
(
pNtk
->
nRealPos
==
0
||
(
Abc_NtkPoNum
(
pNtk
)
-
pNtk
->
nRealPos
)
%
5
!=
0
)
return
NULL
;
// allocate
vBoxInfo
=
Vec_PtrAlloc
(
10
);
vDrivers
=
Vec_PtrAlloc
(
Abc_NtkPoNum
(
pNtk
)
);
vMapIn
=
Vec_IntStartFull
(
Abc_NtkObjNumMax
(
pNtk
)
);
vMapOut
=
Vec_IntStartFull
(
Abc_NtkObjNumMax
(
pNtk
)
);
// collect drivers
Abc_NtkForEachPo
(
pNtk
,
pObj
,
i
)
Vec_PtrPush
(
vDrivers
,
Abc_ObjFanin0
(
Abc_ObjFanin0
(
pObj
))
);
// map box signals into box numbers
for
(
i
=
pNtk
->
nRealPos
;
i
<
Abc_NtkPoNum
(
pNtk
);
i
+=
5
)
{
// int k;
// for ( k = 0; k < 5; k++ )
// printf( "%d ", Abc_ObjFanin0(Abc_ObjFanin0(Abc_ObjFanin0(Abc_NtkPo(pNtk,i+k))))->Id );
// printf( "\n" );
Abc_MapBoxSetPrevNext
(
vDrivers
,
vMapIn
,
vMapOut
,
i
);
}
// find those that do not have input mapped
for
(
i
=
pNtk
->
nRealPos
;
i
<
Abc_NtkPoNum
(
pNtk
);
i
+=
5
)
{
if
(
Abc_MapBox2Prev
(
vDrivers
,
vMapIn
,
vMapOut
,
i
)
!=
~
0
)
continue
;
// create new list
vList
=
Vec_IntAlloc
(
32
);
boxId
=
i
;
while
(
boxId
!=
~
0
)
{
Vec_IntPush
(
vList
,
boxId
);
boxId
=
Abc_MapBox2Next
(
vDrivers
,
vMapIn
,
vMapOut
,
boxId
);
}
Vec_PtrPush
(
vBoxInfo
,
vList
);
//printf( " %d", Vec_IntSize(vList) );
}
//printf( "\n" );
if
(
5
*
Vec_VecSizeSize
((
Vec_Vec_t
*
)
vBoxInfo
)
!=
(
Abc_NtkPoNum
(
pNtk
)
-
pNtk
->
nRealPos
)
)
printf
(
"Mismatch in the number of boxes!!!
\n
"
);
// clean up
Vec_IntFree
(
vMapIn
);
Vec_IntFree
(
vMapOut
);
Vec_PtrFree
(
vDrivers
);
return
(
Vec_Vec_t
*
)
vBoxInfo
;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
...
...
src/map/if/if.h
View file @
ee261ef3
...
...
@@ -231,7 +231,8 @@ struct If_Obj_t_
unsigned
fVisit
:
1
;
// multipurpose mark
unsigned
fSpec
:
1
;
// multipurpose mark
unsigned
fDriver
:
1
;
// multipurpose mark
unsigned
Level
:
20
;
// logic level of the node
unsigned
fSkipCut
:
1
;
// multipurpose mark
unsigned
Level
:
19
;
// logic level of the node
int
Id
;
// integer ID
int
IdPio
;
// integer ID of PIs/POs
int
nRefs
;
// the number of references
...
...
src/map/if/ifMap.c
View file @
ee261ef3
...
...
@@ -94,8 +94,11 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
If_Cut_t
*
pCut0
,
*
pCut1
,
*
pCut
;
int
i
,
k
;
assert
(
p
->
pPars
->
fSeqMap
||
!
If_ObjIsAnd
(
pObj
->
pFanin0
)
||
pObj
->
pFanin0
->
pCutSet
->
nCuts
>
1
);
assert
(
p
->
pPars
->
fSeqMap
||
!
If_ObjIsAnd
(
pObj
->
pFanin1
)
||
pObj
->
pFanin1
->
pCutSet
->
nCuts
>
1
);
// assert( p->pPars->fSeqMap || !If_ObjIsAnd(pObj->pFanin0) || pObj->pFanin0->pCutSet->nCuts > 1 );
// assert( p->pPars->fSeqMap || !If_ObjIsAnd(pObj->pFanin1) || pObj->pFanin1->pCutSet->nCuts > 1 );
assert
(
p
->
pPars
->
fSeqMap
||
!
If_ObjIsAnd
(
pObj
->
pFanin0
)
||
pObj
->
pFanin0
->
pCutSet
->
nCuts
>
0
);
assert
(
p
->
pPars
->
fSeqMap
||
!
If_ObjIsAnd
(
pObj
->
pFanin1
)
||
pObj
->
pFanin1
->
pCutSet
->
nCuts
>
0
);
// prepare
if
(
!
p
->
pPars
->
fSeqMap
)
...
...
@@ -232,8 +235,11 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
assert
(
pCutSet
->
nCuts
>
0
);
// add the trivial cut to the set
If_ManSetupCutTriv
(
p
,
pCutSet
->
ppCuts
[
pCutSet
->
nCuts
++
],
pObj
->
Id
);
assert
(
pCutSet
->
nCuts
<=
pCutSet
->
nCutsMax
+
1
);
if
(
!
pObj
->
fSkipCut
)
{
If_ManSetupCutTriv
(
p
,
pCutSet
->
ppCuts
[
pCutSet
->
nCuts
++
],
pObj
->
Id
);
assert
(
pCutSet
->
nCuts
<=
pCutSet
->
nCutsMax
+
1
);
}
// update the best cut
if
(
!
fPreprocess
||
pCutSet
->
ppCuts
[
0
]
->
Delay
<=
pObj
->
Required
+
p
->
fEpsilon
)
...
...
@@ -325,8 +331,11 @@ void If_ObjPerformMappingChoice( If_Man_t * p, If_Obj_t * pObj, int Mode, int fP
assert
(
pCutSet
->
nCuts
>
0
);
// add the trivial cut to the set
If_ManSetupCutTriv
(
p
,
pCutSet
->
ppCuts
[
pCutSet
->
nCuts
++
],
pObj
->
Id
);
assert
(
pCutSet
->
nCuts
<=
pCutSet
->
nCutsMax
+
1
);
if
(
!
pObj
->
fSkipCut
)
{
If_ManSetupCutTriv
(
p
,
pCutSet
->
ppCuts
[
pCutSet
->
nCuts
++
],
pObj
->
Id
);
assert
(
pCutSet
->
nCuts
<=
pCutSet
->
nCutsMax
+
1
);
}
// update the best cut
if
(
!
fPreprocess
||
pCutSet
->
ppCuts
[
0
]
->
Delay
<=
pObj
->
Required
+
p
->
fEpsilon
)
...
...
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