chipfoundry-cli 1.3.0__tar.gz → 1.4.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chipfoundry-cli
3
- Version: 1.3.0
3
+ Version: 1.4.0
4
4
  Summary: CLI tool to automate ChipFoundry project submission to SFTP server
5
5
  Home-page: https://chipfoundry.io
6
6
  License: Apache-2.0
@@ -1915,6 +1915,19 @@ def setup(project_root, repo_owner, repo_name, branch, pdk, caravel_lite,
1915
1915
  # Check if project is initialized (allow dry-run to proceed)
1916
1916
  check_project_initialized(project_root_path, 'setup', dry_run=dry_run)
1917
1917
 
1918
+ # Read project type from project.json
1919
+ project_json_path = project_root_path / '.cf' / 'project.json'
1920
+ project_type = 'digital' # default
1921
+ if project_json_path.exists():
1922
+ try:
1923
+ with open(project_json_path, 'r') as f:
1924
+ project_data = json.load(f)
1925
+ project_type = project_data.get('project', {}).get('type', 'digital')
1926
+ except (json.JSONDecodeError, IOError):
1927
+ pass # Use default if we can't read it
1928
+
1929
+ is_openframe = project_type == 'openframe'
1930
+
1918
1931
  had_errors = False
1919
1932
 
1920
1933
  def _error_text(err):
@@ -1943,7 +1956,8 @@ def setup(project_root, repo_owner, repo_name, branch, pdk, caravel_lite,
1943
1956
  # If in "only" mode, only install what's specified
1944
1957
  # If not in "only" mode, install everything
1945
1958
  install_caravel = only_caravel or not only_mode
1946
- install_mcw = only_mcw or not only_mode
1959
+ # MCW is not used for openframe projects
1960
+ install_mcw = (only_mcw or not only_mode) and not is_openframe
1947
1961
  install_openlane = only_openlane or not only_mode
1948
1962
  install_pdk = only_pdk or not only_mode
1949
1963
  install_timing = only_timing or not only_mode
@@ -1956,9 +1970,13 @@ def setup(project_root, repo_owner, repo_name, branch, pdk, caravel_lite,
1956
1970
  f"Project directory: [yellow]{project_root}[/yellow]",
1957
1971
  f"Repository: [yellow]{repo_owner}/{repo_name}@{branch}[/yellow]",
1958
1972
  f"PDK: [yellow]{pdk}[/yellow]",
1973
+ f"Project type: [yellow]{project_type}[/yellow]",
1959
1974
  f"Caravel variant: [yellow]{'caravel-lite' if caravel_lite else 'caravel'}[/yellow]",
1960
1975
  ]
1961
1976
 
1977
+ if is_openframe:
1978
+ config_lines.append("[dim]MCW not needed for openframe projects[/dim]")
1979
+
1962
1980
  if only_mode:
1963
1981
  installing = []
1964
1982
  if only_caravel: installing.append("caravel")
@@ -2057,7 +2075,11 @@ def setup(project_root, repo_owner, repo_name, branch, pdk, caravel_lite,
2057
2075
  console.print(f"[dim]{e.stderr}[/dim]")
2058
2076
 
2059
2077
  # Step 3: Install Management Core Wrapper
2060
- if install_mcw:
2078
+ # Show message if user explicitly requested MCW but project is openframe
2079
+ if only_mcw and is_openframe:
2080
+ console.print("\n[bold]Step 3:[/bold] Installing Management Core Wrapper...")
2081
+ console.print("[yellow]⚠[/yellow] MCW is not used for openframe projects, skipping...")
2082
+ elif install_mcw:
2061
2083
  console.print("\n[bold]Step 3:[/bold] Installing Management Core Wrapper...")
2062
2084
  mcw_dir = project_root_path / 'mgmt_core_wrapper'
2063
2085
 
@@ -3084,7 +3106,7 @@ def precheck(project_root, disable_lvs, checks, dry_run):
3084
3106
  @click.option('--sim', type=click.Choice(['rtl', 'gl'], case_sensitive=False), default='rtl', help='Simulation type: rtl or gl (gate-level)')
3085
3107
  @click.option('--list', 'list_tests', is_flag=True, help='List all available cocotb tests')
3086
3108
  @click.option('--all', 'run_all', is_flag=True, help='Run all tests')
3087
- @click.option('--tag', help='Test list tag/yaml file (e.g., user_proj_tests)')
3109
+ @click.option('--tag', help='Test list tag/yaml file (e.g., all_tests or user_proj_tests)')
3088
3110
  @click.option('--dry-run', is_flag=True, help='Show the configuration without running')
3089
3111
  def verify(test, project_root, sim, list_tests, run_all, tag, dry_run):
3090
3112
  """Run cocotb verification tests.
@@ -3094,7 +3116,7 @@ def verify(test, project_root, sim, list_tests, run_all, tag, dry_run):
3094
3116
  cf verify counter_la # Run a specific test (RTL)
3095
3117
  cf verify counter_la --sim gl # Run gate-level simulation
3096
3118
  cf verify --all # Run all tests
3097
- cf verify --tag user_proj_tests # Run tests from a yaml list
3119
+ cf verify --tag all_tests # Run tests from a yaml list
3098
3120
  """
3099
3121
  # If .cf/project.json exists in cwd, use it as default project_root
3100
3122
  cwd_root, _ = get_project_json_from_cwd()
@@ -3114,13 +3136,13 @@ def verify(test, project_root, sim, list_tests, run_all, tag, dry_run):
3114
3136
 
3115
3137
  project_json_path = project_root_path / '.cf' / 'project.json'
3116
3138
 
3139
+ # Get project type (needed for openframe flag)
3140
+ with open(project_json_path, 'r') as f:
3141
+ project_data = json.load(f)
3142
+ project_type = project_data.get('project', {}).get('type', 'digital')
3143
+
3117
3144
  # Check if GPIO configuration exists (skip check if just listing tests or openframe)
3118
3145
  if not list_tests:
3119
- # Check project type - GPIO config not needed for openframe
3120
- with open(project_json_path, 'r') as f:
3121
- project_data = json.load(f)
3122
- project_type = project_data.get('project', {}).get('type', 'digital')
3123
-
3124
3146
  if project_type != 'openframe':
3125
3147
  gpio_config = get_gpio_config_from_project_json(str(project_json_path))
3126
3148
  if not gpio_config or len(gpio_config) == 0:
@@ -3221,13 +3243,19 @@ def verify(test, project_root, sim, list_tests, run_all, tag, dry_run):
3221
3243
 
3222
3244
  if dry_run:
3223
3245
  console.print("[bold yellow]Dry run - configuration ready[/bold yellow]\n")
3246
+ openframe_flag = " --openframe" if project_type == 'openframe' else ""
3224
3247
  if test:
3225
- console.print(f"Would run: {caravel_cocotb_bin} -t {test} -sim {sim_arg}")
3248
+ console.print(f"Would run: {caravel_cocotb_bin} -t {test} -sim {sim_arg}{openframe_flag}")
3226
3249
  elif run_all:
3227
- yaml_file = 'user_proj_tests_gl.yaml' if sim.lower() == 'gl' else 'user_proj_tests.yaml'
3228
- console.print(f"Would run: {caravel_cocotb_bin} -tl user_proj_tests/{yaml_file} -sim {sim_arg}")
3250
+ all_tests_yaml = cocotb_dir / ('all_tests_gl.yaml' if sim.lower() == 'gl' else 'all_tests.yaml')
3251
+ if all_tests_yaml.exists():
3252
+ yaml_path = all_tests_yaml.name
3253
+ else:
3254
+ yaml_file = 'user_proj_tests_gl.yaml' if sim.lower() == 'gl' else 'user_proj_tests.yaml'
3255
+ yaml_path = f'user_proj_tests/{yaml_file}'
3256
+ console.print(f"Would run: {caravel_cocotb_bin} -tl {yaml_path} -sim {sim_arg}{openframe_flag}")
3229
3257
  elif tag:
3230
- console.print(f"Would run: {caravel_cocotb_bin} -tl {tag} -sim {sim_arg}")
3258
+ console.print(f"Would run: {caravel_cocotb_bin} -tl {tag} -sim {sim_arg}{openframe_flag}")
3231
3259
  return
3232
3260
 
3233
3261
  # Prepare environment
@@ -3244,9 +3272,14 @@ def verify(test, project_root, sim, list_tests, run_all, tag, dry_run):
3244
3272
  if test:
3245
3273
  cmd.extend(['-t', test])
3246
3274
  elif run_all:
3247
- # Use the appropriate test list yaml
3248
- yaml_file = 'user_proj_tests_gl.yaml' if sim.lower() == 'gl' else 'user_proj_tests.yaml'
3249
- yaml_path = f'user_proj_tests/{yaml_file}'
3275
+ # Look for test list yaml - prefer all_tests.yaml, fall back to user_proj_tests/
3276
+ all_tests_yaml = cocotb_dir / ('all_tests_gl.yaml' if sim.lower() == 'gl' else 'all_tests.yaml')
3277
+ if all_tests_yaml.exists():
3278
+ yaml_path = all_tests_yaml.name
3279
+ else:
3280
+ # Fall back to legacy user_proj_tests directory
3281
+ yaml_file = 'user_proj_tests_gl.yaml' if sim.lower() == 'gl' else 'user_proj_tests.yaml'
3282
+ yaml_path = f'user_proj_tests/{yaml_file}'
3250
3283
  cmd.extend(['-tl', yaml_path])
3251
3284
  elif tag:
3252
3285
  # User specified a custom test list
@@ -3270,6 +3303,13 @@ def verify(test, project_root, sim, list_tests, run_all, tag, dry_run):
3270
3303
  if sim.lower() == 'gl':
3271
3304
  cmd.extend(['-sim', 'GL'])
3272
3305
 
3306
+ # Add openframe flag for openframe projects
3307
+ if project_type == 'openframe':
3308
+ cmd.append('--openframe')
3309
+
3310
+ # Add CI flag to disable Docker interactive mode (required when not running in a terminal)
3311
+ cmd.append('--CI')
3312
+
3273
3313
  # Run cocotb tests
3274
3314
  console.print(f"[cyan]Running cocotb verification...[/cyan]")
3275
3315
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "chipfoundry-cli"
3
- version = "1.3.0"
3
+ version = "1.4.0"
4
4
  description = "CLI tool to automate ChipFoundry project submission to SFTP server"
5
5
  authors = ["ChipFoundry <marwan.abbas@chipfoundry.io>"]
6
6
  readme = "README.md"
File without changes