opencos-eda 0.2.45__tar.gz → 0.2.46__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.
Files changed (84) hide show
  1. {opencos_eda-0.2.45/opencos_eda.egg-info → opencos_eda-0.2.46}/PKG-INFO +1 -1
  2. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/deps_helpers.py +15 -12
  3. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/deps_schema.py +3 -0
  4. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/eda_base.py +28 -13
  5. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/eda_config_defaults.yml +1 -0
  6. {opencos_eda-0.2.45 → opencos_eda-0.2.46/opencos_eda.egg-info}/PKG-INFO +1 -1
  7. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/pyproject.toml +1 -1
  8. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/LICENSE +0 -0
  9. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/LICENSE.spdx +0 -0
  10. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/README.md +0 -0
  11. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/__init__.py +0 -0
  12. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/_version.py +0 -0
  13. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/_waves_pkg.sv +0 -0
  14. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/__init__.py +0 -0
  15. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/build.py +0 -0
  16. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/elab.py +0 -0
  17. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/export.py +0 -0
  18. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/flist.py +0 -0
  19. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/lec.py +0 -0
  20. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/multi.py +0 -0
  21. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/open.py +0 -0
  22. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/proj.py +0 -0
  23. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/shell.py +0 -0
  24. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/sim.py +0 -0
  25. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/sweep.py +0 -0
  26. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/synth.py +0 -0
  27. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/targets.py +0 -0
  28. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/upload.py +0 -0
  29. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/commands/waves.py +0 -0
  30. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/eda.py +0 -0
  31. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/eda_config.py +0 -0
  32. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/eda_config_max_verilator_waivers.yml +0 -0
  33. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/eda_config_reduced.yml +0 -0
  34. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/eda_deps_bash_completion.bash +0 -0
  35. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/eda_extract_targets.py +0 -0
  36. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/eda_tool_helper.py +0 -0
  37. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/export_helper.py +0 -0
  38. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/export_json_convert.py +0 -0
  39. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/files.py +0 -0
  40. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/names.py +0 -0
  41. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/oc_cli.py +0 -0
  42. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/pcie.py +0 -0
  43. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/peakrdl_cleanup.py +0 -0
  44. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/seed.py +0 -0
  45. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/__init__.py +0 -0
  46. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/custom_config.yml +0 -0
  47. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/deps_files/command_order/DEPS.yml +0 -0
  48. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/deps_files/error_msgs/DEPS.yml +0 -0
  49. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/deps_files/iverilog_test/DEPS.yml +0 -0
  50. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/deps_files/no_deps_here/DEPS.yml +0 -0
  51. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/deps_files/non_sv_reqs/DEPS.yml +0 -0
  52. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/deps_files/tags_with_tools/DEPS.yml +0 -0
  53. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/deps_files/test_err_fatal/DEPS.yml +0 -0
  54. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/helpers.py +0 -0
  55. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/test_build.py +0 -0
  56. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/test_deps_helpers.py +0 -0
  57. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/test_deps_schema.py +0 -0
  58. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/test_eda.py +0 -0
  59. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/test_eda_elab.py +0 -0
  60. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/test_eda_synth.py +0 -0
  61. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/test_oc_cli.py +0 -0
  62. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tests/test_tools.py +0 -0
  63. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/__init__.py +0 -0
  64. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/invio.py +0 -0
  65. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/invio_helpers.py +0 -0
  66. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/invio_yosys.py +0 -0
  67. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/iverilog.py +0 -0
  68. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/modelsim_ase.py +0 -0
  69. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/questa.py +0 -0
  70. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/riviera.py +0 -0
  71. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/slang.py +0 -0
  72. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/slang_yosys.py +0 -0
  73. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/surelog.py +0 -0
  74. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/tabbycad_yosys.py +0 -0
  75. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/verilator.py +0 -0
  76. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/vivado.py +0 -0
  77. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/tools/yosys.py +0 -0
  78. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos/util.py +0 -0
  79. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos_eda.egg-info/SOURCES.txt +0 -0
  80. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos_eda.egg-info/dependency_links.txt +0 -0
  81. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos_eda.egg-info/entry_points.txt +0 -0
  82. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos_eda.egg-info/requires.txt +0 -0
  83. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/opencos_eda.egg-info/top_level.txt +0 -0
  84. {opencos_eda-0.2.45 → opencos_eda-0.2.46}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opencos-eda
