diff --git a/prjxray/util.py b/prjxray/util.py index 0b4cf689..7cde6a0c 100644 --- a/prjxray/util.py +++ b/prjxray/util.py @@ -189,15 +189,19 @@ def gen_tile_bits(db_root, tilej, strict=False, verbose=False): for block_type, blockj in tilej["bits"].items(): baseaddr = int(blockj["baseaddr"], 0) bitbase = 32 * blockj["offset"] + frames = tilej["bits"][block_type]["frames"] if block_type == "CLB_IO_CLK": fn = "%s/segbits_%s.db" % (db_root, tilej["type"].lower()) else: - fn = "%s/segbits_%s.db.%s" % ( + fn = "%s/segbits_%s.%s.db" % ( db_root, tilej["type"].lower(), block_type.lower()) # tilegrid runs a lot earlier than fuzzers # may not have been created yet verbose and print("Check %s: %s" % (fn, os.path.exists(fn))) + + # FIXME: some segbits files are not present and the strict check produces assertion errors + # e.g. segbits_cmt_top_r_lower_b.db if strict: assert os.path.exists(fn) elif not os.path.exists(fn): @@ -208,6 +212,7 @@ def gen_tile_bits(db_root, tilej, strict=False, verbose=False): for bitstr in bits: # 31_06 _bit_inv, (bit_addroff, bit_bitoff) = parse_tagbit(bitstr) + assert bit_addroff <= frames, "ERROR: bit out of bound" yield (baseaddr + bit_addroff, bitbase + bit_bitoff, tag) diff --git a/utils/checkdb.py b/utils/checkdb.py index 425cf4d6..df1d8090 100755 --- a/utils/checkdb.py +++ b/utils/checkdb.py @@ -64,6 +64,7 @@ def check_tile_overlap(db, db_root, strict=False, verbose=False): Throw an exception if two tiles share an address ''' mall = dict() + tiles_type_done = set() tiles_checked = 0 @@ -74,6 +75,10 @@ def check_tile_overlap(db, db_root, strict=False, verbose=False): for tile_name, tilej in db.tilegrid.items(): # for tile_name, tilej in subtiles(["CLBLL_L_X14Y112", "INT_L_X14Y112"]): + if tilej['type'] in tiles_type_done or not tilej["bits"]: + continue + tiles_type_done.add(tilej['type']) + mtile = make_tile_mask( db_root, tile_name, tilej, strict=strict, verbose=verbose) verbose and print(