From f67b28c52a6f813e8d82878e454fc17d07ef00d9 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 4 Nov 2022 23:45:10 +0100 Subject: [PATCH] Supporting LayerInfo objects in fill pattern generation, doc updates --- src/doc/doc/about/drc_ref_layer.xml | 19 +++++++++++++++++++ src/drc/drc/built-in-macros/_drc_layer.rb | 19 +++++++++++++++++++ src/drc/drc/built-in-macros/_drc_tags.rb | 4 ++++ testdata/drc/drcSimpleTests_46.drc | 4 ++-- 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/doc/doc/about/drc_ref_layer.xml b/src/doc/doc/about/drc_ref_layer.xml index 6d105b8ea..4cc344d45 100644 --- a/src/doc/doc/about/drc_ref_layer.xml +++ b/src/doc/doc/about/drc_ref_layer.xml @@ -1125,6 +1125,25 @@ A more compact way of writing this is: p = fill_pattern("FILL_CELL").shape(1, 0, box(0.0, 0.0, 1.0, 1.0))

+The "shape" method takes several forms: +

+

+

+The first form takes a GDS2 layer number. The datatype is assumed to be 0. +The second form takes a GDS layer and datatype number. +The third form takes a layer name for layout systems with named layers +(like Magic, CIF or DXF). +The forth form takes a LayerInfo object to specify the layer. +All forms take one to many geometry objects which are written to the respective layer. +Geometry objects can either be created using the generator functions +(box, polygon, path). The core classes DBox, DPolygon, DPath or +DText are also accepted as geometry objects. +

The fill pattern can be given a reference point which is used for placing the pattern. The reference point is the one which is aligned with the pattern origin. The following code will assign (-0.5, -0.5) as the reference point for the 1x1 micron rectangle. Hence the reference point is a little below and left of the rectangle which diff --git a/src/drc/drc/built-in-macros/_drc_layer.rb b/src/drc/drc/built-in-macros/_drc_layer.rb index 88ab7e0b7..c8e2731a5 100644 --- a/src/drc/drc/built-in-macros/_drc_layer.rb +++ b/src/drc/drc/built-in-macros/_drc_layer.rb @@ -4712,6 +4712,25 @@ CODE # p = fill_pattern("FILL_CELL").shape(1, 0, box(0.0, 0.0, 1.0, 1.0)) # @/code # + # The "shape" method takes several forms: + # + # @ul + # @li @tt shape(layer, object, object ...) @/tt (1) @/li + # @li @tt shape(layer, datatype, object, object ...) @/tt (2) @/li + # @li @tt shape(name, object, object ...) @/tt (3) @/li + # @li @tt shape(layer_info, object, object ...) @/tt (4) @/li + # @/ul + # + # The first form takes a GDS2 layer number. The datatype is assumed to be 0. + # The second form takes a GDS layer and datatype number. + # The third form takes a layer name for layout systems with named layers + # (like Magic, CIF or DXF). + # The forth form takes a RBA::LayerInfo object to specify the layer. + # All forms take one to many geometry objects which are written to the respective layer. + # Geometry objects can either be created using the generator functions + # (\global#box, \global#polygon, \global#path). The core classes RBA::DBox, RBA::DPolygon, RBA::DPath or + # RBA::DText are also accepted as geometry objects. + # # The fill pattern can be given a reference point which is used for placing the pattern. The reference point # is the one which is aligned with the pattern origin. The following code will assign (-0.5, -0.5) as the reference # point for the 1x1 micron rectangle. Hence the reference point is a little below and left of the rectangle which diff --git a/src/drc/drc/built-in-macros/_drc_tags.rb b/src/drc/drc/built-in-macros/_drc_tags.rb index dedd797ef..86fd67e8d 100644 --- a/src/drc/drc/built-in-macros/_drc_tags.rb +++ b/src/drc/drc/built-in-macros/_drc_tags.rb @@ -256,6 +256,10 @@ module DRC else raise("Argument ##{ai+1} not understood for FillCell#shape") end + elsif a.is_a?(RBA::LayerInfo) + layer = a.layer + datatype = a.datatype + name = a.name elsif a.is_a?(String) if !name name = a diff --git a/testdata/drc/drcSimpleTests_46.drc b/testdata/drc/drcSimpleTests_46.drc index 1278a4681..493b4aee1 100644 --- a/testdata/drc/drcSimpleTests_46.drc +++ b/testdata/drc/drcSimpleTests_46.drc @@ -14,10 +14,10 @@ to_fill = extent - l1 fp1 = fill_pattern("FP1").shape(10, 0, box(0, 0, 800.nm, 800.nm)).origin(-100.nm, -100.nm) to_fill = to_fill.fill_with_left(fp1, hstep(1.um), vstep(200.nm, 1.um), multi_origin) -fp2 = fill_pattern("FP2").shape(10, 0, box(0, 0, 400.nm, 400.nm)).origin(-50.nm, -50.nm) +fp2 = fill_pattern("FP2").shape(10, box(0, 0, 400.nm, 400.nm)).origin(-50.nm, -50.nm) to_fill = to_fill.fill_with_left(fp2, hstep(0.5.um), vstep(100.nm, 0.5.um), multi_origin) -fp3 = fill_pattern("FP3").shape(10, 0, box(0, 0, 200.nm, 200.nm)).origin(-25.nm, -25.nm) +fp3 = fill_pattern("FP3").shape(RBA::LayerInfo::new(10, 0), box(0, 0, 200.nm, 200.nm)).origin(-25.nm, -25.nm) to_fill = to_fill.fill_with_left(fp3, hstep(0.25.um), vstep(50.nm, 0.25.um), multi_origin) to_fill.output(100, 0)