3
- Version: 0.2.45
3
+ Version: 0.2.46
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
@@ -68,6 +68,7 @@ class Defaults:
68
68
  'shell',
69
69
  'work-dir-add-srcs', 'work-dir-add-sources',
70
70
  'peakrdl',
71
+ 'run-from-work-dir',
71
72
  'var-subst-args',
72
73
  'var-subst-os-env',
73
74
  'tee',
@@ -387,20 +388,20 @@ def path_substitutions_relative_to_work_dir(exec_list : list, info_str : str, ta
387
388
 
388
389
  # Look for path substitutions, b/c we later "work" in self.args['work-dir'], but
389
390
  # files should be relative to our target_path.
390
- for iter,word in enumerate(exec_list):
391
+ for i,word in enumerate(exec_list):
391
392
  m = re.search(r'(\.+\/+[^"\;\:\|\<\>\*]*)$', word)
392
393
  if m:
393
394
  # ./, ../, file=./../whatever It might be a filepath.
394
395
  # [^"\;\:\|\<\>\*] is looking for non-path like characters, so we dont' have a trailing
395
396
  # " : ; < > |
396
- # try and see if this file exists. Note that files in the self.args['work-dir'] don't
397
+ # try and see if this file or dir exists. Note that files in the self.args['work-dir'] don't
397
398
  # need this, and we can't assume dir levels in the work-dir.
398
399
  try:
399
400
  try_path = os.path.abspath(os.path.join(os.path.abspath(target_path), m.group(1)))
400
- if os.path.isfile(try_path):
401
+ if os.path.isfile(try_path) or os.path.isdir(try_path):
401
402
  # make the substitution
402
- exec_list[iter] = word.replace(m.group(1), try_path)
403
- debug(f'path substitution {info_str=} {target_path=}: replaced - {word=} is now ={exec_list[iter]}')
403
+ exec_list[i] = word.replace(m.group(1), try_path)
404
+ debug(f'path substitution {info_str=} {target_path=}: replaced - {word=} is now ={exec_list[i]}')
404
405
  except:
405
406
  pass
406
407
 
@@ -1064,6 +1065,7 @@ def parse_deps_shell_str(line : str, target_path : str, target_node : str, enabl
1064
1065
 
1065
1066
  d = {'target_path': os.path.abspath(target_path),
1066
1067
  'target_node': target_node,
1068
+ 'run_from_work_dir': True,
1067
1069
  'exec_list': exec_list,
1068
1070
  }
1069
1071
  return d
@@ -1137,12 +1139,12 @@ def parse_deps_peakrdl(line : str, target_path : str, target_node : str, enable
1137
1139
 
1138
1140
  sv_files = list()
1139
1141
  top = ''
1140
- for iter,str_value in enumerate(args_list):
1142
+ for i,str_value in enumerate(args_list):
1141
1143
  if '--top=' in str_value:
1142
1144
  _, top = str_value.split('=')
1143
1145
  elif '--top' in str_value:
1144
- if iter + 1 < len(args_list):
1145
- top = args_list[iter + 1]
1146
+ if i + 1 < len(args_list):
1147
+ top = args_list[i + 1]
1146
1148
 
1147
1149
  for str_item in args_list:
1148
1150
  if str_item[-4:] == '.rdl':
@@ -1235,14 +1237,14 @@ def deps_commands_handler(config: dict, eda_args: dict,
1235
1237
  var_subst_dict = eda_args
1236
1238
 
1237
1239
  tee_fpath = command.get('tee', None)
1240
+ run_from_work_dir = command.get('run-from-work-dir', True) # for shell, default True
1238
1241
 
1239
1242
  for key,item in command.items():
1240
1243
 
1241
1244
  # skip the var-subst-* keys, since these types are bools
1242
- if key.startswith('var-subst'):
1243
- continue
1244
-
1245
- if key.startswith('tee'):
1245
+ if key.startswith('var-subst') or \
1246
+ key.startswith('tee') or \
1247
+ key.startswith('run-from-work-dir'):
1246
1248
  continue
1247
1249
 
1248
1250
  # Optional variable substituion in commands
@@ -1262,6 +1264,7 @@ def deps_commands_handler(config: dict, eda_args: dict,
1262
1264
  # list item in ret_dict['exec_list'], and make it a util.ShellCommandList.
1263
1265
  if tee_fpath:
1264
1266
  ret_dict['exec_list'] = ShellCommandList(ret_dict['exec_list'], tee_fpath=tee_fpath)
1267
+ ret_dict['run_from_work_dir'] = run_from_work_dir
1265
1268
  assert ret_dict, f'shell command failed in {dep=} {target_node=} in {deps_file=}'
1266
1269
  shell_commands_list.append(ret_dict) # process this later, append to our to-be-returned tuple
1267
1270
 
@@ -69,6 +69,8 @@ my_target_name:
69
69
  - shell: <---- string for shell command to be run
70
70
  var-subst-args: <---- bool, perform var substitution using args
71
71
  var-subst-os-env: <---- bool, perform var substitution using os.environ
72
+ run-from-work-dir: <---- bool, default True, if False runs from target dir
73
+ instead of work-dir.
72
74
  tee: <---- string, filename to write logs to
73
75
  - work-dir-add-sources: <---- work-dir-add-sources, optional list (or string)
74
76
  - some_file_gen_from_sh.sv <---- string filename that we created with sh command
@@ -150,6 +152,7 @@ DEPS_COMMANDS_LIST = [
150
152
  Optional('shell'): str,
151
153
  Optional('var-subst-args'): bool,
152
154
  Optional('var-subst-os-env'): bool,
155
+ Optional('run-from-work-dir'): bool,
153
156
  Optional('tee'): Or(str, type(None)),
154
157
  },
155
158
  {
@@ -716,8 +716,9 @@ class CommandDesign(Command):
716
716
 
717
717
  log_fnames_count = {} # count per target_node.
718
718
 
719
- for iter, d in enumerate(self.dep_shell_commands):
719
+ for i, d in enumerate(self.dep_shell_commands):
720
720
  clist = util.ShellCommandList(d['exec_list'])
721
+ run_from_work_dir = d['run_from_work_dir'] # default True
721
722
  log = clist.tee_fpath
722
723
  target_node = d["target_node"]
723
724
  if clist.tee_fpath is None:
@@ -729,24 +730,38 @@ class CommandDesign(Command):
729
730
  all_cmds_lists += [
730
731
  [], # blank line
731
732
  # comment, where it came from, log to {node}__shell_{lognum}.log (or tee name from DEPS.yml)
732
- [f'# command {iter}: target: {d["target_path"]} : {target_node} --> {log}'],
733
- # actual command (list or util.ShellCommandList)
734
- clist,
733
+ [f'# command {i}: target: {d["target_path"]} : {target_node} --> {log}'],
735
734
  ]
735
+ if not run_from_work_dir:
736
+ all_cmds_lists.append([f'cd {d["target_path"]}'])
737
+
738
+ # actual command (list or util.ShellCommandList)
739
+ all_cmds_lists.append(clist)
740
+
741
+ if not run_from_work_dir:
742
+ all_cmds_lists.append([f'cd {os.path.abspath(self.args["work-dir"])}'])
743
+
736
744
  d['exec_list'] = clist # update to tee_fpath is set.
737
745
 
738
746
  util.write_shell_command_file(dirpath=self.args['work-dir'], filename='pre_compile_dep_shell_commands.sh',
739
747
  command_lists=all_cmds_lists)
740
748
 
741
- for iter,d in enumerate(self.dep_shell_commands):
742
- util.info(f'run_dep_shell_commands {iter=}: {d=}')
749
+ for i,d in enumerate(self.dep_shell_commands):
750
+ util.info(f'run_dep_shell_commands {i=}: {d=}')
743
751
  clist = util.ShellCommandList(d['exec_list'])
752
+ tee_fpath=clist.tee_fpath
753
+ if d['run_from_work_dir']:
754
+ run_from_dir = self.args['work-dir']
755
+ else:
756
+ # Run from the target's directory (not the `eda` caller $PWD)
757
+ run_from_dir = d["target_path"]
758
+ tee_fpath = os.path.abspath(os.path.join(self.args['work-dir'], tee_fpath))
744
759
  # NOTE(drew): shell=True subprocess call, can disable with self.config
745
760
  if sys.platform.startswith('win'):
746
761
  # for Windows, we run shell=True otherwise most built-in cmd.exe calls won't work.
747
- self.exec(self.args['work-dir'], clist, tee_fpath=clist.tee_fpath, shell=True)
762
+ self.exec(run_from_dir, clist, tee_fpath=tee_fpath, shell=True)
748
763
  else:
749
- self.exec(self.args['work-dir'], clist, tee_fpath=clist.tee_fpath,
764
+ self.exec(run_from_dir, clist, tee_fpath=tee_fpath,
750
765
  shell=self.config.get('deps_subprocess_shell', False))
751
766
 
752
767
  def update_file_lists_for_work_dir(self):
@@ -766,10 +781,10 @@ class CommandDesign(Command):
766
781
  my_file_lists_list = [self.files_v, self.files_sv, self.files_vhd, self.files_cpp,
767
782
  self.files_sdc]
768
783
  for my_file_list in my_file_lists_list:
769
- for iter,value in enumerate(my_file_list):
784
+ for i,value in enumerate(my_file_list):
770
785
  if value and type(value) is str and value.startswith(self._work_dir_add_srcs_path_string):
771
786
  new_value = os.path.join(work_dir_abspath, value[_work_dir_add_srcs_path_string_len :])
772
- my_file_list[iter] = new_value
787
+ my_file_list[i] = new_value
773
788
  util.debug(f"file lists: replaced {value} with {new_value}")
774
789
 
775
790
  def update_non_source_files_in_work_dir(self):
@@ -1575,10 +1590,10 @@ class CommandParallel(Command):
1575
1590
  else:
1576
1591
  util.info(f"Parallel: <No jobs found>")
1577
1592
  # Make sure all jobs have a set status:
1578
- for iter,rc in enumerate(self.jobs_status):
1593
+ for i,rc in enumerate(self.jobs_status):
1579
1594
  if rc is None or type(rc) != int:
1580
- self.error(f'job {iter=} {rc=} did not return a proper return code')
1581
- jobs_status[iter] = 1
1595
+ self.error(f'job {i=} {rc=} did not return a proper return code')
1596
+ jobs_status[i] = 1
1582
1597
 
1583
1598
  # if self.status > 0, then keep it non-zero, else set it if we still have running jobs.
1584
1599
  if self.status == 0:
@@ -62,6 +62,7 @@ file_extensions:
62
62
  - .vhdl
63
63
  cpp:
64
64
  - .cpp
65
+ - .cc
65
66
  synth_constraints:
66
67
  - .sdc
67
68
  - .xdc
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opencos-eda
3
- Version: 0.2.45
3
+ Version: 0.2.46
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  [project]
4
4
  name = "opencos-eda"
5
- version = "0.2.45"
5
+ version = "0.2.46"
6
6
  dependencies = [
7
7
  # opencos/eda.py dependencies
8
8
  "mergedeep >= 1.3.4",
File without changes
File without changes
File without changes
File without changes