-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
The caching messes up error injection because normally error injection will catch flipped bits during the initialization of the possible matches. |
bfasst/utils/structural.py
Outdated
@@ -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: |
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.
Did you change other files to use this debug parameter? Or when you use the debug feature how are you setting it?
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'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?
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 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?
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.
That sounds good to me.
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. |
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.