mirror of https://github.com/KLayout/klayout.git
167 lines
4.3 KiB
Plaintext
167 lines
4.3 KiB
Plaintext
|
|
# Interact with count
|
|
|
|
has_unbounded_range = ((RUBY_VERSION.split(".").map(&:to_i) <=> [2,7,0]) >= 0)
|
|
|
|
source($drc_test_source, "TOP")
|
|
target($drc_test_target)
|
|
|
|
l1 = input(1, 0)
|
|
l2 = input(2, 0)
|
|
|
|
l1.output(1, 0)
|
|
l2.output(2, 0)
|
|
|
|
def split_vs_normal(r, f1, f2, *args)
|
|
d1 = r.send(f1, *args)[0].data
|
|
d2 = r.send(f2, *args).data
|
|
d1.to_s == d2.to_s || raise("#{f1.to_s} vs. #{f2.to_s} check failed: #{d1.to_s} != #{d2.to_s}")
|
|
end
|
|
|
|
def splitn_vs_normal(r, f1, f2, *args)
|
|
d1 = r.send(f1, *args)[1].data
|
|
d2 = r.send(f2, *args).data
|
|
d1.to_s == d2.to_s || raise("#{f1.to_s} vs. #{f2.to_s} check failed: #{d1.to_s} != #{d2.to_s}")
|
|
end
|
|
|
|
l1.interacting(l2, 1).output(100, 0)
|
|
l1.interacting(l2, 2).output(101, 0)
|
|
l1.interacting(l2, 1..2).output(102, 0)
|
|
if has_unbounded_range
|
|
l1.interacting(l2, eval("2..")).output(103, 0)
|
|
else
|
|
l1.interacting(l2, 2..10000).output(103, 0)
|
|
end
|
|
l1.interacting(l2, 1, 2).output(104, 0)
|
|
|
|
split_vs_normal(l1, :split_interacting, :interacting, l2, 1)
|
|
split_vs_normal(l1, :split_interacting, :interacting, l2, 2)
|
|
split_vs_normal(l1, :split_interacting, :interacting, l2, 1..2)
|
|
split_vs_normal(l1, :split_interacting, :interacting, l2, 1, 2)
|
|
|
|
l1.overlapping(l2, 1).output(110, 0)
|
|
l1.overlapping(l2, 2).output(111, 0)
|
|
l1.overlapping(l2, 1..2).output(112, 0)
|
|
if has_unbounded_range
|
|
l1.overlapping(l2, eval("2..")).output(113, 0)
|
|
else
|
|
l1.overlapping(l2, 2..10000).output(113, 0)
|
|
end
|
|
l1.overlapping(l2, 1, 2).output(114, 0)
|
|
|
|
split_vs_normal(l1, :split_overlapping, :overlapping, l2, 1)
|
|
split_vs_normal(l1, :split_overlapping, :overlapping, l2, 2)
|
|
split_vs_normal(l1, :split_overlapping, :overlapping, l2, 1..2)
|
|
split_vs_normal(l1, :split_overlapping, :overlapping, l2, 1, 2)
|
|
|
|
l = l1.dup
|
|
l.select_interacting(l2, 1)
|
|
l.output(200, 0)
|
|
l = l1.dup
|
|
l.select_interacting(l2, 2)
|
|
l.output(201, 0)
|
|
l = l1.dup
|
|
l.select_interacting(l2, 1..2)
|
|
l.output(202, 0)
|
|
l = l1.dup
|
|
if has_unbounded_range
|
|
l.select_interacting(l2, eval("2.."))
|
|
else
|
|
l.select_interacting(l2, 2..10000)
|
|
end
|
|
l.output(203, 0)
|
|
l = l1.dup
|
|
l.select_interacting(l2, 1, 2)
|
|
l.output(204, 0)
|
|
|
|
l = l1.dup
|
|
l.select_overlapping(l2, 1)
|
|
l.output(210, 0)
|
|
l = l1.dup
|
|
l.select_overlapping(l2, 2)
|
|
l.output(211, 0)
|
|
l = l1.dup
|
|
l.select_overlapping(l2, 1..2)
|
|
l.output(212, 0)
|
|
l = l1.dup
|
|
if has_unbounded_range
|
|
l.select_overlapping(l2, eval("2.."))
|
|
else
|
|
l.select_overlapping(l2, 2..10000)
|
|
end
|
|
l.output(213, 0)
|
|
l = l1.dup
|
|
l.select_overlapping(l2, 1, 2)
|
|
l.output(214, 0)
|
|
|
|
l1.not_interacting(l2, 1).output(300, 0)
|
|
l1.not_interacting(l2, 2).output(301, 0)
|
|
l1.not_interacting(l2, 1..2).output(302, 0)
|
|
if has_unbounded_range
|
|
l1.not_interacting(l2, eval("2..")).output(303, 0)
|
|
else
|
|
l1.not_interacting(l2, 2..10000).output(303, 0)
|
|
end
|
|
l1.not_interacting(l2, 1, 2).output(304, 0)
|
|
|
|
splitn_vs_normal(l1, :split_interacting, :not_interacting, l2, 1)
|
|
splitn_vs_normal(l1, :split_interacting, :not_interacting, l2, 2)
|
|
splitn_vs_normal(l1, :split_interacting, :not_interacting, l2, 1..2)
|
|
splitn_vs_normal(l1, :split_interacting, :not_interacting, l2, 1, 2)
|
|
|
|
l1.not_overlapping(l2, 1).output(310, 0)
|
|
l1.not_overlapping(l2, 2).output(311, 0)
|
|
l1.not_overlapping(l2, 1..2).output(312, 0)
|
|
if has_unbounded_range
|
|
l1.not_overlapping(l2, eval("2..")).output(313, 0)
|
|
else
|
|
l1.not_overlapping(l2, 2..10000).output(313, 0)
|
|
end
|
|
l1.not_overlapping(l2, 1, 2).output(314, 0)
|
|
|
|
splitn_vs_normal(l1, :split_overlapping, :not_overlapping, l2, 1)
|
|
splitn_vs_normal(l1, :split_overlapping, :not_overlapping, l2, 2)
|
|
splitn_vs_normal(l1, :split_overlapping, :not_overlapping, l2, 1..2)
|
|
splitn_vs_normal(l1, :split_overlapping, :not_overlapping, l2, 1, 2)
|
|
|
|
l = l1.dup
|
|
l.select_not_interacting(l2, 1)
|
|
l.output(400, 0)
|
|
l = l1.dup
|
|
l.select_not_interacting(l2, 2)
|
|
l.output(401, 0)
|
|
l = l1.dup
|
|
l.select_not_interacting(l2, 1..2)
|
|
l.output(402, 0)
|
|
l = l1.dup
|
|
if has_unbounded_range
|
|
l.select_not_interacting(l2, eval("2.."))
|
|
else
|
|
l.select_not_interacting(l2, 2..10000)
|
|
end
|
|
l.output(403, 0)
|
|
l = l1.dup
|
|
l.select_not_interacting(l2, 1, 2)
|
|
l.output(404, 0)
|
|
|
|
l = l1.dup
|
|
l.select_not_overlapping(l2, 1)
|
|
l.output(410, 0)
|
|
l = l1.dup
|
|
l.select_not_overlapping(l2, 2)
|
|
l.output(411, 0)
|
|
l = l1.dup
|
|
l.select_not_overlapping(l2, 1..2)
|
|
l.output(412, 0)
|
|
l = l1.dup
|
|
if has_unbounded_range
|
|
l.select_not_overlapping(l2, eval("2.."))
|
|
else
|
|
l.select_not_overlapping(l2, 2..10000)
|
|
end
|
|
l.output(413, 0)
|
|
l = l1.dup
|
|
l.select_not_overlapping(l2, 1, 2)
|
|
l.output(414, 0)
|
|
|