Compare commits

...

14 Commits
dev ... main

Author SHA1 Message Date
Aquiles Viza
13461c39c6 Updated volare commit
All checks were successful
release / build-base (push) Successful in 4m59s
release / build-digital-heavy (push) Successful in 22m27s
release / build-digital-icarus (push) Successful in 22m39s
release / build-digital-ator (push) Successful in 22m42s
release / build-analog-xk (push) Successful in 24m17s
release / build-analog-xm (push) Successful in 25m8s
release / build-analog-heavy (push) Successful in 26m38s
release / build-heavy (push) Successful in 26m37s
release / build-chipathon-tools (push) Successful in 19m37s
2024-01-23 18:44:19 -03:00
Aquiles Viza
6885bf1076 Added wget into base dependencies
All checks were successful
release / build-digital-heavy (push) Successful in 22m41s
release / build-digital-icarus (push) Successful in 22m50s
release / build-analog-xk (push) Successful in 23m29s
release / build-analog-xm (push) Successful in 24m29s
release / build-analog-heavy (push) Successful in 25m20s
release / build-heavy (push) Successful in 25m45s
release / build-chipathon-tools (push) Successful in 19m21s
release / build-base (push) Successful in 4m56s
release / build-digital-ator (push) Successful in 22m41s
2023-12-24 00:37:57 -03:00
Aquiles Viza
455c759f08 Fixed install open pdks
Some checks failed
release / build-base (push) Successful in 6m56s
release / build-digital-icarus (push) Successful in 19m22s
release / build-digital-heavy (push) Successful in 20m46s
release / build-digital-ator (push) Successful in 20m51s
release / build-analog-xk (push) Successful in 22m26s
release / build-analog-xm (push) Successful in 22m48s
release / build-analog-heavy (push) Successful in 24m33s
release / build-heavy (push) Successful in 24m33s
release / build-chipathon-tools (push) Failing after 6m32s
2023-12-23 21:14:05 -03:00
Aquiles Viza
62fae6b2bd Fixed Dockerfile
Some checks failed
release / build-base (push) Successful in 8m7s
release / build-digital-ator (push) Successful in 17m57s
release / build-digital-icarus (push) Successful in 18m4s
release / build-digital-heavy (push) Successful in 18m7s
release / build-analog-xk (push) Successful in 20m35s
release / build-analog-xm (push) Successful in 20m39s
release / build-heavy (push) Successful in 21m26s
release / build-chipathon-tools (push) Failing after 4m2s
release / build-analog-heavy (push) Successful in 12m55s
2023-12-22 17:53:22 -03:00
Aquiles Viza
e9bba39379 Fixes in gf180mcu support for ngspice, xschem and klayout
Some checks failed
release / build-base (push) Successful in 10m6s
release / build-digital-ator (push) Successful in 24m11s
release / build-digital-heavy (push) Successful in 24m12s
release / build-digital-icarus (push) Successful in 24m21s
release / build-analog-xm (push) Successful in 25m19s
release / build-analog-xk (push) Successful in 28m14s
release / build-heavy (push) Successful in 28m27s
release / build-analog-heavy (push) Successful in 28m40s
release / build-chipathon-tools (push) Failing after 19s
2023-12-21 16:10:21 -03:00
Aquiles Viza
167797effe Updated gf180 patch
Some checks are pending
release / build-digital-icarus (push) Blocked by required conditions
release / build-digital-heavy (push) Blocked by required conditions
release / build-heavy (push) Blocked by required conditions
release / build-chipathon-tools (push) Blocked by required conditions
release / build-base (push) Waiting to run
release / build-analog-xk (push) Blocked by required conditions
release / build-analog-xm (push) Blocked by required conditions
release / build-analog-heavy (push) Blocked by required conditions
release / build-digital-ator (push) Blocked by required conditions
2023-12-21 04:03:17 -03:00
Aquiles Viza
2069040fe4 Fixed typo on chipathon .bashrc
All checks were successful
release / build-base (push) Successful in 4m31s
release / build-digital-icarus (push) Successful in 21m24s
release / build-digital-ator (push) Successful in 21m46s
release / build-digital-heavy (push) Successful in 21m56s
release / build-analog-xk (push) Successful in 22m31s
release / build-analog-xm (push) Successful in 23m2s
release / build-heavy (push) Successful in 26m17s
release / build-analog-heavy (push) Successful in 26m26s
release / build-chipathon-tools (push) Successful in 20m0s
2023-11-16 14:18:09 -03:00
Aquiles Viza
ffd56db136 Fixed distro problem on run ps1
All checks were successful
release / build-base (push) Successful in 4m32s
release / build-digital-heavy (push) Successful in 21m25s
release / build-digital-ator (push) Successful in 21m38s
release / build-digital-icarus (push) Successful in 22m5s
release / build-analog-xk (push) Successful in 22m44s
release / build-analog-xm (push) Successful in 26m20s
release / build-heavy (push) Successful in 26m31s
release / build-analog-heavy (push) Successful in 26m46s
release / build-chipathon-tools (push) Successful in 20m5s
2023-11-16 11:42:15 -03:00
Aquiles Viza
594b3b13c3 Added gdsfactory dependency
Some checks failed
release / build-base (push) Successful in 4m35s
release / build-analog-xm (push) Failing after 22s
release / build-digital-ator (push) Successful in 19m28s
release / build-digital-icarus (push) Successful in 19m26s
release / build-digital-heavy (push) Successful in 19m30s
release / build-analog-xk (push) Successful in 20m17s
release / build-analog-heavy (push) Successful in 21m34s
release / build-heavy (push) Successful in 22m30s
release / build-chipathon-tools (push) Successful in 19m11s
2023-11-15 12:35:53 -03:00
Aquiles Viza
b580b9d649 Fix chipathon-tools references to gf180mcuC version. Removed C variant
All checks were successful
release / build-base (push) Successful in 4m22s
release / build-digital-heavy (push) Successful in 21m22s
release / build-digital-ator (push) Successful in 21m42s
release / build-digital-icarus (push) Successful in 21m40s
release / build-analog-xk (push) Successful in 26m27s
release / build-analog-xm (push) Successful in 26m42s
release / build-heavy (push) Successful in 26m55s
release / build-analog-heavy (push) Successful in 27m9s
release / build-chipathon-tools (push) Successful in 16m4s
2023-11-15 10:50:55 -03:00
Aquiles Viza
3d589f60d2 Fix to fix: Download flag works
All checks were successful
release / build-base (push) Successful in 19m19s
release / build-analog-xk (push) Successful in 24m45s
release / build-digital-ator (push) Successful in 15m16s
release / build-digital-icarus (push) Successful in 15m22s
release / build-digital-heavy (push) Successful in 15m15s
release / build-analog-xm (push) Successful in 20m14s
release / build-analog-heavy (push) Successful in 23m5s
release / build-heavy (push) Successful in 21m42s
release / build-chipathon-tools (push) Successful in 20m38s
2023-11-14 16:35:53 -03:00
Aquiles Viza
1e5601bb33 Fixed run.ps1 download option
All checks were successful
release / build-base (push) Successful in 12m32s
release / build-analog-xk (push) Successful in 31m38s
release / build-digital-icarus (push) Successful in 25m11s
release / build-digital-ator (push) Successful in 26m0s
release / build-analog-xm (push) Successful in 31m21s
release / build-digital-heavy (push) Successful in 24m20s
release / build-analog-heavy (push) Successful in 32m2s
release / build-heavy (push) Successful in 30m10s
release / build-chipathon-tools (push) Successful in 28m42s
2023-11-14 16:31:12 -03:00
Aquiles Viza
02bec29f55 Added gf180mcuD
All checks were successful
release / build-base (push) Successful in 5m15s
release / build-digital-icarus (push) Successful in 36m2s
release / build-digital-heavy (push) Successful in 37m16s
release / build-digital-ator (push) Successful in 40m43s
release / build-analog-xk (push) Successful in 41m32s
release / build-analog-heavy (push) Successful in 44m10s
release / build-analog-xm (push) Successful in 44m23s
release / build-heavy (push) Successful in 44m25s
release / build-chipathon-tools (push) Successful in 41m24s
2023-11-14 16:27:23 -03:00
Aquiles Viza
961108837a Updated volare commit
All checks were successful
release / build-base (push) Successful in 5m56s
release / build-digital-icarus (push) Successful in 25m54s
release / build-digital-heavy (push) Successful in 26m58s
release / build-digital-ator (push) Successful in 27m2s
release / build-analog-xk (push) Successful in 28m58s
release / build-analog-xm (push) Successful in 29m12s
release / build-heavy (push) Successful in 30m52s
release / build-analog-heavy (push) Successful in 31m7s
release / build-chipathon-tools (push) Successful in 22m46s
2023-11-09 12:12:35 -03:00
9 changed files with 2356 additions and 106 deletions

