deepcopy overide for instance

This commit is contained in:
Jesse Cirimelli-Low 2023-08-11 13:45:24 -07:00
parent e23289d5ae
commit 0111620c91
2 changed files with 9 additions and 2 deletions

View File

@ -200,9 +200,17 @@ class instance(geometry):
self.width = round_to_grid(mod.width)
self.height = round_to_grid(mod.height)
self.compute_boundary(offset, mirror, rotate)
debug.info(4, "creating instance: " + self.name)
def __deepcopy__(original, memo):
new_inst = instance(original.name+"_copy", original.mod)
new_inst.rotate = original.rotate
new_inst.offset = original.offset
new_inst.mirror = original.mirror
new_inst.is_bitcell = original.is_bitcell
return new_inst
def get_blockages(self, lpp, top=False):
""" Retrieve blockages of all modules in this instance.
Apply the transform of the instance placement to give absolute blockages."""

View File

@ -479,7 +479,6 @@ class layout():
def add_existing_inst(self, inst, name):
new_inst = deepcopy(inst)
new_inst.mod = inst.mod
self.mods.add(new_inst.mod)
if name:
new_inst.name = name