diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-07-10 21:20:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-10 21:20:59 +0200 |
commit | 9ccdd95ff71eca76fb93427992c04ab51491ff4b (patch) | |
tree | 2685a02606db89fa1c236e2e5cdd695e8592e3e7 /icebox | |
parent | 2d1f1f6258a2d56bf3b7b86d6a2483e3c99e7de1 (diff) | |
parent | ef618927caa8468ef8afcd38d7b4e15938580d81 (diff) | |
download | icestorm-9ccdd95ff71eca76fb93427992c04ab51491ff4b.tar.gz icestorm-9ccdd95ff71eca76fb93427992c04ab51491ff4b.tar.bz2 icestorm-9ccdd95ff71eca76fb93427992c04ab51491ff4b.zip |
Merge pull request #167 from mithro/icebox_vlog_drivers
icebox_vlog: Better information about drivers for nets.
Diffstat (limited to 'icebox')
-rwxr-xr-x | icebox/icebox_vlog.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/icebox/icebox_vlog.py b/icebox/icebox_vlog.py index 68c0925..0080f34 100755 --- a/icebox/icebox_vlog.py +++ b/icebox/icebox_vlog.py @@ -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) |