-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmagic_init_project.tcl
More file actions
55 lines (47 loc) · 1.73 KB
/
magic_init_project.tcl
File metadata and controls
55 lines (47 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024-2025 Tiny Tapeout LTD
# Author: Uri Shaked
# Description: This script initializes a new Magic project for an analog design on Tiny Tapeout.
# Important: before running this script, download the the .def file from
# https://raw.githubusercontent.com/TinyTapeout/tt-support-tools/main/tech/sky130A/def/analog/tt_analog_1x2.def
# Change the settings below to match your design:
# ------------------------------------------------
set TOP_LEVEL_CELL tt_um_IEEE_open_silicon_FOSSEE
set TEMPLATE_FILE tt_analog_1x2.def
set POWER_STRIPE_WIDTH 2um ;# The minimum width is 1.2um
# Power stripes: NET name, x position. You can add additional power stripes for each net, as needed.
set POWER_STRIPES {
VDPWR 1um
VGND 4um
}
# If you use the 3v3 template, uncomment the line below:
#lappend POWER_STRIPES VAPWR 7um
# Read in the pin positions
# -------------------------
def read $TEMPLATE_FILE
cellname rename tt_um_template $TOP_LEVEL_CELL
# Draw the power stripes
# --------------------------------
proc draw_power_stripe {name x} {
global POWER_STRIPE_WIDTH
box $x 5um $x 220.76um
box width $POWER_STRIPE_WIDTH
paint met4
label $name FreeSans 0.25u -met4
port make
port use [expr {$name eq "VGND" ? "ground" : "power"}]
port class bidirectional
port connections n s e w
}
# You can extra power stripes, as you need.
foreach {name x} $POWER_STRIPES {
puts "Drawing power stripe $name at $x"
draw_power_stripe $name $x
}
# Save the layout and export GDS/LEF
# ----------------------------------
save ${TOP_LEVEL_CELL}.mag
file mkdir gds
gds write gds/${TOP_LEVEL_CELL}.gds
file mkdir lef
lef write lef/${TOP_LEVEL_CELL}.lef -hide -pinonly