in magic is there a simple way to get the size of ...
# magic
h
in magic is there a simple way to get the size of a cell boundary (for scripting purposes)?
m
You mean size of the cell? Just take your cursor above the selection and press b. The details should be visible in the command shell.
h
This is hypothetically an auto-generated cell going straight into another tool that needs to know it's size. I am doing it by looking at the original generation parameters atm but was wondering if there's a shortcut
m
@User might have an answer.
t
@User: If it's an abutment box like is used for standard cells, then it is set as a property of the cell called FIXED_BBOX and can be obtained with
property FIXED_BBOX
. Otherwise, you can get the geometrical bounds using
load <cell>;  select top cell; box values
. The returned value will be in internal database units. That may be sufficient for scripting purposes; if not, and you need units in, say, microns, then multiply all the box values by the value returned by
cif scale out
(which is the conversion scalefactor between internal units and microns).
h
thank you 🙂
hmm, I can't quite figure out how to turn this into a shell script/command. when I run those commands manually the box values come out, but if I try putting them into a tcl script then the box values just don't get printed
ah the script runs first my bad
t
In a script you want to do, e.g.,
set bbox [box values]
, something like this should work:
Copy code
set scf [cif scale out]
select top cell
set bbox [box values]
set llx [expr [lindex $bbox 0] * $scf]
set lly [expr [lindex $bbox 1] * $scf]
set urx [expr [lindex $bbox 2] * $scf]
set ury [expr [lindex $bbox 3] * $scf]
h
I'm trying to use the
load <cell>;  select top cell; box values
method
When I type it into the shell it gives me what I want, but I tried making a script with
tech load [tech];
load [cell];
select top cell;
box values
However when I call magic with
magic -dnull -noconsole  mag/cellsize.tcl
, it doesn't print the box values which is what I would expect it to do
t
The problem is that
box values
does not print to stdout; it returns a result which is a list. The behavior of the console is to echo all results, but this is console behavior, not Tcl/Tk behavior. So if you want the result printed you will need to do
puts stdout [box values]
.
h
ahh right, I will give that a shot
that's the behaviour I was looking for, thank you very much for the help
(sorry it's a bit awkward, it's because I want to get these values into python)