Bug fixes, new test data

This commit is contained in:
Matthias Koefferlein 2026-02-27 17:29:31 +01:00
parent d24697a5e3
commit 6e161d938f
59 changed files with 60 additions and 82 deletions

View File

@ -1353,7 +1353,7 @@ PrintingDifferenceReceiver::print_cell_inst (const db::CellInstArrayWithProperti
enough (tl::info) << "" << tl::noendl;
}
if (ci.properties_id () != 0) {
enough (tl::info) << " [" << ci.properties_id () << "]";
enough (tl::info) << " " << db::properties (ci.properties_id ()).to_dict_var ().to_string ();
} else {
enough (tl::info) << "";
}
@ -1374,7 +1374,7 @@ PrintingDifferenceReceiver::print_cell_inst (const db::CellInstArrayWithProperti
enough (tl::info) << "" << tl::noendl;
}
if (ci.properties_id () != 0) {
enough (tl::info) << " [" << ci.properties_id () << "]";
enough (tl::info) << " " << db::properties (ci.properties_id ()).to_dict_var ().to_string ();
} else {
enough (tl::info) << "";
}

View File

@ -238,22 +238,22 @@ static void run_test2 (tl::TestBase *_this, const std::string &base, db::Layout
TEST(1a)
{
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1a_au.gds.gz");
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1a_au2.gds.gz");
}
TEST(1b)
{
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1b_au.gds.gz", 0, 0.01);
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1b_au2.gds.gz", 0, 0.01);
}
TEST(1c)
{
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1b_au.gds.gz", 0, 0.01, true);
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1b_au2.gds.gz", 0, 0.01, true);
}
TEST(1d)
{
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1b_au.gds.gz", 0, 0.01, false, true);
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1b_au2.gds.gz", 0, 0.01, false, true);
}
TEST(2)
@ -263,17 +263,17 @@ TEST(2)
TEST(3a)
{
run_test (_this, tl::testdata_private (), "t3.cif.gz", "t3a_au.gds.gz", "CAA:43,CCA:48,CCP:47,CMF:49,CMS:51,CPG:46,CSN:45,CSP:44,CVA:50,CWN:42,XP:26");
run_test (_this, tl::testdata_private (), "t3.cif.gz", "t3a_au2.gds.gz", "CAA:43,CCA:48,CCP:47,CMF:49,CMS:51,CPG:46,CSN:45,CSP:44,CVA:50,CWN:42,XP:26");
}
TEST(3b)
{
run_test (_this, tl::testdata_private (), "t3.cif.gz", "t3b_au.gds.gz", "CAA:43,CCA:48,CCP:47,CMF:49,CMS:51,CPG:46,CSN:45,CSP:44,CVA:50,CWN:42,XP:26", 0.00012);
run_test (_this, tl::testdata_private (), "t3.cif.gz", "t3b_au2.gds.gz", "CAA:43,CCA:48,CCP:47,CMF:49,CMS:51,CPG:46,CSN:45,CSP:44,CVA:50,CWN:42,XP:26", 0.00012);
}
TEST(3c)
{
run_test (_this, tl::testdata_private (), "t3.cif.gz", "t3c_au.gds.gz", "(CPG:1/0) +(CPG:1000/0) (CCP:1/0) (CMF:2/0) +(CMF:1000/0) (CVA:3/0)", 0.00012);
run_test (_this, tl::testdata_private (), "t3.cif.gz", "t3c_au2.gds.gz", "(CPG:1/0) +(CPG:1000/0) (CCP:1/0) (CMF:2/0) +(CMF:1000/0) (CVA:3/0)", 0.00012);
}
TEST(4)

View File

@ -117,7 +117,7 @@ TEST(4)
db::DXFReaderOptions opt;
opt.layer_map = string2lm ("Metal:1,Metal2:5");
opt.create_other_layers = true;
run_test (_this, "t4.dxf.gz", "t4_au.gds.gz", opt);
run_test (_this, "t4.dxf.gz", "t4_au_2.gds.gz", opt);
}
TEST(5)
@ -127,7 +127,7 @@ TEST(5)
TEST(6)
{
run_test (_this, "t6.dxf.gz", "t6_au.gds.gz");
run_test (_this, "t6.dxf.gz", "t6_au_2.gds.gz");
}
TEST(7)
@ -140,7 +140,7 @@ TEST(8)
db::DXFReaderOptions opt;
opt.layer_map = string2lm ("Metal:4,Kommentare:3,Bemassung:2");
opt.create_other_layers = true;
run_test (_this, "t8.dxf.gz", "t8_au.gds.gz", opt);
run_test (_this, "t8.dxf.gz", "t8_au_2.gds.gz", opt);
}
TEST(9)
@ -148,7 +148,7 @@ TEST(9)
db::DXFReaderOptions opt;
opt.layer_map = string2lm ("Bemassung:2,Metal:5,Kommentare:4");
opt.create_other_layers = true;
run_test (_this, "t9.dxf.gz", "t9_au.gds.gz", opt);
run_test (_this, "t9.dxf.gz", "t9_au_2.gds.gz", opt);
}
TEST(10)
@ -156,7 +156,7 @@ TEST(10)
db::DXFReaderOptions opt;
opt.layer_map = string2lm ("METAL:1,KOMMENTARE:4");
opt.create_other_layers = true;
run_test (_this, "t10.dxf.gz", "t10_au.gds.gz", opt);
run_test (_this, "t10.dxf.gz", "t10_au_2.gds.gz", opt);
}
TEST(11)
@ -166,7 +166,7 @@ TEST(11)
TEST(12)
{
run_test (_this, "t12.dxf.gz", "t12_au.gds.gz");
run_test (_this, "t12.dxf.gz", "t12_au_2.gds.gz");
}
TEST(14)
@ -174,7 +174,7 @@ TEST(14)
db::DXFReaderOptions opt;
opt.layer_map = string2lm ("'A11-STRUKTUR__E_TYP_':10,A21_NITRID:11,'B11-KONTAKT':9,'B11-STRUKTUR':3,HELLFELD:7,MASKE:5,NORM_MIN_MAX_WAFER:6,RASTER:2,_BEGRENZUNG_A11_A21_A31_B1:8");
opt.create_other_layers = true;
run_test (_this, "t14.dxf.gz", "t14_au.gds.gz", opt);
run_test (_this, "t14.dxf.gz", "t14_au_2.gds.gz", opt);
}
TEST(15)
@ -182,7 +182,7 @@ TEST(15)
db::DXFReaderOptions opt;
opt.layer_map = string2lm ("TEXT:4,IGBT:5,Wire:7,Ceramic:11,LAYER_1:14,Diode:18,'DBC TOP Plate':19,'Terminal Position':20");
opt.create_other_layers = true;
run_test (_this, "t15.dxf.gz", "t15_au2_2.gds.gz", opt);
run_test (_this, "t15.dxf.gz", "t15_au2_3.gds.gz", opt);
}
TEST(16)
@ -190,7 +190,7 @@ TEST(16)
db::DXFReaderOptions opt;
opt.layer_map = string2lm ("TEXT:4,IGBT:5,Wire:7,Ceramic:11,LAYER_1:14,Diode:18,'DBC TOP Plate':19,'Terminal Position':20");
opt.create_other_layers = true;
run_test (_this, "t16.dxf.gz", "t16_au2_2.gds.gz", opt);
run_test (_this, "t16.dxf.gz", "t16_au2_3.gds.gz", opt);
}
TEST(17)
@ -198,32 +198,32 @@ TEST(17)
db::DXFReaderOptions opt;
opt.layer_map = string2lm ("TEXT:4,IGBT:5,Wire:7,Ceramic:11,LAYER_1:14,Diode:18,'DBC TOP Plate':19,'Terminal Position':20");
opt.create_other_layers = true;
run_test (_this, "t17.dxf.gz", "t17_au2_2.gds.gz", opt);
run_test (_this, "t17.dxf.gz", "t17_au2_3.gds.gz", opt);
}
TEST(18)
{
run_test (_this, "t18.dxf.gz", "t18_au.gds.gz");
run_test (_this, "t18.dxf.gz", "t18_au_2.gds.gz");
}
TEST(19)
{
run_test (_this, "t19.dxf.gz", "t19_au.gds.gz");
run_test (_this, "t19.dxf.gz", "t19_au_2.gds.gz");
}
TEST(20)
{
run_test (_this, "t20.dxf.gz", "t20_au.gds.gz");
run_test (_this, "t20.dxf.gz", "t20_au_2.gds.gz");
}
TEST(21)
{
run_test (_this, "t21.dxf.gz", "t21_au.gds.gz");
run_test (_this, "t21.dxf.gz", "t21_au_2.gds.gz");
}
TEST(22)
{
run_test (_this, "t22.dxf.gz", "t22_au.gds.gz");
run_test (_this, "t22.dxf.gz", "t22_au_2.gds.gz");
}
TEST(23a)
@ -233,7 +233,7 @@ TEST(23a)
opt.unit = 1;
opt.polyline_mode = 0;
opt.circle_points = 10;
run_test (_this, "t23.dxf.gz", "t23a_au.gds.gz", opt);
run_test (_this, "t23.dxf.gz", "t23a_au_2.gds.gz", opt);
}
TEST(23b)
@ -243,7 +243,7 @@ TEST(23b)
opt.unit = 1;
opt.polyline_mode = 1;
opt.circle_points = 10;
run_test (_this, "t23.dxf.gz", "t23b_au.gds.gz", opt);
run_test (_this, "t23.dxf.gz", "t23b_au_2.gds.gz", opt);
}
TEST(23c)
@ -253,7 +253,7 @@ TEST(23c)
opt.unit = 1;
opt.polyline_mode = 2;
opt.circle_points = 10;
run_test (_this, "t23.dxf.gz", "t23c_au.gds.gz", opt);
run_test (_this, "t23.dxf.gz", "t23c_au_2.gds.gz", opt);
}
TEST(23d)
@ -263,7 +263,7 @@ TEST(23d)
opt.unit = 1;
opt.polyline_mode = 3;
opt.circle_points = 10;
run_test (_this, "t23.dxf.gz", "t23d_au.gds.gz", opt);
run_test (_this, "t23.dxf.gz", "t23d_au_2.gds.gz", opt);
}
TEST(23e)
@ -273,7 +273,7 @@ TEST(23e)
opt.unit = 1;
opt.polyline_mode = 4;
opt.circle_points = 10;
run_test (_this, "t23.dxf.gz", "t23e_au.gds.gz", opt);
run_test (_this, "t23.dxf.gz", "t23e_au_2.gds.gz", opt);
}
TEST(26a)
@ -283,7 +283,7 @@ TEST(26a)
opt.unit = 1;
opt.polyline_mode = 0;
opt.circle_points = 100;
run_test (_this, "t26.dxf.gz", "t26a_au.gds.gz", opt);
run_test (_this, "t26.dxf.gz", "t26a_au_2.gds.gz", opt);
}
TEST(26b)
@ -293,7 +293,7 @@ TEST(26b)
opt.unit = 1;
opt.polyline_mode = 1;
opt.circle_points = 100;
run_test (_this, "t26.dxf.gz", "t26b_au.gds.gz", opt);
run_test (_this, "t26.dxf.gz", "t26b_au_2.gds.gz", opt);
}
TEST(26c)
@ -303,7 +303,7 @@ TEST(26c)
opt.unit = 1;
opt.polyline_mode = 2;
opt.circle_points = 100;
run_test (_this, "t26.dxf.gz", "t26c_au.gds.gz", opt);
run_test (_this, "t26.dxf.gz", "t26c_au_2.gds.gz", opt);
}
TEST(26d)
@ -313,7 +313,7 @@ TEST(26d)
opt.unit = 1;
opt.polyline_mode = 3;
opt.circle_points = 100;
run_test (_this, "t26.dxf.gz", "t26d_au.gds.gz", opt);
run_test (_this, "t26.dxf.gz", "t26d_au_2.gds.gz", opt);
}
TEST(26e)
@ -323,7 +323,7 @@ TEST(26e)
opt.unit = 1;
opt.polyline_mode = 4;
opt.circle_points = 100;
run_test (_this, "t26.dxf.gz", "t26e_au.gds.gz", opt);
run_test (_this, "t26.dxf.gz", "t26e_au_2.gds.gz", opt);
}
TEST(27a)
@ -438,7 +438,7 @@ TEST(30)
opt.polyline_mode = 4;
opt.circle_points = 1000;
opt.circle_accuracy = 0.001;
run_test (_this, "t30.dxf.gz", "t30d_au.gds.gz", opt);
run_test (_this, "t30.dxf.gz", "t30d_au_2.gds.gz", opt);
}
// accuracy
@ -449,16 +449,16 @@ TEST(31)
opt.unit = 1000;
opt.contour_accuracy = 0;
run_test (_this, "t31.dxf.gz", "t31a_au.gds.gz", opt);
run_test (_this, "t31.dxf.gz", "t31a_au_2.gds.gz", opt);
opt.contour_accuracy = 0.005;
run_test (_this, "t31.dxf.gz", "t31b_au.gds.gz", opt);
run_test (_this, "t31.dxf.gz", "t31b_au_2.gds.gz", opt);
opt.contour_accuracy = 0.01;
run_test (_this, "t31.dxf.gz", "t31c_au.gds.gz", opt);
run_test (_this, "t31.dxf.gz", "t31c_au_2.gds.gz", opt);
opt.contour_accuracy = 0.02;
run_test (_this, "t31.dxf.gz", "t31d_au.gds.gz", opt);
run_test (_this, "t31.dxf.gz", "t31d_au_2.gds.gz", opt);
}
// issue #198
@ -491,20 +491,20 @@ TEST(33)
db::DXFReaderOptions opt;
opt.polyline_mode = 3;
run_test (_this, "t33.dxf.gz", "t33a_au.gds.gz", opt);
run_test (_this, "t33.dxf.gz", "t33a_au_2.gds.gz", opt);
opt.circle_accuracy = 1.0;
run_test (_this, "t33.dxf.gz", "t33b_au.gds.gz", opt);
run_test (_this, "t33.dxf.gz", "t33b_au_2.gds.gz", opt);
opt.circle_accuracy = 50.0;
run_test (_this, "t33.dxf.gz", "t33c_au.gds.gz", opt);
run_test (_this, "t33.dxf.gz", "t33c_au_2.gds.gz", opt);
opt.circle_accuracy = 0.0;
opt.polyline_mode = 4;
run_test (_this, "t33.dxf.gz", "t33d_au.gds.gz", opt);
run_test (_this, "t33.dxf.gz", "t33d_au_2.gds.gz", opt);
opt.polyline_mode = 2;
run_test (_this, "t33.dxf.gz", "t33e_au.gds.gz", opt);
run_test (_this, "t33.dxf.gz", "t33e_au_2.gds.gz", opt);
}
// issue #1173

