It looks like you're new here. If you want to get involved, click one of these buttons!
the doc shows the 3rd argument as a lmap, however I get the following error when running it:
Unexpected object type (expected hash, got RBA::LayerMapping) for argument #3 ('lmap') in LayoutToNetlist::build_all_nets
Below is the code segment:
# Performs netlist extraction
startTime = Time.now
#LayoutToNetlist::BuildNetHierarchyMode BNH_SubcircuitCells
lm = RBA::LayerMapping::new
_lm.create_full(_layout,_layout)
_cm = RBA::CellMapping::new
_cm.for_single_cell_full(_cell, _cell)
l2n.cell_mapping_into(_layout, _cell, with_device_cells = false)
l2n.build_all_nets(_cm, _layout, _lm, net_cell_name_prefix = "net", netname_prop = nil, circuit_cell_name_prefix = nil, device_cell_name_prefix = nil)
l2n.threads=4
l2n.extract_netlist
totalTime = Time.now - startTime
f.puts "netlist runtime #{sprintf('%.2f', totalTime)};\n"
f.close
Any advice would be greatly appreciated...
Comments
Is that a paste error or do you write "lm" once and "_lm" the second time?
You can basically format code by placing a line with a triple backtick before and after the code (like GitHub Markdown for example).
But basically the problem is that "lmap" is not a LayerMapping object but a Ruby or Python hash. Here is some sample code:
You also can't use named parameters the way you did. In Ruby, named parameters are written with a colon (e.g. "fun(param: 17)"). But that does not matter as KLayout's API does not support named parameters (technically because it is derived from C++ which does not have argument names).
Matthias
I updated the use a hash for the mapping between the layout and netlist,
however the script fails with the message:
The netlist has not been extracted yet in LayoutToNetlist::build_all_nets
I am sending a test-case zip file containing 4 gerber artwork files, the ipc-356 netlist file & the ruby script
Where did you send this to? I have not seen a mail.
Matthias
I just sent a new message to klayoutadmin containing the zip file
I may have not sent it correctly the first time
I finally realized the failure message was pointing out the error in my code...
I moved the extract_netlist() call before the build_all_nets() call & it works correctly now
Very good