librelane 2.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of librelane might be problematic. Click here for more details.
- librelane/__init__.py +38 -0
- librelane/__main__.py +479 -0
- librelane/__version__.py +43 -0
- librelane/common/__init__.py +63 -0
- librelane/common/cli.py +75 -0
- librelane/common/drc.py +246 -0
- librelane/common/generic_dict.py +319 -0
- librelane/common/metrics/__init__.py +35 -0
- librelane/common/metrics/__main__.py +413 -0
- librelane/common/metrics/library.py +354 -0
- librelane/common/metrics/metric.py +186 -0
- librelane/common/metrics/util.py +279 -0
- librelane/common/misc.py +456 -0
- librelane/common/ring_buffer.py +63 -0
- librelane/common/tcl.py +80 -0
- librelane/common/toolbox.py +549 -0
- librelane/common/tpe.py +41 -0
- librelane/common/types.py +116 -0
- librelane/config/__init__.py +32 -0
- librelane/config/__main__.py +155 -0
- librelane/config/config.py +1025 -0
- librelane/config/flow.py +490 -0
- librelane/config/pdk_compat.py +255 -0
- librelane/config/preprocessor.py +464 -0
- librelane/config/removals.py +45 -0
- librelane/config/variable.py +743 -0
- librelane/container.py +285 -0
- librelane/env_info.py +320 -0
- librelane/examples/spm/config.yaml +33 -0
- librelane/examples/spm/pin_order.cfg +14 -0
- librelane/examples/spm/src/impl.sdc +73 -0
- librelane/examples/spm/src/signoff.sdc +68 -0
- librelane/examples/spm/src/spm.v +73 -0
- librelane/examples/spm/verify/spm_tb.v +106 -0
- librelane/examples/spm-user_project_wrapper/SPM_example.v +286 -0
- librelane/examples/spm-user_project_wrapper/base_sdc_file.sdc +145 -0
- librelane/examples/spm-user_project_wrapper/config-tut.json +12 -0
- librelane/examples/spm-user_project_wrapper/config.json +13 -0
- librelane/examples/spm-user_project_wrapper/defines.v +66 -0
- librelane/examples/spm-user_project_wrapper/template.def +7656 -0
- librelane/examples/spm-user_project_wrapper/user_project_wrapper.v +123 -0
- librelane/flows/__init__.py +24 -0
- librelane/flows/builtins.py +18 -0
- librelane/flows/classic.py +327 -0
- librelane/flows/cli.py +463 -0
- librelane/flows/flow.py +1049 -0
- librelane/flows/misc.py +71 -0
- librelane/flows/optimizing.py +179 -0
- librelane/flows/sequential.py +367 -0
- librelane/flows/synth_explore.py +173 -0
- librelane/help/__main__.py +39 -0
- librelane/logging/__init__.py +40 -0
- librelane/logging/logger.py +323 -0
- librelane/open_pdks_rev +1 -0
- librelane/plugins.py +21 -0
- librelane/py.typed +0 -0
- librelane/scripts/base.sdc +80 -0
- librelane/scripts/klayout/Readme.md +2 -0
- librelane/scripts/klayout/open_design.py +63 -0
- librelane/scripts/klayout/render.py +121 -0
- librelane/scripts/klayout/stream_out.py +176 -0
- librelane/scripts/klayout/xml_drc_report_to_json.py +45 -0
- librelane/scripts/klayout/xor.drc +120 -0
- librelane/scripts/magic/Readme.md +1 -0
- librelane/scripts/magic/common/read.tcl +114 -0
- librelane/scripts/magic/def/antenna_check.tcl +35 -0
- librelane/scripts/magic/def/mag.tcl +19 -0
- librelane/scripts/magic/def/mag_gds.tcl +79 -0
- librelane/scripts/magic/drc.tcl +78 -0
- librelane/scripts/magic/extract_spice.tcl +98 -0
- librelane/scripts/magic/gds/drc_batch.tcl +74 -0
- librelane/scripts/magic/gds/erase_box.tcl +32 -0
- librelane/scripts/magic/gds/extras_mag.tcl +45 -0
- librelane/scripts/magic/gds/mag_with_pointers.tcl +31 -0
- librelane/scripts/magic/get_bbox.tcl +11 -0
- librelane/scripts/magic/lef/extras_maglef.tcl +61 -0
- librelane/scripts/magic/lef/maglef.tcl +26 -0
- librelane/scripts/magic/lef.tcl +57 -0
- librelane/scripts/magic/open.tcl +28 -0
- librelane/scripts/magic/wrapper.tcl +21 -0
- librelane/scripts/netgen/setup.tcl +28 -0
- librelane/scripts/odbpy/apply_def_template.py +49 -0
- librelane/scripts/odbpy/cell_frequency.py +107 -0
- librelane/scripts/odbpy/check_antenna_properties.py +116 -0
- librelane/scripts/odbpy/contextualize.py +109 -0
- librelane/scripts/odbpy/defutil.py +573 -0
- librelane/scripts/odbpy/diodes.py +373 -0
- librelane/scripts/odbpy/disconnected_pins.py +305 -0
- librelane/scripts/odbpy/eco_buffer.py +181 -0
- librelane/scripts/odbpy/eco_diode.py +139 -0
- librelane/scripts/odbpy/filter_unannotated.py +100 -0
- librelane/scripts/odbpy/io_place.py +482 -0
- librelane/scripts/odbpy/ioplace_parser/__init__.py +23 -0
- librelane/scripts/odbpy/ioplace_parser/parse.py +147 -0
- librelane/scripts/odbpy/label_macro_pins.py +277 -0
- librelane/scripts/odbpy/lefutil.py +97 -0
- librelane/scripts/odbpy/placers.py +162 -0
- librelane/scripts/odbpy/power_utils.py +397 -0
- librelane/scripts/odbpy/random_place.py +57 -0
- librelane/scripts/odbpy/reader.py +250 -0
- librelane/scripts/odbpy/remove_buffers.py +173 -0
- librelane/scripts/odbpy/snap_to_grid.py +57 -0
- librelane/scripts/odbpy/wire_lengths.py +93 -0
- librelane/scripts/openroad/antenna_check.tcl +20 -0
- librelane/scripts/openroad/antenna_repair.tcl +31 -0
- librelane/scripts/openroad/basic_mp.tcl +24 -0
- librelane/scripts/openroad/buffer_list.tcl +10 -0
- librelane/scripts/openroad/common/dpl.tcl +24 -0
- librelane/scripts/openroad/common/dpl_cell_pad.tcl +26 -0
- librelane/scripts/openroad/common/grt.tcl +32 -0
- librelane/scripts/openroad/common/io.tcl +540 -0
- librelane/scripts/openroad/common/pdn_cfg.tcl +135 -0
- librelane/scripts/openroad/common/resizer.tcl +103 -0
- librelane/scripts/openroad/common/set_global_connections.tcl +78 -0
- librelane/scripts/openroad/common/set_layer_adjustments.tcl +31 -0
- librelane/scripts/openroad/common/set_power_nets.tcl +30 -0
- librelane/scripts/openroad/common/set_rc.tcl +75 -0
- librelane/scripts/openroad/common/set_routing_layers.tcl +30 -0
- librelane/scripts/openroad/cts.tcl +80 -0
- librelane/scripts/openroad/cut_rows.tcl +24 -0
- librelane/scripts/openroad/dpl.tcl +24 -0
- librelane/scripts/openroad/drt.tcl +37 -0
- librelane/scripts/openroad/fill.tcl +30 -0
- librelane/scripts/openroad/floorplan.tcl +145 -0
- librelane/scripts/openroad/gpl.tcl +88 -0
- librelane/scripts/openroad/grt.tcl +30 -0
- librelane/scripts/openroad/gui.tcl +37 -0
- librelane/scripts/openroad/insert_buffer.tcl +127 -0
- librelane/scripts/openroad/ioplacer.tcl +67 -0
- librelane/scripts/openroad/irdrop.tcl +51 -0
- librelane/scripts/openroad/pdn.tcl +52 -0
- librelane/scripts/openroad/rcx.tcl +32 -0
- librelane/scripts/openroad/repair_design.tcl +70 -0
- librelane/scripts/openroad/repair_design_postgrt.tcl +48 -0
- librelane/scripts/openroad/rsz_timing_postcts.tcl +68 -0
- librelane/scripts/openroad/rsz_timing_postgrt.tcl +70 -0
- librelane/scripts/openroad/sta/check_macro_instances.tcl +53 -0
- librelane/scripts/openroad/sta/corner.tcl +393 -0
- librelane/scripts/openroad/tapcell.tcl +25 -0
- librelane/scripts/openroad/write_views.tcl +27 -0
- librelane/scripts/pyosys/construct_abc_script.py +177 -0
- librelane/scripts/pyosys/json_header.py +84 -0
- librelane/scripts/pyosys/synthesize.py +493 -0
- librelane/scripts/pyosys/ys_common.py +153 -0
- librelane/scripts/tclsh/hello.tcl +1 -0
- librelane/state/__init__.py +24 -0
- librelane/state/__main__.py +61 -0
- librelane/state/design_format.py +195 -0
- librelane/state/state.py +359 -0
- librelane/steps/__init__.py +61 -0
- librelane/steps/__main__.py +510 -0
- librelane/steps/checker.py +637 -0
- librelane/steps/common_variables.py +340 -0
- librelane/steps/cvc_rv.py +169 -0
- librelane/steps/klayout.py +509 -0
- librelane/steps/magic.py +576 -0
- librelane/steps/misc.py +160 -0
- librelane/steps/netgen.py +253 -0
- librelane/steps/odb.py +1088 -0
- librelane/steps/openroad.py +2460 -0
- librelane/steps/openroad_alerts.py +102 -0
- librelane/steps/pyosys.py +640 -0
- librelane/steps/step.py +1571 -0
- librelane/steps/tclstep.py +288 -0
- librelane/steps/verilator.py +222 -0
- librelane/steps/yosys.py +371 -0
- librelane-2.4.0.dist-info/METADATA +169 -0
- librelane-2.4.0.dist-info/RECORD +170 -0
- librelane-2.4.0.dist-info/WHEEL +4 -0
- librelane-2.4.0.dist-info/entry_points.txt +9 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Copyright 2020 Efabless Corporation
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
source $::env(SCRIPTS_DIR)/magic/common/read.tcl
|
|
15
|
+
drc off
|
|
16
|
+
|
|
17
|
+
read_pdk_gds
|
|
18
|
+
gds noduplicates true
|
|
19
|
+
|
|
20
|
+
if { $::env(MAGIC_MACRO_STD_CELL_SOURCE) == "PDK" } {
|
|
21
|
+
read_macro_gds
|
|
22
|
+
} else {
|
|
23
|
+
read_macro_gds_blackbox
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
read_extra_gds
|
|
27
|
+
|
|
28
|
+
load (NEWCELL)
|
|
29
|
+
|
|
30
|
+
read_tech_lef
|
|
31
|
+
read_def
|
|
32
|
+
|
|
33
|
+
load $::env(DESIGN_NAME)
|
|
34
|
+
select top cell
|
|
35
|
+
|
|
36
|
+
if { $::env(MAGIC_ZEROIZE_ORIGIN) } {
|
|
37
|
+
# assuming scalegrid 1 2
|
|
38
|
+
# makes origin zero based on the minimum enclosing box
|
|
39
|
+
# all shapes will be within the block boundary
|
|
40
|
+
# lower left corner will become (0, 0)
|
|
41
|
+
puts "\[INFO\] Zeroizing Origin"
|
|
42
|
+
set bbox [box values]
|
|
43
|
+
set offset_x [lindex $bbox 0]
|
|
44
|
+
set offset_y [lindex $bbox 1]
|
|
45
|
+
move origin [expr {$offset_x/2}] [expr {$offset_y/2}]
|
|
46
|
+
puts "\[INFO\] Current Box Values: [box values]"
|
|
47
|
+
property FIXED_BBOX [box values]
|
|
48
|
+
} else {
|
|
49
|
+
# makes origin zero based on the DIEAREA as defined in the DEF
|
|
50
|
+
# file. Shapes can extend outside the block boundary.
|
|
51
|
+
# magic "lef write -hide" doesn't produce nice results in this
|
|
52
|
+
# case for shapes outside the boundary.
|
|
53
|
+
box [lindex $::env(DIE_AREA) 0]um [lindex $::env(DIE_AREA) 1]um [lindex $::env(DIE_AREA) 2]um [lindex $::env(DIE_AREA) 3]um
|
|
54
|
+
property FIXED_BBOX [box values]
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
select top cell
|
|
58
|
+
|
|
59
|
+
cellname filepath $::env(DESIGN_NAME) $::env(STEP_DIR)
|
|
60
|
+
|
|
61
|
+
save
|
|
62
|
+
|
|
63
|
+
load $::env(DESIGN_NAME)
|
|
64
|
+
|
|
65
|
+
select top cell
|
|
66
|
+
|
|
67
|
+
if { $::env(MAGIC_DISABLE_CIF_INFO) } {
|
|
68
|
+
cif *hier write disable
|
|
69
|
+
cif *array write disable
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
gds nodatestamp yes
|
|
73
|
+
|
|
74
|
+
if { $::env(MAGIC_GDS_POLYGON_SUBCELLS) } {
|
|
75
|
+
gds polygon subcells true
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
gds write $::env(SAVE_MAG_GDS)
|
|
79
|
+
puts "\[INFO\] GDS Write Complete"
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Copyright 2020 Efabless Corporation
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
if { $::env(MAGIC_DRC_USE_GDS) } {
|
|
16
|
+
gds read $::env(CURRENT_GDS)
|
|
17
|
+
} else {
|
|
18
|
+
source $::env(SCRIPTS_DIR)/magic/common/read.tcl
|
|
19
|
+
read_tech_lef
|
|
20
|
+
read_pdk_lef
|
|
21
|
+
read_macro_lef
|
|
22
|
+
read_def
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
set report_dir $::env(STEP_DIR)/reports
|
|
26
|
+
|
|
27
|
+
set drc_rpt_path $report_dir/drc_violations.magic.rpt
|
|
28
|
+
set fout [open $drc_rpt_path w]
|
|
29
|
+
set oscale [cif scale out]
|
|
30
|
+
set cell_name $::env(DESIGN_NAME)
|
|
31
|
+
magic::suspendall
|
|
32
|
+
puts stdout "\[INFO\] Loading $cell_name\n"
|
|
33
|
+
flush stdout
|
|
34
|
+
load $cell_name
|
|
35
|
+
select top cell
|
|
36
|
+
drc euclidean on
|
|
37
|
+
drc style drc(full)
|
|
38
|
+
drc check
|
|
39
|
+
set drcresult [drc listall why]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
set count 0
|
|
43
|
+
puts $fout "$cell_name"
|
|
44
|
+
puts $fout "----------------------------------------"
|
|
45
|
+
foreach {errtype coordlist} $drcresult {
|
|
46
|
+
puts $fout $errtype
|
|
47
|
+
puts $fout "----------------------------------------"
|
|
48
|
+
foreach coord $coordlist {
|
|
49
|
+
set bllx [expr {$oscale * [lindex $coord 0]}]
|
|
50
|
+
set blly [expr {$oscale * [lindex $coord 1]}]
|
|
51
|
+
set burx [expr {$oscale * [lindex $coord 2]}]
|
|
52
|
+
set bury [expr {$oscale * [lindex $coord 3]}]
|
|
53
|
+
set coords [format " %.3fum %.3fum %.3fum %.3fum" $bllx $blly $burx $bury]
|
|
54
|
+
puts $fout "$coords"
|
|
55
|
+
set count [expr {$count + 1} ]
|
|
56
|
+
}
|
|
57
|
+
puts $fout "----------------------------------------"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
puts $fout "\[INFO\] COUNT: $count"
|
|
61
|
+
puts $fout "\[INFO\] Should be divided by 3 or 4"
|
|
62
|
+
|
|
63
|
+
puts $fout ""
|
|
64
|
+
close $fout
|
|
65
|
+
|
|
66
|
+
puts stdout "\[INFO\] COUNT: $count"
|
|
67
|
+
puts stdout "\[INFO\] Should be divided by 3 or 4"
|
|
68
|
+
puts stdout "\[INFO\] DRC Checking DONE ($drc_rpt_path)"
|
|
69
|
+
flush stdout
|
|
70
|
+
|
|
71
|
+
set views_dir $::env(STEP_DIR)/views
|
|
72
|
+
file mkdir $views_dir
|
|
73
|
+
|
|
74
|
+
set mag_view $views_dir/$::env(DESIGN_NAME).drc.mag
|
|
75
|
+
puts stdout "\[INFO\] Saving mag view with DRC errors ($mag_view)"
|
|
76
|
+
# WARNING: changes the name of the cell; keep as last step
|
|
77
|
+
save $mag_view
|
|
78
|
+
puts stdout "\[INFO\] Saved"
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Copyright 2020-2022 Efabless Corporation
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
set f [open $::env(STEP_DIR)/cif_scale.txt "w"]
|
|
15
|
+
puts $f "[magic::i2u 1]"
|
|
16
|
+
close $f
|
|
17
|
+
|
|
18
|
+
if { $::env(MAGIC_EXT_USE_GDS) } {
|
|
19
|
+
gds read $::env(CURRENT_GDS)
|
|
20
|
+
} else {
|
|
21
|
+
source $::env(SCRIPTS_DIR)/magic/common/read.tcl
|
|
22
|
+
read_tech_lef
|
|
23
|
+
read_pdk_lef
|
|
24
|
+
read_macro_lef
|
|
25
|
+
read_extra_lef
|
|
26
|
+
read_def
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if { [info exists ::env(MAGIC_EXT_ABSTRACT_CELLS)] } {
|
|
30
|
+
set cells [cellname list allcells]
|
|
31
|
+
set matching_cells ""
|
|
32
|
+
foreach expression $::env(MAGIC_EXT_ABSTRACT_CELLS) {
|
|
33
|
+
set matched 0
|
|
34
|
+
foreach cell $cells {
|
|
35
|
+
if { [regexp $expression $cell] } {
|
|
36
|
+
puts "$cell matched with the expression '$expression'"
|
|
37
|
+
set matching_cells "$cell $matching_cells"
|
|
38
|
+
set matched 1
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if { $matched == 0 } {
|
|
42
|
+
puts "\[WARNING\] Failed to match the experssion '$expression' with cells in the design"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
foreach cell $matching_cells {
|
|
46
|
+
load $cell
|
|
47
|
+
property LEFview true
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if { [info exists ::env(MAGIC_EXT_ABSTRACT_CELLS_RX)] } {
|
|
52
|
+
set cells [cellname list allcells]
|
|
53
|
+
set matching_cells ""
|
|
54
|
+
foreach expression $::env(MAGIC_EXT_ABSTRACT_CELLS_RX) {
|
|
55
|
+
foreach cell $cells {
|
|
56
|
+
if { [regexp $expression $cell] } {
|
|
57
|
+
puts "$cell matched with $expression"
|
|
58
|
+
set matching_cells "$cell $matching_cells"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
foreach cell $matching_cells {
|
|
63
|
+
load $cell
|
|
64
|
+
property LEFview true
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
load $::env(DESIGN_NAME) -dereference
|
|
69
|
+
|
|
70
|
+
set backup $::env(PWD)
|
|
71
|
+
set extdir $::env(STEP_DIR)/extraction
|
|
72
|
+
set netlist $::env(STEP_DIR)/$::env(DESIGN_NAME).spice
|
|
73
|
+
|
|
74
|
+
file mkdir $extdir
|
|
75
|
+
cd $extdir
|
|
76
|
+
|
|
77
|
+
extract do local
|
|
78
|
+
extract no capacitance
|
|
79
|
+
extract no coupling
|
|
80
|
+
extract no resistance
|
|
81
|
+
extract no adjust
|
|
82
|
+
if { ! $::env(MAGIC_NO_EXT_UNIQUE) } {
|
|
83
|
+
extract unique
|
|
84
|
+
}
|
|
85
|
+
# extract warn all
|
|
86
|
+
extract
|
|
87
|
+
|
|
88
|
+
ext2spice lvs
|
|
89
|
+
|
|
90
|
+
# For designs where more than one top-level pin is connected to the same net
|
|
91
|
+
if { $::env(MAGIC_EXT_SHORT_RESISTOR) } {
|
|
92
|
+
ext2spice short resistor
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
ext2spice -o $netlist $::env(DESIGN_NAME).ext
|
|
96
|
+
|
|
97
|
+
cd $backup
|
|
98
|
+
feedback save $::env(STEP_DIR)/feedback.txt
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Copyright 2020 Efabless Corporation
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
if { [info exists ::env(TECH)] } {
|
|
16
|
+
tech load $::env(TECH)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
gds read $::env(GDS_INPUT)
|
|
20
|
+
|
|
21
|
+
proc custom_drc_save_report {{cellname ""} {outfile ""}} {
|
|
22
|
+
if {$outfile == ""} {set outfile "drc.out"}
|
|
23
|
+
|
|
24
|
+
set fout [open $outfile w]
|
|
25
|
+
set oscale [cif scale out]
|
|
26
|
+
|
|
27
|
+
# magic::suspendall
|
|
28
|
+
|
|
29
|
+
if {$cellname == ""} {
|
|
30
|
+
select top cell
|
|
31
|
+
set cellname [cellname list self]
|
|
32
|
+
set origname ""
|
|
33
|
+
} else {
|
|
34
|
+
set origname [cellname list self]
|
|
35
|
+
puts stdout "\[INFO\] Loading $cellname\n"
|
|
36
|
+
flush stdout
|
|
37
|
+
|
|
38
|
+
load $cellname
|
|
39
|
+
select top cell
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
drc check
|
|
43
|
+
set count [drc list count]
|
|
44
|
+
|
|
45
|
+
puts $fout "$cellname count: $count"
|
|
46
|
+
puts $fout "----------------------------------------"
|
|
47
|
+
set drcresult [drc listall why]
|
|
48
|
+
foreach {errtype coordlist} $drcresult {
|
|
49
|
+
puts $fout $errtype
|
|
50
|
+
puts $fout "----------------------------------------"
|
|
51
|
+
foreach coord $coordlist {
|
|
52
|
+
set bllx [expr {$oscale * [lindex $coord 0]}]
|
|
53
|
+
set blly [expr {$oscale * [lindex $coord 1]}]
|
|
54
|
+
set burx [expr {$oscale * [lindex $coord 2]}]
|
|
55
|
+
set bury [expr {$oscale * [lindex $coord 3]}]
|
|
56
|
+
set coords [format " %.3fum %.3fum %.3fum %.3fum" $bllx $blly $burx $bury]
|
|
57
|
+
puts $fout "$coords"
|
|
58
|
+
}
|
|
59
|
+
puts $fout "----------------------------------------"
|
|
60
|
+
}
|
|
61
|
+
puts $fout ""
|
|
62
|
+
|
|
63
|
+
if {$origname != ""} {
|
|
64
|
+
load $origname
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
# magic::resumeall
|
|
68
|
+
|
|
69
|
+
close $fout
|
|
70
|
+
puts "\[INFO\] DONE with $outfile\n"
|
|
71
|
+
#flush stdout
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
custom_drc_save_report $::env(DESIGN_NAME) $::env(REPORT_OUTPUT)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Copyright 2020-2022 Efabless Corporation
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
tech unlock *
|
|
16
|
+
|
|
17
|
+
gds read $::env(CURRENT_GDS)
|
|
18
|
+
|
|
19
|
+
set box_coordinates [list]
|
|
20
|
+
lappend box_coordinates {*}$::env(_tmp_mag_box_coordinates)
|
|
21
|
+
|
|
22
|
+
box [lindex box_coordinates 2]um [lindex box_coordinates 3]um [lindex box_coordinates 4]um [lindex box_coordinates 5]um
|
|
23
|
+
|
|
24
|
+
erase
|
|
25
|
+
select area
|
|
26
|
+
delete
|
|
27
|
+
|
|
28
|
+
select top cell
|
|
29
|
+
erase labels
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
gds write $::env(SAVE_GDS)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Copyright 2020 Efabless Corporation
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
# convert all external macros to mag views with GDS pointers
|
|
16
|
+
# we will only copy the GDS pointers from these files in the
|
|
17
|
+
# corresponding maglefs
|
|
18
|
+
|
|
19
|
+
drc off
|
|
20
|
+
|
|
21
|
+
gds readonly true
|
|
22
|
+
gds rescale false
|
|
23
|
+
|
|
24
|
+
if { $::env(MAGIC_GDS_POLYGON_SUBCELLS) } {
|
|
25
|
+
gds polygon subcells true
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if { [info exist ::env(EXTRA_GDS_FILES)] } {
|
|
29
|
+
set gds_files_in $::env(EXTRA_GDS_FILES)
|
|
30
|
+
foreach gds_file $gds_files_in {
|
|
31
|
+
gds read $gds_file
|
|
32
|
+
|
|
33
|
+
select top cell
|
|
34
|
+
set design_name [cellname list self]
|
|
35
|
+
|
|
36
|
+
cellname filepath $design_name $::env(STEP_DIR)
|
|
37
|
+
|
|
38
|
+
save
|
|
39
|
+
|
|
40
|
+
# maglefs reserve the original names
|
|
41
|
+
file rename $::env(STEP_DIR)/$design_name.mag $::env(STEP_DIR)/$design_name.full.mag
|
|
42
|
+
|
|
43
|
+
puts "\[INFO\] Saved mag view from $gds_file under $::env(STEP_DIR)"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Copyright 2020 Efabless Corporation
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
drc off
|
|
16
|
+
|
|
17
|
+
gds readonly true
|
|
18
|
+
gds rescale false
|
|
19
|
+
|
|
20
|
+
# This comes afterwards, so that it would contain GDS pointers
|
|
21
|
+
# And yes, we need to re-read the GDS we just generated…
|
|
22
|
+
gds read $::env(MAGIC_GDS)
|
|
23
|
+
|
|
24
|
+
cellname filepath $::env(DESIGN_NAME) $::env(signoff_tmpfiles)
|
|
25
|
+
save
|
|
26
|
+
|
|
27
|
+
set final_filepath $::env(signoff_tmpfiles)/gds_ptrs.mag
|
|
28
|
+
|
|
29
|
+
file rename -force $::env(signoff_tmpfiles)/$::env(DESIGN_NAME).mag $final_filepath
|
|
30
|
+
|
|
31
|
+
puts "\[INFO\] Wrote $final_filepath including GDS pointers."
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
gds read $::env(_GDS_IN)
|
|
2
|
+
load $::env(_MACRO_NAME_IN)
|
|
3
|
+
set properties [property]
|
|
4
|
+
foreach property [property] {
|
|
5
|
+
if {[lindex $property 0] == "FIXED_BBOX"} {
|
|
6
|
+
puts "%OL_METRIC_I llx [lindex $property 1]"
|
|
7
|
+
puts "%OL_METRIC_I lly [lindex $property 2]"
|
|
8
|
+
puts "%OL_METRIC_I urx [lindex $property 3]"
|
|
9
|
+
puts "%OL_METRIC_I ury [lindex $property 4]"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Copyright 2020 Efabless Corporation
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
# convert all external macros to maglef views with GDS_* pointers
|
|
16
|
+
|
|
17
|
+
drc off
|
|
18
|
+
|
|
19
|
+
if { [info exist ::env(EXTRA_LEFS)] } {
|
|
20
|
+
foreach lef_file $::env(EXTRA_LEFS) {
|
|
21
|
+
lef read $lef_file
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
cellname delete \(UNNAMED\)
|
|
26
|
+
|
|
27
|
+
foreach design_name [cellname list allcells] {
|
|
28
|
+
load $design_name
|
|
29
|
+
|
|
30
|
+
cellname filepath $design_name $::env(signoff_results)
|
|
31
|
+
|
|
32
|
+
save
|
|
33
|
+
|
|
34
|
+
# Copy GDS pointers from .full.mag files into .mag files
|
|
35
|
+
|
|
36
|
+
set gds_properties [list]
|
|
37
|
+
set fp [open $design_name.full.mag r]
|
|
38
|
+
|
|
39
|
+
set mag_lines [split [read $fp] "\n"]
|
|
40
|
+
foreach line $mag_lines {
|
|
41
|
+
if { [string first "string GDS_" $line] != -1 } {
|
|
42
|
+
lappend gds_properties $line
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
close $fp
|
|
46
|
+
|
|
47
|
+
set fp [open $design_name.mag r]
|
|
48
|
+
set mag_lines [split [read $fp] "\n"]
|
|
49
|
+
set new_mag_lines [list]
|
|
50
|
+
foreach line $mag_lines {
|
|
51
|
+
if { [string first "<< end >>" $line] != -1 } {
|
|
52
|
+
lappend new_mag_lines [join $gds_properties "\n"]
|
|
53
|
+
}
|
|
54
|
+
lappend new_mag_lines $line
|
|
55
|
+
}
|
|
56
|
+
close $fp
|
|
57
|
+
|
|
58
|
+
set fp [open $design_name.mag w]
|
|
59
|
+
puts $fp [join $new_mag_lines "\n"]
|
|
60
|
+
close $fp
|
|
61
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Copyright 2020 Efabless Corporation
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
drc off
|
|
16
|
+
|
|
17
|
+
lef read $::env(signoff_results)/$::env(DESIGN_NAME).lef
|
|
18
|
+
|
|
19
|
+
load $::env(DESIGN_NAME)
|
|
20
|
+
|
|
21
|
+
cellname rename $::env(DESIGN_NAME) $::env(DESIGN_NAME).lef
|
|
22
|
+
|
|
23
|
+
cellname filepath $::env(DESIGN_NAME).lef $::env(signoff_results)
|
|
24
|
+
save
|
|
25
|
+
|
|
26
|
+
puts "\[INFO\] DONE GENERATING MAGLEF VIEW"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Copyright 2020-2023 Efabless Corporation
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
drc off
|
|
15
|
+
if { $::env(MAGIC_LEF_WRITE_USE_GDS) } {
|
|
16
|
+
gds read $::env(CURRENT_GDS)
|
|
17
|
+
} else {
|
|
18
|
+
source $::env(SCRIPTS_DIR)/magic/common/read.tcl
|
|
19
|
+
read_tech_lef
|
|
20
|
+
read_pdk_gds
|
|
21
|
+
read_macro_gds
|
|
22
|
+
read_extra_gds
|
|
23
|
+
load (REFRESHLAYOUT?)
|
|
24
|
+
read_def
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if { [info exists ::env(VDD_NETS)] || [info exists ::env(GND_NETS)] } {
|
|
28
|
+
# they both must exist and be equal in length
|
|
29
|
+
# current assumption: they cannot have a common ground
|
|
30
|
+
if { ! [info exists ::env(VDD_NETS)] || ! [info exists ::env(GND_NETS)] } {
|
|
31
|
+
puts stderr "\[ERROR\] VDD_NETS and GND_NETS must *both* either be defined or undefined"
|
|
32
|
+
exit -1
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
set ::env(VDD_NETS) $::env(VDD_PIN)
|
|
36
|
+
set ::env(GND_NETS) $::env(GND_PIN)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
puts "\[INFO\] Ignoring '$::env(VDD_NETS) $::env(GND_NETS)'"
|
|
40
|
+
lef nocheck $::env(VDD_NETS) $::env(GND_NETS)
|
|
41
|
+
|
|
42
|
+
# Write LEF
|
|
43
|
+
set lefwrite_opts [list]
|
|
44
|
+
if { $::env(MAGIC_WRITE_FULL_LEF) } {
|
|
45
|
+
puts "\[INFO\] Writing non-abstract (full) LEF…"
|
|
46
|
+
} else {
|
|
47
|
+
lappend lefwrite_opts -hide
|
|
48
|
+
puts "\[INFO\] Writing abstract LEF…"
|
|
49
|
+
}
|
|
50
|
+
if { $::env(MAGIC_WRITE_LEF_PINONLY) } {
|
|
51
|
+
puts "\[INFO\] Specifying -pinonly (nets connected to pins on the same layer are declared as obstructions)…"
|
|
52
|
+
lappend lefwrite_opts -pinonly
|
|
53
|
+
} else {
|
|
54
|
+
puts "\[INFO\] Not specifiying -pinonly (nets connected to pins on the same layer are declared as part of the pin)…"
|
|
55
|
+
}
|
|
56
|
+
lef write $::env(STEP_DIR)/$::env(DESIGN_NAME).lef {*}$lefwrite_opts
|
|
57
|
+
puts "\[INFO\] LEF Write Complete."
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Copyright 2024 Efabless Corporation
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
source $::env(_TCL_ENV_IN)
|
|
15
|
+
|
|
16
|
+
if { $::env(MAGIC_GUI_USE_GDS) && [info exists ::env(CURRENT_GDS)] } {
|
|
17
|
+
gds read $::env(CURRENT_GDS)
|
|
18
|
+
} else {
|
|
19
|
+
source $::env(SCRIPTS_DIR)/magic/common/read.tcl
|
|
20
|
+
read_tech_lef
|
|
21
|
+
read_pdk_lef
|
|
22
|
+
read_macro_lef
|
|
23
|
+
read_def
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
set cell_name $::env(DESIGN_NAME)
|
|
27
|
+
load $cell_name
|
|
28
|
+
select top cell
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Copyright 2020-2022 Efabless Corporation
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
source $::env(_TCL_ENV_IN)
|
|
15
|
+
|
|
16
|
+
if {[catch {source $::env(_MAGIC_SCRIPT)} err]} {
|
|
17
|
+
puts "Error: $err"
|
|
18
|
+
exit 1
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exit 0
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
source $::env(_TCL_ENV_IN)
|
|
2
|
+
source $::env(NETGEN_SETUP)
|
|
3
|
+
|
|
4
|
+
#---------------------------------------------------------------
|
|
5
|
+
# Equate prefixed layout cells with corresponding source
|
|
6
|
+
foreach cell $cells1 {
|
|
7
|
+
set layout $cell
|
|
8
|
+
while {[regexp {([A-Z][A-Z0-9]_)(.*)} $layout match prefix cellname]} {
|
|
9
|
+
if {([lsearch $cells2 $cell] < 0) && \
|
|
10
|
+
([lsearch $cells2 $cellname] >= 0)} {
|
|
11
|
+
# netlist with the N names should always be the second netlist
|
|
12
|
+
equate classes "-circuit2 $cellname" "-circuit1 $cell"
|
|
13
|
+
puts stdout "Custom: Equating $cell in circuit 1 and $cellname in circuit 2"
|
|
14
|
+
}
|
|
15
|
+
set layout $cellname
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if { [info exists ::env(LVS_FLATTEN_CELLS)] } {
|
|
20
|
+
foreach cell $::env(LVS_FLATTEN_CELLS) {
|
|
21
|
+
if { [lsearch $cells1 "$cell"] >= 0 } {
|
|
22
|
+
flatten class "-circuit1 $cell"
|
|
23
|
+
}
|
|
24
|
+
if { [lsearch $cells2 "$cell"] >= 0 } {
|
|
25
|
+
flatten class "-circuit2 $cell"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|