opencos-eda 0.3.9__py3-none-any.whl → 0.3.11__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 (74) hide show
  1. opencos/commands/deps_help.py +89 -120
  2. opencos/commands/export.py +7 -2
  3. opencos/commands/multi.py +3 -3
  4. opencos/commands/sim.py +14 -16
  5. opencos/commands/synth.py +1 -2
  6. opencos/commands/upload.py +192 -4
  7. opencos/commands/waves.py +8 -8
  8. opencos/deps/deps_commands.py +6 -6
  9. opencos/deps/deps_file.py +82 -79
  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 +175 -41
  24. opencos/eda_base.py +180 -50
  25. opencos/eda_config.py +62 -16
  26. opencos/eda_config_defaults.yml +21 -4
  27. opencos/eda_deps_bash_completion.bash +37 -15
  28. opencos/files.py +26 -1
  29. opencos/tools/cocotb.py +5 -5
  30. opencos/tools/invio.py +2 -2
  31. opencos/tools/invio_yosys.py +2 -1
  32. opencos/tools/iverilog.py +3 -3
  33. opencos/tools/quartus.py +113 -115
  34. opencos/tools/questa_common.py +3 -4
  35. opencos/tools/riviera.py +3 -3
  36. opencos/tools/slang.py +11 -7
  37. opencos/tools/slang_yosys.py +1 -0
  38. opencos/tools/surelog.py +4 -3
  39. opencos/tools/verilator.py +5 -4
  40. opencos/tools/vivado.py +307 -176
  41. opencos/tools/yosys.py +4 -4
  42. opencos/util.py +6 -3
  43. opencos/utils/dict_helpers.py +31 -0
  44. opencos/utils/markup_helpers.py +2 -2
  45. opencos/utils/str_helpers.py +7 -0
  46. opencos/utils/subprocess_helpers.py +3 -3
  47. opencos/utils/vscode_helper.py +2 -2
  48. opencos/utils/vsim_helper.py +58 -22
  49. {opencos_eda-0.3.9.dist-info → opencos_eda-0.3.11.dist-info}/METADATA +1 -1
  50. opencos_eda-0.3.11.dist-info/RECORD +94 -0
  51. {opencos_eda-0.3.9.dist-info → opencos_eda-0.3.11.dist-info}/entry_points.txt +1 -0
  52. opencos/tests/__init__.py +0 -0
  53. opencos/tests/custom_config.yml +0 -13
  54. opencos/tests/deps_files/command_order/DEPS.yml +0 -44
  55. opencos/tests/deps_files/error_msgs/DEPS.yml +0 -55
  56. opencos/tests/deps_files/iverilog_test/DEPS.yml +0 -4
  57. opencos/tests/deps_files/no_deps_here/DEPS.yml +0 -0
  58. opencos/tests/deps_files/non_sv_reqs/DEPS.yml +0 -50
  59. opencos/tests/deps_files/tags_with_tools/DEPS.yml +0 -54
  60. opencos/tests/deps_files/test_err_fatal/DEPS.yml +0 -4
  61. opencos/tests/helpers.py +0 -354
  62. opencos/tests/test_build.py +0 -12
  63. opencos/tests/test_deps_helpers.py +0 -207
  64. opencos/tests/test_deps_schema.py +0 -30
  65. opencos/tests/test_eda.py +0 -921
  66. opencos/tests/test_eda_elab.py +0 -110
  67. opencos/tests/test_eda_synth.py +0 -150
  68. opencos/tests/test_oc_cli.py +0 -25
  69. opencos/tests/test_tools.py +0 -404
  70. opencos_eda-0.3.9.dist-info/RECORD +0 -99
  71. {opencos_eda-0.3.9.dist-info → opencos_eda-0.3.11.dist-info}/WHEEL +0 -0
  72. {opencos_eda-0.3.9.dist-info → opencos_eda-0.3.11.dist-info}/licenses/LICENSE +0 -0
  73. {opencos_eda-0.3.9.dist-info → opencos_eda-0.3.11.dist-info}/licenses/LICENSE.spdx +0 -0
  74. {opencos_eda-0.3.9.dist-info → opencos_eda-0.3.11.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'],
@@ -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:
@@ -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):
@@ -30,7 +30,8 @@ class ToolVerilator(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
+ # __init__ would have set self.EXE to full path.
34
+ path = safe_shutil_which(self._EXE)
34
35
  if not path:
35
36
  self.error(f'"{self._EXE}" not in path or not installed, see {self._URL})')
36
37
  else:
@@ -39,7 +40,7 @@ class ToolVerilator(Tool):
39
40
 
40
41
  # Let's get the verilator_coverage path from the same place as verilator.
41
42
  if path:
42
- self.verilator_coverage_exe = shutil.which(
43
+ self.verilator_coverage_exe = safe_shutil_which(
43
44
  os.path.join(self.verilator_base_path, 'verilator_coverage')
44
45
  )
45
46
  if not self.verilator_coverage_exe: