lambdapdk 0.1.56__py3-none-any.whl → 0.2.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.
@@ -1,23 +1,18 @@
1
+ from pathlib import Path
1
2
 
2
- import os
3
- import siliconcompiler
4
- from lambdapdk import register_data_source
3
+ from lambdapdk import LambdaPDK, _LambdaPath
5
4
 
6
5
 
7
6
  pdk_rev = '0854e9bcd558b68c573149038b4c95706314e2f1'
8
7
 
9
8
 
10
- def register_ihp130_data_source(chip):
11
- chip.register_source(
12
- 'ihp130',
13
- path='git+https://github.com/IHP-GmbH/IHP-Open-PDK',
14
- ref=pdk_rev)
9
+ class _IHP130Path(_LambdaPath):
10
+ def __init__(self):
11
+ super().__init__()
12
+ self.set_dataroot("ihp130", "git+https://github.com/IHP-GmbH/IHP-Open-PDK", pdk_rev)
15
13
 
16
14
 
17
- ####################################################
18
- # PDK Setup
19
- ####################################################
20
- def setup():
15
+ class IHP130PDK(LambdaPDK, _IHP130Path):
21
16
  '''
22
17
  130nm BiCMOS Open Source PDK, dedicated for Analog/Digital, Mixed Signal and RF Design
23
18
 
@@ -38,110 +33,80 @@ def setup():
38
33
 
39
34
  * https://github.com/IHP-GmbH/IHP-Open-PDK
40
35
  '''
