diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 1706c9d9..52d6b61e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -44,7 +44,7 @@ body: You also need to upload some files so we can reproduce your issue. If a step fails, you can create a reproducible by going - into the step directory, then typing `openlane.steps create-reproducible -d .` + into the step directory, then typing `openlane.steps create-reproducible` A new directory called `reproducible` should be created. Zip or tarball that directory then upload by clicking and dragging the file to diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45e272d5..b18bdb8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,9 +121,7 @@ jobs: - uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - access-tokens = github.com=${{ env.GITHUB_TOKEN }} - extra-substituters = https://openlane.cachix.org - extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E= + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - uses: DeterminateSystems/magic-nix-cache-action@main - name: Build with Nix uses: ./.github/actions/build_nix @@ -148,9 +146,7 @@ jobs: - uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - access-tokens = github.com=${{ env.GITHUB_TOKEN }} - extra-substituters = https://openlane.cachix.org - extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E= + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - uses: DeterminateSystems/magic-nix-cache-action@main - name: Build with Nix uses: ./.github/actions/build_nix @@ -182,9 +178,7 @@ jobs: - uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - access-tokens = github.com=${{ env.GITHUB_TOKEN }} - extra-substituters = https://openlane.cachix.org - extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E= + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - uses: DeterminateSystems/magic-nix-cache-action@main # For some reason, GHA Macs are far more aggressively rate-limited with # Volare than Linux @@ -232,6 +226,9 @@ jobs: fi echo "NIX_SYSTEM=$nix_system" >> $GITHUB_ENV - uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - uses: DeterminateSystems/magic-nix-cache-action@main - name: Build with Nix uses: ./.github/actions/build_nix @@ -301,6 +298,9 @@ jobs: git status || true tree .git || true - uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - uses: DeterminateSystems/magic-nix-cache-action@main - name: Build with Nix uses: ./.github/actions/build_nix diff --git a/Changelog.md b/Changelog.md index 45a33a61..edbc822e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -14,6 +14,21 @@ ## Documentation --> +# 2.1.4 + +## Steps + +* `OpenROAD.STA*PNR` + * New environment variable made accessible to SDC files used during + Multi-Corner STA steps, `OPENLANE_SDC_IDEAL_CLOCKS`, set to `1` for pre-PnR. + Band-aid until the SDC situation is properly discussed and addressed (in a + potentially breaking change.) + * Fixed issue where the clock was always propagated after `STAPrePNR` + regardless the information in the SDC file. + * For backwards compatibility, `STAPrePNR` unsets all propagated clocks and + the rest set all propagated clocks IF the SDC file lacks the strings + `set_propagated_clock` or `unset_propagated_clock`. + # 2.1.3 ## Tool Updates diff --git a/docs/source/getting_started/common/nix_installation/installation_linux.md b/docs/source/getting_started/common/nix_installation/installation_linux.md index 1886f15d..ec0226ee 100644 --- a/docs/source/getting_started/common/nix_installation/installation_linux.md +++ b/docs/source/getting_started/common/nix_installation/installation_linux.md @@ -30,7 +30,7 @@ $ sudo apt-get install -y curl After that, simply run this command: ```console -$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm --extra-conf " +$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix/pr/1145 | sh -s -- install --no-confirm --extra-conf " extra-substituters = https://openlane.cachix.org extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E= " diff --git a/docs/source/getting_started/common/nix_installation/installation_macos.md b/docs/source/getting_started/common/nix_installation/installation_macos.md index 28ebfc23..9b5f329f 100644 --- a/docs/source/getting_started/common/nix_installation/installation_macos.md +++ b/docs/source/getting_started/common/nix_installation/installation_macos.md @@ -15,7 +15,7 @@ Simply run this (entire) command in `Terminal.app`: ```console -$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm --extra-conf " +$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix/pr/1145 | sh -s -- install --no-confirm --extra-conf " extra-substituters = https://openlane.cachix.org extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E= " diff --git a/docs/source/getting_started/common/nix_installation/installation_win.md b/docs/source/getting_started/common/nix_installation/installation_win.md index 2e454760..6282621c 100644 --- a/docs/source/getting_started/common/nix_installation/installation_win.md +++ b/docs/source/getting_started/common/nix_installation/installation_win.md @@ -59,7 +59,7 @@ $ sudo apt-get install -y curl Then install Nix by running the following command: ```console -$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm --extra-conf " +$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix/pr/1145 | sh -s -- install --no-confirm --extra-conf " extra-substituters = https://openlane.cachix.org extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E= " diff --git a/openlane/scripts/base.sdc b/openlane/scripts/base.sdc index 59283986..dc4359f5 100644 --- a/openlane/scripts/base.sdc +++ b/openlane/scripts/base.sdc @@ -71,3 +71,10 @@ set_clock_transition $::env(CLOCK_TRANSITION_CONSTRAINT) $clocks puts "\[INFO] Setting timing derate to: $::env(TIME_DERATING_CONSTRAINT)%" set_timing_derate -early [expr 1-[expr $::env(TIME_DERATING_CONSTRAINT) / 100]] set_timing_derate -late [expr 1+[expr $::env(TIME_DERATING_CONSTRAINT) / 100]] + +if { [info exists ::env(OPENLANE_SDC_IDEAL_CLOCKS)] && $::env(OPENLANE_SDC_IDEAL_CLOCKS) } { + unset_propagated_clock [all_clocks] +} else { + set_propagated_clock [all_clocks] +} + diff --git a/openlane/scripts/openroad/common/io.tcl b/openlane/scripts/openroad/common/io.tcl index f3ba72fa..567ea1ce 100644 --- a/openlane/scripts/openroad/common/io.tcl +++ b/openlane/scripts/openroad/common/io.tcl @@ -58,6 +58,16 @@ proc read_current_sdc {} { exit 1 } + if { ![string_in_file $::env(_SDC_IN) "set_propagated_clock"] && ![string_in_file $::env(_SDC_IN) "unset_propagated_clock"] } { + if { [info exists ::env(OPENLANE_SDC_IDEAL_CLOCKS)] && $::env(OPENLANE_SDC_IDEAL_CLOCKS) } { + puts "\[INFO\] No information on clock propagation in input SDC file-- unpropagating all clocks." + unset_propagated_clock [all_clocks] + } else { + puts "\[INFO\] No information on clock propagation in input SDC file-- propagating all clocks." + set_propagated_clock [all_clocks] + } + } + # Restore Environment unset ::env(IO_PCT) unset ::env(SYNTH_TIMING_DERATE) diff --git a/openlane/scripts/openroad/sta/corner.tcl b/openlane/scripts/openroad/sta/corner.tcl index ce3f4525..5a85b5ed 100644 --- a/openlane/scripts/openroad/sta/corner.tcl +++ b/openlane/scripts/openroad/sta/corner.tcl @@ -44,10 +44,6 @@ if { [namespace exists ::ord] } { } read_spefs -if { $::env(STEP_ID) != "OpenROAD.STAPrePNR"} { - set_propagated_clock [all_clocks] -} - set corner [lindex [sta::corners] 0] sta::set_cmd_corner $corner @@ -328,6 +324,26 @@ write_metric_num "timing__setup_r2r__ws__corner:[$corner name]" $worst_r2r_setup write_metric_int "timing__setup_r2r_vio__count__corner:[$corner name]" $r2r_setup_vios puts "%OL_END_REPORT" +puts "%OL_CREATE_REPORT unpropagated.rpt" + +foreach clock [all_clocks] { + if { ![get_property $clock propagated] } { + puts "[get_property $clock full_name]" + } +} + +puts "%OL_END_REPORT" + + +# puts "%OL_CREATE_REPORT clock.rpt" + +# foreach clock [all_clocks] { +# report_clock_properties $clock +# report_clock_latency -clock $clock +# report_clock_min_period -clocks [get_property $clock name] +# } + +# puts "%OL_END_REPORT" write_sdfs write_libs diff --git a/openlane/steps/__main__.py b/openlane/steps/__main__.py index e50a9166..668ae8bc 100644 --- a/openlane/steps/__main__.py +++ b/openlane/steps/__main__.py @@ -447,13 +447,15 @@ def create_reproducible( @command(formatter_settings=formatter_settings, hidden=True) -@argument( - "step_dir", +@o( + "-d", + "--step-dir", type=Path( exists=False, file_okay=False, dir_okay=True, ), + help="The step directory from which to create the test. If provided, --config and the input state can be omitted, and vice versa.", default=None, ) @o( @@ -465,8 +467,20 @@ def create_reproducible( ), default=None, ) +@argument( + "step_dir_arg", + type=Path( + exists=False, + file_okay=False, + dir_okay=True, + ), + default=None, + required=False, + nargs=1, +) @pass_context -def create_test(ctx, step_dir, output): +def create_test(ctx, step_dir, step_dir_arg, output): + step_dir = step_dir or step_dir_arg or os.getcwd() config = os.path.join(step_dir, "config.json") state_in = os.path.join(step_dir, "state_in.json") if output is None: diff --git a/openlane/steps/openroad.py b/openlane/steps/openroad.py index d3cabffd..0e44f879 100644 --- a/openlane/steps/openroad.py +++ b/openlane/steps/openroad.py @@ -702,12 +702,21 @@ class STAPrePNR(MultiCornerSTA): If timing information is not available for a Macro, the macro in question will be black-boxed. + + During this step, the special variable `OPENLANE_SDC_IDEAL_CLOCKS` is + exposed to SDC files with a value of `1`. We encourage PNR SDC files to use + ideal clocks at this stage based on this variable's existence and value. """ id = "OpenROAD.STAPrePNR" name = "STA (Pre-PnR)" long_name = "Static Timing Analysis (Pre-PnR)" + def prepare_env(self, env: Dict, state: State) -> Dict: + env = super().prepare_env(env, state) + env["OPENLANE_SDC_IDEAL_CLOCKS"] = "1" + return env + def run_corner( self, state_in: State, current_env: Dict[str, Any], corner: str, corner_dir: str ) -> Dict[str, Any]: @@ -743,6 +752,10 @@ class STAPostPNR(STAPrePNR): Performs multi-corner `Static Timing Analysis `_ using OpenSTA on the post-PnR Verilog netlist, with extracted parasitics for both the top-level module and any associated macros. + + During this step, the special variable `OPENLANE_SDC_IDEAL_CLOCKS` is + exposed to SDC files with a value of `0`. We encourage PNR SDC files to use + propagated clocks at this stage based on this variable's existence and value. """ id = "OpenROAD.STAPostPNR" @@ -764,6 +777,7 @@ def prepare_env(self, env: dict, state: State) -> dict: env = super().prepare_env(env, state) if signoff_sdc_file := self.config["SIGNOFF_SDC_FILE"]: env["_SDC_IN"] = signoff_sdc_file + env["OPENLANE_SDC_IDEAL_CLOCKS"] = "0" return env def filter_unannotated_report( diff --git a/pyproject.toml b/pyproject.toml index 679bdc1b..c02bdce4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "openlane" -version = "2.1.3" +version = "2.1.4" description = "An infrastructure for implementing chip design flows" authors = ["Efabless Corporation and Contributors "] readme = "Readme.md" diff --git a/test/designs b/test/designs index 567e4dc0..2682d228 160000 --- a/test/designs +++ b/test/designs @@ -1 +1 @@ -Subproject commit 567e4dc0290ea42d91b1d286705de71409ba2ccc +Subproject commit 2682d228448208ce45094b65346ba17611a783b2 diff --git a/test/steps/all b/test/steps/all index 15681153..c970ed0d 160000 --- a/test/steps/all +++ b/test/steps/all @@ -1 +1 @@ -Subproject commit 1568115321d08bd67bb40e0f82413f27b878cd7e +Subproject commit c970ed0d2b8eeef1cdf40fc57b9b8f22a17b6faa