opencos-eda 0.3.10__py3-none-any.whl → 0.3.12__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 (59) hide show
  1. opencos/commands/deps_help.py +63 -113
  2. opencos/commands/export.py +7 -2
  3. opencos/commands/multi.py +4 -4
  4. opencos/commands/sim.py +14 -15
  5. opencos/commands/sweep.py +1 -1
  6. opencos/commands/synth.py +1 -2
  7. opencos/commands/upload.py +192 -4
  8. opencos/commands/waves.py +52 -8
  9. opencos/deps/deps_commands.py +6 -6
  10. opencos/deps/deps_processor.py +129 -50
  11. opencos/docs/Architecture.md +45 -0
  12. opencos/docs/ConnectingApps.md +29 -0
  13. opencos/docs/DEPS.md +199 -0
  14. opencos/docs/Debug.md +77 -0
  15. opencos/docs/DirectoryStructure.md +22 -0
  16. opencos/docs/Installation.md +117 -0
  17. opencos/docs/OcVivadoTcl.md +63 -0
  18. opencos/docs/OpenQuestions.md +7 -0
  19. opencos/docs/README.md +13 -0
  20. opencos/docs/RtlCodingStyle.md +54 -0
  21. opencos/docs/eda.md +147 -0
  22. opencos/docs/oc_cli.md +135 -0
  23. opencos/eda.py +358 -155
  24. opencos/eda_base.py +187 -60
  25. opencos/eda_config.py +70 -35
  26. opencos/eda_config_defaults.yml +310 -186
  27. opencos/eda_config_reduced.yml +19 -39
  28. opencos/eda_tool_helper.py +190 -21
  29. opencos/files.py +26 -1
  30. opencos/tools/cocotb.py +11 -23
  31. opencos/tools/invio.py +2 -2
  32. opencos/tools/invio_yosys.py +2 -1
  33. opencos/tools/iverilog.py +3 -3
  34. opencos/tools/modelsim_ase.py +1 -1
  35. opencos/tools/quartus.py +172 -137
  36. opencos/tools/questa_common.py +50 -9
  37. opencos/tools/riviera.py +5 -4
  38. opencos/tools/slang.py +14 -10
  39. opencos/tools/slang_yosys.py +1 -0
  40. opencos/tools/surelog.py +7 -6
  41. opencos/tools/verilator.py +9 -7
  42. opencos/tools/vivado.py +315 -180
  43. opencos/tools/yosys.py +5 -5
  44. opencos/util.py +6 -3
  45. opencos/utils/dict_helpers.py +31 -0
  46. opencos/utils/markup_helpers.py +2 -2
  47. opencos/utils/str_helpers.py +38 -0
  48. opencos/utils/subprocess_helpers.py +3 -3
  49. opencos/utils/vscode_helper.py +2 -2
  50. opencos/utils/vsim_helper.py +16 -5
  51. {opencos_eda-0.3.10.dist-info → opencos_eda-0.3.12.dist-info}/METADATA +1 -1
  52. opencos_eda-0.3.12.dist-info/RECORD +93 -0
  53. opencos/eda_config_max_verilator_waivers.yml +0 -39
  54. opencos_eda-0.3.10.dist-info/RECORD +0 -81
  55. {opencos_eda-0.3.10.dist-info → opencos_eda-0.3.12.dist-info}/WHEEL +0 -0
  56. {opencos_eda-0.3.10.dist-info → opencos_eda-0.3.12.dist-info}/entry_points.txt +0 -0
  57. {opencos_eda-0.3.10.dist-info → opencos_eda-0.3.12.dist-info}/licenses/LICENSE +0 -0
  58. {opencos_eda-0.3.10.dist-info → opencos_eda-0.3.12.dist-info}/licenses/LICENSE.spdx +0 -0
  59. {opencos_eda-0.3.10.dist-info → opencos_eda-0.3.12.dist-info}/top_level.txt +0 -0
opencos/tools/slang.py CHANGED
@@ -6,12 +6,12 @@ Contains classes for ToolSlang, CommandElabSlang
6
6
  # pylint: disable=R0801 # (calling functions with same arguments)
7
7
 
8
8
  import os
