Compare commits

..

13 Commits
main ... dev

34 changed files with 308 additions and 2408 deletions

7
.gitattributes vendored
View File

@ -5,10 +5,15 @@
*.sh text eol=lf
*.py text eol=lf
*.bat text eol=crlf
<<<<<<< HEAD
*.desktop text eol=lf
scripts/* text eol=lf
=======
desktopinit text eol=lf
klayout text eol=lf
.bashrc text eol=lf
setwallpaper text eol=lf
startserver text eol=lf
*.desktop text eol=lf
xschemrc text eol=lf
xschemrc text eol=lf
>>>>>>> 9337a522bfce850a6848722c6ba4973ce31ea63b

View File

@ -29,7 +29,7 @@ include_toc: true
- **digital-heavy**: Workflow with all the digital tools
- **heavy**: Workflow with all the previous tools
> Flavors: web / desktop
> Flavors: Web / Desktop | [Docker image list](https://git.1159.cl/Mario1159/osic-stacks/packages)
## Usage
@ -55,7 +55,7 @@ Execute the next script in powershell and follow the container initialization pr
This script will run the container inside WSL and bind the enviroments variables for [WSLg](https://github.com/microsoft/wslg/blob/main/samples/container/Containers.md). Also, it will download itself so it will exists locally.
##### Linux
Execute the next script in your terminal replacing `<container_name>` by any name and `<stack>` by an stack from the previous [stack list](#stacks).
Execute the next docker command in your terminal replacing `<container_name>` by any name and `<stack>` by an stack from the previous [stack list](#stacks).
```sh
docker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --name <container_name> git.1159.cl/mario1159/<stack>-desktop
```
@ -69,8 +69,9 @@ Install `Xquartz` and run the linux previous command.
#### 1b. Starting a container with a **Web** VNC client
If you prefer running the container in your web browser instead of in your integrated terminal, you can select the web flavor of any stack. In this case, it is not necessary to bind extra environment variables for enabling native graphics output.
```sh
docker run -it -p 8444:8444 --name <container_name> git.1159.cl/mario1159/<stack>-web
docker run -d --security-opt seccomp=unconfined -p 8444:8444 --name <container_name> git.1159.cl/mario1159/<stack>-web
```
This can also be deployed from a docker compose file, an example is provided [here](https://git.1159.cl/Mario1159/osic-stacks/src/branch/main/compose/docker-compose.yml).
### 2. Connecting to the container
@ -86,9 +87,11 @@ docker exec -it <container_name> bash
Access from the web to the VNC client at `https://localhost:8444`.
The default username is `designer` and the password is `password`.
### 3. Configure Volare
List the available PDKs and choose one to install.
Choose a PDK variant from the following list to install.
| PDK Technology | PDK Variant |
|----------------|-------------|
@ -98,9 +101,16 @@ List the available PDKs and choose one to install.
| | gf180mcuB |
| | gf180mcuC |
Replace `<pdk_variant>` and `<pdk_tech>` correspondingly by one of the PDKs listed above.
To automatically download and configure the latest version of the PDK to this date, run `volare_set_latest` replacing `<pdk_variant>` for a PDK variant from the list.
```sh
echo 'export PDK=<pdk_variant>' >> ~/.bashrc
volare_set_latest <pdk_variant>
```
To manually set any version of the PDK, set the `PDK` environment variable, list the available PDKs and choose one to install replacing `<pdk_variant>` and `<pdk_tech>` correspondingly by one of the PDKs listed above.
```sh
echo 'export PDK=<pdk_variant>' >> ~/.bashrc
source ~/.bashrc
volare ls-remote --pdk <pdk_tech>
volare enable --pdk <pdk_tech> <version_id>
```
@ -117,6 +127,20 @@ or you can also install packages from the [AUR](https://aur.archlinux.org/) usin
```paru <package_name>```
## Updating the image
To update to the latest image version, first make sure you have all your important data linked by a volume or backed up in an external storage, **all your files outside any linked volume will be lost**.
After you backed your data, stop the container, delete it, pull the latest image and finally start the container again as the first step of the usage section.
```
docker stop <container_name>
docker rm <container_name>
docker pull <image>
docker run -d --security-opt seccomp=unconfined -p 8444:8444 -v <path_to_volume>:/home/designer/shared --name <container_name> <image-web>
```
> Container names can be seen with `docker ps -a`
## Custom Images
For creating an image with your own pre-installed set of packages for your team you can create your own docker image extending the stacks, just as the stacks extend the base image. For reference check the stacks dockerfiles in the `stack` folder.

View File

@ -6,7 +6,21 @@ 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 wget
RUN aur-install \
sudo \
git \
git-lfs \
python \
python-pip \
python-pipx \
xz \
gnu-free-fonts \
gvim \
ngspice \
gedit \
jupyter-notebook \
xterm
ENV TERM=xterm EDITOR=gedit
# Clean cache
@ -31,5 +45,17 @@ RUN mkdir -p .scripts
COPY --chown=designer:designer --chmod=755 scripts/* /home/designer/.scripts
ENV PATH="/home/designer/.scripts:${PATH}"
# Add motd
RUN echo "custom_motd" >> "/home/designer/.bashrc"
# Add media includes
RUN mkdir -p /home/designer/.media
COPY --chown=designer:designer include/media/* /home/designer/.media
# Setup Docker in Docker (DiD)
RUN aur-install docker
RUN sudo groupadd docker
RUN sudo usermod -aG docker $USER
# Initialize the enviroment keeping container alive
CMD ["sleep", "infinity"]
ENTRYPOINT ["start_desktop"]

View File

@ -27,12 +27,14 @@ RUN sudo usermod -aG root designer
# Install XFCE
RUN sudo pacman -S --noconfirm xorg xfce4
# Copy includes
RUN mkdir -p /home/designer/.media
COPY --chown=designer:designer include/media/* /home/designer/.media
# Copy autostart include
RUN mkdir -p /home/designer/.config/autostart
COPY --chown=designer:designer include/desktopinit.desktop /home/designer/.config/autostart
COPY --chown=designer:designer include/desktop_init.desktop /home/designer/.config/autostart
# Set login user
ENV LOGIN_USER designer
ENV LOGIN_PASSWORD password
# Start VNC & desktop environment
WORKDIR /home/designer
ENTRYPOINT ["startserver"]
ENTRYPOINT ["start_server"]

View File

@ -0,0 +1,13 @@
# Example deploy from docker compose
services:
osicstacks-heavy-web:
# Image from https://git.1159.cl/Mario1159/osic-stacks/packages
image: git.1159.cl/mario1159/heavy-web
port:
- 8444:8444
environment:
- LOGIN_USER: designer
- LOGIN_PASSWORD: password
- PDK: sky130A
volumes:
- ./data:/home/designer/shared

View File

@ -1,4 +1,4 @@
[Desktop Entry]
Type=Application
Name=OSICStacks-DesktopInit
Exec=sh -c "sleep 1 && desktopinit"
Exec=sh -c "sleep 1 && desktop_init"

View File

@ -0,0 +1,8 @@
__ __
__ /\ \__ /\ \
___ ____/\_\ ___ ____\ \ ,_\ __ ___\ \ \/'\ ____
/ __`\ /',__\/\ \ /'___\ /',__\\ \ \/ /'__`\ /'___\ \ , < /',__\
/\ \L\ \/\__, `\ \ \/\ \__/ /\__, `\\ \ \_/\ \L\.\_/\ \__/\ \ \\`\ /\__, `\
\ \____/\/\____/\ \_\ \____\ \/\____/ \ \__\ \__/.\_\ \____\\ \_\ \_\/\____/
\/___/ \/___/ \/_/\/____/ \/___/ \/__/\/__/\/_/\/____/ \/_/\/_/\/___/

57
run.ps1
View File

@ -20,29 +20,13 @@ $global:STACK_OPTIONS = [ordered]@{
$global:SELECTED_STACK='chipathon-tools'
$global:CONTAINER_NAME=$global:SELECTED_STACK
$global:EXECMODE='desktop'
$global:PDK="gf180mcuD"
$global:PDK="gf180mcuC"
$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
@ -136,34 +120,9 @@ function path-conversion() {
echo "/mnt/$($drive.tolower())$($path.replace("\","/"))"
}
function get-value-from-wsl() {
function get-value-from-wsl () {
$variable, $other = $args
$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
return "$(wsl -d Ubuntu bash -c "echo `$$variable")"
}
function set-common-parameters () {
@ -201,8 +160,7 @@ function run-docker-wsl() {
$global:PARAMS += " -v /mnt/wslg:/mnt/wsl"
$global:PARAMS += " -v ${global:DIRECTORY}:/home/designer/shared "
#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`""
Call "wsl -d Ubuntu bash --noprofile --norc -ic `"docker run $global:PARAMS $global:IMAGE $global:COMMAND`""
if ($?) {
Write-Host "Container created successfully!" -ForegroundColor Green
@ -215,9 +173,9 @@ function run-docker-wsl() {
}
function run-docker-win() {
$global:PARAMS += " -v '\\wsl.localhost\$global:WSL_DISTRO\mnt\wslg:/tmp'"
$global:PARAMS += " -v '\\wsl.localhost\Ubuntu\mnt\wslg:/tmp'"
$global:PARAMS += " -v ${global:DIRECTORY}:/home/designer/shared"
#$global:PARAMS += " -v '\\wsl.localhost\$global:WSL_DISTRO\mnt\wslg\runtime-dir'%XDG_RUNTIME_DIR%"
#$global:PARAMS += " -v '\\wsl.localhost\Ubuntu\mnt\wslg\runtime-dir'%XDG_RUNTIME_DIR%"
Call "docker run $global:PARAMS $global:IMAGE $global:COMMAND"
@ -235,7 +193,7 @@ function download-run-bat () {
if (!$download) { return }
try {
$response = Call "Invoke-WebRequest -URI https://git.1159.cl/Mario1159/osic-stacks/raw/branch/main/run.ps1 -OutFile run.ps1"
$response = Call "Invoke-WebRequest -URI https://git.1159.cl/Mario1159/osic-stacks/src/branch/main/run.ps1"
} catch {
$StatusCode = $_.Exception.Response.StatusCode.value__
Write-Host "Error downloading file :( ($($StatusCode))" -ForegroundColor Red
@ -256,7 +214,6 @@ function run(){
download-run-bat
validate-environment
get-ubuntu-distro
if ($interactive) {
select-stack

16
scripts/custom_motd Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash
cat $HOME/.media/ascii_art.txt
if [[ ! -z "${PDK_TECH}" ]]; then
if [[ ! -z "${PDK_VERSION}" ]]; then
volare_set_latest
fi
else
echo "
There is not an active PDK, Use:
volare_set_latest <pdk_variant>
to automatically download and configure the latest version of a PDK.
You can also manually configure a PDK using volare and setting the PDK_TECH environment variable
"
fi

18
scripts/desktop_init Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
set_wallpaper $HOME/.media/default_wallpaper.png
xfce4-terminal
# Add application launcher
mkdir -p $HOME/.config/xfce4/panel/launcher-18
ln /usr/share/applications/klayoutEditor.desktop $HOME/.config/xfce4/panel/launcher-18
xfconf-query -c xfce4-panel -p /plugins/plugin-18 -t string -s "launcher" --create
xfconf-query -c xfce4-panel -p /plugins/plugin-18/items -t string -s "klayoutEditor.desktop" -a --create
# Delete plugin id array
xfconf-query -c xfce4-panel -p /panels/panel-2/plugin-ids -rR
# Recreate id array with new values
xfconf-query -c xfce4-panel -p /panels/panel-2/plugin-ids -t int -s 18
# Restart panel
xfce4-panel -r

View File

@ -1,2 +0,0 @@
#!/bin/bash
setwallpaper /home/designer/.media/defaultwallpaper.png

2
scripts/magic Normal file
View File

@ -0,0 +1,2 @@
#!/bin/bash
/bin/magic -rcfile $PDK_ROOT/$PDK/libs.tech/magic/$PDK.magicrc $@

3
scripts/start_desktop Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
volare_set_latest
sleep infinity

34
scripts/start_server Normal file
View File

@ -0,0 +1,34 @@
#!/bin/bash
cd $HOME
# Run VNC server
echo 'Running VNC Server'
mkdir -p $HOME/.vnc
touch "$HOME/.Xauthority"
touch "$HOME/.vnc/passwd"
echo -e "$LOGIN_PASSWORD\n$LOGIN_PASSWORD\n" | vncpasswd -u $LOGIN_USER -w -r
kasm_vnc_options="
-httpd /usr/share/kasmvnc/www \
-SecurityTypes None \
-disableBasicAuth \
-KasmPasswordFile $HOME/.kasmpasswd \
-MaxVideoResolution 1920x1080 \
-interface 0.0.0.0 \
-websocketPort 8444 \
-cert /etc/ssl/certs/ssl-cert-snakeoil.pem \
-key /etc/ssl/private/ssl-cert-snakeoil.key \
-auth $HOME/.Xauthority \
-sslOnly 0 \
-desktop osicstacks \
-rfbauth $HOME/.vnc/passwd"
vncserver -select-de xfce -fg -xstartup $HOME/.scripts/xstartup $kasm_vnc_options &
#if ! docker info > /dev/null 2>&1; then
sudo dockerd &
#fi
# Keep container alive
sleep infinity

View File

@ -1,22 +0,0 @@
#!/bin/bash
cd /home/designer
# Run VNC server
eval $(vncserver -dry-run) &
echo -e "password\npassword\n" | vncpasswd -u designer -w -r
# Wait for VNC server to start
sleep 2
while ! xset q &>/dev/null;
do
echo "XServer not responsive, retrying..."
sleep 2
done
echo "XServer has been found, running desktop environment"
# Run desktop environment (XFCE)
xfce4-session --display=$DISPLAY
# Keep container alive
sleep infinity

View File

@ -0,0 +1,7 @@
#!/bin/bash
if [[ ! -z "$1" ]]; then PDK_TECH=$1; fi
if [[ ! -z "${PDK_TECH}" ]]; then
echo "Installing $PDK_TECH ($PDK_VERSION)"
PDK_VERSION=$(volare ls-remote --pdk $PDK_TECH | sed -n '1 p')
volare enable --pdk $PDK_TECH $PDK_VERSION
fi

2
scripts/xschem Normal file
View File

@ -0,0 +1,2 @@
#!/bin/bash
/bin/xschem --rcfile $PDK_ROOT/$PDK/libs.tech/xschem/xschemrc $@

14
scripts/xstartup Normal file
View File

@ -0,0 +1,14 @@
#!/bin/bash
# Wait for VNC server to start
sleep 2
while ! xdpyinfo -display $DISPLAY &> /dev/null;
do
echo "XServer not responsive, retrying..."
sleep 2
done
echo "XServer has been found, running desktop environment"
# Run desktop environment (XFCE)
dbus-launch xfce4-session --display=$DISPLAY

View File

@ -21,10 +21,10 @@ RUN sudo pacman -Scc
FROM analog-heavy as analog-heavy-desktop
# Initialize the environment keeping container alive
CMD ["sleep", "infinity"]
ENTRYPOINT ["start_desktop"]
# - Web build
FROM analog-heavy as analog-heavy-web
# Run VNC server & desktop environment
CMD ["startserver"]
ENTRYPOINT ["start_server"]

View File

@ -19,10 +19,10 @@ RUN sudo pacman -Scc
FROM analog-xk as analog-xk-desktop
# Initialize the environment keeping container alive
CMD ["sleep", "infinity"]
ENTRYPOINT ["start_desktop"]
# - Web build
FROM analog-xk as analog-xk-web
# Run VNC server & desktop environment
CMD ["startserver"]
ENTRYPOINT ["start_server"]

View File

@ -20,10 +20,10 @@ RUN sudo pacman -Scc
FROM analog-xm as analog-xm-desktop
# Initialize the environment keeping container alive
CMD ["sleep", "infinity"]
ENTRYPOINT ["start_desktop"]
# - Web build
FROM analog-xm as analog-xm-web
# Run VNC server & desktop environment
CMD ["startserver"]
ENTRYPOINT ["start_server"]

View File

@ -2,8 +2,6 @@ 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
@ -14,4 +12,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,33 +1,22 @@
[[ $- != *i* ]] && return
# ------------------
# SET PDK PARAMETERS
# ------------------
if [ "$PDK" == "" ]; then
echo "PDK not defined, using default one (gf180mcuD)"
PDK=gf180mcuD
fi
case "$PDK" in
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";;
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
;;
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
@ -48,12 +37,13 @@ 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 :(
# --------------------------------
# USEFUL ENV VARIABLES AND ALIASES
# --------------------------------
export KLAYOUT_HOME=$PDK_ROOT/$PDK/libs.tech/klayout
export DESIGNS="/home/designer/shared"
alias ls="ls --color=auto -XF"
alias grep="grep --color=auto"
git config --global --add safe.directory /home/designer/shared
git config --global --add safe.directory /workspaces/*
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

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -1,168 +1,82 @@
#!/bin/bash
set -ex
function _gf180mcuD_clean_install() {
# Re-installs gf180mcuD
SCRIPT_DIR=$PWD
rm -rf $PDK_ROOT/gf180mcu*
rm -rf $PDK_ROOT/volare/gf180mcu/versions/$OPEN_PDKS_COMMIT
# 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
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
}
sudo aur-install wget
pip install docopt --upgrade --break-system-packages
function gf180_delete_repos() {
rm -rf globalfoundries-pdk-libs-gf180mcu_fd_pr
rm -rf globalfoundries-pdk-libs-gf180mcu_fd_pv
}
function gf180_patch_xschemrc() {
FILEPATH=$PDK_ROOT/gf180mcuC/libs.tech/xschem/xschemrc
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)/gf180mcuD/libs.tech/xschem'
REPLACE='append XSCHEM_LIBRARY_PATH :$env(PDK_ROOT)/$env(PDK)/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)/gf180mcuD/libs.tech/ngspice'
REPLACE='set 180MCU_MODELS $env(PDK_ROOT)/$env(PDK)/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() {
# Delete old volare pymacros, use the pcells from efabless repo.
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
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
rm -rf .scripts/klayout
}
function gf180_patch_klayout_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
# 27:00 & 36:40
DROPDOWN_REPO="https://github.com/mabrains/globalfoundries-pdk-libs-gf180mcu_fd_pr"
DROPDOWN_DIRECTORY="gf_dropdown"
# 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
git clone $DROPDOWN_REPO $DROPDOWN_DIRECTORY
# Make D default on .lym
FILEPATH=$KLAYOUT_HOME/macros/gf180mcu_options.lym
cp -r $DROPDOWN_DIRECTORY/rules/klayout/macros $KLAYOUT_HOME
ORIGINAL=';"C"'
REPLACE=';"D"'
sed -i "s\\$ORIGINAL\\$REPLACE\g" $FILEPATH
rm -rf $DROPDOWN_DIRECTORY
}
ORIGINAL='], 2)'
REPLACE='], 3)'
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
}
function gf180_patch_klayout_precheck_drc() {
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
#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
}
function gf180_patch() {
# 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
export KLAYOUT_HOME="$PDK_ROOT/gf180mcuC/libs.tech/klayout"
gf180_patch_xschemrc
gf180_patch_klayout_pcells
gf180_patch_klayout_tech_clean
gf180_patch_klayout_drc_lvs
gf180_patch_klayout_dropdown
gf180_patch_klayout_precheck_drc
gf180_patch_klayout_lyp
gf180_delete_repos
gf180_patch_klayout_dropdown
gf180_patch_klayout_gf_drc
}
source ./global-variables.sh
#_gf180mcuD_clean_install
pip install docopt --upgrade --break-system-packages
gf180_patch
sudo aur-install gedit xterm gvim

View File

@ -1,6 +1,23 @@
#!/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
@ -52,12 +69,6 @@ function sky130_patch() {
sky130_patch_klayout_precheck_drc
}
source ./global-variables.sh
sky130_patch
# 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
sudo aur-install gedit xterm gvim

View File

@ -20,10 +20,10 @@ RUN sudo pacman -Scc
FROM digital-ator as digital-ator-desktop
# Initialize the environment keeping container alive
CMD ["sleep", "infinity"]
ENTRYPOINT ["start_desktop"]
# - Web build
FROM digital-ator as digital-ator-web
# Run VNC server & desktop environment
CMD ["startserver"]
ENTRYPOINT ["start_server"]

View File

@ -21,10 +21,10 @@ RUN sudo pacman -Scc
FROM digital-heavy as digital-heavy-desktop
# Initialize the environment keeping container alive
CMD ["sleep", "infinity"]
ENTRYPOINT ["start_desktop"]
# - Web build
FROM digital-heavy as digital-heavy-web
# Run VNC server & desktop environment
CMD ["startserver"]
ENTRYPOINT ["start_server"]

View File

@ -20,10 +20,10 @@ RUN sudo pacman -Scc
FROM digital-icarus as digital-icarus-desktop
# Initialize the environment keeping container alive
CMD ["sleep", "infinity"]
ENTRYPOINT ["start_desktop"]
# - Web build
FROM digital-icarus as digital-icarus-web
# Run VNC server & desktop environment
CMD ["startserver"]
ENTRYPOINT ["start_server"]

View File

@ -26,10 +26,10 @@ RUN sudo pacman -Scc
FROM heavy as heavy-desktop
# Initialize the environment keeping container alive
CMD ["sleep", "infinity"]
ENTRYPOINT ["start_desktop"]
# - Web build
FROM heavy as heavy-web
# Run VNC server & desktop environment
CMD ["startserver"]
ENTRYPOINT ["start_server"]