View File

@ -6,7 +6,7 @@ FROM greyltc/archlinux-aur:paru as osicstacks-base-desktop
RUN pacman -Syuq --noconfirm
# Install packages
RUN aur-install sudo git git-lfs python python-pip python-pipx xz gnu-free-fonts vim ngspice gedit jupyter-notebook xterm
RUN aur-install sudo git git-lfs python python-pip python-pipx xz gnu-free-fonts vim ngspice gedit jupyter-notebook xterm wget
ENV TERM=xterm EDITOR=gedit
# Clean cache

57
run.ps1
View File

@ -20,13 +20,29 @@ $global:STACK_OPTIONS = [ordered]@{
$global:SELECTED_STACK='chipathon-tools'
$global:CONTAINER_NAME=$global:SELECTED_STACK
$global:EXECMODE='desktop'
$global:PDK="gf180mcuC"
$global:PDK="gf180mcuD"
$global:DIRECTORY=Get-Location | Foreach-Object { $_.Path }
$global:WSL_DISTRO="NO DISTRO"
$global:PARAMS = ""
New-Alias Call Invoke-Expression
function debug($fname, $message) {
Write-Host "[$fname] $message" -ForegroundColor Green
}
function get-ubuntu-distro() {
# Identify if distro has (Predeterminado) or something like that
Invoke-Expression "wsl --list" | ForEach-Object {
if ($_ -match '\)' ) {
$global:WSL_DISTRO=$_.split('(')[0].replace(" ","")
}
}
debug "get-ubuntu-distro" "Linux distribution: $global:WSL_DISTRO"
}
function validate-environment() {
Write-Host "Checking requirements and WSL updates" -ForegroundColor DarkGray
@ -120,9 +136,34 @@ function path-conversion() {
echo "/mnt/$($drive.tolower())$($path.replace("\","/"))"
}
function get-value-from-wsl () {
function get-value-from-wsl() {
$variable, $other = $args
return "$(wsl -d Ubuntu bash -c "echo `$$variable")"
$cmd = "wsl bash -c `'echo `$$variable`'"
# Simple replacement
#$cmd = "wsl -d $global:WSL_DISTRO bash -c `'echo `$$variable`'"
#$cmd = "wsl -d `'$global:WSL_DISTRO`' bash -c `'echo `$$variable`'"
# Using parenthesis
#$cmd = "wsl -d $($global:WSL_DISTRO) bash -c `'echo `$$variable`'"
#$cmd = "wsl -d `'$($global:WSL_DISTRO)`' bash -c `'echo `$$variable`'"
#$cmd = "wsl -d `"$($global:WSL_DISTRO)`" bash -c `'echo `$$variable`'"
# Using curly braces
#$cmd = "wsl -d ${global:WSL_DISTRO} bash -c `'echo `$$variable`'"
#$cmd = "wsl -d '${global:WSL_DISTRO}' bash -c `'echo `$$variable`'"
# Using here strings (Never worked)
# @"
# "wsl -d $global:WSL_DISTRO bash -c `'echo `$$variable`'"
# "@
debug "get-value-from-wsl" "Command: $cmd"
$response = Invoke-Expression "$cmd"
debug "get-value-from-wsl" "Response: $response"
return $response
}
function set-common-parameters () {
@ -160,7 +201,8 @@ function run-docker-wsl() {
$global:PARAMS += " -v /mnt/wslg:/mnt/wsl"
$global:PARAMS += " -v ${global:DIRECTORY}:/home/designer/shared "
Call "wsl -d Ubuntu bash --noprofile --norc -ic `"docker run $global:PARAMS $global:IMAGE $global:COMMAND`""
#Call "wsl -d $global:WSL_DISTRO bash --noprofile --norc -ic `"docker run $global:PARAMS $global:IMAGE $global:COMMAND`""
Call "wsl bash --noprofile --norc -ic `"docker run $global:PARAMS $global:IMAGE $global:COMMAND`""
if ($?) {
Write-Host "Container created successfully!" -ForegroundColor Green
@ -173,9 +215,9 @@ function run-docker-wsl() {
}
function run-docker-win() {
$global:PARAMS += " -v '\\wsl.localhost\Ubuntu\mnt\wslg:/tmp'"
$global:PARAMS += " -v '\\wsl.localhost\$global:WSL_DISTRO\mnt\wslg:/tmp'"
$global:PARAMS += " -v ${global:DIRECTORY}:/home/designer/shared"
#$global:PARAMS += " -v '\\wsl.localhost\Ubuntu\mnt\wslg\runtime-dir'%XDG_RUNTIME_DIR%"
#$global:PARAMS += " -v '\\wsl.localhost\$global:WSL_DISTRO\mnt\wslg\runtime-dir'%XDG_RUNTIME_DIR%"
Call "docker run $global:PARAMS $global:IMAGE $global:COMMAND"
@ -193,7 +235,7 @@ function download-run-bat () {
if (!$download) { return }
try {
$response = Call "Invoke-WebRequest -URI https://git.1159.cl/Mario1159/osic-stacks/src/branch/main/run.ps1"
$response = Call "Invoke-WebRequest -URI https://git.1159.cl/Mario1159/osic-stacks/raw/branch/main/run.ps1 -OutFile run.ps1"
} catch {
$StatusCode = $_.Exception.Response.StatusCode.value__
Write-Host "Error downloading file :( ($($StatusCode))" -ForegroundColor Red
@ -214,6 +256,7 @@ function run(){
download-run-bat
validate-environment
get-ubuntu-distro
if ($interactive) {
select-stack

View File

@ -2,6 +2,8 @@ ARG BASE_IMG=heavy-desktop
FROM $BASE_IMG as chipathon-tools
# Add scripts
COPY --chown=designer:designer --chmod=755 stacks/chipathon-tools/scripts/global-variables.sh .
COPY --chown=designer:designer --chmod=755 stacks/chipathon-tools/scripts/install-open-pdks.sh .
RUN ./install-open-pdks.sh
@ -12,4 +14,4 @@ RUN ./patch-open-pdks-sky130.sh
RUN rm *.sh
# Initialize the enviroment keeping container alive
CMD ["sleep", "infinity"]
CMD ["sleep", "infinity"]

View File

@ -1,22 +1,33 @@
[[ $- != *i* ]] && return
# ------------------
# SET PDK PARAMETERS
# ------------------
if [ "$PDK" == "" ]; then
echo "PDK not defined, using default one (gf180mcuD)"
PDK=gf180mcuD
fi
case "$PDK" in
gf180mcuC)
export PDKPATH=$PDK_ROOT/$PDK
export STD_CELL_LIBRARY=gf180mcu_fd_sc_mcu7t5v0
;;
sky130A)
export PDKPATH=$PDK_ROOT/$PDK
export STD_CELL_LIBRARY=sky130_fd_sc_hd
;;
*)
echo "PDK not defined, using default one (gf180mcuC)"
export PDK=gf180mcuC
export PDKPATH=$PDK_ROOT/$PDK
export STD_CELL_LIBRARY=gf180mcu_fd_sc_mcu7t5v0
;;
gf180mcuC) echo "gf180mcuC is not supported, only D variant [default one]" ;;
gf180mcuD) export STD_CELL_LIBRARY=gf180mcu_fd_sc_mcu7t5v0 ;;
sky130A) export STD_CELL_LIBRARY=sky130_fd_sc_hd ;;
*) echo "PDK $PDK NOT RECOGNIZED";;
esac
export PDKPATH=$PDK_ROOT/$PDK
export KLAYOUT_HOME=$PDK_ROOT/$PDK/libs.tech/klayout
alias xschem='xschem -b --rcfile $PDK_ROOT/$PDK/libs.tech/xschem/xschemrc'
alias xschemtcl='xschem --rcfile $PDK_ROOT/$PDK/libs.tech/xschem/xschemrc'
#alias magic='magic --rcfile $PDK_ROOT/$PDK/libs.tech/magic/*.magicrc'
# ------------------
# SET PROMPT
# ------------------
function git_branch {
branch=$(git symbolic-ref --short HEAD 2>/dev/null)
if [ "$branch" != "" ]; then
@ -37,13 +48,12 @@ c_whi='\[\033[01;37m\]' # White
# export PS1="${c_pur}\w $(git_branch)\n${c_res}\$ " ## This dont work :(
PS1="${c_pur}\w \n${c_res}\$ " ## This dont work :(
export KLAYOUT_HOME=$PDK_ROOT/$PDK/libs.tech/klayout
export DESIGNS="/home/designer/shared"
# --------------------------------
# USEFUL ENV VARIABLES AND ALIASES
# --------------------------------
alias ls="ls --color=auto -XF"
alias grep="grep --color=auto"
alias xschem='xschem -b --rcfile $PDK_ROOT/$PDK/libs.tech/xschem/xschemrc'
alias xschemtcl='xschem --rcfile $PDK_ROOT/$PDK/libs.tech/xschem/xschemrc'
git config --global --add safe.directory $DESIGNS
git config --global --add safe.directory /home/designer/shared
git config --global --add safe.directory /workspaces/*

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
export PDK_ROOT=/home/designer/.volare
#export OPEN_PDKS_COMMIT="cd1748bb197f9b7af62a54507de6624e30363943"
export OPEN_PDKS_COMMIT="bdc9412b3e468c102d01b7cf6337be06ec6e9c9a"
# This files can be downloaded directly
# - sky130A_mr.drc
# - gf180mcuD_mr.drc
export PRECHECK_REPO=https://raw.githubusercontent.com/efabless/mpw_precheck/main/checks/tech-files/
export PRECHECK_GF_FILE=gf180mcuD_mr.drc
export PRECHECK_SKY_FILE=sky130A_mr.drc
export SCRIPT_DIR=$PWD

View File

@ -1,34 +1,32 @@
#!/bin/bash
set -e
set -ex
export OPEN_PDKS_VERSION="dd7771c384ed36b91a25e9f8b314355fc26561be"
export SCRIPT_DIR=$PWD
source ./global-variables.sh
#pip install git+https://github.com/gdsfactory/skywater130.git git+https://github.com/gdsfactory/gf180.git --upgrade --break-system-packages
pip install gf180 --upgrade --break-system-packages
pip install sky130 --upgrade --break-system-packages
# pip install gf180 --upgrade --break-system-packages
# pip install sky130 --upgrade --break-system-packages
pip install gdsfactory[cad]==7.3.0 --break-system-packages
######################
# INSTALL GF180MCU PDK
######################
volare enable "${OPEN_PDKS_VERSION}" --pdk gf180mcu
volare enable "${OPEN_PDKS_COMMIT}" --pdk gf180mcu
rm -rf $PDK_ROOT/volare/gf180mcu/versions/*/gf180mcuA
rm -rf $PDK_ROOT/volare/gf180mcu/versions/*/gf180mcuB
rm -rf $PDK_ROOT/volare/gf180mcu/versions/*/gf180mcuD
rm -rf $PDK_ROOT/volare/gf180mcu/versions/*/gf180mcuC
rm -rf $PDK_ROOT/gf180mcuA
rm -rf $PDK_ROOT/gf180mcuB
rm -rf $PDK_ROOT/gf180mcuD
rm -rf $PDK_ROOT/gf180mcuC
####################
# INSTALL SKY130 PDK
####################
volare enable "${OPEN_PDKS_VERSION}" --pdk sky130
# ADD PCELL SUPPORT
volare enable "${OPEN_PDKS_COMMIT}" --pdk sky130
# remove version sky130B to save space (efabless TO use mostly sky130A)
rm -rf "$PDK_ROOT"/volare/sky130/versions/*/sky130B

View File

@ -1,82 +1,168 @@
#!/bin/bash
set -ex
SCRIPT_DIR=$PWD
function _gf180mcuD_clean_install() {
# Re-installs gf180mcuD
# This files can be downloaded directly
# - sky130A_mr.drc
# - gf180mcuC_mr.drc
PRECHECK_REPO=https://raw.githubusercontent.com/efabless/mpw_precheck/main/checks/tech-files/
PRECHECK_GF_FILE=gf180mcuC_mr.drc
PRECHECK_SKY_FILE=sky130A_mr.drc
rm -rf $PDK_ROOT/gf180mcu*
rm -rf $PDK_ROOT/volare/gf180mcu/versions/$OPEN_PDKS_COMMIT
sudo aur-install wget
pip install docopt --upgrade --break-system-packages
volare enable --pdk gf180mcu $OPEN_PDKS_COMMIT
rm -rf $PDK_ROOT/gf180mcuA
rm -rf $PDK_ROOT/gf180mcuB
rm -rf $PDK_ROOT/gf180mcuC
rm -rf $PDK_ROOT/volare/gf180mcu/versions/$OPEN_PDKS_COMMIT/gf180mcuA
rm -rf $PDK_ROOT/volare/gf180mcu/versions/$OPEN_PDKS_COMMIT/gf180mcuB
rm -rf $PDK_ROOT/volare/gf180mcu/versions/$OPEN_PDKS_COMMIT/gf180mcuC
}
function gf180_patch_xschemrc() {
FILEPATH=$PDK_ROOT/gf180mcuC/libs.tech/xschem/xschemrc
function gf180_delete_repos() {
rm -rf globalfoundries-pdk-libs-gf180mcu_fd_pr
rm -rf globalfoundries-pdk-libs-gf180mcu_fd_pv
}
function gf180_download_repos() {
gf180_delete_repos
git clone --depth 1 https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr.git
git clone --depth 1 https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pv.git
}
function gf180_patch_ngspice_primitives() {
NGSPICE_TECH=$PDK_ROOT/gf180mcuD/libs.tech/ngspice
rm -rf $NGSPICE_TECH
mv globalfoundries-pdk-libs-gf180mcu_fd_pr/models/ngspice $NGSPICE_TECH
}
function gf180_patch_xyce_primitives() {
XYCE_TECH=$PDK_ROOT/gf180mcuD/libs.tech/xyce
rm -rf $XYCE_TECH
mv globalfoundries-pdk-libs-gf180mcu_fd_pr/models/xyce $XYCE_TECH
}
function gf180_patch_xschem_primitives() {
# Replace volare xschem dir with efabless one
XSCHEM_TECH=$PDK_ROOT/gf180mcuD/libs.tech/xschem
rm -rf $XSCHEM_TECH
mv globalfoundries-pdk-libs-gf180mcu_fd_pr/cells/xschem $XSCHEM_TECH
}
function gf180_patch_xschem_xschemrc() {
FILEPATH=$PDK_ROOT/gf180mcuD/libs.tech/xschem/xschemrc
# Add gf180mcuD symbols to xschem path
ORIGINAL='append XSCHEM_LIBRARY_PATH :$env(PWD)'
REPLACE='append XSCHEM_LIBRARY_PATH :$env(PDK_ROOT)/$env(PDK)/libs.tech/xschem'
REPLACE='append XSCHEM_LIBRARY_PATH :$env(PDK_ROOT)/gf180mcuD/libs.tech/xschem'
sed -i "s\\$ORIGINAL\\$REPLACE\g" $FILEPATH
# Update 180MCU_MODELS
ORIGINAL='set 180MCU_MODELS ${PDK_ROOT}/models/ngspice'
REPLACE='set 180MCU_MODELS $env(PDK_ROOT)/$env(PDK)/libs.tech/ngspice'
REPLACE='set 180MCU_MODELS $env(PDK_ROOT)/gf180mcuD/libs.tech/ngspice'
sed -i "s\\$ORIGINAL\\$REPLACE\g" $FILEPATH
# Allow setting of symbol paths with XSCHEM_USER_LIBRARY_PATH env variable
echo '' >> $FILEPATH
echo '# open_pdks-specific' >> $FILEPATH
echo 'set XSCHEM_START_WINDOW ${PDK_ROOT}/gf180mcuD/libs.tech/xschem/tests/0_top.sch' >> $FILEPATH
echo 'append XSCHEM_LIBRARY_PATH :${PDK_ROOT}/gf180mcuD/libs.tech/xschem' >> $FILEPATH
echo '' >> $FILEPATH
echo '# allow a user-specific path add-on' >> $FILEPATH
echo 'if { [info exists ::env(XSCHEM_USER_LIBRARY_PATH) ] } {' >> $FILEPATH
echo ' append XSCHEM_LIBRARY_PATH :$env(XSCHEM_USER_LIBRARY_PATH)' >> $FILEPATH
echo '}' >> $FILEPATH
}
function gf180_patch_klayout_pcells() {
mv $KLAYOUT_HOME/pymacros $KLAYOUT_HOME/cells
mkdir $KLAYOUT_HOME/pymacros
mv $KLAYOUT_HOME/cells $KLAYOUT_HOME/pymacros
mv $KLAYOUT_HOME/tech/gf180mcu.lym $KLAYOUT_HOME/pymacros
# Delete old volare pymacros, use the pcells from efabless repo.
rm -rf .scripts/klayout
rm -rf $KLAYOUT_HOME/pymacros
mv globalfoundries-pdk-libs-gf180mcu_fd_pr/cells/klayout/pymacros $KLAYOUT_HOME
}
function gf180_patch_klayout_tech_clean() {
# DRC and LVS is obsolete, and the copy is made on $KLAYOUT_HOME/
rm -rf $KLAYOUT_HOME/tech/drc
rm -rf $KLAYOUT_HOME/tech/lvs
# .lym should be on $KLAYOUT_HOME/pymacros
rm -rf $KLAYOUT_HOME/tech/gf180mcu.lym
}
function gf180_patch_klayout_drc_lvs() {
rm -rf $KLAYOUT_HOME/drc
rm -rf $KLAYOUT_HOME/lvs
mv globalfoundries-pdk-libs-gf180mcu_fd_pv/klayout/drc $KLAYOUT_HOME
mv globalfoundries-pdk-libs-gf180mcu_fd_pv/klayout/lvs $KLAYOUT_HOME
}
function gf180_patch_klayout_dropdown() {
# 27:00 & 36:40
DROPDOWN_REPO="https://github.com/mabrains/globalfoundries-pdk-libs-gf180mcu_fd_pr"
DROPDOWN_DIRECTORY="gf_dropdown"
# dropdown menu should live on $KLAYOUT_HOME/macro
# Depends on $KLAYOUT_HOME/drc $KLAYOUT_HOME/lvs
mv globalfoundries-pdk-libs-gf180mcu_fd_pr/rules/klayout/macros $KLAYOUT_HOME
git clone $DROPDOWN_REPO $DROPDOWN_DIRECTORY
# Make D the default variant in {drc lvs}_options.yml
FILEPATH=$KLAYOUT_HOME/macros/*_options.yml
ORIGINAL='variant: C'
REPLACE='variant: D'
sed -i "s\\$ORIGINAL\\$REPLACE\g" $FILEPATH
cp -r $DROPDOWN_DIRECTORY/rules/klayout/macros $KLAYOUT_HOME
# Make D default on .lym
FILEPATH=$KLAYOUT_HOME/macros/gf180mcu_options.lym
rm -rf $DROPDOWN_DIRECTORY
}
ORIGINAL=';"C"'
REPLACE=';"D"'
sed -i "s\\$ORIGINAL\\$REPLACE\g" $FILEPATH
function gf180_patch_klayout_gf_drc() {
# 27:00 & 36:40
GF_VERIFICATION_REPO=https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pv
VERIFICATION_DIR="gf_verification"
git clone $GF_VERIFICATION_REPO $VERIFICATION_DIR
# rm -rf $KLAYOUT_HOME/drc
# rm -rf $KLAYOUT_HOME/lvs
cp -r $VERIFICATION_DIR/klayout/drc/* $KLAYOUT_HOME/drc
cp -r $VERIFICATION_DIR/klayout/lvs/* $KLAYOUT_HOME/lvs
rm -rf $VERIFICATION_DIR
ORIGINAL='], 2)'
REPLACE='], 3)'
sed -i "s\\$ORIGINAL\\$REPLACE\g" $FILEPATH
}
function gf180_patch_klayout_precheck_drc() {
#curl -o $KLAYOUT_HOME/drc/rule_decks/$PRECHECK_GF_FILE $PRECHECK_REPO/$PRECHECK_GF_FILE
wget -O $KLAYOUT_HOME/drc/rule_decks/$PRECHECK_GF_FILE $PRECHECK_REPO/$PRECHECK_GF_FILE
wget -O $KLAYOUT_HOME/drc/$PRECHECK_GF_FILE $PRECHECK_REPO/$PRECHECK_GF_FILE
}
function gf180_patch_klayout_lyp() {
# If $KLAYOUT_HOME/tech is not modified, this has no dependencies
mv gf180mcu.lyp $KLAYOUT_HOME/tech/gf180mcu.lyp
}
function gf180_patch() {
export KLAYOUT_HOME="$PDK_ROOT/gf180mcuC/libs.tech/klayout"
gf180_patch_xschemrc
# volare pdk should be installed with ./volare_install.sh
export KLAYOUT_HOME="$PDK_ROOT/gf180mcuD/libs.tech/klayout"
gf180_download_repos
gf180_patch_ngspice_primitives
gf180_patch_xyce_primitives
gf180_patch_xschem_primitives
gf180_patch_xschem_xschemrc
gf180_patch_klayout_pcells
gf180_patch_klayout_precheck_drc
gf180_patch_klayout_tech_clean
gf180_patch_klayout_drc_lvs
gf180_patch_klayout_dropdown
gf180_patch_klayout_gf_drc
gf180_patch_klayout_precheck_drc
gf180_patch_klayout_lyp
gf180_delete_repos
}
gf180_patch
source ./global-variables.sh
sudo aur-install gedit xterm gvim
#_gf180mcuD_clean_install
pip install docopt --upgrade --break-system-packages
gf180_patch

View File

@ -1,23 +1,6 @@
#!/bin/bash
set -ex
SCRIPT_DIR=$PWD
# This files can be downloaded directly
# - sky130A_mr.drc
# - gf180mcuC_mr.drc
PRECHECK_REPO=https://raw.githubusercontent.com/efabless/mpw_precheck/main/checks/tech-files/
PRECHECK_GF_FILE=gf180mcuC_mr.drc
PRECHECK_SKY_FILE=sky130A_mr.drc
# TODO: DOWNLOAD WITH WGET, DONT HAVE IT STATIC
if [ -d $SCRIPT_DIR/iic-spice-model-red.py ]; then
echo File iic-spice-model.red.py not found
return -1
fi
sudo aur-install wget
function sky130_patch_reduced_models() {
cd "$PDK_ROOT/sky130A/libs.tech/ngspice" || exit 1
"$SCRIPT_DIR/iic-spice-model-red.py" sky130.lib.spice tt
@ -69,6 +52,12 @@ function sky130_patch() {
sky130_patch_klayout_precheck_drc
}
sky130_patch
source ./global-variables.sh
sudo aur-install gedit xterm gvim
# TODO: DOWNLOAD WITH WGET, DONT HAVE IT STATIC
if [ -d $SCRIPT_DIR/iic-spice-model-red.py ]; then
echo File iic-spice-model.red.py not found
return -1
fi
sky130_patch