mirror of https://github.com/KLayout/klayout.git
Fixed #476
This commit is contained in:
parent
fb0d06602e
commit
eeadfcea7b
|
|
@ -619,3 +619,58 @@ TEST(13b_KissingCornersDeep)
|
|||
CHECKPOINT ();
|
||||
db::compare_layouts (_this, layout, au, db::NoNormalization);
|
||||
}
|
||||
|
||||
TEST(14_SwitchingTargets)
|
||||
{
|
||||
std::string rs = tl::testsrc ();
|
||||
rs += "/testdata/drc/drcSimpleTests_14.drc";
|
||||
|
||||
std::string input = tl::testsrc ();
|
||||
input += "/testdata/drc/drcSimpleTests_14.gds";
|
||||
|
||||
std::string au = tl::testsrc ();
|
||||
au += "/testdata/drc/drcSimpleTests_au14.gds";
|
||||
|
||||
std::string au2 = tl::testsrc ();
|
||||
au2 += "/testdata/drc/drcSimpleTests_au14_2.gds";
|
||||
|
||||
std::string output = this->tmp_file ("tmp.gds");
|
||||
std::string output2 = this->tmp_file ("tmp2.gds");
|
||||
|
||||
{
|
||||
// Set some variables
|
||||
lym::Macro config;
|
||||
config.set_text (tl::sprintf (
|
||||
"$drc_test_source = '%s'\n"
|
||||
"$drc_test_target = '%s'\n"
|
||||
"$drc_test_target2 = '%s'\n"
|
||||
, input, output, output2)
|
||||
);
|
||||
config.set_interpreter (lym::Macro::Ruby);
|
||||
EXPECT_EQ (config.run (), 0);
|
||||
}
|
||||
|
||||
lym::Macro drc;
|
||||
drc.load_from (rs);
|
||||
EXPECT_EQ (drc.run (), 0);
|
||||
|
||||
db::Layout layout;
|
||||
|
||||
{
|
||||
tl::InputStream stream (output);
|
||||
db::Reader reader (stream);
|
||||
reader.read (layout);
|
||||
}
|
||||
|
||||
db::compare_layouts (_this, layout, au, db::NoNormalization);
|
||||
|
||||
db::Layout layout2;
|
||||
|
||||
{
|
||||
tl::InputStream stream (output2);
|
||||
db::Reader reader (stream);
|
||||
reader.read (layout2);
|
||||
}
|
||||
|
||||
db::compare_layouts (_this, layout2, au2, db::NoNormalization);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
|
||||
source($drc_test_source, "TOP")
|
||||
|
||||
ly = RBA::Layout::new
|
||||
ly.create_cell("TOP")
|
||||
|
||||
ly2 = RBA::Layout::new
|
||||
ly2.create_cell("TOP")
|
||||
|
||||
lr1 = input(10,0)
|
||||
lr2 = input(61,0)
|
||||
cut = lr1&lr2
|
||||
target(ly)
|
||||
new = (lr1-cut)
|
||||
new.output(10,0)
|
||||
|
||||
lr1 = input(11,0)
|
||||
lr2 = input(61,0)
|
||||
cut = lr1&lr2
|
||||
new = lr1-cut
|
||||
target(ly2)
|
||||
new.output(11,0)
|
||||
|
||||
lr1 = input(12,0)
|
||||
lr2 = input(61,0)
|
||||
cut = lr1&lr2
|
||||
new = lr1-cut
|
||||
target(ly)
|
||||
new.output(12,0)
|
||||
|
||||
# 2. Boolean Operation (Difference CutOutLayer vs GreylinesLayer)
|
||||
lr1 = input(120,0)
|
||||
lr2 = layout($drc_test_source, "TOP").input(15,0)
|
||||
target(ly2)
|
||||
diff = lr2-lr1
|
||||
diff.output(150,0)
|
||||
|
||||
# 3. Boolean Operation (Union Layer15(@1) und Layer15(@2)
|
||||
lr1 = input(150,0)
|
||||
lr2 = layout($drc_test_source2, "TOP").input(15,0)
|
||||
target(ly)
|
||||
align = lr1.or(lr2)
|
||||
align.output(15,0)
|
||||
|
||||
# 4. Size shapes with 1µm as parameter
|
||||
lr1 = input(120,0)
|
||||
lr2 = input(121,0)
|
||||
lr3 = input(122,0)
|
||||
lr4 = input(123,0)
|
||||
|
||||
target(ly)
|
||||
lr1.size(1.um).output(120,0)
|
||||
lr2.size(1.um).output(121,0)
|
||||
target(ly2)
|
||||
lr3.size(1.um).output(122,0)
|
||||
target(ly2)
|
||||
lr4.size(1.um).output(123,0)
|
||||
|
||||
ly.write($drc_test_target)
|
||||
ly2.write($drc_test_target2)
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue