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

Profiles for regression tests #596

Merged
merged 11 commits into from
Mar 7, 2024
Merged

Profiles for regression tests #596

merged 11 commits into from
Mar 7, 2024

Conversation

tilk
Copy link
Member

@tilk tilk commented Mar 1, 2024

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.

Copy link

@xThaid xThaid left a 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:
Copy link

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.

transactron/profiler.py Show resolved Hide resolved
return (os.path.relpath(src_loc[0]), src_loc[1])

for transaction in method_map.transactions:
transactions_and_methods[get_id(transaction)] = ProfileInfo(
Copy link
Contributor

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?

Copy link
Member Author

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.

@tilk tilk force-pushed the tilk/profiles-cocotb branch from 5490800 to dabd236 Compare March 6, 2024 14:16
@tilk
Copy link
Member Author

tilk commented Mar 6, 2024

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?

@tilk tilk merged commit 0ae1ed8 into master Mar 7, 2024
8 checks passed
@tilk tilk deleted the tilk/profiles-cocotb branch March 7, 2024 13:47
github-actions bot pushed a commit that referenced this pull request Mar 7, 2024
tilk added a commit to kuznia-rdzeni/transactron that referenced this pull request Nov 25, 2024
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