From 9a604179149bceccdd13a9eac1995b81a75aff3e Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Mon, 9 Feb 2026 15:11:52 +0200 Subject: [PATCH] added support to build cocotb from source --- chipfoundry_cli/main.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/chipfoundry_cli/main.py b/chipfoundry_cli/main.py index bf4ce48..87273b9 100644 --- a/chipfoundry_cli/main.py +++ b/chipfoundry_cli/main.py @@ -2374,8 +2374,8 @@ def maybe_abort_no_space(err, step_label): console.print(f"\n[bold]Step {step_num}:[/bold] Setting up Cocotb...") venv_cocotb = project_root_path / 'venv-cocotb' - # Check if already installed - is_installed = check_python_package_installed(venv_cocotb, 'caravel-cocotb') + # Check if already installed (package name is caravel_cocotb in pyproject.toml) + is_installed = check_python_package_installed(venv_cocotb, 'caravel_cocotb') if is_installed and not overwrite: console.print("[green]✓[/green] Cocotb already installed") @@ -2402,14 +2402,18 @@ def maybe_abort_no_space(err, step_label): # Determine the python executable path in venv venv_python = str(venv_cocotb / 'bin' / 'python3') - console.print("[cyan]Installing caravel-cocotb...[/cyan]") + console.print("[cyan]Installing caravel-cocotb from source (chipfoundry/caravel-sim-infrastructure)...[/cyan]") subprocess.run( [venv_python, '-m', 'pip', 'install', '--upgrade', '--no-cache-dir', 'pip'], check=True, capture_output=True ) + # Install from GitHub source (workaround: PyPI package is under efabless, we use chipfoundry repo) subprocess.run( - [venv_python, '-m', 'pip', 'install', '--upgrade', '--no-cache-dir', 'caravel-cocotb'], + [ + venv_python, '-m', 'pip', 'install', '--upgrade', '--no-cache-dir', + 'git+https://github.com/chipfoundry/caravel-sim-infrastructure.git@main#subdirectory=cocotb' + ], check=True, capture_output=True )