Merge pull request #167 from mithro/icebox_vlog_drivers

icebox_vlog: Better information about drivers for nets.
This commit is contained in:
Clifford Wolf 2018-07-10 21:20:59 +02:00 committed by GitHub
commit 9ccdd95ff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 11 deletions

View File

@ -345,21 +345,21 @@ for segs in sorted(ic.group_segments(extra_connections=extra_connections, extra_
else:
net_segs.add(s)
count_drivers = 0
count_drivers = []
for s in segs:
if re.match(r"ram/RDATA_", s[2]): count_drivers += 1
if re.match(r"io_./D_IN_", s[2]): count_drivers += 1
if re.match(r"lutff_./out", s[2]): count_drivers += 1
if re.match(r"lutff_./lout", s[2]): count_drivers += 1
if re.match(r"ram/RDATA_", s[2]): count_drivers.append(s[2])
if re.match(r"io_./D_IN_", s[2]): count_drivers.append(s[2])
if re.match(r"lutff_./out", s[2]): count_drivers.append(s[2])
if re.match(r"lutff_./lout", s[2]): count_drivers.append(s[2])
if count_drivers != 1 and check_driver:
failed_drivers_check.append(n)
if len(count_drivers) != 1 and check_driver:
failed_drivers_check.append((n, count_drivers))
if not strip_comments:
for s in sorted(net_segs):
text_wires.append("// %s" % (s,))
if count_drivers != 1 and check_driver:
text_wires.append("// Number of drivers: %d" % count_drivers)
text_wires.append("// Number of drivers: %d %s" % (len(count_drivers), count_drivers))
text_wires.append("")
def seg_to_net(seg, default=None):
@ -941,7 +941,9 @@ print("endmodule")
print()
if failed_drivers_check:
print("// Single-driver-check failed for %d nets:" % len(failed_drivers_check))
print("// %s" % " ".join(failed_drivers_check))
assert False
emsg = ["Single-driver-check failed for %d nets:" % len(failed_drivers_check)]
for net, drivers in failed_drivers_check:
emsg.append("%s has %d drivers: %s" % (net, len(drivers), drivers))
print("//", "\n//".join(emsg))
assert False, "\n ".join(emsg)