Some enhancements to layer and cell mapping

* Modification of the mapping is possible now
  (#map used to ignore mappings if there was one
  already)
* Added DropCell mapping (also for RBA)
* Added unit tests for cell mapping, layer mapping
  db::merge_layouts, db::copy_shapes and db::move_shapes
This commit is contained in:
Matthias Koefferlein
2017-08-30 01:11:38 +02:00
parent 3499c3856a
commit b28317fb69
24 changed files with 746 additions and 60 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+13 -1
View File
@@ -28,7 +28,12 @@ def mapping_to_s(ly1, ly2, cm)
ly1.each_cell_top_down do |c|
s = ly1.cell(c).name
if cm.has_mapping?(c)
s += "=>" + ly2.cell(cm.cell_mapping(c)).name
t = cm.cell_mapping(c)
if t == RBA::CellMapping::DropCell
s += "=>(0)"
else
s += "=>" + ly2.cell(t).name
end
end
r == "" || (r += ";")
r += s
@@ -50,6 +55,8 @@ class DBCellMapping_TestClass < TestBase
assert_equal(mp.has_mapping?(1), false)
mp.map(1, 2)
assert_equal(mp.cell_mapping(1), 2)
mp.map(1, 3)
assert_equal(mp.cell_mapping(1), 3)
ly = RBA::Layout::new
@@ -170,6 +177,11 @@ class DBCellMapping_TestClass < TestBase
assert_equal(mapping_to_s(ly2, ly1dup, mp), "c0;c2=>c2;c1=>c1;c3=>c3$1")
assert_equal(nc.inspect, "[3]")
mp.clear
mp.from_geometry(ly1, top1, ly2, top2)
mp.map(ci2, RBA::CellMapping::DropCell)
assert_equal(mapping_to_s(ly2, ly1, mp), "c0;c2=>(0);c1=>c1;c3")
end
end
+2
View File
@@ -50,6 +50,8 @@ class DBLayerMapping_TestClass < TestBase
assert_equal(mp.has_mapping?(1), false)
mp.map(1, 2)
assert_equal(mp.layer_mapping(1), 2)
mp.map(1, 3)
assert_equal(mp.layer_mapping(1), 3)
ly1 = RBA::Layout::new