View File

@ -496,11 +496,10 @@ GDS2WriterBase::build_property_translations (const db::Layout &layout, const std
for (auto l = layers.begin (); l != layers.end (); ++l) {
const db::Shapes &shapes = cell.shapes (l->first);
for (auto s = shapes.begin (db::ShapeIterator::AllWithProperties); ! s.at_end (); ++s) {
for (auto s = shapes.begin (db::ShapeIterator::AllWithProperties); ! s.at_end (); s.finish_array ()) {
if (s->prop_id () != 0) {
prop_ids.insert (s->prop_id ());
}
s.finish_array ();
}
}
@ -1367,39 +1366,5 @@ GDS2WriterBase::write_string_record (short record, const std::string &t)
write_string (t);
}
void
GDS2WriterBase::collect_property_ids (std::set<db::properties_id_type> &property_ids, const db::Layout &layout, const std::vector<cell_index_type> &cells, const std::vector <std::pair <unsigned int, db::LayerProperties> > &layers)
{
if (layout.prop_id () != 0) {
property_ids.insert (layout.prop_id ());
}
for (auto cell = cells.begin (); cell != cells.end (); ++cell) {
const db::Cell &cref (layout.cell (*cell));
if (cref.prop_id () != 0) {
property_ids.insert (cref.prop_id ());
}
for (db::Cell::const_iterator inst = cref.begin (); ! inst.at_end (); ++inst) {
if (inst->has_prop_id () && inst->prop_id () != 0) {
property_ids.insert (inst->prop_id ());
}
}
for (auto l = layers.begin (); l != layers.end (); ++l) {
db::ShapeIterator shape (cref.shapes (l->first).begin (db::ShapeIterator::Properties | db::ShapeIterator::Boxes | db::ShapeIterator::Polygons | db::ShapeIterator::Edges | db::ShapeIterator::Paths | db::ShapeIterator::Texts));
while (! shape.at_end ()) {
if (shape->has_prop_id () && shape->prop_id () != 0) {
property_ids.insert (shape->prop_id ());
}
shape.finish_array ();
}
}
}
}
} // namespace db

