diff --git a/scgallery/designs/zerosoc/run_hierarchy.py b/scgallery/designs/zerosoc/run_hierarchy.py index 4c1c905..4dfb62f 100644 --- a/scgallery/designs/zerosoc/run_hierarchy.py +++ b/scgallery/designs/zerosoc/run_hierarchy.py @@ -5,6 +5,6 @@ def runtime_setup(gallery): build = init_zerosoc() core_chip = build.build_core(remote=False, verify=False, - resume=gallery.is_resume, + resume=not gallery.is_clean, floorplan=False) return build.setup_top_hier(core_chip) diff --git a/scgallery/gallery.py b/scgallery/gallery.py index 854bd98..e1353ed 100755 --- a/scgallery/gallery.py +++ b/scgallery/gallery.py @@ -62,7 +62,7 @@ def __init__(self, name=None, path=None): self.__report_chips = {} self.__jobname = None - self.set_resume(False) + self.set_clean(False) self.set_remote(None) self.set_strict(True) self.set_rules_to_skip(None) @@ -255,28 +255,28 @@ def is_remote(self): return False ####################################################### - def set_resume(self, resume): + def set_clean(self, clean): ''' - Set if the gallery should resume a previous run. + Set if the gallery should clean a previous run. Parameters: - resume (boolean): Flag to indicate if resume should be used + clean (boolean): Flag to indicate if clean should be used ''' - if resume: - resume = True + if clean: + clean = True else: - resume = False - self.__resume = resume + clean = False + self.__clean = clean @property - def is_resume(self): + def is_clean(self): ''' - Determine if the gallery is set to resume a previous run + Determine if the gallery is set to clean a previous run Returns: boolean: True, if resuming, False if not ''' - return self.__resume + return self.__clean ####################################################### def set_strict(self, strict): @@ -305,10 +305,10 @@ def is_strict(self): ################################################### def set_rules_to_skip(self, rules): ''' - Set if the gallery should resume a previous run. + Set rules to skip during checks Parameters: - rules (list): Flag to indicate if resume should be used + rules (list): List of glob rules ''' if not rules: rules = [] @@ -485,7 +485,7 @@ def __run_design(self, design): chip.set('option', 'quiet', True) chip.set('option', 'strict', self.is_strict) - chip.set('option', 'clean', not self.is_resume) + chip.set('option', 'clean', self.is_clean) if self.is_remote: chip.set('option', 'credentials', self.__remote) @@ -815,9 +815,9 @@ def format_list(items, prefix_len, max_len=80): help='Perform a remote run, ' 'optionally provides path to remote credentials') - parser.add_argument('-resume', + parser.add_argument('-clean', action='store_true', - help='Use option,resume') + help='Use option,clean') parser.add_argument('-gallery', metavar='', @@ -837,7 +837,7 @@ def format_list(items, prefix_len, max_len=80): args = parser.parse_args() gallery.set_path(args.path) - gallery.set_resume(args.resume) + gallery.set_clean(args.clean) gallery.set_remote(args.remote) if args.target: diff --git a/scripts/generate_image_cache.py b/scripts/generate_image_cache.py index 97c84ae..e99d218 100755 --- a/scripts/generate_image_cache.py +++ b/scripts/generate_image_cache.py @@ -32,7 +32,7 @@ def print_github(print_size): print(f"Total jobs on github: {len(github_jobs)}") -def run_cache(resume, dry_run): +def run_cache(clean, dry_run): from scgallery import Gallery cached_jobs = [job for job in all_jobs if "cache" in job and job["cache"]] @@ -41,7 +41,7 @@ def run_cache(resume, dry_run): gal = Gallery() gal.set_run_designs([job['design']]) gal.set_run_targets([job['target']]) - gal.set_resume(resume) + gal.set_clean(clean) print(f"{job['design']} - {job['target']}") if not dry_run: @@ -84,5 +84,5 @@ def run_cache(resume, dry_run): sys.exit(0) if args.generate_cache: - run_cache(not args.dont_resume, args.dry_run) + run_cache(args.dont_resume, args.dry_run) sys.exit(0) diff --git a/tests/test_gallery.py b/tests/test_gallery.py index 9acf694..340d0de 100644 --- a/tests/test_gallery.py +++ b/tests/test_gallery.py @@ -170,14 +170,14 @@ def test_set_remote_invalid_file(): gallery.set_remote("file not found") -def test_set_unset_resume(): +def test_set_unset_clean(): gallery = Gallery() - assert not gallery.is_resume - gallery.set_resume(True) - assert gallery.is_resume - gallery.set_resume(False) - assert not gallery.is_resume + assert not gallery.is_clean + gallery.set_clean(True) + assert gallery.is_clean + gallery.set_clean(False) + assert not gallery.is_clean def test_set_unset_strict():