mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-07 02:51:38 +02:00
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
|
||||
# some prep steps
|
||||
ly = RBA::Layout::new
|
||||
ly.create_cell("TOP")
|
||||
l1 = ly.layer(1, 0)
|
||||
ly.top_cell.shapes(l1).insert(RBA::Box::new(0, 0, 1000, 2000))
|
||||
l2 = ly.layer(2, 0)
|
||||
ly.top_cell.shapes(l2).insert(RBA::Box::new(500, 500, 1500, 2500))
|
||||
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
|
||||
import os
|
||||
|
||||
def f():
|
||||
return("f: " + os.path.basename(pya.Macro.real_path(__file__, lineno())) + ":" + str(pya.Macro.real_line(__file__, lineno())))
|
||||
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
|
||||
def f
|
||||
return "f: " + File.basename(__FILE__) + ":" + __LINE__.to_s
|
||||
end
|
||||
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
|
||||
def f
|
||||
raise("An error")
|
||||
end
|
||||
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
|
||||
# some prep steps
|
||||
ly = RBA::Layout::new
|
||||
ly.create_cell("TOP")
|
||||
l1 = ly.layer(1, 0)
|
||||
ly.top_cell.shapes(l1).insert(RBA::Box::new(0, 0, 1000, 2000))
|
||||
l2 = ly.layer(2, 0)
|
||||
ly.top_cell.shapes(l2).insert(RBA::Box::new(500, 500, 1500, 2500))
|
||||
|
||||
# actual "DRC"
|
||||
|
||||
source(ly.top_cell)
|
||||
|
||||
l1_drc = input(1, 0)
|
||||
l2_drc = input(2, 0)
|
||||
(l1_drc & l2_drc).output(100, 0)
|
||||
|
||||
l100 = ly.layer(100, 0)
|
||||
|
||||
puts "Result: " + RBA::Region::new(ly.top_cell.begin_shapes_rec(l100)).to_s + " in " + File.basename(__FILE__) + ":" + __LINE__.to_s
|
||||
|
||||
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
print("Hello, world!")
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
puts "Hello, world!"
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
# %include "a_inc.drc"
|
||||
|
||||
# actual "DRC"
|
||||
|
||||
source(ly.top_cell)
|
||||
|
||||
l1_drc = input(1, 0)
|
||||
l2_drc = input(2, 0)
|
||||
(l1_drc & l2_drc).output(100, 0)
|
||||
|
||||
l100 = ly.layer(100, 0)
|
||||
|
||||
puts "Result: " + RBA::Region::new(ly.top_cell.begin_shapes_rec(l100)).to_s + " in " + File.basename(__FILE__) + ":" + __LINE__.to_s
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
import os
|
||||
import inspect
|
||||
|
||||
def lineno():
|
||||
return inspect.currentframe().f_back.f_lineno
|
||||
|
||||
print("Stop 1: " + os.path.basename(pya.Macro.real_path(__file__, lineno())) + ":" + str(pya.Macro.real_line(__file__, lineno())))
|
||||
|
||||
# %include a_inc.py
|
||||
|
||||
print(f())
|
||||
|
||||
print("Stop 2: " + os.path.basename(pya.Macro.real_path(__file__, lineno())) + ":" + str(pya.Macro.real_line(__file__, lineno())))
|
||||
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
|
||||
puts "Stop 1: " + File.basename(__FILE__) + ":" + __LINE__.to_s
|
||||
|
||||
# %include a_inc.rb
|
||||
|
||||
puts f
|
||||
|
||||
puts "Stop 2: " + File.basename(__FILE__) + ":" + __LINE__.to_s
|
||||
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
|
||||
# %include b_inc.rb
|
||||
|
||||
begin
|
||||
puts f
|
||||
rescue => ex
|
||||
ln = ex.backtrace[0].split(":")
|
||||
# NOTE: as the backtrace is a native Ruby feature, include file translation
|
||||
# does not happen. We need to do this explicitly here:
|
||||
puts ex.to_s + " in " + RBA::Macro::real_path(ln[0], ln[1].to_i) + ":" + RBA::Macro::real_line(ln[0], ln[1].to_i).to_s
|
||||
end
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
included.1
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
included.2a
|
||||
included.2b
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
include.3a
|
||||
# %include inc2.txt
|
||||
include.3b
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
A line
|
||||
Another line
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
A line
|
||||
# %include inc1.txt
|
||||
Another line
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
A line
|
||||
# %include inc3.txt
|
||||
Another line
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
A line
|
||||
# %include inc$(1+2).txt
|
||||
Another line
|
||||
Reference in New Issue
Block a user