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

[dv] Fix paths in merge_cov.py #2120

Merged
merged 1 commit into from
Jan 11, 2024
Merged

Conversation

superpung
Copy link
Contributor

  1. In metadata.py, class RegressionMetadata has a field named dir_cov, not cov_dir:
    dir_cov : pathlib.Path = field(init=False, compare=False, default_factory=pathlib.Path)

    self.dir_cov = self.dir_run/'coverage'

    But in merge_cov.py, it refers to a field named cov_dir that does not exist in class RegressionMetadata:
    '-dbname', str(md.cov_dir/'merged.vdb'),
    '-report', str(md.cov_dir/'report'),
    '-log', str(md.cov_dir/'merge.log'),

    This results in an AttributeError during dv process:

AttributeError: 'RegressionMetadata' object has no attribute 'cov_dir'


  1. In scripts_lib.py, type of parameter cmd in function run_one is List[str]:
    def run_one(verbose: bool,
    cmd: List[str],

    But in merge_cov.py, it passes a list (list(cov_dirs)) with type List[pathlib3x.pathlib3x.PosixPath] to function run_one as a parameter:
    def merge_cov_vcs(md: RegressionMetadata, cov_dirs: Set[pathlib.Path]) -> int:
    logging.info("Generating merged coverage directory")
    cmd = (['urg', '-full64',
    '-format', 'both',
    '-dbname', str(md.cov_dir/'merged.vdb'),
    '-report', str(md.cov_dir/'report'),
    '-log', str(md.cov_dir/'merge.log'),
    '-dir'] +
    list(cov_dirs))
    return run_one(md.verbose, cmd, redirect_stdstreams='/dev/null')

    This results in a TypeError during dv process:

TypeError: type of argument "cmd"[11] must be str; got pathlib3x.pathlib3x.PosixPath instead

@rswarbrick
Copy link
Contributor

Hi @hcallahan-lowrisc! Would you mind taking a look at this? A quick glance at the code in question makes me think that the proposed fix is right, but I think your name is all over the code in question :-)

@hcallahan-lowrisc
Copy link
Contributor

Ah okay yes this appears to be exercising some code that we don't run here regularly. We use Xcelium for our regressions, so it appears the vcs flow has not been tested.

I'll test this locally and get back to you, but the fix looks reasonable to me.

Copy link
Contributor

@hcallahan-lowrisc hcallahan-lowrisc left a comment

Choose a reason for hiding this comment

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

Great, thanks for the PR!

@hcallahan-lowrisc hcallahan-lowrisc added this pull request to the merge queue Jan 11, 2024
Merged via the queue into lowRISC:master with commit 123d46b Jan 11, 2024
11 checks passed
@superpung superpung deleted the patch-1 branch January 12, 2024 04:47
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