Optimizing Shape Movement Between Cells

Hi Matthias,

I use the following code to move shapes from a source cell into a target cell. However, since there are numerous cells and shapes involved, this code runs quite slowly. For both the source layout and the target layout, the database unit (dbu) is identical. Is there a faster method to move these shapes? Instead of creating new shapes in the target cell and then clearing the shapes from the source cell, can the shapes be moved directly? This would improve speed and reduce memory usage. Could you please advise on the appropriate function interface to use? Thank you very much

                  db::Cell &source_cell = source_layout.cell(source_cid);
                  db::Cell &target_cell = target_layout.cell(target_cid);

                  for (std::map<unsigned int, unsigned int>::const_iterator lm = layer_mapping.begin (); lm != layer_mapping.end (); ++lm) {
                    target_cell.shapes (lm->second).insert (source_cell.shapes (lm->first));
                     source_cell.shapes (lm->first).clear();
                  }

Comments

  • The "Cell" class has a "move" method while allows moving shapes from one cell/layer to another cell/different layer.

    But eventually the implementation is not much different from yours. So I don't think you will gain a lot.

    Matthias

Sign In or Register to comment.