siliconcompiler 0.26.0__cp310-cp310-win_amd64.whl → 0.26.1__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- siliconcompiler/_metadata.py +1 -1
- siliconcompiler/apps/smake.py +192 -0
- siliconcompiler/core.py +43 -0
- siliconcompiler/remote/client.py +14 -106
- siliconcompiler/schema/schema_cfg.py +9 -0
- siliconcompiler/use.py +41 -1
- {siliconcompiler-0.26.0.dist-info → siliconcompiler-0.26.1.dist-info}/METADATA +1 -1
- {siliconcompiler-0.26.0.dist-info → siliconcompiler-0.26.1.dist-info}/RECORD +12 -11
- {siliconcompiler-0.26.0.dist-info → siliconcompiler-0.26.1.dist-info}/entry_points.txt +1 -0
- {siliconcompiler-0.26.0.dist-info → siliconcompiler-0.26.1.dist-info}/LICENSE +0 -0
- {siliconcompiler-0.26.0.dist-info → siliconcompiler-0.26.1.dist-info}/WHEEL +0 -0
- {siliconcompiler-0.26.0.dist-info → siliconcompiler-0.26.1.dist-info}/top_level.txt +0 -0
siliconcompiler/_metadata.py
CHANGED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Copyright 2023 Silicon Compiler Authors. All Rights Reserved.
|
|
2
|
+
import argparse
|
|
3
|
+
import sys
|
|
4
|
+
import os
|
|
5
|
+
import importlib
|
|
6
|
+
from inspect import getmembers, isfunction, getfullargspec
|
|
7
|
+
from siliconcompiler._metadata import version
|
|
8
|
+
from siliconcompiler.schema import utils
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
__default_source_file = "make.py"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def __process_file(path):
|
|
15
|
+
if not os.path.exists(path):
|
|
16
|
+
return {}, None, None
|
|
17
|
+
mod_name = 'scmake'
|
|
18
|
+
spec = importlib.util.spec_from_file_location(mod_name, path)
|
|
19
|
+
make = importlib.util.module_from_spec(spec)
|
|
20
|
+
sys.modules[mod_name] = make
|
|
21
|
+
syspath = sys.path.copy()
|
|
22
|
+
sys.path.insert(0, os.getcwd())
|
|
23
|
+
spec.loader.exec_module(make)
|
|
24
|
+
sys.path = syspath
|
|
25
|
+
|
|
26
|
+
args = {}
|
|
27
|
+
for name, func in getmembers(make, isfunction):
|
|
28
|
+
if name.startswith('_'):
|
|
29
|
+
continue
|
|
30
|
+
|
|
31
|
+
# generate doc
|
|
32
|
+
docstring = utils.trim(func.__doc__)
|
|
33
|
+
if not docstring:
|
|
34
|
+
docstring = f"run \"{name}\""
|
|
35
|
+
short_help = docstring.splitlines()[0]
|
|
36
|
+
|
|
37
|
+
func_spec = getfullargspec(func)
|
|
38
|
+
|
|
39
|
+
func_args = {}
|
|
40
|
+
for arg in func_spec.args:
|
|
41
|
+
arg_type = str
|
|
42
|
+
if arg in func_spec.annotations:
|
|
43
|
+
arg_type = func_spec.annotations[arg]
|
|
44
|
+
func_args[arg] = arg_type
|
|
45
|
+
|
|
46
|
+
args[name] = {
|
|
47
|
+
"function": func,
|
|
48
|
+
"help": short_help,
|
|
49
|
+
"full_help": docstring,
|
|
50
|
+
"args": func_args
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if args:
|
|
54
|
+
default_arg = list(args.keys())[0]
|
|
55
|
+
else:
|
|
56
|
+
default_arg = None
|
|
57
|
+
|
|
58
|
+
default_arg = getattr(make, '__scdefault', default_arg)
|
|
59
|
+
|
|
60
|
+
module_help = utils.trim(make.__doc__)
|
|
61
|
+
|
|
62
|
+
return args, default_arg, module_help
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def main():
|
|
66
|
+
progname = "smake"
|
|
67
|
+
description = f"""-----------------------------------------------------------
|
|
68
|
+
SC app that provides an Makefile like interface to python
|
|
69
|
+
configuration files. This utility app will analyze a file
|
|
70
|
+
"{__default_source_file}" or the file specified with --file to determine
|
|
71
|
+
the available targets.
|
|
72
|
+
|
|
73
|
+
To view the help, use:
|
|
74
|
+
smake --help
|
|
75
|
+
|
|
76
|
+
or view the help for a specific target:
|
|
77
|
+
smake --help <target>
|
|
78
|
+
|
|
79
|
+
To run a target, use:
|
|
80
|
+
smake <target>
|
|
81
|
+
|
|
82
|
+
or run a target from a file other than "{__default_source_file}":
|
|
83
|
+
smake --file <file> <target>
|
|
84
|
+
|
|
85
|
+
or run a target in a different directory:
|
|
86
|
+
smake --directory <directory> <target>
|
|
87
|
+
|
|
88
|
+
To run a target with supported arguments, use:
|
|
89
|
+
smake <target> --flow asicflow
|
|
90
|
+
-----------------------------------------------------------"""
|
|
91
|
+
|
|
92
|
+
# handle source file identification before arg parse
|
|
93
|
+
source_file = __default_source_file
|
|
94
|
+
file_args = ('--file', '-f')
|
|
95
|
+
for file_arg in file_args:
|
|
96
|
+
if file_arg in sys.argv:
|
|
97
|
+
source_file_idx = sys.argv.index(file_arg) + 1
|
|
98
|
+
if source_file_idx < len(sys.argv):
|
|
99
|
+
source_file = sys.argv[source_file_idx]
|
|
100
|
+
else:
|
|
101
|
+
source_file = None
|
|
102
|
+
break
|
|
103
|
+
|
|
104
|
+
# handle directory identification before arg parse
|
|
105
|
+
source_dir = os.getcwd()
|
|
106
|
+
dir_args = ('--directory', '-C')
|
|
107
|
+
for file_arg in dir_args:
|
|
108
|
+
if file_arg in sys.argv:
|
|
109
|
+
source_dir_idx = sys.argv.index(file_arg) + 1
|
|
110
|
+
if source_dir_idx < len(sys.argv):
|
|
111
|
+
source_dir = sys.argv[source_dir_idx]
|
|
112
|
+
else:
|
|
113
|
+
source_dir = None
|
|
114
|
+
break
|
|
115
|
+
|
|
116
|
+
if source_dir:
|
|
117
|
+
if not os.path.isdir(source_dir):
|
|
118
|
+
print(f"Unable to change directory to {source_dir}")
|
|
119
|
+
return 1
|
|
120
|
+
|
|
121
|
+
os.chdir(source_dir)
|
|
122
|
+
|
|
123
|
+
make_args = {}
|
|
124
|
+
default_arg = None
|
|
125
|
+
module_help = None
|
|
126
|
+
if source_file:
|
|
127
|
+
make_args, default_arg, module_help = __process_file(source_file)
|
|
128
|
+
|
|
129
|
+
if module_help:
|
|
130
|
+
description += \
|
|
131
|
+
f"\n\n{module_help}\n\n-----------------------------------------------------------"
|
|
132
|
+
|
|
133
|
+
parser = argparse.ArgumentParser(
|
|
134
|
+
progname,
|
|
135
|
+
description=description,
|
|
136
|
+
formatter_class=argparse.RawDescriptionHelpFormatter)
|
|
137
|
+
|
|
138
|
+
parser.add_argument(
|
|
139
|
+
*file_args,
|
|
140
|
+
metavar='<file>',
|
|
141
|
+
help=f'Use file as makefile, default is {__default_source_file}')
|
|
142
|
+
|
|
143
|
+
parser.add_argument(
|
|
144
|
+
*dir_args,
|
|
145
|
+
metavar='<directory>',
|
|
146
|
+
help='Change to directory <directory> before reading the makefile.')
|
|
147
|
+
|
|
148
|
+
parser.add_argument(
|
|
149
|
+
'--version', '-v',
|
|
150
|
+
action='version',
|
|
151
|
+
version=version)
|
|
152
|
+
|
|
153
|
+
targetparsers = parser.add_subparsers(
|
|
154
|
+
dest='target',
|
|
155
|
+
metavar='<target>',
|
|
156
|
+
help='Target to execute')
|
|
157
|
+
|
|
158
|
+
for arg, info in make_args.items():
|
|
159
|
+
subparse = targetparsers.add_parser(
|
|
160
|
+
arg,
|
|
161
|
+
description=info['full_help'],
|
|
162
|
+
help=info['help'])
|
|
163
|
+
|
|
164
|
+
for subarg, subarg_type in info['args'].items():
|
|
165
|
+
subparse.add_argument(
|
|
166
|
+
f'--{subarg}',
|
|
167
|
+
dest=f'sub_{subarg}',
|
|
168
|
+
metavar=f'<{subarg}>',
|
|
169
|
+
type=subarg_type)
|
|
170
|
+
|
|
171
|
+
args = parser.parse_args()
|
|
172
|
+
target = args.target
|
|
173
|
+
if not target:
|
|
174
|
+
target = default_arg
|
|
175
|
+
|
|
176
|
+
if not os.path.isfile(source_file):
|
|
177
|
+
print(f"Unable to load {source_file}")
|
|
178
|
+
return 1
|
|
179
|
+
|
|
180
|
+
call_args = {}
|
|
181
|
+
args_vars = vars(args)
|
|
182
|
+
for arg in make_args[target]["args"]:
|
|
183
|
+
if f'sub_{arg}' in args_vars and args_vars[f'sub_{arg}'] is not None:
|
|
184
|
+
call_args[arg] = args_vars[f'sub_{arg}']
|
|
185
|
+
make_args[target]["function"](**call_args)
|
|
186
|
+
|
|
187
|
+
return 0
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
#########################
|
|
191
|
+
if __name__ == "__main__":
|
|
192
|
+
sys.exit(main())
|
siliconcompiler/core.py
CHANGED
|
@@ -2054,6 +2054,49 @@ class Chip:
|
|
|
2054
2054
|
except graphviz.ExecutableNotFound as e:
|
|
2055
2055
|
self.logger.error(f'Unable to save flowgraph: {e}')
|
|
2056
2056
|
|
|
2057
|
+
########################################################################
|
|
2058
|
+
def swap_library(self, org_library, new_library, step=None, index=None):
|
|
2059
|
+
'''
|
|
2060
|
+
Recursively changes a library in ['option', 'library'] from a previous
|
|
2061
|
+
value to a new value. If the library is not present then nothing is
|
|
2062
|
+
changed.
|
|
2063
|
+
|
|
2064
|
+
Args:
|
|
2065
|
+
org_library (str): Name of old library
|
|
2066
|
+
new_library (str): Name of new library
|
|
2067
|
+
step(str): Step to change, if not specified, all steps will be modified
|
|
2068
|
+
index (str): Index to change, if not specified, all indexes will be modified
|
|
2069
|
+
|
|
2070
|
+
Examples:
|
|
2071
|
+
>>> chip.swap_library('lambdalib_iolib', 'lambdalib_sky130iolib')
|
|
2072
|
+
Changes from the lambdalib_iolib to lambdalib_sky130iolib.
|
|
2073
|
+
'''
|
|
2074
|
+
all_libraries = self.getkeys('library')
|
|
2075
|
+
|
|
2076
|
+
def swap(*key):
|
|
2077
|
+
if step is not None:
|
|
2078
|
+
r_step = step
|
|
2079
|
+
r_index = index
|
|
2080
|
+
if r_index is None:
|
|
2081
|
+
r_index = Schema.GLOBAL_KEY
|
|
2082
|
+
|
|
2083
|
+
val = self.get(*key, step=r_step, index=r_index)
|
|
2084
|
+
self.set(*key, list(map(lambda x: x.replace(org_library, new_library), val)),
|
|
2085
|
+
step=r_step, index=r_index)
|
|
2086
|
+
else:
|
|
2087
|
+
for val, r_step, r_index in self.schema._getvals(*key):
|
|
2088
|
+
if r_step is None:
|
|
2089
|
+
r_step = Schema.GLOBAL_KEY
|
|
2090
|
+
if r_index is None:
|
|
2091
|
+
r_index = Schema.GLOBAL_KEY
|
|
2092
|
+
|
|
2093
|
+
self.set(*key, list(map(lambda x: x.replace(org_library, new_library), val)),
|
|
2094
|
+
step=r_step, index=r_index)
|
|
2095
|
+
|
|
2096
|
+
swap('option', 'library')
|
|
2097
|
+
for lib in all_libraries:
|
|
2098
|
+
swap('library', lib, 'option', 'library')
|
|
2099
|
+
|
|
2057
2100
|
########################################################################
|
|
2058
2101
|
def collect(self, directory=None, verbose=True, whitelist=None):
|
|
2059
2102
|
'''
|
siliconcompiler/remote/client.py
CHANGED
|
@@ -13,9 +13,7 @@ import multiprocessing
|
|
|
13
13
|
from siliconcompiler import utils, SiliconCompilerError
|
|
14
14
|
from siliconcompiler import NodeStatus as SCNodeStatus
|
|
15
15
|
from siliconcompiler._metadata import default_server
|
|
16
|
-
from siliconcompiler.
|
|
17
|
-
from siliconcompiler.scheduler import _setup_node, _runtask, _executenode, clean_node_dir
|
|
18
|
-
from siliconcompiler.flowgraph import _get_flowgraph_entry_nodes, nodes_to_execute
|
|
16
|
+
from siliconcompiler.flowgraph import nodes_to_execute
|
|
19
17
|
from siliconcompiler.remote import JobStatus
|
|
20
18
|
|
|
21
19
|
# Step name to use while logging
|
|
@@ -59,6 +57,10 @@ def get_base_url(chip):
|
|
|
59
57
|
return remote_protocol + remote_host
|
|
60
58
|
|
|
61
59
|
|
|
60
|
+
def get_remote_manifest(chip):
|
|
61
|
+
return f'{chip.getworkdir()}/sc_remote.pkg.json'
|
|
62
|
+
|
|
63
|
+
|
|
62
64
|
###################################
|
|
63
65
|
def __post(chip, url, post_action, success_action, error_action=None):
|
|
64
66
|
'''
|
|
@@ -128,75 +130,10 @@ def __build_post_params(chip, verbose, job_name=None, job_hash=None):
|
|
|
128
130
|
|
|
129
131
|
|
|
130
132
|
###################################
|
|
131
|
-
def _remote_preprocess(chip
|
|
133
|
+
def _remote_preprocess(chip):
|
|
132
134
|
'''
|
|
133
135
|
Helper method to run a local import stage for remote jobs.
|
|
134
136
|
'''
|
|
135
|
-
preset_step = chip.get('arg', 'step')
|
|
136
|
-
preset_index = chip.get('arg', 'index')
|
|
137
|
-
|
|
138
|
-
# Fetch a list of 'import' steps, and make sure they're all at the start of the flow.
|
|
139
|
-
flow = chip.get('option', 'flow')
|
|
140
|
-
entry_nodes = _get_flowgraph_entry_nodes(chip, flow)
|
|
141
|
-
if any([node not in remote_nodelist for node in entry_nodes]) or (len(remote_nodelist) == 1):
|
|
142
|
-
chip.logger.error('Remote flows must be organized such that the starting task(s) are run '
|
|
143
|
-
'before all other steps, and at least one other task is included.')
|
|
144
|
-
chip.logger.error('Full nodelist: '
|
|
145
|
-
f'{", ".join([f"{step}{index}" for step, index in remote_nodelist])}')
|
|
146
|
-
chip.logger.error('Starting nodes: '
|
|
147
|
-
f'{", ".join([f"{step}{index}" for step, index in entry_nodes])}')
|
|
148
|
-
raise SiliconCompilerError('Remote setup invalid', chip=chip)
|
|
149
|
-
|
|
150
|
-
# Setup up tools for all local functions
|
|
151
|
-
for local_step, index in entry_nodes.copy():
|
|
152
|
-
if not _setup_node(chip, local_step, index):
|
|
153
|
-
entry_nodes.remove((local_step, index))
|
|
154
|
-
|
|
155
|
-
# Setup up tools for all local functions
|
|
156
|
-
for local_step, index in entry_nodes:
|
|
157
|
-
# Need to set step/index to only run this node locally
|
|
158
|
-
chip.set('arg', 'step', local_step)
|
|
159
|
-
chip.set('arg', 'index', index)
|
|
160
|
-
|
|
161
|
-
if chip.get('option', 'clean') or \
|
|
162
|
-
chip.get('record', 'status', step=local_step, index=index) != SCNodeStatus.SUCCESS:
|
|
163
|
-
# Run the actual import step locally with multiprocess as _runtask must
|
|
164
|
-
# be run in a separate thread.
|
|
165
|
-
# We can pass in an empty 'status' dictionary, since _runtask() will
|
|
166
|
-
# only look up a step's dependencies in this dictionary, and the first
|
|
167
|
-
# step should have none.
|
|
168
|
-
clean_node_dir(chip, local_step, index)
|
|
169
|
-
|
|
170
|
-
run_task = multiprocessor.Process(target=_runtask,
|
|
171
|
-
args=(chip,
|
|
172
|
-
flow,
|
|
173
|
-
local_step,
|
|
174
|
-
index,
|
|
175
|
-
_executenode))
|
|
176
|
-
run_task.start()
|
|
177
|
-
run_task.join()
|
|
178
|
-
ftask = f'{local_step}{index}'
|
|
179
|
-
if run_task.exitcode != 0:
|
|
180
|
-
# A 'None' or nonzero value indicates that the Process target failed.
|
|
181
|
-
raise SiliconCompilerError(
|
|
182
|
-
f"Could not start remote job: local setup task {ftask} failed.",
|
|
183
|
-
chip=chip)
|
|
184
|
-
manifest = os.path.join(chip.getworkdir(step=local_step, index=index),
|
|
185
|
-
'outputs',
|
|
186
|
-
f'{chip.design}.pkg.json')
|
|
187
|
-
if os.path.exists(manifest):
|
|
188
|
-
chip.schema.read_journal(manifest)
|
|
189
|
-
else:
|
|
190
|
-
raise SiliconCompilerError(
|
|
191
|
-
f"Output manifest is missing from {ftask}.",
|
|
192
|
-
chip=chip)
|
|
193
|
-
|
|
194
|
-
# Read in manifest
|
|
195
|
-
manifest = os.path.join(chip.getworkdir(step=local_step, index=index),
|
|
196
|
-
'outputs',
|
|
197
|
-
f'{chip.design}.pkg.json')
|
|
198
|
-
if os.path.exists(manifest):
|
|
199
|
-
chip.schema.read_journal(manifest)
|
|
200
137
|
|
|
201
138
|
# Ensure packages with python sources are copied
|
|
202
139
|
for key in chip.allkeys():
|
|
@@ -219,10 +156,6 @@ def _remote_preprocess(chip, remote_nodelist):
|
|
|
219
156
|
cfg = get_remote_config(chip, False)
|
|
220
157
|
chip.collect(whitelist=cfg.setdefault('directory_whitelist', []))
|
|
221
158
|
|
|
222
|
-
# Recover step/index
|
|
223
|
-
chip.set('arg', 'step', preset_step)
|
|
224
|
-
chip.set('arg', 'index', preset_index)
|
|
225
|
-
|
|
226
159
|
|
|
227
160
|
###################################
|
|
228
161
|
def _log_truncated_stats(chip, status, nodes_with_status, nodes_to_print):
|
|
@@ -366,7 +299,7 @@ def remote_process(chip):
|
|
|
366
299
|
raise SiliconCompilerError('Cannot pass [arg,index] parameter into remote flow.', chip=chip)
|
|
367
300
|
# Only run the pre-process step if the job doesn't already have a remote ID.
|
|
368
301
|
if not remote_resume:
|
|
369
|
-
_remote_preprocess(chip
|
|
302
|
+
_remote_preprocess(chip)
|
|
370
303
|
|
|
371
304
|
# Run the job on the remote server, and wait for it to finish.
|
|
372
305
|
# Set logger to indicate remote run
|
|
@@ -410,13 +343,9 @@ def remote_run_loop(chip, check_interval):
|
|
|
410
343
|
try:
|
|
411
344
|
__remote_run_loop(chip, check_interval)
|
|
412
345
|
except KeyboardInterrupt:
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
'outputs',
|
|
417
|
-
f'{chip.design}.pkg.json')
|
|
418
|
-
reconnect_cmd = f'sc-remote -cfg {entry_manifest} -reconnect'
|
|
419
|
-
cancel_cmd = f'sc-remote -cfg {entry_manifest} -cancel'
|
|
346
|
+
manifest_path = get_remote_manifest(chip)
|
|
347
|
+
reconnect_cmd = f'sc-remote -cfg {manifest_path} -reconnect'
|
|
348
|
+
cancel_cmd = f'sc-remote -cfg {manifest_path} -cancel'
|
|
420
349
|
chip.logger.info('Disconnecting from remote job')
|
|
421
350
|
chip.logger.info(f'To reconnect to this job use: {reconnect_cmd}')
|
|
422
351
|
chip.logger.info(f'To cancel this job use: {cancel_cmd}')
|
|
@@ -500,30 +429,6 @@ def check_progress(chip):
|
|
|
500
429
|
return [], True
|
|
501
430
|
|
|
502
431
|
|
|
503
|
-
###################################
|
|
504
|
-
def _update_entry_manifests(chip):
|
|
505
|
-
'''
|
|
506
|
-
Helper method to update locally-run manifests to include remote job ID.
|
|
507
|
-
'''
|
|
508
|
-
|
|
509
|
-
flow = chip.get('option', 'flow')
|
|
510
|
-
jobid = chip.get('record', 'remoteid')
|
|
511
|
-
design = chip.get('design')
|
|
512
|
-
|
|
513
|
-
entry_nodes = _get_flowgraph_entry_nodes(chip, flow)
|
|
514
|
-
for step, index in entry_nodes:
|
|
515
|
-
manifest_path = os.path.join(chip.getworkdir(step=step, index=index),
|
|
516
|
-
'outputs',
|
|
517
|
-
f'{design}.pkg.json')
|
|
518
|
-
|
|
519
|
-
if not os.path.exists(manifest_path):
|
|
520
|
-
continue
|
|
521
|
-
tmp_schema = Schema(manifest=manifest_path)
|
|
522
|
-
tmp_schema.set('record', 'remoteid', jobid)
|
|
523
|
-
with open(manifest_path, 'w') as new_manifest:
|
|
524
|
-
tmp_schema.write_json(new_manifest)
|
|
525
|
-
|
|
526
|
-
|
|
527
432
|
###################################
|
|
528
433
|
def _request_remote_run(chip):
|
|
529
434
|
'''
|
|
@@ -580,7 +485,10 @@ def _request_remote_run(chip):
|
|
|
580
485
|
if 'message' in resp and resp['message']:
|
|
581
486
|
chip.logger.info(resp['message'])
|
|
582
487
|
chip.set('record', 'remoteid', resp['job_hash'])
|
|
583
|
-
|
|
488
|
+
|
|
489
|
+
manifest = get_remote_manifest(chip)
|
|
490
|
+
chip.write_manifest(manifest)
|
|
491
|
+
|
|
584
492
|
chip.logger.info(f"Your job's reference ID is: {resp['job_hash']}")
|
|
585
493
|
|
|
586
494
|
return remote_status['progress_interval']
|
|
@@ -1737,6 +1737,7 @@ def schema_task(cfg, tool='default', task='default', step='default', index='defa
|
|
|
1737
1737
|
scparam(cfg, ['tool', tool, 'task', task, 'file', key],
|
|
1738
1738
|
sctype='[file]',
|
|
1739
1739
|
pernode='optional',
|
|
1740
|
+
copy=True,
|
|
1740
1741
|
shorthelp="Task: setup files",
|
|
1741
1742
|
switch="-tool_task_file 'tool task key <file>'",
|
|
1742
1743
|
example=[
|
|
@@ -1752,6 +1753,7 @@ def schema_task(cfg, tool='default', task='default', step='default', index='defa
|
|
|
1752
1753
|
scparam(cfg, ['tool', tool, 'task', task, 'dir', key],
|
|
1753
1754
|
sctype='[dir]',
|
|
1754
1755
|
pernode='optional',
|
|
1756
|
+
copy=True,
|
|
1755
1757
|
shorthelp="Task: setup directories",
|
|
1756
1758
|
switch="-tool_task_dir 'tool task key <dir>'",
|
|
1757
1759
|
example=[
|
|
@@ -1912,6 +1914,7 @@ def schema_task(cfg, tool='default', task='default', step='default', index='defa
|
|
|
1912
1914
|
scparam(cfg, ['tool', tool, 'task', task, 'prescript'],
|
|
1913
1915
|
sctype='[file]',
|
|
1914
1916
|
pernode='optional',
|
|
1917
|
+
copy=True,
|
|
1915
1918
|
shorthelp="Task: pre-step script",
|
|
1916
1919
|
switch="-tool_task_prescript 'tool task <file>'",
|
|
1917
1920
|
example=[
|
|
@@ -1927,6 +1930,7 @@ def schema_task(cfg, tool='default', task='default', step='default', index='defa
|
|
|
1927
1930
|
scparam(cfg, ['tool', tool, 'task', task, 'postscript'],
|
|
1928
1931
|
sctype='[file]',
|
|
1929
1932
|
pernode='optional',
|
|
1933
|
+
copy=True,
|
|
1930
1934
|
shorthelp="Task: post-step script",
|
|
1931
1935
|
switch="-tool_task_postscript 'tool task <file>'",
|
|
1932
1936
|
example=[
|
|
@@ -2640,6 +2644,7 @@ def schema_option(cfg):
|
|
|
2640
2644
|
scparam(cfg, ['option', 'file', key],
|
|
2641
2645
|
sctype='[file]',
|
|
2642
2646
|
scope='job',
|
|
2647
|
+
copy=True,
|
|
2643
2648
|
shorthelp="Custom files",
|
|
2644
2649
|
switch="-file 'key <file>'",
|
|
2645
2650
|
example=[
|
|
@@ -2654,6 +2659,7 @@ def schema_option(cfg):
|
|
|
2654
2659
|
scparam(cfg, ['option', 'dir', key],
|
|
2655
2660
|
sctype='[dir]',
|
|
2656
2661
|
scope='job',
|
|
2662
|
+
copy=True,
|
|
2657
2663
|
shorthelp="Custom directories",
|
|
2658
2664
|
switch="-dir 'key <dir>'",
|
|
2659
2665
|
example=[
|
|
@@ -2876,6 +2882,7 @@ def schema_option(cfg):
|
|
|
2876
2882
|
scparam(cfg, ['option', 'idir'],
|
|
2877
2883
|
sctype='[dir]',
|
|
2878
2884
|
shorthelp="Design search paths",
|
|
2885
|
+
copy=True,
|
|
2879
2886
|
switch=['+incdir+<dir>',
|
|
2880
2887
|
'-I <dir>',
|
|
2881
2888
|
'-idir <dir>'],
|
|
@@ -2891,6 +2898,7 @@ def schema_option(cfg):
|
|
|
2891
2898
|
scparam(cfg, ['option', 'ydir'],
|
|
2892
2899
|
sctype='[dir]',
|
|
2893
2900
|
shorthelp="Design module search paths",
|
|
2901
|
+
copy=True,
|
|
2894
2902
|
switch=['-y <dir>',
|
|
2895
2903
|
'-ydir <dir>'],
|
|
2896
2904
|
example=[
|
|
@@ -2905,6 +2913,7 @@ def schema_option(cfg):
|
|
|
2905
2913
|
scparam(cfg, ['option', 'vlib'],
|
|
2906
2914
|
sctype='[file]',
|
|
2907
2915
|
shorthelp="Design libraries",
|
|
2916
|
+
copy=True,
|
|
2908
2917
|
switch=['-v <file>',
|
|
2909
2918
|
'-vlib <file>'],
|
|
2910
2919
|
example=["cli: -v './mylib.v'",
|
siliconcompiler/use.py
CHANGED
|
@@ -5,10 +5,50 @@ from siliconcompiler import Chip
|
|
|
5
5
|
|
|
6
6
|
class PackageChip(Chip):
|
|
7
7
|
def __init__(self, chip, name, package=None):
|
|
8
|
-
|
|
8
|
+
# Start with None as init setting will not depend on package
|
|
9
|
+
self.__package = None
|
|
10
|
+
|
|
9
11
|
super().__init__(name)
|
|
10
12
|
self.logger = chip.logger
|
|
11
13
|
|
|
14
|
+
path = None
|
|
15
|
+
ref = None
|
|
16
|
+
if isinstance(package, (tuple, list)):
|
|
17
|
+
if len(package) == 3:
|
|
18
|
+
package, path, ref = package
|
|
19
|
+
elif len(package) == 2:
|
|
20
|
+
package, path = package
|
|
21
|
+
else:
|
|
22
|
+
raise ValueError(f"{package} should be a 2 or 3 item tuple or list.")
|
|
23
|
+
elif isinstance(package, dict):
|
|
24
|
+
if len(package) == 1:
|
|
25
|
+
info = list(package.values())[0]
|
|
26
|
+
if "path" not in info:
|
|
27
|
+
raise ValueError(f"{package} should contain a path key.")
|
|
28
|
+
path = info["path"]
|
|
29
|
+
if "ref" in info:
|
|
30
|
+
ref = info["ref"]
|
|
31
|
+
|
|
32
|
+
package = list(package.keys())[0]
|
|
33
|
+
else:
|
|
34
|
+
raise ValueError(f"{package} cannot contain multiple packages.")
|
|
35
|
+
elif isinstance(package, str):
|
|
36
|
+
pass
|
|
37
|
+
else:
|
|
38
|
+
if package is not None:
|
|
39
|
+
raise ValueError(f"{package} is not supported.")
|
|
40
|
+
|
|
41
|
+
if path:
|
|
42
|
+
self.register_source(package, path, ref=ref)
|
|
43
|
+
|
|
44
|
+
self.__package = package
|
|
45
|
+
|
|
46
|
+
# Clear all copy flags since these are libraries, pdks, fpga, etc.
|
|
47
|
+
for key in self.allkeys():
|
|
48
|
+
sc_type = self.get(*key, field='type')
|
|
49
|
+
if 'file' in sc_type or 'dir' in sc_type:
|
|
50
|
+
self.set(*key, False, field='copy')
|
|
51
|
+
|
|
12
52
|
def add(self, *args, field='value', step=None, index=None, package=None):
|
|
13
53
|
if not package:
|
|
14
54
|
package = self.__package
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
siliconcompiler/__init__.py,sha256=5T-mWDc05v0FEdwg2btphrAb_W7XaXUmKrRSxuSMNUQ,535
|
|
2
2
|
siliconcompiler/__main__.py,sha256=x5bzv4spw66iQOldUM-iCWw2j5NxXkkkC_Wd2hGAAgo,182
|
|
3
3
|
siliconcompiler/_common.py,sha256=27VU0PqZkD6-qz20brjzj-Z8cpDt0oyE6ZA6wARZvrk,1283
|
|
4
|
-
siliconcompiler/_metadata.py,sha256=
|
|
5
|
-
siliconcompiler/core.py,sha256=
|
|
4
|
+
siliconcompiler/_metadata.py,sha256=h8nOD2KxE0kNl0PmgJiDQa4HLE-2KvdUA7wFxYe9WvU,1300
|
|
5
|
+
siliconcompiler/core.py,sha256=ztyuat3kodYLhNszqSmhDPcKwDX4viLXrApjrkwV2dc,128350
|
|
6
6
|
siliconcompiler/flowgraph.py,sha256=aQh0VO7LVwGNJbWZcBIgzGRv_pDH72_ilMQtK906Rqk,22502
|
|
7
7
|
siliconcompiler/issue.py,sha256=jrQnDKY9G-k-KF61XkhPyLSDmOSBoWA2GHRxB4auKNA,11223
|
|
8
8
|
siliconcompiler/package.py,sha256=Z2FqMRq8mtvmF6d_hyDOZN8DOZ8gu7zABDMWOfUGu-M,14463
|
|
9
9
|
siliconcompiler/units.py,sha256=dYn185TzusMtBd69RFKhNlCky2td5jC__AJdPjqXELU,6069
|
|
10
|
-
siliconcompiler/use.py,sha256=
|
|
10
|
+
siliconcompiler/use.py,sha256=InIDvKtlr3iwo8w3hVxzATjTyN8JQGzelZbs5tioMqo,5630
|
|
11
11
|
siliconcompiler/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
siliconcompiler/apps/_common.py,sha256=368PjPwz0yw4baJOXPOhkgVq0uP_G77j5C6ei_eIaPs,2565
|
|
13
13
|
siliconcompiler/apps/sc.py,sha256=2LT0rvky_3SRpsvbmZ68asAvGdagIIEW7fwMoCqVpUE,2876
|
|
@@ -16,6 +16,7 @@ siliconcompiler/apps/sc_issue.py,sha256=BJSj9kgwvtJQCsudjiuHfPguLpZR1QAuQRTyxfEA
|
|
|
16
16
|
siliconcompiler/apps/sc_remote.py,sha256=9m6g79STJG784NqzMHyxoPzexZ7ihZaYxxxLlg7cnQk,7522
|
|
17
17
|
siliconcompiler/apps/sc_server.py,sha256=aeW9wldn_qO6yyv9j5drx2wv0KMk8f6s9XSZgPCerhY,933
|
|
18
18
|
siliconcompiler/apps/sc_show.py,sha256=ykP-yUOViD64DRb2jR-E-v4cI6OOCw57XdWYLze-yBM,4702
|
|
19
|
+
siliconcompiler/apps/smake.py,sha256=uN8COdCcvlpRp-TBA2oqC5t4-ISg7YB5XWOBXC_r6Vw,5663
|
|
19
20
|
siliconcompiler/checklists/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
21
|
siliconcompiler/checklists/oh_tapeout.py,sha256=ZJsCktTZ9uX94IQEWwxt9gBKGeXXsWQKXg0rM9fpKc0,1492
|
|
21
22
|
siliconcompiler/data/heartbeat.v,sha256=1hOB1OhZOEF7f8WKTzOYgYtkdVL6yNI4Ou4fmVuApPU,438
|
|
@@ -49,7 +50,7 @@ siliconcompiler/pdks/freepdk45.py,sha256=fl8iQQBf90qGkzBvTwxasiGR55wQwYJjTs5ht9d
|
|
|
49
50
|
siliconcompiler/pdks/gf180.py,sha256=_CvEiHsd8VNHasH_SHdwJiSsO56o7pB6aLWm92U_WVY,211
|
|
50
51
|
siliconcompiler/pdks/skywater130.py,sha256=ml5bGW6h7-aaYprmBPy4pjj4sfT0Qi2hVTcdwTy-OkY,212
|
|
51
52
|
siliconcompiler/remote/__init__.py,sha256=RFKWKDF1qK928_-8-1nmANyGwkmgUJYh39CLj_HshUc,846
|
|
52
|
-
siliconcompiler/remote/client.py,sha256=
|
|
53
|
+
siliconcompiler/remote/client.py,sha256=S9hmFI2qoAdvjMqBRN8EJ_4GAO0bkYZRoP670Q5ZG8g,31811
|
|
53
54
|
siliconcompiler/remote/schema.py,sha256=kK1C6nvbpRrOJu61qnZKGxrar2LXg8G9JNBFTxQmWow,3941
|
|
54
55
|
siliconcompiler/remote/server.py,sha256=2jw0DJISpgnhxKlMaGYBuC6YnCuaJLmGRZJAanTGQ5A,20013
|
|
55
56
|
siliconcompiler/remote/server_schema/requests/cancel_job.json,sha256=D6obnSDKrf8wEmc1unX_SliR6lzLn8rvYJoiAtCJPGo,1521
|
|
@@ -79,7 +80,7 @@ siliconcompiler/scheduler/send_messages.py,sha256=ZVO6923-EJWUMlDOOpLEhaSrsKtP-d
|
|
|
79
80
|
siliconcompiler/scheduler/slurm.py,sha256=IaglZSvrHOqEDT46ZcJ19gXpJxiMm7AAO7EvVdrauZc,7305
|
|
80
81
|
siliconcompiler/scheduler/validation/email_credentials.json,sha256=rJHUmTS0YyQVCeZpJI1D4WgxsXRHigZTJ6xToITziuo,1800
|
|
81
82
|
siliconcompiler/schema/__init__.py,sha256=5MfwK7me_exH7qjcInSUSesM0kiGIx8FXQDj4Br2QAQ,127
|
|
82
|
-
siliconcompiler/schema/schema_cfg.py,sha256=
|
|
83
|
+
siliconcompiler/schema/schema_cfg.py,sha256=LfvboErSQngjN-6RPJjAizcojmwMtou7NLaeHgIXQ40,183093
|
|
83
84
|
siliconcompiler/schema/schema_obj.py,sha256=R3rrGNgoyNakMmQ2HDW9XJwfar3WMKVyqWrClr38jR8,74403
|
|
84
85
|
siliconcompiler/schema/utils.py,sha256=KKWtwOkXcDjaxs2f4yIuE6JCFZaapGjdLG4dQLYmH08,4111
|
|
85
86
|
siliconcompiler/sphinx_ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -243,9 +244,9 @@ siliconcompiler/tools/yosys/templates/abc.const,sha256=2Ea7eZz2eHzar3RLf_l2Nb9dn
|
|
|
243
244
|
siliconcompiler/utils/__init__.py,sha256=b3mhPeBb8HIqU-8w23h2IMLSxuDrXm53e5iSeqZrkDI,13168
|
|
244
245
|
siliconcompiler/utils/asic.py,sha256=knq-raDWs1FKtfqkUbLOecdSwXezlmqb8gk9QPZWdqY,5144
|
|
245
246
|
siliconcompiler/utils/showtools.py,sha256=kNaw97U6tV_MwLvWb1dme_k9E6dQVqnTT6y2zzMcXJk,1158
|
|
246
|
-
siliconcompiler-0.26.
|
|
247
|
-
siliconcompiler-0.26.
|
|
248
|
-
siliconcompiler-0.26.
|
|
249
|
-
siliconcompiler-0.26.
|
|
250
|
-
siliconcompiler-0.26.
|
|
251
|
-
siliconcompiler-0.26.
|
|
247
|
+
siliconcompiler-0.26.1.dist-info/LICENSE,sha256=UJh7mqgsPZN3gg37jhwYnrtCUs1m19vkIA6Px7jAOPY,10956
|
|
248
|
+
siliconcompiler-0.26.1.dist-info/METADATA,sha256=VaHaMcQ8HWCLl0IiJuz7EuqEtyR36XtkvuxLBTNgcD0,9663
|
|
249
|
+
siliconcompiler-0.26.1.dist-info/WHEEL,sha256=fsW6--WFfuzX2scefE6JfcSZ5dXg5h59u8lqlpL5uuo,101
|
|
250
|
+
siliconcompiler-0.26.1.dist-info/entry_points.txt,sha256=M3cpZxvqanXhVU9CuLTRDzBdDKmKz-t0p4DT57TyysU,451
|
|
251
|
+
siliconcompiler-0.26.1.dist-info/top_level.txt,sha256=H8TOYhnEUZAV1RJTa8JRtjLIebwHzkQUhA2wkNU2O6M,16
|
|
252
|
+
siliconcompiler-0.26.1.dist-info/RECORD,,
|
|
@@ -6,6 +6,7 @@ sc-remote = siliconcompiler.apps.sc_remote:main
|
|
|
6
6
|
sc-server = siliconcompiler.apps.sc_server:main
|
|
7
7
|
sc-show = siliconcompiler.apps.sc_show:main
|
|
8
8
|
siliconcompiler = siliconcompiler.apps.sc:main
|
|
9
|
+
smake = siliconcompiler.apps.smake:main
|
|
9
10
|
|
|
10
11
|
[siliconcompiler.show]
|
|
11
12
|
scsetup = siliconcompiler.utils.showtools:setup
|
|
File without changes
|
|
File without changes
|
|
File without changes
|