Skip to content

Commit 3bb06fc

Browse files
machshevhcallahan-lowrisc
authored andcommitted
refactor: make cov_db_dirs deterministic
Sort the coverage database paths, while leaving the first path in place. This should mean that the dumped deployment objects are now deterministic. At the moment when comparing dumps often the only difference is the order of these paths, adding unnecessary noise and making it more difficult to check for meaningful differences. Signed-off-by: James McCorrie <[email protected]>
1 parent 92e4e9a commit 3bb06fc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/dvsim/job/deploy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,10 @@ def __init__(self, run_items, sim_cfg) -> None:
711711
else:
712712
self.cov_db_dirs.append(run.cov_db_dir)
713713

714+
# Sort the cov_db_dir except for the first directory
715+
if len(self.cov_db_dirs) > 1:
716+
self.cov_db_dirs = [self.cov_db_dirs[0], *sorted(self.cov_db_dirs[1:])]
717+
714718
# Early lookup the cov_merge_db_dir, which is a mandatory misc
715719
# attribute anyway. We need it to compute additional cov db dirs.
716720
self.cov_merge_db_dir = subst_wildcards("{cov_merge_db_dir}", sim_cfg.__dict__)

0 commit comments

Comments
 (0)