diff --git a/src/doc/doc/about/drc_ref_global.xml b/src/doc/doc/about/drc_ref_global.xml index 91fa1a06e..3deac6889 100644 --- a/src/doc/doc/about/drc_ref_global.xml +++ b/src/doc/doc/about/drc_ref_global.xml @@ -1182,6 +1182,36 @@ See Netter#netlist for a descrip
See Netter for more details
+Usage:
++This method creates an independent report object. This object +can be used in "output" to send a layer to a different report than +the default report or target. +
+Arguments are the same than for report. +
+See Layer#output for details about this feature. +
+Usage:
++This method creates an independent target object. This object +can be used in "output" to send a layer to a different layout file than +the default report or target. +
+Arguments are the same than for target. +
+See Layer#output for details about this feature. +
Usage:
@@ -1413,6 +1443,21 @@ See Source#polygons for a descr The primary input of the universal DRC function is the layer the Layer#drc function is called on. +Usage:
++Turns profiling on or off (default). In profiling mode, the +system will collect statistics about rules executed, their execution time +and memory information. The argument specifies how many operations to +print at the end of the run. Without an argument, all operations are +printed. Passing "false" for the argument will disable profiling. This is the +default. +
diff --git a/src/doc/doc/about/drc_ref_layer.xml b/src/doc/doc/about/drc_ref_layer.xml
index 4dbd218fa..6efff2012 100644
--- a/src/doc/doc/about/drc_ref_layer.xml
+++ b/src/doc/doc/about/drc_ref_layer.xml
@@ -2217,6 +2217,26 @@ a single
See report and target on how to configure output to a target layout or report database. +
+See also new_target and new_report on how to create additional +targets for output. This allows saving certain layers to different files than +the standard target or report. To do so, create a new target or report using one +of these functions and pass that object to the corresponding "output" call as +an additional argument. +
+Example: +
+
+check1 = ...
+check2 = ...
+check3 = ...
+
+second_report = new_report("Only for check2", "check2.lyrdb")
+
+check1.output("Check 1")
+check2.output("Check 2", second_report)
+check3.output("Check 3")
+
- Output can be sent to other layouts using the "target" function: + Output can be sent to other layouts using the target function:
@@ -196,7 +196,7 @@ target("@2")
target("out.gds", "OUT_TOP")
- Output can also be sent to a report database: + Output can also be sent to a report database using the report function:
@@ -234,6 +234,38 @@ l.output("check1", "The first check")
unpredictable.
+ + It is possible to open "side" reports and targets and send layers to these + outputs without closing the default output. +
+ ++ To open a "side report", use new_report + in the same way you use "report". Instead of switching the output, this function will return a + new report object that can be included in the argument list of "output" + for the layer that is to be sent to that side report: +
+ +
+# opens a new side report
+side_report = new_report("Another report")
+...
+# Send data from layer l to new category "check1" to the side report
+l.output(side_report, "check1", "The first check")
+
+ + In the same way, "side targets" can be opened using new_target. + Such side targets open a way to write certain layers to other layout files. + This is very handy for debugging: +
+ +
+# opens a new side target for debugging
+debug_out = new_target("debug.gds")
+...
+# Send data from layer l to the debug output, layer 100/0
+l.output(debug_out, 100, 0)
+
- layer = input(1, 0) - layer.raw.sized(0.1).output(100, 0) +layer = input(1, 0) +layer.raw.sized(0.1).output(100, 0) - # this check will now be done on a raw layer, since the - # previous raw call was putting the layer into raw mode - layer.width(0.2).ouput(101, 0)+# this check will now be done on a raw layer, since the +# previous raw call was putting the layer into raw mode +layer.width(0.2).ouput(101, 0)
The following two images show the effect of raw and clean mode: @@ -792,20 +824,18 @@ overlaps = layer.size(0.2).raw.merged(2)
- ... - drc_w = input(1, 0).width(0.2) - ... -+... +drc_w = input(1, 0).width(0.2) +...
can be written as:
- ... - drc_w = input(1, 0).drc(width < 0.2) - ... -+... +drc_w = input(1, 0).drc(width < 0.2) +...
The drc method is the "universal DRC" method. @@ -845,12 +875,11 @@ overlaps = layer.size(0.2).raw.merged(2)
- ... - l1 = input(1, 0) - l2 = input(2, 0) - drc_sep = l1.drc(separation(l2) <= 0.5) - ... -+... +l1 = input(1, 0) +l2 = input(2, 0) +drc_sep = l1.drc(separation(l2) <= 0.5) +...
Options are also specified together with the measurement and follow the same notation @@ -858,10 +887,9 @@ overlaps = layer.size(0.2).raw.merged(2)
- ... - drc_w = input(1, 0).drc(width(projection) < 0.2) - ... -+... +drc_w = input(1, 0).drc(width(projection) < 0.2) +...
However, the universal DRC is much more than a convenient way to write checks: @@ -879,10 +907,9 @@ overlaps = layer.size(0.2).raw.merged(2)
- ... - drc_ws = input(1, 0).drc((width < 0.2) & (space < 0.3)) - ... -+... +drc_ws = input(1, 0).drc((width < 0.2) & (space < 0.3)) +...
The boolean AND is computed between the edges on the primary shape and returns the @@ -891,12 +918,11 @@ overlaps = layer.size(0.2).raw.merged(2)
- ... - drc_ws1 = input(1, 0).width(0.2).edges - drc_ws2 = input(1, 0).space(0.3).edges - drc_ws = drc_ws1 & drc_ws2 - ... -+... +drc_ws1 = input(1, 0).width(0.2).edges +drc_ws2 = input(1, 0).space(0.3).edges +drc_ws = drc_ws1 & drc_ws2 +...
The reason is that performing the boolean computation in the local loop can be @@ -933,11 +959,10 @@ overlaps = layer.size(0.2).raw.merged(2)
- ...
- drc_w = input(1, 0).width(0.2)
- log("Number of width violations: #{drc_w.data.size}")
- ...
-
+...
+drc_w = input(1, 0).width(0.2)
+log("Number of width violations: #{drc_w.data.size}")
+...
The error function can be used to output error messages @@ -946,11 +971,23 @@ overlaps = layer.size(0.2).raw.merged(2)
- log_file("drc_log.txt")
- verbose(true)
- info("This message will be sent to the log file")
- ...
-
+log_file("drc_log.txt")
+verbose(true)
+info("This message will be sent to the log file")
+...
+
+ + The profile function will collect profiling + information during the DRC run. At the end of the script, the operations are printed to the log + output, sorted by their CPU time and approximate memory footprint. "profile" can be given a + numerical argument indicating the number of operations to print. Lower-ranking operations are + skipped in that case. By default, all operations are printed. +
+ ++# enables profiling +profile +...
Some operations implicitly specify a tile border. If the tile border is known (see length example above), explicit borders