It looks like you're new here. If you want to get involved, click one of these buttons!
Hi All,
Do you have any way to output the name of top cells to scrent without Klayout user-interface (klayout can runing in the
background)?
In our team , we have some user didn't know how to using Klayout , who is not designer but he is an photo enginner .
so , I want to using a DOS command to link into Klayout command , just output what the top cellnames to screen for he/she preview.
Firstly , I make a icon that is a dos batch file , I want to click and drag the *.gds file into this icon to get the answer.
I also make a VBA in excel , to let the user to read the "GDS_filelog.txt" do I export.
The script in Klayout can been process.
But look like I can't using DOS command to run Klayout and get the answer .
Do you have any idea for that?
The key point will be that , our photo enginner is not the expert for Klayout
It is why I try to using DOS command to link they and this software.
DOS:
@FOR %%C IN (*.gds) DO C:\Users\%username%\AppData\Roaming\KLayout\klayout_app -r \bp-zk\OBU3\Mask\Sample\klayout\drc_118.lydrc %%C
Klayout srcipt: (drc_118.lydrc )
layoutfile = RBA::Application::instance.main_window.current_view.active_cellview.name
layoutLibrary = RBA::Application::instance.main_window.current_view.active_cellview.filename
currentfilepath=layoutLibrary.sub(layoutfile,"")
layoutView = RBA::Application::instance.main_window.current_view.active_cellview.layout
eachcells = layoutView.each_cell
username=ENV['USERNAME']
topcells = layoutView.top_cells
outputdata=Array.new()
topcells.each do |xx|
outputdata << xx.name
puts xx.name
end
log_filename="C:\\users\\#{username}\\Desktop\\GDS_filelog.txt"
aFile = File.new("#{log_filename}", "w+")
outputdata.each do |yy|
aFile.syswrite("#{yy}\n")
end
aFile.close
Comments
Hi jiunnweiyeh,
I'm not very much sure if my idea satisfies your requirements.
However, my idea is to provide your photo engineers with a simple GUI tool using KLayout Python Module (https://www.klayout.org/klayout-pypi/).
Assumptions and prerequisites:
You can set up the Python environment for your engineers. More precisely, you can:
1) install the standard Python3
2) add some core Python modules, including klayout and PyQt5 by:
% python3 -m pip install kalyout
% python3 -m pip install PyQt5
Watch the attached demo video shot on Mac.
I hope the function is straightforward and self-explanatory.
If a design file (GDS or OASIS) has a single top cell, its name is printed in blue. If there is more than one, it is printed in red.
I made two types (Type-A and Type-B) of the tool. Their behaviors are identical.
Only the implementation approach differs. Refer to the "ReadMe.txt" file in the attached ZIP file.
However, I prefer Type-B because I can split the GUI design work and coding.
I have tested both types on Mac, Linux, and Windows 11.
The images below are from Windows 11.
The file export function is not provided for simplicity. But you can copy and paste the output like other ordinary GUI tools.
Kazzz-S
Cont.
I haven't tried your original batch file, but I often ask ChatGPT for help when encountering problems.
The following is for your reference.
Kazzz-S
Chat with ChatGPT o1-preview:
Question
Answer (Think for 34 seconds)
The batch file provided has several potential issues that need correction to function properly.
Here's the corrected version:
Corrections and Explanations:
Final Corrected Batch File:
Note: Make sure that:
Cont.
I have slightly improved
Type-B
toType-B2
.Now the results are exported to an Excel file, as shown below.
To use
F2631B2.py
, you need topython3 -m pip install pandas openpyxl
.Kazzz-S
P.S.
In a Windows environment, I recommend renaming the extension from
.py
to.pyw
to associate these Qt-based Python script files with theWindowed
tool (pythonw3.exe). This tool is a Python interpreter version designed not to display a console window.Also added
Type-B3
with a different UI.Hi sekigawa-san,
@sekigawa
Thanks a lot for your help , I will try the batch file you mention.
What the issue in my side is that , our photo enginner didn't using another software to do the simple work,
even that just click and select and didn't need he/her to make any cording.
They also want to know the layer information /some special size/distance/density in some cell that have a key word.
I can make a Klayout script to export what the information they needs as a GDS report base on our internal format.
But , this script need running in Klayout.... we have to training they for basic operate in Klayout.
Anyway , let me check your idea , Thanks.