%define have_ext 1 %define have_osu 1 %define use_efab 1 %global pkgvers 0 %global scdate0 20241120 %global schash0 4a79634ac7cff28de923d7129046363052dafc65 %global branch0 master %global source0 https://github.com/RTimothyEdwards/open_pdks.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: efabless-open-pdks Version: 1.0.501 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Efabless format Open PDKs License: Apache 2.0 BuildArch: noarch URL: https://github.com/RTimothyEdwards/open_pdks BuildRequires: make git python3 python3-devel python3-setuptools magic # main libraries %define skywater_libs %(curl -s https://raw.githubusercontent.com/google/skywater-pdk/main/.gitmodules | grep submodule | awk '{print $2}' | cut -d'/' -f2 | uniq | grep sky | grep -v reram) %define globalfoundries_libs %(curl https://raw.githubusercontent.com/google/gf180mcu-pdk/main/.gitmodules | grep submodule | awk '{print $2}' | cut -d'/' -f2 | uniq | grep gf | grep -v gf180mcu_fd_pr | grep -v gf180mcu_fd_bd_sram) # ext targets %if %{have_ext} %define addons_ext sky130_sram_macros sky130_ml_xx_hd %endif # osu targets %if %{have_osu} %define addons_osu sky130_osu_sc_12t_hs sky130_osu_sc_12t_ls sky130_osu_sc_12t_ms \ sky130_osu_sc_15t_hs sky130_osu_sc_15t_ls sky130_osu_sc_15t_ms \ sky130_osu_sc_18t_hs sky130_osu_sc_18t_ls sky130_osu_sc_18t_ms \ gf180mcu_osu_sc_gp9t3v3 gf180mcu_osu_sc_gp12t3v3 %endif # all targets %define build_targets %{globalfoundries_libs} %{skywater_libs} %{?addons_ext} %{?addons_osu} %if ! %{use_efab} %{lua: for target in string.gmatch(rpm.expand("%{skywater_libs}"), "[%w_-]+") do print("BuildRequires: open-pdk-skywater-"..target.."\n") end } %{lua: for target in string.gmatch(rpm.expand("%{globalfoundries_libs}"), "[%w_-]+") do print("BuildRequires: open-pdk-globalfoundries-"..target.."\n") end } BuildRequires: open-pdk-globalfoundries-gf180mcu_fd_pr %endif Requires: %{name}-gf180mcu_fd_sc_mcu7t5v0 Requires: %{name}-gf180mcu_fd_sc_mcu9t5v0 Requires: %{name}-sky130_fd_sc_hd %if %{have_ext} Requires: %{name}-sky130_ml_xx_hd Requires: %{name}-sky130_sram_macros %endif %description Set in the efabless format having "libs.ref" (IP) and "libs.tech" for the EDA tool setup. %{lua: for target in string.gmatch(rpm.expand("%{build_targets}"), "[%w_-]+") do print("%package "..target.."\n") print("Summary: Efabless format Open PDKs for "..target.."\n") print("Requires: efabless-open-pdks\n\n") print("%description "..target.."\n") print("Efabless format Open PDKs for "..target.." parts.\n") print("\n") end } %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} git log --format=fuller %build # use move to save build space sed -i 's|copy_tree(stagingdir, writedir.*|shutil.rmtree(writedir); shutil.move(stagingdir, writedir)|' common/staging_install.py # fix wrong paths sed -i 's|klayout/$::env(PDK).lyt|klayout/tech/$::env(PDK).lyt|g' sky130/openlane/config.tcl sed -i 's|klayout/$::env(PDK).lyp|klayout/tech/$::env(PDK).lyp|g' sky130/openlane/config.tcl sed -i 's|klayout/$::env(PDK)_mr.drc|klayout/drc/$::env(PDK)_mr.drc|g' sky130/openlane/config.tcl # fix errors cp sky130/openlane/rules.openrcx.sky130A.min.calibre sky130/openlane/rules.openrcx.sky130B.min.calibre cp sky130/openlane/rules.openrcx.sky130A.max.calibre sky130/openlane/rules.openrcx.sky130B.max.calibre cp sky130/openlane/rules.openrcx.sky130A.nom.calibre sky130/openlane/rules.openrcx.sky130B.nom.calibre # build %configure \ --enable-klayout \ --enable-magic \ --enable-netgen \ --enable-irsim \ --enable-openlane \ --enable-qflow \ --enable-xschem \ %if %{have_ext} --enable-klayout \ --enable-precheck-sky130 \ --enable-sram-sky130 \ --enable-sram-space-sky130 \ --enable-xschem-sky130 \ --enable-alpha-sky130 \ %else --disable-klayout \ --disable-precheck-sky130 \ --disable-sram-sky130 \ --disable-xschem-sky130 \ --disable-alpha-sky130 \ %endif %if %{have_osu} --enable-osu-t12-sky130 \ --enable-osu-t15-sky130 \ --enable-osu-t18-sky130 \ --enable-osu-sc-gf180mcu \ %endif --with-sky130-link-targets=none \ %if ! %{use_efab} --enable-sky130-pdk=%{_datadir}/open-pdk-skywater \ --enable-primitive-sky130=%{_datadir}/open-pdk-skywater/libraries/sky130_fd_pr/latest \ --enable-io-sky130=%{_datadir}/open-pdk-skywater/libraries/sky130_fd_io/latest \ --enable-sc-hs-sky130=%{_datadir}/open-pdk-skywater/libraries/sky130_fd_sc_hs/latest \ --enable-sc-ms-sky130=%{_datadir}/open-pdk-skywater/libraries/sky130_fd_sc_ms/latest \ --enable-sc-ls-sky130=%{_datadir}/open-pdk-skywater/libraries/sky130_fd_sc_ls/latest \ --enable-sc-lp-sky130=%{_datadir}/open-pdk-skywater/libraries/sky130_fd_sc_lp/latest \ --enable-sc-hd-sky130=%{_datadir}/open-pdk-skywater/libraries/sky130_fd_sc_hd/latest \ --enable-sc-hdll-sky130=%{_datadir}/open-pdk-skywater/libraries/sky130_fd_sc_hdll/latest \ --enable-sc-hvl-sky130=%{_datadir}/open-pdk-skywater/libraries/sky130_fd_sc_hvl/latest \ %else --enable-sky130-pdk \ %endif --with-gf180mcu-link-targets=none \ %if ! %{use_efab} --enable-gf180mcu-pdk=%{_datadir}/open-pdk-globalfoundries \ --enable-io-gf180mcu=%{_datadir}/open-pdk-globalfoundries/libraries/gf180mcu_fd_io/latest \ --enable-primitive-gf180mcu=%{_datadir}/open-pdk-globalfoundries/libraries/gf180mcu_fd_pr/latest \ --enable-sc-7t5v0-gf180mcu=%{_datadir}/open-pdk-globalfoundries/libraries/gf180mcu_fd_sc_mcu7t5v0/latest \ --enable-sc-9t5v0-gf180mcu=%{_datadir}/open-pdk-globalfoundries/libraries/gf180mcu_fd_sc_mcu9t5v0/latest \ --enable-sram-gf180mcu=%{_datadir}/open-pdk-globalfoundries/macros/gf180mcu_fd_ip_sram/latest %else --enable-gf180mcu-pdk %endif # seq download prerequisites for m in $(find . -name Makefile); do for s in $(cat $m | grep prerequisites: | cut -d':' -f2); do make -C $(dirname $m) $s done done # build make %install # pdks install make VERBOSE=1 DESTDIR=%{buildroot} install # environment setup mkdir -p %{buildroot}/etc/profile.d echo "export PDK_ROOT=%{_datadir}/pdk" \ > %{buildroot}/etc/profile.d/openpdk.sh # fix python shebags find %{buildroot} -type f -name '*.py' \ -exec sed -i 's|#!/bin/env python3|#/usr/bin/python3|' {} \; %files %doc README.* %doc docs.txt %license LICENSE %exclude %{_datadir}/pdk/*/libs.ref/* %{_datadir}/* %{_sysconfdir}/profile.d/openpdk.sh %{lua: for target in string.gmatch(rpm.expand("%{build_targets}"), "[%w_-]+") do print("%files "..target.."\n") print(rpm.expand("%{_datadir}/pdk/*/libs.ref/")..target.."/*\n\n") end } %changelog * Tue Mar 29 2022 Cristian Balint - github update releases