Skip to content

Conversation

@machshev
Copy link
Collaborator

@machshev machshev commented Jan 8, 2026

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.

  • Hacky fixes for sim specific assumptions in common components
  • Refactor sim flow modules into a top level sim package - this means it's clearer which components are common and generic and which are simulation specific.
  • Restore the old linting report generation - this includes the markdown report that is printed to the terminal.

@machshev machshev force-pushed the fix_lint_flow branch 3 times, most recently from 95853d1 to e3a9746 Compare January 8, 2026 16:24
@machshev
Copy link
Collaborator Author

machshev commented Jan 8, 2026

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.

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 <[email protected]>
@machshev
Copy link
Collaborator Author

machshev commented Jan 8, 2026

Reports partially restored.

[I 260108 17:16:52 one_shot:180] [results]: [aes]:
    ## AES Style Lint Results

    ### Thursday January 08 2026 17:16:52 UTC
    ### GitHub Revision: [`d6ada3540f`](https://github.com/lowrisc/opentitan/tree/d6ada3540ff636dbd9962b24c722f606a0dd5980)
    ### Branch: fix_lint_flow
    ### Tool: VERIBLELINT

    |  Build Mode  |  Flow Infos  |  Flow Warnings  |  Flow Errors  |  Lint Infos  |  Lint Warnings  |  Lint Errors  |
    |:------------:|:------------:|:---------------:|:-------------:|:------------:|:---------------:|:-------------:|
    |   default    |     0 I      |       0 W       |      1 E      |     0 I      |       0 W       |      0 E      |

    ### Messages for Build Mode `'default'`
    #### Flow Errors
    ```
    IOError: [Errno 2] No such file or directory: '/home/jamesm/base/opentitan/scratch/fix_lint_flow/aes-lint-veriblelint/default/results.hjson'

    ```

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 <[email protected]>
self.sim_cfg = sim_cfg
self.flow = sim_cfg.name

if not hasattr(self.sim_cfg, "variant"):
Copy link
Contributor

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.

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)
Copy link
Contributor

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?

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)
Copy link
Contributor

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?

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