<@U016EM8L91B> I’m seeing 2 standard cells placed ...
# magic
m
@Tim Edwards I’m seeing 2 standard cells placed at exactly the same location being extracted as 2 instances in the spice netlist. The schematic/verilog only has one. Are there any checks for this?
t
There are checks; for example, you cannot do
getcell
and drop a new instance on the same location as another of the same cell. However, there are ways to place cells that do not have such a check (obviously, or you wouldn't have seen it). I'd have to look in the code for GDS read and DEF read at least. My best guess is that this came from GDS?
m
Right. https://github.com/chrische-xx/mpw7/blob/main/gds/design.gds.gz
user_analog_project_wrapper
->`main`->`rosc` is the block and
ro_inv_lvt
is the cell at (57.14500, 2.24500) Extracted
rosc.ext
has
Copy code
use ro__inv_lvt ro__inv_lvt_1 1 0 11429 0 1 449
use ro__inv_lvt ro__inv_lvt_0 1 0 11429 0 1 449
t
I'm suspicious that there is a way to drop two instances on each other in magic and somehow bypass the usual checks. I guess I can think of at least one that probably works---copy a flipped version directly on top of another instance of the same cell, and then flip it. I don't think it's a particularly easy problem to solve efficiently.
m
I’m not sure of the source of the gds. It may be another tool. Would it be appropriate to ignore duplicate placements in magic on cifin?
t
Yes, I think that would be appropriate. In fact, note line 150 of database/DBcell.c (routine
DBPlaceCell()
):
Copy code
/* To do:  Check non-duplicate placement, check non-duplicate ID */
👍 1
Also see
DBCellFindDup()
. So I think there just needs to be a call to
DBCellFindDup()
where I put that comment. Note that if you search for
DBCellFindDup()
in the code base, there's one for the
getcell
command and one for selection operations. Putting it in
DBPlaceCell()
would handle both of those cases. Note, however, that without a full hierarchical survey, this will not guarantee that there are no duplicate instances in an entire design; only that there are no duplicate instances in the same cell. The more general case would be much more problematic to support, so I'd just go with adding the check to
DBPlaceCell()
.
m
Sounds like a relatively simple solution. Thanks for taking the time to look into it.