DRC::def_output: A simple yet useful extension to obtain the output layout and to manipulate it (within limits)

This commit is contained in:
Matthias Koefferlein 2025-07-21 22:21:33 +02:00
parent cb4511b721
commit d4e3872142
8 changed files with 133 additions and 5 deletions

View File

@ -434,6 +434,28 @@ By default the interpretation of such polygons is undefined - they may even vani
By setting this flag to true, the deep mode layout processor will reject such polygons with
an error.
</p>
<a name="def_output"/><h2>"def_output" - Gets an object describing the default output channel</h2>
<keyword name="def_output"/>
<p>Usage:</p>
<ul>
<li><tt>def_output</tt></li>
</ul>
<p>
The function returns an object describing the current output channel.
This channel object can be used like the channels delivered by
<a href="/about/drc_ref_global.xml#new_target">new_target</a> or <a href="/about/drc_ref_global.xml#new_report">new_report</a>.
</p><p>
These readonly attributes are supported by the channel object:
</p><p>
<ul>
<li>"layout": the <class_doc href="Layout">Layout</class_doc> object if the output is a layout </li>
<li>"rdb": the <class_doc href="ReportDatabase">ReportDatabase</class_doc> object if the output is a report </li>
<li>"cell": a <class_doc href="Cell">Cell</class_doc> object or <class_doc href="RdbCell">RdbCell</class_doc> object, depending on the type of channel </li>
</ul>
</p><p>
Note, that the channel object will be modified when you use <a href="/about/drc_ref_global.xml#output_cell">output_cell</a>,
<a href="/about/drc_ref_global.xml#target">target</a> or <a href="/about/drc_ref_global.xml#report">report</a> calls that change the target.
</p>
<a name="device_scaling"/><h2>"device_scaling" - Specifies a dimension scale factor for the geometrical device properties</h2>
<keyword name="device_scaling"/>
<p>Usage:</p>
@ -1666,6 +1688,9 @@ The cellname specifies the top cell used for the report file.
By default this is the cell name of the default source. If there
is no source layout you'll need to give the cell name in the
third parameter.
</p><p>
The return value of this method is a channel object of the same
type that <a href="/about/drc_ref_global.xml#new_report">new_report</a> will return.
</p>
<a name="report_netlist"/><h2>"report_netlist" - Specifies an extracted netlist report for output</h2>
<keyword name="report_netlist"/>
@ -2033,6 +2058,7 @@ needs to be the same - i.e. all need to render polygons or edges or edge pairs.
<keyword name="target"/>
<p>Usage:</p>
<ul>
<li><tt>target</tt></li>
<li><tt>target(what [, cellname])</tt></li>
</ul>
<p>
@ -2055,6 +2081,9 @@ a new target will be set up.
Except if the argument is a <class_doc href="Cell">Cell</class_doc> object, a cellname can be specified
stating the cell name under which the results are saved. If no cellname is
specified, either the current cell or "TOP" is used.
</p><p>
The return value of this method is a channel object of the same
type that <a href="/about/drc_ref_global.xml#new_target">new_target</a> will return.
</p>
<a name="target_netlist"/><h2>"target_netlist" - With this statement, an extracted netlist is finally written to a file</h2>
<keyword name="target_netlist"/>

View File

