aboutsummaryrefslogtreecommitdiffstats
path: root/icebox
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2019-06-07 23:41:40 +0200
committerMichael Buesch <m@bues.ch>2019-06-08 16:12:16 +0200
commitc4ac25e096d5ca660102a8806f9596269724eaba (patch)
treea218d283ce8609f6940ce4a9c358cc6cd97b8dd8 /icebox
parentd26ac8d09eb31898b3c79f9cb4193bbe4b1286d6 (diff)
downloadicestorm-c4ac25e096d5ca660102a8806f9596269724eaba.tar.gz
icestorm-c4ac25e096d5ca660102a8806f9596269724eaba.tar.bz2
icestorm-c4ac25e096d5ca660102a8806f9596269724eaba.zip
icebox_colbuf: Use cached re functions
Diffstat (limited to 'icebox')
-rwxr-xr-xicebox/icebox_colbuf.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/icebox/icebox_colbuf.py b/icebox/icebox_colbuf.py
index 26b8940..ec6843e 100755
--- a/icebox/icebox_colbuf.py
+++ b/icebox/icebox_colbuf.py
@@ -16,6 +16,7 @@
#
import icebox
+from icebox import re_match_cached
import getopt, sys, re
check_mode = False
@@ -70,7 +71,7 @@ def make_cache(stmt, raw_db):
if bit.startswith("!"):
value = "0"
bit = bit[1:]
- match = re.match("B([0-9]+)\[([0-9]+)\]", bit)
+ match = re_match_cached("B([0-9]+)\[([0-9]+)\]", bit)
cache_entry[1].append((int(match.group(1)), int(match.group(2)), value))
cache.append(cache_entry)
return cache
@@ -120,7 +121,7 @@ def set_colbuf(ic, tile, bit, value):
tile_db = ic.tile_db(tile[0], tile[1])
for entry in tile_db:
if entry[1] == "ColBufCtrl" and entry[2] == "glb_netwk_%d" % bit:
- match = re.match("B([0-9]+)\[([0-9]+)\]", entry[0][0])
+ match = re_match_cached("B([0-9]+)\[([0-9]+)\]", entry[0][0])
l = tile_dat[int(match.group(1))]
n = int(match.group(2))
l = l[:n] + value + l[n+1:]