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
96d8f899
Commit
96d8f899
authored
Nov 08, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extending and improving timing manager.
parent
e50fc467
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
184 additions
and
39 deletions
+184
-39
abclib.dsp
+5
-1
src/map/mio/mioApi.c
+2
-0
src/map/mio/mioInt.h
+1
-0
src/map/scl/sclLib.h
+134
-0
src/map/scl/sclLibScl.c
+24
-3
src/opt/fret/fretMain.c
+1
-1
src/opt/sfm/module.make
+2
-1
src/opt/sfm/sfmDec.c
+0
-0
src/opt/sfm/sfmInt.h
+12
-1
src/opt/sfm/sfmMit.c
+0
-0
src/opt/sfm/sfmTim.c
+3
-32
No files found.
abclib.dsp
View file @
96d8f899
...
@@ -2535,6 +2535,10 @@ SOURCE=.\src\opt\sfm\sfmLib.c
...
@@ -2535,6 +2535,10 @@ SOURCE=.\src\opt\sfm\sfmLib.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
SOURCE=.\src\opt\sfm\sfmMit.c
# End Source File
# Begin Source File
SOURCE=.\src\opt\sfm\sfmNtk.c
SOURCE=.\src\opt\sfm\sfmNtk.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
...
@@ -2543,7 +2547,7 @@ SOURCE=.\src\opt\sfm\sfmSat.c
...
@@ -2543,7 +2547,7 @@ SOURCE=.\src\opt\sfm\sfmSat.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
SOURCE=.\src\opt\sfm\sfmTim
e
.c
SOURCE=.\src\opt\sfm\sfmTim.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
...
...
src/map/mio/mioApi.c
View file @
96d8f899
...
@@ -178,7 +178,9 @@ Vec_Int_t * Mio_GateReadExpr ( Mio_Gate_t * pGate ) { return
...
@@ -178,7 +178,9 @@ Vec_Int_t * Mio_GateReadExpr ( Mio_Gate_t * pGate ) { return
word
Mio_GateReadTruth
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
nInputs
<=
6
?
pGate
->
uTruth
:
0
;
}
word
Mio_GateReadTruth
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
nInputs
<=
6
?
pGate
->
uTruth
:
0
;
}
word
*
Mio_GateReadTruthP
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
nInputs
<=
6
?
NULL
:
pGate
->
pTruth
;
}
word
*
Mio_GateReadTruthP
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
nInputs
<=
6
?
NULL
:
pGate
->
pTruth
;
}
int
Mio_GateReadValue
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
Value
;
}
int
Mio_GateReadValue
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
Value
;
}
int
Mio_GateReadCell
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
Cell
;
}
void
Mio_GateSetValue
(
Mio_Gate_t
*
pGate
,
int
Value
)
{
pGate
->
Value
=
Value
;
}
void
Mio_GateSetValue
(
Mio_Gate_t
*
pGate
,
int
Value
)
{
pGate
->
Value
=
Value
;
}
void
Mio_GateSetCell
(
Mio_Gate_t
*
pGate
,
int
Cell
)
{
pGate
->
Value
=
Cell
;
}
int
Mio_GateIsInv
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
uTruth
==
ABC_CONST
(
0x5555555555555555
);
}
int
Mio_GateIsInv
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
uTruth
==
ABC_CONST
(
0x5555555555555555
);
}
/**Function*************************************************************
/**Function*************************************************************
...
...
src/map/mio/mioInt.h
View file @
96d8f899
...
@@ -93,6 +93,7 @@ struct Mio_GateStruct_t_
...
@@ -93,6 +93,7 @@ struct Mio_GateStruct_t_
Mio_Gate_t
*
pTwin
;
Mio_Gate_t
*
pTwin
;
// the derived information
// the derived information
int
Cell
;
// cell id
int
nInputs
;
// the number of inputs
int
nInputs
;
// the number of inputs
double
dDelayMax
;
// the maximum delay
double
dDelayMax
;
// the maximum delay
char
*
pSop
;
// sum-of-products
char
*
pSop
;
// sum-of-products
...
...
src/map/scl/sclLib.h
View file @
96d8f899
...
@@ -65,6 +65,12 @@ struct SC_Pair_
...
@@ -65,6 +65,12 @@ struct SC_Pair_
float
rise
;
float
rise
;
float
fall
;
float
fall
;
};
};
typedef
struct
SC_PairI_
SC_PairI
;
struct
SC_PairI_
{
int
rise
;
int
fall
;
};
typedef
struct
SC_SizePars_
SC_SizePars
;
typedef
struct
SC_SizePars_
SC_SizePars
;
struct
SC_SizePars_
struct
SC_SizePars_
...
@@ -144,6 +150,9 @@ struct SC_Surface_
...
@@ -144,6 +150,9 @@ struct SC_Surface_
Vec_Flt_t
vIndex0
;
// Vec<float> -- correspondes to "index_1" in the liberty file (for timing: slew)
Vec_Flt_t
vIndex0
;
// Vec<float> -- correspondes to "index_1" in the liberty file (for timing: slew)
Vec_Flt_t
vIndex1
;
// Vec<float> -- correspondes to "index_2" in the liberty file (for timing: load)
Vec_Flt_t
vIndex1
;
// Vec<float> -- correspondes to "index_2" in the liberty file (for timing: load)
Vec_Ptr_t
vData
;
// Vec<Vec<float> > -- 'data[i0][i1]' gives value at '(index0[i0], index1[i1])'
Vec_Ptr_t
vData
;
// Vec<Vec<float> > -- 'data[i0][i1]' gives value at '(index0[i0], index1[i1])'
Vec_Int_t
vIndex0I
;
// Vec<float> -- correspondes to "index_1" in the liberty file (for timing: slew)
Vec_Int_t
vIndex1I
;
// Vec<float> -- correspondes to "index_2" in the liberty file (for timing: load)
Vec_Ptr_t
vDataI
;
// Vec<Vec<float> > -- 'data[i0][i1]' gives value at '(index0[i0], index1[i1])'
float
approx
[
3
][
6
];
float
approx
[
3
][
6
];
};
};
...
@@ -171,6 +180,8 @@ struct SC_Pin_
...
@@ -171,6 +180,8 @@ struct SC_Pin_
float
cap
;
// -- this value is used if 'rise_cap' and 'fall_cap' is missing (copied by 'postProcess()'). (not used)
float
cap
;
// -- this value is used if 'rise_cap' and 'fall_cap' is missing (copied by 'postProcess()'). (not used)
float
rise_cap
;
// }- used for input pins ('cap' too).
float
rise_cap
;
// }- used for input pins ('cap' too).
float
fall_cap
;
// }
float
fall_cap
;
// }
float
rise_capI
;
// }- used for input pins ('cap' too).
float
fall_capI
;
// }
float
max_out_cap
;
// } (not used)
float
max_out_cap
;
// } (not used)
float
max_out_slew
;
// }- used only for output pins (max values must not be exceeded or else mapping is illegal) (not used)
float
max_out_slew
;
// }- used only for output pins (max values must not be exceeded or else mapping is illegal) (not used)
char
*
func_text
;
// }
char
*
func_text
;
// }
...
@@ -188,6 +199,8 @@ struct SC_Cell_
...
@@ -188,6 +199,8 @@ struct SC_Cell_
int
unsupp
;
// -- set to TRUE by parser if cell contains information we cannot handle
int
unsupp
;
// -- set to TRUE by parser if cell contains information we cannot handle
float
area
;
float
area
;
float
leakage
;
float
leakage
;
float
areaI
;
float
leakageI
;
int
drive_strength
;
// -- some library files provide this field (currently unused, but may be a good hint for sizing) (not used)
int
drive_strength
;
// -- some library files provide this field (currently unused, but may be a good hint for sizing) (not used)
Vec_Ptr_t
vPins
;
// NamedSet<SC_Pin>
Vec_Ptr_t
vPins
;
// NamedSet<SC_Pin>
int
n_inputs
;
// -- 'pins[0 .. n_inputs-1]' are input pins
int
n_inputs
;
// -- 'pins[0 .. n_inputs-1]' are input pins
...
@@ -372,7 +385,10 @@ static inline void Abc_SclSurfaceFree( SC_Surface * p )
...
@@ -372,7 +385,10 @@ static inline void Abc_SclSurfaceFree( SC_Surface * p )
{
{
Vec_FltErase
(
&
p
->
vIndex0
);
Vec_FltErase
(
&
p
->
vIndex0
);
Vec_FltErase
(
&
p
->
vIndex1
);
Vec_FltErase
(
&
p
->
vIndex1
);
Vec_IntErase
(
&
p
->
vIndex0I
);
Vec_IntErase
(
&
p
->
vIndex1I
);
Vec_VecErase
(
(
Vec_Vec_t
*
)
&
p
->
vData
);
Vec_VecErase
(
(
Vec_Vec_t
*
)
&
p
->
vData
);
Vec_VecErase
(
(
Vec_Vec_t
*
)
&
p
->
vDataI
);
ABC_FREE
(
p
->
pName
);
ABC_FREE
(
p
->
pName
);
// ABC_FREE( p );
// ABC_FREE( p );
}
}
...
@@ -531,6 +547,84 @@ static inline void Scl_LibPinDeparture( SC_Timing * pTime, SC_Pair * pDepIn, SC_
...
@@ -531,6 +547,84 @@ static inline void Scl_LibPinDeparture( SC_Timing * pTime, SC_Pair * pDepIn, SC_
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Lookup table delay computation.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
int
Scl_LibLookupI
(
SC_Surface
*
p
,
int
slew
,
int
load
)
{
int
*
pIndex0
,
*
pIndex1
,
*
pDataS
,
*
pDataS1
;
int
p0
,
p1
,
s
,
l
;
iword
lFrac0
,
lFrac1
,
sFrac
;
// handle constant table
if
(
Vec_IntSize
(
&
p
->
vIndex0I
)
==
1
&&
Vec_IntSize
(
&
p
->
vIndex1I
)
==
1
)
{
Vec_Int_t
*
vTemp
=
(
Vec_Int_t
*
)
Vec_PtrEntry
(
&
p
->
vDataI
,
0
);
assert
(
Vec_PtrSize
(
&
p
->
vDataI
)
==
1
);
assert
(
Vec_IntSize
(
vTemp
)
==
1
);
return
Vec_IntEntry
(
vTemp
,
0
);
}
// Find closest sample points in surface:
pIndex0
=
Vec_IntArray
(
&
p
->
vIndex0I
);
for
(
s
=
1
;
s
<
Vec_IntSize
(
&
p
->
vIndex0I
)
-
1
;
s
++
)
if
(
pIndex0
[
s
]
>
slew
)
break
;
s
--
;
pIndex1
=
Vec_IntArray
(
&
p
->
vIndex1I
);
for
(
l
=
1
;
l
<
Vec_IntSize
(
&
p
->
vIndex1I
)
-
1
;
l
++
)
if
(
pIndex1
[
l
]
>
load
)
break
;
l
--
;
pDataS
=
Vec_IntArray
(
(
Vec_Int_t
*
)
Vec_PtrEntry
(
&
p
->
vDataI
,
s
)
);
pDataS1
=
Vec_IntArray
(
(
Vec_Int_t
*
)
Vec_PtrEntry
(
&
p
->
vDataI
,
s
+
1
)
);
// Interpolate (or extrapolate) function value from sample points:
// lfrac = (load - pIndex1[l]) / (pIndex1[l+1] - pIndex1[l]);
// sfrac = (slew - pIndex0[s]) / (pIndex0[s+1] - pIndex0[s]);
lFrac0
=
(
iword
)(
pDataS
[
l
+
1
]
-
pDataS
[
l
])
*
(
iword
)(
load
-
pIndex1
[
l
])
/
(
iword
)(
pIndex1
[
l
+
1
]
-
pIndex1
[
l
]);
lFrac1
=
(
iword
)(
pDataS1
[
l
+
1
]
-
pDataS1
[
l
])
*
(
iword
)(
load
-
pIndex1
[
l
])
/
(
iword
)(
pIndex1
[
l
+
1
]
-
pIndex1
[
l
]);
// p0 = pDataS [l] + lfrac * (pDataS [l+1] - pDataS [l]);
// p1 = pDataS1[l] + lfrac * (pDataS1[l+1] - pDataS1[l]);
p0
=
pDataS
[
l
]
+
(
int
)
lFrac0
;
p1
=
pDataS1
[
l
]
+
(
int
)
lFrac1
;
sFrac
=
(
iword
)(
p1
-
p0
)
*
(
iword
)(
slew
-
pIndex0
[
s
])
/
(
iword
)(
pIndex0
[
s
+
1
]
-
pIndex0
[
s
]);
// return p0 + sfrac * (p1 - p0);
return
p0
+
(
int
)
sFrac
;
}
static
inline
void
Scl_LibPinArrivalI
(
SC_Timing
*
pTime
,
SC_PairI
*
pArrIn
,
SC_PairI
*
pSlewIn
,
SC_PairI
*
pLoad
,
SC_PairI
*
pArrOut
,
SC_PairI
*
pSlewOut
)
{
if
(
pTime
->
tsense
==
sc_ts_Pos
||
pTime
->
tsense
==
sc_ts_Non
)
{
pArrOut
->
rise
=
Abc_MaxInt
(
pArrOut
->
rise
,
pArrIn
->
rise
+
Scl_LibLookupI
(
&
pTime
->
pCellRise
,
pSlewIn
->
rise
,
pLoad
->
rise
)
);
pArrOut
->
fall
=
Abc_MaxInt
(
pArrOut
->
fall
,
pArrIn
->
fall
+
Scl_LibLookupI
(
&
pTime
->
pCellFall
,
pSlewIn
->
fall
,
pLoad
->
fall
)
);
pSlewOut
->
rise
=
Abc_MaxInt
(
pSlewOut
->
rise
,
Scl_LibLookupI
(
&
pTime
->
pRiseTrans
,
pSlewIn
->
rise
,
pLoad
->
rise
)
);
pSlewOut
->
fall
=
Abc_MaxInt
(
pSlewOut
->
fall
,
Scl_LibLookupI
(
&
pTime
->
pFallTrans
,
pSlewIn
->
fall
,
pLoad
->
fall
)
);
}
if
(
pTime
->
tsense
==
sc_ts_Neg
||
pTime
->
tsense
==
sc_ts_Non
)
{
pArrOut
->
rise
=
Abc_MaxInt
(
pArrOut
->
rise
,
pArrIn
->
fall
+
Scl_LibLookupI
(
&
pTime
->
pCellRise
,
pSlewIn
->
fall
,
pLoad
->
rise
)
);
pArrOut
->
fall
=
Abc_MaxInt
(
pArrOut
->
fall
,
pArrIn
->
rise
+
Scl_LibLookupI
(
&
pTime
->
pCellFall
,
pSlewIn
->
rise
,
pLoad
->
fall
)
);
pSlewOut
->
rise
=
Abc_MaxInt
(
pSlewOut
->
rise
,
Scl_LibLookupI
(
&
pTime
->
pRiseTrans
,
pSlewIn
->
fall
,
pLoad
->
rise
)
);
pSlewOut
->
fall
=
Abc_MaxInt
(
pSlewOut
->
fall
,
Scl_LibLookupI
(
&
pTime
->
pFallTrans
,
pSlewIn
->
rise
,
pLoad
->
fall
)
);
}
}
/**Function*************************************************************
Synopsis [Compute one timing edge.]
Synopsis [Compute one timing edge.]
Description []
Description []
...
@@ -582,6 +676,46 @@ static inline void Scl_LibHandleInputDriver( SC_Cell * pCell, SC_Pair * pLoadIn,
...
@@ -582,6 +676,46 @@ static inline void Scl_LibHandleInputDriver( SC_Cell * pCell, SC_Pair * pLoadIn,
pArrOut
->
rise
=
ArrOut1
.
rise
-
ArrOut0
.
rise
;
pArrOut
->
rise
=
ArrOut1
.
rise
-
ArrOut0
.
rise
;
}
}
/**Function*************************************************************
Synopsis [Compute one timing edge.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
int
Scl_LibPinArrivalEstimateI
(
SC_Cell
*
pCell
,
int
iPin
,
int
Slew
,
int
Load
)
{
SC_PairI
LoadIn
=
{
Load
,
Load
};
SC_PairI
ArrIn
=
{
0
,
0
};
SC_PairI
ArrOut
=
{
0
,
0
};
SC_PairI
SlewIn
=
{
0
,
0
};
SC_PairI
SlewOut
=
{
0
,
0
};
// Vec_Flt_t * vIndex0 = pTime->pCellRise->vIndex0; // slew
// SlewIn.fall = SlewIn.rise = Vec_FltEntry( vIndex0, Vec_FltSize(vIndex0)/2 );
SlewIn
.
fall
=
SlewIn
.
rise
=
Slew
;
Scl_LibPinArrivalI
(
Scl_CellPinTime
(
pCell
,
iPin
),
&
ArrIn
,
&
SlewIn
,
&
LoadIn
,
&
ArrOut
,
&
SlewOut
);
return
(
ArrOut
.
fall
+
ArrOut
.
rise
)
>>
1
;
}
static
inline
void
Scl_LibHandleInputDriver2
(
SC_Cell
*
pCell
,
SC_PairI
*
pLoadIn
,
SC_PairI
*
pArrOut
,
SC_PairI
*
pSlewOut
)
{
SC_PairI
LoadIn
=
{
0
,
0
};
// zero input load
SC_PairI
ArrIn
=
{
0
,
0
};
// zero input time
SC_PairI
SlewIn
=
{
0
,
0
};
// zero input slew
SC_PairI
ArrOut0
=
{
0
,
0
};
// output time under zero load
SC_PairI
ArrOut1
=
{
0
,
0
};
// output time under given load
SC_PairI
SlewOut
=
{
0
,
0
};
// output slew under zero load
pSlewOut
->
fall
=
pSlewOut
->
rise
=
0
;
assert
(
pCell
->
n_inputs
==
1
);
Scl_LibPinArrivalI
(
Scl_CellPinTime
(
pCell
,
0
),
&
ArrIn
,
&
SlewIn
,
&
LoadIn
,
&
ArrOut0
,
&
SlewOut
);
Scl_LibPinArrivalI
(
Scl_CellPinTime
(
pCell
,
0
),
&
ArrIn
,
&
SlewIn
,
pLoadIn
,
&
ArrOut1
,
pSlewOut
);
pArrOut
->
fall
=
ArrOut1
.
fall
-
ArrOut0
.
fall
;
pArrOut
->
rise
=
ArrOut1
.
rise
-
ArrOut0
.
rise
;
}
/*=== sclLiberty.c ===============================================================*/
/*=== sclLiberty.c ===============================================================*/
extern
SC_Lib
*
Abc_SclReadLiberty
(
char
*
pFileName
,
int
fVerbose
,
int
fVeryVerbose
);
extern
SC_Lib
*
Abc_SclReadLiberty
(
char
*
pFileName
,
int
fVerbose
,
int
fVeryVerbose
);
/*=== sclLibScl.c ===============================================================*/
/*=== sclLibScl.c ===============================================================*/
...
...
src/map/scl/sclLibScl.c
View file @
96d8f899
...
@@ -49,20 +49,35 @@ ABC_NAMESPACE_IMPL_START
...
@@ -49,20 +49,35 @@ ABC_NAMESPACE_IMPL_START
static
void
Abc_SclReadSurface
(
Vec_Str_t
*
vOut
,
int
*
pPos
,
SC_Surface
*
p
)
static
void
Abc_SclReadSurface
(
Vec_Str_t
*
vOut
,
int
*
pPos
,
SC_Surface
*
p
)
{
{
Vec_Flt_t
*
vVec
;
Vec_Flt_t
*
vVec
;
Vec_Int_t
*
vVecI
;
int
i
,
j
;
int
i
,
j
;
for
(
i
=
Vec_StrGetI
(
vOut
,
pPos
);
i
!=
0
;
i
--
)
for
(
i
=
Vec_StrGetI
(
vOut
,
pPos
);
i
!=
0
;
i
--
)
Vec_FltPush
(
&
p
->
vIndex0
,
Vec_StrGetF
(
vOut
,
pPos
)
);
{
float
Num
=
Vec_StrGetF
(
vOut
,
pPos
);
Vec_FltPush
(
&
p
->
vIndex0
,
Num
);
Vec_IntPush
(
&
p
->
vIndex0I
,
(
int
)(
MIO_NUM
*
Num
)
);
}
for
(
i
=
Vec_StrGetI
(
vOut
,
pPos
);
i
!=
0
;
i
--
)
for
(
i
=
Vec_StrGetI
(
vOut
,
pPos
);
i
!=
0
;
i
--
)
Vec_FltPush
(
&
p
->
vIndex1
,
Vec_StrGetF
(
vOut
,
pPos
)
);
{
float
Num
=
Vec_StrGetF
(
vOut
,
pPos
);
Vec_FltPush
(
&
p
->
vIndex1
,
Num
);
Vec_IntPush
(
&
p
->
vIndex1I
,
(
int
)(
MIO_NUM
*
Num
)
);
}
for
(
i
=
0
;
i
<
Vec_FltSize
(
&
p
->
vIndex0
);
i
++
)
for
(
i
=
0
;
i
<
Vec_FltSize
(
&
p
->
vIndex0
);
i
++
)
{
{
vVec
=
Vec_FltAlloc
(
Vec_FltSize
(
&
p
->
vIndex1
)
);
vVec
=
Vec_FltAlloc
(
Vec_FltSize
(
&
p
->
vIndex1
)
);
Vec_PtrPush
(
&
p
->
vData
,
vVec
);
Vec_PtrPush
(
&
p
->
vData
,
vVec
);
vVecI
=
Vec_IntAlloc
(
Vec_FltSize
(
&
p
->
vIndex1
)
);
Vec_PtrPush
(
&
p
->
vDataI
,
vVecI
);
for
(
j
=
0
;
j
<
Vec_FltSize
(
&
p
->
vIndex1
);
j
++
)
for
(
j
=
0
;
j
<
Vec_FltSize
(
&
p
->
vIndex1
);
j
++
)
Vec_FltPush
(
vVec
,
Vec_StrGetF
(
vOut
,
pPos
)
);
{
float
Num
=
Vec_StrGetF
(
vOut
,
pPos
);
Vec_FltPush
(
vVec
,
Num
);
Vec_IntPush
(
vVecI
,
(
int
)(
MIO_NUM
*
Num
)
);
}
}
}
for
(
i
=
0
;
i
<
3
;
i
++
)
for
(
i
=
0
;
i
<
3
;
i
++
)
...
@@ -138,6 +153,9 @@ static int Abc_SclReadLibrary( Vec_Str_t * vOut, int * pPos, SC_Lib * p )
...
@@ -138,6 +153,9 @@ static int Abc_SclReadLibrary( Vec_Str_t * vOut, int * pPos, SC_Lib * p )
pCell
->
n_inputs
=
Vec_StrGetI
(
vOut
,
pPos
);
pCell
->
n_inputs
=
Vec_StrGetI
(
vOut
,
pPos
);
pCell
->
n_outputs
=
Vec_StrGetI
(
vOut
,
pPos
);
pCell
->
n_outputs
=
Vec_StrGetI
(
vOut
,
pPos
);
pCell
->
areaI
=
(
int
)(
MIO_NUM
*
pCell
->
area
);
pCell
->
leakageI
=
(
int
)(
MIO_NUM
*
pCell
->
leakage
);
/*
/*
printf( "%s\n", pCell->pName );
printf( "%s\n", pCell->pName );
if ( !strcmp( "XOR3_X4M_A9TL", pCell->pName ) )
if ( !strcmp( "XOR3_X4M_A9TL", pCell->pName ) )
...
@@ -154,6 +172,9 @@ static int Abc_SclReadLibrary( Vec_Str_t * vOut, int * pPos, SC_Lib * p )
...
@@ -154,6 +172,9 @@ static int Abc_SclReadLibrary( Vec_Str_t * vOut, int * pPos, SC_Lib * p )
pPin
->
pName
=
Vec_StrGetS
(
vOut
,
pPos
);
pPin
->
pName
=
Vec_StrGetS
(
vOut
,
pPos
);
pPin
->
rise_cap
=
Vec_StrGetF
(
vOut
,
pPos
);
pPin
->
rise_cap
=
Vec_StrGetF
(
vOut
,
pPos
);
pPin
->
fall_cap
=
Vec_StrGetF
(
vOut
,
pPos
);
pPin
->
fall_cap
=
Vec_StrGetF
(
vOut
,
pPos
);
pPin
->
rise_capI
=
(
int
)(
MIO_NUM
*
pPin
->
rise_capI
);
pPin
->
fall_capI
=
(
int
)(
MIO_NUM
*
pPin
->
fall_capI
);
}
}
for
(
j
=
0
;
j
<
pCell
->
n_outputs
;
j
++
)
for
(
j
=
0
;
j
<
pCell
->
n_outputs
;
j
++
)
...
...
src/opt/fret/fretMain.c
View file @
96d8f899
...
@@ -350,7 +350,7 @@ Abc_FlowRetime_MainLoop( ) {
...
@@ -350,7 +350,7 @@ Abc_FlowRetime_MainLoop( ) {
// assert(!pManMR->fComputeInitState || pManMR->pInitNtk);
// assert(!pManMR->fComputeInitState || pManMR->pInitNtk);
if
(
pManMR
->
fComputeInitState
)
Abc_NtkDelete
(
pManMR
->
pInitNtk
);
if
(
pManMR
->
fComputeInitState
)
Abc_NtkDelete
(
pManMR
->
pInitNtk
);
if
(
pManMR
->
fGuaranteeInitState
)
;
/* Abc_NtkDelete(pNtkCopy); note: original ntk deleted later */
//
if (pManMR->fGuaranteeInitState) ; /* Abc_NtkDelete(pNtkCopy); note: original ntk deleted later */
return
pNtk
;
return
pNtk
;
}
}
...
...
src/opt/sfm/module.make
View file @
96d8f899
...
@@ -4,5 +4,6 @@ SRC += src/opt/sfm/sfmCnf.c \
...
@@ -4,5 +4,6 @@ SRC += src/opt/sfm/sfmCnf.c \
src/opt/sfm/sfmLib.c
\
src/opt/sfm/sfmLib.c
\
src/opt/sfm/sfmNtk.c
\
src/opt/sfm/sfmNtk.c
\
src/opt/sfm/sfmSat.c
\
src/opt/sfm/sfmSat.c
\
src/opt/sfm/sfmTime.c
\
src/opt/sfm/sfmTim.c
\
src/opt/sfm/sfmMit.c
\
src/opt/sfm/sfmWin.c
src/opt/sfm/sfmWin.c
src/opt/sfm/sfmDec.c
View file @
96d8f899
This diff is collapsed.
Click to expand it.
src/opt/sfm/sfmInt.h
View file @
96d8f899
...
@@ -63,6 +63,7 @@ ABC_NAMESPACE_HEADER_START
...
@@ -63,6 +63,7 @@ ABC_NAMESPACE_HEADER_START
typedef
struct
Sfm_Fun_t_
Sfm_Fun_t
;
typedef
struct
Sfm_Fun_t_
Sfm_Fun_t
;
typedef
struct
Sfm_Lib_t_
Sfm_Lib_t
;
typedef
struct
Sfm_Lib_t_
Sfm_Lib_t
;
typedef
struct
Sfm_Tim_t_
Sfm_Tim_t
;
typedef
struct
Sfm_Tim_t_
Sfm_Tim_t
;
typedef
struct
Sfm_Mit_t_
Sfm_Mit_t
;
struct
Sfm_Ntk_t_
struct
Sfm_Ntk_t_
{
{
...
@@ -214,7 +215,7 @@ extern void Sfm_NtkUpdate( Sfm_Ntk_t * p, int iNode, int f, int iFaninNe
...
@@ -214,7 +215,7 @@ extern void Sfm_NtkUpdate( Sfm_Ntk_t * p, int iNode, int f, int iFaninNe
/*=== sfmSat.c ==========================================================*/
/*=== sfmSat.c ==========================================================*/
extern
int
Sfm_NtkWindowToSolver
(
Sfm_Ntk_t
*
p
);
extern
int
Sfm_NtkWindowToSolver
(
Sfm_Ntk_t
*
p
);
extern
word
Sfm_ComputeInterpolant
(
Sfm_Ntk_t
*
p
);
extern
word
Sfm_ComputeInterpolant
(
Sfm_Ntk_t
*
p
);
/*=== sfmTim
e
.c ==========================================================*/
/*=== sfmTim.c ==========================================================*/
extern
Sfm_Tim_t
*
Sfm_TimStart
(
Mio_Library_t
*
pLib
,
Scl_Con_t
*
pExt
,
Abc_Ntk_t
*
pNtk
,
int
DeltaCrit
);
extern
Sfm_Tim_t
*
Sfm_TimStart
(
Mio_Library_t
*
pLib
,
Scl_Con_t
*
pExt
,
Abc_Ntk_t
*
pNtk
,
int
DeltaCrit
);
extern
void
Sfm_TimStop
(
Sfm_Tim_t
*
p
);
extern
void
Sfm_TimStop
(
Sfm_Tim_t
*
p
);
extern
int
Sfm_TimReadNtkDelay
(
Sfm_Tim_t
*
p
);
extern
int
Sfm_TimReadNtkDelay
(
Sfm_Tim_t
*
p
);
...
@@ -224,6 +225,16 @@ extern int Sfm_TimSortArrayByArrival( Sfm_Tim_t * p, Vec_Int_t * vNodes
...
@@ -224,6 +225,16 @@ extern int Sfm_TimSortArrayByArrival( Sfm_Tim_t * p, Vec_Int_t * vNodes
extern
int
Sfm_TimPriorityNodes
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vCands
,
int
Window
);
extern
int
Sfm_TimPriorityNodes
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vCands
,
int
Window
);
extern
int
Sfm_TimNodeIsNonCritical
(
Sfm_Tim_t
*
p
,
Abc_Obj_t
*
pPivot
,
Abc_Obj_t
*
pNode
);
extern
int
Sfm_TimNodeIsNonCritical
(
Sfm_Tim_t
*
p
,
Abc_Obj_t
*
pPivot
,
Abc_Obj_t
*
pNode
);
extern
int
Sfm_TimEvalRemapping
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vFanins
,
Vec_Int_t
*
vMap
,
Mio_Gate_t
*
pGate1
,
char
*
pFans1
,
Mio_Gate_t
*
pGate2
,
char
*
pFans2
);
extern
int
Sfm_TimEvalRemapping
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vFanins
,
Vec_Int_t
*
vMap
,
Mio_Gate_t
*
pGate1
,
char
*
pFans1
,
Mio_Gate_t
*
pGate2
,
char
*
pFans2
);
/*=== sfmMit.c ==========================================================*/
extern
Sfm_Mit_t
*
Sfm_MitStart
(
Mio_Library_t
*
pLib
,
Scl_Con_t
*
pExt
,
Abc_Ntk_t
*
pNtk
,
int
DeltaCrit
);
extern
void
Sfm_MitStop
(
Sfm_Mit_t
*
p
);
extern
int
Sfm_MitReadNtkDelay
(
Sfm_Mit_t
*
p
);
extern
int
Sfm_MitReadObjDelay
(
Sfm_Mit_t
*
p
,
int
iObj
);
extern
void
Sfm_MitUpdateTiming
(
Sfm_Mit_t
*
p
,
Vec_Int_t
*
vTimeNodes
);
extern
int
Sfm_MitSortArrayByArrival
(
Sfm_Mit_t
*
p
,
Vec_Int_t
*
vNodes
,
int
iPivot
);
extern
int
Sfm_MitPriorityNodes
(
Sfm_Mit_t
*
p
,
Vec_Int_t
*
vCands
,
int
Window
);
extern
int
Sfm_MitNodeIsNonCritical
(
Sfm_Mit_t
*
p
,
Abc_Obj_t
*
pPivot
,
Abc_Obj_t
*
pNode
);
extern
int
Sfm_MitEvalRemapping
(
Sfm_Mit_t
*
p
,
Vec_Int_t
*
vFanins
,
Vec_Int_t
*
vMap
,
Mio_Gate_t
*
pGate1
,
char
*
pFans1
,
Mio_Gate_t
*
pGate2
,
char
*
pFans2
);
/*=== sfmWin.c ==========================================================*/
/*=== sfmWin.c ==========================================================*/
extern
int
Sfm_ObjMffcSize
(
Sfm_Ntk_t
*
p
,
int
iObj
);
extern
int
Sfm_ObjMffcSize
(
Sfm_Ntk_t
*
p
,
int
iObj
);
extern
int
Sfm_NtkCreateWindow
(
Sfm_Ntk_t
*
p
,
int
iNode
,
int
fVerbose
);
extern
int
Sfm_NtkCreateWindow
(
Sfm_Ntk_t
*
p
,
int
iNode
,
int
fVerbose
);
...
...
src/opt/sfm/sfmMit.c
0 → 100644
View file @
96d8f899
This diff is collapsed.
Click to expand it.
src/opt/sfm/sfmTim
e
.c
→
src/opt/sfm/sfmTim.c
View file @
96d8f899
/**CFile****************************************************************
/**CFile****************************************************************
FileName [sfmTim
e
.c]
FileName [sfmTim.c]
SystemName [ABC: Logic synthesis and verification system.]
SystemName [ABC: Logic synthesis and verification system.]
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
Date [Ver. 1.0. Started - June 20, 2005.]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [$Id: sfmTim
e
.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
Revision [$Id: sfmTim.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
***********************************************************************/
***********************************************************************/
...
@@ -38,11 +38,6 @@ struct Sfm_Tim_t_
...
@@ -38,11 +38,6 @@ struct Sfm_Tim_t_
// timing info
// timing info
Vec_Int_t
vTimArrs
;
// arrivals (rise/fall)
Vec_Int_t
vTimArrs
;
// arrivals (rise/fall)
Vec_Int_t
vTimReqs
;
// required (rise/fall)
Vec_Int_t
vTimReqs
;
// required (rise/fall)
Vec_Int_t
vTimSlews
;
// slews (rise/fall)
Vec_Int_t
vTimLoads
;
// loads (rise/fall)
// timing edges
Vec_Int_t
vObjOffs
;
// object offsets
Vec_Int_t
vTimEdges
;
// edge timings (rise/fall)
// incremental timing
// incremental timing
Vec_Wec_t
vLevels
;
// levels
Vec_Wec_t
vLevels
;
// levels
// critical path
// critical path
...
@@ -52,13 +47,9 @@ struct Sfm_Tim_t_
...
@@ -52,13 +47,9 @@ struct Sfm_Tim_t_
static
inline
int
*
Sfm_TimArrId
(
Sfm_Tim_t
*
p
,
int
Id
)
{
return
Vec_IntEntryP
(
&
p
->
vTimArrs
,
Abc_Var2Lit
(
Id
,
0
)
);
}
static
inline
int
*
Sfm_TimArrId
(
Sfm_Tim_t
*
p
,
int
Id
)
{
return
Vec_IntEntryP
(
&
p
->
vTimArrs
,
Abc_Var2Lit
(
Id
,
0
)
);
}
static
inline
int
*
Sfm_TimReqId
(
Sfm_Tim_t
*
p
,
int
Id
)
{
return
Vec_IntEntryP
(
&
p
->
vTimReqs
,
Abc_Var2Lit
(
Id
,
0
)
);
}
static
inline
int
*
Sfm_TimReqId
(
Sfm_Tim_t
*
p
,
int
Id
)
{
return
Vec_IntEntryP
(
&
p
->
vTimReqs
,
Abc_Var2Lit
(
Id
,
0
)
);
}
static
inline
int
*
Sfm_TimSlewId
(
Sfm_Tim_t
*
p
,
int
Id
)
{
return
Vec_IntEntryP
(
&
p
->
vTimSlews
,
Abc_Var2Lit
(
Id
,
0
)
);
}
static
inline
int
*
Sfm_TimLoadId
(
Sfm_Tim_t
*
p
,
int
Id
)
{
return
Vec_IntEntryP
(
&
p
->
vTimLoads
,
Abc_Var2Lit
(
Id
,
0
)
);
}
static
inline
int
*
Sfm_TimArr
(
Sfm_Tim_t
*
p
,
Abc_Obj_t
*
pNode
)
{
return
Vec_IntEntryP
(
&
p
->
vTimArrs
,
Abc_Var2Lit
(
Abc_ObjId
(
pNode
),
0
)
);
}
static
inline
int
*
Sfm_TimArr
(
Sfm_Tim_t
*
p
,
Abc_Obj_t
*
pNode
)
{
return
Vec_IntEntryP
(
&
p
->
vTimArrs
,
Abc_Var2Lit
(
Abc_ObjId
(
pNode
),
0
)
);
}
static
inline
int
*
Sfm_TimReq
(
Sfm_Tim_t
*
p
,
Abc_Obj_t
*
pNode
)
{
return
Vec_IntEntryP
(
&
p
->
vTimReqs
,
Abc_Var2Lit
(
Abc_ObjId
(
pNode
),
0
)
);
}
static
inline
int
*
Sfm_TimReq
(
Sfm_Tim_t
*
p
,
Abc_Obj_t
*
pNode
)
{
return
Vec_IntEntryP
(
&
p
->
vTimReqs
,
Abc_Var2Lit
(
Abc_ObjId
(
pNode
),
0
)
);
}
static
inline
int
*
Sfm_TimSlew
(
Sfm_Tim_t
*
p
,
Abc_Obj_t
*
pNode
)
{
return
Vec_IntEntryP
(
&
p
->
vTimSlews
,
Abc_Var2Lit
(
Abc_ObjId
(
pNode
),
0
)
);
}
static
inline
int
*
Sfm_TimLoad
(
Sfm_Tim_t
*
p
,
Abc_Obj_t
*
pNode
)
{
return
Vec_IntEntryP
(
&
p
->
vTimLoads
,
Abc_Var2Lit
(
Abc_ObjId
(
pNode
),
0
)
);
}
static
inline
int
Sfm_TimArrMaxId
(
Sfm_Tim_t
*
p
,
int
Id
)
{
int
*
a
=
Sfm_TimArrId
(
p
,
Id
);
return
Abc_MaxInt
(
a
[
0
],
a
[
1
]);
}
static
inline
int
Sfm_TimArrMaxId
(
Sfm_Tim_t
*
p
,
int
Id
)
{
int
*
a
=
Sfm_TimArrId
(
p
,
Id
);
return
Abc_MaxInt
(
a
[
0
],
a
[
1
]);
}
...
@@ -237,21 +228,12 @@ int Sfm_TimTrace( Sfm_Tim_t * p )
...
@@ -237,21 +228,12 @@ int Sfm_TimTrace( Sfm_Tim_t * p )
***********************************************************************/
***********************************************************************/
Sfm_Tim_t
*
Sfm_TimStart
(
Mio_Library_t
*
pLib
,
Scl_Con_t
*
pExt
,
Abc_Ntk_t
*
pNtk
,
int
DeltaCrit
)
Sfm_Tim_t
*
Sfm_TimStart
(
Mio_Library_t
*
pLib
,
Scl_Con_t
*
pExt
,
Abc_Ntk_t
*
pNtk
,
int
DeltaCrit
)
{
{
// Abc_Obj_t * pObj; int i;
Sfm_Tim_t
*
p
=
ABC_CALLOC
(
Sfm_Tim_t
,
1
);
Sfm_Tim_t
*
p
=
ABC_CALLOC
(
Sfm_Tim_t
,
1
);
p
->
pLib
=
pLib
;
p
->
pLib
=
pLib
;
p
->
pExt
=
pExt
;
p
->
pExt
=
pExt
;
p
->
pNtk
=
pNtk
;
p
->
pNtk
=
pNtk
;
Vec_IntFill
(
&
p
->
vTimArrs
,
3
*
Abc_NtkObjNumMax
(
pNtk
),
0
);
Vec_IntFill
(
&
p
->
vTimArrs
,
3
*
Abc_NtkObjNumMax
(
pNtk
),
0
);
Vec_IntFill
(
&
p
->
vTimReqs
,
3
*
Abc_NtkObjNumMax
(
pNtk
),
0
);
Vec_IntFill
(
&
p
->
vTimReqs
,
3
*
Abc_NtkObjNumMax
(
pNtk
),
0
);
// Vec_IntFill( &p->vTimSlews, 3*Abc_NtkObjNumMax(pNtk), 0 );
// Vec_IntFill( &p->vTimLoads, 3*Abc_NtkObjNumMax(pNtk), 0 );
// Vec_IntFill( &p->vObjOffs, 2*Abc_NtkObjNumMax(pNtk), 0 );
// Abc_NtkForEachNode( pNtk, pObj, i )
// {
// Vec_IntWriteEntry( &p->vObjOffs, i, Vec_IntSize(Vec_IntSize(&p->vTimEdges)) );
// Vec_IntFillExtra( &p->vTimEdges, Vec_IntSize(Vec_IntSize(&p->vTimEdges)) + Abc_ObjFaninNum(pObj), 0 );
// }
p
->
Delay
=
Sfm_TimTrace
(
p
);
p
->
Delay
=
Sfm_TimTrace
(
p
);
assert
(
DeltaCrit
>
0
&&
DeltaCrit
<
MIO_NUM
*
1000
);
assert
(
DeltaCrit
>
0
&&
DeltaCrit
<
MIO_NUM
*
1000
);
p
->
DeltaCrit
=
DeltaCrit
;
p
->
DeltaCrit
=
DeltaCrit
;
...
@@ -261,10 +243,6 @@ void Sfm_TimStop( Sfm_Tim_t * p )
...
@@ -261,10 +243,6 @@ void Sfm_TimStop( Sfm_Tim_t * p )
{
{
Vec_IntErase
(
&
p
->
vTimArrs
);
Vec_IntErase
(
&
p
->
vTimArrs
);
Vec_IntErase
(
&
p
->
vTimReqs
);
Vec_IntErase
(
&
p
->
vTimReqs
);
Vec_IntErase
(
&
p
->
vTimSlews
);
Vec_IntErase
(
&
p
->
vTimLoads
);
Vec_IntErase
(
&
p
->
vObjOffs
);
Vec_IntErase
(
&
p
->
vTimEdges
);
Vec_WecErase
(
&
p
->
vLevels
);
Vec_WecErase
(
&
p
->
vLevels
);
Vec_IntErase
(
&
p
->
vPath
);
Vec_IntErase
(
&
p
->
vPath
);
Vec_WrdErase
(
&
p
->
vSortData
);
Vec_WrdErase
(
&
p
->
vSortData
);
...
@@ -409,17 +387,10 @@ int Sfm_TimPriorityNodes( Sfm_Tim_t * p, Vec_Int_t * vCands, int Window )
...
@@ -409,17 +387,10 @@ int Sfm_TimPriorityNodes( Sfm_Tim_t * p, Vec_Int_t * vCands, int Window )
Vec_WecSort
(
&
p
->
vLevels
,
0
);
Vec_WecSort
(
&
p
->
vLevels
,
0
);
Vec_IntClear
(
vCands
);
Vec_IntClear
(
vCands
);
Vec_WecForEachLevel
(
&
p
->
vLevels
,
vLevel
,
i
)
Vec_WecForEachLevel
(
&
p
->
vLevels
,
vLevel
,
i
)
{
// printf( "%d ", Vec_IntSize(vLevel) );
Abc_NtkForEachObjVec
(
vLevel
,
p
->
pNtk
,
pObj
,
k
)
Abc_NtkForEachObjVec
(
vLevel
,
p
->
pNtk
,
pObj
,
k
)
if
(
!
pObj
->
fMarkA
)
if
(
!
pObj
->
fMarkA
)
Vec_IntPush
(
vCands
,
Abc_ObjId
(
pObj
)
);
Vec_IntPush
(
vCands
,
Abc_ObjId
(
pObj
)
);
// if ( Vec_IntSize(vCands) > 10 )
// printf( "Path = %5d Cand = %5d\n", Vec_IntSize(&p->vPath) );
// break;
}
// printf( "\n" );
// printf( "Path = %5d ", Vec_IntSize(&p->vPath) );
// printf( "Cand = %5d ", Vec_IntSize(vCands) );
return
Vec_IntSize
(
vCands
)
>
0
;
return
Vec_IntSize
(
vCands
)
>
0
;
}
}
...
...
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