41
-
42
- foundry = 'Leibniz-Institut für innovative Mikroelektronik'
43
- process = 'ihp130'
44
- stackup = '5M2TL'
45
-
46
- node = 130
47
- # TODO: dummy numbers, only matter for cost estimation
48
- wafersize = 300
49
- hscribe = 0.1
50
- vscribe = 0.1
51
- edgemargin = 2
52
-
53
- lpdkdir = os.path.join('lambdapdk', 'ihp130', 'base')
54
-
55
- pdk = siliconcompiler.PDK(process, package='ihp130')
56
- register_ihp130_data_source(pdk)
57
- register_data_source(pdk)
58
-
59
- # process name
60
- pdk.set('pdk', process, 'foundry', foundry)
61
- pdk.set('pdk', process, 'node', node)
62
- pdk.set('pdk', process, 'version', pdk_rev)
63
- pdk.set('pdk', process, 'stackup', stackup)
64
- pdk.set('pdk', process, 'wafersize', wafersize)
65
- pdk.set('pdk', process, 'edgemargin', edgemargin)
66
- pdk.set('pdk', process, 'scribe', (hscribe, vscribe))
67
-
68
- # APR Setup
69
- # TODO: remove libtype
70
- for tool in ('openroad', 'klayout', 'magic'):
71
- # Add unithd for backwards compatibility
72
- pdk.set('pdk', process, 'aprtech', tool, stackup, '9t', 'lef',
73
- 'ihp-sg13g2/libs.ref/sg13g2_stdcell/lef/sg13g2_tech.lef')
74
-
75
- pdk.set('pdk', process, 'minlayer', stackup, 'Metal2')
76
- pdk.set('pdk', process, 'maxlayer', stackup, 'Metal5')
77
-
78
- # DRC Runsets
79
- # pdk.set('pdk', process, 'drc', 'runset', 'magic', stackup, 'basic',
80
- # pdkdir + '/setup/magic/sky130A.tech')
81
-
82
- # LVS Runsets
83
- # pdk.set('pdk', process, 'lvs', 'runset', 'netgen', stackup, 'basic',
84
- # pdkdir + '/setup/netgen/lvs_setup.tcl')
85
-
86
- # Layer map and display file
87
- pdk.set('pdk', process, 'layermap', 'klayout', 'def', 'klayout', stackup,
88
- 'ihp-sg13g2/libs.tech/klayout/tech/sg13g2.lyt')
89
- pdk.set('pdk', process, 'display', 'klayout', stackup,
90
- 'ihp-sg13g2/libs.tech/klayout/tech/sg13g2.lyp')
91
-
92
- pdk.set('pdk', process, 'layermap', 'klayout', 'def', 'gds', stackup,
93
- 'ihp-sg13g2/libs.tech/klayout/tech/sg13g2.map')
94
-
95
- # Openroad global routing grid derating
96
- openroad_layer_adjustments = {
97
- 'Metal1': 0.25,
98
- 'Metal2': 0.25,
99
- 'Metal3': 0.25,
100
- 'Metal4': 0.25,
101
- 'Metal5': 0.25,
102
- 'TopMetal1': 0.00,
103
- 'TopMetal2': 0.00,
104
- }
105
- for layer, adj in openroad_layer_adjustments.items():
106
- pdk.set('pdk', process, 'var', 'openroad', f'{layer}_adjustment', stackup, str(adj))
107
-
108
- pdk.set('pdk', process, 'var', 'openroad', 'rclayer_signal', stackup, 'Metal2')
109
- pdk.set('pdk', process, 'var', 'openroad', 'rclayer_clock', stackup, 'Metal5')
110
-
111
- pdk.set('pdk', process, 'var', 'openroad', 'pin_layer_vertical', stackup, 'Metal2')
112
- pdk.set('pdk', process, 'var', 'openroad', 'pin_layer_horizontal', stackup, 'Metal3')
113
-
114
- # PEX
115
- for corner in ["typical"]:
116
- pdk.set('pdk', process, 'pexmodel', 'openroad', stackup, corner,
117
- lpdkdir + '/pex/openroad/' + corner + '.tcl', package='lambdapdk')
118
- pdk.set('pdk', process, 'pexmodel', 'openroad-openrcx', stackup, corner,
119
- lpdkdir + '/pex/openroad/' + corner + '.rules', package='lambdapdk')
120
-
121
- # DRC
122
- drcs = {
123
- "maximal": 'ihp-sg13g2/libs.tech/klayout/tech/drc/sg13g2_maximal.lydrc',
124
- "minimal": 'ihp-sg13g2/libs.tech/klayout/tech/drc/sg13g2_minimal.lydrc'
125
- }
126
- for drc, runset in drcs.items():
127
- pdk.set('pdk', process, 'drc', 'runset', 'klayout', stackup, drc, runset)
128
-
129
- key = f'drc_params:{drc}'
130
- pdk.add('pdk', process, 'var', 'klayout', stackup, key, 'in_gds=<input>')
131
- pdk.add('pdk', process, 'var', 'klayout', stackup, key, 'cell=<topcell>')
132
- pdk.add('pdk', process, 'var', 'klayout', stackup, key, 'report_file=<report>')
133
-
134
- # Documentation
135
- pdk.set('pdk', process, 'doc', 'overview',
136
- 'ihp-sg13g2/libs.doc/doc/SG13G2_os_process_spec.pdf')
137
- pdk.set('pdk', process, 'doc', 'drc_rules',
138
- 'ihp-sg13g2/libs.doc/doc/SG13G2_os_layout_rules.pdf')
139
-
140
- return pdk
141
-
142
-
143
- #########################
144
- if __name__ == "__main__":
145
- pdk = setup()
146
- pdk.write_manifest(f'{pdk.top()}.json')
147
- pdk.check_filepaths()
36
+ def __init__(self):
37
+ super().__init__()
38
+ self.set_name("ihp130")
39
+
40
+ self.set_foundry("Leibniz-Institut für innovative Mikroelektronik")
41
+ self.package.set_version(pdk_rev)
42
+ self.set_node(130)
43
+ self.set_stackup("5M2TL")
44
+
45
+ pdk_path = Path("lambdapdk", "ihp130", "base")
46
+
47
+ # Docs
48
+ with self.active_dataroot("ihp130"):
49
+ self.package.add_doc("quickstart", "ihp-sg13g2/libs.doc/doc/SG13G2_os_process_spec.pdf")
50
+ self.package.add_doc("signoff", "ihp-sg13g2/libs.doc/doc/SG13G2_os_layout_rules.pdf")
51
+
52
+ with self.active_dataroot("ihp130"):
53
+ # APR Setup
54
+ with self.active_fileset("views.lef"):
55
+ self.add_file("ihp-sg13g2/libs.ref/sg13g2_stdcell/lef/sg13g2_tech.lef")
56
+ for tool in ('openroad', 'klayout', 'magic'):
57
+ self.add_aprtechfileset(tool)
58
+
59
+ with self.active_fileset("layermap"):
60
+ self.add_file("ihp-sg13g2/libs.tech/klayout/tech/sg13g2.map", filetype="layermap")
61
+
62
+ self.set_aprroutinglayers(min="Metal2", max="Metal5")
63
+
64
+ # Klayout setup
65
+ with self.active_dataroot("ihp130"):
66
+ with self.active_fileset("klayout.techmap"):
67
+ self.add_file("ihp-sg13g2/libs.tech/klayout/tech/sg13g2.lyt", filetype="layermap")
68
+ self.add_file("ihp-sg13g2/libs.tech/klayout/tech/sg13g2.lyp", filetype="display")
69
+ self.add_layermapfileset("klayout", "def", "klayout")
70
+ self.add_displayfileset("klayout")
71
+ self.add_layermapfileset("klayout", "def", "gds", fileset="layermap")
72
+
73
+ # OpenROAD setup
74
+ self.set_openroad_rclayers(signal="Metal2", clock="Metal5")
75
+ self.add_openroad_pinlayers(vertical="Metal2", horizontal="Metal3")
76
+
77
+ # Openroad global routing grid derating
78
+ openroad_layer_adjustments = {
79
+ 'Metal1': 0.25,
80
+ 'Metal2': 0.25,
81
+ 'Metal3': 0.25,
82
+ 'Metal4': 0.25,
83
+ 'Metal5': 0.25,
84
+ 'TopMetal1': 0.00,
85
+ 'TopMetal2': 0.00
86
+ }
87
+ for layer, adj in openroad_layer_adjustments.items():
88
+ self.set_openroad_globalroutingderating(layer, adj)
89
+
90
+ # PEX
91
+ with self.active_dataroot("lambdapdk"):
92
+ with self.active_fileset("openroad.pex"):
93
+ self.add_file(pdk_path / "pex" / "openroad" / "typical.tcl", filetype="tcl")
94
+ self.add_file(pdk_path / "pex" / "openroad" / "typical.rules", filetype="openrcx")
95
+
96
+ self.add_pexmodelfileset("openroad", "typical")
97
+ self.add_pexmodelfileset("openroad-openrcx", "typical")
98
+
99
+ # DRC
100
+ drcs = {
101
+ "maximal": 'ihp-sg13g2/libs.tech/klayout/tech/drc/sg13g2_maximal.lydrc',
102
+ "minimal": 'ihp-sg13g2/libs.tech/klayout/tech/drc/sg13g2_minimal.lydrc'
103
+ }
104
+ with self.active_dataroot("ihp130"):
105
+ for drc, runset in drcs.items():
106
+ with self.active_fileset(f"klayout.drc.{drc}"):
107
+ self.add_file(runset, filetype="drc")
108
+ self.add_runsetfileset("drc", "klayout", drc)
109
+
110
+ self.add_klayout_drcparam(drc, "in_gds=<input>")
111
+ self.add_klayout_drcparam(drc, "cell=<topcell>")
112
+ self.add_klayout_drcparam(drc, "report_file=<report>")