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
22a5ab19
Commit
22a5ab19
authored
Mar 11, 2016
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding API to convert Genlib into a simple Liberty.
parent
74328f52
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
145 additions
and
1 deletions
+145
-1
src/map/mio/mio.h
+1
-0
src/map/mio/mioApi.c
+1
-1
src/map/scl/sclLib.h
+1
-0
src/map/scl/sclLibScl.c
+142
-0
No files found.
src/map/mio/mio.h
View file @
22a5ab19
...
@@ -148,6 +148,7 @@ extern double Mio_GateReadDelayMax ( Mio_Gate_t * pGate );
...
@@ -148,6 +148,7 @@ extern double Mio_GateReadDelayMax ( Mio_Gate_t * pGate );
extern
char
*
Mio_GateReadSop
(
Mio_Gate_t
*
pGate
);
extern
char
*
Mio_GateReadSop
(
Mio_Gate_t
*
pGate
);
extern
Vec_Int_t
*
Mio_GateReadExpr
(
Mio_Gate_t
*
pGate
);
extern
Vec_Int_t
*
Mio_GateReadExpr
(
Mio_Gate_t
*
pGate
);
extern
word
Mio_GateReadTruth
(
Mio_Gate_t
*
pGate
);
extern
word
Mio_GateReadTruth
(
Mio_Gate_t
*
pGate
);
extern
word
*
Mio_GateReadTruthP
(
Mio_Gate_t
*
pGate
);
extern
int
Mio_GateReadValue
(
Mio_Gate_t
*
pGate
);
extern
int
Mio_GateReadValue
(
Mio_Gate_t
*
pGate
);
extern
int
Mio_GateReadCell
(
Mio_Gate_t
*
pGate
);
extern
int
Mio_GateReadCell
(
Mio_Gate_t
*
pGate
);
extern
int
Mio_GateReadProfile
(
Mio_Gate_t
*
pGate
);
extern
int
Mio_GateReadProfile
(
Mio_Gate_t
*
pGate
);
...
...
src/map/mio/mioApi.c
View file @
22a5ab19
...
@@ -176,7 +176,7 @@ double Mio_GateReadDelayMax ( Mio_Gate_t * pGate ) { retur
...
@@ -176,7 +176,7 @@ double Mio_GateReadDelayMax ( Mio_Gate_t * pGate ) { retur
char
*
Mio_GateReadSop
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
pSop
;
}
char
*
Mio_GateReadSop
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
pSop
;
}
Vec_Int_t
*
Mio_GateReadExpr
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
vExpr
;
}
Vec_Int_t
*
Mio_GateReadExpr
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
vExpr
;
}
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
?
&
pGate
->
uTruth
:
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
;
}
int
Mio_GateReadCell
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
Cell
;
}
int
Mio_GateReadProfile
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
Profile
;
}
int
Mio_GateReadProfile
(
Mio_Gate_t
*
pGate
)
{
return
pGate
->
Profile
;
}
...
...
src/map/scl/sclLib.h
View file @
22a5ab19
...
@@ -734,6 +734,7 @@ static inline void Scl_LibHandleInputDriver2( SC_Cell * pCell, SC_PairI * pLoadI
...
@@ -734,6 +734,7 @@ static inline void Scl_LibHandleInputDriver2( SC_Cell * pCell, SC_PairI * pLoadI
/*=== 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 ===============================================================*/
extern
SC_Lib
*
Abc_SclReadFromGenlib
(
void
*
pLib
);
extern
SC_Lib
*
Abc_SclReadFromStr
(
Vec_Str_t
*
vOut
);
extern
SC_Lib
*
Abc_SclReadFromStr
(
Vec_Str_t
*
vOut
);
extern
SC_Lib
*
Abc_SclReadFromFile
(
char
*
pFileName
);
extern
SC_Lib
*
Abc_SclReadFromFile
(
char
*
pFileName
);
extern
void
Abc_SclWriteScl
(
char
*
pFileName
,
SC_Lib
*
p
);
extern
void
Abc_SclWriteScl
(
char
*
pFileName
,
SC_Lib
*
p
);
...
...
src/map/scl/sclLibScl.c
View file @
22a5ab19
...
@@ -37,6 +37,148 @@ ABC_NAMESPACE_IMPL_START
...
@@ -37,6 +37,148 @@ ABC_NAMESPACE_IMPL_START
/// FUNCTION DEFINITIONS ///
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis [Reading library from file.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
void
Abc_SclReadSurfaceGenlib
(
SC_Surface
*
p
)
{
Vec_Flt_t
*
vVec
;
Vec_Int_t
*
vVecI
;
int
i
,
j
;
Vec_FltPush
(
&
p
->
vIndex0
,
0
);
Vec_IntPush
(
&
p
->
vIndex0I
,
Scl_Flt2Int
(
0
)
);
Vec_FltPush
(
&
p
->
vIndex1
,
0
);
Vec_IntPush
(
&
p
->
vIndex1I
,
Scl_Flt2Int
(
0
)
);
for
(
i
=
0
;
i
<
Vec_FltSize
(
&
p
->
vIndex0
);
i
++
)
{
vVec
=
Vec_FltAlloc
(
Vec_FltSize
(
&
p
->
vIndex1
)
);
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
++
)
{
Vec_FltPush
(
vVec
,
1
);
Vec_IntPush
(
vVecI
,
Scl_Flt2Int
(
1
)
);
}
}
}
static
int
Abc_SclReadLibraryGenlib
(
SC_Lib
*
p
,
Mio_Library_t
*
pLib
)
{
Mio_Gate_t
*
pGate
;
Mio_Pin_t
*
pGatePin
;
int
j
,
k
;
// Read non-composite fields:
p
->
pName
=
Abc_UtilStrsav
(
Mio_LibraryReadName
(
pLib
)
);
p
->
default_wire_load
=
0
;
p
->
default_wire_load_sel
=
0
;
p
->
default_max_out_slew
=
0
;
p
->
unit_time
=
12
;
p
->
unit_cap_fst
=
1
.
0
;
p
->
unit_cap_snd
=
15
;
Mio_LibraryForEachGate
(
pLib
,
pGate
)
{
SC_Cell
*
pCell
=
Abc_SclCellAlloc
();
pCell
->
Id
=
SC_LibCellNum
(
p
);
Vec_PtrPush
(
&
p
->
vCells
,
pCell
);
pCell
->
pName
=
Abc_UtilStrsav
(
Mio_GateReadName
(
pGate
)
);
pCell
->
area
=
Mio_GateReadArea
(
pGate
);
pCell
->
leakage
=
0
;
pCell
->
drive_strength
=
0
;
pCell
->
n_inputs
=
Mio_GateReadPinNum
(
pGate
);
pCell
->
n_outputs
=
1
;
pCell
->
areaI
=
Scl_Flt2Int
(
pCell
->
area
);
pCell
->
leakageI
=
Scl_Flt2Int
(
pCell
->
leakage
);
Mio_GateForEachPin
(
pGate
,
pGatePin
)
{
SC_Pin
*
pPin
=
Abc_SclPinAlloc
();
Vec_PtrPush
(
&
pCell
->
vPins
,
pPin
);
pPin
->
dir
=
sc_dir_Input
;
pPin
->
pName
=
Abc_UtilStrsav
(
Mio_PinReadName
(
pGatePin
)
);
pPin
->
rise_cap
=
0
;
pPin
->
fall_cap
=
0
;
pPin
->
rise_capI
=
Scl_Flt2Int
(
pPin
->
rise_cap
);
pPin
->
fall_capI
=
Scl_Flt2Int
(
pPin
->
fall_cap
);
}
for
(
j
=
0
;
j
<
pCell
->
n_outputs
;
j
++
)
{
word
*
pTruth
=
Mio_GateReadTruthP
(
pGate
);
SC_Pin
*
pPin
=
Abc_SclPinAlloc
();
Vec_PtrPush
(
&
pCell
->
vPins
,
pPin
);
pPin
->
dir
=
sc_dir_Output
;
pPin
->
pName
=
Abc_UtilStrsav
(
Mio_GateReadOutName
(
pGate
)
);
pPin
->
max_out_cap
=
0
;
pPin
->
max_out_slew
=
0
;
// read function
pPin
->
func_text
=
Abc_UtilStrsav
(
Mio_GateReadForm
(
pGate
)
);
Vec_WrdGrow
(
&
pPin
->
vFunc
,
Abc_Truth6WordNum
(
pCell
->
n_inputs
)
);
for
(
k
=
0
;
k
<
Vec_WrdCap
(
&
pPin
->
vFunc
);
k
++
)
Vec_WrdPush
(
&
pPin
->
vFunc
,
pTruth
[
k
]
);
// read pins
Mio_GateForEachPin
(
pGate
,
pGatePin
)
{
Mio_PinPhase_t
Value
=
Mio_PinReadPhase
(
pGatePin
);
SC_Timings
*
pRTime
=
Abc_SclTimingsAlloc
();
Vec_PtrPush
(
&
pPin
->
vRTimings
,
pRTime
);
pRTime
->
pName
=
Abc_UtilStrsav
(
Mio_PinReadName
(
pGatePin
)
);
if
(
1
)
{
SC_Timing
*
pTime
=
Abc_SclTimingAlloc
();
Vec_PtrPush
(
&
pRTime
->
vTimings
,
pTime
);
if
(
Value
==
MIO_PHASE_UNKNOWN
)
pTime
->
tsense
=
(
SC_TSense
)
sc_ts_Non
;
else
if
(
Value
==
MIO_PHASE_INV
)
pTime
->
tsense
=
(
SC_TSense
)
sc_ts_Neg
;
else
if
(
Value
==
MIO_PHASE_NONINV
)
pTime
->
tsense
=
(
SC_TSense
)
sc_ts_Pos
;
else
assert
(
0
);
Abc_SclReadSurfaceGenlib
(
&
pTime
->
pCellRise
);
Abc_SclReadSurfaceGenlib
(
&
pTime
->
pCellFall
);
Abc_SclReadSurfaceGenlib
(
&
pTime
->
pRiseTrans
);
Abc_SclReadSurfaceGenlib
(
&
pTime
->
pFallTrans
);
}
}
}
}
return
1
;
}
SC_Lib
*
Abc_SclReadFromGenlib
(
void
*
pLib0
)
{
Mio_Library_t
*
pLib
=
(
Mio_Library_t
*
)
pLib0
;
SC_Lib
*
p
=
Abc_SclLibAlloc
();
if
(
!
Abc_SclReadLibraryGenlib
(
p
,
pLib
)
)
return
NULL
;
// hash gates by name
Abc_SclHashCells
(
p
);
Abc_SclLinkCells
(
p
);
return
p
;
}
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Reading library from file.]
Synopsis [Reading library from file.]
...
...
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