# Setup script for salmawaleed055/dd2-project1-g5-cell-finder on Windows (PowerShell), from https://gitmanual.com/salmawaleed055/dd2-project1-g5-cell-finder # Read it before you run it: the commands come from the repo's own README and files. # Run: powershell -ExecutionPolicy Bypass -File .\setup.ps1 $ErrorActionPreference = "Stop" function Write-Step($t) { Write-Host "`n==> $t" -ForegroundColor Cyan } # Windows ships a python that only opens the Microsoft Store; it doesn't count. function Have($c) { $cmd = Get-Command $c -ErrorAction SilentlyContinue; [bool]$cmd -and $cmd.Source -notlike '*\WindowsApps\*' } # New installs change PATH; pick it up without opening a new window. function Update-Path { $env:Path = [Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [Environment]::GetEnvironmentVariable("Path", "User") } # Stop when a program fails, like bash's set -e. Dot-sourced, so cd and venv activation carry on to the next step. function Invoke-Step([scriptblock]$Block) { $global:LASTEXITCODE = 0; . $Block; if ($LASTEXITCODE) { throw "Failed with exit code $LASTEXITCODE" } } Write-Step '1/3 Clone the repository' if (-not (Test-Path 'dd2-project1-g5-cell-finder')) { Invoke-Step { git clone https://github.com/salmawaleed055/dd2-project1-g5-cell-finder.git } } Set-Location 'dd2-project1-g5-cell-finder' Write-Step '2/3 Install the required tools' # make # or use WSL if (-not (Have 'make')) { Invoke-Step { winget install GnuWin32.Make -e --accept-source-agreements --accept-package-agreements }; Update-Path } Write-Step '3/3 Follow the README: 2. Quick start' # In the maintainers' order. Do the README instructions above first — they cover steps outside the terminal. # (needs Git Bash or WSL on Windows) export PDK_ROOT=~/.ciel # where ciel installed sky130A # < 1 min: links given/ (student pack) and pdk/ (PDK_ROOT/sky130A) Invoke-Step { make setup } # < 1 min: Yosys, ABC, Icarus, OpenSTA, the PDK files, the two given libraries Invoke-Step { make check } # < 1 min: unit tests, Table 4 self-test, and every broken case Invoke-Step { make test } # ~ 13 min: the whole flow, steps 1 to 12 of handout section 4 Invoke-Step { make all } # ~ 1 min: the whole flow on one design (interview demo) Invoke-Step { make demo IN= } Write-Host 'Set up salmawaleed055/dd2-project1-g5-cell-finder.' Write-Host 'Manual: https://gitmanual.com/salmawaleed055/dd2-project1-g5-cell-finder'