<@U017X0NM2E7> <@U016EM8L91B> I am trying to edit ...
# magic
p
@Mitch Bailey @Tim Edwards I am trying to edit an existing layout in magic . I need to add fillers cells to the layout. The sky130_fd_sc_hvl_fill_8.gds file is available in the pdk how I can add this to my layout??
t
getcell sky130_fd_sc_hvl_fill_8
p
@Tim Edwards Thanks! Also how to save the layout in magic? Should I use save or writeall or write gds.And yes I am using parameterized cells in layout
t
Use
writeall
.
p
Where does the the layout gets saved by writeall and how can it be reopened once again where we saved last??
Every time when we edit the layout do we need to run write gds at the end after writeall command
t
It gets saved in one or more
.mag
files in the location where magic was started (e.g., result of running the shell command
pwd
in the Tcl interpreter). For magic, GDS is an "exported" data format. You should never go from GDS -> mag then from mag -> GDS if you don't want your data potentially altered in the process, because magic has rules for generating derived layers from GDS, and more rules for generating GDS from its layers. Those two sets of rules are not necessarily reflexive.
v
@Tim Edwards Is there an option to save layout in a specific folder at path different from where magic was started ?
t
It's a little tricky because subcells retain their locations in the .mag file. If you want to do that for just one or two cells, then load the cell and used the
cellname filepath
command to change the location of the cell (then
writeall
to save to the new location). If you want to migrate a bunch of cells, then just copy the cells to the new location, then read everything in from the top level using
load -dereference
to get rid of all the original path information (then
writeall
to save).
v
What is ideal way of saving layout of multiple sub-blocks and top level blocks in magic? For xschem, different block schematics and testbench scehamtics are created in different folders and integrated into top-level schematic at some other location. What kind of approach can be followed for magic layouts of sub-blocks and top level layout ?
m
The magicrc file sets up a search path (command
addpath
) for mag files. In order to be portable, it is probably wise to have the cells in a subdirectory although a sister directory might work too. You can check the first
use
line for each cell in the resultant
mag
file to ensure that you do not have absolute paths.
v
@Mitch Bailey Is it ok if
inverter_chain.mag
layout file is moved to sub-folder (
inv01
) in attached directory structure.
inverter.mag
cell layout is used inside
inverter_chain.mag
. Any specific points to take care? I could not get what needs to be done with
addpath
or
use
commands as mentioned in your last reply.
m
Each
mag
file has
use
lines for the cell instances it contains. Some lines have the path to the mag file included like this
Copy code
use sky130_fd_sc_hd__mux2_8  _16517_ $PDKPATH/libs.ref/sky130_fd_sc_hd/mag
Others don’t
Copy code
use user_id_programming  user_id_value
For the lines that don’t have an explicit path to the mag file, magic has an internal path search list that begins with the current directory by default. You can modify this path using the
addpath
command. The path is also searched if the cell can not be found in the explicit path. In your example, you have
Copy code
inverter.mag
inv01/
+- inverter_chain.mag
One way to place the cell would be to use a
../
as an explicit directory path.
Copy code
use inverter inv1 ../
Maybe you meant the other way.
Copy code
inverter_chain.mag
inv01/
+- inverter.mag
where
inverter_chain.mag
would contain
Copy code
use inverter inv1 inv01/
👍 1
v
Thanks @Mitch Bailey, got the point now.
👍 1