mirror of https://github.com/KLayout/klayout.git
Added DRC integration and tests
This commit is contained in:
parent
ddc17818b0
commit
13a1bf713d
|
|
@ -197,10 +197,11 @@ module DRC
|
|||
@total_timer = nil
|
||||
@drc_progress = nil
|
||||
|
||||
# initialize the defaults for max_area_ratio, max_vertex_count
|
||||
# initialize the defaults for max_area_ratio, max_vertex_count, sparse_array_limit
|
||||
dss = RBA::DeepShapeStore::new
|
||||
@max_area_ratio = dss.max_area_ratio
|
||||
@max_vertex_count = dss.max_vertex_count
|
||||
@sparse_array_limit = dss.sparse_array_limit
|
||||
@deep_reject_odd_polygons = dss.reject_odd_polygons
|
||||
dss._destroy
|
||||
|
||||
|
|
@ -1309,6 +1310,43 @@ module DRC
|
|||
self.max_vertex_count(count)
|
||||
end
|
||||
|
||||
# %DRC%
|
||||
# @name sparse_array_limit
|
||||
# @brief Gets or sets the sparse array singularization limit
|
||||
# @synopsis sparse_array_limit(limit)
|
||||
# @synopsis sparse_array_limit
|
||||
#
|
||||
# In deep mode, array instances with a bad ratio of overall bounding box area
|
||||
# vs. actually covered area, induce a performance penalty, because their bounding
|
||||
# box is not longer a good approximation for their footprint.
|
||||
# The "sparse array limit" defines the ratio of array instance bounding box area
|
||||
# vs. sum of bounding box areas of the individual instances, above which the array
|
||||
# is resolved into single instances.
|
||||
#
|
||||
# Use this method without an argument to get the current value.
|
||||
#
|
||||
# By default, this feature is off (the sparse array limit value is negative).
|
||||
# If your design uses many arrays with a bad coverage, you can set the sparse
|
||||
# array limit to a value of 10 for example.
|
||||
|
||||
def sparse_array_limit(sal = nil)
|
||||
if sal
|
||||
if @dss
|
||||
raise("sparse_array_limit must be set before the first 'input' statement in deep mode")
|
||||
end
|
||||
if sal.is_a?(1.0.class) || sal.is_a?(1.class)
|
||||
@sparse_array_limit = sal
|
||||
else
|
||||
raise("Argument is not numerical in sparse_array_limit")
|
||||
end
|
||||
end
|
||||
@sparse_array_limit
|
||||
end
|
||||
|
||||
def sparse_array_limit=(sal)
|
||||
self.sparse_array_limit(sal)
|
||||
end
|
||||
|
||||
# %DRC%
|
||||
# @name max_area_ratio
|
||||
# @brief Gets or sets the maximum bounding box to polygon area ratio for deep mode fragmentation
|
||||
|
|
@ -3305,6 +3343,7 @@ CODE
|
|||
@dss.reject_odd_polygons = @deep_reject_odd_polygons
|
||||
@dss.max_vertex_count = @max_vertex_count
|
||||
@dss.max_area_ratio = @max_area_ratio
|
||||
@dss.sparse_array_limit = @sparse_array_limit
|
||||
|
||||
r = cls.new(iter, @dss, RBA::ICplxTrans::new(sf.to_f))
|
||||
|
||||
|
|
|
|||
|
|
@ -2108,3 +2108,8 @@ TEST(147_MeasureNetsWithL2N)
|
|||
compare_text_files (output, au_output);
|
||||
}
|
||||
|
||||
TEST(148_sparse_array_limit)
|
||||
{
|
||||
run_test (_this, "148", true);
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,39 @@
|
|||
|
||||
# Breaking
|
||||
|
||||
source($drc_test_source, "TOP")
|
||||
target($drc_test_target)
|
||||
|
||||
sparse_array_limit(10.0)
|
||||
if sparse_array_limit != 10.0
|
||||
raise("sparse array limit is not 10.0!")
|
||||
end
|
||||
|
||||
deep
|
||||
|
||||
# can still set sparse_array_limit before the first input statement
|
||||
self.sparse_array_limit = 5.0
|
||||
if self.sparse_array_limit != 5.0
|
||||
raise("sparse array limit is not 5.0!")
|
||||
end
|
||||
|
||||
l1 = input(1, 0)
|
||||
l2 = input(2, 0)
|
||||
|
||||
error = false
|
||||
begin
|
||||
self.sparse_array_limit = 2.0
|
||||
rescue
|
||||
error = true
|
||||
end
|
||||
error || raise("sparse_array_limit must throw an exception after 'deep'")
|
||||
|
||||
if @dss.sparse_array_limit != 5.0
|
||||
raise("sparse array limit of DSS is not 5.0!")
|
||||
end
|
||||
|
||||
l1.output(1, 0)
|
||||
l2.output(2, 0)
|
||||
l1.sized(1.um).output(11, 0)
|
||||
l2.sized(1.um).output(12, 0)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue