diff options
author | Tim 'mithro' Ansell <me@mith.ro> | 2018-07-08 15:59:53 -0700 |
---|---|---|
committer | Tim 'mithro' Ansell <me@mith.ro> | 2018-07-08 15:59:53 -0700 |
commit | ef618927caa8468ef8afcd38d7b4e15938580d81 (patch) | |
tree | 8f94635d62a78cc66965c0e961edaf4feb58eb65 | |
parent | b2e1df618c01194011926b3e42b07a2257c249a6 (diff) | |
download | icestorm-ef618927caa8468ef8afcd38d7b4e15938580d81.tar.gz icestorm-ef618927caa8468ef8afcd38d7b4e15938580d81.tar.bz2 icestorm-ef618927caa8468ef8afcd38d7b4e15938580d81.zip |
icebox_vlog: Save error message to file and print it.
Previously if you were doing;
`icebox_vlog example.asc > example_bit.v` you would just get;
```
Traceback (most recent call last):
File "icebox_vlog.py", line 947, in <module>
assert False
AssertionError
```
Now you get;
```
Traceback (most recent call last):
File "icebox_vlog.py", line 948, in <module>
assert False, "\n ".join(emsg)
AssertionError: Single-driver-check failed for 2 nets:
n10 has 0 drivers: []
n15 has 2 drivers: ['clk', 'clk2']
```
-rwxr-xr-x | icebox/icebox_vlog.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/icebox/icebox_vlog.py b/icebox/icebox_vlog.py index 21ffb12..9f5b602 100755 --- a/icebox/icebox_vlog.py +++ b/icebox/icebox_vlog.py @@ -941,8 +941,9 @@ print("endmodule") print() if failed_drivers_check: - print("// Single-driver-check failed for %d nets:" % len(failed_drivers_check)) + emsg = ["Single-driver-check failed for %d nets:" % len(failed_drivers_check)] for net, drivers in failed_drivers_check: - print("// %s has %d drivers: %s" % (net, len(drivers), drivers)) - assert False + emsg.append("%s has %d drivers: %s" % (net, len(drivers), drivers)) + print("//", "\n//".join(emsg)) + assert False, "\n ".join(emsg) |