aboutsummaryrefslogtreecommitdiffstats
path: root/icebox
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2019-06-07 23:52:47 +0200
committerMichael Buesch <m@bues.ch>2019-06-08 16:12:16 +0200
commit00213ed9c39e291a8750e1425b059f617219533b (patch)
treefc9764fb351cd197b2e71bc5b8d612469ececc70 /icebox
parent51a11ffc81a09bd464f4ef637646fa682d281f54 (diff)
downloadicestorm-00213ed9c39e291a8750e1425b059f617219533b.tar.gz
icestorm-00213ed9c39e291a8750e1425b059f617219533b.tar.bz2
icestorm-00213ed9c39e291a8750e1425b059f617219533b.zip
icebox_stat: Use cached re functions
Diffstat (limited to 'icebox')
-rwxr-xr-xicebox/icebox_stat.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/icebox/icebox_stat.py b/icebox/icebox_stat.py
index ffb7b6a..ec404fb 100755
--- a/icebox/icebox_stat.py
+++ b/icebox/icebox_stat.py
@@ -16,6 +16,7 @@
#
import icebox
+from icebox import re_match_cached
import getopt, sys, re
verbose = False
@@ -72,23 +73,23 @@ if verbose:
for segs in connections:
for seg in segs:
if ic.tile_type(seg[0], seg[1]) == "IO" and seg[2].startswith("io_"):
- match = re.match("io_(\d+)/D_(IN|OUT)_(\d+)", seg[2])
+ match = re_match_cached("io_(\d+)/D_(IN|OUT)_(\d+)", seg[2])
if match:
loc = (seg[0], seg[1], int(match.group(1)))
io_locations.add(loc)
if ic.tile_type(seg[0], seg[1]) == "LOGIC" and seg[2].startswith("lutff_"):
- match = re.match("lutff_(\d)/in_\d", seg[2])
+ match = re_match_cached("lutff_(\d)/in_\d", seg[2])
if match:
loc = (seg[0], seg[1], int(match.group(1)))
lut_locations.add(loc)
- match = re.match("lutff_(\d)/cout", seg[2])
+ match = re_match_cached("lutff_(\d)/cout", seg[2])
if match:
loc = (seg[0], seg[1], int(match.group(1)))
carry_locations.add(loc)
- match = re.match("lutff_(\d)/out", seg[2])
+ match = re_match_cached("lutff_(\d)/out", seg[2])
if match:
loc = (seg[0], seg[1], int(match.group(1)))
seq_bits = icebox.get_lutff_seq_bits(ic.tile(loc[0], loc[1]), loc[2])
@@ -100,7 +101,7 @@ for segs in connections:
bram_locations.add(loc)
if seg[2].startswith("glb_netwk_"):
- match = re.match("glb_netwk_(\d)", seg[2])
+ match = re_match_cached("glb_netwk_(\d)", seg[2])
if match:
global_nets.add(int(match.group(1)))
@@ -108,7 +109,7 @@ pll_config_bitidx = dict()
for entry in icebox.iotile_l_db:
if entry[1] == "PLL":
- match = re.match(r"B(\d+)\[(\d+)\]", entry[0][0]);
+ match = re_match_cached(r"B(\d+)\[(\d+)\]", entry[0][0]);
assert match
pll_config_bitidx[entry[2]] = (int(match.group(1)), int(match.group(2)))