%define have_ext 1 %define have_osu 1 %global pkgvers 0 %global scdate0 20221211 %global schash0 8f01d8f4d17110a53080cafc52c7762b94101f1d %global branch0 master %global source0 https://github.com/RTimothyEdwards/open_pdks.git %global scdate1 20221210 %global schash1 ddb7619b305f7a775f455a580592381949176b04 %global branch1 main %global source1 https://github.com/StefanSchippers/xschem_sky130.git %global scdate2 20201202 %global schash2 6eb3b0718552b034f1bf1870285ff135e3fb2dcb %global branch2 master %global source2 https://github.com/PaulSchulz/sky130_pschulz_xx_hd.git %global scdate3 20211020 %global schash3 c2333394e0b0b9d9d71185678a8d8087715d5e3b %global branch3 main %global source3 https://github.com/efabless/sky130_sram_macros.git %global scdate4 20220505 %global schash4 ac90ef0c622a9377a16b5218d9da3ac4169eeaaf %global branch4 main %global source4 https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t12.git %global scdate5 20220504 %global schash5 95d1c19abb47e1b2945847acb4e817b1b8417c43 %global branch5 main %global source5 https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t15.git %global scdate6 20220426 %global schash6 aa2b509f3c8f32ea94fdb55ac9768754667c1658 %global branch6 main %global source6 https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t18.git %global scdate7 20221209 %global schash7 af5e77881f6f45825e31c6ec8223ec452c2bdd8f %global branch7 main %global source7 https://github.com/stineje/globalfoundries-pdk-libs-gf180mcu_osu_sc %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: efabless-open-pdks Version: 1.0.372 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_9T gf180mcu_osu_sc_12T %endif # all targets %define build_targets %{globalfoundries_libs} %{skywater_libs} %{?addons_ext} %{?addons_osu} %{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 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 %if %{have_ext} git clone --depth 1 -n -b %{branch1} %{source1} sources/xschem_sky130 git -C sources/xschem_sky130 fetch --depth 1 origin %{schash1} git -C sources/xschem_sky130 reset --hard %{schash1} git -C sources/xschem_sky130 log --format=fuller git clone --depth 1 -n -b %{branch2} %{source2} sources/sky130_ml_xx_hd git -C sources/sky130_ml_xx_hd fetch --depth 1 origin %{schash2} git -C sources/sky130_ml_xx_hd reset --hard %{schash2} git -C sources/sky130_ml_xx_hd log --format=fuller git clone --depth 1 -n -b %{branch3} %{source3} sources/sky130_sram_macros git -C sources/sky130_sram_macros fetch --depth 1 origin %{schash3} git -C sources/sky130_sram_macros reset --hard %{schash3} git -C sources/sky130_sram_macros log --format=fuller %endif %if %{have_osu} git clone --depth 1 -n -b %{branch4} %{source4} sources/sky130_osu_t12 git -C sources/sky130_osu_t12 fetch --depth 1 origin %{schash4} git -C sources/sky130_osu_t12 reset --hard %{schash4} git -C sources/sky130_osu_t12 log --format=fuller git clone --depth 1 -n -b %{branch5} %{source5} sources/sky130_osu_t15 git -C sources/sky130_osu_t15 fetch --depth 1 origin %{schash5} git -C sources/sky130_osu_t15 reset --hard %{schash5} git -C sources/sky130_osu_t15 log --format=fuller git clone --depth 1 -n -b %{branch6} %{source6} sources/sky130_osu_t18 git -C sources/sky130_osu_t18 fetch --depth 1 origin %{schash6} git -C sources/sky130_osu_t18 reset --hard %{schash6} git -C sources/sky130_osu_t18 log --format=fuller git clone --depth 1 -n -b %{branch7} %{source7} sources/gf180mcu_osu_sc git -C sources/gf180mcu_osu_sc fetch --depth 1 origin %{schash7} git -C sources/gf180mcu_osu_sc reset --hard %{schash7} git -C sources/gf180mcu_osu_sc log --format=fuller %endif %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-sram-sky130 \ --enable-xschem-sky130 \ --enable-alpha-sky130 \ %else --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=source \ --with-gf180mcu-link-targets=source \ --enable-sky130-pdk=%{_datadir}/open-pdk-skywater \ --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 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("/%{_datadir}/pdk/*/libs.ref/"..target.."/*\n\n") end } %changelog * Tue Mar 29 2022 Cristian Balint - github update releases