9
- import shutil
10
9
  import subprocess
11
10
 
12
11
  from opencos import util
13
- from opencos.eda_base import Tool
14
12
  from opencos.commands import CommandElab
13
+ from opencos.eda_base import Tool
14
+ from opencos.files import safe_shutil_which
15
15
  from opencos.utils.str_helpers import sanitize_defines_for_sh
16
16
 
17
17
 
@@ -30,14 +30,18 @@ class ToolSlang(Tool):
30
30
  def get_versions(self) -> str:
31
31
  if self._VERSION:
32
32
  return self._VERSION
33
- path = shutil.which(self._EXE)
33
+ path = safe_shutil_which(self._EXE)
34
34
  if not path:
35
35
  self.error(f'"{self._EXE}" not in path, need to get it ({self._URL}')
36
36
  else:
37
37
  self.slang_exe = path
38
38
  self.slang_base_path, _ = os.path.split(path)
39
- self.slang_tidy_exe = os.path.join(self.slang_base_path, 'slang-tidy')
40
- self.slang_hier_exe = os.path.join(self.slang_base_path, 'slang-hier')
39
+ self.slang_tidy_exe = safe_shutil_which(
40
+ os.path.join(self.slang_base_path, 'slang-tidy')
41
+ )
42
+ self.slang_hier_exe = safe_shutil_which(
43
+ os.path.join(self.slang_base_path, 'slang-hier')
44
+ )
41
45
 
42
46
  version_ret = subprocess.run(
43
47
  [self.slang_exe, '--version'],
@@ -48,13 +52,13 @@ class ToolSlang(Tool):
48
52
  util.debug(f'{path=} {version_ret=}')
49
53
  words = stdout.split() # slang version 8.0.6+b4a74b00
50
54
  if len(words) < 3:
51
- self.error(f'{self.slang_exe} --version: returned unexpected string {version_ret=}')
55
+ util.warning(f'{self.slang_exe} --version: returned unexpected string {version_ret=}')
52
56
  version = words[2]
53
57
  left, _ = version.split('+')
54
58
  ver_list = left.split('.')
55
59
  if len(ver_list) != 3:
56
- self.error(f'{self.slang_exe} --version: returned unexpected string',
57
- f'{version_ret=} {version=}')
60
+ util.warning(f'{self.slang_exe} --version: returned unexpected string',
61
+ f'{version_ret=} {version=}')
58
62
  self._VERSION = left
59
63
  return self._VERSION
60
64
 
@@ -204,7 +208,7 @@ class CommandElabSlang(CommandElab, ToolSlang):
204
208
  command_list = [self.slang_exe]
205
209
 
206
210
  if self.args['tidy']:
207
- if not shutil.which(self.slang_tidy_exe):
211
+ if not safe_shutil_which(self.slang_tidy_exe):
208
212
  util.warning("Running tool slang with --tidy, but 'slang-tidy'",
209
213
  "not in PATH, using 'slang' instead")
210
214
  else:
@@ -213,7 +217,7 @@ class CommandElabSlang(CommandElab, ToolSlang):
213
217
  if self.args['hier']:
214
218
  if self.args['tidy']:
215
219
  util.warning('Running with --tidy and --heir, will attempt to use slang-hier')
216
- elif not shutil.which(self.slang_hier_exe):
220
+ elif not safe_shutil_which(self.slang_hier_exe):
217
221
  util.warning("Running tool slang with --hier, but 'slang-hier'",
218
222
  "not in PATH, using 'slang' instead")
219
223
  else:
@@ -119,6 +119,7 @@ class CommandSynthSlangYosys(CommonSynthYosys, ToolSlangYosys):
119
119
  )
120
120
 
121
121
  # In case --top was not set:
122
+ # TODO(drew): Can we skip this if it was an inferred top???
122
123
  if not any(x.startswith('--top') for x in read_slang_cmd):
123
124
  read_slang_cmd.append(f'--top {self.args["top"]}')
124
125
 
opencos/tools/surelog.py CHANGED
@@ -3,12 +3,13 @@
3
3
  Contains classes for ToolSurelog, CommandElabSurelog
