custom junk and site verif from mpw7

master
openpowerwtf 2 years ago
parent d5fc9bcd00
commit 685d4a98c4

@ -0,0 +1,125 @@
#!/usr/bin/python

from optparse import OptionParser
import gdspy


usage = '%prog [options] inFile'
parser = OptionParser(usage=usage)
(options, args) = parser.parse_args()

if len(args) != 1:
parser.error('Input .gds required.')

inFile = args[0]



gdsii = gdspy.GdsLibrary()
gdsii.read_gds(inFile)

# list of unreferenced cells
c = gdsii.top_level()
print(c)

LayerNames = {
'64:5' : 'nwell, label',
'64:59' : 'pwell, label',
'67:5' : 'li1, label',
'68:5' : 'met1, label',
'83:44' : 'text, label'
}

class Polygon:
def __init__(self, polygon, layer, datatype, properties=None):
self.polygon = polygon
self.layer = layer
self.datatype = datatype
self.properties = properties

class PolygonSets:
def __init__(self, properties):
self.polygons = []
self.properties = properties

maxLayers = 300
maxTypes = 300

numLabels = 0
numPolygons = 0
numPolygonSets = 0

# layer/type
labels = []
for i in range(maxLayers):
labels.append([])
for j in range(maxTypes):
labels[i].append([])

polygons = []
for i in range(maxLayers):
polygons.append([])
for j in range(maxTypes):
polygons[i].append([])

for i in range(len(c)):

b = c[i].get_bounding_box()
print(f'Cell {i} {b}')

p = c[i].get_dependencies()
print(f'Dependencies ({len(p)})')
for pp in p:
print(p)

p = c[i].get_paths()
print(f'Paths ({len(p)})')
for pp in p:
print(pp)

p = c[i].get_labels()
#print(f'Labels ({len(p)})')
for pp in p:
labels[pp.layer][pp.texttype].append(pp)
numLabels += 1

#p = c[i].get_datatypes()
#print(f'Data Types ({len(p)})')
#for pp in p:
# print(pp)

# print(f'Text Types')
# bug in source
# texttypes.update(reference.ref_cell.get_textypes())
# for l in c[i].get_texttypes():
# print(l)

#p = c[i].get_layers()
#print(f'Layers ({len(p)})')
#p = c[i].get_polygons()
#print(f'Polygons ({len(p)})')

# keep these as polygonsets? pp.properties belongs to the set only
p = c[i].get_polygonsets()
print(f'Polygon Sets ({len(p)})')
for pp in p:
for i in range(len(pp.polygons)):
numPolygons += 1
polygons[pp.layers[i]][pp.datatypes[i]].append(
Polygon(pp.polygons[i], pp.layers[i], pp.datatypes[i])
)
numPolygonSets += 1


print(f' Labels: {numLabels}')
print(f' Polygons: {numPolygons}')
print(f'PolygonSets: {numPolygonSets}')

for i in range(maxLayers):
for j in range(maxTypes):
if (len(labels[i][j]) > 0):
name = LayerNames[f'{i}:{j}']
print(f'{i:3d}:{j:3d} {name}')
for k in range(len(labels[i][j])):
label = labels[i][j][k]
print(f' {label.text} {label.position}')

Binary file not shown.

@ -0,0 +1,6 @@
toysram_local_eval.lef: NOWIREEXTENSIONATPIN ON ;
toysram_local_eval.lef: PIN RBL_O
toysram_local_eval.lef: PIN PRE_R_b
toysram_local_eval.lef: PIN VPB
toysram_local_eval.lef: PIN VNB
toysram_local_eval.lef: PIN VPWR

Binary file not shown.

@ -0,0 +1,11 @@
# magic -rcfile magic.tcl

source ../magic/.magic_tech/.magicrc

gds read local_eval.gds
load toysram_local_eval

# for some reason these don't return values; just puts
drc catchup
drc statistics
drc count total

@ -0,0 +1,11 @@
# magic -rcfile magic.tcl

source ../magic/.magic_tech/.magicrc

gds read toysram_local_pullup.gds
load toysram_local_pullup

# for some reason these don't return values; just puts
drc catchup
drc statistics
drc count total

@ -0,0 +1,20 @@
# magic -dnull -noconsole -rcfile magicdrc.tcl local_eval.gds

source ../magic/.magic_tech/.magicrc
#sleep 10

gds read local_eval.gds
load toysram_local_eval

# for some reason these don't return values; just puts
drc catchup
drc statistics
drc count total

drc find 1
drc find 2
drc find 3
drc find 4
drc find 5

exit

@ -0,0 +1,20 @@
# magic -dnull -noconsole -rcfile magicdrc_pullup.tcl toysram_local_pullup.gds

source ../magic/.magic_tech/.magicrc
#sleep 10

gds read toysram_local_pullup.gds
load toysram_local_pullup

# for some reason these don't return values; just puts
drc catchup
drc statistics
drc count total

drc find 1
drc find 2
drc find 3
drc find 4
drc find 5

exit

Binary file not shown.

@ -0,0 +1,93 @@
VERSION 5.7 ;
NOWIREEXTENSIONATPIN ON ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
MACRO sky130_fd_sc_hd__nand2_1
CLASS CORE ;
FOREIGN sky130_fd_sc_hd__nand2_1 ;
ORIGIN 0.000 0.000 ;
SIZE 1.380 BY 2.720 ;
SYMMETRY X Y R90 ;
SITE unithd ;
PIN A
DIRECTION INPUT ;
USE SIGNAL ;
ANTENNAGATEAREA 0.247500 ;
PORT
LAYER li1 ;
RECT 0.940 1.075 1.275 1.325 ;
END
END A
PIN B
DIRECTION INPUT ;
USE SIGNAL ;
ANTENNAGATEAREA 0.247500 ;
PORT
LAYER li1 ;
RECT 0.095 1.055 0.430 1.325 ;
END
END B
PIN VGND
DIRECTION INOUT ;
USE GROUND ;
SHAPE ABUTMENT ;
PORT
LAYER li1 ;
RECT 0.085 0.085 0.395 0.885 ;
RECT 0.000 -0.085 1.380 0.085 ;
LAYER mcon ;
RECT 0.145 -0.085 0.315 0.085 ;
RECT 0.605 -0.085 0.775 0.085 ;
RECT 1.065 -0.085 1.235 0.085 ;
LAYER met1 ;
RECT 0.000 -0.240 1.380 0.240 ;
END
END VGND
PIN VNB
DIRECTION INOUT ;
USE GROUND ;
PORT
LAYER pwell ;
RECT 0.025 0.105 1.375 1.015 ;
RECT 0.140 -0.085 0.310 0.105 ;
END
END VNB
PIN VPB
DIRECTION INOUT ;
USE POWER ;
PORT
LAYER nwell ;
RECT -0.190 1.305 1.570 2.910 ;
END
END VPB
PIN VPWR
DIRECTION INOUT ;
USE POWER ;
SHAPE ABUTMENT ;
PORT
LAYER li1 ;
RECT 0.000 2.635 1.380 2.805 ;
RECT 0.085 1.495 0.365 2.635 ;
RECT 1.035 1.495 1.295 2.635 ;
LAYER mcon ;
RECT 0.145 2.635 0.315 2.805 ;
RECT 0.605 2.635 0.775 2.805 ;
RECT 1.065 2.635 1.235 2.805 ;
LAYER met1 ;
RECT 0.000 2.480 1.380 2.960 ;
END
END VPWR
PIN Y
DIRECTION OUTPUT ;
USE SIGNAL ;
ANTENNADIFFAREA 0.439000 ;
PORT
LAYER li1 ;
RECT 0.535 1.485 0.865 2.465 ;
RECT 0.600 0.885 0.770 1.485 ;
RECT 0.600 0.255 1.295 0.885 ;
END
END Y
END sky130_fd_sc_hd__nand2_1
END LIBRARY

