Hi all, I am using a template to use as a guide wh...
# magic
n
Hi all, I am using a template to use as a guide while drawing. The smallest square is 0.28um x 0.28um [Fig 1]. I started working with a 0.005um x 0.005um grid and apparently the template changed its dimension by half [Fig 2] I measured the smallest cell and it gave me 0.14um x 0.14um, why did that happen?
t
How did you make your template grid?
If you want a grid to design to, you can just do
grid 0.28um 0.28um
(you can add two more coordinates for offsets if you need to line it up correctly with your drawing).
n
@Tim Edwards you helped me drawing those lines, check this thread if you want.
t
Ah. The problem is that the elements are specified in internal units. Instead, specify the element lines as physical units:
Copy code
element add line track_1 0 0 3.64um 0
element add line track_2 0 0.28um 3.64um 0.28um
Then the distances should continue to track if you change the internal scale. If you're saving the elements in a .mag file and reading them back and they're changing scale, then let me know.
n
Tim, it's not working, I changed the extension to
.mag
and tried to source it
source ./template.mag
but nothing. Here is the code
Copy code
# grid setup
grid 0.005um 0.005um
snap grid

# vertical tracks
element add line tm1_vcc black 0 0 364um 0
element add line tm1_1 black 0 28um 364um 28um
element add line tm1_2 black 0 56um 364um 56um
element add line tm1_3 black 0 84um 364um 84um
element add line tm1_4 black 0 112um 364um 112um
element add line tm1_5 black 0 140um 364um 140um
element add line tm1_6 black 0 168um 364um 168um
element add line tm1_7 black 0 196um 364um 196um
element add line tm1_8 black 0 224um 364um 224um
element add line tm1_9 black 0 252um 364um 252um
element add line tm1_10 black 0 280um 364um 280um
element add line tm1_11 black 0 308um 364um 308um
element add line tm1_12 black 0 336um 364um 336um
element add line tm1_vdd black 0 364um 364um 364um

# horizontal tracks
element add line tm2_left black 0 0 0 364um
element add line tm2_1 black 28um 0 28um 364um
element add line tm2_2 black 56um 0 56um 364um
element add line tm2_3 black 84um 0 84um 364um 
element add line tm2_4 black 112um 0 112um 364um
element add line tm2_5 black 140um 0 140um 364um
element add line tm2_6 black 168um 0 168um 364um
element add line tm2_7 black 196um 0 196um 364um
element add line tm2_8 black 224um 0 224um 364um
element add line tm2_9 black 252um 0 252um 364um 
element add line tm2_10 black 280um 0 280um 364um
element add line tm2_11 black 308um 0 308um 364um 
element add line tm2_12 black 336um 0 336um 364um 
element add line tm2_vdd black 364um 0 364um 364um
It's like adding
um
or
u
generates an error or block the command:
@Tim Edwards While you help me with that, I created a script to generate a custom template, printing lines in internal units. In this case I had to double 0.28, drawing lines with a separation of 56.
t
It's not adding the "um" that is causing the problem. It seems to be an integer overflow in the command or something like that.
element add line tm2_1 black 0.28um 0 0.28um 3.64um
works, but
element add line tm2_1 black 28um 0 28um 364um
does not. I think it should be easy to track down and fix. Meanwhile, your workaround is fine, as long as you understand what the scaling problem is.
I take that back; the line was there but was off-screen and I didn't zoom out enough to see it.
n
@Tim Edwards I found that with
scalegrid
I can set the magic internal units to be equal to lambda units. To check the current relation I type
scalegrid 1 1
if my ratio is
2 internal units : 1 lambda
, then I type
scalegrid 2 1
, to finally get
1 : 1.
I would like to know if everytime I open magic the ratio is set as
2 internal units : 1 lambda
. Having that
1 : 1
, when drawing the template, everything works. Also, I wanted to create a script to create custom standard cell templates to draw above it, setting the grid to
0.005 um 0.005 um
and the scalegrid to
1 : 1
but I would like to know if its possible to send to it the current ratio between the internal units and lambda, so I convert it to
1:1
with the script. I attach the script.
t
The
tech lambda
command returns a list representing the scale numerator and denominator in a 2-value list (the numerator, denominator format allows the internal units to be larger than or smaller than lambda without requiring floating point). The two values you would need for any scaling would be
cif scale out
(to convert between internal units and microns, although beware that is in floating point and subject to round-off error), and
tech lambda
.
You can leave everything in your python script in microns and just change the
f.write
lines to:
f.write(f"element add line track_height_{i} black 0 {i*hp}um {(wt-1)*wp}um {i*hp}um\n")
and
f.write(f"element add line track_width_{i} black {i*wp}um 0 {i*wp}um {(ht-1)*hp}um\n")
(i.e., add
um
after every non-zero coordinate).
n
@Tim Edwards it works! It wasn't working because my last update of magic was in september 🤦🏼‍♂️