From 837e1605604ebebf09fe8058de823b2647ea6392 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Wed, 30 Sep 2020 12:05:50 -0700 Subject: [PATCH] Add fix to prevent INT features with 3 bits. This may help fix #1246. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- utils/dbfixup.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/utils/dbfixup.py b/utils/dbfixup.py index 015718a3..1d3bc2cd 100755 --- a/utils/dbfixup.py +++ b/utils/dbfixup.py @@ -9,8 +9,10 @@ # # SPDX-License-Identifier: ISC -import sys, os, re import itertools +import os +import re + from prjxray import util clb_int_zero_db = [ @@ -283,6 +285,16 @@ def add_zero_bits( """ if clb_int: zero_range(tag, bits, 22, 25) + + set_bits = [bit for bit in bits if bit[0] != '!'] + if len(set_bits) not in [2, 4]: + # All INT bits appear to be only have 2 or 4 bits. + verbose and print( + "WARNING: dropping line with %d bits, not [2, 4]: %s, %s" + % (len(set_bits), bits, line)) + drops += 1 + continue + zero_groups.add_bits_from_zero_groups( tag, bits, strict=strict, verbose=verbose) @@ -303,7 +315,6 @@ def add_zero_bits( if new_line != line: changes += 1 new_lines.add(new_line) - llast = line if drops: print("WARNING: %s dropped %s unresolved lines" % (fn_in, drops))