Hi Matthias,
Is there a way to extract a cell with it's hierarchy(like the "Save Current Cell As" function in Cells list) via RBA ? currently a possible code I think is the following steps:
1. Open the original database
2. New a layout database
3. Copy the cell we want from original to new
4. Save the new layout to a GDS/OASIS
For the replace action:
1. Open the original database
2. Open the cell database
3. Delete the cell(maybe "A") from original
4. Copy "A" from cell to original
5. Save original
Is that correct?
Best Regards,
--
chhung
Comments
Hi Matthias,
I referenced the following code you wrote and trying to implement the cell extraction function via RBA code, however it failed with the error message, I guess the copy_cells could not be used in this condition, could you please give me some hints ?
Error message:
*** ERROR: ./test.rb:38: Ruby error: 'No method with matching arguments for method new, class CellInstArray' (RuntimeError)
If I remark lines about CellInstArray, the code works and output correct patterns, however the extracted cell would not contain the instances.
Ref:
http://klayout.de/forum/comments.php?DiscussionID=103&page=1#Item_0
Hi chunng,
the problem is caused by the test for the cell name:
is not confining the copy to a subtree. Instead it will only select the cell with srccellname and that is why there are not copies of child cells when the function is trying to map the cell instances.
Instead the code should look like that:
This code should process all cells which need to be copied. Doing that bottom-up ensures that child cells are available when they are required to map instanced.
Lacking the complete code I have not tested that, but I am confident it works.
Best regards,
Matthias
Hi Matthias,
I modified the code and try to run it again, however the result didn't fit our request, it still contains all the cells in the original database(just like copy), not extracted cell with sub cells.
The whole RBA code:
Best Regards,
chhung
Hi chhung,
your script is missing a tiny but important detail: the "if" inside the "lsrc.each_cell_bottom_up do |cisrc| ..." loop is missing.
See my code above:
with this, the script should only copy should be confined to the subtree of the given cell (I can't edit your reply otherwise I would have corrected that :-) )
Best regards,
Matthias
Hi Matthias,
You are right, I missed the "if called_cells[cisrc]" statement...
I modified the code and confirmed it works fine now, and I edited/corrected the code in the above post for others who interesting in it.
Really appreciate your kindly support~ :-)
Best Regards,
chhung