@ -0,0 +1,73 @@
VERSION 5.7 ;
NOWIREEXTENSIONATPIN ON ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
MACRO toysram_local_eval
CLASS BLOCK ;
FOREIGN toysram_local_eval ;
ORIGIN 0.270 0.150 ;
SIZE 2.440 BY 3.200 ;
PIN RBL_O
ANTENNAGATEAREA 0.555000 ;
ANTENNADIFFAREA 0.898275 ;
PORT
LAYER li1 ;
RECT 0.455 1.575 0.835 2.555 ;
RECT 0.015 1.190 0.350 1.415 ;
RECT 0.570 1.190 0.740 1.575 ;
RECT 1.580 1.415 1.825 2.525 ;
RECT 0.910 1.190 1.825 1.415 ;
RECT 0.015 1.165 1.825 1.190 ;
RECT 0.015 1.145 1.245 1.165 ;
RECT 0.170 0.975 1.245 1.145 ;
RECT 0.005 0.345 1.315 0.975 ;
RECT 0.005 0.175 1.245 0.345 ;
RECT -0.080 0.005 1.760 0.175 ;
LAYER mcon ;
RECT 0.065 0.005 0.235 0.175 ;
RECT 0.525 0.005 0.695 0.175 ;
RECT 0.985 0.005 1.155 0.175 ;
RECT 1.445 0.005 1.615 0.175 ;
LAYER met1 ;
RECT -0.080 -0.150 1.875 0.330 ;
END
END RBL_O
PIN PRE_R_b
ANTENNAGATEAREA 0.116025 ;
PORT
LAYER li1 ;
RECT 1.495 0.585 1.830 0.855 ;
END
END PRE_R_b
PIN VPB
PORT
LAYER nwell ;
RECT -0.270 1.395 2.170 3.000 ;
END
END VPB
PIN VNB
PORT
LAYER pwell ;
RECT -0.055 0.195 1.395 1.105 ;
RECT 0.060 0.005 0.230 0.195 ;
END
END VNB
PIN VPWR
USE POWER ;
PORT
LAYER li1 ;
RECT -0.080 2.725 1.760 2.895 ;
RECT 0.005 1.585 0.285 2.725 ;
RECT 1.055 1.585 1.315 2.725 ;
LAYER mcon ;
RECT 0.065 2.725 0.235 2.895 ;
RECT 0.525 2.725 0.695 2.895 ;
RECT 0.985 2.725 1.155 2.895 ;
RECT 1.445 2.725 1.615 2.895 ;
LAYER met1 ;
RECT -0.080 2.570 1.880 3.050 ;
END
END VPWR
END toysram_local_eval
END LIBRARY

@ -0,0 +1,60 @@
VERSION 5.7 ;
NOWIREEXTENSIONATPIN ON ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
MACRO toysram_local_pullup
CLASS BLOCK ;
FOREIGN toysram_local_pullup ;
ORIGIN 0.000 0.000 ;
SIZE 1.380 BY 2.720 ;
PIN RBL
ANTENNADIFFAREA 0.260000 ;
PORT
LAYER li1 ;
RECT 0.720 1.485 1.050 2.465 ;
RECT 0.820 0.990 1.050 1.485 ;
END
END RBL
PIN PRE_b
ANTENNAGATEAREA 0.150000 ;
PORT
LAYER li1 ;
RECT 0.320 1.075 0.650 1.315 ;
END
END PRE_b
PIN VPB
PORT
LAYER nwell ;
RECT -0.190 1.305 1.570 2.910 ;
END
END VPB
PIN VGND
USE GROUND ;
PORT
LAYER li1 ;
RECT 0.000 -0.085 1.380 0.085 ;
LAYER mcon ;
RECT 0.145 -0.085 0.315 0.085 ;
RECT 0.605 -0.085 0.775 0.085 ;
RECT 1.065 -0.085 1.235 0.085 ;
LAYER met1 ;
RECT 0.000 -0.240 1.380 0.240 ;
END
END VGND
PIN VPWR
USE POWER ;
PORT
LAYER li1 ;
RECT 0.000 2.635 1.380 2.805 ;
RECT 0.340 1.495 0.550 2.635 ;
LAYER mcon ;
RECT 0.145 2.635 0.315 2.805 ;
RECT 0.605 2.635 0.775 2.805 ;
RECT 1.065 2.635 1.235 2.805 ;
LAYER met1 ;
RECT 0.000 2.480 1.380 2.960 ;
END
END VPWR
END toysram_local_pullup
END LIBRARY

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

@ -3,56 +3,73 @@
### Process this file with the m4 processor
###

if {[info exists ::env(PDK_ROOT)]} {
set PDK_ROOT $::env(PDK_ROOT)
} else {
shell echo "PDK_ROOT must be set!"
quit
}

