diff options
author | Michael Buesch <m@bues.ch> | 2019-06-07 23:44:32 +0200 |
---|---|---|
committer | Michael Buesch <m@bues.ch> | 2019-06-08 16:12:16 +0200 |
commit | 30769bbfd0b6399200c79e20247788e3799310ad (patch) | |
tree | dd64894f75abeb2278e420f775b8428a50444332 | |
parent | 52bbe0f4690b305de571eb94b90863d3c0d4fec2 (diff) | |
download | icestorm-30769bbfd0b6399200c79e20247788e3799310ad.tar.gz icestorm-30769bbfd0b6399200c79e20247788e3799310ad.tar.bz2 icestorm-30769bbfd0b6399200c79e20247788e3799310ad.zip |
icebox_explain: Use cached re functions
-rwxr-xr-x | icebox/icebox_explain.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/icebox/icebox_explain.py b/icebox/icebox_explain.py index 4e678ff..f843c09 100755 --- a/icebox/icebox_explain.py +++ b/icebox/icebox_explain.py @@ -16,6 +16,7 @@ # import icebox +from icebox import re_match_cached, re_search_cached import getopt, sys, re print_bits = False @@ -82,14 +83,14 @@ def print_tile(stmt, ic, x, y, tile, db): else: bits.add("!B%d[%d]" % (k, i)) - if re.search(r"logic_tile", stmt): + if re_search_cached(r"logic_tile", stmt): active_luts = set([i for i in range(8) if "1" in icebox.get_lutff_bits(tile, i)]) text = set() used_lc = set() text_default_mask = 0 for entry in db: - if re.match(r"LC_", entry[1]): + if re_match_cached(r"LC_", entry[1]): continue if entry[1] in ("routing", "buffer"): if not ic.tile_has_net(x, y, entry[2]): continue @@ -117,7 +118,7 @@ def print_tile(stmt, ic, x, y, tile, db): bitinfo.append("") extra_text = "" for i in range(len(line)): - if 36 <= i <= 45 and re.search(r"(logic_tile|dsp\d_tile|ipcon_tile)", stmt): + if 36 <= i <= 45 and re_search_cached(r"(logic_tile|dsp\d_tile|ipcon_tile)", stmt): lutff_idx = k // 2 lutff_bitnum = (i-36) + 10*(k%2) if line[i] == "1": |