@ -1233,8 +1233,17 @@ Without a reference point given, the lower left corner of the fill pattern's bou
as the reference point. The reference point will also defined the footprint of the fill cell - more precisely
the lower left corner. When step vectors are given, the fill cell's footprint is taken to be a rectangle
having the horizontal and vertical step pitch for width and height respectively. This way the fill cells
will be arrange seamlessly. However, the cell's dimensions can be changed, so that the fill cells
will be arrange seamlessly.
</p><p>
However, the cell's dimensions can be changed, so that the fill cells
can overlap or there is a space between the cells. To change the dimensions use the "dim" method.
This example will use a fill cell footprint of 1x1 micrometers, regardless of the step pitch:
</p><p>
<pre>
p = fill_pattern("FILL_CELL")
p.shape(1, 0, box(0.0, 0.0, 1.0, 1.0))
p.dim(1.0, 1.0)
</pre>
</p><p>
The following example specifies a fill cell with an active area of -0.5 .. 1.5 in both directions
(2 micron width and height). With these dimensions the fill cell's footprint is independent of the
@ -1247,6 +1256,18 @@ p.origin(-0.5, -0.5)
p.dim(2.0, 2.0)
</pre>
</p><p>
Finally, the fill cell can be given a margin: this is a space around the fill cell which needs
to be inside the fill region. Hence, the margin can be used to implement a distance, the fill
cells (more precisely: their footprints) will maintain to the outside border of the fill region.
The following example implements a margin of 200 nm in horizontal and 250 nm in vertical direction:
</p><p>
<pre>
p = fill_pattern("FILL_CELL")
p.shape(1, 0, box(0.0, 0.0, 1.0, 1.0))
p.dim(1.0, 1.0)
p.margin(0.2, 0.25)
</pre>
</p><p>
With these ingredients will can use the fill function. The first example fills the polygons
of "to_fill" with an orthogonal pattern of 1x1 micron rectangles with a pitch of 2 microns:
</p><p>

View File

@ -1579,6 +1579,9 @@ module DRC
# By default this is the cell name of the default source. If there
# is no source layout you'll need to give the cell name in the
# third parameter.
#
# The return value of this method is a channel object of the same
# type that \global#new_report will return.
def report(description, filename = nil, cellname = nil)
@ -1592,7 +1595,9 @@ module DRC
@def_output = _make_report(description, filename, cellname)
end
@def_output
end
# %DRC%
@ -1713,6 +1718,7 @@ module DRC
# %DRC%
# @name target
# @brief Specify the target layout
# @synopsis target
# @synopsis target(what [, cellname])
# This function can be used to specify a target layout for output.
# Subsequent calls of "output" will send their results to that target
@ -1733,12 +1739,14 @@ module DRC
# Except if the argument is a RBA::Cell object, a cellname can be specified
# stating the cell name under which the results are saved. If no cellname is
# specified, either the current cell or "TOP" is used.
#
#
# The return value of this method is a channel object of the same
# type that \global#new_target will return.
def target(arg, cellname = nil)
def target(arg = nil, cellname = nil)
self._context("target") do
# finish what we got so far
_finish(false)
@ -1747,6 +1755,41 @@ module DRC
end
@def_output
end
# %DRC%
# @name def_output
# @brief Gets an object describing the default output channel
# @synopsis def_output
#
# The function returns an object describing the current output channel.
# This channel object can be used like the channels delivered by
# \global#new_target or \global#new_report.
#
# These readonly attributes are supported by the channel object:
#
# @ul
# @li "layout": the RBA::Layout object if the output is a layout @/li
# @li "rdb": the RBA::ReportDatabase object if the output is a report @/li
# @li "cell": a RBA::Cell object or RBA::RdbCell object, depending on the type of channel @/li
# @/ul
#
# Note, that the channel object will be modified when you use \global#output_cell,
# \global#target or \global#report calls that change the target.
def def_output
self._context("def_output") do
# establish an output channel if none was established so far
if ! @def_output
@def_output = LayoutOutputChannel::new(self, self._output_layout, self._output_cell, nil)
end
end
@def_output
end
# %DRC%

View File

@ -1993,3 +1993,13 @@ TEST(132d_sensitive_breaking)
{
run_test (_this, "132", true);
}
TEST(140_target_modification)
{
run_test (_this, "140", false);
}
TEST(140d_target_modification)
{
run_test (_this, "140", true);
}

25
testdata/drc/drcSimpleTests_140.drc vendored Normal file
View File

@ -0,0 +1,25 @@
source $drc_test_source
target $drc_test_target
if $drc_test_deep
deep
end
l1 = input(1, 0)
l2 = input(2, 0)
top_cell = def_output.cell
# Separat 1/0 and 2/0 to two cells L1, L2
output_cell("L1")
top_cell.insert(RBA::DCellInstArray::new(def_output.cell, RBA::DTrans::new))
l1.output(1, 0)
output_cell("L2")
top_cell.insert(RBA::DCellInstArray::new(def_output.cell, RBA::DTrans::new))
l2.output(2, 0)

BIN
testdata/drc/drcSimpleTests_140.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au140.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au140d.gds vendored Normal file

Binary file not shown.