-
Notifications
You must be signed in to change notification settings - Fork 16
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
Profiles for regression tests #596
Conversation
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.
I like it
@@ -29,6 +40,50 @@ class ProfileInfo: | |||
is_transaction: bool | |||
|
|||
|
|||
@dataclass | |||
class ProfileData: |
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.
At first sight it was not very clear for me what the role of this class is. A single comment line or a name like ProfileDescription
or EntireProfileDescription
would make it clear that it only holds non-runtime information.
return (os.path.relpath(src_loc[0]), src_loc[1]) | ||
|
||
for transaction in method_map.transactions: | ||
transactions_and_methods[get_id(transaction)] = ProfileInfo( |
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.
Maybe a comment should be added to point that we encode transactions and methods to ints so that CycleProfile
can be more efficient?
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.
We also encode transactions and methods to ints so that the required information about transactions can be JSON-serialized. JSON serialization doesn't preserve object identities.
5490800
to
dabd236
Compare
Stumbled upon an issue with pytest (#603). I can't really check if my changes still work, so I'm not merging yet. @lekcyjna123, could you take a look? |
This PR adds support for generating transaction profiles from regression tests, both in pysim and cocotb. The profiler was refactored so that its code can be used both in pysim and cocotb.
By the way, it's unfortunate that benchmarks and riscof tests have some significant code duplication, it would be nice to clean up this mess one day.