siliconcompiler 0.33.2__py3-none-any.whl → 0.34.0__py3-none-any.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.
Files changed (49) hide show
  1. siliconcompiler/__init__.py +2 -0
  2. siliconcompiler/_metadata.py +1 -1
  3. siliconcompiler/apps/sc_issue.py +5 -3
  4. siliconcompiler/apps/sc_remote.py +0 -17
  5. siliconcompiler/checklist.py +1 -1
  6. siliconcompiler/core.py +34 -47
  7. siliconcompiler/dependencyschema.py +392 -0
  8. siliconcompiler/design.py +664 -0
  9. siliconcompiler/flowgraph.py +32 -1
  10. siliconcompiler/package/__init__.py +383 -223
  11. siliconcompiler/package/git.py +75 -77
  12. siliconcompiler/package/github.py +70 -97
  13. siliconcompiler/package/https.py +77 -93
  14. siliconcompiler/packageschema.py +260 -0
  15. siliconcompiler/pdk.py +2 -2
  16. siliconcompiler/remote/client.py +15 -3
  17. siliconcompiler/report/dashboard/cli/board.py +1 -1
  18. siliconcompiler/scheduler/__init__.py +3 -1382
  19. siliconcompiler/scheduler/docker.py +268 -0
  20. siliconcompiler/scheduler/run_node.py +10 -16
  21. siliconcompiler/scheduler/scheduler.py +308 -0
  22. siliconcompiler/scheduler/schedulernode.py +934 -0
  23. siliconcompiler/scheduler/slurm.py +147 -163
  24. siliconcompiler/scheduler/taskscheduler.py +39 -52
  25. siliconcompiler/schema/__init__.py +3 -3
  26. siliconcompiler/schema/baseschema.py +234 -10
  27. siliconcompiler/schema/editableschema.py +4 -0
  28. siliconcompiler/schema/journal.py +210 -0
  29. siliconcompiler/schema/namedschema.py +31 -2
  30. siliconcompiler/schema/parameter.py +14 -1
  31. siliconcompiler/schema/parametervalue.py +1 -34
  32. siliconcompiler/schema/schema_cfg.py +210 -349
  33. siliconcompiler/tool.py +61 -20
  34. siliconcompiler/tools/builtin/concatenate.py +2 -2
  35. siliconcompiler/tools/builtin/verify.py +1 -2
  36. siliconcompiler/tools/openroad/scripts/common/procs.tcl +27 -25
  37. siliconcompiler/tools/vpr/route.py +69 -0
  38. siliconcompiler/toolscripts/_tools.json +4 -4
  39. siliconcompiler/utils/__init__.py +2 -23
  40. siliconcompiler/utils/flowgraph.py +5 -5
  41. siliconcompiler/utils/logging.py +2 -1
  42. {siliconcompiler-0.33.2.dist-info → siliconcompiler-0.34.0.dist-info}/METADATA +4 -3
  43. {siliconcompiler-0.33.2.dist-info → siliconcompiler-0.34.0.dist-info}/RECORD +47 -42
  44. siliconcompiler/scheduler/docker_runner.py +0 -254
  45. siliconcompiler/schema/journalingschema.py +0 -242
  46. {siliconcompiler-0.33.2.dist-info → siliconcompiler-0.34.0.dist-info}/WHEEL +0 -0
  47. {siliconcompiler-0.33.2.dist-info → siliconcompiler-0.34.0.dist-info}/entry_points.txt +0 -0
  48. {siliconcompiler-0.33.2.dist-info → siliconcompiler-0.34.0.dist-info}/licenses/LICENSE +0 -0
  49. {siliconcompiler-0.33.2.dist-info → siliconcompiler-0.34.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,260 @@
1
+ import os
2
+
3
+ import os.path
4
+
5
+ from siliconcompiler.schema import BaseSchema
6
+ from siliconcompiler.schema import EditableSchema, Parameter, Scope
7
+ from siliconcompiler.schema.utils import trim
8
+ from siliconcompiler.package import Resolver
9
+
10
+
11
+ class PackageSchema(BaseSchema):
12
+ def __init__(self):
13
+ super().__init__()
14
+
15
+ schema_package(self)
16
+
17
+ self.__cache = {}
18
+
19
+ def register(self, name, path, ref=None, clobber=True):
20
+ """
21
+ Registers a package by its name with the source path and reference
22
+
23
+ Registered package sources are stored in the package section of the schema.
24
+
25
+ Args:
26
+ name (str): Package name
27
+ path (str): Path to the sources, can be file, git url, archive url
28
+ ref (str): Reference of the sources, can be commitid, branch name, tag
29
+ clobber (bool): Overwrite existing
30
+
31
+ Examples:
32
+ >>> schema.register('siliconcompiler_data',
33
+ 'git+https://github.com/siliconcompiler/siliconcompiler',
34
+ 'cd328131bafd361787f9137a6ffed999d64c8c30')
35
+ """
36
+
37
+ # If this is a file, get the directory for this
38
+ if os.path.isfile(path):
39
+ path = os.path.dirname(os.path.abspath(path))
40
+ elif os.path.isdir(path):
41
+ path = os.path.abspath(path)
42
+
43
+ success = False
44
+ if self.set('source', name, 'path', path, clobber=clobber):
45
+ success = True
46
+ if success and ref:
47
+ success = False
48
+ if self.set('source', name, 'ref', ref, clobber=clobber):
49
+ success = True
50
+ return success
51
+
52
+ def get_resolver(self, package):
53
+ '''
54
+ Returns a specific resolver
55
+
56
+ Args:
57
+ package (str): name of package
58
+ '''
59
+ resolver_cls = Resolver.find_resolver(self.get("source", package, "path"))
60
+ resolver = resolver_cls(package, self._parent(root=True),
61
+ self.get("source", package, "path"),
62
+ self.get("source", package, "ref"))
63
+ resolver.set_cache(self.__cache)
64
+ return resolver
65
+
66
+ def get_resolvers(self):
67
+ '''
68
+ Returns a dictionary of packages with their resolver method.
69
+ '''
70
+ resolvers = {}
71
+ for package in self.getkeys("source"):
72
+ resolvers[package] = self.get_resolver(package).get_path
73
+
74
+ return resolvers
75
+
76
+ def _set_cache(self, package, path):
77
+ self.__cache[package] = path
78
+
79
+ def get_path_cache(self):
80
+ return self.__cache.copy()
81
+
82
+
83
+ ############################################
84
+ # Package information
85
+ ############################################
86
+ def schema_package(schema):
87
+ schema = EditableSchema(schema)
88
+
89
+ schema.insert(
90
+ 'version',
91
+ Parameter(
92
+ 'str',
93
+ scope=Scope.GLOBAL,
94
+ shorthelp="Package: version",
95
+ switch="-package_version <str>",
96
+ example=[
97
+ "cli: -package_version 1.0",
98
+ "api: chip.set('package', 'version', '1.0')"],
99
+ help=trim("""Package version. Can be a branch, tag, commit hash,
100
+ or a semver compatible version.""")))
101
+
102
+ schema.insert(
103
+ 'description',
104
+ Parameter(
105
+ 'str',
106
+ scope=Scope.GLOBAL,
107
+ shorthelp="Package: description",
108
+ switch="-package_description <str>",
109
+ example=[
110
+ "cli: -package_description 'Yet another cpu'",
111
+ "api: chip.set('package', 'description', 'Yet another cpu')"],
112
+ help=trim("""Package short one line description for package
113
+ managers and summary reports.""")))
114
+
115
+ schema.insert(
116
+ 'keyword',
117
+ Parameter(
118
+ 'str',
119
+ scope=Scope.GLOBAL,
120
+ shorthelp="Package: keyword",
121
+ switch="-package_keyword <str>",
122
+ example=[
123
+ "cli: -package_keyword cpu",
124
+ "api: chip.set('package', 'keyword', 'cpu')"],
125
+ help=trim("""Package keyword(s) used to characterize package.""")))
126
+ schema.insert(
127
+ 'doc', 'homepage',
128
+ Parameter(
129
+ 'str',
130
+ scope=Scope.GLOBAL,
131
+ shorthelp="Package: documentation homepage",
132
+ switch="-package_doc_homepage <str>",
133
+ example=[
134
+ "cli: -package_doc_homepage index.html",
135
+ "api: chip.set('package', 'doc', 'homepage', 'index.html')"],
136
+ help=trim("""
137
+ Package documentation homepage. Filepath to design docs homepage.
138
+ Complex designs can can include a long non standard list of
139
+ documents dependent. A single html entry point can be used to
140
+ present an organized documentation dashboard to the designer.""")))
141
+
142
+ doctypes = ['datasheet',
143
+ 'reference',
144
+ 'userguide',
145
+ 'quickstart',
146
+ 'releasenotes',
147
+ 'testplan',
148
+ 'signoff',
149
+ 'tutorial']
150
+
151
+ for item in doctypes:
152
+ schema.insert(
153
+ 'doc', item,
154
+ Parameter(
155
+ '[file]',
156
+ scope=Scope.GLOBAL,
157
+ shorthelp=f"Package: {item} document",
158
+ switch=f"-package_doc_{item} <file>",
159
+ example=[
160
+ f"cli: -package_doc_{item} {item}.pdf",
161
+ f"api: chip.set('package', 'doc', '{item}', '{item}.pdf')"],
162
+ help=trim(f"""Package list of {item} documents.""")))
163
+
164
+ schema.insert(
165
+ 'license',
166
+ Parameter(
167
+ '[str]',
168
+ scope=Scope.GLOBAL,
169
+ shorthelp="Package: license identifiers",
170
+ switch="-package_license <str>",
171
+ example=[
172
+ "cli: -package_license 'Apache-2.0'",
173
+ "api: chip.set('package', 'license', 'Apache-2.0')"],
174
+ help=trim("""Package list of SPDX license identifiers.""")))
175
+
176
+ schema.insert(
177
+ 'licensefile',
178
+ Parameter(
179
+ '[file]',
180
+ scope=Scope.GLOBAL,
181
+ shorthelp="Package: license files",
182
+ switch="-package_licensefile <file>",
183
+ example=[
184
+ "cli: -package_licensefile './LICENSE'",
185
+ "api: chip.set('package', 'licensefile', './LICENSE')"],
186
+ help=trim("""Package list of license files for to be
187
+ applied in cases when a SPDX identifier is not available.
188
+ (eg. proprietary licenses).""")))
189
+
190
+ schema.insert(
191
+ 'organization',
192
+ Parameter(
193
+ '[str]',
194
+ scope=Scope.GLOBAL,
195
+ shorthelp="Package: sponsoring organization",
196
+ switch="-package_organization <str>",
197
+ example=[
198
+ "cli: -package_organization 'humanity'",
199
+ "api: chip.set('package', 'organization', 'humanity')"],
200
+ help=trim("""Package sponsoring organization. The field can be left
201
+ blank if not applicable.""")))
202
+
203
+ record = ['name',
204
+ 'email',
205
+ 'username',
206
+ 'location',
207
+ 'organization',
208
+ 'publickey']
209
+
210
+ for item in record:
211
+ schema.insert(
212
+ 'author', 'default', item,
213
+ Parameter(
214
+ 'str',
215
+ scope=Scope.GLOBAL,
216
+ shorthelp=f"Package: author {item}",
217
+ switch=f"-package_author_{item} 'userid <str>'",
218
+ example=[
219
+ f"cli: -package_author_{item} 'wiley wiley@acme.com'",
220
+ f"api: chip.set('package', 'author', 'wiley', '{item}', 'wiley@acme.com')"],
221
+ help=trim(f"""Package author {item} provided with full name as key and
222
+ {item} as value.""")))
223
+
224
+ schema.insert(
225
+ 'source', 'default', 'path',
226
+ Parameter(
227
+ 'str',
228
+ scope=Scope.GLOBAL,
229
+ shorthelp="Package: data source path",
230
+ switch="-package_source_path 'source <str>'",
231
+ example=[
232
+ "cli: -package_source_path "
233
+ "'freepdk45_data ssh://git@github.com/siliconcompiler/freepdk45/'",
234
+ "api: chip.set('package', 'source', "
235
+ "'freepdk45_data', 'path', 'ssh://git@github.com/siliconcompiler/freepdk45/')"],
236
+ help=trim("""
237
+ Package data source path, allowed paths:
238
+
239
+ * /path/on/network/drive
240
+ * file:///path/on/network/drive
241
+ * git+https://github.com/xyz/xyz
242
+ * git://github.com/xyz/xyz
243
+ * git+ssh://github.com/xyz/xyz
244
+ * ssh://github.com/xyz/xyz
245
+ * https://github.com/xyz/xyz/archive
246
+ * https://zeroasic.com/xyz.tar.gz
247
+ * python://siliconcompiler
248
+ """)))
249
+
250
+ schema.insert(
251
+ 'source', 'default', 'ref',
252
+ Parameter(
253
+ 'str',
254
+ scope=Scope.GLOBAL,
255
+ shorthelp="Package: data source reference",
256
+ switch="-package_source_ref 'source <str>'",
257
+ example=[
258
+ "cli: -package_source_ref 'freepdk45_data 07ec4aa'",
259
+ "api: chip.set('package', 'source', 'freepdk45_data', 'ref', '07ec4aa')"],
260
+ help=trim("""Package data source reference""")))
siliconcompiler/pdk.py CHANGED
@@ -4,8 +4,8 @@ from siliconcompiler.schema.utils import trim
4
4
 
5
5
 
6
6
  class PDKSchema(NamedSchema, PackageSchema):
7
- def __init__(self, name=None, package=None):
8
- NamedSchema.__init__(self, name=name)
7
+ def __init__(self, name, package=None):
8
+ NamedSchema.__init__(self, name)
9
9
  PackageSchema.__init__(self, package=package)
10
10
 
11
11
  schema_pdk(self)
@@ -18,12 +18,24 @@ from siliconcompiler._metadata import default_server
18
18
  from siliconcompiler.remote import JobStatus, NodeStatus
19
19
  from siliconcompiler.report.dashboard import DashboardType
20
20
  from siliconcompiler.flowgraph import RuntimeFlowgraph
21
- from siliconcompiler.schema import JournalingSchema
21
+ from siliconcompiler.scheduler.scheduler import Scheduler
22
+ from siliconcompiler.schema import Journal
22
23
 
23
24
  # Step name to use while logging
24
25
  remote_step_name = 'remote'
25
26
 
26
27
 
28
+ class ClientScheduler(Scheduler):
29
+ def run_core(self):
30
+ Client(self._Scheduler__chip).run()
31
+
32
+ def configure_nodes(self):
33
+ return
34
+
35
+ def check_manifest(self):
36
+ return True
37
+
38
+
27
39
  class Client():
28
40
  # Step name to use while logging
29
41
  STEP_NAME = "remote"
@@ -597,7 +609,7 @@ service, provided by SiliconCompiler, is not intended to process proprietary IP.
597
609
  manifest = os.path.join(self.__chip.getworkdir(), f'{self.__chip.design}.pkg.json')
598
610
  if os.path.exists(manifest):
599
611
  try:
600
- JournalingSchema(self.__chip.schema).read_journal(manifest)
612
+ Journal.replay_file(self.__chip.schema, manifest)
601
613
  self.__setup_information_loaded = True
602
614
  changed = True
603
615
  except: # noqa E722
@@ -619,7 +631,7 @@ service, provided by SiliconCompiler, is not intended to process proprietary IP.
619
631
  f'{self.__chip.design}.pkg.json')
620
632
  if os.path.exists(manifest):
621
633
  try:
622
- JournalingSchema(self.__chip.schema).read_journal(manifest)
634
+ Journal.replay_file(self.__chip.schema, manifest)
623
635
  node_info["imported"] = True
624
636
  changed = True
625
637
  except: # noqa E722
@@ -414,7 +414,7 @@ class Board(metaclass=BoardSingleton):
414
414
  table.show_footer = False
415
415
  table.show_header = False
416
416
  for line in self._log_handler.get_lines(layout.log_height):
417
- table.add_row(f"[bright_black]{line}[/]")
417
+ table.add_row(f"[white]{line}[/]")
418
418
  while table.row_count < layout.log_height:
419
419
  table.add_row("")
420
420