mirror of https://github.com/KLayout/klayout.git
Added more tests, debugging.
This commit is contained in:
parent
f57dd8e81a
commit
c24568b510
|
|
@ -269,7 +269,7 @@ CODE
|
||||||
# The plain function is equivalent to "primary.bbox_min".
|
# The plain function is equivalent to "primary.bbox_min".
|
||||||
|
|
||||||
def bbox_min
|
def bbox_min
|
||||||
DRCOpNodeBBoxParameterFilter::new(@engine, RBA::CompoundRegionOperationNode::BoxMinDim, self)
|
DRCOpNodeBBoxParameterFilter::new(@engine, RBA::CompoundRegionOperationNode::ParameterType::BoxMinDim, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
# %DRC%
|
# %DRC%
|
||||||
|
|
@ -284,7 +284,7 @@ CODE
|
||||||
# The plain function is equivalent to "primary.bbox_max".
|
# The plain function is equivalent to "primary.bbox_max".
|
||||||
|
|
||||||
def bbox_max
|
def bbox_max
|
||||||
DRCOpNodeBBoxParameterFilter::new(@engine, RBA::CompoundRegionOperationNode::BoxMaxDim, self)
|
DRCOpNodeBBoxParameterFilter::new(@engine, RBA::CompoundRegionOperationNode::ParameterType::BoxMaxDim, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
# %DRC%
|
# %DRC%
|
||||||
|
|
@ -302,7 +302,7 @@ CODE
|
||||||
# The plain function is equivalent to "primary.bbox_width".
|
# The plain function is equivalent to "primary.bbox_width".
|
||||||
|
|
||||||
def bbox_width
|
def bbox_width
|
||||||
DRCOpNodeBBoxParameterFilter::new(@engine, RBA::CompoundRegionOperationNode::BoxWidth, self)
|
DRCOpNodeBBoxParameterFilter::new(@engine, RBA::CompoundRegionOperationNode::ParameterType::BoxWidth, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
# %DRC%
|
# %DRC%
|
||||||
|
|
@ -320,7 +320,7 @@ CODE
|
||||||
# The plain function is equivalent to "primary.bbox_height".
|
# The plain function is equivalent to "primary.bbox_height".
|
||||||
|
|
||||||
def bbox_height
|
def bbox_height
|
||||||
DRCOpNodeBBoxParameterFilter::new(@engine, RBA::CompoundRegionOperationNode::BoxHeight, self)
|
DRCOpNodeBBoxParameterFilter::new(@engine, RBA::CompoundRegionOperationNode::ParameterType::BoxHeight, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
# %DRC%
|
# %DRC%
|
||||||
|
|
@ -1537,21 +1537,21 @@ class DRCOpNodeBBoxParameterFilter < DRCOpNodeWithCompare
|
||||||
attr_accessor :parameter
|
attr_accessor :parameter
|
||||||
attr_accessor :inverse
|
attr_accessor :inverse
|
||||||
|
|
||||||
def initialize(engine, parameter, input, description)
|
def initialize(engine, parameter, input)
|
||||||
super(engine)
|
super(engine)
|
||||||
self.parameter = parameter
|
self.parameter = parameter
|
||||||
self.input = input
|
self.input = input
|
||||||
self.inverse = false
|
self.inverse = false
|
||||||
self.description = description
|
self.description = parameter.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def do_create_node(cache)
|
def do_create_node(cache)
|
||||||
args = [ self.input.create_node(cache), self.inverse ]
|
args = [ self.input.create_node(cache), self.parameter, self.inverse ]
|
||||||
args << (self.gt ? @engine._make_value(self.gt) + 1 : (self.ge ? @engine._make_value(self.ge) : 0))
|
args << (self.gt ? @engine._make_value(self.gt) + 1 : (self.ge ? @engine._make_value(self.ge) : 0))
|
||||||
if self.lt || self.le
|
if self.lt || self.le
|
||||||
args << (self.lt ? @engine._make_value(self.lt) : @engine._make_value(self.le) + 1)
|
args << (self.lt ? @engine._make_value(self.lt) : @engine._make_value(self.le) + 1)
|
||||||
end
|
end
|
||||||
RBA::CompoundRegionOperationNode::new_perimeter_filter(*args)
|
RBA::CompoundRegionOperationNode::new_bbox_filter(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def inverted
|
def inverted
|
||||||
|
|
|
||||||
|
|
@ -158,3 +158,13 @@ TEST(9d)
|
||||||
{
|
{
|
||||||
run_test (_this, "9", true);
|
run_test (_this, "9", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(10)
|
||||||
|
{
|
||||||
|
run_test (_this, "10", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(10d)
|
||||||
|
{
|
||||||
|
run_test (_this, "10", true);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
|
||||||
|
source $drc_test_source
|
||||||
|
target $drc_test_target
|
||||||
|
|
||||||
|
if $drc_test_deep
|
||||||
|
deep
|
||||||
|
threads(0) # easier to debug
|
||||||
|
end
|
||||||
|
|
||||||
|
l1 = input(1, 0)
|
||||||
|
l2 = input(2, 0)
|
||||||
|
l3 = input(3, 0)
|
||||||
|
|
||||||
|
l1.output(1, 0)
|
||||||
|
l2.output(2, 0)
|
||||||
|
l3.output(3, 0)
|
||||||
|
|
||||||
|
# bbox_predicates
|
||||||
|
|
||||||
|
l1.drc(bbox_min > 2.0).output(100, 0)
|
||||||
|
l1.drc(bbox_max <= 2.0).output(101, 0)
|
||||||
|
l1.drc(bbox_width > 3.0).output(102, 0)
|
||||||
|
l1.drc(bbox_height > 11.0).output(103, 0)
|
||||||
|
|
||||||
Binary file not shown.
|
|
@ -39,3 +39,6 @@ l1.drc(! rectangles).output(141, 0)
|
||||||
l1.drc(if_all(! rectangles, area < 8.0)).output(150, 0)
|
l1.drc(if_all(! rectangles, area < 8.0)).output(150, 0)
|
||||||
l1.drc(if_any(rectangles, area > 8.0)).output(151, 0)
|
l1.drc(if_any(rectangles, area > 8.0)).output(151, 0)
|
||||||
|
|
||||||
|
l1.drc(if_any(corners.count > 4)).output(160, 0)
|
||||||
|
l1.drc(if_any(corners.count == 4)).output(161, 0)
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue