Nelson Rodriguez
02/21/2023, 9:24 PMTim Edwards
02/21/2023, 10:35 PMgrid 0.28um 0.28um
(you can add two more coordinates for offsets if you need to line it up correctly with your drawing).Nelson Rodriguez
02/22/2023, 1:13 AMTim Edwards
02/22/2023, 1:17 AMelement 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.Nelson Rodriguez
02/22/2023, 2:11 AM.mag
and tried to source it source ./template.mag
but nothing. Here is the 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
um
or u
generates an error or block the command:Tim Edwards
02/22/2023, 2:10 PMelement 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.Nelson Rodriguez
02/23/2023, 8:44 PMscalegrid
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.Tim Edwards
02/23/2023, 10:05 PMtech 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
.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).Nelson Rodriguez
02/24/2023, 2:04 AM