diff options
author | Clifford Wolf <clifford@clifford.at> | 2017-11-21 18:19:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-21 18:19:47 +0100 |
commit | 6e9a2da5c46edf00f1dc87c86053b5edbc17d5d7 (patch) | |
tree | b94fdbf6f316b9758e8afd848d8c900343469f07 /icefuzz/glbcheck.py | |
parent | 9a2a325acb846936431c4aa5843184034be25d5c (diff) | |
parent | 9184fbdf404c0e94326919c92a27d3292994cdf1 (diff) | |
download | icestorm-6e9a2da5c46edf00f1dc87c86053b5edbc17d5d7.tar.gz icestorm-6e9a2da5c46edf00f1dc87c86053b5edbc17d5d7.tar.bz2 icestorm-6e9a2da5c46edf00f1dc87c86053b5edbc17d5d7.zip |
Merge pull request #109 from daveshah1/up5k
Support for new UltraPlus features
Diffstat (limited to 'icefuzz/glbcheck.py')
-rw-r--r-- | icefuzz/glbcheck.py | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/icefuzz/glbcheck.py b/icefuzz/glbcheck.py index 49008ca..04a2580 100644 --- a/icefuzz/glbcheck.py +++ b/icefuzz/glbcheck.py @@ -6,26 +6,32 @@ asc_bits = set() glb_bits = set() # parsing .asc file -with open(argv[1]) as f: - current_tile = None - current_line = None - for line in f: - if line.startswith("."): - if line.find("_tile ") >= 0: - f = line.split() - current_tile = "%02d.%02d" % (int(f[1]), int(f[2])) - current_line = 0 - else: - current_tile = None - current_line = None - continue - - if current_tile is not None: - for i in range(len(line)): - if line[i] == '1': - asc_bits.add("%s.%02d.%02d" % (current_tile, current_line, i)) - current_line += 1 +try: + with open(argv[1]) as f: + current_tile = None + current_line = None + for line in f: + if line.startswith("."): + if line.find("_tile ") >= 0: + f = line.split() + current_tile = "%02d.%02d" % (int(f[1]), int(f[2])) + current_line = 0 + else: + current_tile = None + current_line = None + continue + if current_tile is not None: + for i in range(len(line)): + if line[i] == '1': + asc_bits.add("%s.%02d.%02d" % (current_tile, current_line, i)) + current_line += 1 +except FileNotFoundError: + print("ASC file doesn't exist, skipping glbcheck!.") + # The asc file may not exist for innocent reasons, such as + # the icecube router failing. So exit with code 0 to keep + # the fuzz Makefile happy + exit(0) # parsing .glb file with open(argv[2]) as f: current_tile = None |