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

Add initial support for print #28

Merged
merged 7 commits into from
Sep 14, 2018
Merged

Add initial support for print #28

merged 7 commits into from
Sep 14, 2018

Conversation

leonardt
Copy link
Owner

@leonardt leonardt commented Sep 14, 2018

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:

    tester.print(circ.O, "%08x")

Adds tests for Actions, Tester, and the magma/verilator targets.

@coveralls
Copy link

coveralls commented Sep 14, 2018

Pull Request Test Coverage Report for Build 224

  • 28 of 29 (96.55%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.9%) to 81.023%

Changes Missing Coverage Covered Lines Changed/Added Lines %
fault/actions.py 12 13 92.31%
Totals Coverage Status
Change from base Build 211: 0.9%
Covered Lines: 491
Relevant Lines: 606

💛 - Coveralls

fault/actions.py Outdated
@@ -34,6 +34,24 @@ def __init__(self, port, value):
super().__init__(port, value)


class Peek(Action):
Copy link
Collaborator

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.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Okay that makes sense.

@leonardt leonardt changed the title Add initial support for peek Add initial support for print Sep 14, 2018
@leonardt
Copy link
Owner Author

If you're referring to the tester method peek, just caught that (sorry was find/replacing Peek, didn't catch the lower case)

@rsetaluri
Copy link
Collaborator

oh just saw you did that 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants