Bugfix: small LVS and DRC macro iessues (LVS and DRC menus not working etc.)

This commit is contained in:
matthias 2019-07-13 17:00:05 +02:00
parent 1251fb2cd6
commit ebca5e1ce6
5 changed files with 83 additions and 63 deletions

View File

@ -15,6 +15,8 @@
<interpreter>ruby</interpreter> <interpreter>ruby</interpreter>
<dsl-interpreter-name/> <dsl-interpreter-name/>
<text> <text>
module DRC
# Installs the home menu entries (needs to be done on autorun, not autorun-early) # Installs the home menu entries (needs to be done on autorun, not autorun-early)
if RBA::Application::instance &amp;&amp; RBA::Application::instance.main_window if RBA::Application::instance &amp;&amp; RBA::Application::instance.main_window
@ -26,21 +28,23 @@ if RBA::Application::instance &amp;&amp; RBA::Application::instance.main_window
mw = RBA::Application::instance.main_window mw = RBA::Application::instance.main_window
mw.menu.insert_menu("tools_menu.verification_group+", cat, name) mw.menu.insert_menu("tools_menu.verification_group+", cat, name)
new_action = RBA::Action::new @new_action = RBA::Action::new
new_action.title = "New #{name} Script" @new_action.title = "New #{name} Script"
new_action.on_triggered do @new_action.on_triggered do
mw.show_macro_editor(cat, true) mw.show_macro_editor(cat, true)
end end
mw.menu.insert_item("tools_menu.#{cat}.end", "new_script", new_action) mw.menu.insert_item("tools_menu.#{cat}.end", "new_script", @new_action)
edit_action = RBA::Action::new @edit_action = RBA::Action::new
edit_action.title = "Edit #{name} Script" @edit_action.title = "Edit #{name} Script"
edit_action.on_triggered do @edit_action.on_triggered do
mw.show_macro_editor(cat, false) mw.show_macro_editor(cat, false)
end end
mw.menu.insert_item("tools_menu.#{cat}.end", "edit_script", edit_action) mw.menu.insert_item("tools_menu.#{cat}.end", "edit_script", @edit_action)
end
end end
</text> </text>

View File

@ -15,6 +15,14 @@
with support by either one of those languages. with support by either one of those languages.
</p> </p>
<p>
As a special kind of macros, DRC and LVS scripts are available for editing
and debugging too. These scripts are basically Ruby scripts but run in a
customized environment so that specific functions are provided.
For more details on these kind of scripts see <link href="/manual/drc.xml"/>
and <link href="/manual/lvs.xml"/>.
</p>
<p> <p>
In a simple scenario, scripts can be stored in simple text files and loaded by KLayout using the "-rm" or "-r" command-line option. In a simple scenario, scripts can be stored in simple text files and loaded by KLayout using the "-rm" or "-r" command-line option.
"-rm" will run a script and then execute the normal application. "-r" will run a script and then exit the "-rm" will run a script and then execute the normal application. "-r" will run a script and then exit the
@ -82,6 +90,9 @@
search paths. This makes those folders useful for keeping plain Ruby or Python libraries. Generic ".lym" files cannot search paths. This makes those folders useful for keeping plain Ruby or Python libraries. Generic ".lym" files cannot
reside there and those locations are not scanned for autorun macros. reside there and those locations are not scanned for autorun macros.
</li> </li>
<li>
DRC and LVS scripts are kept inside "drc" and "lvs" folders respectively.
</li>
<li> <li>
In addition, further repositories can be given on the command line with the "-j" option. This allows In addition, further repositories can be given on the command line with the "-j" option. This allows
adding development repositories which are under configuration management and contain the latest code adding development repositories which are under configuration management and contain the latest code

View File

@ -685,28 +685,23 @@ BEGIN_PROTECTED
} }
} }
if (cat == "drc") {
TipDialog td (this,
tl::to_string (QObject::tr ("<html><body>To get started with the DRC feature, read the documentation provided: <a href=\"int:/manual/drc.xml\">Design Rule Checks (DRC)</a>.</body></html>")),
"macro-editor-drc-tips");
td.exec_dialog ();
} else {
TipDialog td (this, TipDialog td (this,
tl::to_string (QObject::tr ("<html><body>To get started with the macro development feature, read the documentation provided: <a href=\"int:/about/macro_editor.xml\">About Macro Development</a>.</body></html>")), tl::to_string (QObject::tr ("<html><body>To get started with the macro development feature, read the documentation provided: <a href=\"int:/about/macro_editor.xml\">About Macro Development</a>.</body></html>")),
"macro-editor-basic-tips"); "macro-editor-basic-tips");
td.exec_dialog (); td.exec_dialog ();
}
} else if (force_add) { } else {
if (! cat.empty ()) { if (! cat.empty ()) {
select_category (cat); select_category (cat);
} }
if (force_add) {
lym::Macro *m = new_macro (); lym::Macro *m = new_macro ();
if (force_add && m) { if (m) {
set_run_macro (m); set_run_macro (m);
} }
}
} }

View File

@ -15,6 +15,8 @@
<interpreter>ruby</interpreter> <interpreter>ruby</interpreter>
<dsl-interpreter-name/> <dsl-interpreter-name/>
<text> <text>
module LVS
# Installs the home menu entries (needs to be done on autorun, not autorun-early) # Installs the home menu entries (needs to be done on autorun, not autorun-early)
if RBA::Application::instance &amp;&amp; RBA::Application::instance.main_window if RBA::Application::instance &amp;&amp; RBA::Application::instance.main_window
@ -26,21 +28,23 @@ if RBA::Application::instance &amp;&amp; RBA::Application::instance.main_window
mw = RBA::Application::instance.main_window mw = RBA::Application::instance.main_window
mw.menu.insert_menu("tools_menu.verification_group+", cat, name) mw.menu.insert_menu("tools_menu.verification_group+", cat, name)
new_action = RBA::Action::new @new_action = RBA::Action::new
new_action.title = "New #{name} Script" @new_action.title = "New #{name} Script"
new_action.on_triggered do @new_action.on_triggered do
mw.show_macro_editor(cat, true) mw.show_macro_editor(cat, true)
end end
mw.menu.insert_item("tools_menu.#{cat}.end", "new_script", new_action) mw.menu.insert_item("tools_menu.#{cat}.end", "new_script", @new_action)
edit_action = RBA::Action::new @edit_action = RBA::Action::new
edit_action.title = "Edit #{name} Script" @edit_action.title = "Edit #{name} Script"
edit_action.on_triggered do @edit_action.on_triggered do
mw.show_macro_editor(cat, false) mw.show_macro_editor(cat, false)
end end
mw.menu.insert_item("tools_menu.#{cat}.end", "edit_script", edit_action) mw.menu.insert_item("tools_menu.#{cat}.end", "edit_script", @edit_action)
end
end end
</text> </text>

View File

@ -70,9 +70,19 @@ module LVS
# create a template for the macro editor: # create a template for the macro editor:
mt = create_template("lvs") mt = create_template("lvs")
mt.text = &lt;&lt;"END" mt.text = &lt;&lt;"END"
# Try this sample script with this layout:
# https://github.com/KLayout/klayout/tree/master/samples/lvs/ringo.gds
# and this schematic:
# https://github.com/KLayout/klayout/tree/master/samples/lvs/schematic.cir
# Reference schematic (if not absolute: path relative to original layout) # Reference schematic (if not absolute: path relative to original layout)
schematic("schematic.cir") schematic("schematic.cir")
# Tip: you can also use:
# schematic(source.path.sub(/\.(oas|gds)/, ".cir"))
# to derive the schematic name from the layout file's name
# by substituting .oas or .gsd with .cir.
# Enable hierarchical mode # Enable hierarchical mode
deep deep
@ -88,12 +98,10 @@ active = input(2, 0)
pplus = input(3, 0) pplus = input(3, 0)
nplus = input(4, 0) nplus = input(4, 0)
poly = input(5, 0) poly = input(5, 0)
contact = input(6, 0) contact = input(8, 0)
metal1 = input(7, 0) metal1 = input(9, 0) # includes labels
metal1_lbl = labels(7, 1) via1 = input(10, 0)
via1 = input(8, 0) metal2 = input(11, 0) # includes labels
metal2 = input(9, 0)
metal2_lbl = labels(9, 1)
# Bulk layer for terminal provisioning # Bulk layer for terminal provisioning
bulk = polygon_layer bulk = polygon_layer
@ -133,10 +141,8 @@ connect(ntie, contact)
connect(nwell, ntie) connect(nwell, ntie)
connect(ptie, contact) connect(ptie, contact)
connect(contact, metal1) connect(contact, metal1)
connect(metal1, metal1_lbl) # attaches labels
connect(metal1, via1) connect(metal1, via1)
connect(via1, metal2) connect(via1, metal2)
connect(metal2, metal2_lbl) # attaches labels
# Global # Global
connect_global(bulk, "SUBSTRATE") connect_global(bulk, "SUBSTRATE")