Some more fixup for sc-show and make it testable
Set return code based on chip.show() call status
Don't use None for chip.get('cfg') check, since it'll be an empty list
if unset
Finish implementing -design mode
Fix examples
@@ -15,10 +15,10 @@ def main():
Examples:
sc-show -design adder
- (displays build/adder/export/0/outputs/adder.gds)
+ (displays build/job0/adder/export/0/outputs/adder.gds)
- sc-show build/adder/route/1/outputs/adder.def
- (displays build/adder/route/1/outputs/adder.def)
+ sc-show -asic_def build/job0/adder/route/1/outputs/adder.def
+ (displays build/job0/adder/route/1/outputs/adder.def)
"""
@@ -33,7 +33,7 @@ def main():
if (def_mode + gds_mode) > 1:
print(progname+": error: gds, def options are mutually exclusive")
- sys.exit()
+ sys.exit(1)
if gds_mode:
filename = chip.get('asic', 'gds')[-1]
@@ -51,9 +51,12 @@ def main():
design + '.pkg.json']
manifest = os.path.join(*dirlist)
chip.read_manifest(manifest)
- filename = None
+ filename = chip.find_result('gds', step='export')
+ if filename is None:
+ chip.logger.error('No final GDS export found for design')
+ sys.exit(1)
- if chip.get('cfg') is None:
+ if not chip.get('cfg'):
# only autoload manifest if user doesn't supply manually
design = os.path.splitext(os.path.basename(filename))[0]
dirname = os.path.dirname(filename)
@@ -62,7 +65,9 @@ def main():
# Read in file
chip.logger.info("Displaying filename")
- chip.show(filename)
+ success = chip.show(filename)
+
+ return 0 if success else 1
#########################
if __name__ == "__main__":
