parse_db_line: verbose error on mask input

Signed-off-by: John McMaster <johndmcmaster@gmail.com>
This commit is contained in:
John McMaster 2018-11-13 19:47:13 -08:00
parent 8753ac3b67
commit 1707c01306
1 changed files with 2 additions and 0 deletions

View File

@ -78,6 +78,8 @@ def parse_db_line(line):
# Ex: CLBLL_L.SLICEL_X0.AMUX.A5Q
assert len(parts), "Empty line"
tag = parts[0]
if tag == 'bit':
raise ValueError("Wanted bits db but got mask db")
assert re.match(r'[A-Z0-9_.]+',
tag), "Invalid tag name: %s, line: %s" % (tag, line)
orig_bits = line.replace(tag + " ", "")