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
2f64033b
Commit
2f64033b
authored
Jun 22, 2012
by
Baruch Sterin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
735a831e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
11 deletions
+57
-11
scripts/main.py
+57
-11
scripts/par.py
+0
-0
No files found.
scripts/main.py
View file @
2f64033b
...
...
@@ -86,6 +86,9 @@ def constraints():
print
(
"inductive constraints:"
)
x
(
'constr '
)
def
help
(
s
):
run_command
(
'
%
s -h'
%
s
)
def
strip
():
"""Strip out each output of a multi-output example and write it
into a separate file"""
...
...
@@ -100,6 +103,12 @@ def strip():
abc
(
'w p_
%
d.aig'
%
j
)
print_circuit_stats
()
def
fn_def
(
f
,
n
):
filename
=
f
.
__code__
.
co_filename
firstline
=
f
.
__code__
.
co_firstlineno
lines
=
open
(
filename
,
"r"
)
.
readlines
()
print
""
.
join
(
lines
[
firstline
:
n
+
firstline
])
def
lst
(
list
,
match
):
result
=
[]
for
j
in
range
(
len
(
list
)):
...
...
@@ -133,20 +142,54 @@ def blif2aig():
def
la
():
return
list_aig
(
''
)
def
list_aig
(
s
):
def
list_aig
(
s
=
''
):
""" prnts out the sizes of aig files"""
#os.chdir('../ibm-web')
list_all
=
os
.
listdir
(
'.'
)
dir
=
lst
(
list_all
,
'.aig'
)
dir
.
sort
()
result
=
[]
for
j
in
range
(
len
(
dir
)):
name
=
dir
[
j
][:
-
4
]
if
not
s
in
name
:
if
not
s
_in_s
(
s
,
name
)
:
continue
print
'
%
s '
%
name
,
abc
(
'r
%
s.aig'
%
name
)
ps
()
return
dir
result
=
result
+
[
name
]
return
result
def
list_blif
(
s
=
''
):
""" prnts out the sizes of aig files"""
#os.chdir('../ibm-web')
list_all
=
os
.
listdir
(
'.'
)
dir
=
lst
(
list_all
,
'.blif'
)
dir
.
sort
()
result
=
[]
for
j
in
range
(
len
(
dir
)):
name
=
dir
[
j
][:
-
5
]
if
not
s_in_s
(
s
,
name
):
continue
print
'
%
s: '
%
name
,
abc
(
'read_blif
%
s.blif'
%
name
)
run_command
(
'ps'
)
abc
(
'st;zero;w
%
s.aig'
%
name
)
result
=
result
+
[
name
]
return
result
def
s_in_s
(
s1
,
s2
):
ls1
=
len
(
s1
)
l
=
1
+
len
(
s2
)
-
ls1
if
l
<
0
:
return
False
else
:
for
j
in
range
(
l
):
if
s1
==
s2
[
j
:
j
+
ls1
]:
return
True
else
:
continue
return
False
def
convert_ibm
():
""" converts blif files (with constraints?) into aig files"""
...
...
@@ -174,14 +217,16 @@ def cleanup():
list
=
os
.
listdir
(
'.'
)
for
j
in
range
(
len
(
list
)):
name
=
list
[
j
]
if
((
'_smp'
in
name
)
or
(
'_save'
in
name
)
or
(
'_backup'
in
name
)
or
(
'_osave'
in
name
)
or
(
'_best'
in
name
)
or
(
'_gsrm'
in
name
)
or
(
'gore'
in
name
)
or
(
'_bip'
in
name
)
or
(
'sm0'
in
name
)
or
(
'gabs'
in
name
)
or
(
'temp'
in
name
)
or
(
'__'
in
name
)
or
(
'greg'
in
name
)
or
(
'tf2'
in
name
)
or
(
'gsrm'
in
name
)
or
(
'_rpm'
in
name
)
or
(
'gsyn'
in
name
)
or
(
'beforerpm'
in
name
)
or
(
'afterrpm'
in
name
)
or
(
'initabs'
in
name
)
or
(
'.status'
in
name
)
or
(
'_init'
in
name
)
or
(
'_osave'
in
name
)
or
(
'tt_'
in
name
)
or
(
'_before'
in
name
)
or
(
'_after'
in
name
)
or
(
'_and'
in
name
)
or
(
'_final'
in
name
)
or
(
'_spec'
in
name
)
or
(
'temp.a'
in
name
)
or
(
'_sync'
in
name
)
if
((
s_in_s
(
'_smp'
,
name
))
or
(
s_in_s
(
'_save'
,
name
))
or
(
s_in_s
(
'_backup'
,
name
))
or
(
s_in_s
(
'_osave'
,
name
))
or
(
s_in_s
(
'_best'
,
name
))
or
(
s_in_s
(
'_gsrm'
,
name
))
or
(
s_in_s
(
'gore'
,
name
))
or
(
s_in_s
(
'_bip'
,
name
))
or
(
s_in_s
(
'sm0'
,
name
))
or
(
s_in_s
(
'gabs'
,
name
))
or
(
s_in_s
(
'temp'
,
name
))
or
(
s_in_s
(
'__'
,
name
))
or
(
s_in_s
(
'greg'
,
name
))
or
(
s_in_s
(
'tf2'
,
name
))
or
(
s_in_s
(
'gsrm'
,
name
))
or
(
s_in_s
(
'_rpm'
,
name
))
or
(
s_in_s
(
'gsyn'
,
name
))
or
(
s_in_s
(
'beforerpm'
,
name
))
or
(
s_in_s
(
'afterrpm'
,
name
))
or
(
s_in_s
(
'initabs'
,
name
))
or
(
s_in_s
(
'.status'
,
name
))
or
(
s_in_s
(
'_init'
,
name
))
or
(
s_in_s
(
'_osave'
,
name
))
or
(
s_in_s
(
'tt_'
,
name
))
or
(
s_in_s
(
'_before'
,
name
))
or
(
s_in_s
(
'_after'
,
name
))
or
(
s_in_s
(
'_and'
,
name
))
or
(
s_in_s
(
'_final'
,
name
))
or
(
s_in_s
(
'_spec'
,
name
))
or
(
s_in_s
(
'temp.a'
,
name
))
or
(
s_in_s
(
'_sync'
,
name
))
or
(
s_in_s
(
'_old'
,
name
))
or
(
s_in_s
(
'_cone_'
,
name
))
or
(
s_in_s
(
'_abs'
,
name
))
or
(
s_in_s
(
'_vabs'
,
name
))
):
os
.
remove
(
name
)
...
...
@@ -215,6 +260,7 @@ def strip_names():
simplify
()
run_command
(
'w
%
s_smp.aig'
%
name
)
def
map_ibm
():
os
.
chdir
(
'../ibmmike2'
)
list_ibm
=
os
.
listdir
(
'.'
)
...
...
scripts/par.py
View file @
2f64033b
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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