Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'wired to None' error message #276

Merged
merged 1 commit into from
Sep 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion magma/backend/coreir_.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ def is_clock_or_nested_clock(p):
if value is None and is_clock_or_nested_clock(port):
return
elif value is None:
raise Exception("Got None for port: {}, is it connected to anything?".format(port))
raise Exception(f"Got None for port '{port.debug_name}', is it "
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably consolidate all error reporting in the backends. In some places we use Exceptions, in others error().

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point to where we use error in the backend?

The idea was that error was used for things like wiring logic, which shouldn't terminate the program so you can see all the wiring errors. (like seeing multiple errors from a C compiler)

The backends throw exceptions because if it runs into an issue, it can't continue on (e.g. it can't compile anything), so the program should terminate.

"connected to anything?")
elif isinstance(value, coreir.Wireable):
source = value

Expand Down