6 from Hurricane
import Technology
, DataBase
, DbU
, Library
, \
7 Layer
, BasicLayer
, Cell
, Net
, Vertical
, \
8 Rectilinear
, Box
, Point
, Instance
, \
9 Transformation
, NetExternalComponents
, \
11 from helpers
import u
, l
12 from helpers
.overlay
import UpdateSession
19 print( ' o pll.py: Create dummy abstract of "pll".' )
21 af
= CRL
.AllianceFramework
.get()
22 rg
= af
.getRoutingGauge()
23 cg
= af
.getCellGauge()
25 tech
= db
.getTechnology()
26 rootlib
= db
.getRootLibrary()
27 sliceHeight
= cg
.getSliceHeight()
28 METAL2
= tech
.getLayer( 'METAL2' )
29 METAL3
= tech
.getLayer( 'METAL3' )
30 METAL4
= tech
.getLayer( 'METAL4' )
31 METAL5
= tech
.getLayer( 'METAL5' )
32 BLOCKAGE1
= tech
.getLayer( 'BLOCKAGE1' )
33 BLOCKAGE2
= tech
.getLayer( 'BLOCKAGE2' )
34 BLOCKAGE3
= tech
.getLayer( 'BLOCKAGE3' )
35 BLOCKAGE4
= tech
.getLayer( 'BLOCKAGE4' )
36 BLOCKAGE5
= tech
.getLayer( 'BLOCKAGE5' )
39 lib
= Library
.create( rootlib
, 'pll' )
40 cell
= Cell
.create( lib
, 'pll' )
42 cell
.setAbutmentBox( Box( 0, 0, (15+2)*sliceHeight
, (13+2)*sliceHeight
) )
44 netSpecs
= ( ( 'a0' , None , Net
.Direction
.IN
, True )
45 , ( 'a1' , None , Net
.Direction
.IN
, True )
46 , ( 'ref_v' , None , Net
.Direction
.IN
, True )
47 , ( 'out_v' , None , Net
.Direction
.OUT
, True )
48 , ( 'vco_test_ana', None , Net
.Direction
.OUT
, True )
49 , ( 'div_out_test', None , Net
.Direction
.OUT
, True )
50 , ( 'vdd' , Net
.Type
.POWER
, Net
.Direction
.IN
, True )
51 , ( 'vss' , Net
.Type
.GROUND
, Net
.Direction
.IN
, True )
52 , ( 'blockageNet' , None , Net
.Direction
.IN
, True )
54 for name
, netType
, direction
, external
in netSpecs
:
55 nets
[ name
] = Net
.create( cell
, name
)
56 if netType
is not None: nets
[name
].setType ( netType
)
57 if direction
is not None: nets
[name
].setDirection( direction
)
58 if external
is not None: nets
[name
].setExternal ( external
)
59 blockageArea
= Box( cell
.getAbutmentBox() )
60 blockageArea
.inflate( -sliceHeight
)
61 for layer
in (BLOCKAGE1
, BLOCKAGE2
, BLOCKAGE3
, BLOCKAGE4
):
62 Pad
.create( nets
['blockageNet'], layer
, blockageArea
)
63 METAL2pitch
= rg
.getLayerGauge( METAL2
).getPitch()
64 METAL3pitch
= rg
.getLayerGauge( METAL3
).getPitch()
65 METAL2width
= rg
.getLayerGauge( METAL2
).getWireWidth()
66 METAL3width
= rg
.getLayerGauge( METAL3
).getWireWidth()
68 xref
= cell
.getAbutmentBox().getXMin() + sliceHeight
69 yref
= cell
.getAbutmentBox().getYMax() - sliceHeight
+ METAL2pitch
70 for name
, xpitchs
in (('a0',20), ('ref_v',75), ('a1',130)):
71 segment
= Vertical
.create( nets
[name
]
73 , xref
+ xpitchs
*METAL3pitch
76 , yref
- sliceHeight
)
77 segment
= Vertical
.create( nets
[name
]
79 , xref
+ xpitchs
*METAL3pitch
82 , yref
- METAL2pitch
)
83 NetExternalComponents
.setExternal( segment
)
85 xref
= cell
.getAbutmentBox().getXMin() + sliceHeight
- METAL3pitch
86 yref
= cell
.getAbutmentBox().getYMin() + sliceHeight
87 for name
, ypitchs
in (('vco_test_ana',65), ('div_out_test',120)):
88 segment
= Horizontal
.create( nets
[name
]
90 , yref
+ ypitchs
*METAL2pitch
93 , xref
+ sliceHeight
)
94 segment
= Horizontal
.create( nets
[name
]
96 , yref
+ ypitchs
*METAL2pitch
99 , xref
+ METAL3pitch
)
100 NetExternalComponents
.setExternal( segment
)
102 xref
= cell
.getAbutmentBox().getXMax() - 2*sliceHeight
+ METAL3pitch
103 yref
= cell
.getAbutmentBox().getYMin() + sliceHeight
104 for name
, ypitchs
in (('out_v',120),):
105 segment
= Horizontal
.create( nets
[name
]
107 , yref
+ ypitchs
*METAL2pitch
110 , xref
+ sliceHeight
)
111 segment
= Horizontal
.create( nets
[name
]
113 , yref
+ ypitchs
*METAL2pitch
116 , xref
+ sliceHeight
- METAL3pitch
)
117 NetExternalComponents
.setExternal( segment
)
119 xmin
= cell
.getAbutmentBox().getXMin() + sliceHeight
120 xmax
= cell
.getAbutmentBox().getXMax() - sliceHeight
121 yref
= cell
.getAbutmentBox().getYMin() + 2*sliceHeight
126 segment
= Horizontal
.create( net
128 , yref
+ sliceHeight
*3*i
132 NetExternalComponents
.setExternal( segment
)
134 af
.wrapLibrary( lib
, 0 )