First tests

This commit is contained in:
Matthias Koefferlein 2022-11-12 00:29:50 +01:00
parent b02d3b24a8
commit 2341170065
7 changed files with 50 additions and 37 deletions

View File

@ -699,7 +699,7 @@ Class<db::EdgePairs> decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
"edge pairs not fulfilling this criterion are returned.\n" "edge pairs not fulfilling this criterion are returned.\n"
"\n" "\n"
"This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations " "This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations "
"and are specified using one of the \\OrthoEdges, \\DiagonalEgdes or \\OrthoDiagonalEdges types.\n" "and are specified using one of the \\Edges#OrthoEdges, \\Edges#DiagonalEgdes or \\Edges#OrthoDiagonalEdges types.\n"
"\n" "\n"
"This method has been added in version 0.28.\n" "This method has been added in version 0.28.\n"
) + ) +
@ -735,7 +735,7 @@ Class<db::EdgePairs> decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
"edge pairs not fulfilling this criterion are returned.\n" "edge pairs not fulfilling this criterion are returned.\n"
"\n" "\n"
"This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations " "This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations "
"and are specified using one of the \\OrthoEdges, \\DiagonalEgdes or \\OrthoDiagonalEdges types.\n" "and are specified using one of the \\Edges#OrthoEdges, \\Edges#DiagonalEgdes or \\Edges#OrthoDiagonalEdges types.\n"
"\n" "\n"
"This method has been added in version 0.28.\n" "This method has been added in version 0.28.\n"
) + ) +
@ -875,22 +875,4 @@ Class<db::EdgePairs> decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
"This class has been introduced in version 0.23.\n" "This class has been introduced in version 0.23.\n"
); );
gsi::EnumIn<db::EdgePairs, db::SpecialEdgeOrientationFilter::FilterType> decl_EdgePairsEdgeFilterType ("db", "EdgeType",
gsi::enum_const ("OrthoEdges", db::SpecialEdgeOrientationFilter::Ortho,
"@brief Horizontal and vertical edges are selected\n"
) +
gsi::enum_const ("DiagonalEdges", db::SpecialEdgeOrientationFilter::Diagonal,
"@brief Diagonal edges are selected (-45 and 45 degree)\n"
) +
gsi::enum_const ("OrthoDiagonalEdges", db::SpecialEdgeOrientationFilter::OrthoDiagonal,
"@brief Diagonal or orthogonal edges are selected (0, 90, -45 and 45 degree)\n"
),
"@brief This enum specifies the the edge type for edge angle filters.\n"
"\n"
"This enum was introduced in version 0.28.\n"
);
// Inject the db::SpecialEdgeOrientationFilter::FilterType declarations into EdgePairs:
gsi::ClassExt<db::EdgePairs> decl_EdgePairsEdgeFilterType_into_parent (decl_EdgePairsEdgeFilterType.defs ());
} }

View File

@ -1000,7 +1000,7 @@ CODE
args = args.select do |a| args = args.select do |a|
if a.is_a?(DRCBothEdges) if a.is_a?(DRCBothEdges)
if !self.data.is_a?(RBA::EdgePairs) if !self.data.is_a?(RBA::EdgePairs)
raise("'both' keyword only available for edge pair layers") raise("'both' keyword is only available for edge pair layers")
end end
f = :with_#{f}_both f = :with_#{f}_both
false false
@ -1018,11 +1018,10 @@ CODE
if a.is_a?(Range) if a.is_a?(Range)
DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.begin, a.end, #{inv.inspect})) DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.begin, a.end, #{inv.inspect}))
elsif a.is_a?(DRCOrthoEdges) || a.is_a?(DRCDiagonalOnlyEdges) || a.is_a?(DRCDiagonalEdges) elsif a.is_a?(DRCOrthoEdges) || a.is_a?(DRCDiagonalOnlyEdges) || a.is_a?(DRCDiagonalEdges)
if self.data.is_a?(RBA::Edges) if self.data.is_a?(RBA::Region)
DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.e_value, #{inv.inspect})) raise("'ortho', 'diagonal' or 'diagonal_only' keyword is only available for edge or edge pair layers")
else
DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.ep_value, #{inv.inspect}))
end end
DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.value, #{inv.inspect}))
else else
DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a, #{inv.inspect})) DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a, #{inv.inspect}))
end end

View File

@ -22,30 +22,21 @@ module DRC
# A wrapper for the "ortho edges" flag for Edges#with_angle or EdgePairs#with_angle # A wrapper for the "ortho edges" flag for Edges#with_angle or EdgePairs#with_angle
class DRCOrthoEdges class DRCOrthoEdges
def ep_value def value
RBA::EdgePairs::OrthoEdges
end
def e_value
RBA::Edges::OrthoEdges RBA::Edges::OrthoEdges
end end
end end
# A wrapper for the "diagonal only edges" flag for Edges#with_angle or EdgePairs#with_angle # A wrapper for the "diagonal only edges" flag for Edges#with_angle or EdgePairs#with_angle
class DRCDiagonalOnlyEdges class DRCDiagonalOnlyEdges
def ep_value def value
RBA::EdgePairs::DiagonalEdges
end
def e_value
RBA::Edges::DiagonalEdges RBA::Edges::DiagonalEdges
end end
end end
# A wrapper for the "diagonal edges" flag for Edges#with_angle or EdgePairs#with_angle # A wrapper for the "diagonal edges" flag for Edges#with_angle or EdgePairs#with_angle
class DRCDiagonalEdges class DRCDiagonalEdges
def ep_value def value
RBA::EdgePairs::OrthoDiagonalEdges
end
def e_value
RBA::Edges::OrthoDiagonalEdges RBA::Edges::OrthoDiagonalEdges
end end
end end

View File

@ -1328,3 +1328,13 @@ TEST(55d_drccount)
run_test (_this, "55", true); run_test (_this, "55", true);
} }
TEST(56_angle_classes)
{
run_test (_this, "56", false);
}
TEST(56d_angle_classes)
{
run_test (_this, "56", true);
}

31
testdata/drc/drcSimpleTests_56.drc vendored Normal file
View File

@ -0,0 +1,31 @@
source $drc_test_source
target $drc_test_target
if $drc_test_deep
deep
end
l1 = input(1, 0)
l1.output(1, 0)
l1e = l1.edges
l1e.with_angle(ortho).output(100, 0)
l1e.without_angle(ortho).output(101, 0)
l1e.with_angle(diagonal).output(102, 0)
l1e.without_angle(diagonal).output(103, 0)
l1e.with_angle(diagonal_only).output(104, 0)
l1e.without_angle(diagonal_only).output(105, 0)
l1ee = l1.width(100.um, projection)
l1ee.output(10, 0)
l1ee.with_angle(ortho).output(200, 0)
l1ee.without_angle(ortho).output(201, 0)
l1ee.with_angle(diagonal).output(202, 0)
l1ee.without_angle(diagonal).output(203, 0)
l1ee.with_angle(diagonal_only).output(204, 0)
l1ee.without_angle(diagonal_only).output(205, 0)
l1ee.with_angle(ortho, both).output(210, 0)

BIN
testdata/drc/drcSimpleTests_56.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au56.gds vendored Normal file

Binary file not shown.