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

added caching mechanism #492

Merged
merged 10 commits into from
Jul 17, 2024
Merged

added caching mechanism #492

merged 10 commits into from
Jul 17, 2024

Conversation

yonnorc42
Copy link
Contributor

@yonnorc42 yonnorc42 commented Jun 21, 2024

For the larger designs like jpegencode, a lot of the runtime is spent initializing the list of possible matches for each primitive based on cell type and properties. This pr creates a caching mechanism which rebuilds the dict based on the instance names. For jpegencode, this brought the runtime down by 29 minutes.

@yonnorc42
Copy link
Contributor Author

yonnorc42 commented Jun 21, 2024

The caching messes up error injection because normally error injection will catch flipped bits during the initialization of the possible matches.

@yonnorc42 yonnorc42 marked this pull request as ready for review July 12, 2024 02:43
@yonnorc42 yonnorc42 requested a review from reillymck July 12, 2024 04:56
bfasst/utils/structural.py Outdated Show resolved Hide resolved
@@ -22,11 +30,12 @@ class StructuralCompareError(Exception):
class StructuralCompare:
"""Structural compare and map"""

def __init__(self, named_netlist_path, reversed_netlist_path, log_path) -> None:
def __init__(self, named_netlist_path, reversed_netlist_path, log_path, debug=False) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you change other files to use this debug parameter? Or when you use the debug feature how are you setting it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've been using a script that runs comparison directly without using ninja to allow me more flexibility and customization. Should I add it in as a flow argument?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think what we should do is have it dump the debug file by default, but only look for if the file exists if it is passed in as a command line argument. Maybe --debug should tell it to look for the file, and it dumps the file regardless. How does that sound?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That sounds good to me.

@yonnorc42
Copy link
Contributor Author

I decided to do it as a flow arg, by default it's false but if you add --flow_arguments "{'debug': True}" to the end of your "python scripts/run.py ... " it will use the cache if there is one available, and use the RapidWright functionality as well. If debugging mode is False, and/or if there is no cache available, it will create a cache during that run.

@yonnorc42 yonnorc42 requested a review from reillymck July 16, 2024 21:03
@reillymck reillymck merged commit 0321197 into main Jul 17, 2024
18 checks passed
@reillymck reillymck deleted the possible_matches_cache branch July 17, 2024 16:58
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.

2 participants