https://open-source-silicon.dev logo
Title
j

Juan Andres

03/21/2023, 8:55 PM
Hi, Does anyone know if there is a way to extract an image of the layout in magic or klayout in PDF format?
t

Tim Edwards

03/21/2023, 9:13 PM
In magic, just use the
plot pnm
command to generate a PNM file, then use the
convert
(ImageMagick) command to make the PDF. e.g.,
plot pnm test 1000
in magic, and from the Linux command line,
convert test.pnm test.pdf
The "plot pnm" command is good for large layouts; "plot ps" "plot postscript" or "plot svg" are good for small layouts. The "convert" command can go between any of the formats.
Make sure you select the entire area of the chip before doing "plot", else you will get a plot of whatever is inside the box.
apt install imagemagick
j

Juan Andres

03/21/2023, 9:24 PM
the command plot svg and eps do not work for me
t

Tim Edwards

03/21/2023, 9:28 PM
Sorry, (1) it's
plot postscript
not
plot ps
, and (2) to get
plot svg
you need to run magic with the
-d XR
switch (the SVG generator is a Cairo backend, so the Cairo graphics have to be enabled).
j

Juan Andres

03/21/2023, 9:34 PM
with the first one I get a white image
I think I should write which layers, is there a way to say that all of them?
t

Tim Edwards

03/21/2023, 9:41 PM
I think the problem there is that I never wrote a postscript style for the sky130 tech file.
j

Juan Andres

03/21/2023, 9:42 PM
and with the svg command it creates the file, but trying to open it crashes everything
t

Tim Edwards

03/21/2023, 9:42 PM
What are you trying to open it with?
j

Juan Andres

03/21/2023, 9:44 PM
just open it with the linux program, and try to convert it with convert and it shows “No -conforming drawing primitives definition”
t

Tim Edwards

03/21/2023, 9:46 PM
I just generated an SVG file of an inverter layout and I can open it in "inkscape" (also in a browser using URL file:///).
j

Juan Andres

03/21/2023, 9:47 PM
But that Can I convert to pdf too?
t

Tim Edwards

03/21/2023, 9:47 PM
I was able to convert from SVG to PDF; I think ImageMagick may use ghostscript for that.
j

Juan Andres

03/21/2023, 9:49 PM
Did you use the same command or another?
t

Tim Edwards

03/21/2023, 9:50 PM
I just selected the cell, did
plot svg inverter.svg
, then exited magic and did
convert inverter.svg inverter.pdf
and it just worked. . .
I have a postscript style but I need to adapt it for sky130. I'll try to get that done in a little bit.
j

Juan Andres

03/21/2023, 10:04 PM
Thanks, Do you know why when generating the svg, the image shows the mark "top cell in the view"
t

Tim Edwards

03/22/2023, 12:25 AM
Because the SVG generator is a Cairo back-end, and just draws whatever is in the window, verbatim. If you do
select clear
before you do the
plot
command, it should disappear.