From 41aaa13c8b41f50015d7de077d95ad8026603c7a Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Thu, 8 Aug 2024 16:05:45 +0300 Subject: [PATCH 1/3] Match exact regex when checking for regex using in set_global_connections used by `PDN_MACRO_CONNECTIONS` (#525) * `OpenROAD.*` * Fixed an issue where the validation for `PDN_MACRO_CONNECTIONS` would partially match net names, unlike OpenROAD itself * Internal string escaping consistency --- Changelog.md | 10 ++++++++++ openlane/scripts/magic/extract_spice.tcl | 2 +- openlane/scripts/magic/gds/extras_mag.tcl | 2 +- openlane/scripts/magic/lef.tcl | 14 +++++++------- openlane/scripts/openroad/common/io.tcl | 2 +- openlane/scripts/openroad/common/resizer.tcl | 2 +- .../openroad/common/set_global_connections.tcl | 6 +++--- .../scripts/openroad/common/set_power_nets.tcl | 2 +- .../openroad/common/set_routing_layers.tcl | 4 ++-- openlane/scripts/openroad/cts.tcl | 8 ++++---- openlane/scripts/openroad/floorplan.tcl | 14 +++++++------- openlane/scripts/openroad/gpl.tcl | 6 +++--- openlane/scripts/openroad/ioplacer.tcl | 2 +- openlane/scripts/openroad/irdrop.tcl | 2 +- .../openroad/sta/check_macro_instances.tcl | 6 +++--- .../scripts/yosys/construct_abc_script.tcl | 10 +++++----- openlane/scripts/yosys/synthesize.tcl | 18 +++++++++--------- pyproject.toml | 2 +- 18 files changed, 61 insertions(+), 51 deletions(-) diff --git a/Changelog.md b/Changelog.md index 1711bc770..41e8b61aa 100644 --- a/Changelog.md +++ b/Changelog.md @@ -14,6 +14,16 @@ ## Documentation --> +# 2.1.2 + +## Steps + +* `OpenROAD.*` + + * Fixed an issue where the validation for `PDN_MACRO_CONNECTIONS` would + partially match net names, unlike OpenROAD itself + * Internal string escaping consistency + # 2.1.1 ## Steps diff --git a/openlane/scripts/magic/extract_spice.tcl b/openlane/scripts/magic/extract_spice.tcl index c25799f49..6e71713c8 100644 --- a/openlane/scripts/magic/extract_spice.tcl +++ b/openlane/scripts/magic/extract_spice.tcl @@ -39,7 +39,7 @@ if { [info exists ::env(MAGIC_EXT_ABSTRACT_CELLS)] } { } } if { $matched == 0 } { - puts "\[WARNING] Failed to match the experssion '$expression' with cells in the design" + puts "\[WARNING\] Failed to match the experssion '$expression' with cells in the design" } } foreach cell $matching_cells { diff --git a/openlane/scripts/magic/gds/extras_mag.tcl b/openlane/scripts/magic/gds/extras_mag.tcl index 250b89308..3865a704e 100755 --- a/openlane/scripts/magic/gds/extras_mag.tcl +++ b/openlane/scripts/magic/gds/extras_mag.tcl @@ -40,7 +40,7 @@ if { [info exist ::env(EXTRA_GDS_FILES)] } { # maglefs reserve the original names file rename $::env(STEP_DIR)/$design_name.mag $::env(STEP_DIR)/$design_name.full.mag - puts "\[INFO] Saved mag view from $gds_file under $::env(STEP_DIR)" + puts "\[INFO\] Saved mag view from $gds_file under $::env(STEP_DIR)" } } diff --git a/openlane/scripts/magic/lef.tcl b/openlane/scripts/magic/lef.tcl index 52bbe6648..38531f03f 100644 --- a/openlane/scripts/magic/lef.tcl +++ b/openlane/scripts/magic/lef.tcl @@ -28,7 +28,7 @@ if { [info exists ::env(VDD_NETS)] || [info exists ::env(GND_NETS)] } { # they both must exist and be equal in length # current assumption: they cannot have a common ground if { ! [info exists ::env(VDD_NETS)] || ! [info exists ::env(GND_NETS)] } { - puts stderr "\[ERROR] VDD_NETS and GND_NETS must *both* either be defined or undefined" + puts stderr "\[ERROR\] VDD_NETS and GND_NETS must *both* either be defined or undefined" exit -1 } } else { @@ -36,22 +36,22 @@ if { [info exists ::env(VDD_NETS)] || [info exists ::env(GND_NETS)] } { set ::env(GND_NETS) $::env(GND_PIN) } -puts "\[INFO] Ignoring '$::env(VDD_NETS) $::env(GND_NETS)'" +puts "\[INFO\] Ignoring '$::env(VDD_NETS) $::env(GND_NETS)'" lef nocheck $::env(VDD_NETS) $::env(GND_NETS) # Write LEF set lefwrite_opts [list] if { $::env(MAGIC_WRITE_FULL_LEF) } { - puts "\[INFO] Writing non-abstract (full) LEF…" + puts "\[INFO\] Writing non-abstract (full) LEF…" } else { lappend lefwrite_opts -hide - puts "\[INFO] Writing abstract LEF…" + puts "\[INFO\] Writing abstract LEF…" } if { $::env(MAGIC_WRITE_LEF_PINONLY) } { - puts "\[INFO] Specifying -pinonly (nets connected to pins on the same layer are declared as obstructions)…" + puts "\[INFO\] Specifying -pinonly (nets connected to pins on the same layer are declared as obstructions)…" lappend lefwrite_opts -pinonly } else { - puts "\[INFO] Not specifiying -pinonly (nets connected to pins on the same layer are declared as part of the pin)…" + puts "\[INFO\] Not specifiying -pinonly (nets connected to pins on the same layer are declared as part of the pin)…" } lef write $::env(STEP_DIR)/$::env(DESIGN_NAME).lef {*}$lefwrite_opts -puts "\[INFO] LEF Write Complete." +puts "\[INFO\] LEF Write Complete." diff --git a/openlane/scripts/openroad/common/io.tcl b/openlane/scripts/openroad/common/io.tcl index 0402147fa..f3ba72fa3 100644 --- a/openlane/scripts/openroad/common/io.tcl +++ b/openlane/scripts/openroad/common/io.tcl @@ -31,7 +31,7 @@ proc env_var_used {file var} { proc read_current_sdc {} { if { ![info exists ::env(_SDC_IN)]} { - puts "\[INFO] _SDC_IN not found. Not reading an SDC file." + puts "\[INFO\] _SDC_IN not found. Not reading an SDC file." return } diff --git a/openlane/scripts/openroad/common/resizer.tcl b/openlane/scripts/openroad/common/resizer.tcl index 9777a0f8a..a9707c473 100644 --- a/openlane/scripts/openroad/common/resizer.tcl +++ b/openlane/scripts/openroad/common/resizer.tcl @@ -25,7 +25,7 @@ proc load_rsz_corners {args} { } if { $i == "0" } { - puts stderr "\[WARNING] No resizer-specific timing information read." + puts stderr "\[WARNING\] No resizer-specific timing information read." return } diff --git a/openlane/scripts/openroad/common/set_global_connections.tcl b/openlane/scripts/openroad/common/set_global_connections.tcl index 8453b0070..13a48b433 100644 --- a/openlane/scripts/openroad/common/set_global_connections.tcl +++ b/openlane/scripts/openroad/common/set_global_connections.tcl @@ -14,7 +14,7 @@ # Power nets proc set_global_connections {} { - puts "\[INFO] Setting global connections..." + puts "\[INFO\] Setting global connections..." if { [info exists ::env(PDN_ENABLE_GLOBAL_CONNECTIONS) ] } { if { $::env(PDN_ENABLE_GLOBAL_CONNECTIONS) == 1 } { foreach power_pin $::env(SCL_POWER_PINS) { @@ -50,13 +50,13 @@ proc set_global_connections {} { set matched 0 foreach cell [[ord::get_db_block] getInsts] { - if { [regexp "\^$instance_name" [$cell getName]] } { + if { [regexp "\^$instance_name\$" [$cell getName]] } { set matched 1 puts "$instance_name matched with [$cell getName]" } } if { $matched != 1 } { - puts "\[ERROR] No match found for regular expression '$instance_name' defined in PDN_MACRO_CONNECTIONS." + puts "\[ERROR\] No match found for regular expression '$instance_name' defined in PDN_MACRO_CONNECTIONS." exit 1 } diff --git a/openlane/scripts/openroad/common/set_power_nets.tcl b/openlane/scripts/openroad/common/set_power_nets.tcl index 8d1f4a164..951b5f749 100644 --- a/openlane/scripts/openroad/common/set_power_nets.tcl +++ b/openlane/scripts/openroad/common/set_power_nets.tcl @@ -16,7 +16,7 @@ if { [info exists ::env(VDD_NETS)] || [info exists ::env(GND_NETS)] } { # they both must exist and be equal in length # current assumption: they cannot have a common ground if { ! [info exists ::env(VDD_NETS)] || ! [info exists ::env(GND_NETS)] } { - puts stderr "\[ERROR] VDD_NETS and GND_NETS must *both* either be defined or undefined" + puts stderr "\[ERROR\] VDD_NETS and GND_NETS must *both* either be defined or undefined" exit -1 } set ::env(VDD_NET) [lindex $::env(VDD_NETS) 0] diff --git a/openlane/scripts/openroad/common/set_routing_layers.tcl b/openlane/scripts/openroad/common/set_routing_layers.tcl index 747ad575a..950e0f47d 100644 --- a/openlane/scripts/openroad/common/set_routing_layers.tcl +++ b/openlane/scripts/openroad/common/set_routing_layers.tcl @@ -24,7 +24,7 @@ if { [info exists ::env(RT_CLOCK_MAX_LAYER)]} { set clock_max_layer $::env(RT_CLOCK_MAX_LAYER) } -puts "\[INFO] Setting signal min routing layer to: $signal_min_layer and clock min routing layer to $clock_min_layer. " -puts "\[INFO] Setting signal max routing layer to: $signal_max_layer and clock max routing layer to $clock_max_layer. " +puts "\[INFO\] Setting signal min routing layer to: $signal_min_layer and clock min routing layer to $clock_min_layer. " +puts "\[INFO\] Setting signal max routing layer to: $signal_max_layer and clock max routing layer to $clock_max_layer. " set_routing_layers -signal [subst $signal_min_layer]-[subst $signal_max_layer] -clock [subst $clock_min_layer]-[subst $clock_max_layer] diff --git a/openlane/scripts/openroad/cts.tcl b/openlane/scripts/openroad/cts.tcl index 99bf67286..bfbe7dd20 100755 --- a/openlane/scripts/openroad/cts.tcl +++ b/openlane/scripts/openroad/cts.tcl @@ -35,9 +35,9 @@ if { [info exists ::env(CTS_MAX_SLEW)] } { } configure_cts_characterization {*}$cts_characterization_args -puts "\[INFO] Performing clock tree synthesis…" -puts "\[INFO] Looking for the following net(s): $::env(CLOCK_NET)" -puts "\[INFO] Running Clock Tree Synthesis…" +puts "\[INFO\] Performing clock tree synthesis…" +puts "\[INFO\] Looking for the following net(s): $::env(CLOCK_NET)" +puts "\[INFO\] Running Clock Tree Synthesis…" set arg_list [list] @@ -60,7 +60,7 @@ clock_tree_synthesis {*}$arg_list set_propagated_clock [all_clocks] estimate_parasitics -placement -puts "\[INFO] Repairing long wires on clock nets…" +puts "\[INFO\] Repairing long wires on clock nets…" # CTS leaves a long wire from the pad to the clock tree root. repair_clock_nets -max_wire_length $::env(CTS_CLK_MAX_WIRE_LENGTH) diff --git a/openlane/scripts/openroad/floorplan.tcl b/openlane/scripts/openroad/floorplan.tcl index e5bbffed4..f3e750f43 100755 --- a/openlane/scripts/openroad/floorplan.tcl +++ b/openlane/scripts/openroad/floorplan.tcl @@ -48,7 +48,7 @@ if { [info exists ::env(EXTRA_SITES)] } { } } -puts "\[INFO] Using $::env(FP_SIZING) sizing for the floorplan." +puts "\[INFO\] Using $::env(FP_SIZING) sizing for the floorplan." if {$::env(FP_SIZING) == "absolute"} { if { [llength $::env(DIE_AREA)] != 4 } { @@ -72,7 +72,7 @@ if {$::env(FP_SIZING) == "absolute"} { puts stderr "Invalid core area string '$::env(CORE_AREA)'." exit -1 } - puts "\[INFO] Using the set CORE_AREA; ignoring core margin parameters" + puts "\[INFO\] Using the set CORE_AREA; ignoring core margin parameters" } lappend arg_list -die_area $::env(DIE_AREA) @@ -90,7 +90,7 @@ if { [info exists ::env(FP_OBSTRUCTIONS)] } { set urx [expr int([expr [lindex $obstruction 2] * $::dbu])] set ury [expr int([expr [lindex $obstruction 3] * $::dbu])] odb::dbBlockage_create [ord::get_db_block] $llx $lly $urx $ury - puts "\[INFO] Created floorplan obstruction at $obstruction (µm)" + puts "\[INFO\] Created floorplan obstruction at $obstruction (µm)" } } @@ -107,11 +107,11 @@ if { [info exists ::env(PL_SOFT_OBSTRUCTIONS)] } { set ury [expr int([expr [lindex $obstruction 3] * $::dbu])] set obstruction_o [odb::dbBlockage_create [ord::get_db_block] $llx $lly $urx $ury] set _ [$obstruction_o setSoft] - puts "\[INFO] Created soft placement obstruction at $obstruction (µm)" + puts "\[INFO\] Created soft placement obstruction at $obstruction (µm)" } } -puts "\[INFO] Extracting DIE_AREA and CORE_AREA from the floorplan" +puts "\[INFO\] Extracting DIE_AREA and CORE_AREA from the floorplan" set ::env(DIE_AREA) [list] set ::env(CORE_AREA) [list] @@ -131,8 +131,8 @@ foreach coord $core_area { lappend ::env(CORE_AREA) [expr {1.0 * $coord / $::dbu}] } -puts "\[INFO] Floorplanned on a die area of $::env(DIE_AREA) (µm)." -puts "\[INFO] Floorplanned on a core area of $::env(CORE_AREA) (µm)." +puts "\[INFO\] Floorplanned on a die area of $::env(DIE_AREA) (µm)." +puts "\[INFO\] Floorplanned on a core area of $::env(CORE_AREA) (µm)." source $::env(TRACKS_INFO_FILE_PROCESSED) diff --git a/openlane/scripts/openroad/gpl.tcl b/openlane/scripts/openroad/gpl.tcl index 369e48afa..1652456d3 100755 --- a/openlane/scripts/openroad/gpl.tcl +++ b/openlane/scripts/openroad/gpl.tcl @@ -26,9 +26,9 @@ foreach inst $::insts { } if { !$placement_needed } { - puts stderr "\[WARNING] All instances are FIXED/FIRM." - puts stderr "\[WARNING] No need to perform global placement." - puts stderr "\[WARNING] Skipping…" + puts stderr "\[WARNING\] All instances are FIXED/FIRM." + puts stderr "\[WARNING\] No need to perform global placement." + puts stderr "\[WARNING\] Skipping…" write_views exit 0 } diff --git a/openlane/scripts/openroad/ioplacer.tcl b/openlane/scripts/openroad/ioplacer.tcl index 6a156a2a6..6e0aa2ab1 100755 --- a/openlane/scripts/openroad/ioplacer.tcl +++ b/openlane/scripts/openroad/ioplacer.tcl @@ -55,7 +55,7 @@ if { $::env(FP_PPL_MODE) == "annealing" } { set HMETAL $::env(FP_IO_HLAYER) set VMETAL $::env(FP_IO_VLAYER) -puts "\[INFO] place_pins args: $arg_list" +puts "\[INFO\] place_pins args: $arg_list" place_pins {*}$arg_list \ -random_seed 42 \ -hor_layers $HMETAL \ diff --git a/openlane/scripts/openroad/irdrop.tcl b/openlane/scripts/openroad/irdrop.tcl index 9df20df70..f5545707f 100644 --- a/openlane/scripts/openroad/irdrop.tcl +++ b/openlane/scripts/openroad/irdrop.tcl @@ -31,7 +31,7 @@ if { [info exists ::env(VSRC_LOC_FILES)] } { } puts "%OL_END_REPORT" } else { - puts "\[INFO] Using voltage extracted from lib ($::env(LIB_VOLTAGE)V) for power nets and 0V for ground nets…" + puts "\[INFO\] Using voltage extracted from lib ($::env(LIB_VOLTAGE)V) for power nets and 0V for ground nets…" puts "%OL_CREATE_REPORT irdrop.rpt" foreach net "$::env(VDD_NETS)" { set arg_list [list] diff --git a/openlane/scripts/openroad/sta/check_macro_instances.tcl b/openlane/scripts/openroad/sta/check_macro_instances.tcl index dde097457..d6aa20448 100644 --- a/openlane/scripts/openroad/sta/check_macro_instances.tcl +++ b/openlane/scripts/openroad/sta/check_macro_instances.tcl @@ -30,10 +30,10 @@ foreach {instance_name macro_name} $::env(_check_macro_instances) { set instances [get_cells -hierarchical $instance_name] set instance_count [llength $instances] if { $instance_count < 1 } { - puts "\[ERROR] No macro instance $instance_name found." + puts "\[ERROR\] No macro instance $instance_name found." incr error_count } elseif { $instance_count > 1 } { - puts "\[ERROR] Macro instance name $instance_name matches multiple cells." + puts "\[ERROR\] Macro instance name $instance_name matches multiple cells." incr error_count } else { # The next line doesn't actually matter because this is Tcl but I'd feel @@ -42,7 +42,7 @@ foreach {instance_name macro_name} $::env(_check_macro_instances) { set master_name [get_property $instance ref_name] if { $master_name != $macro_name } { - puts "\[ERROR] Instance $instance_name is configured as an instance of macro $macro_name, but is an instance of $master_name." + puts "\[ERROR\] Instance $instance_name is configured as an instance of macro $macro_name, but is an instance of $master_name." incr error_count } } diff --git a/openlane/scripts/yosys/construct_abc_script.tcl b/openlane/scripts/yosys/construct_abc_script.tcl index 00b793098..2503a9978 100644 --- a/openlane/scripts/yosys/construct_abc_script.tcl +++ b/openlane/scripts/yosys/construct_abc_script.tcl @@ -78,8 +78,8 @@ namespace eval yosys_ol { set strategy_parts [split $strategy] proc malformed_strategy {strategy} { - log -stderr "\[ERROR] Misformatted SYNTH_STRATEGY (\"$strategy\")." - log -stderr "\[ERROR] Correct format is \"DELAY 0-[expr [llength $yosys_ol::delay_scripts]-1]|AREA 0-[expr [llength $yosys_ol::area_scripts]-1]\"." + log -stderr "\[ERROR\] Misformatted SYNTH_STRATEGY (\"$strategy\")." + log -stderr "\[ERROR\] Correct format is \"DELAY 0-[expr [llength $yosys_ol::delay_scripts]-1]|AREA 0-[expr [llength $yosys_ol::area_scripts]-1]\"." exit 1 } @@ -91,17 +91,17 @@ namespace eval yosys_ol { set strategy_type_idx [lindex $strategy_parts 1] if { $strategy_type != "AREA" && $strategy_type != "DELAY" } { - log -stderr "\[ERROR] AREA|DELAY tokens not found. ($strategy_type)" + log -stderr "\[ERROR\] AREA|DELAY tokens not found. ($strategy_type)" malformed_strategy $strategy } if { $strategy_type == "DELAY" && $strategy_type_idx >= [llength $yosys_ol::delay_scripts] } { - log -stderr "\[ERROR] strategy index ($strategy_type_idx) is too high." + log -stderr "\[ERROR\] strategy index ($strategy_type_idx) is too high." malformed_strategy $strategy } if { $strategy_type == "AREA" && $strategy_type_idx >= [llength $yosys_ol::area_scripts] } { - log -stderr "\[ERROR] strategy index ($strategy_type_idx) is too high." + log -stderr "\[ERROR\] strategy index ($strategy_type_idx) is too high." malformed_strategy $strategy } diff --git a/openlane/scripts/yosys/synthesize.tcl b/openlane/scripts/yosys/synthesize.tcl index 7f4014f8a..0324b11e1 100644 --- a/openlane/scripts/yosys/synthesize.tcl +++ b/openlane/scripts/yosys/synthesize.tcl @@ -100,24 +100,24 @@ if { [info exists ::env(SYNTH_TRISTATE_MAP)] } { } set adder_type $::env(SYNTH_ADDER_TYPE) if { !($adder_type in [list "YOSYS" "FA" "RCA" "CSA"]) } { - log -stderr "\[ERROR] Misformatted SYNTH_ADDER_TYPE (\"$::env(SYNTH_ADDER_TYPE)\")." - log -stderr "\[ERROR] Correct format is \"YOSYS|FA|RCA|CSA\"." + log -stderr "\[ERROR\] Misformatted SYNTH_ADDER_TYPE (\"$::env(SYNTH_ADDER_TYPE)\")." + log -stderr "\[ERROR\] Correct format is \"YOSYS|FA|RCA|CSA\"." exit 1 } if { $adder_type == "RCA"} { if { [info exists ::env(SYNTH_RCA_MAP)] } { - log "\[INFO] Applying ripple carry adder mapping from '$::env(RIPPLE_CARRY_ADDER_MAP)'..." + log "\[INFO\] Applying ripple carry adder mapping from '$::env(RIPPLE_CARRY_ADDER_MAP)'..." techmap -map $::env(RIPPLE_CARRY_ADDER_MAP) } } elseif { $adder_type == "CSA"} { if { [info exists ::env(SYNTH_CSA_MAP)] } { - log "\[INFO] Applying carry-select adder mapping from '$::env(SYNTH_CSA_MAP)'..." + log "\[INFO\] Applying carry-select adder mapping from '$::env(SYNTH_CSA_MAP)'..." techmap -map $::env(SYNTH_CSA_MAP) } } elseif { $adder_type == "FA"} { if { [info exists ::env(SYNTH_FA_MAP)] } { set fa_map true - log "\[INFO] Applying carry-select adder mapping from '$::env(SYNTH_FA_MAP)'..." + log "\[INFO\] Applying carry-select adder mapping from '$::env(SYNTH_FA_MAP)'..." } } @@ -141,21 +141,21 @@ tee -o "$report_dir/pre_techmap.log" stat {*}$lib_args # Techmaps if { $tbuf_map } { log {mapping tbuf} - log "\[INFO] Applying tri-state buffer mapping from '$::env(SYNTH_TRISTATE_MAP)'..." + log "\[INFO\] Applying tri-state buffer mapping from '$::env(SYNTH_TRISTATE_MAP)'..." techmap -map $::env(SYNTH_TRISTATE_MAP) simplemap } if { $fa_map } { - log "\[INFO] Applying full-adder mapping from '$::env(SYNTH_FA_MAP)'..." + log "\[INFO\] Applying full-adder mapping from '$::env(SYNTH_FA_MAP)'..." techmap -map $::env(SYNTH_FA_MAP) } if { [info exists ::env(SYNTH_LATCH_MAP)] } { - log "\[INFO] Applying latch mapping from '$::env(SYNTH_LATCH_MAP)'..." + log "\[INFO\] Applying latch mapping from '$::env(SYNTH_LATCH_MAP)'..." techmap -map $::env(SYNTH_LATCH_MAP) simplemap } if { [info exists ::env(SYNTH_EXTRA_MAPPING_FILE)] } { - log "\[INFO] Applying extra mappings from '$::env(SYNTH_EXTRA_MAPPING_FILE)'..." + log "\[INFO\] Applying extra mappings from '$::env(SYNTH_EXTRA_MAPPING_FILE)'..." techmap -map $::env(SYNTH_EXTRA_MAPPING_FILE) } diff --git a/pyproject.toml b/pyproject.toml index af2203fe1..7fc4bcdd3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "openlane" -version = "2.1.1" +version = "2.1.2" description = "An infrastructure for implementing chip design flows" authors = ["Efabless Corporation and Contributors "] readme = "Readme.md" From 110d685d8d815cd68dc863214571eb624e2f90bd Mon Sep 17 00:00:00 2001 From: Mohamed Gaber Date: Sun, 25 Aug 2024 13:51:23 +0300 Subject: [PATCH 2/3] Add ORFS-inspired Diagram to Readme; use DetSys Nix Installer (#533) ## Documentation * Installation documents now use the less-brittle Determinate Systems Nix installer, as well as adding warnings about the `apt` version of Nix. * Added an OpenROAD Flow Scripts-inspired Diagram to the Readme. ## Testing * CI now uses Determinate Systems Nix Installer for all Nix installations as well as the Magic Nix Cache Action instead of the nonfunctional attempt at local file-based substituters --- .github/actions/build_nix/action.yml | 22 ------ .github/workflows/ci.yml | 52 ++++++------- Readme.md | 74 +++++++++++++------ .../nix_installation/installation_linux.md | 14 ++-- .../nix_installation/installation_macos.md | 9 +-- .../nix_installation/installation_win.md | 14 ++-- flake.lock | 6 +- 7 files changed, 101 insertions(+), 90 deletions(-) diff --git a/.github/actions/build_nix/action.yml b/.github/actions/build_nix/action.yml index 1e8701476..53535a02f 100644 --- a/.github/actions/build_nix/action.yml +++ b/.github/actions/build_nix/action.yml @@ -17,10 +17,6 @@ inputs: description: "The nix platform string to build for" required: true default: "x86_64-linux" - local_cache_key: - description: Key to use for the cache - required: false - default: "" run_tests: description: Whether to run unit tests and the smoke test required: false @@ -32,20 +28,10 @@ inputs: runs: using: "composite" steps: - - id: cache - name: Cache Derivation - uses: actions/cache@v3 - with: - key: ${{ inputs.local_cache_key }}-${{ inputs.nix_system }} - path: /tmp/${{ inputs.local_cache_key }} - id: Build name: Build shell: ${{ inputs.shell }} run: | - substituters='https://${{ inputs.cachix_cache }}.cachix.org https://cache.nixos.org' - if [ '${{ inputs.local_cache_key }}' = '' ]; then - substituters="file:///tmp/${{ inputs.local_cache_key }} $substituters" - fi echo "#################################################################" outPath=$(nix build\ --print-out-paths\ @@ -53,7 +39,6 @@ runs: --accept-flake-config\ --option system ${{ inputs.nix_system }}\ --extra-platforms ${{ inputs.nix_system }}\ - --option substituters "$substituters"\ .#devShells.${{ inputs.nix_system }}.default) echo "out-path=$outPath" >> $GITHUB_OUTPUT sudo du -hs /nix/store/* | sort -h | tail -n 20 @@ -78,13 +63,6 @@ runs: --accept-flake-config\ .#devShells.${{ inputs.nix_system }}.dev --command\ pytest --step-rx '.' --pdk-root="${{ inputs.pdk_root }}" -n auto - - name: Push to local cache - shell: ${{ inputs.shell }} - if: inputs.local_cache_key != '' && steps.cache.outputs.cache-hit != 'true' - run: | - nix copy\ - --to 'file:///tmp/${{ inputs.local_cache_key }}?compression=zstd¶llel-compression=true'\ - ${{ steps.build.outputs.out-path }} - name: Install + Push to Cachix shell: ${{ inputs.shell }} if: ${{ inputs.cachix_token != '' }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cfcd40f7..45e272d58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,21 +118,17 @@ jobs: - name: Set up GITHUB_TOKEN run: | echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - - name: Install Nix - run: | - sh <(curl -L https://nixos.org/nix/install) --yes --daemon --nix-extra-conf-file /dev/stdin <> $GITHUB_ENV + - 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= + - uses: DeterminateSystems/magic-nix-cache-action@main - name: Build with Nix uses: ./.github/actions/build_nix with: nix_system: x86_64-linux - local_cache_key: derivation-${{ github.run_id }} cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }} cachix_token: "${{ secrets.CACHIX_TOKEN }}" run_tests: "true" @@ -149,12 +145,17 @@ jobs: - name: Set up GITHUB_TOKEN run: | echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - - uses: DeterminateSystems/nix-installer-action@main # Using the DS Nix installer because it also sets up binfmt + - 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= + - uses: DeterminateSystems/magic-nix-cache-action@main - name: Build with Nix uses: ./.github/actions/build_nix with: nix_system: aarch64-linux - local_cache_key: derivation-${{ github.run_id }} cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }} cachix_token: "${{ secrets.CACHIX_TOKEN }}" run_tests: "true" @@ -178,17 +179,13 @@ jobs: - name: Set up GITHUB_TOKEN run: | echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - - name: Install Nix - run: | - sh <(curl -L https://nixos.org/nix/install) --yes --nix-extra-conf-file /dev/stdin <> $GITHUB_ENV + - 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= + - uses: DeterminateSystems/magic-nix-cache-action@main # For some reason, GHA Macs are far more aggressively rate-limited with # Volare than Linux - name: Cache sky130 PDK @@ -201,7 +198,6 @@ jobs: uses: ./.github/actions/build_nix with: nix_system: ${{ matrix.system.nix }} - local_cache_key: derivation-${{ github.run_id }} cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }} cachix_token: "${{ secrets.CACHIX_TOKEN }}" shell: "zsh {0}" @@ -236,11 +232,11 @@ jobs: fi echo "NIX_SYSTEM=$nix_system" >> $GITHUB_ENV - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main - name: Build with Nix uses: ./.github/actions/build_nix with: nix_system: ${{ env.NIX_SYSTEM }} - local_cache_key: derivation-${{ github.run_id }} cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }} - name: Build Docker Image @@ -304,14 +300,12 @@ jobs: run: | git status || true tree .git || true - - uses: DeterminateSystems/nix-installer-action@main - + - uses: DeterminateSystems/magic-nix-cache-action@main - name: Build with Nix uses: ./.github/actions/build_nix with: nix_system: x86_64-linux - local_cache_key: derivation-${{ github.run_id }} cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }} - name: Check Nix diff --git a/Readme.md b/Readme.md index ecf97818e..9dccf5fc8 100644 --- a/Readme.md +++ b/Readme.md @@ -32,23 +32,52 @@ started. You can discuss OpenLane 2 in the channel of the [Efabless Open Source Silicon Slack](https://invite.skywater.tools). -```python -from openlane.flows import Flow - -Classic = Flow.factory.get("Classic") - -flow = Classic( - { - "PDK": "sky130A", - "DESIGN_NAME": "spm", - "VERILOG_FILES": ["./src/spm.v"], - "CLOCK_PORT": "clk", - "CLOCK_PERIOD": 10, - }, - design_dir=".", -) - -flow.start() +```mermaid +timeline + title The OpenLane Infrastructure + RTL to Netlist + : Linting / Verilator + : Power Distribution Network Hierarchy / Yosys + : Synthesis / Yosys + : Synthesis / Design Compiler (with proprietary plugin) + : Multi-corner Netlist STA / OpenSTA + Floorplanning + : Floorplan Initialization / OpenROAD + : Manual Macro Placement / OpenDB + : Tap/Endcap Insertion / OpenROAD + : PDN Generation / OpenROAD + Placement + : Pin Placement (from config file) / OpenROAD, OpenDB + : Pin Placement (Random/Matching/Annealing) / OpenROAD + : Pin Placement (from template DEF) / OpenDB + : Global Placement / OpenROAD + : Resizer Design Repair (Post-GPL) / OpenROAD + : Detailed Placement / OpenROAD + Clock Tree Synthesis + : Clock-Tree Synthesis / OpenROAD + : Resizer Timing Repair (Post-CTS) / OpenROAD + Routing + : Global Routing / OpenROAD + : Resizer Design Repair (Post-GRT) / OpenROAD + : Diode Insertion on Ports / OpenDB + : Heuristic Diode Insertion / OpenDB + : Antenna Repair / OpenROAD + : Resizer Timing Repair (Post-GRT) / OpenROAD + : Detailed Routing / OpenROAD + : Row Filling / OpenROAD + Signoff (Timing) + : Parasitics Extraction / OpenROAD + : Multi-corner Static Timing Analysis / OpenSTA + : SI-Enabled Multi-corner Static Timing Analysis / PrimeTime (with proprietary plugin) + Signoff (Physical) + : GDSII Stream-Out / Magic + : GDSII Stream-Out / KLayout + : Magic vs. KLayout Stream XOR / KLayout + : Design Rule Checks / Magic + : Design Rule Checks / KLayout + : Spice Extraction / Magic + : Layout vs. Schematic / Netgen + : Equivalence Check (Alpha) / Yosys EQY ``` ## Try it out @@ -83,15 +112,18 @@ in the docs for more info. Do note you'll need to add `--dockerized` right after `openlane` in most CLI invocations. -### Python-only Installation (Advanced) +### Python-only Installation (Advanced, Not Recommended) -You'll need to bring your own compiled utilities, but otherwise, simply install -OpenLane as follows: +**You'll need to bring your own compiled utilities**, but otherwise, simply +install OpenLane as follows: ```sh python3 -m pip install --upgrade openlane ``` +Python-only installations are presently unsupported and entirely at your own +risk. + ## Usage In the root folder of the repository, you may invoke: @@ -127,7 +159,7 @@ If you use OpenLane in your research, please cite the following paper. doi={}} ``` -## License +## License and Information [The Apache License, version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt). 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 a30dda51a..1886f15d0 100644 --- a/docs/source/getting_started/common/nix_installation/installation_linux.md +++ b/docs/source/getting_started/common/nix_installation/installation_linux.md @@ -14,6 +14,11 @@ If you're looking to build a virtual machine, we recommend [Ubuntu 22.04](https: ## Installing Nix +```{warning} +Do **not** install Nix using `apt`. The version of Nix offered by `apt` is more +often than not severely out-of-date and may cause issues. +``` + You will need `curl` to install Nix. To install curl on Ubuntu, simply type in the following in your terminal: @@ -25,11 +30,10 @@ $ sudo apt-get install -y curl After that, simply run this command: ```console -$ sh <(curl -L https://nixos.org/nix/install) --yes --daemon --nix-extra-conf-file /dev/stdin < Date: Thu, 5 Sep 2024 13:43:42 +0300 Subject: [PATCH 3/3] Bundle stable OpenSTA alongside OpenROAD's version (#544) ## Tool Updates * Bundled a downgraded OpenSTA bundled with OpenLane to work around critical bug for hierarchical static timing analysis: https://github.com/parallaxsw/OpenSTA/issues/82 * Version of OpenSTA linked against OpenROAD unchanged. --- Changelog.md | 22 ++++++++++++++++++++++ default.nix | 4 ++-- flake.nix | 4 ++++ nix/opensta.nix | 1 + pyproject.toml | 2 +- 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 41e8b61aa..45a33a612 100644 --- a/Changelog.md +++ b/Changelog.md @@ -14,6 +14,28 @@ ## Documentation --> +# 2.1.3 + +## Tool Updates + +* Bundled an downgraded OpenSTA bundled with OpenLane to work around critical + bug for hierarchical static timing analysis: + https://github.com/parallaxsw/OpenSTA/issues/82 + * Version of OpenSTA linked against OpenROAD unchanged. + +## Testing + +* CI now uses DeterminateSystems Nix Installer for all Nix installations as well + as the Magic Nix Cache Action instead of the nonfunctional attempt at local + file-based substituters + +## Documentation + +* Installation documents now use the less-brittle Determinate Systems Nix + installer, as well as adding warnings about the `apt` version of Nix. + +* Added an OpenROAD Flow Scripts-inspired Diagram to the Readme. + # 2.1.2 ## Steps diff --git a/default.nix b/default.nix index 62039206a..2fe274ab0 100644 --- a/default.nix +++ b/default.nix @@ -23,7 +23,7 @@ libparse, magic-vlsi, netgen, - opensta, + opensta-stable, openroad, ruby, surelog, @@ -77,7 +77,7 @@ yosys-f4pga-sdc ] ++ lib.optionals (system == "x86_64-linux") [yosys-ghdl])) - opensta + opensta-stable openroad klayout netgen diff --git a/flake.nix b/flake.nix index 7b882df84..49235413d 100644 --- a/flake.nix +++ b/flake.nix @@ -69,6 +69,10 @@ }); colab-env = callPackage ./nix/colab-env.nix {}; opensta = callPackage ./nix/opensta.nix {}; + opensta-stable = callPackage ./nix/opensta.nix { + rev = "cc9eb1f12a0d5030aebc1f1428e4300480e30b40"; + sha256 = "sha256-/ShPD4xWq3lkN0Z3uONKm7i9eqbT+IU41UF7yIvDJy4="; + }; openroad-abc = callPackage ./nix/openroad-abc.nix {}; openroad = callPythonPackage ./nix/openroad.nix {}; openlane = callPythonPackage ./default.nix {}; diff --git a/nix/opensta.nix b/nix/opensta.nix index 9381bf6c9..ddf574173 100644 --- a/nix/opensta.nix +++ b/nix/opensta.nix @@ -78,6 +78,7 @@ clangStdenv.mkDerivation (finalAttrs: { meta = with lib; { description = "Gate-level static timing verifier"; homepage = "https://parallaxsw.com"; + mainProgram = "sta"; license = licenses.gpl3Plus; platforms = platforms.darwin ++ platforms.linux; }; diff --git a/pyproject.toml b/pyproject.toml index 7fc4bcdd3..679bdc1bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "openlane" -version = "2.1.2" +version = "2.1.3" description = "An infrastructure for implementing chip design flows" authors = ["Efabless Corporation and Contributors "] readme = "Readme.md"