-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfabfile.py
69 lines (51 loc) · 1.83 KB
/
fabfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
from random import sample
from string import lowercase
from fabric.api import run
from fabric.api import sudo
from fabric.api import cd
from fabric.api import env
from fabric.state import output
from fabric.operations import put
from fabric.operations import get
from fabric.contrib.files import exists
project_name = "sync-models"
workspace_dir = "workspaces"
output["status"] = False
output["running"] = False
env.output_prefix = False
env.use_ssh_config = True
versify_host = "vmach"
ifv_host = "eeebrahms"
def vers():
env.host_string = versify_host
put("examples/flat-arbiter/correct.blif", "/home/ubuntu/circuit.blif")
put("examples/flat-arbiter/spec.g", "/home/ubuntu/spec.g")
put("libraries/workcraft.lib", "/home/ubuntu/versify.genlib")
put("libraries/extra.lib", "/home/ubuntu/extra.genlib")
with cd("/home/ubuntu"):
run("time versify -nosemi -Lversify.genlib -Ccircuit.blif -Espec.g")
def verify():
env.host_string = ifv_host
clean()
run_name = "".join(sample(lowercase, 6))
work_dir = "%s/%s/%s" % (workspace_dir, project_name, run_name)
run("mkdir -p %s" % work_dir)
with cd(work_dir):
# Create project subdirectories
run("mkdir -p workspace")
run("mkdir -p generated")
run("mkdir -p gates")
# Copy files
put("gates/*", "gates")
put("generated-ifv-perf/*", "generated")
put("ifv/go.sh", "go.sh", mirror_local_mode=True)
put("ifv/run.tcl", "run.tcl")
# Run ifv
run("module load cadence-license && ./go.sh")
# Grab counter-example
if exists("examples/counter.vcd"):
get("examples/counter.vcd", "counter.vcd")
def clean():
env.host_string = ifv_host
work_dir = "%s/%s/" % (workspace_dir, project_name)
run("rm -rf %s" % work_dir)