mirror of https://github.com/KLayout/klayout.git
Better handling of inputs in deep mode after manipulating the hierarchy of the input layout
This commit is contained in:
parent
047455c560
commit
6955d7d0c7
|
|
@ -867,7 +867,9 @@ void DeepShapeStore::remove_ref (unsigned int layout, unsigned int layer)
|
|||
unsigned int
|
||||
DeepShapeStore::layout_for_iter (const db::RecursiveShapeIterator &si, const db::ICplxTrans &trans)
|
||||
{
|
||||
layout_map_type::iterator l = m_layout_map.find (std::make_pair (si, trans));
|
||||
size_t gen_id = si.layout () ? si.layout ()->hier_generation_id () : 0;
|
||||
|
||||
layout_map_type::iterator l = m_layout_map.find (std::make_pair (si, std::make_pair (gen_id, trans)));
|
||||
if (l == m_layout_map.end () || m_layouts[l->second] == 0) {
|
||||
|
||||
unsigned int layout_index;
|
||||
|
|
@ -886,7 +888,7 @@ DeepShapeStore::layout_for_iter (const db::RecursiveShapeIterator &si, const db:
|
|||
layout.dbu (si.layout ()->dbu () / trans.mag ());
|
||||
}
|
||||
|
||||
m_layout_map[std::make_pair (si, trans)] = layout_index;
|
||||
m_layout_map[std::make_pair (si, std::make_pair (gen_id, trans))] = layout_index;
|
||||
return layout_index;
|
||||
|
||||
} else {
|
||||
|
|
@ -896,7 +898,8 @@ DeepShapeStore::layout_for_iter (const db::RecursiveShapeIterator &si, const db:
|
|||
|
||||
void DeepShapeStore::make_layout (unsigned int layout_index, const db::RecursiveShapeIterator &si, const db::ICplxTrans &trans)
|
||||
{
|
||||
tl_assert (m_layout_map.find (std::make_pair (si, trans)) == m_layout_map.end ());
|
||||
size_t gen_id = si.layout () ? si.layout ()->hier_generation_id () : 0;
|
||||
tl_assert (m_layout_map.find (std::make_pair (si, std::make_pair (gen_id, trans))) == m_layout_map.end ());
|
||||
|
||||
while (m_layouts.size () <= layout_index) {
|
||||
m_layouts.push_back (0);
|
||||
|
|
@ -909,7 +912,7 @@ void DeepShapeStore::make_layout (unsigned int layout_index, const db::Recursive
|
|||
layout.dbu (si.layout ()->dbu () / trans.mag ());
|
||||
}
|
||||
|
||||
m_layout_map[std::make_pair (si, trans)] = layout_index;
|
||||
m_layout_map[std::make_pair (si, std::make_pair (gen_id, trans))] = layout_index;
|
||||
}
|
||||
|
||||
DeepLayer DeepShapeStore::create_polygon_layer (const db::RecursiveShapeIterator &si, double max_area_ratio, size_t max_vertex_count, const db::ICplxTrans &trans)
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ private:
|
|||
|
||||
struct DB_PUBLIC RecursiveShapeIteratorCompareForTargetHierarchy
|
||||
{
|
||||
bool operator () (const std::pair<db::RecursiveShapeIterator, db::ICplxTrans> &a, const std::pair<db::RecursiveShapeIterator, db::ICplxTrans> &b) const
|
||||
bool operator () (const std::pair<db::RecursiveShapeIterator, std::pair<size_t, db::ICplxTrans> > &a, const std::pair<db::RecursiveShapeIterator, std::pair<size_t, db::ICplxTrans> > &b) const
|
||||
{
|
||||
int cmp_iter = db::compare_iterators_with_respect_to_target_hierarchy (a.first, b.first);
|
||||
if (cmp_iter != 0) {
|
||||
|
|
@ -865,7 +865,7 @@ private:
|
|||
|
||||
void issue_variants (unsigned int layout, const std::map<db::cell_index_type, std::map<db::ICplxTrans, db::cell_index_type> > &var_map);
|
||||
|
||||
typedef std::map<std::pair<db::RecursiveShapeIterator, db::ICplxTrans>, unsigned int, RecursiveShapeIteratorCompareForTargetHierarchy> layout_map_type;
|
||||
typedef std::map<std::pair<db::RecursiveShapeIterator, std::pair<size_t, db::ICplxTrans> >, unsigned int, RecursiveShapeIteratorCompareForTargetHierarchy> layout_map_type;
|
||||
|
||||
// no copying
|
||||
DeepShapeStore (const DeepShapeStore &);
|
||||
|
|
|
|||
|
|
@ -5148,9 +5148,6 @@ CODE
|
|||
|
||||
m = with_left ? "fill_with_left" : "fill"
|
||||
|
||||
# generation of new cells not tested in deep mode
|
||||
@deep && raise("#{m} command not supported in deep mode currently")
|
||||
|
||||
(@engine._output_layout && @engine._output_cell) || raise("#{m} command needs an output layout and output cell")
|
||||
|
||||
source = @engine.source
|
||||
|
|
|
|||
|
|
@ -1302,6 +1302,16 @@ TEST(47_fillWithOverlappingBoxesTiled)
|
|||
run_test (_this, "47", false);
|
||||
}
|
||||
|
||||
TEST(47b_fillWithUsingOutput)
|
||||
{
|
||||
run_test (_this, "47b", false);
|
||||
}
|
||||
|
||||
TEST(47bd_fillWithUsingOutputDeep)
|
||||
{
|
||||
run_test (_this, "47b", true);
|
||||
}
|
||||
|
||||
TEST(48_drcWithFragments)
|
||||
{
|
||||
run_test (_this, "48", false);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
source $drc_test_source
|
||||
|
||||
if $drc_test_deep
|
||||
deep
|
||||
end
|
||||
|
||||
to_fill = input(1, 0)
|
||||
|
||||
# Create a fill pattern with a 0.025x0.025 µm box at 2/0
|
||||
pattern = fill_pattern("FILL_CELL").shape(2, 0, box(0, 0, 0.025, 0.025))
|
||||
|
||||
# place every 25 nm
|
||||
to_fill.fill(pattern, hstep(0.025), vstep(0.025))
|
||||
|
||||
# compute remaining parts
|
||||
l2 = input(2, 0)
|
||||
(to_fill - l2).output(100, 0)
|
||||
|
||||
# we cannot use input(..) on the fill output if we use
|
||||
# a separate target layout, so wo do this:
|
||||
layout.layout.write($drc_test_target)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue