-
Notifications
You must be signed in to change notification settings - Fork 4
Fix lint flow #86
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
base: master
Are you sure you want to change the base?
Fix lint flow #86
Conversation
95853d1 to
e3a9746
Compare
|
It looks like the current fixes allow us to run the linting tools... however the reporting is stubbed out which means the results are not displayed in the terminal. |
e3a9746 to
2238d9b
Compare
|
Reports partially restored. |
d6ada35 to
017f5d1
Compare
| self.sim_cfg = sim_cfg | ||
| self.flow = sim_cfg.name | ||
|
|
||
| if not hasattr(self.sim_cfg, "variant"): |
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.
Is variant used anywhere outside of deploy.py? If not, maybe a nicer hack would be to use things like this?
self._variant_suffix = f"_{self.sim_cfg.variant}" if self.sim_cfg.getattr("variant") else ""
That way, we don't touch the contents of the sim_cfg object.
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's what I had initially, but unfortunately it is used elsewhere. So I chose this approach for time sake and also to reduce the risk of the change.
Longer term I think we need to factor out the Deploy objects altogether and get the FlowCfg to generate the JobSpec objects directly. But that is a bigger change than we can do right now.
src/dvsim/launcher/base.py
Outdated
| self.job_runtime.set(self.job_runtime_secs, "s") | ||
| try: | ||
| time, unit = plugin.get_job_runtime(log_text=lines) | ||
| self.job_runtime.set(time, unit) |
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'd probably suggest tweaking this code so that we set up a local time and unit variables on any of the three branches (including the exception below) and then only call self.job_runtime.set in one place?
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.
Updated
src/dvsim/flow/one_shot.py
Outdated
| for link in self.links: | ||
| rm_path(self.links[link]) | ||
| pathlib.Path(self.links[link]).mkdir(parents=True) | ||
| Path(self.links[link]).mkdir(parents=True) |
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.
Looks sensible. Since you're touching the line anyway, would it make sense to make a path variable from the string in this loop and use it explicitly for rm_path as well?
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.
Done
It seems there sim flow specific assumptions in the deploy object base class, as well as the launcher base class. This issue is a lot broader than the regressions fixed in this commit. The code should be refactored to separate out the sim specific parts from the generic DVSim mechanism. Signed-off-by: James McCorrie <james.mccorrie@lowrisc.org>
Improve the clarity on what is simulation flow specific and what is common. This makes way to fix the linting and formal flows, and creates more clarity on what is required to be implemented to add a new flow. Signed-off-by: James McCorrie <james.mccorrie@lowrisc.org>
04b4d8d to
d1153e2
Compare
Signed-off-by: James McCorrie <james.mccorrie@lowrisc.org>
d1153e2 to
102e7a3
Compare
|
This PR seems to get the CLI report working. The HTML report is still not in place, but I'll leave that for further PRs. This gets the flow working again for the moment. |
This PR addresses the regressions in the lint flow. All of the refactoring until now has been simulation focused, unfortunately this has resulted in some regressions in other flows such as linting.
The immediate goal is to restore the functionality of these other flows.
Not covered: the HTML report generation.