intpips: maketodo.py

Signed-off-by: John McMaster <johndmcmaster@gmail.com>
This commit is contained in:
John McMaster 2018-12-11 16:35:39 -08:00
parent b384f1f09e
commit 35a473ffed
1 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,57 @@
#!/usr/bin/env python3
import os, re, sys
from prjxray import util
def maketodo(pipfile, dbfile, verbose=False):
'''Print name of all pips in pipfile but not dbfile'''
todos = set()
with open(pipfile, "r") as f:
for line in f:
line = line.split()
todos.add(line[0])
verbose and print(
'%s: %u entries' % (pipfile, len(todos)), file=sys.stderr)
# Support generate without existing DB
if os.path.exists(dbfile):
with open(dbfile, "r") as f:
for line in f:
line = line.split()
pip = line[0]
todos.remove(pip)
verbose and print(
'Remove %s: %u entries' % (dbfile, len(todos)), file=sys.stderr)
drops = 0
lines = 0
for line in todos:
if line.endswith(".VCC_WIRE"):
drops += 1
continue
print(line)
lines += 1
verbose and print(
'Print %u entries w/ %u drops' % (lines, drops), file=sys.stderr)
def run(build_dir):
maketodo(
"%s/pips_int_l.txt" % build_dir, "%s/segbits_int_l.db" % build_dir)
maketodo(
"%s/pips_int_r.txt" % build_dir, "%s/segbits_int_r.db" % build_dir)
def main():
import argparse
parser = argparse.ArgumentParser(
description="Print list of known but unsolved PIPs")
parser.add_argument('--build-dir', default="build", help='')
args = parser.parse_args()
run(build_dir=args.build_dir)
if __name__ == '__main__':
main()