-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMergingMultipleFiles.rb
68 lines (48 loc) · 1.49 KB
/
MergingMultipleFiles.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Enter your Ruby code here
file1 = "path to file"
file2 = "path to file"
file3 = "path to file"
file4 = "path to file"
out = "path to file"
puts "Reading #{file1} .."
ly1 = RBA::Layout::new
ly1.read(file1)
puts "Reading #{file2} .."
ly2 = RBA::Layout::new
ly2.read(file2)
puts "Reading #{file3} .."
ly3 = RBA::Layout::new
ly3.read(file3)
puts "Reading #{file4} .."
ly4 = RBA::Layout::new
ly4.read(file4)
ly1_top_cell = ly1.top_cell
new_cell = ly1.create_cell(ly2.top_cell.name)
new_cell.copy_tree(ly2.top_cell)
angle = 0 # (1 = 90, 2 = 180, 3 = 270 degree)
mirror = false
x = 116*1000
y = 11726*1000
trans = RBA::Trans::new(angle, mirror, x, y);
ly1_top_cell.insert(RBA::CellInstArray::new(new_cell.cell_index, trans))
#---------------------------------------------------------------------------
new_cell = ly1.create_cell(ly3.top_cell.name)
new_cell.copy_tree(ly3.top_cell)
angle = 0 # (1 = 90, 2 = 180, 3 = 270 degree)
mirror = false
x = 116*1000
y = 3566*1000
trans = RBA::Trans::new(angle, mirror, x, y);
ly1_top_cell.insert(RBA::CellInstArray::new(new_cell.cell_index, trans))
#---------------------------------------------------------------------------
new_cell = ly1.create_cell(ly4.top_cell.name)
new_cell.copy_tree(ly4.top_cell)
angle = 0 # (1 = 90, 2 = 180, 3 = 270 degree)
mirror = false
x = 116*1000
y = 9926*1000
trans = RBA::Trans::new(angle, mirror, x, y);
ly1_top_cell.insert(RBA::CellInstArray::new(new_cell.cell_index, trans))
# saving the result
puts "Writing #{out} .."
ly1.write(out)