Merge pull request #2084 from KLayout/feature/issue-2044

Feature/issue 2044
This commit is contained in:
Matthias Köfferlein
2025-07-19 18:57:10 +02:00
committed by GitHub
29 changed files with 365 additions and 21 deletions
@@ -836,6 +836,7 @@ CIFReader::do_read (db::Layout &layout)
db::LayoutLocker locker (&layout);
double sf = 0.01 / m_dbu;
check_dbu (m_dbu);
layout.dbu (m_dbu);
m_cellname = "{CIF top level}";
@@ -350,6 +350,7 @@ DXFReader::read (db::Layout &layout, const db::LoadLayoutOptions &options)
db::cell_index_type top = layout.add_cell("TOP"); // TODO: make variable ..
check_dbu (m_dbu);
layout.dbu (m_dbu);
do_read (layout, top);
cleanup (layout, top);
@@ -236,6 +236,7 @@ GDS2ReaderBase::do_read (db::Layout &layout)
m_dbuu = dbuu;
m_dbu = dbum * 1e6; /*in micron*/
check_dbu (m_dbu);
layout.dbu (m_dbu);
} else {
@@ -119,6 +119,7 @@ LEFDEFReader::read_lefdef (db::Layout &layout, const db::LoadLayoutOptions &opti
effective_options = *lefdef_options;
}
check_dbu (effective_options.dbu ());
layout.dbu (effective_options.dbu ());
std::string base_path;
@@ -98,6 +98,7 @@ MAGReader::read (db::Layout &layout, const db::LoadLayoutOptions &options)
top_cell = layout.add_cell (top_cellname.c_str ());
}
check_dbu (m_dbu);
layout.dbu (m_dbu);
m_cells_to_read.clear ();
@@ -51,7 +51,6 @@ namespace db
MALYReader::MALYReader (tl::InputStream &s)
: m_stream (s),
m_progress (tl::to_string (tr ("Reading MALY file")), 1000),
m_dbu (0.001),
m_last_record_line (0)
{
m_progress.set_format (tl::to_string (tr ("%.0fk lines")));
@@ -89,7 +88,10 @@ MALYReader::read (db::Layout &layout, const db::LoadLayoutOptions &options)
init (options);
const db::MALYReaderOptions &specific_options = options.get_options<db::MALYReaderOptions> ();
m_dbu = specific_options.dbu;
double dbu = specific_options.dbu;
check_dbu (dbu);
layout.dbu (dbu);
set_layer_map (specific_options.layer_map);
set_create_layers (specific_options.create_other_layers);
@@ -223,7 +223,6 @@ private:
tl::TextInputStream m_stream;
tl::AbsoluteProgress m_progress;
double m_dbu;
unsigned int m_last_record_line;
std::string m_record;
std::string m_record_returned;
@@ -135,6 +135,7 @@ TEST(10_BasicLayout)
{
run_test (_this, tl::testdata (), "MALY_test10.maly", "maly_test10_au.oas");
run_test (_this, tl::testdata (), "MALY_test10.maly", "maly_test10_lm_au.oas", "A: 10, B: 11, C: 12, D: 13");
run_test (_this, tl::testdata (), "MALY_test10.maly", "maly_test10_dbu10nm_au.oas", 0, 0.01);
}
TEST(11_Titles)
@@ -623,7 +623,9 @@ OASISReader::do_read (db::Layout &layout)
}
// compute database unit in pixel per meter
layout.dbu (1.0 / res);
double dbu = 1.0 / res;
check_dbu (dbu);
layout.dbu (dbu);
// read over table offsets if required
bool table_offsets_at_end = get_uint64 () != 0;
@@ -1142,6 +1142,8 @@ public:
db::GerberImporter importer (warn_level ());
data.setup_importer (&importer);
check_dbu (data.dbu);
importer.read (layout);
std::string lyr_file = data.get_layer_properties_file ();