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
19d50b98
Commit
19d50b98
authored
Aug 25, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New package to read/write a subset of Liberty for STA.
parent
2a7a06b6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
9 deletions
+20
-9
src/map/scl/scl.c
+11
-2
src/map/scl/sclFile.c
+0
-0
src/map/scl/sclInt.h
+8
-7
src/misc/util/abc_global.h
+1
-0
No files found.
src/map/scl/scl.c
View file @
19d50b98
...
@@ -102,14 +102,14 @@ int Scl_CommandRead( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -102,14 +102,14 @@ int Scl_CommandRead( Abc_Frame_t * pAbc, int argc, char ** argv )
// get the input file name
// get the input file name
pFileName
=
argv
[
globalUtilOptind
];
pFileName
=
argv
[
globalUtilOptind
];
if
(
(
pFile
=
fopen
(
pFileName
,
"r"
))
==
NULL
)
if
(
(
pFile
=
fopen
(
pFileName
,
"r
b
"
))
==
NULL
)
{
{
fprintf
(
pAbc
->
Err
,
"Cannot open input file
\"
%s
\"
.
\n
"
,
pFileName
);
fprintf
(
pAbc
->
Err
,
"Cannot open input file
\"
%s
\"
.
\n
"
,
pFileName
);
return
1
;
return
1
;
}
}
fclose
(
pFile
);
fclose
(
pFile
);
//
set the new network
//
read new library
Abc_SclLoad
(
pFileName
,
&
pAbc
->
pLibScl
);
Abc_SclLoad
(
pFileName
,
&
pAbc
->
pLibScl
);
return
0
;
return
0
;
...
@@ -134,6 +134,7 @@ usage:
...
@@ -134,6 +134,7 @@ usage:
***********************************************************************/
***********************************************************************/
int
Scl_CommandWrite
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Scl_CommandWrite
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
FILE
*
pFile
;
char
*
pFileName
;
char
*
pFileName
;
int
c
;
int
c
;
...
@@ -157,6 +158,14 @@ int Scl_CommandWrite( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -157,6 +158,14 @@ int Scl_CommandWrite( Abc_Frame_t * pAbc, int argc, char **argv )
}
}
// get the input file name
// get the input file name
pFileName
=
argv
[
globalUtilOptind
];
pFileName
=
argv
[
globalUtilOptind
];
if
(
(
pFile
=
fopen
(
pFileName
,
"wb"
))
==
NULL
)
{
fprintf
(
pAbc
->
Err
,
"Cannot open output file
\"
%s
\"
.
\n
"
,
pFileName
);
return
1
;
}
fclose
(
pFile
);
// save current library
Abc_SclSave
(
pFileName
,
pAbc
->
pLibScl
);
Abc_SclSave
(
pFileName
,
pAbc
->
pLibScl
);
return
0
;
return
0
;
...
...
src/map/scl/sclFile.c
View file @
19d50b98
This diff is collapsed.
Click to expand it.
src/map/scl/sclInt.h
View file @
19d50b98
...
@@ -101,6 +101,7 @@ struct SC_Surface_
...
@@ -101,6 +101,7 @@ 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])'
float
approx
[
3
][
6
];
};
};
struct
SC_Timing_
struct
SC_Timing_
...
@@ -153,8 +154,8 @@ struct SC_Lib_
...
@@ -153,8 +154,8 @@ struct SC_Lib_
char
*
default_wire_load_sel
;
char
*
default_wire_load_sel
;
float
default_max_out_slew
;
// -- 'default_max_transition'; this is copied to each output pin where 'max_transition' is not defined
float
default_max_out_slew
;
// -- 'default_max_transition'; this is copied to each output pin where 'max_transition' is not defined
int
unit_time
;
// -- Valid 9..12. Unit is '10^(-val)' seconds (e.g. 9=1ns, 10=100ps, 11=10ps, 12=1ps)
int
unit_time
;
// -- Valid 9..12. Unit is '10^(-val)' seconds (e.g. 9=1ns, 10=100ps, 11=10ps, 12=1ps)
float
unit_cap_f
loat
;
// -- First part is a multiplier, second either 12 or 15 for 'pf' or 'ff'.
float
unit_cap_f
st
;
// -- First part is a multiplier, second either 12 or 15 for 'pf' or 'ff'.
int
unit_cap_
int
;
int
unit_cap_
snd
;
Vec_Ptr_t
*
vWireLoads
;
// NamedSet<SC_WireLoad>
Vec_Ptr_t
*
vWireLoads
;
// NamedSet<SC_WireLoad>
Vec_Ptr_t
*
vWireLoadSels
;
// NamedSet<SC_WireLoadSel>
Vec_Ptr_t
*
vWireLoadSels
;
// NamedSet<SC_WireLoadSel>
Vec_Ptr_t
*
vTempls
;
// NamedSet<SC_TableTempl>
Vec_Ptr_t
*
vTempls
;
// NamedSet<SC_TableTempl>
...
@@ -221,7 +222,7 @@ static inline SC_Timings * Abc_SclTimingsAlloc()
...
@@ -221,7 +222,7 @@ static inline SC_Timings * Abc_SclTimingsAlloc()
{
{
SC_Timings
*
p
;
SC_Timings
*
p
;
p
=
ABC_CALLOC
(
SC_Timings
,
1
);
p
=
ABC_CALLOC
(
SC_Timings
,
1
);
p
->
vTimings
=
Vec_PtrAlloc
(
0
);
p
->
vTimings
=
Vec_PtrAlloc
(
0
);
return
p
;
return
p
;
}
}
static
inline
SC_Pin
*
Abc_SclPinAlloc
()
static
inline
SC_Pin
*
Abc_SclPinAlloc
()
...
@@ -229,8 +230,8 @@ static inline SC_Pin * Abc_SclPinAlloc()
...
@@ -229,8 +230,8 @@ static inline SC_Pin * Abc_SclPinAlloc()
SC_Pin
*
p
;
SC_Pin
*
p
;
p
=
ABC_CALLOC
(
SC_Pin
,
1
);
p
=
ABC_CALLOC
(
SC_Pin
,
1
);
p
->
max_out_slew
=
-
1
;
p
->
max_out_slew
=
-
1
;
p
->
v
RTimings
=
Vec_Ptr
Alloc
(
0
);
p
->
v
Func
=
Vec_Wrd
Alloc
(
0
);
p
->
v
Func
=
Vec_Wrd
Alloc
(
0
);
p
->
v
RTimings
=
Vec_Ptr
Alloc
(
0
);
return
p
;
return
p
;
}
}
static
inline
SC_Cell
*
Abc_SclCellAlloc
()
static
inline
SC_Cell
*
Abc_SclCellAlloc
()
...
@@ -246,8 +247,8 @@ static inline SC_Lib * Abc_SclLibAlloc()
...
@@ -246,8 +247,8 @@ static inline SC_Lib * Abc_SclLibAlloc()
p
=
ABC_CALLOC
(
SC_Lib
,
1
);
p
=
ABC_CALLOC
(
SC_Lib
,
1
);
p
->
default_max_out_slew
=
-
1
;
p
->
default_max_out_slew
=
-
1
;
p
->
unit_time
=
9
;
p
->
unit_time
=
9
;
p
->
unit_cap_f
loat
=
1
;
p
->
unit_cap_f
st
=
1
;
p
->
unit_cap_
int
=
12
;
p
->
unit_cap_
snd
=
12
;
p
->
vWireLoads
=
Vec_PtrAlloc
(
0
);
p
->
vWireLoads
=
Vec_PtrAlloc
(
0
);
p
->
vWireLoadSels
=
Vec_PtrAlloc
(
0
);
p
->
vWireLoadSels
=
Vec_PtrAlloc
(
0
);
p
->
vTempls
=
Vec_PtrAlloc
(
0
);
p
->
vTempls
=
Vec_PtrAlloc
(
0
);
...
...
src/misc/util/abc_global.h
View file @
19d50b98
...
@@ -242,6 +242,7 @@ static inline int Abc_Base16Log( unsigned n ) { int r; if ( n <
...
@@ -242,6 +242,7 @@ static inline int Abc_Base16Log( unsigned n ) { int r; if ( n <
static
inline
char
*
Abc_UtilStrsav
(
char
*
s
)
{
return
s
?
strcpy
(
ABC_ALLOC
(
char
,
strlen
(
s
)
+
1
),
s
)
:
NULL
;
}
static
inline
char
*
Abc_UtilStrsav
(
char
*
s
)
{
return
s
?
strcpy
(
ABC_ALLOC
(
char
,
strlen
(
s
)
+
1
),
s
)
:
NULL
;
}
static
inline
int
Abc_BitWordNum
(
int
nBits
)
{
return
(
nBits
>>
5
)
+
((
nBits
&
31
)
>
0
);
}
static
inline
int
Abc_BitWordNum
(
int
nBits
)
{
return
(
nBits
>>
5
)
+
((
nBits
&
31
)
>
0
);
}
static
inline
int
Abc_TruthWordNum
(
int
nVars
)
{
return
nVars
<=
5
?
1
:
(
1
<<
(
nVars
-
5
));
}
static
inline
int
Abc_TruthWordNum
(
int
nVars
)
{
return
nVars
<=
5
?
1
:
(
1
<<
(
nVars
-
5
));
}
static
inline
int
Abc_Truth6WordNum
(
int
nVars
)
{
return
nVars
<=
6
?
1
:
(
1
<<
(
nVars
-
6
));
}
static
inline
int
Abc_InfoHasBit
(
unsigned
*
p
,
int
i
)
{
return
(
p
[(
i
)
>>
5
]
&
(
1
<<
((
i
)
&
31
)))
>
0
;
}
static
inline
int
Abc_InfoHasBit
(
unsigned
*
p
,
int
i
)
{
return
(
p
[(
i
)
>>
5
]
&
(
1
<<
((
i
)
&
31
)))
>
0
;
}
static
inline
void
Abc_InfoSetBit
(
unsigned
*
p
,
int
i
)
{
p
[(
i
)
>>
5
]
|=
(
1
<<
((
i
)
&
31
));
}
static
inline
void
Abc_InfoSetBit
(
unsigned
*
p
,
int
i
)
{
p
[(
i
)
>>
5
]
|=
(
1
<<
((
i
)
&
31
));
}
static
inline
void
Abc_InfoXorBit
(
unsigned
*
p
,
int
i
)
{
p
[(
i
)
>>
5
]
^=
(
1
<<
((
i
)
&
31
));
}
static
inline
void
Abc_InfoXorBit
(
unsigned
*
p
,
int
i
)
{
p
[(
i
)
>>
5
]
^=
(
1
<<
((
i
)
&
31
));
}
...
...
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