opencos-eda 0.3.12__py3-none-any.whl → 0.3.13__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/commands/flist.py +222 -39
- opencos/commands/multi.py +4 -2
- opencos/commands/sim.py +121 -7
- opencos/deps/deps_file.py +4 -1
- opencos/deps_schema.py +2 -2
- opencos/eda.py +12 -9
- opencos/eda_base.py +39 -8
- opencos/eda_config.py +37 -6
- opencos/eda_config_defaults.yml +28 -4
- opencos/eda_tool_helper.py +4 -4
- opencos/tools/cocotb.py +0 -11
- opencos/tools/invio.py +0 -6
- opencos/tools/iverilog.py +16 -16
- opencos/tools/modelsim_ase.py +0 -12
- opencos/tools/quartus.py +21 -1
- opencos/tools/questa.py +0 -14
- opencos/tools/questa_common.py +49 -25
- opencos/tools/questa_fe.py +0 -14
- opencos/tools/questa_fse.py +0 -14
- opencos/tools/riviera.py +54 -24
- opencos/tools/slang.py +12 -9
- opencos/tools/slang_yosys.py +0 -6
- opencos/tools/surelog.py +11 -8
- opencos/tools/tabbycad_yosys.py +1 -7
- opencos/tools/verilator.py +13 -11
- opencos/tools/vivado.py +49 -18
- opencos/tools/yosys.py +1 -3
- opencos/util.py +14 -5
- opencos/utils/str_helpers.py +4 -1
- {opencos_eda-0.3.12.dist-info → opencos_eda-0.3.13.dist-info}/METADATA +1 -2
- {opencos_eda-0.3.12.dist-info → opencos_eda-0.3.13.dist-info}/RECORD +36 -36
- {opencos_eda-0.3.12.dist-info → opencos_eda-0.3.13.dist-info}/WHEEL +0 -0
- {opencos_eda-0.3.12.dist-info → opencos_eda-0.3.13.dist-info}/entry_points.txt +0 -0
- {opencos_eda-0.3.12.dist-info → opencos_eda-0.3.13.dist-info}/licenses/LICENSE +0 -0
- {opencos_eda-0.3.12.dist-info → opencos_eda-0.3.13.dist-info}/licenses/LICENSE.spdx +0 -0
- {opencos_eda-0.3.12.dist-info → opencos_eda-0.3.13.dist-info}/top_level.txt +0 -0
opencos/tools/riviera.py
CHANGED
|
@@ -82,6 +82,7 @@ class CommandSimRiviera(CommonSimQuesta, ToolRiviera):
|
|
|
82
82
|
'waves-fst': True,
|
|
83
83
|
'waves-vcd': False,
|
|
84
84
|
'coverage-tcl': '',
|
|
85
|
+
'ext-defines-sv-fname': '_ext_defines.sv',
|
|
85
86
|
})
|
|
86
87
|
self.args_help.update({
|
|
87
88
|
'waves-fst': (
|
|
@@ -99,6 +100,12 @@ class CommandSimRiviera(CommonSimQuesta, ToolRiviera):
|
|
|
99
100
|
'Attempts to support UVM. Adds to vlog: -l uvm +incdir+PATH for the PATH to'
|
|
100
101
|
' uvm_macros.svh for the installed version of Riviera used.'
|
|
101
102
|
),
|
|
103
|
+
'license-queue': (
|
|
104
|
+
'Set to enable env vars (if unset) LICENSE_QUEUE=1, ALDEC_LICENSE_QUEUE=1,'
|
|
105
|
+
' FLEXLM_TIMEOUT=3000000 (3us), which should set Riviera to wait for licenses'
|
|
106
|
+
' instead of immediately exiting with error. You may wish to also set your own'
|
|
107
|
+
' env vars for ALDEC_LICENSE_FILE instead of LM_LICENSE_FILE.'
|
|
108
|
+
),
|
|
102
109
|
})
|
|
103
110
|
|
|
104
111
|
if self.uvm_versions:
|
|
@@ -109,15 +116,6 @@ class CommandSimRiviera(CommonSimQuesta, ToolRiviera):
|
|
|
109
116
|
'uvm-version': { 'choices': list(self.uvm_versions) }
|
|
110
117
|
})
|
|
111
118
|
|
|
112
|
-
def set_tool_defines(self):
|
|
113
|
-
# Update any defines from config.tools.modelsim_ase:
|
|
114
|
-
self.defines.update(
|
|
115
|
-
self.tool_config.get(
|
|
116
|
-
'defines',
|
|
117
|
-
# defaults, if not set:
|
|
118
|
-
{'OC_TOOL_RIVIERA': 1}
|
|
119
|
-
)
|
|
120
|
-
)
|
|
121
119
|
|
|
122
120
|
# Note: many of these we follow the same flow as CommandSimModelsimAse:
|
|
123
121
|
# do_it, prepare_compile, compile, elaborate, simulate
|
|
@@ -195,20 +193,27 @@ class CommandSimRiviera(CommonSimQuesta, ToolRiviera):
|
|
|
195
193
|
for value in self.incdirs:
|
|
196
194
|
vlog_dot_f_lines += [ f"+incdir+{value}" ]
|
|
197
195
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if
|
|
206
|
-
|
|
207
|
-
vlog_dot_f_lines += [ f'"+define+{k}={str_v}"' ]
|
|
196
|
+
# For external defines, we will create a file in the work-dir named
|
|
197
|
+
# _ext_defines.sv, it will be the first file in the file list, and it
|
|
198
|
+
# will be valid Verilog/SV, not a list of +define+Name[=Value]
|
|
199
|
+
if self.args['ext-defines-sv-fname']:
|
|
200
|
+
self.create_ext_defines_sv()
|
|
201
|
+
else:
|
|
202
|
+
for k,v in self.defines.items():
|
|
203
|
+
if v is None:
|
|
204
|
+
vlog_dot_f_lines += [ f'+define+{k}' ]
|
|
208
205
|
else:
|
|
209
|
-
#
|
|
210
|
-
# +define+
|
|
211
|
-
|
|
206
|
+
# if the value v is a double-quoted string, such as v='"hi"', the
|
|
207
|
+
# entire +define+NAME="hi" needs to wrapped in double quotes with the
|
|
208
|
+
# value v double-quotes escaped: "+define+NAME=\"hi\""
|
|
209
|
+
if isinstance(v, str) and v.startswith('"') and v.endswith('"'):
|
|
210
|
+
str_v = v.replace('"', '\\"')
|
|
211
|
+
vlog_dot_f_lines += [ f'"+define+{k}={str_v}"' ]
|
|
212
|
+
else:
|
|
213
|
+
# Generally we should only support int and str python types passed as
|
|
214
|
+
# +define+{k}={v}, but also for SystemVerilog plusargs
|
|
215
|
+
vlog_dot_f_lines += [ f'+define+{k}={sanitize_defines_for_sh(v)}' ]
|
|
216
|
+
|
|
212
217
|
|
|
213
218
|
|
|
214
219
|
vlog_dot_f_lines += self.args['compile-args']
|
|
@@ -261,9 +266,17 @@ class CommandSimRiviera(CommonSimQuesta, ToolRiviera):
|
|
|
261
266
|
if all(x not in voptargs_str for x in ('+access +r', '+access +w+r')):
|
|
262
267
|
voptargs_str += ' +access +r'
|
|
263
268
|
|
|
264
|
-
# parameters
|
|
269
|
+
# parameters, for Riviera we need to use the leading forward slash option
|
|
270
|
+
# aka -G/Name=Value, if our parameter name doesn't already have path information.
|
|
271
|
+
# If you do -GName=Value, all parameters in the hierachy with Name will be set,
|
|
272
|
+
# so to only do top level parameters, if hierarchy isn't mentioned in the Name,
|
|
273
|
+
# would need to do -G/{self.args['top']}/Name=Value.
|
|
265
274
|
if self.parameters:
|
|
266
|
-
voptargs_str += ' ' + ' '.join(
|
|
275
|
+
voptargs_str += ' ' + ' '.join(
|
|
276
|
+
self.process_parameters_get_list(
|
|
277
|
+
arg_prefix='-G', hier_delimiter='/', top_hier_str=f'/{self.args["top"]}/'
|
|
278
|
+
)
|
|
279
|
+
)
|
|
267
280
|
|
|
268
281
|
vsim_libs = ' '.join([f'-l {x}' for x in self.args['sim-library']])
|
|
269
282
|
|
|
@@ -365,6 +378,23 @@ class CommandSimRiviera(CommonSimQuesta, ToolRiviera):
|
|
|
365
378
|
f.writelines(line + "\n" for line in vsim_vlogonly_dot_do_lines)
|
|
366
379
|
|
|
367
380
|
|
|
381
|
+
def handle_arg_license_queue(self) -> None:
|
|
382
|
+
'''Handles self.args['license-queue'] (bool) to set env vars
|
|
383
|
+
|
|
384
|
+
Overriden from opencos.command.sim::CommandSim.
|
|
385
|
+
'''
|
|
386
|
+
if not self.args['license-queue']:
|
|
387
|
+
return
|
|
388
|
+
|
|
389
|
+
if 'LICENSE_QUEUE' not in os.environ:
|
|
390
|
+
os.environ['LICENSE_QUEUE'] = '1'
|
|
391
|
+
if 'ALDEC_LICENSE_QUEUE' not in os.environ:
|
|
392
|
+
os.environ['ALDEC_LICENSE_QUEUE'] = '1'
|
|
393
|
+
|
|
394
|
+
# Anecdotal evidence, set this which may help
|
|
395
|
+
if 'FLEXLM_TIMEOUT' not in os.environ:
|
|
396
|
+
os.environ['FLEXLM_TIMEOUT'] = '3000000' # 3e6 us = 3 sec
|
|
397
|
+
|
|
368
398
|
|
|
369
399
|
def _get_vsim_suppress_list_str(self) -> str:
|
|
370
400
|
vsim_suppress_list = []
|
opencos/tools/slang.py
CHANGED
|
@@ -63,7 +63,7 @@ class ToolSlang(Tool):
|
|
|
63
63
|
return self._VERSION
|
|
64
64
|
|
|
65
65
|
def set_tool_defines(self):
|
|
66
|
-
|
|
66
|
+
super().set_tool_defines()
|
|
67
67
|
if 'SYNTHESIS' not in self.defines:
|
|
68
68
|
self.defines['SIMULATION'] = None # add define
|
|
69
69
|
# Expected to manually add SYNTHESIS command line or target, otherwise.
|
|
@@ -139,14 +139,17 @@ class CommandElabSlang(CommandElab, ToolSlang):
|
|
|
139
139
|
command_list += [ '--include-directory', value ]
|
|
140
140
|
|
|
141
141
|
# defines:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
if self.args['ext-defines-sv-fname']:
|
|
143
|
+
self.create_ext_defines_sv()
|
|
144
|
+
else:
|
|
145
|
+
for k,v in self.defines.items():
|
|
146
|
+
command_list.append( '--define-macro' )
|
|
147
|
+
if v is None:
|
|
148
|
+
command_list.append( k )
|
|
149
|
+
else:
|
|
150
|
+
# Generally we should only support int and str python types passed as
|
|
151
|
+
# --define-macro {k}={v}
|
|
152
|
+
command_list.append( f'{k}={sanitize_defines_for_sh(v)}' )
|
|
150
153
|
|
|
151
154
|
# parameters
|
|
152
155
|
command_list.extend(
|
opencos/tools/slang_yosys.py
CHANGED
|
@@ -22,12 +22,6 @@ class ToolSlangYosys(ToolYosys):
|
|
|
22
22
|
'https://github.com/MikePopoloski/slang',
|
|
23
23
|
]
|
|
24
24
|
|
|
25
|
-
def set_tool_defines(self):
|
|
26
|
-
super().set_tool_defines()
|
|
27
|
-
self.defines.update({
|
|
28
|
-
'OC_TOOL_SLANG': None,
|
|
29
|
-
})
|
|
30
|
-
|
|
31
25
|
|
|
32
26
|
class CommandSynthSlangYosys(CommonSynthYosys, ToolSlangYosys):
|
|
33
27
|
'''CommandSynthSlangYosys is a command handler for: eda synth --tool=slang_yosys'''
|
opencos/tools/surelog.py
CHANGED
|
@@ -48,7 +48,7 @@ class ToolSurelog(Tool):
|
|
|
48
48
|
return self._VERSION
|
|
49
49
|
|
|
50
50
|
def set_tool_defines(self):
|
|
51
|
-
|
|
51
|
+
super().set_tool_defines()
|
|
52
52
|
if 'SYNTHESIS' not in self.defines:
|
|
53
53
|
self.defines['SIMULATION'] = None # add define
|
|
54
54
|
# Expected to manually add SYNTHESIS command line or target, otherwise.
|
|
@@ -116,13 +116,16 @@ class CommandElabSurelog(CommandElab, ToolSurelog):
|
|
|
116
116
|
)
|
|
117
117
|
|
|
118
118
|
# defines:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
119
|
+
if self.args['ext-defines-sv-fname']:
|
|
120
|
+
self.create_ext_defines_sv()
|
|
121
|
+
else:
|
|
122
|
+
for k,v in self.defines.items():
|
|
123
|
+
if v is None:
|
|
124
|
+
command_list.append( f'+define+{k}' )
|
|
125
|
+
else:
|
|
126
|
+
# Generally we should only support int and str python types passed as
|
|
127
|
+
# +define+{k}={v}
|
|
128
|
+
command_list.append( f'+define+{k}={sanitize_defines_for_sh(v)}' )
|
|
126
129
|
|
|
127
130
|
# Because many elab target-name won't match the --top needed for
|
|
128
131
|
# slang, we'll leave this to arg --surelog-top:
|
opencos/tools/tabbycad_yosys.py
CHANGED
|
@@ -21,17 +21,11 @@ class ToolTabbyCadYosys(ToolYosys):
|
|
|
21
21
|
_TOOL = 'tabbycad_yosys'
|
|
22
22
|
_URL = 'https://www.yosyshq.com/tabby-cad-datasheet'
|
|
23
23
|
|
|
24
|
-
def set_tool_defines(self):
|
|
25
|
-
super().set_tool_defines()
|
|
26
|
-
self.defines.update({
|
|
27
|
-
'OC_TOOL_TABBYCAD': None,
|
|
28
|
-
})
|
|
29
|
-
|
|
30
24
|
|
|
31
25
|
class CommandSynthTabbyCadYosys(CommonSynthYosys, ToolTabbyCadYosys):
|
|
32
26
|
'''Command handler for: eda synth --tool tabbycad_yosys.'''
|
|
33
27
|
|
|
34
|
-
def __init__(self, config:dict):
|
|
28
|
+
def __init__(self, config: dict):
|
|
35
29
|
CommonSynthYosys.__init__(self, config)
|
|
36
30
|
ToolTabbyCadYosys.__init__(self, config=self.config)
|
|
37
31
|
|
opencos/tools/verilator.py
CHANGED
|
@@ -67,9 +67,6 @@ class ToolVerilator(Tool):
|
|
|
67
67
|
self._VERSION = version
|
|
68
68
|
return self._VERSION
|
|
69
69
|
|
|
70
|
-
def set_tool_defines(self):
|
|
71
|
-
# We don't need to define VERILATOR, the verilated exe does that itself.
|
|
72
|
-
pass
|
|
73
70
|
|
|
74
71
|
class VerilatorSim(CommandSim, ToolVerilator):
|
|
75
72
|
'''VerilatorSim is a command handler for: eda sim --tool=verilator'''
|
|
@@ -222,7 +219,9 @@ class VerilatorSim(CommandSim, ToolVerilator):
|
|
|
222
219
|
check_logs=False
|
|
223
220
|
)
|
|
224
221
|
|
|
225
|
-
def get_compile_command_lists(
|
|
222
|
+
def get_compile_command_lists( # pylint: disable=too-many-branches
|
|
223
|
+
self, **kwargs
|
|
224
|
+
) -> list:
|
|
226
225
|
|
|
227
226
|
# Support for lint_only (bool) in kwargs:
|
|
228
227
|
lint_only = kwargs.get('lint_only', False)
|
|
@@ -268,13 +267,16 @@ class VerilatorSim(CommandSim, ToolVerilator):
|
|
|
268
267
|
verilate_command_list += [ f"+incdir+{value}" ]
|
|
269
268
|
|
|
270
269
|
# defines
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
270
|
+
if self.args['ext-defines-sv-fname']:
|
|
271
|
+
self.create_ext_defines_sv()
|
|
272
|
+
else:
|
|
273
|
+
for k,v in self.defines.items():
|
|
274
|
+
if v is None:
|
|
275
|
+
verilate_command_list += [ f'+define+{k}' ]
|
|
276
|
+
else:
|
|
277
|
+
# Generally we should only support int and str python types passed as
|
|
278
|
+
# +define+{k}={v}, but also for SystemVerilog plusargs
|
|
279
|
+
verilate_command_list += [ f'+define+{k}={sanitize_defines_for_sh(v)}' ]
|
|
278
280
|
|
|
279
281
|
# parameters
|
|
280
282
|
verilate_command_list.extend(
|
opencos/tools/vivado.py
CHANGED
|
@@ -265,7 +265,9 @@ class CommandSimVivado(CommandSim, ToolVivado):
|
|
|
265
265
|
|
|
266
266
|
return []
|
|
267
267
|
|
|
268
|
-
def process_parameters_get_list(
|
|
268
|
+
def process_parameters_get_list(
|
|
269
|
+
self, arg_prefix: str = '-G', **kwargs
|
|
270
|
+
) -> list:
|
|
269
271
|
'''Override from sim.CommandSim
|
|
270
272
|
|
|
271
273
|
custom handler for parameters, instead of the one in sim.py
|
|
@@ -448,17 +450,22 @@ class CommandSimVivado(CommandSim, ToolVivado):
|
|
|
448
450
|
for value in self.incdirs:
|
|
449
451
|
command_list.append('-i')
|
|
450
452
|
command_list.append(Path(value).as_posix())
|
|
451
|
-
for key, value in self.defines.items():
|
|
452
|
-
command_list.append('-d')
|
|
453
|
-
if value is not None:
|
|
454
|
-
# Because we're writing to a .tcl file, \" will become ", and \\\" will become \"
|
|
455
|
-
# we want \" in the final file. Parameters need to act the same way as defines:
|
|
456
|
-
value = f'{value}'.replace('"', '\\\"')
|
|
457
453
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
454
|
+
if self.args['ext-defines-sv-fname']:
|
|
455
|
+
self.create_ext_defines_sv()
|
|
456
|
+
else:
|
|
457
|
+
for key, value in self.defines.items():
|
|
458
|
+
command_list.append('-d')
|
|
459
|
+
if value is not None:
|
|
460
|
+
# Because we're writing to a .tcl file, \" will become ", and \\\" will become
|
|
461
|
+
# \". We want \" in the final file. Parameters need to act the same way as
|
|
462
|
+
# defines:
|
|
463
|
+
value = f'{value}'.replace('"', '\\\"')
|
|
464
|
+
|
|
465
|
+
if value is None:
|
|
466
|
+
command_list.append(key)
|
|
467
|
+
else:
|
|
468
|
+
command_list.append(f"\"{key}={value}\"")
|
|
462
469
|
|
|
463
470
|
command_list += self.args['compile-args']
|
|
464
471
|
|
|
@@ -502,7 +509,7 @@ class CommandSimVivado(CommandSim, ToolVivado):
|
|
|
502
509
|
_, leafname = os.path.split(name)
|
|
503
510
|
if leafname == 'vivado.log':
|
|
504
511
|
description = 'Vivado XSim log from stdout/stderr'
|
|
505
|
-
|
|
512
|
+
elif leafname == 'xsim.log':
|
|
506
513
|
description = 'Vivado XSim simulation step (3/3) log from stdout/stderr'
|
|
507
514
|
elif leafname == 'xelab.log':
|
|
508
515
|
description = 'Vivado XSim elaboration step (2/3) log from stdout/stderr'
|
|
@@ -836,10 +843,7 @@ class CommandBuildVivado(CommandBuild, ToolVivado):
|
|
|
836
843
|
'--tool=' + self.args['tool'],
|
|
837
844
|
'--force',
|
|
838
845
|
'--out=' + flist_file,
|
|
839
|
-
#'--no-emit-incdir',
|
|
840
|
-
#'--no-single-quote-define', # Needed to run in Command.exec( ... shell=False)
|
|
841
846
|
'--no-quote-define',
|
|
842
|
-
#'--bracket-quote-define',
|
|
843
847
|
'--quote-define-value',
|
|
844
848
|
'--escape-define-value',
|
|
845
849
|
'--no-equal-define',
|
|
@@ -919,13 +923,40 @@ class CommandBuildVivado(CommandBuild, ToolVivado):
|
|
|
919
923
|
|
|
920
924
|
|
|
921
925
|
class CommandFListVivado(CommandFList, ToolVivado):
|
|
922
|
-
'''CommandFlistVivado is a command handler for: eda flist --tool=vivado
|
|
926
|
+
'''CommandFlistVivado is a command handler for: eda flist --tool=vivado
|
|
927
|
+
|
|
928
|
+
This is more synthesis and projects, not for Vivado XSim. We'll log
|
|
929
|
+
warnings if any plusargs or parameters were set, because they will
|
|
930
|
+
not be emitted.
|
|
931
|
+
'''
|
|
923
932
|
|
|
924
933
|
def __init__(self, config: dict):
|
|
925
934
|
CommandFList.__init__(self, config=config)
|
|
926
935
|
ToolVivado.__init__(self, config=self.config)
|
|
927
|
-
self.args
|
|
928
|
-
|
|
936
|
+
self.args.update({
|
|
937
|
+
'all-sv': False,
|
|
938
|
+
# synth/project style Flist, can't emit these:
|
|
939
|
+
'emit-parameter': False,
|
|
940
|
+
'emit-plusargs': False,
|
|
941
|
+
})
|
|
942
|
+
|
|
943
|
+
def get_flist_plusargs_list(self) -> list:
|
|
944
|
+
'''Overriden from CommandFList.'''
|
|
945
|
+
if self.args['unprocessed-plusargs']:
|
|
946
|
+
util.warning('Command "flist" for --tool=vivado is not intended for simulation',
|
|
947
|
+
'and plusargs were present. They will NOT be included in the flist:',
|
|
948
|
+
f'{self.args["unprocessed-plusargs"]}')
|
|
949
|
+
|
|
950
|
+
return []
|
|
951
|
+
|
|
952
|
+
def get_flist_parameter_list(self) -> list:
|
|
953
|
+
'''Overriden from CommandFList.'''
|
|
954
|
+
if self.parameters:
|
|
955
|
+
util.warning('Command "flist" for --tool=vivado is not intended for simulation',
|
|
956
|
+
'and parameters were present. They will NOT be included in the flist:',
|
|
957
|
+
f'{self.parameters}')
|
|
958
|
+
|
|
959
|
+
return []
|
|
929
960
|
|
|
930
961
|
|
|
931
962
|
class CommandUploadVivado(CommandUpload, ToolVivado):
|
opencos/tools/yosys.py
CHANGED
|
@@ -88,9 +88,7 @@ class ToolYosys(Tool):
|
|
|
88
88
|
return self._VERSION
|
|
89
89
|
|
|
90
90
|
def set_tool_defines(self):
|
|
91
|
-
|
|
92
|
-
'OC_TOOL_YOSYS': None
|
|
93
|
-
})
|
|
91
|
+
super().set_tool_defines()
|
|
94
92
|
if 'OC_LIBRARY' not in self.defines:
|
|
95
93
|
self.defines.update({
|
|
96
94
|
'OC_LIBRARY_BEHAVIORAL': None,
|
opencos/util.py
CHANGED
|
@@ -24,12 +24,14 @@ from opencos.files import safe_shutil_which
|
|
|
24
24
|
from opencos.utils import status_constants
|
|
25
25
|
from opencos.utils.str_helpers import strip_ansi_color
|
|
26
26
|
|
|
27
|
+
INITIAL_CWD = os.getcwd()
|
|
28
|
+
|
|
27
29
|
global_exit_allowed = False # pylint: disable=invalid-name
|
|
28
30
|
progname = "UNKNOWN" # pylint: disable=invalid-name
|
|
29
31
|
progname_in_message = True # pylint: disable=invalid-name
|
|
30
32
|
debug_level = 0 # pylint: disable=invalid-name
|
|
31
|
-
dot_f_files_expanded =
|
|
32
|
-
env_files_loaded =
|
|
33
|
+
dot_f_files_expanded = [] # pylint: disable=invalid-name
|
|
34
|
+
env_files_loaded = [] # pylint: disable=invalid-name
|
|
33
35
|
|
|
34
36
|
args = { # pylint: disable=invalid-name
|
|
35
37
|
'color' : bool(supportsColor.stdout),
|
|
@@ -456,7 +458,8 @@ def load_env_file(env_file: str) -> None:
|
|
|
456
458
|
'''Handles .env file (from util CLI args --env-file)'''
|
|
457
459
|
if os.path.isfile(env_file):
|
|
458
460
|
load_dotenv(env_file, override=True)
|
|
459
|
-
|
|
461
|
+
if os.path.abspath(env_file) not in env_files_loaded:
|
|
462
|
+
env_files_loaded.append(os.path.abspath(env_file))
|
|
460
463
|
else:
|
|
461
464
|
warning(f'--env-file {env_file} does not exist and is not loaded.')
|
|
462
465
|
|
|
@@ -510,7 +513,8 @@ def read_tokens_from_dot_f(filepath: str, caller_info: str = '', verbose: bool =
|
|
|
510
513
|
if os.path.abspath(filepath) in dot_f_files_expanded:
|
|
511
514
|
error(f'-f (or --input-file): {filepath} has already been expanded',
|
|
512
515
|
f'cannot traverse again (duplicate arg or nested .f files) {caller_info}')
|
|
513
|
-
|
|
516
|
+
else:
|
|
517
|
+
dot_f_files_expanded.append(os.path.abspath(filepath))
|
|
514
518
|
tokens = []
|
|
515
519
|
dotf_file_dir, _ = os.path.split(filepath)
|
|
516
520
|
with open(filepath, encoding='utf-8') as f:
|
|
@@ -518,7 +522,12 @@ def read_tokens_from_dot_f(filepath: str, caller_info: str = '', verbose: bool =
|
|
|
518
522
|
line = os.path.expandvars(line.strip())
|
|
519
523
|
if not line or line.startswith('#') or line.startswith('//'):
|
|
520
524
|
continue
|
|
521
|
-
words =
|
|
525
|
+
words = []
|
|
526
|
+
if line.startswith("'") and line.endswith("'"):
|
|
527
|
+
# treat as single word:
|
|
528
|
+
words = [line]
|
|
529
|
+
else:
|
|
530
|
+
words = line.split()
|
|
522
531
|
tokens.extend(patch_args_for_dir(
|
|
523
532
|
tokens=words, patch_dir=dotf_file_dir, caller_info=f"(from dotf {filepath})"
|
|
524
533
|
))
|
opencos/utils/str_helpers.py
CHANGED
|
@@ -6,11 +6,14 @@ import re
|
|
|
6
6
|
import shlex
|
|
7
7
|
import textwrap
|
|
8
8
|
|
|
9
|
-
VALID_TARGET_INFO_STR = (
|
|
9
|
+
VALID_TARGET_INFO_STR: str = (
|
|
10
10
|
"should start with a . or underscore/letter, rest should be"
|
|
11
11
|
" ., alpha-numeric, dashes, or underscores."
|
|
12
12
|
)
|
|
13
13
|
|
|
14
|
+
# Parameters, with hierarchy, can have a name like: /Path/to.label[6]/Name
|
|
15
|
+
PARAMETER_NAME_RSTR : str = r'[\w\.\/\[\]]+'
|
|
16
|
+
|
|
14
17
|
def is_valid_target_name(s: str) -> bool:
|
|
15
18
|
'''Returns True if str starts with . or underscore/letter, rest alphanum, dash, dot,
|
|
16
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: opencos-eda
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.13
|
|
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
|
|
@@ -20,7 +20,6 @@ Requires-Dist: supports_color>=0.2.0
|
|
|
20
20
|
Provides-Extra: dev
|
|
21
21
|
Requires-Dist: pylint>=3.0.0; extra == "dev"
|
|
22
22
|
Requires-Dist: pytest>=8.3.5; extra == "dev"
|
|
23
|
-
Requires-Dist: twine>=6.1.0; extra == "dev"
|
|
24
23
|
Provides-Extra: cocotb
|
|
25
24
|
Requires-Dist: cocotb>=2.0; extra == "cocotb"
|
|
26
25
|
Requires-Dist: pytest>=8.3.5; extra == "cocotb"
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
opencos/__init__.py,sha256=RwJA9oc1uUlvNX7v5zoqwjnSRNq2NZwRlHqtS-ICJkI,122
|
|
2
2
|
opencos/_version.py,sha256=KaWIjS0c08g-C0fgYY1kXwSPqhOFxaq5pYEeoZhOR_I,617
|
|
3
3
|
opencos/_waves_pkg.sv,sha256=TL5YT9lT-fn2FD54MbVVZROmZ7vtW3ScA_rM2eRzKmU,2068
|
|
4
|
-
opencos/deps_schema.py,sha256=
|
|
5
|
-
opencos/eda.py,sha256=
|
|
6
|
-
opencos/eda_base.py,sha256
|
|
7
|
-
opencos/eda_config.py,sha256=
|
|
8
|
-
opencos/eda_config_defaults.yml,sha256=
|
|
4
|
+
opencos/deps_schema.py,sha256=wKRMuFzOIapwpCPFGvWGM8Mcwdh9yngHOiDRMmvUaIg,17394
|
|
5
|
+
opencos/eda.py,sha256=2vJLMYMW9muWieNaOJz-U5EIVchmVyhTfmEcnZwQtvg,37382
|
|
6
|
+
opencos/eda_base.py,sha256=-nguHrrYVb8a853HEMfFrOoXlsEEeRnDdFR66nTwX0s,124332
|
|
7
|
+
opencos/eda_config.py,sha256=EPW0rhnbrpfV9h0OtKrp7By19FcEyDXT2-ud7y4jbRU,17266
|
|
8
|
+
opencos/eda_config_defaults.yml,sha256=xRJWps4On748MAFIfOIvLNOv5cyON7xAeaW5XquJSp0,21534
|
|
9
9
|
opencos/eda_config_reduced.yml,sha256=BOKGfe-OmVIF0SKhTTglPIzfAoGuCZ8n-f2KpoLF8dk,883
|
|
10
10
|
opencos/eda_deps_bash_completion.bash,sha256=o1yZvGUQSbN-AYq95sDTzMFw7gNHCUSlv9tASEHnACA,2763
|
|
11
11
|
opencos/eda_deps_sanitize.py,sha256=SQjvrte9Hv9JesRY0wljvbdC6pAmLCikI-Wdzzy-D04,1939
|
|
12
12
|
opencos/eda_extract_targets.py,sha256=POlxZfqf2dNH2nc1CEw5B_53vSHAicSTkpU9_-2_6Zw,2851
|
|
13
|
-
opencos/eda_tool_helper.py,sha256=
|
|
13
|
+
opencos/eda_tool_helper.py,sha256=NoVUvUeqvM18Svx1Oy4R8xM4Numq_YZneKyHSDnMMnY,8546
|
|
14
14
|
opencos/export_helper.py,sha256=zDkvsUS6FVrpXl1UTy53QG3CuhYp5FFplI9rRzAE2g8,25395
|
|
15
15
|
opencos/export_json_convert.py,sha256=tSIMbLFtc_Fo66EhFovMii1v_qJYyFZJrPNnoPdW7L0,4182
|
|
16
16
|
opencos/files.py,sha256=-vHrddbFrwxEHU47VzeyLOU93q8XSXAmPiopClfV-bs,2296
|
|
17
17
|
opencos/names.py,sha256=Y2aJ5wgpbNIJ-_P5xUXnHMv_h-zMOX2Rt6iLuduqC1Q,1213
|
|
18
18
|
opencos/peakrdl_cleanup.py,sha256=vHNGtalTrIVP335PhRjPt9RhoccgpK1HJAi-E4M8Kc8,736
|
|
19
19
|
opencos/seed.py,sha256=IL9Yg-r9SLSRseMVWaEHmuw2_DNi_eyut11EafoNTsU,942
|
|
20
|
-
opencos/util.py,sha256=
|
|
20
|
+
opencos/util.py,sha256=LzMOY5ijcubq3OZSG5zVSALN7-IWuTkeNCvbY7whwq0,44854
|
|
21
21
|
opencos/commands/__init__.py,sha256=oOOQmn5_jHAMSOfA3swJJ7mdoyHsJA0lJwKPTudlTns,1125
|
|
22
22
|
opencos/commands/build.py,sha256=mvJYxk5J15k0Cr8R7oIdIIdsEtWV3gE-LnPweVwtSDo,1487
|
|
23
23
|
opencos/commands/deps_help.py,sha256=rWRro9UZCy8FjNgjDdCt5MMrC5KV7Pj6KDsV2xa5fSI,8178
|
|
24
24
|
opencos/commands/elab.py,sha256=m6Gk03wSzX8UkcmReooK7turF7LpqO0IcdOZwJ8XiyI,1596
|
|
25
25
|
opencos/commands/export.py,sha256=bV4JCuihccbbnE_3qWVvlGtrdKWNVjo1hwOq4ax2dxA,3773
|
|
26
|
-
opencos/commands/flist.py,sha256=
|
|
26
|
+
opencos/commands/flist.py,sha256=YlcQFuTo-jpmSfDYdVtNDqK_2VYMM_Ox1_5_0Os-I7o,16329
|
|
27
27
|
opencos/commands/lec.py,sha256=7uziNSeGhZrDEbfS4dt3qVp-z2122hx2kqPH15PqIgQ,4091
|
|
28
28
|
opencos/commands/lint.py,sha256=piPb0l0zE3sAtNJkFQ-oNpuHxnaV_RNXkXtEj_9mwGs,1594
|
|
29
|
-
opencos/commands/multi.py,sha256=
|
|
29
|
+
opencos/commands/multi.py,sha256=urm-IDllnMZWScH7e6Pg4ukHGHILBd4NbPlPmHU3vsw,27624
|
|
30
30
|
opencos/commands/open.py,sha256=XckvKUNwvc5KHbYGV-eQ2i0WG4X-yckroDaMC610MB4,804
|
|
31
31
|
opencos/commands/proj.py,sha256=cExW9ZZkw6nkpVyNfeQzJADzmPtbYgBgWml82tqO6jY,1158
|
|
32
32
|
opencos/commands/shell.py,sha256=upHpFs8Gdtzi-boVXwsC-QzEsnvtoZNMAu4oN10kdxw,7801
|
|
33
|
-
opencos/commands/sim.py,sha256=
|
|
33
|
+
opencos/commands/sim.py,sha256=ifdSpOVmxMWkQ65-9lhwMNZM4F3MXokjJJBm4puyVX4,28573
|
|
34
34
|
opencos/commands/sweep.py,sha256=62XmDHT-prdxJNy-6MbK6wEGJm1YC9caOaJapoekQ8s,9325
|
|
35
35
|
opencos/commands/synth.py,sha256=Qs6FP9Ge_gp9TH3EFzVXKFlrrqrMwIbr38VYVlZvmeA,4557
|
|
36
36
|
opencos/commands/targets.py,sha256=_jRNhm2Fqj0fmMvTw6Ba39DCsRHf_r_uZCy_R064kpA,1472
|
|
@@ -39,7 +39,7 @@ opencos/commands/waves.py,sha256=LYF1UcxkHFYYtYoebnh9iE_on80PbbmzIpaSk-XtZcI,923
|
|
|
39
39
|
opencos/deps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
40
|
opencos/deps/defaults.py,sha256=Z6mIVJEV0zQ9rC-HkQFMBFAkixjqKS1TATPSc27wOeA,1502
|
|
41
41
|
opencos/deps/deps_commands.py,sha256=p6jgZXQFu8kJ5M3YqqKZwrdnRC0EAMm-8oqhKvm_gBE,16665
|
|
42
|
-
opencos/deps/deps_file.py,sha256=
|
|
42
|
+
opencos/deps/deps_file.py,sha256=HNZXhg4cXEklTCATboAn1ZO6xfwibwYQBY17dvFJcAw,17078
|
|
43
43
|
opencos/deps/deps_processor.py,sha256=fSzVonVuocJDinNGOgs4jizF9yjllSdc11QW7Aj8LzQ,46662
|
|
44
44
|
opencos/docs/Architecture.md,sha256=8zLj19-gzwyHe2ahO7fw6It1pYkpnOtfSD8ciocN_hM,4072
|
|
45
45
|
opencos/docs/ConnectingApps.md,sha256=xfAJoSa7rx6-aZ8edTugRxKLwZwapR36xjds9CZBYDw,2698
|
|
@@ -57,37 +57,37 @@ opencos/hw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
57
57
|
opencos/hw/oc_cli.py,sha256=U1JGlshLZhtd0LgndZFBZVltAj_HemdhbjO_Zo8ZuVM,132252
|
|
58
58
|
opencos/hw/pcie.py,sha256=VUJljaZJYgScAAx5yn7F6GoA8K9eTcw24otYZbkMpYs,3035
|
|
59
59
|
opencos/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
|
-
opencos/tools/cocotb.py,sha256=
|
|
61
|
-
opencos/tools/invio.py,sha256=
|
|
60
|
+
opencos/tools/cocotb.py,sha256=mkhdbBbkOcPPct1TZcKH6wPPT7pjzRH_6wCNH2qgXOM,19660
|
|
61
|
+
opencos/tools/invio.py,sha256=pxrS5oaNTcEv-ToXdhFBJZF5XhTmZnJz9CQ8NnLoty8,3155
|
|
62
62
|
opencos/tools/invio_helpers.py,sha256=86WOGmSf4m_lEqBtK3DLjWqI0jnqAWzBEBRYfBUGiSY,8804
|
|
63
63
|
opencos/tools/invio_yosys.py,sha256=zPVX5Bv-mR4zaUZiH0QqGF4Vbm_LXAf75mDW6ywse5c,6026
|
|
64
|
-
opencos/tools/iverilog.py,sha256=
|
|
65
|
-
opencos/tools/modelsim_ase.py,sha256=
|
|
66
|
-
opencos/tools/quartus.py,sha256=
|
|
67
|
-
opencos/tools/questa.py,sha256=
|
|
68
|
-
opencos/tools/questa_common.py,sha256=
|
|
69
|
-
opencos/tools/questa_fe.py,sha256=
|
|
70
|
-
opencos/tools/questa_fse.py,sha256=
|
|
71
|
-
opencos/tools/riviera.py,sha256=
|
|
72
|
-
opencos/tools/slang.py,sha256=
|
|
73
|
-
opencos/tools/slang_yosys.py,sha256=
|
|
74
|
-
opencos/tools/surelog.py,sha256=
|
|
75
|
-
opencos/tools/tabbycad_yosys.py,sha256=
|
|
76
|
-
opencos/tools/verilator.py,sha256=
|
|
77
|
-
opencos/tools/vivado.py,sha256=
|
|
78
|
-
opencos/tools/yosys.py,sha256=
|
|
64
|
+
opencos/tools/iverilog.py,sha256=7R4wL1udfn0WdckPDsYM75GgYW9DeCfPUQEOe-8SGVM,6755
|
|
65
|
+
opencos/tools/modelsim_ase.py,sha256=NEzAXJtiVWkKb3N-O3PYxSnnFmrq8LNrqjxFNBwzfKI,2254
|
|
66
|
+
opencos/tools/quartus.py,sha256=gtswIhpnHjUTmw5g1BRxhjB6tofXEsx-I6IySjwyF94,32303
|
|
67
|
+
opencos/tools/questa.py,sha256=QP0JCt8rWf0-snncNP0_Pi6oRY6_Z9Hwix1IYlRdGEc,2057
|
|
68
|
+
opencos/tools/questa_common.py,sha256=oVytNlwLK-W6yUYqOwlWjPrDd0kWJV4-FnWgppkSX8k,21647
|
|
69
|
+
opencos/tools/questa_fe.py,sha256=yYNlUnA2pQ8-gELLajnvJgqg6ZXb6F26YRmyvrlNFOA,2155
|
|
70
|
+
opencos/tools/questa_fse.py,sha256=CjOAn1Ik-3Hd-vyUH_WyTTJxH2yPfhNEfXbedCir7J4,2116
|
|
71
|
+
opencos/tools/riviera.py,sha256=LgLartBXWwJIoI4zRFL7X2wk6hu2wa0CIJCNBZOGxUc,17509
|
|
72
|
+
opencos/tools/slang.py,sha256=MxRwu4laSbv7oa3lO-BKg4McL7KAckSA003sL-9sY3U,9682
|
|
73
|
+
opencos/tools/slang_yosys.py,sha256=z8gUcNSGDl5S6Ufxdx54WWe5v73w0UydErBKFWBR6ZI,10154
|
|
74
|
+
opencos/tools/surelog.py,sha256=QaXS1EWI2b1TqBoekpXndoHxS6t2e8SD-I2Ryi-gHGs,6666
|
|
75
|
+
opencos/tools/tabbycad_yosys.py,sha256=J4RgfuzYLiBK1U8odXiovXZhgkcDFPlbxt73SppksVA,7657
|
|
76
|
+
opencos/tools/verilator.py,sha256=cx4q1WrterA5Kcn8bt8ukqthS0030swGOFOsoMRBYvw,25131
|
|
77
|
+
opencos/tools/vivado.py,sha256=c8iHVK76de_25iOqN-PJ7O6n1lRopvO_XCM0HZV3c04,48702
|
|
78
|
+
opencos/tools/yosys.py,sha256=DZyqAnrHT-6Wv6TlIwzuv4qw7HZs4vOXPpxZzErRsnY,28292
|
|
79
79
|
opencos/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
80
80
|
opencos/utils/dict_helpers.py,sha256=xCdfE8SE-D6hNu5dG_d46A2g6au6h1h7SFpzYmeyRtA,810
|
|
81
81
|
opencos/utils/markup_helpers.py,sha256=F_Emh2kT2gETYf7C-Jy5yJjsiHiPUtBpQzONsCka6Eo,4604
|
|
82
82
|
opencos/utils/status_constants.py,sha256=na6YsqlsCwIYzTXWE14dPadUYRNTrOS6YTXHCer2NbA,635
|
|
83
|
-
opencos/utils/str_helpers.py,sha256=
|
|
83
|
+
opencos/utils/str_helpers.py,sha256=ctl0Zh0h0JW7OlReeSdGxB9wODQYzmMO-9-h55rSRv0,8419
|
|
84
84
|
opencos/utils/subprocess_helpers.py,sha256=Wqqs8FKm3XIjmD9GUYM-HWVJH7TxWJJA37A07J4fQ4w,6619
|
|
85
85
|
opencos/utils/vscode_helper.py,sha256=8epyEeYfXONwiSoc5KZjUfKc8vgLryct8yckJYie88U,1398
|
|
86
86
|
opencos/utils/vsim_helper.py,sha256=-TJK4Dh8LZ4DCM8GrS9Wka4HE_WMGG_aKwTZtKBrEOE,2994
|
|
87
|
-
opencos_eda-0.3.
|
|
88
|
-
opencos_eda-0.3.
|
|
89
|
-
opencos_eda-0.3.
|
|
90
|
-
opencos_eda-0.3.
|
|
91
|
-
opencos_eda-0.3.
|
|
92
|
-
opencos_eda-0.3.
|
|
93
|
-
opencos_eda-0.3.
|
|
87
|
+
opencos_eda-0.3.13.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
|
|
88
|
+
opencos_eda-0.3.13.dist-info/licenses/LICENSE.spdx,sha256=8gn1610RMP6eFgT3Hm6q9VKXt0RvdTItL_oxMo72jII,189
|
|
89
|
+
opencos_eda-0.3.13.dist-info/METADATA,sha256=ryUfx_mmUFaZcwGr8lXFXrkY2whYhLB-HcQCfKSMtn8,1165
|
|
90
|
+
opencos_eda-0.3.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
91
|
+
opencos_eda-0.3.13.dist-info/entry_points.txt,sha256=QOlMZnQeqqwOzIaeKBcY_WlMR3idmOAEbGFh2dXlqJw,290
|
|
92
|
+
opencos_eda-0.3.13.dist-info/top_level.txt,sha256=J4JDP-LpRyJqPNeh9bSjx6yrLz2Mk0h6un6YLmtqql4,8
|
|
93
|
+
opencos_eda-0.3.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|