%global pkgvers 0 %global scdate0 20240111 %global schash0 9dbd8b5ea2bd891bed4dcc97df5c7439083f0368 %global branch0 master %global source0 https://github.com/The-OpenROAD-Project/OpenLane.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: openlane Version: 2024.01.12 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Automated RTL to GDSII flow License: Apache 2.0 BuildArch: noarch URL: https://github.com/The-OpenROAD-Project/OpenLane BuildRequires: make git tcl tcllib openroad environment-modules BuildRequires: python3 python3-devel python3-setuptools BuildRequires: git tcl openroad klayout efabless-open-pdks BuildRequires: qflow padring magic netgen cvc yosys dr-cu cu-gr verilator BuildRequires: ncurses python3-click python3-pyyaml glibc-langpack-en BuildRequires: python3-libparse klayout-python3 Requires: git tcl tcllib openroad klayout efabless-open-pdks Requires: qflow padring magic netgen cvc yosys dr-cu cu-gr verilator Requires: ncurses python3-click python3-pyyaml environment-modules Requires: python3-libparse klayout-python3 %{!?tcl_version: %global tcl_version %(echo 'puts $tcl_version' | tclsh)} %{!?tcl_sitelib: %global tcl_sitelib %{_datadir}/tcl%{tcl_version}} %description OpenLane is an automated RTL to GDSII flow based on several components including OpenROAD, Yosys, Magic, Netgen, Fault, CVC, SPEF-Extractor, CU-GR, Klayout and a number of custom scripts for design exploration and optimization. The flow performs full ASIC implementation steps from RTL all the way down to GDSII. %package designs Summary: Example files for %{name} Requires: %{name} = %{version}-%{release} %description designs This package contains example files for %{name} %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 # disable version checks sed -i 's|exec python3.*verify_versions.py|exec /bin/true|g' scripts/tcl_commands/all.tcl # set relative run path #sed -i 's|set run_path $::env(DESIGN_DIR)/runs/$tag|set run_path "[pwd]/$tag"|g' scripts/tcl_commands/all.tcl #sed -i 's|os.getcwd(), run_path, "config.tcl"|run_path, "config.tcl"|g' scripts/config/config.py # insert proper version info sed -i 's|exec git.*HEAD|exec echo "%{schash0}"|g' flow.tcl sed -i 's|exec cat .*installed_version|exec echo "%{version}-%{scdate0}.%{pkgvers}.git%{sshort0}%{?dist}"|g' flow.tcl # fix path sed -i '/env(SCRIPTS_DIR)\/utils\/utils.tcl/d' scripts/openroad/common/pdn_cfg.tcl %if 0%{?rhel} == 8 # fix pycli sed -i 's|from-json|from_json|' scripts/tcl_commands/all.tcl %endif # fix odb api sed -i 's|odb.read_def(self.db,|odb.read_def(self.db.getTech(),|g' scripts/odbpy/reader.py %install # prepare mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_datadir}/%{name} mkdir -p %{buildroot}%{tcl_sitelib}/%{name}-utils # install cp -rp scripts %{buildroot}%{_datadir}/%{name}/ cp -rp designs %{buildroot}%{_datadir}/%{name}/ cp -rp configuration %{buildroot}%{_datadir}/%{name}/ install -m755 flow.tcl %{buildroot}%{_datadir}/%{name}/ mv -f %{buildroot}%{_datadir}/%{name}/scripts/tcl_commands \ %{buildroot}%{tcl_sitelib}/%{name}-tcl_commands mv -f %{buildroot}%{_datadir}/%{name}/scripts/utils/*.tcl \ %{buildroot}%{tcl_sitelib}/%{name}-utils/ # install system wide wrapper cat << EOF > %{buildroot}%{_bindir}/%{name}-flow #!/bin/sh echo 'OpenLane wrapper via [flow.tcl]' set -x export PDK="sky130A" export PDK_ROOT="%{_datadir}/pdk" export STD_CELL_LIBRARY=sky130_fd_sc_hd export STD_CELL_LIBRARY_OPT=sky130_fd_sc_hd export OPENLANE_ROOT="%{_datadir}/%{name}" trap 'tput init' err exit unset module unset _module_raw %{_datadir}/%{name}/flow.tcl \${@} EOF chmod 755 %{buildroot}%{_bindir}/%{name}-flow %check # mpi off unset module unset _module_raw # term unset TERM export LANG=C.UTF-8 export LC_ALL=C.UTF-8 export TCLLIBPATH=%{buildroot}%{tcl_sitelib}/ # run test design export PDK="sky130A" export PDK_ROOT="%{_datadir}/pdk" export STD_CELL_LIBRARY=sky130_fd_sc_hd export STD_CELL_LIBRARY_OPT=sky130_fd_sc_hd export OPENLANE_ROOT=%{buildroot}%{_datadir}/%{name}/ export PYTHONPATH="%{python3_sitelib}:%{python3_sitearch}" # copy a sample design rm -rf /tmp/my-spm cp -r %{buildroot}/usr/share/openlane/designs/spm /tmp/my-spm %{buildroot}%{_datadir}/%{name}/flow.tcl -design /tmp/my-spm %files %doc README.md %doc docs %license LICENSE %{_bindir}/openlane-flow %dir %{_datadir}/%{name} %{_datadir}/%{name}/flow.tcl %{_datadir}/%{name}/scripts %{_datadir}/%{name}/configuration %{tcl_sitelib}/* %files designs %{_datadir}/%{name}/designs %changelog * Wed Mar 30 2022 Cristian Balint - github update releases