# MUST CHANGE THIS TO REPOSITORIES TOP LEVEL DIRECTORY
set PDK_ROOT /path/to/osu-toy-sram
set TECH_ROOT ${PDK_ROOT}/sky130B/libs.tech/magic/*.magicrc
set rc [glob -nocomplain $TECH_ROOT]
if {[llength $rc] != 1} {
shell echo "Expected one .magicrc file in $TECH_ROOT. Found:"
shell echo $rc
quit
}

puts "Sourcing $rc..."
source $rc

puts stdout "Sourcing design .magicrc for technology sky130 ..."

# MUST CHANGE THIS TO REPOSITORIES TOP LEVEL DIRECTORY
#set PDK_ROOT /path/to/osu-toy-sram

#puts stdout "Sourcing design .magicrc for technology sky130 ..."

# Put grid on 0.005 pitch. This is important, as some commands don't
# rescale the grid automatically (such as lef read?).

set scalefac [tech lambda]
if {[lindex $scalefac 1] < 2} {
scalegrid 1 2
}
#set scalefac [tech lambda]
#if {[lindex $scalefac 1] < 2} {
# scalegrid 1 2
#}

# drc off
drc euclidean on
#drc euclidean on

# Change this to a fixed number for repeatable behavior with GDS writes
# e.g., "random seed 12345"
catch {random seed}
#catch {random seed}

# Turn off the scale option on ext2spice or else it conflicts with the
# scale in the model files.
ext2spice scale off
#ext2spice scale off


# Set this to the folder that holds the technology files
set TECH_ROOT ${PDK_ROOT}/magic/.magic_tech
#set TECH_ROOT ${PDK_ROOT}/magic/.magic_tech

# loading technology
tech load ${TECH_ROOT}/sky130A.tech
#tech load ${TECH_ROOT}/sky130A.tech
# load device generator
#source $TECH_ROOT/sky130.tcl

# load bind keys (optional)
source ${TECH_ROOT}/sky130.BindKeys
#source ${TECH_ROOT}/sky130.BindKeys

# set units to lambda grid
snap internal
# set units to lambda grid
#snap internal

# set sky130 standard power, ground, and substrate names
set VDD VPWR
set GND VGND
set SUB VSUBS
#set VDD VPWR
#set GND VGND
#set SUB VSUBS

# add path to IP from catalog. This procedure defined in the PDK script.
catch {magic::query_mylib_ip}
#catch {magic::query_mylib_ip}
# add path to local IP from user design space. Defined in the PDK script.
catch {magic::query_my_projects}
#catch {magic::query_my_projects}

# Custom macros
#macro XK_Left "scroll l .1 w"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

@ -0,0 +1,112 @@
VERSION 5.7 ;
NOWIREEXTENSIONATPIN ON ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
MACRO 10T_toy_magic
CLASS BLOCK ;
FOREIGN 10T_toy_magic ;
ORIGIN 0.500 0.095 ;
SIZE 2.760 BY 1.350 ;
PIN RWL
DIRECTION INPUT ;
USE SIGNAL ;
ANTENNAGATEAREA 0.031500 ;
PORT
LAYER li1 ;
RECT 1.895 0.415 2.045 0.585 ;
END
END RWL
PIN RWL
DIRECTION INPUT ;
USE SIGNAL ;
ANTENNAGATEAREA 0.031500 ;
PORT
LAYER li1 ;
RECT -0.285 0.415 -0.135 0.585 ;
END
END RWL
PIN WBL
DIRECTION INPUT ;
USE SIGNAL ;
ANTENNADIFFAREA 0.024175 ;
PORT
LAYER li1 ;
RECT 1.820 0.825 1.895 0.970 ;
END
END WBL
PIN WBLb
DIRECTION INPUT ;
USE SIGNAL ;
ANTENNADIFFAREA 0.023100 ;
PORT
LAYER li1 ;
RECT -0.130 0.825 -0.055 0.965 ;
END
END WBLb
PIN RBL0
DIRECTION OUTPUT ;
USE SIGNAL ;
ANTENNADIFFAREA 0.045150 ;
PORT
LAYER li1 ;
RECT 2.185 0.095 2.260 0.305 ;
END
END RBL0
PIN RBL1
DIRECTION OUTPUT ;
USE SIGNAL ;
ANTENNADIFFAREA 0.045150 ;
PORT
LAYER li1 ;
RECT -0.500 0.095 -0.425 0.305 ;
END
END RBL1
PIN VDD
DIRECTION INOUT ;
USE POWER ;
SHAPE ABUTMENT ;
PORT
LAYER nwell ;
RECT 0.490 0.625 1.255 1.105 ;
LAYER li1 ;
RECT 0.800 1.035 0.960 1.105 ;
RECT 0.810 1.025 0.950 1.035 ;
LAYER met1 ;
RECT -0.500 1.035 2.260 1.105 ;
END
END VDD
PIN GND
DIRECTION INOUT ;
USE GROUND ;
SHAPE ABUTMENT ;
PORT
LAYER pwell ;
RECT -0.500 0.395 0.350 1.255 ;
RECT 1.410 0.395 2.260 1.255 ;
RECT -0.500 -0.095 2.260 0.395 ;
LAYER li1 ;
RECT 0.810 -0.025 0.950 -0.015 ;
RECT 0.800 -0.095 0.960 -0.025 ;
LAYER met1 ;
RECT -0.500 -0.095 2.260 -0.025 ;
END
END GND
OBS
LAYER li1 ;
RECT 0.275 0.825 0.350 0.965 ;
RECT 0.490 0.775 0.565 0.915 ;
RECT 1.195 0.835 1.255 0.915 ;
POLYGON 1.195 0.835 1.255 0.835 1.255 0.775 ;
RECT 1.410 0.825 1.485 0.965 ;
RECT 0.220 0.305 0.370 0.475 ;
RECT 0.610 0.440 0.760 0.610 ;
RECT 1.000 0.440 1.150 0.610 ;
RECT 1.390 0.305 1.540 0.475 ;
RECT 0.485 0.220 0.535 0.255 ;
POLYGON 0.535 0.255 0.570 0.220 0.535 0.220 ;
RECT 0.485 0.095 0.570 0.220 ;
RECT 1.190 0.095 1.275 0.255 ;
END
END 10T_toy_magic
END LIBRARY

Binary file not shown.

@ -0,0 +1,138 @@
VERSION 5.7 ;
NOWIREEXTENSIONATPIN ON ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
PROPERTYDEFINITIONS
MACRO maskLayoutSubType STRING ;
MACRO prCellType STRING ;
MACRO originalViewName STRING ;
END PROPERTYDEFINITIONS

MACRO sky130_fd_sc_hdll__nand2_1
CLASS CORE ;
FOREIGN sky130_fd_sc_hdll__nand2_1 ;
ORIGIN 0.000 0.000 ;
SIZE 1.840 BY 2.720 ;
SYMMETRY X Y R90 ;
SITE unithd ;
PIN A
DIRECTION INPUT ;
USE SIGNAL ;
ANTENNAGATEAREA 0.277500 ;
PORT
LAYER li1 ;
RECT 0.990 1.075 1.375 1.325 ;
END
END A
PIN B
DIRECTION INPUT ;
USE SIGNAL ;
ANTENNAGATEAREA 0.277500 ;
PORT
LAYER li1 ;
RECT 0.095 1.055 0.430 1.325 ;
END
END B
PIN VGND
DIRECTION INOUT ;
USE GROUND ;
PORT
LAYER li1 ;
RECT 0.085 0.085 0.395 0.885 ;
RECT 0.000 -0.085 1.840 0.085 ;
LAYER mcon ;
RECT 0.145 -0.085 0.315 0.085 ;
RECT 0.605 -0.085 0.775 0.085 ;
RECT 1.065 -0.085 1.235 0.085 ;
RECT 1.525 -0.085 1.695 0.085 ;
LAYER met1 ;
RECT 0.000 -0.240 1.840 0.240 ;
END
END VGND
PIN VNB
DIRECTION INOUT ;
USE GROUND ;
PORT
LAYER pwell ;
RECT 0.025 0.105 1.475 1.015 ;
RECT 0.140 -0.085 0.310 0.105 ;
END
END VNB
PIN VPB
DIRECTION INOUT ;
USE POWER ;
PORT
LAYER nwell ;
RECT -0.190 1.305 2.030 2.910 ;
END
END VPB
PIN VPWR
DIRECTION INOUT ;
USE POWER ;
PORT
LAYER li1 ;
RECT 0.000 2.635 1.840 2.805 ;
RECT 0.085 1.495 0.365 2.635 ;
RECT 1.135 1.495 1.395 2.635 ;
LAYER mcon ;
RECT 0.145 2.635 0.315 2.805 ;
RECT 0.605 2.635 0.775 2.805 ;
RECT 1.065 2.635 1.235 2.805 ;
RECT 1.525 2.635 1.695 2.805 ;
LAYER met1 ;
RECT 0.000 2.480 1.840 2.960 ;
END
END VPWR
PIN Y
DIRECTION OUTPUT ;
USE SIGNAL ;
ANTENNADIFFAREA 0.491500 ;
PORT
LAYER li1 ;
RECT 0.535 1.485 0.915 2.465 ;
RECT 0.650 0.885 0.820 1.485 ;
RECT 0.650 0.255 1.395 0.885 ;
END
END Y
PROPERTY maskLayoutSubType "abstract" ;
PROPERTY prCellType "standard" ;
PROPERTY originalViewName "layout" ;
END sky130_fd_sc_hdll__nand2_1
MACRO local_eval
CLASS BLOCK ;
FOREIGN local_eval ;
ORIGIN 0.270 0.150 ;
SIZE 2.220 BY 3.200 ;
OBS
LAYER nwell ;
RECT -0.270 1.395 1.950 3.000 ;
LAYER pwell ;
RECT -0.055 0.195 1.395 1.105 ;
RECT 0.060 0.005 0.230 0.195 ;
LAYER li1 ;
RECT -0.080 2.725 1.760 2.895 ;
RECT 0.005 1.585 0.285 2.725 ;
RECT 0.455 1.575 0.835 2.555 ;
RECT 1.055 1.585 1.315 2.725 ;
RECT 0.015 1.145 0.350 1.415 ;
RECT 0.570 0.975 0.740 1.575 ;
RECT 0.910 1.165 1.295 1.415 ;
RECT 0.005 0.175 0.315 0.975 ;
RECT 0.570 0.345 1.315 0.975 ;
RECT -0.080 0.005 1.760 0.175 ;
LAYER mcon ;
RECT 0.065 2.725 0.235 2.895 ;
RECT 0.525 2.725 0.695 2.895 ;
RECT 0.985 2.725 1.155 2.895 ;
RECT 1.445 2.725 1.615 2.895 ;
RECT 0.065 0.005 0.235 0.175 ;
RECT 0.525 0.005 0.695 0.175 ;
RECT 0.985 0.005 1.155 0.175 ;
RECT 1.445 0.005 1.615 0.175 ;
LAYER met1 ;
RECT -0.080 2.570 1.760 3.050 ;
RECT -0.080 -0.150 1.760 0.330 ;
END
END local_eval
END LIBRARY

@ -0,0 +1,8 @@
magic
tech sky130B
timestamp 1667750849
use sky130_fd_sc_hdll__nand2_1 sky130_fd_sc_hdll__nand2_1_0 $PDKPATH/libs.ref/sky130_fd_sc_hdll/mag
timestamp 1667402666
transform 1 0 -8 0 1 9
box -19 -24 203 296
<< end >>

Binary file not shown.

@ -0,0 +1,8 @@
magic
tech sky130B
timestamp 1667750849
use sky130_fd_sc_hdll__nand2_1 sky130_fd_sc_hdll__nand2_1_0 $PDKPATH/libs.ref/sky130_fd_sc_hdll/mag
timestamp 1667402666
transform 1 0 -8 0 1 9
box -19 -24 203 296
<< end >>

@ -0,0 +1,70 @@
VERSION 5.7 ;
NOWIREEXTENSIONATPIN ON ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
MACRO sky130_fd_sc_hd__inv_1
CLASS BLOCK ;
FOREIGN sky130_fd_sc_hd__inv_1 ;
ORIGIN 0.000 0.000 ;
SIZE 1.380 BY 2.720 ;
PIN Y
ANTENNADIFFAREA 0.429000 ;
PORT
LAYER li1 ;
RECT 0.720 1.485 1.050 2.465 ;
RECT 0.820 0.885 1.050 1.485 ;
RECT 0.720 0.255 1.050 0.885 ;
END
END Y
PIN A
ANTENNAGATEAREA 0.247500 ;
PORT
LAYER li1 ;
RECT 0.320 1.075 0.650 1.315 ;
END
END A
PIN VPB
PORT
LAYER nwell ;
RECT -0.190 1.305 1.570 2.910 ;
END
END VPB
PIN VNB
PORT
LAYER pwell ;
RECT 0.210 0.105 1.140 1.015 ;
RECT 0.210 0.085 0.315 0.105 ;
RECT 0.145 -0.085 0.315 0.085 ;
END
END VNB
PIN VGND
USE GROUND ;
PORT
LAYER li1 ;
RECT 0.320 0.085 0.550 0.905 ;
RECT 0.000 -0.085 1.380 0.085 ;
LAYER mcon ;
RECT 0.145 -0.085 0.315 0.085 ;
RECT 0.605 -0.085 0.775 0.085 ;
RECT 1.065 -0.085 1.235 0.085 ;
LAYER met1 ;
RECT 0.000 -0.240 1.380 0.240 ;
END
END VGND
PIN VPWR
USE POWER ;
PORT
LAYER li1 ;
RECT 0.000 2.635 1.380 2.805 ;
RECT 0.340 1.495 0.550 2.635 ;
LAYER mcon ;
RECT 0.145 2.635 0.315 2.805 ;
RECT 0.605 2.635 0.775 2.805 ;
RECT 1.065 2.635 1.235 2.805 ;
LAYER met1 ;
RECT 0.000 2.480 1.380 2.960 ;
END
END VPWR
END sky130_fd_sc_hd__inv_1
END LIBRARY

@ -0,0 +1,79 @@
VERSION 5.7 ;
NOWIREEXTENSIONATPIN ON ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
MACRO sky130_fd_sc_hdll__nand2_1
CLASS BLOCK ;
FOREIGN sky130_fd_sc_hdll__nand2_1 ;
ORIGIN 0.000 0.000 ;
SIZE 1.840 BY 2.720 ;
PIN Y
ANTENNADIFFAREA 0.491500 ;
PORT
LAYER li1 ;
RECT 0.535 1.485 0.915 2.465 ;
RECT 0.650 0.885 0.820 1.485 ;
RECT 0.650 0.255 1.395 0.885 ;
END
END Y
PIN B
ANTENNAGATEAREA 0.277500 ;
PORT
LAYER li1 ;
RECT 0.095 1.055 0.430 1.325 ;
END
END B
PIN A
ANTENNAGATEAREA 0.277500 ;
PORT
LAYER li1 ;
RECT 0.990 1.075 1.375 1.325 ;
END
END A
PIN VPB
PORT
LAYER nwell ;
RECT -0.190 1.305 2.030 2.910 ;
END
END VPB
PIN VNB
PORT
LAYER pwell ;
RECT 0.025 0.105 1.475 1.015 ;
RECT 0.140 -0.085 0.310 0.105 ;
END
END VNB
PIN VGND
USE GROUND ;
PORT
LAYER li1 ;
RECT 0.085 0.085 0.395 0.885 ;
RECT 0.000 -0.085 1.840 0.085 ;
LAYER mcon ;
RECT 0.145 -0.085 0.315 0.085 ;
RECT 0.605 -0.085 0.775 0.085 ;
RECT 1.065 -0.085 1.235 0.085 ;
RECT 1.525 -0.085 1.695 0.085 ;
LAYER met1 ;
RECT 0.000 -0.240 1.840 0.240 ;
END
END VGND
PIN VPWR
USE POWER ;
PORT
LAYER li1 ;
RECT 0.000 2.635 1.840 2.805 ;
RECT 0.085 1.495 0.365 2.635 ;
RECT 1.135 1.495 1.395 2.635 ;
LAYER mcon ;
RECT 0.145 2.635 0.315 2.805 ;
RECT 0.605 2.635 0.775 2.805 ;
RECT 1.065 2.635 1.235 2.805 ;
RECT 1.525 2.635 1.695 2.805 ;
LAYER met1 ;
RECT 0.000 2.480 1.840 2.960 ;
END
END VPWR
END sky130_fd_sc_hdll__nand2_1
END LIBRARY

@ -0,0 +1,494 @@
[<gdspy.library.Cell object at 0x7f228c1e3fa0>]
Cell 0 [[-0.27 -0.15]
[ 1.95 3.05]]
Dependencies (1)
{<gdspy.library.Cell object at 0x7f228e0f0a60>}
Paths (0)
Labels (10)
Label ("Y", at (0.6050000000000001, 1.655), rotation None, magnification 0.125, reflection False, layer 67, texttype 5)
Label ("Y", at (0.6050000000000001, 1.995), rotation None, magnification 0.125, reflection False, layer 67, texttype 5)
Label ("Y", at (1.045, 0.87), rotation None, magnification 0.125, reflection False, layer 67, texttype 5)
Label ("B", at (0.14500000000000002, 1.28), rotation None, magnification 0.125, reflection False, layer 67, texttype 5)
Label ("A", at (1.065, 1.28), rotation None, magnification 0.125, reflection False, layer 67, texttype 5)
Label ("VPB", at (0.14500000000000002, 2.81), rotation None, magnification 0.1, reflection False, layer 64, texttype 5)
Label ("VNB", at (0.14500000000000002, 0.09), rotation None, magnification 0.1, reflection False, layer 64, texttype 59)
Label ("VGND", at (0.15000000000000002, 0.09), rotation None, magnification 0.1, reflection False, layer 68, texttype 5)
Label ("VPWR", at (0.14500000000000002, 2.81), rotation None, magnification 0.1, reflection False, layer 68, texttype 5)
Label ("nand2_1", at (-0.08, 0.09), rotation 90.0, magnification 0.1, reflection False, layer 83, texttype 44)
Data Types (5)
0
16
4
20
44
Layers (13)
Polygon Sets (50)
[array([[0.535, 1.5 ],
[0.525, 1.5 ],
[0.525, 2.705],
[0.345, 2.705],
[0.345, 1.5 ],
[0.335, 1.5 ],
[0.335, 1.415],
[0.025, 1.415],
[0.025, 1.085],
[0.385, 1.085],
[0.385, 0.195],
[0.535, 0.195]])] [66] [20]
[array([[1.295, 1.415],
[1.005, 1.415],
[1.005, 1.5 ],
[0.995, 1.5 ],
[0.995, 2.705],
[0.815, 2.705],
[0.815, 1.5 ],
[0.805, 1.5 ],
[0.805, 0.195],
[0.955, 0.195],
[0.955, 1.085],
[1.295, 1.085]])] [66] [20]
[array([[0.065, 2.725],
[0.235, 2.725],
[0.235, 2.895],
[0.065, 2.895]])] [67] [44]
[array([[0.065, 0.005],
[0.235, 0.005],
[0.235, 0.175],
[0.065, 0.175]])] [67] [44]
[array([[0.525, 2.725],
[0.695, 2.725],
[0.695, 2.895],
[0.525, 2.895]])] [67] [44]
[array([[0.525, 0.005],
[0.695, 0.005],
[0.695, 0.175],
[0.525, 0.175]])] [67] [44]
[array([[0.985, 2.725],
[1.155, 2.725],
[1.155, 2.895],
[0.985, 2.895]])] [67] [44]
[array([[0.985, 0.005],
[1.155, 0.005],
[1.155, 0.175],
[0.985, 0.175]])] [67] [44]
[array([[1.445, 2.725],
[1.615, 2.725],
[1.615, 2.895],
[1.445, 2.895]])] [67] [44]
[array([[1.445, 0.005],
[1.615, 0.005],
[1.615, 0.175],
[1.445, 0.175]])] [67] [44]
[array([[-0.08, 0.09],
[ 1.76, 0.09],
[ 1.76, 2.81],
[-0.08, 2.81]])] [236] [0]
[array([[0.06 , 2.725],
[0.06 , 2.895],
[0.23 , 2.895],
[0.23 , 2.725]])] [64] [16]
[array([[0.06 , 0.005],
[0.06 , 0.175],
[0.23 , 0.175],
[0.23 , 0.005]])] [122] [16]
[array([[0.06 , 0.005],
[0.06 , 0.175],
[0.23 , 0.175],
[0.23 , 0.005]])] [68] [16]
[array([[0.06 , 2.725],
[0.06 , 2.895],
[0.23 , 2.895],
[0.23 , 2.725]])] [68] [16]
[array([[ 1.76 , 0.175],
[ 0.315, 0.175],
[ 0.315, 0.975],
[ 0.005, 0.975],
[ 0.005, 0.175],
[-0.08 , 0.175],
[-0.08 , 0.005],
[ 1.76 , 0.005]])] [67] [20]
[array([[ 1.76 , 2.895],
[-0.08 , 2.895],
[-0.08 , 2.725],
[ 0.005, 2.725],
[ 0.005, 1.585],
[ 0.285, 1.585],
[ 0.285, 2.725],
[ 1.055, 2.725],
[ 1.055, 1.585],
[ 1.315, 1.585],
[ 1.315, 2.725],
[ 1.76 , 2.725]])] [67] [20]
[array([[0.015, 1.145],
[0.015, 1.415],
[0.35 , 1.415],
[0.35 , 1.145]])] [67] [20]
[array([[0.91 , 1.165],
[0.91 , 1.415],
[1.295, 1.415],
[1.295, 1.165]])] [67] [20]
[array([[1.315, 0.975],
[0.74 , 0.975],
[0.74 , 1.575],
[0.835, 1.575],
[0.835, 2.555],
[0.455, 2.555],
[0.455, 1.575],
[0.57 , 1.575],
[0.57 , 0.345],
[1.315, 0.345]])] [67] [20]
[array([[-0.08, 2.57],
[ 1.76, 2.57],
[ 1.76, 3.05],
[-0.08, 3.05]])] [68] [20]
[array([[-0.08, -0.15],
[ 1.76, -0.15],
[ 1.76, 0.33],
[-0.08, 0.33]])] [68] [20]
[array([[1.055, 0.385],
[1.225, 0.385],
[1.225, 0.555],
[1.055, 0.555]])] [66] [44]
[array([[1.055, 0.725],
[1.225, 0.725],
[1.225, 0.895],
[1.055, 0.895]])] [66] [44]
[array([[0.115, 2.345],
[0.285, 2.345],
[0.285, 2.515],
[0.115, 2.515]])] [66] [44]
[array([[0.115, 2.005],
[0.285, 2.005],
[0.285, 2.175],
[0.115, 2.175]])] [66] [44]
[array([[0.115, 1.665],
[0.285, 1.665],
[0.285, 1.835],
[0.115, 1.835]])] [66] [44]
[array([[0.115, 0.725],
[0.285, 0.725],
[0.285, 0.895],
[0.115, 0.895]])] [66] [44]
[array([[0.115, 0.385],
[0.285, 0.385],
[0.285, 0.555],
[0.115, 0.555]])] [66] [44]
[array([[0.585, 2.345],
[0.755, 2.345],
[0.755, 2.515],
[0.585, 2.515]])] [66] [44]
[array([[0.585, 2.005],
[0.755, 2.005],
[0.755, 2.175],
[0.585, 2.175]])] [66] [44]
[array([[0.585, 1.665],
[0.755, 1.665],
[0.755, 1.835],
[0.585, 1.835]])] [66] [44]
[array([[1.04 , 1.165],
[1.21 , 1.165],
[1.21 , 1.335],
[1.04 , 1.335]])] [66] [44]
[array([[1.055, 2.345],
[1.225, 2.345],
[1.225, 2.515],
[1.055, 2.515]])] [66] [44]
[array([[0.1 , 1.165],
[0.27 , 1.165],
[0.27 , 1.335],
[0.1 , 1.335]])] [66] [44]
[array([[1.055, 2.005],
[1.225, 2.005],
[1.225, 2.175],
[1.055, 2.175]])] [66] [44]
[array([[1.055, 1.665],
[1.225, 1.665],
[1.225, 1.835],
[1.055, 1.835]])] [66] [44]
[array([[1.08 , 1.195],
[1.08 , 1.365],
[1.25 , 1.365],
[1.25 , 1.195]])] [67] [16]
[array([[0.57, 1.57],
[0.57, 1.74],
[0.74, 1.74],
[0.74, 1.57]])] [67] [16]
[array([[0.57, 1.91],
[0.57, 2.08],
[0.74, 2.08],
[0.74, 1.91]])] [67] [16]
[array([[0.98 , 0.795],
[0.98 , 0.965],
[1.15 , 0.965],
[1.15 , 0.795]])] [67] [16]
[array([[0.06 , 1.195],
[0.06 , 1.365],
[0.23 , 1.365],
[0.23 , 1.195]])] [67] [16]
[array([[0.075, 1.575],
[0.075, 2.575],
[1.265, 2.575],
[1.265, 1.575]])] [65] [20]
[array([[0.075, 0.325],
[0.075, 0.975],
[1.265, 0.975],
[1.265, 0.325]])] [65] [20]
[array([[-0.08, 0.09],
[ 1.76, 0.09],
[ 1.76, 2.81],
[-0.08, 2.81]])] [81] [4]
[array([[-0.08 , 1.445],
[ 1.76 , 1.445],
[ 1.76 , 3. ],
[-0.08 , 3. ]])] [94] [20]
[array([[-0.27 , 1.395],
[ 1.95 , 1.395],
[ 1.95 , 3. ],
[-0.27 , 3. ]])] [64] [20]
[array([[-0.08 , -0.1 ],
[ 1.76 , -0.1 ],
[ 1.76 , 1.105],
[-0.08 , 1.105]])] [93] [44]
[array([[-0.08, 1.34],
[ 1.76, 1.34],
[ 1.76, 2.81],
[-0.08, 2.81]])] [78] [44]
[array([[-0.08 , 1.065],
[ 1.76 , 1.065],
[ 1.76 , 1.435],
[-0.08 , 1.435]])] [95] [20]
Polygons (50)
[[0.535 1.5 ]
[0.525 1.5 ]
[0.525 2.705]
[0.345 2.705]
[0.345 1.5 ]
[0.335 1.5 ]
[0.335 1.415]
[0.025 1.415]
[0.025 1.085]
[0.385 1.085]
[0.385 0.195]
[0.535 0.195]]
[[1.295 1.415]
[1.005 1.415]
[1.005 1.5 ]
[0.995 1.5 ]
[0.995 2.705]
[0.815 2.705]
[0.815 1.5 ]
[0.805 1.5 ]
[0.805 0.195]
[0.955 0.195]
[0.955 1.085]
[1.295 1.085]]
[[0.065 2.725]
[0.235 2.725]
[0.235 2.895]
[0.065 2.895]]
[[0.065 0.005]
[0.235 0.005]
[0.235 0.175]
[0.065 0.175]]
[[0.525 2.725]
[0.695 2.725]
[0.695 2.895]
[0.525 2.895]]
[[0.525 0.005]
[0.695 0.005]
[0.695 0.175]
[0.525 0.175]]
[[0.985 2.725]
[1.155 2.725]
[1.155 2.895]
[0.985 2.895]]
[[0.985 0.005]
[1.155 0.005]
[1.155 0.175]
[0.985 0.175]]
[[1.445 2.725]
[1.615 2.725]
[1.615 2.895]
[1.445 2.895]]
[[1.445 0.005]
[1.615 0.005]
[1.615 0.175]
[1.445 0.175]]
[[-0.08 0.09]
[ 1.76 0.09]
[ 1.76 2.81]
[-0.08 2.81]]
[[0.06 2.725]
[0.06 2.895]
[0.23 2.895]
[0.23 2.725]]
[[0.06 0.005]
[0.06 0.175]
[0.23 0.175]
[0.23 0.005]]
[[0.06 0.005]
[0.06 0.175]
[0.23 0.175]
[0.23 0.005]]
[[0.06 2.725]
[0.06 2.895]
[0.23 2.895]
[0.23 2.725]]
[[ 1.76 0.175]
[ 0.315 0.175]
[ 0.315 0.975]
[ 0.005 0.975]
[ 0.005 0.175]
[-0.08 0.175]
[-0.08 0.005]
[ 1.76 0.005]]
[[ 1.76 2.895]
[-0.08 2.895]
[-0.08 2.725]
[ 0.005 2.725]
[ 0.005 1.585]
[ 0.285 1.585]
[ 0.285 2.725]
[ 1.055 2.725]
[ 1.055 1.585]
[ 1.315 1.585]
[ 1.315 2.725]
[ 1.76 2.725]]
[[0.015 1.145]
[0.015 1.415]
[0.35 1.415]
[0.35 1.145]]
[[0.91 1.165]
[0.91 1.415]
[1.295 1.415]
[1.295 1.165]]
[[1.315 0.975]
[0.74 0.975]
[0.74 1.575]
[0.835 1.575]
[0.835 2.555]
[0.455 2.555]
[0.455 1.575]
[0.57 1.575]
[0.57 0.345]
[1.315 0.345]]
[[-0.08 2.57]
[ 1.76 2.57]
[ 1.76 3.05]
[-0.08 3.05]]
[[-0.08 -0.15]
[ 1.76 -0.15]
[ 1.76 0.33]
[-0.08 0.33]]
[[1.055 0.385]
[1.225 0.385]
[1.225 0.555]
[1.055 0.555]]
[[1.055 0.725]
[1.225 0.725]
[1.225 0.895]
[1.055 0.895]]
[[0.115 2.345]
[0.285 2.345]
[0.285 2.515]
[0.115 2.515]]
[[0.115 2.005]
[0.285 2.005]
[0.285 2.175]
[0.115 2.175]]
[[0.115 1.665]
[0.285 1.665]
[0.285 1.835]
[0.115 1.835]]
[[0.115 0.725]
[0.285 0.725]
[0.285 0.895]
[0.115 0.895]]
[[0.115 0.385]
[0.285 0.385]
[0.285 0.555]
[0.115 0.555]]
[[0.585 2.345]
[0.755 2.345]
[0.755 2.515]
[0.585 2.515]]
[[0.585 2.005]
[0.755 2.005]
[0.755 2.175]
[0.585 2.175]]
[[0.585 1.665]
[0.755 1.665]
[0.755 1.835]
[0.585 1.835]]
[[1.04 1.165]
[1.21 1.165]
[1.21 1.335]
[1.04 1.335]]
[[1.055 2.345]
[1.225 2.345]
[1.225 2.515]
[1.055 2.515]]
[[0.1 1.165]
[0.27 1.165]
[0.27 1.335]
[0.1 1.335]]
[[1.055 2.005]
[1.225 2.005]
[1.225 2.175]
[1.055 2.175]]
[[1.055 1.665]
[1.225 1.665]
[1.225 1.835]
[1.055 1.835]]
[[1.08 1.195]
[1.08 1.365]
[1.25 1.365]
[1.25 1.195]]
[[0.57 1.57]
[0.57 1.74]
[0.74 1.74]
[0.74 1.57]]
[[0.57 1.91]
[0.57 2.08]
[0.74 2.08]
[0.74 1.91]]
[[0.98 0.795]
[0.98 0.965]
[1.15 0.965]
[1.15 0.795]]
[[0.06 1.195]
[0.06 1.365]
[0.23 1.365]
[0.23 1.195]]
[[0.075 1.575]
[0.075 2.575]
[1.265 2.575]
[1.265 1.575]]
[[0.075 0.325]
[0.075 0.975]
[1.265 0.975]
[1.265 0.325]]
[[-0.08 0.09]
[ 1.76 0.09]
[ 1.76 2.81]
[-0.08 2.81]]
[[-0.08 1.445]
[ 1.76 1.445]
[ 1.76 3. ]
[-0.08 3. ]]
[[-0.27 1.395]
[ 1.95 1.395]
[ 1.95 3. ]
[-0.27 3. ]]
[[-0.08 -0.1 ]
[ 1.76 -0.1 ]
[ 1.76 1.105]
[-0.08 1.105]]
[[-0.08 1.34]
[ 1.76 1.34]
[ 1.76 2.81]
[-0.08 2.81]]
[[-0.08 1.065]
[ 1.76 1.065]
[ 1.76 1.435]
[-0.08 1.435]]

@ -0,0 +1,172 @@
#
# Cadence-compatibility bindings except where marked.
#
macro f "view" ;# zoom to fit window
macro ^z "zoom 0.5" ;# zoom in
macro Z "zoom 2" ;# zoom out
macro B "popstack" ;# up hierarchy
macro X {pushstack [cellname list self]} ;# down hierarchy
macro x "edit" ;# down hierarchy, edit-in-place
macro b "select top cell ; edit" ;# up hierarchy from edit-in-place
macro p "tool wire; magic::trackwire %W pick" ;# path
macro ^r "redraw"
macro ^f "unexpand"
macro F "expand"
macro ^a "select area"
macro ^d "select clear"
macro k "magic::measure"
macro K "magic::unmeasure"
macro i "magic::promptload getcell"
macro l "magic::update_texthelper ; wm deiconify .texthelper ; raise .texthelper"
macro O "magic::clock"
macro <del> "magic::delete"

# Toolkit parameter dialog
macro q "magic::gencell {} ; raise .params"
#
# The following should be already implemented as existing Magic bindings
#
macro u "undo"
macro U "redo"
macro m "move"
macro c "copy"
#
# Compatibility with Electric; Cadence bindings are on function keys and
# do not work through the VNC.
macro ^s "magic::promptsave magic" ;# save dialog menu

#
# Bertrand's bindings follow except where marked.
#
macro < sideways
macro ^ upsidedown
#
# Set grid at 1 micron
#
macro 0 "grid on ; grid 1l" ;# Grid at 0.5um (1 lambda)
# macro ^f "feedback clear" ;# conflicts with Cadence binding
#
# Paint/Erase macros
#
macro 1 "paint m1"
macro ! "erase m1"
macro 2 "paint m2"
macro @ "erase m2"
macro 3 "paint m3"
macro # "erase m3"
macro 4 "paint m4"
macro $ "erase m4"
macro 5 "paint mtp"
macro % "erase mtp"

macro 7 "paint poly"
# macro & "erase poly"
# macro p "paint pdiff"
macro n "paint ndiff"
# macro l "erase labels"
macro P "erase pdiff"
macro N "erase ndiff"
macro y "drc check; drc why"
macro ? "select area; what"

macro / "expand toggle"
macro ^w "writeall force"
macro ^e "edit"
# macro ^x "quit"

macro z "findbox zoom"
# "f" conflicts with Cadence "full view", so use control-i to select cells.
# macro f "select cell"
macro ^i "select cell"

# Leave keypad bindings as-is, further down. However, keypad
# keys generally don't translate through the VNC session, so
# use the following arrow key bindings:
#
# no shift shift
# arrows only -> Pan 10% 100%
# with alt -> Move 1 lambda 1 grid
# with ctrl -> Stretch 1 lambda 1 grid
#
# Pan 10 percent of the window size with arrows
# macro XK_Left "scroll l .1 w"
# macro XK_Up "scroll u .1 w"
# macro XK_Right "scroll r .1 w"
# macro XK_Down "scroll d .1 w"

# Pan 100 percent of the window size with arrows
# macro Shift_XK_Left "scroll l 1 w"
# macro Shift_XK_Up "scroll u 1 w"
# macro Shift_XK_Right "scroll r 1 w"
# macro Shift_XK_Down "scroll d 1 w"

# move 0.05um with arrows
# macro Alt_XK_Left "move l 1l"
# macro Alt_XK_Right "move r 1l"
# macro Alt_XK_Up "move u 1l"
# macro Alt_XK_Down "move d 1l"

# move 1 grid unit with arrows
# macro Alt_Shift_XK_Left "move l 1g"
# macro Alt_Shift_XK_Right "move r 1g"
# macro Alt_Shift_XK_Up "move u 1g"
# macro Alt_Shift_XK_Down "move d 1g"

# stretch 0.05um with arrows
# macro Control_XK_Left "stretch l 1l"
# macro Control_XK_Right "stretch r 1l"
# macro Control_XK_Up "stretch u 1l"
# macro Control_XK_Down "stretch d 1l"

# stretch 1 grid unit with arrows
# macro Control_Shift_XK_Left "stretch l 1g"
# macro Control_Shift_XK_Right "stretch r 1g"
# macro Control_Shift_XK_Up "stretch u 1g"
# macro Control_Shift_XK_Down "stretch d 1g"

# shift mouse wheel bindings for right-left shift
macro Shift_XK_Pointer_Button4 "scroll r .05 w"
macro Shift_XK_Pointer_Button5 "scroll l .05 w"

# control mouse wheel bindings for zoom in/out
macro Control_XK_Pointer_Button4 "zoom 0.70711"
macro Control_XK_Pointer_Button5 "zoom 1.41421"

# Bertrand's original arrow macros
# move 1 grid unit with arrows
macro XK_Left "move l 1g"
macro XK_Right "move r 1g"
macro XK_Up "move u 1g"
macro XK_Down "move d 1g"

# move 0.05um with arrows
macro Control_XK_Left "move l 1l"
macro Control_XK_Right "move r 1l"
macro Control_XK_Up "move u 1l"
macro Control_XK_Down "move d 1l"

# stretch 1 grid unit with arrows
macro Shift_XK_Left "stretch l 1g"
macro Shift_XK_Right "stretch r 1g"
macro Shift_XK_Up "stretch u 1g"
macro Shift_XK_Down "stretch d 1g"

# stretch 0.05um with arrows
macro Control_Shift_XK_Left "stretch l 1l"
macro Control_Shift_XK_Right "stretch r 1l"
macro Control_Shift_XK_Up "stretch u 1l"
macro Control_Shift_XK_Down "stretch d 1l"

# Restore pan function on Alt-key
# Pan 10 percent of the window size with arrows
macro Alt_XK_Left "scroll l .1 w"
macro Alt_XK_Up "scroll u .1 w"
macro Alt_XK_Right "scroll r .1 w"
macro Alt_XK_Down "scroll d .1 w"

# Pan 100 percent of the window size with arrows
macro Alt_Shift_XK_Left "scroll l 1 w"
macro Alt_Shift_XK_Up "scroll u 1 w"
macro Alt_Shift_XK_Right "scroll r 1 w"
macro Alt_Shift_XK_Down "scroll d 1 w"

@ -1,11 +1,127 @@
# Custom Cell
# Custom Cell Design

### Prerequisites
#### Prerequisites

* Magic (VERSION TODO) - Layout
* Xschem (VERSION TODO) - Schematic capture
* Netgen-lvs (VERSION TODO) - Layout Vs. Schematic
* Ngspice (VERSION TODO) - SPICE simulation

## 10T RAM Cell

* domino 10T 2R1W
* domino background
* clocked logic family (each gate has a clock)
* clock low, 'precharge' -> node high
* clock high, 'evaluate' -> node based on input(s), can only go low now
* clock signal ensures critical path only traverses through cells during 'evaluate'
* since only switches in one direction, no pmos pullups needed
* effective transistor load is lower for previous stage
* smaller circuit for given capacitance, or
* stronger drive for given capacitance
* faster since no pmos/nmos contention during switching
* noninverting logic
* each domino cell is a single-stage dynamic cell followed by an inverter
* glitchless

<image src="./10T.png">

* array
* in cell, read is bottom of domino (evaluate)
* subarray is 16x12 cells
* 'local eval' is top of domino (precharge) and inverter (NAND2 between (2) subarrays)
* (8) subarrays create 64wx24b 'hard' array
* surrounding logical array does strobe/addr predecode and addr/data latching; (3) subarrays for 64x72_2R1W
* DDR adds double in/out latches, early/late select, and DDR-compatible strobe

## Local Eval

* precharge
* 2:1 select

<image src="./local_eval.png">

* nand2 with precharge pmos pullups on RBL_R, RBL_R
* insert the pullups between p/n

### Precharge Pullup Only

* magic

* load sky130_fd_sc_hd__inv_1 (open technology mgr)
* ```gds``` in console
* now have sky130_fd_sc__hd__inv_1.gds

* klayout sky130_fd_sc__hd__inv_1.gds
* hack
* check with ```magic -dnull -noconsole -rcfile magicdrc_pullup.tcl toysram_local_pullup.gds``` while hacking
* drc clean with nfet side mostly removed; can't remove layer 81 (get drc);
because i haven't removed bottom of cell yet (gnd, etc)?

* now stack these with 12x2 nands to make local_eval_stack


## Tools

```
cd xschem
export PDK_ROOT=/data/projects/open_pdks/sky130
# yikes! nfet references through current dir
ln -s $PDK_ROOT/sky130B/libs.tech/xschem/sky130_fd_pr sky130_fd_pr
xschem --rcfile $PDK_ROOT/sky130B/libs.tech/xschem/xschemrc 10T_toy_xschem.sch

xschem --rcfile $PDK_ROOT/sky130B/libs.tech/xschem/xschemrc local_eval.sch

```

```
cd magic
export PDK_ROOT=/data/projects/open_pdks/sky130
magic -rcfile .magic_tech/.magicrc 10T_toy_magic.mag
console:
'gds' creates gds
'lef writeall' creates lef


magic -rcfile .magic_tech/.magicrc local_eval.mag
# use options->cell mgr to select cell; then can see layout (top is (UNNAMED) at start)
# windows->set editable
# box upper pmos section and 'a' (select all)
# 'move up 50'
```


































### Setup
A template `.magicrc` file can be found in `magic/.magic_tech`. This

@ -0,0 +1,45 @@
v {xschem version=3.1.0 file_version=1.2
}
G {}
K {}
V {}
S {}
E {}
N 430 -160 430 -140 {
lab=RBL_R_b}
N 430 -110 480 -110 {
lab=RBL_R_b}
N 430 -190 480 -190 {
lab=GND}
N 430 -140 430 -110 {
lab=RBL_R_b}
N 430 -260 430 -220 {
lab=VDD}
N 400 -140 430 -140 {
lab=RBL_R_b}
N 240 -70 480 -70 {
lab=RBL_L_b}
C {devices/ipin.sym} 390 -190 0 0 {name=p1 lab=PRE_R_b}