mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-01 18:37:50 +02:00
Merge pull request #1451 from KLayout/issue-1307-partial
Fixed part of issue #1307: using pin names for the pin labels in DEF …
This commit is contained in:
@@ -1153,8 +1153,7 @@ DEFImporter::read_pins (db::Layout &layout, db::Cell &design, double scale)
|
||||
{
|
||||
while (test ("-")) {
|
||||
|
||||
take (); // pin name
|
||||
|
||||
std::string pin_name = get ();
|
||||
std::string net;
|
||||
std::string dir;
|
||||
std::map <std::pair<std::string, unsigned int>, std::vector <db::Polygon> > geometry;
|
||||
@@ -1281,7 +1280,7 @@ DEFImporter::read_pins (db::Layout &layout, db::Cell &design, double scale)
|
||||
if (flush || ! peek ("+")) {
|
||||
|
||||
// TODO: put a label on every single object?
|
||||
std::string label = net;
|
||||
std::string label = pin_name;
|
||||
/* don't add the direction currently, a name is sufficient
|
||||
if (! dir.empty ()) {
|
||||
label += ":";
|
||||
@@ -1296,9 +1295,14 @@ DEFImporter::read_pins (db::Layout &layout, db::Cell &design, double scale)
|
||||
if (! dl.empty ()) {
|
||||
|
||||
db::properties_id_type prop_id = 0;
|
||||
if (produce_pin_props ()) {
|
||||
if (produce_pin_props () || produce_net_props ()) {
|
||||
db::PropertiesRepository::properties_set props;
|
||||
props.insert (std::make_pair (pin_prop_name_id (), tl::Variant (label)));
|
||||
if (produce_pin_props ()) {
|
||||
props.insert (std::make_pair (pin_prop_name_id (), tl::Variant (label)));
|
||||
}
|
||||
if (produce_net_props ()) {
|
||||
props.insert (std::make_pair (net_prop_name_id (), tl::Variant (net)));
|
||||
}
|
||||
prop_id = layout.properties_repository ().properties_id (props);
|
||||
}
|
||||
|
||||
|
||||
@@ -326,26 +326,26 @@ TEST(lef8)
|
||||
|
||||
TEST(def1)
|
||||
{
|
||||
run_test (_this, "def1", "lef:in.lef+def:in.def", "au2.oas.gz", default_options ());
|
||||
run_test (_this, "def1", "lef:in.lef+def:in.def", "au2_2.oas.gz", default_options ());
|
||||
}
|
||||
|
||||
TEST(def2)
|
||||
{
|
||||
db::LEFDEFReaderOptions options = default_options ();
|
||||
options.set_cell_outline_layer ("OUTLINE (10/0)");
|
||||
run_test (_this, "def2", "lef:0.lef+lef:1.lef+def:in.def.gz", "au.oas.gz", options);
|
||||
run_test (_this, "def2", "lef:0.lef+lef:1.lef+def:in.def.gz", "au_2.oas.gz", options);
|
||||
}
|
||||
|
||||
TEST(def3)
|
||||
{
|
||||
db::LEFDEFReaderOptions options = default_options ();
|
||||
options.set_cell_outline_layer ("OUTLINE (13/0)");
|
||||
run_test (_this, "def3", "lef:in.lef+def:in.def", "au.oas.gz", options);
|
||||
run_test (_this, "def3", "lef:in.lef+def:in.def", "au_2.oas.gz", options);
|
||||
}
|
||||
|
||||
TEST(def4)
|
||||
{
|
||||
run_test (_this, "def4", "lef:in.lef+def:in.def", "au2.oas.gz", default_options ());
|
||||
run_test (_this, "def4", "lef:in.lef+def:in.def", "au2_2.oas.gz", default_options ());
|
||||
}
|
||||
|
||||
TEST(def5)
|
||||
@@ -355,17 +355,17 @@ TEST(def5)
|
||||
|
||||
TEST(def6)
|
||||
{
|
||||
run_test (_this, "def6", "lef:cells.lef+lef:tech.lef+def:in.def.gz", "au-new.oas.gz", default_options ());
|
||||
run_test (_this, "def6", "lef:cells.lef+lef:tech.lef+def:in.def.gz", "au-new_2.oas.gz", default_options ());
|
||||
}
|
||||
|
||||
TEST(def7)
|
||||
{
|
||||
db::LEFDEFReaderOptions options = default_options ();
|
||||
options.set_placement_blockage_layer ("PLACEMENT_BLK (11/0)");
|
||||
run_test (_this, "def7", "lef:cells.lef+lef:tech.lef+def:in.def.gz", "au-new.oas.gz", options);
|
||||
run_test (_this, "def7", "lef:cells.lef+lef:tech.lef+def:in.def.gz", "au-new_2.oas.gz", options);
|
||||
|
||||
options.set_placement_blockage_layer ("PLACEMENT_BLK (60/0)");
|
||||
run_test (_this, "def7", "map:in.map+lef:cells.lef+lef:tech.lef+def:in.def.gz", "au2_with_map_file-new.oas.gz", options);
|
||||
run_test (_this, "def7", "map:in.map+lef:cells.lef+lef:tech.lef+def:in.def.gz", "au2_with_map_file-new_2.oas.gz", options);
|
||||
}
|
||||
|
||||
TEST(def8)
|
||||
@@ -377,9 +377,9 @@ TEST(def9)
|
||||
{
|
||||
db::LEFDEFReaderOptions options = default_options ();
|
||||
options.set_separate_groups (true);
|
||||
run_test (_this, "def9", "lef:tech.lef+lef:cells_modified.lef+def:in.def", "au-new.oas.gz", options);
|
||||
run_test (_this, "def9", "lef:tech.lef+lef:cells_modified.lef+def:in.def", "au-new_2.oas.gz", options);
|
||||
|
||||
run_test (_this, "def9", "lef:tech.lef+lef:cells_modified.lef+def:in.def", "au_nogroups-new.oas.gz", default_options ());
|
||||
run_test (_this, "def9", "lef:tech.lef+lef:cells_modified.lef+def:in.def", "au_nogroups-new_2.oas.gz", default_options ());
|
||||
}
|
||||
|
||||
TEST(def10)
|
||||
@@ -413,7 +413,7 @@ TEST(def14)
|
||||
{
|
||||
db::LEFDEFReaderOptions opt = default_options ();
|
||||
opt.set_macro_resolution_mode (1);
|
||||
run_test (_this, "def14", "map:test.map+lef:tech.lef+lef:stdlib.lef+def:test.def", "au.oas.gz", opt);
|
||||
run_test (_this, "def14", "map:test.map+lef:tech.lef+lef:stdlib.lef+def:test.def", "au_2.oas.gz", opt);
|
||||
}
|
||||
|
||||
TEST(def15)
|
||||
@@ -429,7 +429,7 @@ TEST(def16)
|
||||
// (complete example)
|
||||
db::LEFDEFReaderOptions opt = default_options ();
|
||||
opt.set_macro_resolution_mode (1);
|
||||
run_test (_this, "def16", "lef:a.lef+lef:tech.lef+def:a.def", "au.oas.gz", opt);
|
||||
run_test (_this, "def16", "lef:a.lef+lef:tech.lef+def:a.def", "au_2.oas.gz", opt);
|
||||
}
|
||||
|
||||
TEST(100)
|
||||
@@ -886,6 +886,15 @@ TEST(131_patternname)
|
||||
run_test (_this, "patternname", "map:v.map+lef:v.lef+def:v.def", "au.oas.gz", default_options (), false);
|
||||
}
|
||||
|
||||
TEST(132_issue1307_pin_names)
|
||||
{
|
||||
db::LEFDEFReaderOptions opt = default_options ();
|
||||
opt.set_produce_pin_names (true);
|
||||
opt.set_pin_property_name (2);
|
||||
opt.set_cell_outline_layer ("OUTLINE (13/0)");
|
||||
run_test (_this, "issue-1307c", "lef:in.lef+def:in.def", "au.oas", opt, false);
|
||||
}
|
||||
|
||||
TEST(200_lefdef_plugin)
|
||||
{
|
||||
db::Layout ly;
|
||||
|
||||
Reference in New Issue
Block a user