opencos-eda 0.3.2__tar.gz → 0.3.3__tar.gz
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-0.3.2/opencos_eda.egg-info → opencos_eda-0.3.3}/PKG-INFO +2 -1
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/eda_config_defaults.yml +2 -1
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/helpers.py +21 -2
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/slang.py +6 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/verilator.py +48 -39
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/util.py +8 -6
- {opencos_eda-0.3.2 → opencos_eda-0.3.3/opencos_eda.egg-info}/PKG-INFO +2 -1
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos_eda.egg-info/requires.txt +1 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/pyproject.toml +2 -1
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/LICENSE +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/LICENSE.spdx +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/README.md +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/__init__.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/_version.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/_waves_pkg.sv +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/__init__.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/build.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/deps_help.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/elab.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/export.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/flist.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/lec.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/lint.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/multi.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/open.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/proj.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/shell.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/sim.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/sweep.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/synth.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/targets.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/upload.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/commands/waves.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/deps/__init__.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/deps/defaults.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/deps/deps_commands.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/deps/deps_file.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/deps/deps_processor.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/deps_schema.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/eda.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/eda_base.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/eda_config.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/eda_config_max_verilator_waivers.yml +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/eda_config_reduced.yml +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/eda_deps_bash_completion.bash +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/eda_deps_sanitize.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/eda_extract_targets.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/eda_tool_helper.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/export_helper.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/export_json_convert.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/files.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/hw/__init__.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/hw/oc_cli.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/hw/pcie.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/names.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/peakrdl_cleanup.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/seed.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/__init__.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/custom_config.yml +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/deps_files/command_order/DEPS.yml +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/deps_files/error_msgs/DEPS.yml +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/deps_files/iverilog_test/DEPS.yml +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/deps_files/no_deps_here/DEPS.yml +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/deps_files/non_sv_reqs/DEPS.yml +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/deps_files/tags_with_tools/DEPS.yml +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/deps_files/test_err_fatal/DEPS.yml +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/test_build.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/test_deps_helpers.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/test_deps_schema.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/test_eda.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/test_eda_elab.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/test_eda_synth.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/test_oc_cli.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tests/test_tools.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/__init__.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/cocotb.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/invio.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/invio_helpers.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/invio_yosys.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/iverilog.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/modelsim_ase.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/quartus.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/questa.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/questa_fse.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/riviera.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/slang_yosys.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/surelog.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/tabbycad_yosys.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/vivado.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/tools/yosys.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/utils/__init__.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/utils/markup_helpers.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/utils/status_constants.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/utils/str_helpers.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/utils/subprocess_helpers.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/utils/vscode_helper.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos/utils/vsim_helper.py +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos_eda.egg-info/SOURCES.txt +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos_eda.egg-info/dependency_links.txt +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos_eda.egg-info/entry_points.txt +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/opencos_eda.egg-info/top_level.txt +0 -0
- {opencos_eda-0.3.2 → opencos_eda-0.3.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: opencos-eda
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
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
|
|
@@ -17,4 +17,5 @@ Requires-Dist: toml>=0.10.2
|
|
|
17
17
|
Requires-Dist: yamllint>=1.35.1
|
|
18
18
|
Requires-Dist: PySerial>=3.5
|
|
19
19
|
Requires-Dist: cocotb>=2.0
|
|
20
|
+
Requires-Dist: supports_color>=0.2.0
|
|
20
21
|
Dynamic: license-file
|
|
@@ -145,6 +145,7 @@ tools:
|
|
|
145
145
|
--timescale=1ns/1ns
|
|
146
146
|
--allow-dup-initial-drivers
|
|
147
147
|
-Wno-missing-top
|
|
148
|
+
compile-waivers: []
|
|
148
149
|
|
|
149
150
|
verilator:
|
|
150
151
|
defines: { }
|
|
@@ -153,11 +154,11 @@ tools:
|
|
|
153
154
|
- "%Fatal"
|
|
154
155
|
log-must-strings:
|
|
155
156
|
- "R e p o r t: Verilator" # These come at end of compile or simulation, since we don't suppress it.
|
|
157
|
+
# Note: -j $(nproc) is handled in verilator.py, but you can override it in compile-args
|
|
156
158
|
compile-args: |
|
|
157
159
|
--timing
|
|
158
160
|
--assert
|
|
159
161
|
--autoflush
|
|
160
|
-
-j 2
|
|
161
162
|
-sv
|
|
162
163
|
compile-coverage-args: |
|
|
163
164
|
--coverage
|
|
@@ -242,7 +242,9 @@ class Helpers:
|
|
|
242
242
|
|
|
243
243
|
return rc
|
|
244
244
|
|
|
245
|
-
def is_in_log(
|
|
245
|
+
def is_in_log(
|
|
246
|
+
self, *want_str, logfile=None, windows_path_support: bool = False
|
|
247
|
+
) -> bool:
|
|
246
248
|
'''Check if want_str (joined) is in the logfile, or self.DEFAULT_LOG'''
|
|
247
249
|
logfile = self._resolve_logfile(logfile)
|
|
248
250
|
want_str0 = ' '.join(list(want_str))
|
|
@@ -254,7 +256,9 @@ class Helpers:
|
|
|
254
256
|
return True
|
|
255
257
|
return False
|
|
256
258
|
|
|
257
|
-
def get_log_lines_with(
|
|
259
|
+
def get_log_lines_with(
|
|
260
|
+
self, *want_str, logfile=None, windows_path_support: bool = False
|
|
261
|
+
) -> list:
|
|
258
262
|
'''gets all log lines with any of want_str args are in the logfile, or self.DEFAULT_LOG'''
|
|
259
263
|
logfile = self._resolve_logfile(logfile)
|
|
260
264
|
ret_list = []
|
|
@@ -267,6 +271,21 @@ class Helpers:
|
|
|
267
271
|
ret_list.append(line)
|
|
268
272
|
return ret_list
|
|
269
273
|
|
|
274
|
+
def get_log_lines_with_all(
|
|
275
|
+
self, *want_str, logfile=None, windows_path_support: bool = False
|
|
276
|
+
) -> list:
|
|
277
|
+
'''gets all log lines with ALL of want_str args are in the logfile, or self.DEFAULT_LOG'''
|
|
278
|
+
logfile = self._resolve_logfile(logfile)
|
|
279
|
+
ret_list = []
|
|
280
|
+
with open(logfile, encoding='utf-8') as f:
|
|
281
|
+
for line in f.readlines():
|
|
282
|
+
if all(x in line for x in list(want_str)):
|
|
283
|
+
ret_list.append(line)
|
|
284
|
+
elif windows_path_support and \
|
|
285
|
+
all(x.replace('/', '\\') in line for x in list(want_str)):
|
|
286
|
+
ret_list.append(line)
|
|
287
|
+
return ret_list
|
|
288
|
+
|
|
270
289
|
def get_log_words_with(self, *want_str, logfile=None, windows_path_support=False):
|
|
271
290
|
'''gets all log words with any of *want_str within a single word
|
|
272
291
|
in the logfile or self.DEFAULT_LOG
|
|
@@ -128,6 +128,7 @@ class CommandElabSlang(CommandElab, ToolSlang):
|
|
|
128
128
|
command_list += self.tool_config.get('compile-args', '--single-unit').split()
|
|
129
129
|
command_list += self.args['slang-args'] # add user args.
|
|
130
130
|
command_list += self._get_slang_json_args(command_exe=command_list[0])
|
|
131
|
+
command_list += self._get_slang_tool_config_waivers()
|
|
131
132
|
|
|
132
133
|
# incdirs
|
|
133
134
|
for value in self.incdirs:
|
|
@@ -214,6 +215,11 @@ class CommandElabSlang(CommandElab, ToolSlang):
|
|
|
214
215
|
|
|
215
216
|
return command_list
|
|
216
217
|
|
|
218
|
+
def _get_slang_tool_config_waivers(self) -> list:
|
|
219
|
+
# Add compile waivers from config and command-line args
|
|
220
|
+
return [f'-Wno-{waiver}' for waiver in
|
|
221
|
+
self.tool_config.get('compile-waivers', []) + self.args['compile-waivers']]
|
|
222
|
+
|
|
217
223
|
|
|
218
224
|
class CommandLintSlang(CommandElabSlang):
|
|
219
225
|
'''CommandLintSlang is a command handler for: eda lint --tool=slang.'''
|
|
@@ -5,10 +5,12 @@ Contains classes for ToolVerilator and VerilatorSim, VerilatorElab.
|
|
|
5
5
|
|
|
6
6
|
# pylint: disable=R0801 # (calling functions with same arguments)
|
|
7
7
|
|
|
8
|
+
import multiprocessing
|
|
8
9
|
import os
|
|
9
10
|
import shutil
|
|
10
11
|
import subprocess
|
|
11
12
|
|
|
13
|
+
|
|
12
14
|
from opencos import util
|
|
13
15
|
from opencos.eda_base import Tool
|
|
14
16
|
from opencos.commands import CommandSim
|
|
@@ -210,15 +212,9 @@ class VerilatorSim(CommandSim, ToolVerilator):
|
|
|
210
212
|
|
|
211
213
|
verilate_command_list = self._get_start_verilator_command_list(lint_only=lint_only)
|
|
212
214
|
|
|
213
|
-
# Add compile args from our self.config (tools.verilator.compile-args str)
|
|
214
|
-
config_compile_args = self.tool_config.get(
|
|
215
|
-
'compile-args',
|
|
216
|
-
'--timing --assert --autoflush -sv').split()
|
|
217
|
-
verilate_command_list += config_compile_args
|
|
218
|
-
|
|
219
215
|
verilate_command_list += self._get_verilator_tool_config_waivers()
|
|
220
216
|
|
|
221
|
-
verilate_command_list += self.
|
|
217
|
+
verilate_command_list += self._verilator_args_defaults_cflags_nproc()
|
|
222
218
|
|
|
223
219
|
verilate_command_list += self._get_verilator_waves_args(lint_only=lint_only)
|
|
224
220
|
|
|
@@ -425,45 +421,51 @@ class VerilatorSim(CommandSim, ToolVerilator):
|
|
|
425
421
|
return ret
|
|
426
422
|
|
|
427
423
|
|
|
428
|
-
def
|
|
424
|
+
def _verilator_args_defaults_cflags_nproc(self) -> list:
|
|
429
425
|
'''Returns list of args to be added to verilator (compile) step
|
|
430
426
|
|
|
431
|
-
Uses self.args['verilate-args']
|
|
427
|
+
Uses self.args['verilate-args'], self.args['compile-args'], and self.tool_config
|
|
428
|
+
|
|
429
|
+
Sets -j <value> and -CFLAGS -O<value> if not present in --config-yml, --compile-args,
|
|
430
|
+
or --verilate-args. If present, chooses the first instance (does not present duplicates
|
|
431
|
+
to verilator call).
|
|
432
432
|
'''
|
|
433
433
|
|
|
434
|
-
# We can only support one -CFLAGS followed by one -O[0-9] arg in
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
434
|
+
# We can only support one -CFLAGS followed by one -O[0-9] arg in
|
|
435
|
+
# --verilate-args or --compile-args.
|
|
436
|
+
|
|
437
|
+
# Add compile args from our self.config (tools.verilator.compile-args str)
|
|
438
|
+
verilate_args = self.args['verilate-args'] + \
|
|
439
|
+
self.args['compile-args'] + \
|
|
440
|
+
self.tool_config.get(
|
|
441
|
+
'compile-args',
|
|
442
|
+
'--timing --assert --autoflush -sv').split()
|
|
443
|
+
|
|
438
444
|
util.debug(f"{self.args['verilate-args']=}")
|
|
439
445
|
util.debug(f"{self.args['compile-args']=}")
|
|
440
|
-
for arg in self.args['verilate-args'] + self.args['compile-args']:
|
|
441
|
-
# pick the first ones we see of these:
|
|
442
|
-
if arg == '-CFLAGS':
|
|
443
|
-
prev_arg_is_cflags = True
|
|
444
|
-
if arg not in verilate_cflags_args_dict:
|
|
445
|
-
# We can only have 1
|
|
446
|
-
verilate_cflags_args_dict[arg] = True
|
|
447
|
-
verilate_args.append(arg)
|
|
448
|
-
else:
|
|
449
|
-
util.debug(f'Previous saw -CFLAGS args {verilate_cflags_args_dict=},',
|
|
450
|
-
f'skipping new {arg=}')
|
|
451
|
-
|
|
452
|
-
elif arg.startswith('-O') and len(arg) == 3:
|
|
453
|
-
if '-O' not in verilate_cflags_args_dict and prev_arg_is_cflags:
|
|
454
|
-
# We can only have 1
|
|
455
|
-
verilate_cflags_args_dict['-O'] = arg[-1]
|
|
456
|
-
verilate_args.append(arg)
|
|
457
|
-
else:
|
|
458
|
-
util.debug(f'Previous saw -CFLAGS args {verilate_cflags_args_dict=},',
|
|
459
|
-
f'skipping new {arg=}')
|
|
460
|
-
prev_arg_is_cflags = False
|
|
461
|
-
|
|
462
|
-
else:
|
|
463
|
-
prev_arg_is_cflags = False
|
|
464
|
-
verilate_args.append(arg)
|
|
465
446
|
|
|
466
|
-
|
|
447
|
+
dash_j_arg_indices = []
|
|
448
|
+
cflags_dasho_args_indices = []
|
|
449
|
+
for i, arg in enumerate(list(verilate_args)):
|
|
450
|
+
# There can only be one of these: -j <value>, similarly can only be one of
|
|
451
|
+
# -CFLAGS -O<value>
|
|
452
|
+
if (i + 1) < len(verilate_args):
|
|
453
|
+
if arg == '-j':
|
|
454
|
+
dash_j_arg_indices.extend([i, i + 1])
|
|
455
|
+
if arg == '-CFLAGS':
|
|
456
|
+
next_arg = verilate_args[i + 1]
|
|
457
|
+
if next_arg.startswith('-O') and len(next_arg) == 3:
|
|
458
|
+
cflags_dasho_args_indices.extend([i, i + 1])
|
|
459
|
+
|
|
460
|
+
# For -j <value> we'll pick the first one, remove the rest.
|
|
461
|
+
# Same goes for -CFLAGS -O<value>
|
|
462
|
+
for index in dash_j_arg_indices[2:] + cflags_dasho_args_indices[2:]:
|
|
463
|
+
verilate_args[index] = ''
|
|
464
|
+
|
|
465
|
+
verilate_args = [x for x in verilate_args if x != ''] # strip empty str.
|
|
466
|
+
|
|
467
|
+
# Support for --optimize which will use -CFLAGS -O3, if -CFLAGS is not present at all.
|
|
468
|
+
if cflags_dasho_args_indices:
|
|
467
469
|
# add whatever args were passed via 'compile-args' or 'verilate_args'. Note these will
|
|
468
470
|
# take precedence over the --optimize arg.
|
|
469
471
|
pass
|
|
@@ -472,8 +474,15 @@ class VerilatorSim(CommandSim, ToolVerilator):
|
|
|
472
474
|
# (slower compile, better runtime)
|
|
473
475
|
verilate_args += '-CFLAGS', '-O3'
|
|
474
476
|
else:
|
|
477
|
+
# Default to -O1:
|
|
475
478
|
verilate_args += '-CFLAGS', '-O1'
|
|
476
479
|
|
|
480
|
+
# If there was no -j setting, then use max(2, $(nproc) - 1)
|
|
481
|
+
if not dash_j_arg_indices:
|
|
482
|
+
nproc = max(2, multiprocessing.cpu_count() - 1)
|
|
483
|
+
verilate_args += '-j', f'{nproc}'
|
|
484
|
+
|
|
485
|
+
|
|
477
486
|
return verilate_args
|
|
478
487
|
|
|
479
488
|
|
|
@@ -18,6 +18,7 @@ from enum import Enum
|
|
|
18
18
|
from pathlib import Path
|
|
19
19
|
from importlib import import_module
|
|
20
20
|
from dotenv import load_dotenv
|
|
21
|
+
from supports_color import supportsColor
|
|
21
22
|
|
|
22
23
|
from opencos.utils import status_constants
|
|
23
24
|
|
|
@@ -29,7 +30,7 @@ dot_f_files_expanded = set() # pylint: disable=invalid-name
|
|
|
29
30
|
env_files_loaded = set() # pylint: disable=invalid-name
|
|
30
31
|
|
|
31
32
|
args = { # pylint: disable=invalid-name
|
|
32
|
-
'color' :
|
|
33
|
+
'color' : bool(supportsColor.stdout),
|
|
33
34
|
'quiet' : False,
|
|
34
35
|
'verbose' : False,
|
|
35
36
|
'debug' : False,
|
|
@@ -351,13 +352,14 @@ def get_argparser() -> argparse.ArgumentParser:
|
|
|
351
352
|
bool_action_kwargs = get_argparse_bool_action_kwargs()
|
|
352
353
|
|
|
353
354
|
parser.add_argument('--version', default=False, action='store_true')
|
|
354
|
-
parser.add_argument('--color', **bool_action_kwargs, default=
|
|
355
|
+
parser.add_argument('--color', **bool_action_kwargs, default=bool(supportsColor.stdout),
|
|
355
356
|
help='Use shell colors for info/warning/error messaging')
|
|
356
|
-
parser.add_argument('--quiet', **bool_action_kwargs,
|
|
357
|
-
|
|
357
|
+
parser.add_argument('--quiet', **bool_action_kwargs, default=args['quiet'],
|
|
358
|
+
help='Do not display info messaging')
|
|
359
|
+
parser.add_argument('--verbose', **bool_action_kwargs, default=args['verbose'],
|
|
358
360
|
help='Display additional messaging level 2 or higher')
|
|
359
|
-
parser.add_argument('--fancy', **bool_action_kwargs)
|
|
360
|
-
parser.add_argument('--debug', **bool_action_kwargs,
|
|
361
|
+
parser.add_argument('--fancy', **bool_action_kwargs, default=args['fancy'])
|
|
362
|
+
parser.add_argument('--debug', **bool_action_kwargs, default=args['debug'],
|
|
361
363
|
help='Display additional debug messaging level 1 or higher')
|
|
362
364
|
parser.add_argument('--debug-level', type=int, default=0,
|
|
363
365
|
help='Set debug level messaging (default: 0)')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: opencos-eda
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
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
|
|
@@ -17,4 +17,5 @@ Requires-Dist: toml>=0.10.2
|
|
|
17
17
|
Requires-Dist: yamllint>=1.35.1
|
|
18
18
|
Requires-Dist: PySerial>=3.5
|
|
19
19
|
Requires-Dist: cocotb>=2.0
|
|
20
|
+
Requires-Dist: supports_color>=0.2.0
|
|
20
21
|
Dynamic: license-file
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[project]
|
|
4
4
|
name = "opencos-eda"
|
|
5
|
-
version = "0.3.
|
|
5
|
+
version = "0.3.3"
|
|
6
6
|
dependencies = [
|
|
7
7
|
# opencos/eda.py dependencies
|
|
8
8
|
"mergedeep >= 1.3.4",
|
|
@@ -16,6 +16,7 @@ dependencies = [
|
|
|
16
16
|
# opencos/oc_cli.py dependencies
|
|
17
17
|
"PySerial >= 3.5",
|
|
18
18
|
"cocotb >= 2.0",
|
|
19
|
+
"supports_color >= 0.2.0",
|
|
19
20
|
]
|
|
20
21
|
requires-python = ">= 3.8"
|
|
21
22
|
authors = [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|