2 # -*- coding: utf-8 -*-
8 from Hurricane
import DbU
, DataBase
, UpdateSession
, Library
, Cell
11 from helpers
.io
import ErrorMessage
, WarningMessage
12 from helpers
.overlay
import UpdateSession
13 from plugins
.alpha
.macro
.macro
import Macro
16 from helpers
import l
, u
, n
17 from Hurricane
import DbU
18 from Hurricane
import DataBase
19 from Hurricane
import Technology
25 tech
= DataBase
.getDB().getTechnology()
27 print WarningMessage( 'cmos.technology: Technology already exists, "%s"' % tech
.getName() )
29 tech
= Technology
.create( DataBase
.getDB(), 'c4mgds' )
31 # Table guessed from the GDSII layouts of the cells.
32 # FreePDK45/osu_soc/lib/source/gds/*.gds
34 # Format of an entry in the table:
35 # (Symbolic_Name, CIF_Name, GDSII_Number)
37 ( ("pWell" , "CWN" , 2, 0)
38 , ("nWell" , "CWP" , 1, 0)
39 , ("active" , "CAA" , 5, 0)
40 , ("pImplant", "CSP" , 8, 0)
41 , ("nImplant", "CSN" , 7, 0)
42 , ("poly" , "CPG" , 15, 0)
43 , ("cut0" , "CCC" , 16, 0)
44 , ("metal1" , "CM1" , 18, 0) # guessing
45 , ("cut1" , "CV1" , 22, 0)
46 , ("metal2" , "CM2" , 23, 0)
47 , ("cut2" , "CV2" , 24, 0)
48 , ("metal3" , "CM3" , 25, 0)
49 , ("cut3" , "CV3" , 26, 0)
50 , ("metal4" , "CM4" , 27, 0)
51 , ("cut4" , "CV4" , 28, 0)
52 , ("metal5" , "CM5" , 29, 0)
53 , ("cut5" , "CV5" , 30, 0)
54 , ("metal6" , "CM6" , 31, 0)
55 , ("cut6" , "CV6" , 32, 0)
56 , ("metal7" , "CM7" , 33, 0)
57 , ("cut7" , "CV7" , 34, 0)
58 , ("metal8" , "CM8" , 35, 0)
59 , ("cut8" , "CV8" , 36, 0)
60 , ("metal9" , "CM9" , 37, 0)
61 , ("cut9" , "CV9" , 38, 0)
62 , ("metal10" , "CM10" , 150, 0) # errr block? somewhere?
66 common
.loadGdsLayers( gdsLayersTable
)
68 def scriptMain ( **kw
):
71 if kw
.has_key('editor') and kw
['editor']:
74 rootLibrary
= DataBase
.getDB().getRootLibrary()
75 gdsLibrary
= rootLibrary
.getLibrary('gds')
77 gdsLibrary
= Library
.create(rootLibrary
, "GDS")
78 Gds
.load( gdsLibrary
, "C4MLogo.gds")
79 c4m
= gdsLibrary
.getCell( 'C4MLogo' )
81 if editor
: editor
.setCell( c4m
)
84 if __name__
== '__main__':
85 #from coriolis2 import settings