-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add initial support for print #28
Conversation
Pull Request Test Coverage Report for Build 224
💛 - Coveralls |
fault/actions.py
Outdated
@@ -34,6 +34,24 @@ def __init__(self, port, value): | |||
super().__init__(port, value) | |||
|
|||
|
|||
class Peek(Action): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we can rename this to like Print(format_str, *args)
where we have some special syntax for a port (like %v
or something else that's not used). The target functionality is the same, it just makes it more clear that this is just a print statement, not returning you the value inline as a peek
normally would.
I.e. val = peek(foo.O)
doesn't make sense here, though that's the normal usage of peek. Then if we have a non-compiled tester in the future that's running in real time, we can actually have a peek
that returns a value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay that makes sense.
If you're referring to the tester method |
oh just saw you did that 😄 |
Only works on top level ports
Supports an optional argument
format_str
which allows you to customize how the value is printed (by default it is%x
).Example usage:
Adds tests for Actions, Tester, and the magma/verilator targets.