diff options
author | Clifford Wolf <clifford@clifford.at> | 2017-07-04 12:24:38 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2017-07-04 12:24:38 +0200 |
commit | 3fb5934d547f4105d1aec4dfb71ea8934daf754b (patch) | |
tree | 3db7cc5d97757864159f36d7beeceb600e84cb6f /icefuzz/make_pll.py | |
parent | 832bcbe4a2a2733cd76d70805390cee55524b0bc (diff) | |
parent | 96511b32b1ee0dbae91f9878094c8f12f5bdafaa (diff) | |
download | icestorm-3fb5934d547f4105d1aec4dfb71ea8934daf754b.tar.gz icestorm-3fb5934d547f4105d1aec4dfb71ea8934daf754b.tar.bz2 icestorm-3fb5934d547f4105d1aec4dfb71ea8934daf754b.zip |
Merge branch 'tannewt'
Diffstat (limited to 'icefuzz/make_pll.py')
-rw-r--r-- | icefuzz/make_pll.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/icefuzz/make_pll.py b/icefuzz/make_pll.py index d438b5e..757a222 100644 --- a/icefuzz/make_pll.py +++ b/icefuzz/make_pll.py @@ -11,9 +11,14 @@ def randbin(n): for p in gpins: if p in pins: pins.remove(p) + -os.system("rm -rf work_pll") -os.mkdir("work_pll") +device_class = os.getenv("ICEDEVICE") + +working_dir = "work_%s_pll" % (device_class, ) + +os.system("rm -rf " + working_dir) +os.mkdir(working_dir) for idx in range(num): pin_names = list() @@ -110,20 +115,17 @@ for idx in range(num): pll_inst.append("defparam uut.TEST_MODE = 1'b0;") - with open("work_pll/pll_%02d.v" % idx, "w") as f: + with open(working_dir + "/pll_%02d.v" % idx, "w") as f: print("module top(%s);" % ", ".join(pin_names), file=f) print("\n".join(vlog_body), file=f) print("\n".join(pll_inst), file=f) print("endmodule", file=f) - with open("work_pll/pll_%02d.pcf" % idx, "w") as f: + with open(working_dir + "/pll_%02d.pcf" % idx, "w") as f: for pll_pin, package_pin in zip(pin_names, list(permutation(pins))[0:len(pin_names)]): if pll_pin == "packagepin": package_pin = "49" print("set_io %s %s" % (pll_pin, package_pin), file=f) -with open("work_pll/Makefile", "w") as f: - print("all: %s" % " ".join(["pll_%02d.bin" % i for i in range(num)]), file=f) - for i in range(num): - print("pll_%02d.bin:" % i, file=f) - print("\t-bash ../icecube.sh pll_%02d > pll_%02d.log 2>&1 && rm -rf pll_%02d.tmp || tail pll_%02d.log" % (i, i, i, i), file=f) + +output_makefile(working_dir, "pll") |