opencos-eda 0.2.35__py3-none-any.whl → 0.2.36__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.
- opencos/eda_deps_bash_completion.bash +1 -1
- opencos/export_helper.py +20 -19
- {opencos_eda-0.2.35.dist-info → opencos_eda-0.2.36.dist-info}/METADATA +1 -1
- {opencos_eda-0.2.35.dist-info → opencos_eda-0.2.36.dist-info}/RECORD +10 -10
- {opencos_eda-0.2.35.dist-info → opencos_eda-0.2.36.dist-info}/entry_points.txt +1 -1
- /opencos/{eda_extract_deps_keys.py → eda_extract_targets.py} +0 -0
- {opencos_eda-0.2.35.dist-info → opencos_eda-0.2.36.dist-info}/WHEEL +0 -0
- {opencos_eda-0.2.35.dist-info → opencos_eda-0.2.36.dist-info}/licenses/LICENSE +0 -0
- {opencos_eda-0.2.35.dist-info → opencos_eda-0.2.36.dist-info}/licenses/LICENSE.spdx +0 -0
- {opencos_eda-0.2.35.dist-info → opencos_eda-0.2.36.dist-info}/top_level.txt +0 -0
opencos/export_helper.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import shutil
|
|
2
3
|
import json
|
|
3
4
|
|
|
4
5
|
from opencos import util
|
|
@@ -75,7 +76,7 @@ def find_sv_included_files_within_file(filename:str,
|
|
|
75
76
|
known_incdir_paths:list,
|
|
76
77
|
warnings:bool=True,
|
|
77
78
|
modify_files_and_save_to_path=None,
|
|
78
|
-
|
|
79
|
+
unmodified_files_copy_to_path=None) -> list:
|
|
79
80
|
'''Given a filename (full path) and a list of known incdir paths, returns
|
|
80
81
|
a list of included files (full path).
|
|
81
82
|
|
|
@@ -83,8 +84,8 @@ def find_sv_included_files_within_file(filename:str,
|
|
|
83
84
|
to strip all path information on the `include "(path)" for example:
|
|
84
85
|
`include "foo.svh" -- no modifications
|
|
85
86
|
`include "../bar.svh" -- is modified to become `include "bar.svh"
|
|
86
|
-
(Optional)
|
|
87
|
-
to
|
|
87
|
+
(Optional) unmodified_files_copy_to_path (str: directory/path) if you wish
|
|
88
|
+
to copy unmodified files to this path.
|
|
88
89
|
'''
|
|
89
90
|
|
|
90
91
|
found_included_files = set()
|
|
@@ -97,7 +98,7 @@ def find_sv_included_files_within_file(filename:str,
|
|
|
97
98
|
|
|
98
99
|
filename_no_path = os.path.split(filename)[1]
|
|
99
100
|
|
|
100
|
-
debug(f'export_helper: {filename=} {modify_files_and_save_to_path=} {
|
|
101
|
+
debug(f'export_helper: {filename=} {modify_files_and_save_to_path=} {unmodified_files_copy_to_path=}')
|
|
101
102
|
|
|
102
103
|
with open(filename) as f:
|
|
103
104
|
|
|
@@ -153,13 +154,13 @@ def find_sv_included_files_within_file(filename:str,
|
|
|
153
154
|
else:
|
|
154
155
|
outf.write(line)
|
|
155
156
|
|
|
156
|
-
#
|
|
157
|
-
if len(modified_lines) == 0 and
|
|
158
|
-
if os.path.isdir(
|
|
159
|
-
dst = os.path.join(
|
|
157
|
+
# Copy unmodified files to some path.
|
|
158
|
+
if len(modified_lines) == 0 and unmodified_files_copy_to_path:
|
|
159
|
+
if os.path.isdir(unmodified_files_copy_to_path):
|
|
160
|
+
dst = os.path.join(unmodified_files_copy_to_path, filename_no_path)
|
|
160
161
|
if not os.path.exists(dst):
|
|
161
|
-
debug(f'export_helper:
|
|
162
|
-
|
|
162
|
+
debug(f'export_helper: Copied unmodified {filename=} to {dst=}')
|
|
163
|
+
shutil.copy(src=filename, dst=dst)
|
|
163
164
|
|
|
164
165
|
|
|
165
166
|
# Back to the list found_included_files that we observed within our filename, we
|
|
@@ -193,7 +194,7 @@ def find_sv_included_files_within_file(filename:str,
|
|
|
193
194
|
def get_list_sv_included_files(all_src_files:list, known_incdir_paths:list, target:str='',
|
|
194
195
|
warnings:bool=True,
|
|
195
196
|
modify_files_and_save_to_path=None,
|
|
196
|
-
|
|
197
|
+
unmodified_files_copy_to_path=None) -> list:
|
|
197
198
|
''' Given a list of all_src_files, and list of known_incdir_paths, returns a list
|
|
198
199
|
of all included files (fullpath). This is recurisve if an included file includes another file.
|
|
199
200
|
|
|
@@ -205,7 +206,7 @@ def get_list_sv_included_files(all_src_files:list, known_incdir_paths:list, targ
|
|
|
205
206
|
`include "foo.svh" -- no modifications
|
|
206
207
|
`include "../bar.svh" -- is modified to become `include "bar.svh"
|
|
207
208
|
Set to None (default) to disable.
|
|
208
|
-
|
|
209
|
+
unmodified_files_copy_to_path -- (str: directory/path) if you wish to copy unmodified
|
|
209
210
|
files to this path. Set to None (default) to disable.
|
|
210
211
|
'''
|
|
211
212
|
|
|
@@ -220,7 +221,7 @@ def get_list_sv_included_files(all_src_files:list, known_incdir_paths:list, targ
|
|
|
220
221
|
known_incdir_paths=known_incdir_paths,
|
|
221
222
|
warnings=warnings,
|
|
222
223
|
modify_files_and_save_to_path=modify_files_and_save_to_path,
|
|
223
|
-
|
|
224
|
+
unmodified_files_copy_to_path=unmodified_files_copy_to_path
|
|
224
225
|
)
|
|
225
226
|
|
|
226
227
|
for f in included_files_list:
|
|
@@ -239,7 +240,7 @@ def get_list_sv_included_files(all_src_files:list, known_incdir_paths:list, targ
|
|
|
239
240
|
known_incdir_paths=known_incdir_paths,
|
|
240
241
|
warnings=warnings,
|
|
241
242
|
modify_files_and_save_to_path=modify_files_and_save_to_path,
|
|
242
|
-
|
|
243
|
+
unmodified_files_copy_to_path=unmodified_files_copy_to_path
|
|
243
244
|
)
|
|
244
245
|
sv_included_files_dict[fname] = True # mark as traversed.
|
|
245
246
|
|
|
@@ -317,7 +318,7 @@ class ExportHelper:
|
|
|
317
318
|
known_incdir_paths=self.cmd_design_obj.incdirs,
|
|
318
319
|
target=self.target,
|
|
319
320
|
modify_files_and_save_to_path=self.out_dir,
|
|
320
|
-
|
|
321
|
+
unmodified_files_copy_to_path=self.out_dir
|
|
321
322
|
)
|
|
322
323
|
|
|
323
324
|
info(f"export_helper: {self.target=} included files {self.included_files=}")
|
|
@@ -325,7 +326,7 @@ class ExportHelper:
|
|
|
325
326
|
for filename in self.cmd_design_obj.files_non_source:
|
|
326
327
|
dst = os.path.join(self.out_dir, os.path.split(filename)[1])
|
|
327
328
|
if not os.path.exists(dst):
|
|
328
|
-
|
|
329
|
+
shutil.copy(src=filename, dst=dst)
|
|
329
330
|
|
|
330
331
|
def create_deps_yml_in_out_dir(self, deps_file_args:list=list()):
|
|
331
332
|
if not self.target:
|
|
@@ -449,11 +450,11 @@ class ExportHelper:
|
|
|
449
450
|
info(f'export_helper: Wrote {dst=}')
|
|
450
451
|
|
|
451
452
|
# If this was from an `export` command, and the self.out_dir != self.args['work-dir'], then
|
|
452
|
-
#
|
|
453
|
+
# copy the export.json to the work-dir:
|
|
453
454
|
if self.out_dir != self.args['work-dir']:
|
|
454
455
|
util.safe_mkdirs(base=self.args['work-dir'], new_dirs=['export'])
|
|
455
456
|
src = os.path.abspath(os.path.join(self.out_dir, 'export.json'))
|
|
456
457
|
dst = os.path.join(self.args['work-dir'], 'export', 'export.json')
|
|
457
458
|
if not os.path.exists(dst):
|
|
458
|
-
|
|
459
|
-
info(f'export_helper:
|
|
459
|
+
shutil.copy(src=filename, dst=dst)
|
|
460
|
+
info(f'export_helper: Copied {src=} to {dst=}')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: opencos-eda
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.36
|
|
4
4
|
Summary: A simple Python package for wrapping RTL simuliatons and synthesis
|
|
5
5
|
Author-email: Simon Sabato <simon@cognichip.ai>, Drew Ranck <drew@cognichip.ai>
|
|
6
6
|
Project-URL: Homepage, https://github.com/cognichip/opencos
|
|
@@ -9,10 +9,10 @@ opencos/eda_config.py,sha256=CXfFVW4QOtP1gpMcX8JhCe93_aibcdbGoS7RAiYQnOs,8561
|
|
|
9
9
|
opencos/eda_config_defaults.yml,sha256=4ryY9THfaeL2kclo5KLkC7F1_g7FbjVzDMQFdAsvTl0,9195
|
|
10
10
|
opencos/eda_config_max_verilator_waivers.yml,sha256=lTAU4IOEbUWVlPzuer1YYhIyxpPINeA4EJqcRIT-Ymk,840
|
|
11
11
|
opencos/eda_config_reduced.yml,sha256=2mV9CiUEj_tyJnQsC9_k0RlxuBrky0zW1HX2xlDVEjU,1469
|
|
12
|
-
opencos/eda_deps_bash_completion.bash,sha256=
|
|
13
|
-
opencos/
|
|
12
|
+
opencos/eda_deps_bash_completion.bash,sha256=BmCZNnRBioiPf93qwjtOmIPdDeHes0ojS_s_k4jhMoo,1950
|
|
13
|
+
opencos/eda_extract_targets.py,sha256=Qc4IEx82ZNY2bLNYY0htpB4XLT-Mr2JQfPriyRigWkI,3467
|
|
14
14
|
opencos/eda_tool_helper.py,sha256=MxNd_ImyA13DZbzMol1R5H8tJZddJfqyDgFVR2ad374,1666
|
|
15
|
-
opencos/export_helper.py,sha256=
|
|
15
|
+
opencos/export_helper.py,sha256=2SfzHM3m6b5Wh-OMgRWv5I_A95MHIYBn8-H_P3YC7ZQ,19680
|
|
16
16
|
opencos/export_json_convert.py,sha256=KsP1ESmSWs8ouecDC5ikuwOFZNJtLjmiYOvYLeN5UZU,3768
|
|
17
17
|
opencos/files.py,sha256=IB-hTRrVQx884GNqdJX1V1ikSRUS1Vwu-B3yX0AN6FI,1495
|
|
18
18
|
opencos/names.py,sha256=LMhAE5UH5LEy4zqHp3rOe6tP26i_Dka6JOJzKMo_bkg,1201
|
|
@@ -66,10 +66,10 @@ opencos/tools/tabbycad_yosys.py,sha256=h9kkAi479cZzYfb4R9WBNY_JmR6BgVFj4s3VShnGp
|
|
|
66
66
|
opencos/tools/verilator.py,sha256=0ZHAkkUqnsM1A4B8-u6tff3lhl-cgfDUx-Dq7DaRwkI,18080
|
|
67
67
|
opencos/tools/vivado.py,sha256=cL5IZdudqquddvZqHQGDVmaHSxgBZsMUmAq18q8AgoM,39134
|
|
68
68
|
opencos/tools/yosys.py,sha256=Nov3zKyliZ6rHwMbH4f8XEkoo9H66T2-MN-KNQTjWFk,3530
|
|
69
|
-
opencos_eda-0.2.
|
|
70
|
-
opencos_eda-0.2.
|
|
71
|
-
opencos_eda-0.2.
|
|
72
|
-
opencos_eda-0.2.
|
|
73
|
-
opencos_eda-0.2.
|
|
74
|
-
opencos_eda-0.2.
|
|
75
|
-
opencos_eda-0.2.
|
|
69
|
+
opencos_eda-0.2.36.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
|
|
70
|
+
opencos_eda-0.2.36.dist-info/licenses/LICENSE.spdx,sha256=8gn1610RMP6eFgT3Hm6q9VKXt0RvdTItL_oxMo72jII,189
|
|
71
|
+
opencos_eda-0.2.36.dist-info/METADATA,sha256=bcp36pjsJ-jZgB8xXIiaYRKT86yOHYl_cBgKHaMVDDI,604
|
|
72
|
+
opencos_eda-0.2.36.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
73
|
+
opencos_eda-0.2.36.dist-info/entry_points.txt,sha256=V8OE1lySAFcFQpDNJuVxVZteeSmDH-joLMhGvrxrvmg,164
|
|
74
|
+
opencos_eda-0.2.36.dist-info/top_level.txt,sha256=J4JDP-LpRyJqPNeh9bSjx6yrLz2Mk0h6un6YLmtqql4,8
|
|
75
|
+
opencos_eda-0.2.36.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|