View File

@ -187,7 +187,6 @@ private:
void write_cell (db::Layout &layout, const db::Cell &cref, const std::vector <std::pair <unsigned int, db::LayerProperties> > &layers,
const std::set <db::cell_index_type> &cell_set, double sf, short *time_data);
void write_shape (const db::Layout &layout, int layer, int datatype, const db::Shape &shape, double sf);
void collect_property_ids (std::set<db::properties_id_type> &property_ids, const db::Layout &layout, const std::vector<cell_index_type> &cells, const std::vector <std::pair <unsigned int, db::LayerProperties> > &layers);
void build_property_translations (const db::Layout &layout, const std::vector <std::pair <unsigned int, db::LayerProperties> > &layers, const std::vector <db::cell_index_type> &cells, const db::GDS2WriterOptions &gds2_options);
void get_property_map_context (std::vector <std::string> &context_strings);
};

View File

@ -3947,15 +3947,29 @@ Eval::eval_atomic (ExpressionParserContext &ex, std::unique_ptr<ExpressionNode>
}
if (dbu_units) {
// round to integers and check whether that is possible
double gg = g;
g = floor (0.5 + g);
if (fabs (g) < 1e12 && fabs (g - gg) > 1e-3) {
throw EvalError (tl::to_string (tr ("Value is not a multiple of the database unit")), ex1);
}
n.reset (new ConstantExpressionNode (ex1, tl::Variant (g)));
} else {
tl::Variant v (g);
// prefer integers
if (g - floor (g) == 0.0 && v.can_convert_to_long ()) {
n.reset (new ConstantExpressionNode (ex1, tl::Variant (v.to_long ())));
} else {
n.reset (new ConstantExpressionNode (ex1, v));
}
}
n.reset (new ConstantExpressionNode (ex1, tl::Variant (g)));
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.