It looks like you're new here. If you want to get involved, click one of these buttons!
Hi Matthias,
I tried to write a simple code to list all cells' name from input database,
the following partial code works however the performance is not good enough
when processing database with many cells(more than 10,000~100,000),
is there any way to dump whole database cells' name directly and faster
then the code ? Thanks~
layout.each_cell do |cell|
puts "#{cell.name}"
end
or
i = 0
while i < layout.cells
puts "#{layout.cell(i).name}"
i = i+1
end
chhung
Comments
Hi chhung,
The first code is already pretty short. Basically it should not take more than a few seconds even for 100k cells.
A small optimization is possible by omitting the string interpolation (
puts(x)
instead ofputs("#{x}")
)I assume the performance is limited by the output method. If you print to the console this will be pretty slow.
You can try to write the names to a file:
Another tip is to disable the debugger or close the macro IDE (you need to bind the script to a menu then). The macro IDE will slow down script execution considerably. For maximum performance you can run the script in batch mode without UI.
If this still isn't good enough, you have hit the limits of a scripting language, I'm afraid.
Matthias
Hi Matthias,
I modified the code and disabled the macros, and tried to write the cell name to file, however the run time is still too long(more than 3 minutes for a 160K cells database)
But I noticed that the load time of database is about 17 seconds, the cell name file output completed is about 2 seconds, in theory after all the cell names were generated, the klayout process should close immediately, however it keeps running(CPU load 99~100%) more than 2 minutes then closed.
The version I am using is 0.24.10, and once I switch the klayout version to 0.25.9 or 0.26.5, the run time decreased to about 19~20 seconds, so maybe it's a bug of old klayout version.
Thanks for your help~
Best Regards,
chhung