activate_verification_toolchain.ps1 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Activate the local PID verification toolchain for the current PowerShell session only.
  2. # This script does not modify the system PATH, registry, user profile, or repository.
  3. $ToolchainBase = Join-Path $HOME "CodexToolchains\CPLD"
  4. $ToolchainRoot = Join-Path $ToolchainBase "oss-cad-suite\latest"
  5. $CocotbPython = Join-Path $ToolchainBase "venvs\pid-study-cocotb-venv\Scripts\python.exe"
  6. $ToolchainBin = Join-Path $ToolchainRoot "bin"
  7. $ToolchainLib = Join-Path $ToolchainRoot "lib"
  8. $VerilatorRoot = Join-Path $ToolchainRoot "share\verilator"
  9. $Smtbmc = Join-Path $ToolchainRoot "bin\yosys-smtbmc.exe.exe"
  10. $env:PID_STUDY_TOOLCHAIN_ROOT = $ToolchainRoot
  11. $env:OSS_CAD_SUITE_ROOT = $ToolchainRoot
  12. $env:PID_STUDY_COCOTB_PYTHON = $CocotbPython
  13. if (Test-Path -LiteralPath $VerilatorRoot) {
  14. $env:VERILATOR_ROOT = $VerilatorRoot
  15. }
  16. if (Test-Path -LiteralPath $Smtbmc) {
  17. $env:SMTBMC = $Smtbmc
  18. }
  19. if (Test-Path -LiteralPath $ToolchainBin) {
  20. $pathParts = $env:PATH -split ";"
  21. if ($pathParts -notcontains $ToolchainBin) {
  22. $env:PATH = "$ToolchainBin;$env:PATH"
  23. }
  24. }
  25. if (Test-Path -LiteralPath $ToolchainLib) {
  26. $pathParts = $env:PATH -split ";"
  27. if ($pathParts -notcontains $ToolchainLib) {
  28. $env:PATH = "$ToolchainLib;$env:PATH"
  29. }
  30. }
  31. Write-Host "PID verification toolchain variables set for current PowerShell session."
  32. Write-Host "PID_STUDY_TOOLCHAIN_ROOT=$env:PID_STUDY_TOOLCHAIN_ROOT"
  33. Write-Host "PID_STUDY_COCOTB_PYTHON=$env:PID_STUDY_COCOTB_PYTHON"