Hi, Does anyone know if there is a way to extract ...
# magic
j
Hi, Does anyone know if there is a way to extract an image of the layout in magic or klayout in PDF format?
t
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.,
Copy code
plot pnm test 1000
in magic, and from the Linux command line,
Copy code
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
the command plot svg and eps do not work for me
t
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
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
I think the problem there is that I never wrote a postscript style for the sky130 tech file.
j
and with the svg command it creates the file, but trying to open it crashes everything
t
What are you trying to open it with?
j
just open it with the linux program, and try to convert it with convert and it shows “No -conforming drawing primitives definition”
t
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
But that Can I convert to pdf too?
t
I was able to convert from SVG to PDF; I think ImageMagick may use ghostscript for that.
j
Did you use the same command or another?
t
I just selected the cell, did
plot svg inverter.svg
, then exited magic and did
convert inverter.svg inverter.pdf
and it just worked. . .
🌍 1
I have a postscript style but I need to adapt it for sky130. I'll try to get that done in a little bit.
🌍 1
j
Thanks, Do you know why when generating the svg, the image shows the mark "top cell in the view"
t
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.
v
@Tim Edwards Seen below is how layout looks in magic (left) and on right side is output of
plot pnm check.pnm 1000
. Is there any option that
plot
command output looks more like original layout and layer colours. What is optimum way of generating high resolution image from magic for documentation purpose ?
t
The colors for a PNM plot are taken from the layout colors by default, without regard to stipple patterns, so light stipples such as the pwell in your layout come out considerably darker in the PNM plot. If you look at the "plot" section in the sky130A.tech tech file, the "style pnm" specifies a few things that should not be rendered in color in a PNM plot. You can improve the result with "draw pwell no_color_at_all". There aren't too many other choices other than to find a drawn style which is in a lighter color; maybe "orange1" would work. However, the "plot pnm" method was made for rendering large areas where details are too tiny to see. There are two other plot types that are good for rendering at the size of a transistor: "plot postscript" gives a good rendering in postscript that matches more closely to the GDS view (it will render contact cuts, for instance), and "plot svg" gives a rendering that is an exact match for what's on the screen. For "plot postscript" you need a modified tech file; I have one that I was working on but I never finished it, but is probably "good enough" for most purposes. For "plot svg", you need to make sure that you start magic with "magic -d XR" because it relies on the cairo graphics package back-end SVG format converter.