Hi, I'm creating LEF files from Magic using as ref...
# magic
n
Hi, I'm creating LEF files from Magic using as reference this repository by @Nickson Jose (thanks Nickson). I've added the property
FIXED_BBOX
and port attributes
class, use
but I have a doubt about some properties it seems were added on the layout [Fig 2] that I don't understand. I found in Magic documentation a description for
LEFclass
and
LEFsource
[Fig 3] but are not clear for me. Same for
LEFsite
. Could anyone help me with them?
t
You need to reference the LEF/DEF documentation for the description of what a LEF file CLASS, SOURCE, and SITE mean. CLASS is usually
CORE
for all standard cells but may have a 2nd keyword
TIEHIGH
,
TIELOW
,
SPACER
,
ANTENNACELL
,
WELLTAP
, or
FEEDTHRU
, for special-purpose standard cells. There is no
LEFsource
and I obviously need to remove it from the documentation (which I will go do as soon as I finish writing this).
LEFsymmetry
tells a placement tool whether cells can be flipped; usually this is set to
X Y
(cells can be flipped either way). (I've also seen
X Y R90
but it's not clear to me what a placement tool would ever be able to do with
R90
).
LEFsite
points to the name of a
SITE
which is usually defined in the technology LEF file; it's a definition of a bounding box for a unit size cell.
m
@Tim Edwards This means if the property
LEFsource
has been set in any custom standard cell, it can safely be removed because it is never used? In this LEF/DEF ref (https://www.ispd.cc/contests/18/lefdefref.pdf) page 250 there is a reference to a
SOURCE
parameter in the DEFsyntax chapter (not LEF), but
LEFsource
was set in a few github repository workshop documentations I've seen (and so did I)..
t
Yes, it can be safely removed. Or just ignored. Magic processes the properties list when it writes LEF; it is looking for specific property names, and since
LEFsource
is not one of them, it will never be output. I suspect that the documented name is just a typo. There were references in the same file (
lef
command reference) to "LEFshape" and "LEFuse". These all correspond to pin properties, not macro properties. They might have been dropped into the documentation during some early development work on the LEF/DEF parsers.
m
All right, thanks Tim!
n
Thanks @Tim Edwards, one doubt about
LEFsite
I was checking the technology LEF file for libraries
_hd_
and
_hvl_
. They have as
SITE
property
unithd
and
unithv
respectively. If my cells are custom (they doesn't share the same dimensions of sky130 libraries, only the
_hd_
X-GRID
(0.46um), what value could I assign to this property?
t
@Nelson Rodriguez: The height of the (unit) site is just the height of the standard cell (although you can also define a double-height unit cell, but I understand that OpenROAD doesn't support double-height cells yet). All of your standard cells should have a width that is a multiple of some unit distance. That width should be the width of the site. There may not be any cell that has that width, but all cells should be, e.g., 2x, 3x, 4x, etc., of the unit site width.
n
Excuseme @Tim Edwards I understand what you said, but I still don't have clear, what should I add to the property
LEFsite
. The LEF files in sky libraries have these strings assigned [Fig1, 2, 3], that's what I don't know, where do they come from?
t
@Nelson Rodriguez: It matches the SITE definition in the technology LEF file (e.g.,
/usr/share/pdk/sky130A/libs.ref/sky130_fd_sc_hd/techlef/sky130_fd_sc_hd__nom.tlef
):
Copy code
# High density, single height
SITE unithd
  SYMMETRY Y ;
  CLASS CORE ;
  SIZE 0.46 BY 2.72 ;
END unithd
n
Ok @Tim Edwards I found them, so If my custom cell has
SIZE 0.46 BY 4.8
do I have to add the following lines in that file?
Copy code
SITE unitcustom
   SYMMETRY Y ;
   CLASS CORE ;
   SIZE 0.46 BY 4.8 ;
END unitcustom
t
Yes, that's what you want. You'll want to copy the entire technology LEF file so that you will have a technology LEF file that is correct for your standard cell library. Most of the technology LEF file will be the same (metal width and spacing rules, etc.); you will just need to change the unit SITE definition and the route pitches (if needed).