4
4
  '''
5
5
 
6
- import shutil
6
+
7
7
  import subprocess
8
8
 
9
9
  from opencos import util
10
- from opencos.eda_base import Tool
11
10
  from opencos.commands import CommandElab
11
+ from opencos.eda_base import Tool
12
+ from opencos.files import safe_shutil_which
12
13
  from opencos.utils.str_helpers import sanitize_defines_for_sh
13
14
 
14
15
 
@@ -24,7 +25,7 @@ class ToolSurelog(Tool):
24
25
  def get_versions(self) -> str:
25
26
  if self._VERSION:
26
27
  return self._VERSION
27
- path = shutil.which(self._EXE)
28
+ path = safe_shutil_which(self._EXE)
28
29
  if not path:
29
30
  self.error(f'"{self._EXE}" not in path, need to get it ({self._URL})')
30
31
  else:
@@ -37,12 +38,12 @@ class ToolSurelog(Tool):
37
38
  util.debug(f'{path=} {version_ret=}')
38
39
  words = stdout.split() # VERSION: 1.84 (first line)
39
40
  if len(words) < 2:
40
- self.error(f'{self.surelog_exe} --version: returned unexpected string {version_ret=}')
41
+ util.warning(f'{self.surelog_exe} --version: returned unexpected string {version_ret=}')
41
42
  version = words[1]
42
43
  ver_list = version.split('.')
43
44
  if len(ver_list) < 2:
44
- self.error(f'{self.surelog_exe} --version: returned unexpected string',
45
- f'{version_ret=} {version=}')
45
+ util.warning(f'{self.surelog_exe} --version: returned unexpected string',
46
+ f'{version_ret=} {version=}')
46
47
  self._VERSION = version
47
48
  return self._VERSION
48
49
 
@@ -7,13 +7,13 @@ Contains classes for ToolVerilator and VerilatorSim, VerilatorElab.
7
7
 
8
8
  import multiprocessing
9
9
  import os
10
- import shutil
11
10
  import subprocess
12
11
 
13
12
 
14
13
  from opencos import util
15
- from opencos.eda_base import Tool
16
14
  from opencos.commands import CommandSim
15
+ from opencos.eda_base import Tool
16
+ from opencos.files import safe_shutil_which
17
17
  from opencos.utils.str_helpers import sanitize_defines_for_sh
18
18
 
19
19
  class ToolVerilator(Tool):
@@ -31,7 +31,7 @@ class ToolVerilator(Tool):
31
31
  if self._VERSION:
32
32
  return self._VERSION
33
33
  # __init__ would have set self.EXE to full path.
34
- path = shutil.which(self._EXE)
34
+ path = safe_shutil_which(self._EXE)
35
35
  if not path:
36
36
  self.error(f'"{self._EXE}" not in path or not installed, see {self._URL})')
37
37
  else:
@@ -40,7 +40,7 @@ class ToolVerilator(Tool):
40
40
 
41
41
  # Let's get the verilator_coverage path from the same place as verilator.
42
42
  if path:
43
- self.verilator_coverage_exe = shutil.which(
43
+ self.verilator_coverage_exe = safe_shutil_which(
44
44
  os.path.join(self.verilator_base_path, 'verilator_coverage')
45
45
  )
46
46
  if not self.verilator_coverage_exe:
@@ -56,12 +56,14 @@ class ToolVerilator(Tool):
56
56
  util.debug(f'{path=} {version_ret=}')
57
57
  words = stdout.split() # 'Verilator 5.027 devel rev v5.026-92-g403a197e2
58
58
  if len(words) < 1:
59
- self.error(f'{self.verilator_exe} --version: returned unexpected string {version_ret=}')
59
+ util.warning(
60
+ f'{self.verilator_exe} --version: returned unexpected string {version_ret=}'
61
+ )
60
62
  version = words[1]
61
63
  ver_list = version.split('.')
62
64
  if len(ver_list) != 2:
63
- self.error(f'{self.verilator_exe} --version: returned unexpected',
64
- f'string {version_ret=} {version=}')
65
+ util.warning(f'{self.verilator_exe} --version: returned unexpected',
66
+ f'string {version_ret=} {version=}')
65
67
  self._VERSION = version
66
68
  return self._VERSION
67
69