mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-08 04:08:14 +02:00
Merge branch 'master' of https://github.com/KLayout/klayout into qt6
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -76,7 +76,7 @@ ConfigPage::commit (lay::Dispatcher *root)
|
||||
root->config_set (cfg_ruler_grid_snap, mp_ui->ruler_grid_snap_cbx->isChecked ());
|
||||
|
||||
int sr = 0;
|
||||
tl::from_string (tl::to_string (mp_ui->ruler_snap_range_edit->text ()), sr);
|
||||
tl::from_string_ext (tl::to_string (mp_ui->ruler_snap_range_edit->text ()), sr);
|
||||
if (sr < 1 || sr > 1000) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("Not a valid pixel value (must be non-zero positive and not too large): %s")), tl::to_string (mp_ui->ruler_snap_range_edit->text ()));
|
||||
}
|
||||
@@ -127,7 +127,7 @@ ConfigPage2::commit (lay::Dispatcher *root)
|
||||
{
|
||||
int mr;
|
||||
try {
|
||||
tl::from_string (tl::to_string (mp_ui->num_rulers_edit->text ()), mr);
|
||||
tl::from_string_ext (tl::to_string (mp_ui->num_rulers_edit->text ()), mr);
|
||||
} catch (...) {
|
||||
mr = -1;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -132,7 +132,7 @@ PropertiesPage::get_points (db::DPoint &p1, db::DPoint &p2)
|
||||
bool has_error = false;
|
||||
|
||||
try {
|
||||
tl::from_string (tl::to_string (x1->text ()), dx1);
|
||||
tl::from_string_ext (tl::to_string (x1->text ()), dx1);
|
||||
lay::indicate_error (x1, (tl::Exception *) 0);
|
||||
} catch (tl::Exception &ex) {
|
||||
lay::indicate_error (x1, &ex);
|
||||
@@ -140,7 +140,7 @@ PropertiesPage::get_points (db::DPoint &p1, db::DPoint &p2)
|
||||
}
|
||||
|
||||
try {
|
||||
tl::from_string (tl::to_string (x2->text ()), dx2);
|
||||
tl::from_string_ext (tl::to_string (x2->text ()), dx2);
|
||||
lay::indicate_error (x2, (tl::Exception *) 0);
|
||||
} catch (tl::Exception &ex) {
|
||||
lay::indicate_error (x2, &ex);
|
||||
@@ -148,7 +148,7 @@ PropertiesPage::get_points (db::DPoint &p1, db::DPoint &p2)
|
||||
}
|
||||
|
||||
try {
|
||||
tl::from_string (tl::to_string (y1->text ()), dy1);
|
||||
tl::from_string_ext (tl::to_string (y1->text ()), dy1);
|
||||
lay::indicate_error (y1, (tl::Exception *) 0);
|
||||
} catch (tl::Exception &ex) {
|
||||
lay::indicate_error (y1, &ex);
|
||||
@@ -156,7 +156,7 @@ PropertiesPage::get_points (db::DPoint &p1, db::DPoint &p2)
|
||||
}
|
||||
|
||||
try {
|
||||
tl::from_string (tl::to_string (y2->text ()), dy2);
|
||||
tl::from_string_ext (tl::to_string (y2->text ()), dy2);
|
||||
lay::indicate_error (y2, (tl::Exception *) 0);
|
||||
} catch (tl::Exception &ex) {
|
||||
lay::indicate_error (y2, &ex);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -42,7 +42,7 @@ int converter_main (int argc, char *argv[], const std::string &format)
|
||||
generic_reader_options.add_options (cmd);
|
||||
|
||||
cmd << tl::arg ("input", &infile, "The input file (any format, may be gzip compressed)",
|
||||
"You can use '+' to supply multiple files which will be read after each other into the same layout. "
|
||||
"You can use '+' or ',' to supply multiple files which will be read after each other into the same layout. "
|
||||
"This provides some cheap, but risky way of merging files. Beware of cell name conflicts.")
|
||||
<< tl::arg ("output", &outfile, tl::sprintf ("The output file (%s format)", format))
|
||||
;
|
||||
@@ -56,14 +56,7 @@ int converter_main (int argc, char *argv[], const std::string &format)
|
||||
{
|
||||
db::LoadLayoutOptions load_options;
|
||||
generic_reader_options.configure (load_options);
|
||||
|
||||
std::vector<std::string> files = tl::split (infile, "+");
|
||||
|
||||
for (std::vector<std::string>::const_iterator f = files.begin (); f != files.end (); ++f) {
|
||||
tl::InputStream stream (*f);
|
||||
db::Reader reader (stream);
|
||||
reader.read (layout, load_options);
|
||||
}
|
||||
read_files (layout, infile, load_options);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -647,7 +647,7 @@ GenericReaderOptions::add_options (tl::CommandLineOptions &cmd)
|
||||
"\n"
|
||||
"The following values are accepted for this option:\n"
|
||||
"\n"
|
||||
"* 0: produce LEF geometry unless a FOREIGN cell is specified\n"
|
||||
"* 0: produce LEF geometry unless a FOREIGN cell is specified (the default)\n"
|
||||
"* 1: produce LEF geometry always and ignore FOREIGN\n"
|
||||
"* 2: Never produce LEF geometry and assume FOREIGN always\n"
|
||||
"\n"
|
||||
@@ -679,8 +679,6 @@ GenericReaderOptions::add_options (tl::CommandLineOptions &cmd)
|
||||
"Use a comma-separated list of file names here to specify which LEF files to read. "
|
||||
"See also '--" + m_long_prefix + "lefdef-read-lef-with-def' for an option to implicitly read all LEF files in the same "
|
||||
"place than the DEF file.\n"
|
||||
"\n"
|
||||
"Relative paths are resolved based on the location of the DEF file which is read."
|
||||
)
|
||||
;
|
||||
|
||||
@@ -730,7 +728,7 @@ GenericReaderOptions::configure (db::LoadLayoutOptions &load_options)
|
||||
load_options.set_option_by_name ("gds2_allow_multi_xy_records", m_gds2_allow_multi_xy_records);
|
||||
|
||||
load_options.set_option_by_name ("oasis_read_all_properties", m_oasis_read_all_properties);
|
||||
load_options.set_option_by_name ("oasis_expect_strict_mode", m_oasis_expect_strict_mode ? 1 : 0);
|
||||
load_options.set_option_by_name ("oasis_expect_strict_mode", m_oasis_expect_strict_mode ? 1 : -1);
|
||||
|
||||
load_options.set_option_by_name ("cif_layer_map", tl::Variant::make_variant (m_layer_map));
|
||||
load_options.set_option_by_name ("cif_create_other_layers", m_create_other_layers);
|
||||
@@ -807,6 +805,8 @@ GenericReaderOptions::configure (db::LoadLayoutOptions &load_options)
|
||||
load_options.set_option_by_name ("lefdef_config.separate_groups", m_lefdef_separate_groups);
|
||||
load_options.set_option_by_name ("lefdef_config.map_file", m_lefdef_map_file);
|
||||
load_options.set_option_by_name ("lefdef_config.macro_resolution_mode", m_lefdef_macro_resolution_mode);
|
||||
load_options.set_option_by_name ("lefdef_config.macro_resolution_mode", m_lefdef_macro_resolution_mode);
|
||||
load_options.set_option_by_name ("lefdef_config.paths_relative_to_cwd", true);
|
||||
|
||||
m_lef_layouts.clear ();
|
||||
tl::Variant lef_layout_ptrs = tl::Variant::empty_list ();
|
||||
@@ -833,4 +833,42 @@ GenericReaderOptions::configure (db::LoadLayoutOptions &load_options)
|
||||
load_options.set_option_by_name ("lefdef_config.macro_layouts", lef_layout_ptrs);
|
||||
}
|
||||
|
||||
static std::string::size_type find_file_sep (const std::string &s, std::string::size_type from)
|
||||
{
|
||||
std::string::size_type p1 = s.find ("+", from);
|
||||
std::string::size_type p2 = s.find (",", from);
|
||||
|
||||
if (p1 == std::string::npos) {
|
||||
return p2;
|
||||
} else if (p2 == std::string::npos) {
|
||||
return p1;
|
||||
} else {
|
||||
return p1 < p2 ? p1 : p2;
|
||||
}
|
||||
}
|
||||
|
||||
static std::vector<std::string> split_file_list (const std::string &infile)
|
||||
{
|
||||
std::vector<std::string> files;
|
||||
|
||||
size_t p = 0;
|
||||
for (size_t pp = 0; (pp = find_file_sep (infile, p)) != std::string::npos; p = pp + 1) {
|
||||
files.push_back (std::string (infile, p, pp - p));
|
||||
}
|
||||
files.push_back (std::string (infile, p));
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
void read_files (db::Layout &layout, const std::string &infile, const db::LoadLayoutOptions &options)
|
||||
{
|
||||
std::vector<std::string> files = split_file_list (infile);
|
||||
|
||||
for (std::vector<std::string>::const_iterator f = files.begin (); f != files.end (); ++f) {
|
||||
tl::InputStream stream (*f);
|
||||
db::Reader reader (stream);
|
||||
reader.read (layout, options);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -195,6 +195,13 @@ private:
|
||||
tl::shared_collection<db::Layout> m_lef_layouts;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A function to load a sequence of files into the layout with the given options
|
||||
*
|
||||
* "file_path" is a "+" or "," separated list of files read "into" a single layout.
|
||||
*/
|
||||
BD_PUBLIC void read_files (db::Layout &layout, const std::string &infile, const db::LoadLayoutOptions &options);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -47,10 +47,7 @@ BD_PUBLIC int strm2txt (int argc, char *argv[])
|
||||
{
|
||||
db::LoadLayoutOptions load_options;
|
||||
generic_reader_options.configure (load_options);
|
||||
|
||||
tl::InputStream stream (infile);
|
||||
db::Reader reader (stream);
|
||||
reader.read (layout, load_options);
|
||||
bd::read_files (layout, infile, load_options);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -71,10 +71,7 @@ void clip (ClipData &data)
|
||||
{
|
||||
db::LoadLayoutOptions load_options;
|
||||
data.reader_options.configure (load_options);
|
||||
|
||||
tl::InputStream stream (data.file_in);
|
||||
db::Reader reader (stream);
|
||||
reader.read (layout, load_options);
|
||||
bd::read_files (layout, data.file_in, load_options);
|
||||
}
|
||||
|
||||
// create the layers in the target layout as well
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -142,19 +142,13 @@ BD_PUBLIC int strmcmp (int argc, char *argv[])
|
||||
{
|
||||
db::LoadLayoutOptions load_options;
|
||||
generic_reader_options_a.configure (load_options);
|
||||
|
||||
tl::InputStream stream (infile_a);
|
||||
db::Reader reader (stream);
|
||||
reader.read (layout_a, load_options);
|
||||
bd::read_files (layout_a, infile_a, load_options);
|
||||
}
|
||||
|
||||
{
|
||||
db::LoadLayoutOptions load_options;
|
||||
generic_reader_options_b.configure (load_options);
|
||||
|
||||
tl::InputStream stream (infile_b);
|
||||
db::Reader reader (stream);
|
||||
reader.read (layout_b, load_options);
|
||||
bd::read_files (layout_b, infile_b, load_options);
|
||||
}
|
||||
|
||||
unsigned int flags = 0;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
+180
-27
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "bdReaderOptions.h"
|
||||
#include "bdWriterOptions.h"
|
||||
#include "dbLayout.h"
|
||||
#include "dbTilingProcessor.h"
|
||||
#include "dbReader.h"
|
||||
@@ -30,12 +31,34 @@
|
||||
#include "dbDeepShapeStore.h"
|
||||
#include "gsiExpression.h"
|
||||
#include "tlCommandLineParser.h"
|
||||
#include "tlThreads.h"
|
||||
|
||||
class CountingInserter
|
||||
namespace {
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
class HealingCountingReceiver
|
||||
: public db::TileOutputReceiver
|
||||
{
|
||||
public:
|
||||
CountingInserter ()
|
||||
: m_count (0)
|
||||
HealingCountingReceiver (size_t *count, bool healing);
|
||||
|
||||
virtual void put (size_t /*ix*/, size_t /*iy*/, const db::Box &tile, size_t /*id*/, const tl::Variant &obj, double /*dbu*/, const db::ICplxTrans & /*trans*/, bool clip);
|
||||
virtual void finish (bool);
|
||||
|
||||
void keep_for_healing (const db::Polygon &poly);
|
||||
|
||||
private:
|
||||
size_t *mp_count;
|
||||
db::Region m_for_healing;
|
||||
bool m_healing;
|
||||
};
|
||||
|
||||
class HealingCountingInserter
|
||||
{
|
||||
public:
|
||||
HealingCountingInserter (const db::Box &tile, bool healing, HealingCountingReceiver *rec)
|
||||
: m_count (0), mp_tile (&tile), m_healing (healing), mp_receiver (rec)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
@@ -46,6 +69,15 @@ public:
|
||||
m_count += 1;
|
||||
}
|
||||
|
||||
void operator() (const db::Polygon &poly)
|
||||
{
|
||||
if (m_healing && ! poly.box ().inside (mp_tile->enlarged (db::Vector (-1, -1)))) {
|
||||
mp_receiver->keep_for_healing (poly);
|
||||
} else {
|
||||
m_count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
size_t count () const
|
||||
{
|
||||
return m_count;
|
||||
@@ -53,29 +85,140 @@ public:
|
||||
|
||||
private:
|
||||
size_t m_count;
|
||||
const db::Box *mp_tile;
|
||||
bool m_healing;
|
||||
HealingCountingReceiver *mp_receiver;
|
||||
};
|
||||
|
||||
class CountingReceiver
|
||||
HealingCountingReceiver::HealingCountingReceiver (size_t *count, bool healing)
|
||||
: mp_count (count), m_healing (healing)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
void
|
||||
HealingCountingReceiver::put (size_t /*ix*/, size_t /*iy*/, const db::Box &tile, size_t /*id*/, const tl::Variant &obj, double /*dbu*/, const db::ICplxTrans & /*trans*/, bool clip)
|
||||
{
|
||||
HealingCountingInserter inserter (tile, m_healing, this);
|
||||
db::insert_var (inserter, obj, tile, clip);
|
||||
*mp_count += inserter.count ();
|
||||
}
|
||||
|
||||
void
|
||||
HealingCountingReceiver::keep_for_healing (const db::Polygon &poly)
|
||||
{
|
||||
m_for_healing.insert (poly);
|
||||
}
|
||||
|
||||
void
|
||||
HealingCountingReceiver::finish (bool)
|
||||
{
|
||||
if (m_healing) {
|
||||
*mp_count += m_for_healing.merged ().count ();
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
class HealingTileLayoutOutputReceiver
|
||||
: public db::TileOutputReceiver
|
||||
{
|
||||
public:
|
||||
CountingReceiver (size_t *count)
|
||||
: mp_count (count)
|
||||
HealingTileLayoutOutputReceiver (db::Layout *layout, db::Cell *cell, unsigned int layer, bool healing);
|
||||
|
||||
void put (size_t /*ix*/, size_t /*iy*/, const db::Box &tile, size_t /*id*/, const tl::Variant &obj, double dbu, const db::ICplxTrans &trans, bool clip);
|
||||
|
||||
void begin (size_t /*nx*/, size_t /*ny*/, const db::DPoint & /*p0*/, double /*dx*/, double /*dy*/, const db::DBox & /*frame*/);
|
||||
void finish (bool /*success*/);
|
||||
|
||||
void keep_for_healing (const db::Polygon &poly);
|
||||
void output (const db::Polygon &poly);
|
||||
|
||||
private:
|
||||
db::Layout *mp_layout;
|
||||
db::Cell *mp_cell;
|
||||
unsigned int m_layer;
|
||||
db::Region m_for_healing;
|
||||
bool m_healing;
|
||||
tl::Mutex m_mutex;
|
||||
};
|
||||
|
||||
class HealingTileLayoutOutputInserter
|
||||
{
|
||||
public:
|
||||
HealingTileLayoutOutputInserter (const db::Box &tile, bool healing, const db::ICplxTrans &trans, HealingTileLayoutOutputReceiver *rec)
|
||||
: mp_tile (&tile), m_healing (healing), mp_trans (&trans), mp_receiver (rec)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
virtual void put (size_t /*ix*/, size_t /*iy*/, const db::Box &tile, size_t /*id*/, const tl::Variant &obj, double /*dbu*/, const db::ICplxTrans & /*trans*/, bool clip)
|
||||
template <class T>
|
||||
void operator() (const T & /*t*/)
|
||||
{
|
||||
CountingInserter inserter;
|
||||
db::insert_var (inserter, obj, tile, clip);
|
||||
*mp_count += inserter.count ();
|
||||
// .. ignore other shapes
|
||||
}
|
||||
|
||||
void operator() (const db::Polygon &poly)
|
||||
{
|
||||
if (m_healing && ! poly.box ().inside (mp_tile->enlarged (db::Vector (-1, -1)))) {
|
||||
mp_receiver->keep_for_healing (*mp_trans * poly);
|
||||
} else {
|
||||
mp_receiver->output (*mp_trans * poly);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
size_t *mp_count;
|
||||
const db::Box *mp_tile;
|
||||
bool m_healing;
|
||||
const db::ICplxTrans *mp_trans;
|
||||
HealingTileLayoutOutputReceiver *mp_receiver;
|
||||
};
|
||||
|
||||
HealingTileLayoutOutputReceiver::HealingTileLayoutOutputReceiver (db::Layout *layout, db::Cell *cell, unsigned int layer, bool healing)
|
||||
: mp_layout (layout), mp_cell (cell), m_layer (layer), m_healing (healing)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
void
|
||||
HealingTileLayoutOutputReceiver::put (size_t /*ix*/, size_t /*iy*/, const db::Box &tile, size_t /*id*/, const tl::Variant &obj, double dbu, const db::ICplxTrans &trans, bool clip)
|
||||
{
|
||||
db::ICplxTrans tr (db::ICplxTrans (dbu / mp_layout->dbu ()) * trans);
|
||||
HealingTileLayoutOutputInserter inserter (tile, m_healing, tr, this);
|
||||
db::insert_var (inserter, obj, tile, clip);
|
||||
}
|
||||
|
||||
void
|
||||
HealingTileLayoutOutputReceiver::begin (size_t /*nx*/, size_t /*ny*/, const db::DPoint & /*p0*/, double /*dx*/, double /*dy*/, const db::DBox & /*frame*/)
|
||||
{
|
||||
mp_layout->start_changes ();
|
||||
}
|
||||
|
||||
void
|
||||
HealingTileLayoutOutputReceiver::finish (bool /*success*/)
|
||||
{
|
||||
// heal the polygons
|
||||
m_for_healing.merge ();
|
||||
m_for_healing.insert_into (mp_layout, mp_cell->cell_index (), m_layer);
|
||||
m_for_healing.clear ();
|
||||
|
||||
mp_layout->end_changes ();
|
||||
}
|
||||
|
||||
void
|
||||
HealingTileLayoutOutputReceiver::keep_for_healing (const db::Polygon &poly)
|
||||
{
|
||||
m_for_healing.insert (poly);
|
||||
}
|
||||
|
||||
void
|
||||
HealingTileLayoutOutputReceiver::output (const db::Polygon &poly)
|
||||
{
|
||||
mp_cell->shapes (m_layer).insert (poly);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
struct ResultDescriptor
|
||||
{
|
||||
ResultDescriptor ()
|
||||
@@ -119,6 +262,8 @@ struct ResultDescriptor
|
||||
}
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
struct XORData
|
||||
{
|
||||
XORData ()
|
||||
@@ -126,7 +271,8 @@ struct XORData
|
||||
tolerance_bump (0),
|
||||
dont_summarize_missing_layers (false), silent (false), no_summary (false),
|
||||
threads (0),
|
||||
tile_size (0.0), output_layout (0), output_cell (0)
|
||||
tile_size (0.0), heal_results (false),
|
||||
output_layout (0), output_cell (0)
|
||||
{ }
|
||||
|
||||
db::Layout *layout_a, *layout_b;
|
||||
@@ -138,12 +284,17 @@ struct XORData
|
||||
bool no_summary;
|
||||
int threads;
|
||||
double tile_size;
|
||||
bool heal_results;
|
||||
db::Layout *output_layout;
|
||||
db::cell_index_type output_cell;
|
||||
std::map<db::LayerProperties, std::pair<int, int>, db::LPLogicalLessFunc> l2l_map;
|
||||
std::map<std::pair<int, db::LayerProperties>, ResultDescriptor> *results;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
static bool run_tiled_xor (const XORData &xor_data);
|
||||
static bool run_deep_xor (const XORData &xor_data);
|
||||
|
||||
@@ -171,11 +322,15 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
|
||||
int tolerance_bump = 10000;
|
||||
int threads = 1;
|
||||
double tile_size = 0.0;
|
||||
bool heal_results = false;
|
||||
|
||||
tl::CommandLineOptions cmd;
|
||||
generic_reader_options_a.add_options (cmd);
|
||||
generic_reader_options_b.add_options (cmd);
|
||||
|
||||
bd::GenericWriterOptions writer_options;
|
||||
writer_options.add_options (cmd);
|
||||
|
||||
cmd << tl::arg ("input_a", &infile_a, "The first input file (any format, may be gzip compressed)")
|
||||
<< tl::arg ("input_b", &infile_b, "The second input file (any format, may be gzip compressed)")
|
||||
<< tl::arg ("?output", &output, "The output file to which the XOR differences are written",
|
||||
@@ -219,6 +374,10 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
|
||||
"In tiling mode, the layout is divided into tiles of the given size. Each tile is computed "
|
||||
"individually. Multiple tiles can be processed in parallel on multiple cores."
|
||||
)
|
||||
<< tl::arg ("-m|--heal", &heal_results, "Heal results in tiling mode",
|
||||
"This options runs a post-XOR merge to remove cuts implied by the tile formation. The resulting "
|
||||
"feature count is closer to the real number of differences."
|
||||
)
|
||||
<< tl::arg ("-b|--layer-bump=offset", &tolerance_bump, "Specifies the layer number offset to add for every tolerance",
|
||||
"This value is the number added to the original layer number to form a layer set for each tolerance "
|
||||
"value. If this value is set to 1000, the first tolerance value will produce XOR results on the "
|
||||
@@ -253,10 +412,7 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
|
||||
|
||||
db::LoadLayoutOptions load_options;
|
||||
generic_reader_options_a.configure (load_options);
|
||||
|
||||
tl::InputStream stream (infile_a);
|
||||
db::Reader reader (stream);
|
||||
reader.read (layout_a, load_options);
|
||||
bd::read_files (layout_a, infile_a, load_options);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -264,10 +420,7 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
|
||||
|
||||
db::LoadLayoutOptions load_options;
|
||||
generic_reader_options_b.configure (load_options);
|
||||
|
||||
tl::InputStream stream (infile_b);
|
||||
db::Reader reader (stream);
|
||||
reader.read (layout_b, load_options);
|
||||
bd::read_files (layout_b, infile_b, load_options);
|
||||
}
|
||||
|
||||
if (top_a.empty ()) {
|
||||
@@ -335,6 +488,7 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
|
||||
xor_data.no_summary = no_summary;
|
||||
xor_data.threads = threads;
|
||||
xor_data.tile_size = tile_size;
|
||||
xor_data.heal_results = heal_results;
|
||||
xor_data.output_layout = output_layout.get ();
|
||||
xor_data.output_cell = output_top;
|
||||
xor_data.l2l_map = l2l_map;
|
||||
@@ -356,6 +510,7 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
|
||||
|
||||
db::SaveLayoutOptions save_options;
|
||||
save_options.set_format_from_filename (output);
|
||||
writer_options.configure (save_options, *output_layout);
|
||||
|
||||
tl::OutputStream stream (output);
|
||||
db::Writer writer (save_options);
|
||||
@@ -413,7 +568,6 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
|
||||
return result ? 0 : 1;
|
||||
}
|
||||
|
||||
|
||||
bool run_tiled_xor (const XORData &xor_data)
|
||||
{
|
||||
db::TilingProcessor proc;
|
||||
@@ -422,6 +576,7 @@ bool run_tiled_xor (const XORData &xor_data)
|
||||
if (xor_data.tile_size > db::epsilon) {
|
||||
if (tl::verbosity () >= 20) {
|
||||
tl::log << "Tile size: " << xor_data.tile_size;
|
||||
tl::log << "Healing: " << (xor_data.heal_results ? "on" : "off");
|
||||
}
|
||||
proc.tile_size (xor_data.tile_size, xor_data.tile_size);
|
||||
}
|
||||
@@ -445,8 +600,6 @@ bool run_tiled_xor (const XORData &xor_data)
|
||||
|
||||
int index = 1;
|
||||
|
||||
std::list<tl::shared_ptr<CountingReceiver> > counters;
|
||||
|
||||
for (std::map<db::LayerProperties, std::pair<int, int> >::const_iterator ll = xor_data.l2l_map.begin (); ll != xor_data.l2l_map.end (); ++ll) {
|
||||
|
||||
if ((ll->second.first < 0 || ll->second.second < 0) && ! xor_data.dont_summarize_missing_layers) {
|
||||
@@ -509,10 +662,10 @@ bool run_tiled_xor (const XORData &xor_data)
|
||||
|
||||
if (result.layout) {
|
||||
result.layer_output = result.layout->insert_layer (lp);
|
||||
proc.output (out, *result.layout, result.top_cell, result.layer_output);
|
||||
HealingTileLayoutOutputReceiver *receiver = new HealingTileLayoutOutputReceiver (result.layout, &result.layout->cell (result.top_cell), result.layer_output, xor_data.heal_results);
|
||||
proc.output (out, 0, receiver, db::ICplxTrans ());
|
||||
} else {
|
||||
CountingReceiver *counter = new CountingReceiver (&result.shape_count);
|
||||
counters.push_back (tl::shared_ptr<CountingReceiver> (counter));
|
||||
HealingCountingReceiver *counter = new HealingCountingReceiver (&result.shape_count, xor_data.heal_results);
|
||||
proc.output (out, 0, counter, db::ICplxTrans ());
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -393,6 +393,105 @@ TEST(3_Flat)
|
||||
);
|
||||
}
|
||||
|
||||
TEST(3_FlatCount)
|
||||
{
|
||||
tl::CaptureChannel cap;
|
||||
|
||||
std::string input_a = tl::testdata ();
|
||||
input_a += "/bd/strmxor_in1.gds";
|
||||
|
||||
std::string input_b = tl::testdata ();
|
||||
input_b += "/bd/strmxor_in2.gds";
|
||||
|
||||
std::string au = tl::testdata ();
|
||||
au += "/bd/strmxor_au3.oas";
|
||||
|
||||
std::string output = this->tmp_file ("tmp.oas");
|
||||
|
||||
const char *argv[] = { "x", "-p=1.0", "-n=4", input_a.c_str (), input_b.c_str () };
|
||||
|
||||
EXPECT_EQ (strmxor (sizeof (argv) / sizeof (argv[0]), (char **) argv), 1);
|
||||
|
||||
EXPECT_EQ (cap.captured_text (),
|
||||
"Layer 10/0 is not present in first layout, but in second\n"
|
||||
"Result summary (layers without differences are not shown):\n"
|
||||
"\n"
|
||||
" Layer Output Differences (shape count)\n"
|
||||
" -------------------------------------------------------\n"
|
||||
" 3/0 - 31\n"
|
||||
" 6/0 - 217\n"
|
||||
" 8/1 - 168\n"
|
||||
" 10/0 - (no such layer in first layout)\n"
|
||||
"\n"
|
||||
);
|
||||
}
|
||||
|
||||
TEST(3_FlatHeal)
|
||||
{
|
||||
tl::CaptureChannel cap;
|
||||
|
||||
std::string input_a = tl::testdata ();
|
||||
input_a += "/bd/strmxor_in1.gds";
|
||||
|
||||
std::string input_b = tl::testdata ();
|
||||
input_b += "/bd/strmxor_in2.gds";
|
||||
|
||||
std::string au = tl::testdata ();
|
||||
au += "/bd/strmxor_au3_heal.oas";
|
||||
|
||||
std::string output = this->tmp_file ("tmp.oas");
|
||||
|
||||
const char *argv[] = { "x", "--heal", "--no-summary", "-p=1.0", "-n=4", input_a.c_str (), input_b.c_str (), output.c_str () };
|
||||
|
||||
EXPECT_EQ (strmxor (sizeof (argv) / sizeof (argv[0]), (char **) argv), 1);
|
||||
|
||||
db::Layout layout;
|
||||
|
||||
{
|
||||
tl::InputStream stream (output);
|
||||
db::Reader reader (stream);
|
||||
reader.read (layout);
|
||||
}
|
||||
|
||||
db::compare_layouts (this, layout, au, db::NoNormalization);
|
||||
EXPECT_EQ (cap.captured_text (),
|
||||
"Layer 10/0 is not present in first layout, but in second\n"
|
||||
);
|
||||
}
|
||||
|
||||
TEST(3_FlatCountHeal)
|
||||
{
|
||||
tl::CaptureChannel cap;
|
||||
|
||||
std::string input_a = tl::testdata ();
|
||||
input_a += "/bd/strmxor_in1.gds";
|
||||
|
||||
std::string input_b = tl::testdata ();
|
||||
input_b += "/bd/strmxor_in2.gds";
|
||||
|
||||
std::string au = tl::testdata ();
|
||||
au += "/bd/strmxor_au3.oas";
|
||||
|
||||
std::string output = this->tmp_file ("tmp.oas");
|
||||
|
||||
const char *argv[] = { "x", "-m", "-p=1.0", "-n=4", input_a.c_str (), input_b.c_str () };
|
||||
|
||||
EXPECT_EQ (strmxor (sizeof (argv) / sizeof (argv[0]), (char **) argv), 1);
|
||||
|
||||
EXPECT_EQ (cap.captured_text (),
|
||||
"Layer 10/0 is not present in first layout, but in second\n"
|
||||
"Result summary (layers without differences are not shown):\n"
|
||||
"\n"
|
||||
" Layer Output Differences (shape count)\n"
|
||||
" -------------------------------------------------------\n"
|
||||
" 3/0 - 30\n"
|
||||
" 6/0 - 41\n"
|
||||
" 8/1 - 1\n"
|
||||
" 10/0 - (no such layer in first layout)\n"
|
||||
"\n"
|
||||
);
|
||||
}
|
||||
|
||||
TEST(3_Deep)
|
||||
{
|
||||
tl::CaptureChannel cap;
|
||||
@@ -460,6 +559,39 @@ TEST(4_Flat)
|
||||
);
|
||||
}
|
||||
|
||||
TEST(4_FlatHeal)
|
||||
{
|
||||
tl::CaptureChannel cap;
|
||||
|
||||
std::string input_a = tl::testdata ();
|
||||
input_a += "/bd/strmxor_in1.gds";
|
||||
|
||||
std::string input_b = tl::testdata ();
|
||||
input_b += "/bd/strmxor_in2.gds";
|
||||
|
||||
std::string au = tl::testdata ();
|
||||
au += "/bd/strmxor_au4_heal.oas";
|
||||
|
||||
std::string output = this->tmp_file ("tmp.oas");
|
||||
|
||||
const char *argv[] = { "x", "--heal", "--no-summary", "-p=1.0", "-n=4", "-t=0.0,0.005,0.01,0.02,0.09,0.1", input_a.c_str (), input_b.c_str (), output.c_str () };
|
||||
|
||||
EXPECT_EQ (strmxor (sizeof (argv) / sizeof (argv[0]), (char **) argv), 1);
|
||||
|
||||
db::Layout layout;
|
||||
|
||||
{
|
||||
tl::InputStream stream (output);
|
||||
db::Reader reader (stream);
|
||||
reader.read (layout);
|
||||
}
|
||||
|
||||
db::compare_layouts (this, layout, au, db::NoNormalization);
|
||||
EXPECT_EQ (cap.captured_text (),
|
||||
"Layer 10/0 is not present in first layout, but in second\n"
|
||||
);
|
||||
}
|
||||
|
||||
TEST(4_Deep)
|
||||
{
|
||||
tl::CaptureChannel cap;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -204,7 +204,6 @@ SOURCES = \
|
||||
gsiDeclDbNetlistCrossReference.cc \
|
||||
gsiDeclDbLayoutVsSchematic.cc \
|
||||
dbNetlistObject.cc \
|
||||
dbD25TechnologyComponent.cc \
|
||||
gsiDeclDbTexts.cc \
|
||||
dbTexts.cc \
|
||||
dbDeepTexts.cc \
|
||||
@@ -381,7 +380,6 @@ HEADERS = \
|
||||
dbLayoutVsSchematicFormatDefs.h \
|
||||
dbLayoutVsSchematic.h \
|
||||
dbNetlistObject.h \
|
||||
dbD25TechnologyComponent.h \
|
||||
dbTexts.h \
|
||||
dbDeepTexts.h \
|
||||
dbAsIfFlatTexts.h \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
+3
-2
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -306,7 +306,8 @@ Cell::update_bbox (unsigned int layers)
|
||||
// update the bboxes of the shapes lists
|
||||
for (shapes_map::iterator s = m_shapes_map.begin (); s != m_shapes_map.end (); ++s) {
|
||||
|
||||
s->second.update_bbox ();
|
||||
s->second.reset_bbox_dirty ();
|
||||
|
||||
box_type sbox (s->second.bbox ());
|
||||
|
||||
if (! sbox.empty ()) {
|
||||
|
||||
+10
-9
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -65,7 +65,7 @@ class LayerMapping;
|
||||
* a set of child cell instances and auxiliary information such as
|
||||
* the parent instance list.
|
||||
* A cell is identified through an index given to the cell upon instantiation.
|
||||
* The cell index is valid in the context of a cell graph object which
|
||||
* The cell index is valid in the context of a layout object which
|
||||
* must issue the cell index.
|
||||
*/
|
||||
|
||||
@@ -483,7 +483,7 @@ public:
|
||||
bool is_shape_bbox_dirty () const;
|
||||
|
||||
/**
|
||||
* @brief Update the bbox
|
||||
* @brief Updates the bbox
|
||||
*
|
||||
* This will update the bbox from the shapes and instances.
|
||||
* This requires the bboxes of the child cells to be computed
|
||||
@@ -496,8 +496,9 @@ public:
|
||||
* @return true, if the bounding box has changed.
|
||||
*/
|
||||
bool update_bbox (unsigned int layers);
|
||||
|
||||
/**
|
||||
* @brief Sort the shapes lists
|
||||
* @brief Sorts the shapes lists
|
||||
*
|
||||
* This will sort the shapes lists for query of regions
|
||||
* on a per-shape basis. Since sorting of the shapes is
|
||||
@@ -511,7 +512,7 @@ public:
|
||||
*
|
||||
* Before the bounding box can be retrieved, it must have
|
||||
* been computed using update_bbox. This is performed by
|
||||
* requesting an update from the graph.
|
||||
* requesting an update from the layout.
|
||||
*
|
||||
* @return The bounding box that was computed by update_bbox
|
||||
*/
|
||||
@@ -522,7 +523,7 @@ public:
|
||||
*
|
||||
* Before the bounding box can be retrieved, it must have
|
||||
* been computed using update_bbox. This is performed by
|
||||
* requesting an update from the graph.
|
||||
* requesting an update from the layout.
|
||||
*
|
||||
* @return The bounding box that was computed by update_bbox
|
||||
*/
|
||||
@@ -1026,10 +1027,10 @@ protected:
|
||||
/**
|
||||
* @brief Standard constructor: create an empty cell object
|
||||
*
|
||||
* Takes the manager object from the graph object.
|
||||
* Takes the manager object from the layout object.
|
||||
*
|
||||
* @param ci The index of the cell
|
||||
* @param g A reference to the graph object that owns the cell
|
||||
* @param g A reference to the layout object that owns the cell
|
||||
*/
|
||||
Cell (cell_index_type ci, db::Layout &g);
|
||||
|
||||
@@ -1065,7 +1066,7 @@ private:
|
||||
// linked list, used by Layout
|
||||
Cell *mp_last, *mp_next;
|
||||
|
||||
// clear the shapes without telling the graph
|
||||
// clear the shapes without telling the layout
|
||||
void clear_shapes_no_invalidate ();
|
||||
|
||||
// helper function for computing the number of hierarchy levels
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -511,19 +511,52 @@ VariantsCollectorBase::create_var_instances_non_tl_invariant (db::Cell &in_cell,
|
||||
std::map<db::cell_index_type, std::map<db::ICplxTrans, db::cell_index_type> >::const_iterator f = var_table.find (i->object ().cell_index ());
|
||||
if (f == var_table.end ()) {
|
||||
|
||||
in_cell.insert (*i);
|
||||
in_cell.insert (*i);
|
||||
|
||||
} else {
|
||||
|
||||
const std::map<db::ICplxTrans, db::cell_index_type> &vt = f->second;
|
||||
|
||||
for (db::CellInstArray::iterator ia = i->begin (); ! ia.at_end (); ++ia) {
|
||||
bool need_explode = false;
|
||||
bool first = true;
|
||||
db::cell_index_type ci = 0;
|
||||
|
||||
for (db::CellInstArray::iterator ia = i->begin (); ! ia.at_end () && ! need_explode; ++ia) {
|
||||
|
||||
db::ICplxTrans rt = mp_red->reduce (for_var * mp_red->reduce_trans (i->complex_trans (*ia)));
|
||||
std::map<db::ICplxTrans, db::cell_index_type>::const_iterator v = vt.find (rt);
|
||||
tl_assert (v != vt.end ());
|
||||
|
||||
in_cell.insert (db::CellInstArrayWithProperties (db::CellInstArray (db::CellInst (v->second), i->complex_trans (*ia)), i->properties_id ()));
|
||||
if (first) {
|
||||
ci = v->second;
|
||||
first = false;
|
||||
} else {
|
||||
need_explode = (ci != v->second);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (need_explode) {
|
||||
|
||||
for (db::CellInstArray::iterator ia = i->begin (); ! ia.at_end (); ++ia) {
|
||||
|
||||
db::ICplxTrans rt = mp_red->reduce (for_var * mp_red->reduce_trans (i->complex_trans (*ia)));
|
||||
std::map<db::ICplxTrans, db::cell_index_type>::const_iterator v = vt.find (rt);
|
||||
tl_assert (v != vt.end ());
|
||||
|
||||
in_cell.insert (db::CellInstArrayWithProperties (db::CellInstArray (db::CellInst (v->second), i->complex_trans (*ia)), i->properties_id ()));
|
||||
|
||||
}
|
||||
|
||||
} else if (ci != i->object ().cell_index ()) {
|
||||
|
||||
db::CellInstArray new_array = *i;
|
||||
new_array.object () = db::CellInst (ci);
|
||||
in_cell.insert (db::CellInstArrayWithProperties (new_array, i->properties_id ()));
|
||||
|
||||
} else {
|
||||
|
||||
in_cell.insert (*i);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -81,9 +81,9 @@ std::string
|
||||
ColdProxy::get_basic_name () const
|
||||
{
|
||||
if (! mp_context_info->pcell_name.empty ()) {
|
||||
return "<defunct>" + mp_context_info->pcell_name;
|
||||
return mp_context_info->pcell_name;
|
||||
} else if (! mp_context_info->cell_name.empty ()) {
|
||||
return "<defunct>" + mp_context_info->cell_name;
|
||||
return mp_context_info->cell_name;
|
||||
} else {
|
||||
return Cell::get_basic_name ();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -286,6 +286,8 @@ CommonReader::read (db::Layout &layout, const db::LoadLayoutOptions &options)
|
||||
{
|
||||
init (options);
|
||||
|
||||
tl_assert (!layout.under_construction ());
|
||||
|
||||
m_common_options.layer_map.prepare (layout);
|
||||
|
||||
layout.start_changes ();
|
||||
@@ -298,6 +300,11 @@ CommonReader::read (db::Layout &layout, const db::LoadLayoutOptions &options)
|
||||
throw;
|
||||
}
|
||||
|
||||
// A cleanup may be necessary because of the following scenario: if library proxies contain subcells
|
||||
// which are proxies itself, the proxy update may make them orphans (the proxies are regenerated).
|
||||
// The cleanup will removed these.
|
||||
layout.cleanup ();
|
||||
|
||||
return m_layer_map_out;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,436 +0,0 @@
|
||||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#include "dbD25TechnologyComponent.h"
|
||||
#include "tlClassRegistry.h"
|
||||
#include "tlString.h"
|
||||
|
||||
namespace db
|
||||
{
|
||||
|
||||
std::string d25_component_name ()
|
||||
{
|
||||
return std::string ("d25");
|
||||
}
|
||||
|
||||
std::string d25_description ()
|
||||
{
|
||||
return tl::to_string (tr ("Z stack (2.5d)"));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
// D25LayerInfo implementation
|
||||
|
||||
D25LayerInfo::D25LayerInfo ()
|
||||
: m_layer (), m_zstart (0.0), m_zstop (0.0)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
D25LayerInfo::~D25LayerInfo ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
D25LayerInfo::D25LayerInfo (const D25LayerInfo &other)
|
||||
{
|
||||
operator= (other);
|
||||
}
|
||||
|
||||
D25LayerInfo &
|
||||
D25LayerInfo::operator= (const D25LayerInfo &other)
|
||||
{
|
||||
if (this != &other) {
|
||||
m_layer = other.m_layer;
|
||||
m_zstart = other.m_zstart;
|
||||
m_zstop = other.m_zstop;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool
|
||||
D25LayerInfo::operator== (const D25LayerInfo &other) const
|
||||
{
|
||||
return fabs (m_zstart - other.m_zstart) < db::epsilon && fabs (m_zstop - other.m_zstop) < db::epsilon;
|
||||
}
|
||||
|
||||
void
|
||||
D25LayerInfo::set_layer (const db::LayerProperties &l)
|
||||
{
|
||||
m_layer = l;
|
||||
}
|
||||
|
||||
void
|
||||
D25LayerInfo::set_layer_from_string (const std::string &l)
|
||||
{
|
||||
db::LayerProperties lp;
|
||||
tl::Extractor ex (l.c_str ());
|
||||
try {
|
||||
lp.read (ex);
|
||||
} catch (tl::Exception &) {
|
||||
// ignore errors for now.
|
||||
}
|
||||
m_layer = lp;
|
||||
}
|
||||
|
||||
std::string
|
||||
D25LayerInfo::layer_as_string () const
|
||||
{
|
||||
return m_layer.to_string ();
|
||||
}
|
||||
|
||||
void
|
||||
D25LayerInfo::set_zstart (double z0)
|
||||
{
|
||||
m_zstart = z0;
|
||||
}
|
||||
|
||||
void
|
||||
D25LayerInfo::set_zstop (double z1)
|
||||
{
|
||||
m_zstop = z1;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
// D25TechnologyComponent implementation
|
||||
|
||||
D25TechnologyComponent::D25TechnologyComponent ()
|
||||
: db::TechnologyComponent (d25_component_name (), d25_description ())
|
||||
{
|
||||
// provide some explanation for the initialization
|
||||
m_src =
|
||||
"# Provide z stack information here\n"
|
||||
"#\n"
|
||||
"# Each line is one layer. The specification consists of a layer specification, a colon and arguments.\n"
|
||||
"# The arguments are named (like \"x=...\") or in serial. Parameters are separated by comma or blanks.\n"
|
||||
"# Named arguments are:\n"
|
||||
"#\n"
|
||||
"# zstart The lower z position of the extruded layer in µm\n"
|
||||
"# zstop The upper z position of the extruded layer in µm\n"
|
||||
"# height The height of the extruded layer in µm\n"
|
||||
"#\n"
|
||||
"# 'height', 'zstart' and 'zstop' can be used in any combination. If no value is given for 'zstart',\n"
|
||||
"# the upper level of the previous layer will be used.\n"
|
||||
"#\n"
|
||||
"# If a single unnamed parameter is given, it corresponds to 'height'. Two parameters correspond to\n"
|
||||
"# 'zstart' and 'zstop'.\n"
|
||||
"#\n"
|
||||
"# Examples:\n"
|
||||
"# 1: 0.5 1.5 # extrude layer 1/0 from 0.5 to 1.5 vertically\n"
|
||||
"# 1/0: 0.5 1.5 # same with explicit datatype\n"
|
||||
"# 1: zstop=1.5, zstart=0.5 # same with named parameters\n"
|
||||
"# 1: height=1.0, zstop=1.5 # same with z stop minus height\n"
|
||||
"# 1: 1.0 zstop=1.5 # same with height as unnamed parameter\n"
|
||||
"#\n"
|
||||
"# VARIABLES\n"
|
||||
"#\n"
|
||||
"# You can declare variables with:\n"
|
||||
"# var name = value\n"
|
||||
"#\n"
|
||||
"# You can use variables inside numeric expressions.\n"
|
||||
"# Example:\n"
|
||||
"# var hmetal = 0.48\n"
|
||||
"# 7/0: 0.5 0.5+hmetal*2 # 2x thick metal\n"
|
||||
"#\n"
|
||||
"# You cannot use variables inside layer specifications currently.\n"
|
||||
"#\n"
|
||||
"# CONDITIONALS\n"
|
||||
"#\n"
|
||||
"# You can enable or disable branches of the table using 'if', 'else', 'elseif' and 'end':\n"
|
||||
"# Example:\n"
|
||||
"# var thick_m1 = true\n"
|
||||
"# if thickm1\n"
|
||||
"# 1: 0.5 1.5\n"
|
||||
"# else\n"
|
||||
"# 1: 0.5 1.2\n"
|
||||
"# end\n"
|
||||
"\n"
|
||||
;
|
||||
}
|
||||
|
||||
D25TechnologyComponent::D25TechnologyComponent (const D25TechnologyComponent &d)
|
||||
: db::TechnologyComponent (d25_component_name (), d25_description ())
|
||||
{
|
||||
m_src = d.m_src;
|
||||
}
|
||||
|
||||
D25TechnologyComponent::layers_type
|
||||
D25TechnologyComponent::compile_from_source () const
|
||||
{
|
||||
layers_type layers;
|
||||
|
||||
int current_line = 0;
|
||||
|
||||
try {
|
||||
|
||||
tl::Eval eval;
|
||||
std::vector<bool> conditional_stack;
|
||||
|
||||
std::vector<std::string> lines = tl::split (m_src, "\n");
|
||||
for (std::vector<std::string>::const_iterator l = lines.begin (); l != lines.end (); ++l) {
|
||||
|
||||
++current_line;
|
||||
|
||||
tl::Extractor ex (l->c_str ());
|
||||
|
||||
if (ex.test ("#")) {
|
||||
// ignore comments
|
||||
} else if (ex.at_end ()) {
|
||||
// ignore empty lines
|
||||
|
||||
} else if (ex.test ("if")) {
|
||||
|
||||
tl::Expression x;
|
||||
eval.parse (x, ex);
|
||||
conditional_stack.push_back (x.execute ().to_bool ());
|
||||
|
||||
ex.expect_end ();
|
||||
|
||||
} else if (ex.test ("else")) {
|
||||
|
||||
if (conditional_stack.empty ()) {
|
||||
throw tl::Exception (tl::to_string (tr ("'else' without 'if'")));
|
||||
}
|
||||
|
||||
conditional_stack.back () = ! conditional_stack.back ();
|
||||
|
||||
ex.expect_end ();
|
||||
|
||||
} else if (ex.test ("end")) {
|
||||
|
||||
if (conditional_stack.empty ()) {
|
||||
throw tl::Exception (tl::to_string (tr ("'end' without 'if'")));
|
||||
}
|
||||
|
||||
conditional_stack.pop_back ();
|
||||
|
||||
ex.expect_end ();
|
||||
|
||||
} else if (ex.test ("elsif")) {
|
||||
|
||||
if (conditional_stack.empty ()) {
|
||||
throw tl::Exception (tl::to_string (tr ("'elsif' without 'if'")));
|
||||
}
|
||||
|
||||
tl::Expression x;
|
||||
eval.parse (x, ex);
|
||||
conditional_stack.back () = x.execute ().to_bool ();
|
||||
|
||||
ex.expect_end ();
|
||||
|
||||
} else if (! conditional_stack.empty () && ! conditional_stack.back ()) {
|
||||
|
||||
continue;
|
||||
|
||||
} else if (ex.test ("var")) {
|
||||
|
||||
std::string n;
|
||||
ex.read_name (n);
|
||||
|
||||
ex.expect ("=");
|
||||
|
||||
tl::Expression x;
|
||||
eval.parse (x, ex);
|
||||
eval.set_var (n, x.execute ());
|
||||
|
||||
ex.expect_end ();
|
||||
|
||||
} else if (ex.test ("print")) {
|
||||
|
||||
tl::Expression x;
|
||||
eval.parse (x, ex);
|
||||
ex.expect_end ();
|
||||
|
||||
tl::info << x.execute ().to_string ();
|
||||
|
||||
} else if (ex.test ("error")) {
|
||||
|
||||
tl::Expression x;
|
||||
eval.parse (x, ex);
|
||||
ex.expect_end ();
|
||||
|
||||
throw tl::Exception (x.execute ().to_string ());
|
||||
|
||||
} else {
|
||||
|
||||
db::D25LayerInfo info;
|
||||
if (! layers.empty ()) {
|
||||
info.set_zstart (layers.back ().zstop ());
|
||||
info.set_zstop (layers.back ().zstop ());
|
||||
}
|
||||
|
||||
tl::Variant z0, z1, h;
|
||||
std::vector<double> args;
|
||||
|
||||
db::LayerProperties lp;
|
||||
lp.read (ex);
|
||||
info.set_layer (lp);
|
||||
|
||||
ex.expect (":");
|
||||
|
||||
while (! ex.at_end ()) {
|
||||
|
||||
if (ex.test ("#")) {
|
||||
break;
|
||||
}
|
||||
|
||||
tl::Expression pvx;
|
||||
|
||||
std::string pn;
|
||||
if (ex.try_read_name (pn)) {
|
||||
ex.expect ("=");
|
||||
eval.parse (pvx, ex);
|
||||
} else {
|
||||
eval.parse (pvx, ex);
|
||||
}
|
||||
|
||||
double pv = pvx.execute ().to_double ();
|
||||
|
||||
ex.test (",");
|
||||
|
||||
if (pn.empty ()) {
|
||||
args.push_back (pv);
|
||||
} else if (pn == "zstart") {
|
||||
z0 = pv;
|
||||
} else if (pn == "zstop") {
|
||||
z1 = pv;
|
||||
} else if (pn == "height") {
|
||||
h = pv;
|
||||
} else {
|
||||
throw tl::Exception (tl::to_string (tr ("Invalid parameter name: ")) + pn);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (args.size () == 0) {
|
||||
if (z0.is_nil () && z1.is_nil ()) {
|
||||
if (! h.is_nil ()) {
|
||||
info.set_zstop (info.zstop () + h.to_double ());
|
||||
}
|
||||
} else if (z0.is_nil ()) {
|
||||
info.set_zstop (z1.to_double ());
|
||||
if (! h.is_nil ()) {
|
||||
info.set_zstart (info.zstop () - h.to_double ());
|
||||
}
|
||||
} else if (z1.is_nil ()) {
|
||||
info.set_zstart (z0.to_double ());
|
||||
if (! h.is_nil ()) {
|
||||
info.set_zstop (info.zstart () + h.to_double ());
|
||||
}
|
||||
} else {
|
||||
info.set_zstart (z0.to_double ());
|
||||
info.set_zstop (z1.to_double ());
|
||||
}
|
||||
} else if (args.size () == 1) {
|
||||
if (! h.is_nil ()) {
|
||||
if (! z0.is_nil ()) {
|
||||
throw tl::Exception (tl::to_string (tr ("Redundant parameters: zstart already given")));
|
||||
}
|
||||
if (! z1.is_nil ()) {
|
||||
throw tl::Exception (tl::to_string (tr ("Redundant parameters: zstop implicitly given")));
|
||||
}
|
||||
info.set_zstart (args[0]);
|
||||
info.set_zstop (args[0] + h.to_double ());
|
||||
} else {
|
||||
if (! z1.is_nil ()) {
|
||||
throw tl::Exception (tl::to_string (tr ("Redundant parameters: zstop implicitly given")));
|
||||
}
|
||||
info.set_zstop ((! z0.is_nil () ? z0.to_double () : info.zstart ()) + args[0]);
|
||||
}
|
||||
} else if (args.size () == 2) {
|
||||
if (! z0.is_nil ()) {
|
||||
throw tl::Exception (tl::to_string (tr ("Redundant parameters: zstart already given")));
|
||||
}
|
||||
if (! z1.is_nil ()) {
|
||||
throw tl::Exception (tl::to_string (tr ("Redundant parameters: zstop already given")));
|
||||
}
|
||||
if (! h.is_nil ()) {
|
||||
throw tl::Exception (tl::to_string (tr ("Redundant parameters: height implicitly given")));
|
||||
}
|
||||
info.set_zstart (args[0]);
|
||||
info.set_zstop (args[1]);
|
||||
} else {
|
||||
throw tl::Exception (tl::to_string (tr ("Too many parameters (max 2)")));
|
||||
}
|
||||
|
||||
layers.push_back (info);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (! conditional_stack.empty ()) {
|
||||
throw tl::Exception (tl::to_string (tr ("'if', 'else' or 'elsif' without matching 'end'")));
|
||||
}
|
||||
|
||||
} catch (tl::Exception &ex) {
|
||||
throw tl::Exception (ex.msg () + tl::sprintf (tl::to_string (tr (" in line %d")), current_line));
|
||||
}
|
||||
|
||||
return layers;
|
||||
}
|
||||
|
||||
std::string
|
||||
D25TechnologyComponent::to_string () const
|
||||
{
|
||||
layers_type layers = compile_from_source ();
|
||||
std::string res;
|
||||
|
||||
for (layers_type::const_iterator i = layers.begin (); i != layers.end (); ++i) {
|
||||
if (! res.empty ()) {
|
||||
res += "\n";
|
||||
}
|
||||
res += i->layer ().to_string () + ": zstart=" + tl::to_string (i->zstart ()) + ", zstop=" + tl::to_string (i->zstop ());
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
// D25TechnologyComponent technology component registration
|
||||
|
||||
class D25TechnologyComponentProvider
|
||||
: public db::TechnologyComponentProvider
|
||||
{
|
||||
public:
|
||||
D25TechnologyComponentProvider ()
|
||||
: db::TechnologyComponentProvider ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
virtual db::TechnologyComponent *create_component () const
|
||||
{
|
||||
return new D25TechnologyComponent ();
|
||||
}
|
||||
|
||||
virtual tl::XMLElementBase *xml_element () const
|
||||
{
|
||||
return new db::TechnologyComponentXMLElement<D25TechnologyComponent> (d25_component_name (),
|
||||
tl::make_member (&D25TechnologyComponent::src, &D25TechnologyComponent::set_src, "src")
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
static tl::RegisteredClass<db::TechnologyComponentProvider> tc_decl (new D25TechnologyComponentProvider (), 3100, d25_component_name ().c_str ());
|
||||
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HDR_dbD25TechnologyComponent
|
||||
#define HDR_dbD25TechnologyComponent
|
||||
|
||||
#include "dbTechnology.h"
|
||||
#include "dbLayerProperties.h"
|
||||
|
||||
namespace db
|
||||
{
|
||||
|
||||
class DB_PUBLIC D25LayerInfo
|
||||
{
|
||||
public:
|
||||
D25LayerInfo ();
|
||||
~D25LayerInfo ();
|
||||
D25LayerInfo (const D25LayerInfo &other);
|
||||
D25LayerInfo &operator= (const D25LayerInfo &other);
|
||||
|
||||
bool operator== (const D25LayerInfo &other) const;
|
||||
|
||||
const db::LayerProperties &layer () const
|
||||
{
|
||||
return m_layer;
|
||||
}
|
||||
|
||||
void set_layer_from_string (const std::string &l);
|
||||
std::string layer_as_string () const;
|
||||
|
||||
void set_layer (const db::LayerProperties &l);
|
||||
|
||||
double zstart () const
|
||||
{
|
||||
return m_zstart;
|
||||
}
|
||||
|
||||
void set_zstart (double z0);
|
||||
|
||||
double zstop () const
|
||||
{
|
||||
return m_zstop;
|
||||
}
|
||||
|
||||
void set_zstop (double z1);
|
||||
|
||||
private:
|
||||
db::LayerProperties m_layer;
|
||||
double m_zstart, m_zstop;
|
||||
};
|
||||
|
||||
class DB_PUBLIC D25TechnologyComponent
|
||||
: public db::TechnologyComponent
|
||||
{
|
||||
public:
|
||||
D25TechnologyComponent ();
|
||||
D25TechnologyComponent (const D25TechnologyComponent &d);
|
||||
|
||||
typedef std::list<D25LayerInfo> layers_type;
|
||||
|
||||
layers_type compile_from_source () const;
|
||||
|
||||
const std::string &src () const
|
||||
{
|
||||
return m_src;
|
||||
}
|
||||
|
||||
// for persistency only, use "compile_from_source" to read from a source string
|
||||
void set_src (const std::string &s)
|
||||
{
|
||||
m_src = s;
|
||||
}
|
||||
|
||||
std::string to_string () const;
|
||||
|
||||
db::TechnologyComponent *clone () const
|
||||
{
|
||||
return new D25TechnologyComponent (*this);
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_src;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2021 Matthias Koefferlein
|
||||
Copyright (C) 2006-2022 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user