Issue #489 (Pin names as shape properties) (#507)

* Fixed #489 (LEF/DEF reader provides pin names as properties)

* Removed vi swap file

* #489 fixed (LEF pins also get properties, added tests)
This commit is contained in:
Matthias Köfferlein
2020-02-23 00:29:12 +01:00
committed by GitHub
parent e99d3a1893
commit 1992fc762a
17 changed files with 788 additions and 289 deletions
@@ -1136,10 +1136,23 @@ DEFImporter::do_read (db::Layout &layout)
std::pair <bool, unsigned int> dl = open_layer (layout, g->first, Pins);
if (dl.first) {
db::properties_id_type prop_id = 0;
if (produce_pin_props ()) {
db::PropertiesRepository::properties_set props;
props.insert (std::make_pair (pin_prop_name_id (), tl::Variant (label)));
prop_id = layout.properties_repository ().properties_id (props);
}
for (std::vector<db::Polygon>::const_iterator p = g->second.begin (); p != g->second.end (); ++p) {
db::Polygon pt = p->transformed (trans);
design.shapes (dl.second).insert (pt);
if (prop_id == 0) {
design.shapes (dl.second).insert (pt);
} else {
design.shapes (dl.second).insert (db::PolygonWithProperties (pt, prop_id));
}
}
}
dl = open_layer (layout, g->first, Label);
@@ -41,6 +41,8 @@ LEFDEFReaderOptions::LEFDEFReaderOptions ()
m_net_property_name (1),
m_produce_inst_names (true),
m_inst_property_name (1),
m_produce_pin_names (false),
m_pin_property_name (1),
m_produce_cell_outlines (true),
m_cell_outline_layer ("OUTLINE"),
m_produce_placement_blockages (true),
@@ -77,6 +79,8 @@ LEFDEFReaderOptions::LEFDEFReaderOptions (const LEFDEFReaderOptions &d)
m_net_property_name (d.m_net_property_name),
m_produce_inst_names (d.m_produce_inst_names),
m_inst_property_name (d.m_inst_property_name),
m_produce_pin_names (d.m_produce_pin_names),
m_pin_property_name (d.m_pin_property_name),
m_produce_cell_outlines (d.m_produce_cell_outlines),
m_cell_outline_layer (d.m_cell_outline_layer),
m_produce_placement_blockages (d.m_produce_placement_blockages),
@@ -357,7 +361,8 @@ LEFDEFLayerDelegate::finish (db::Layout &layout)
LEFDEFImporter::LEFDEFImporter ()
: mp_progress (0), mp_stream (0), mp_layer_delegate (0),
m_produce_net_props (false), m_net_prop_name_id (0),
m_produce_inst_props (false), m_inst_prop_name_id (0)
m_produce_inst_props (false), m_inst_prop_name_id (0),
m_produce_pin_props (false), m_pin_prop_name_id (0)
{
// .. nothing yet ..
}
@@ -393,6 +398,14 @@ LEFDEFImporter::read (tl::InputStream &stream, db::Layout &layout, LEFDEFLayerDe
m_inst_prop_name_id = layout.properties_repository ().prop_name_id (ld.tech_comp ()->inst_property_name ());
}
m_produce_pin_props = false;
m_pin_prop_name_id = 0;
if (ld.tech_comp () && ld.tech_comp ()->produce_pin_names ()) {
m_produce_pin_props = true;
m_pin_prop_name_id = layout.properties_repository ().prop_name_id (ld.tech_comp ()->pin_property_name ());
}
try {
mp_progress = &progress;
@@ -145,6 +145,26 @@ public:
m_inst_property_name = s;
}
bool produce_pin_names () const
{
return m_produce_pin_names;
}
void set_produce_pin_names (bool f)
{
m_produce_pin_names = f;
}
const tl::Variant &pin_property_name () const
{
return m_pin_property_name;
}
void set_pin_property_name (const tl::Variant &s)
{
m_pin_property_name = s;
}
bool produce_cell_outlines () const
{
return m_produce_cell_outlines;
@@ -423,6 +443,8 @@ private:
tl::Variant m_net_property_name;
bool m_produce_inst_names;
tl::Variant m_inst_property_name;
bool m_produce_pin_names;
tl::Variant m_pin_property_name;
bool m_produce_cell_outlines;
std::string m_cell_outline_layer;
bool m_produce_placement_blockages;
@@ -696,6 +718,22 @@ protected:
return m_inst_prop_name_id;
}
/**
* @brief Gets a flag indicating whether pinance names shall be produced as properties
*/
bool produce_pin_props () const
{
return m_produce_pin_props;
}
/**
* @brief Gets the property name id of the pinance name property
*/
db::property_names_id_type pin_prop_name_id () const
{
return m_pin_prop_name_id;
}
protected:
void create_generated_via (std::vector<db::Polygon> &bottom,
std::vector<db::Polygon> &cut,
@@ -719,6 +757,8 @@ private:
db::property_names_id_type m_net_prop_name_id;
bool m_produce_inst_props;
db::property_names_id_type m_inst_prop_name_id;
bool m_produce_pin_props;
db::property_names_id_type m_pin_prop_name_id;
const std::string &next ();
};
@@ -239,6 +239,8 @@ class LEFDEFFormatDeclaration
tl::make_member (&LEFDEFReaderOptions::net_property_name, &LEFDEFReaderOptions::set_net_property_name, "net-property-name") +
tl::make_member (&LEFDEFReaderOptions::produce_inst_names, &LEFDEFReaderOptions::set_produce_inst_names, "produce-inst-names") +
tl::make_member (&LEFDEFReaderOptions::inst_property_name, &LEFDEFReaderOptions::set_inst_property_name, "inst-property-name") +
tl::make_member (&LEFDEFReaderOptions::produce_pin_names, &LEFDEFReaderOptions::set_produce_pin_names, "produce-pin-names") +
tl::make_member (&LEFDEFReaderOptions::pin_property_name, &LEFDEFReaderOptions::set_pin_property_name, "pin-property-name") +
tl::make_member (&LEFDEFReaderOptions::produce_cell_outlines, &LEFDEFReaderOptions::set_produce_cell_outlines, "produce-cell-outlines") +
tl::make_member (&LEFDEFReaderOptions::cell_outline_layer, &LEFDEFReaderOptions::set_cell_outline_layer, "cell-outline-layer") +
tl::make_member (&LEFDEFReaderOptions::produce_placement_blockages, &LEFDEFReaderOptions::set_produce_placement_blockages, "produce-placement-blockages") +
@@ -126,8 +126,28 @@ LEFImporter::get_iteration (db::Layout &layout)
return t;
}
template <class Shape, class Trans>
static db::Shape insert_shape (db::Cell &cell, unsigned int layer_id, const Shape &shape, const Trans &trans, db::properties_id_type prop_id)
{
if (prop_id == 0) {
return cell.shapes (layer_id).insert (shape.transformed (trans));
} else {
return cell.shapes (layer_id).insert (db::object_with_properties<Shape> (shape.transformed (trans), prop_id));
}
}
template <class Shape>
static db::Shape insert_shape (db::Cell &cell, unsigned int layer_id, const Shape &shape, db::properties_id_type prop_id)
{
if (prop_id == 0) {
return cell.shapes (layer_id).insert (shape);
} else {
return cell.shapes (layer_id).insert (db::object_with_properties<Shape> (shape, prop_id));
}
}
void
LEFImporter::read_geometries (db::Layout &layout, db::Cell &cell, LayerPurpose purpose, std::map<std::string, db::Box> *collect_bboxes)
LEFImporter::read_geometries (db::Layout &layout, db::Cell &cell, LayerPurpose purpose, std::map<std::string, db::Box> *collect_bboxes, db::properties_id_type prop_id)
{
int layer_id = -1;
std::string layer_name;
@@ -194,14 +214,14 @@ LEFImporter::read_geometries (db::Layout &layout, db::Cell &cell, LayerPurpose p
std::vector<db::Trans> ti = get_iteration (layout);
if (layer_id >= 0) {
for (std::vector<db::Trans>::const_iterator t = ti.begin (); t != ti.end (); ++t) {
db::Shape s = cell.shapes (layer_id).insert (p.transformed (*t));
db::Shape s = insert_shape (cell, layer_id, p, *t, prop_id);
if (collect_bboxes) {
collect_bboxes->insert (std::make_pair (layer_name, db::Box ())).first->second = s.bbox ();
}
}
}
} else if (layer_id >= 0) {
db::Shape s = cell.shapes (layer_id).insert (p);
db::Shape s = insert_shape (cell, layer_id, p, prop_id);
if (collect_bboxes) {
collect_bboxes->insert (std::make_pair (layer_name, db::Box ())).first->second = s.bbox ();
}
@@ -235,14 +255,14 @@ LEFImporter::read_geometries (db::Layout &layout, db::Cell &cell, LayerPurpose p
std::vector<db::Trans> ti = get_iteration (layout);
if (layer_id >= 0) {
for (std::vector<db::Trans>::const_iterator t = ti.begin (); t != ti.end (); ++t) {
db::Shape s = cell.shapes (layer_id).insert (p.transformed (*t));
db::Shape s = insert_shape (cell, layer_id, p, *t, prop_id);
if (collect_bboxes) {
collect_bboxes->insert (std::make_pair (layer_name, db::Box ())).first->second = s.bbox ();
}
}
}
} else if (layer_id >= 0) {
db::Shape s = cell.shapes (layer_id).insert (p);
db::Shape s = insert_shape (cell, layer_id, p, prop_id);
if (collect_bboxes) {
collect_bboxes->insert (std::make_pair (layer_name, db::Box ())).first->second = s.bbox ();
}
@@ -275,14 +295,14 @@ LEFImporter::read_geometries (db::Layout &layout, db::Cell &cell, LayerPurpose p
std::vector<db::Trans> ti = get_iteration (layout);
if (layer_id >= 0) {
for (std::vector<db::Trans>::const_iterator t = ti.begin (); t != ti.end (); ++t) {
db::Shape s = cell.shapes (layer_id).insert (b.transformed (*t));
db::Shape s = insert_shape (cell, layer_id, b, *t, prop_id);
if (collect_bboxes) {
collect_bboxes->insert (std::make_pair (layer_name, db::Box ())).first->second = s.bbox ();
}
}
}
} else if (layer_id >= 0) {
db::Shape s = cell.shapes (layer_id).insert (b);
db::Shape s = insert_shape (cell, layer_id, b, prop_id);
if (collect_bboxes) {
collect_bboxes->insert (std::make_pair (layer_name, db::Box ())).first->second = s.bbox ();
}
@@ -685,9 +705,6 @@ LEFImporter::do_read (db::Layout &layout)
test (";");
} else if (test ("PORT")) {
std::map <std::string, db::Box> bboxes;
read_geometries (layout, cell, Pins, &bboxes);
// produce pin labels
// TODO: put a label on every single object?
std::string label = pn;
@@ -698,6 +715,16 @@ LEFImporter::do_read (db::Layout &layout)
}
*/
db::properties_id_type prop_id = 0;
if (produce_pin_props ()) {
db::PropertiesRepository::properties_set props;
props.insert (std::make_pair (pin_prop_name_id (), tl::Variant (label)));
prop_id = layout.properties_repository ().properties_id (props);
}
std::map <std::string, db::Box> bboxes;
read_geometries (layout, cell, Pins, &bboxes, prop_id);
for (std::map <std::string, db::Box>::const_iterator b = bboxes.begin (); b != bboxes.end (); ++b) {
std::pair <bool, unsigned int> dl = open_layer (layout, b->first, Label);
if (dl.first) {
@@ -108,7 +108,7 @@ private:
std::map<std::string, ViaDesc> m_vias;
std::vector <db::Trans> get_iteration (db::Layout &layout);
void read_geometries (db::Layout &layout, db::Cell &cell, LayerPurpose purpose, std::map<std::string, db::Box> *collect_bboxes = 0);
void read_geometries (db::Layout &layout, db::Cell &cell, LayerPurpose purpose, std::map<std::string, db::Box> *collect_bboxes = 0, properties_id_type prop_id = 0);
};
}
@@ -76,6 +76,36 @@ static void set_net_property_name (db::LEFDEFReaderOptions *config, const tl::Va
config->set_net_property_name (name);
}
static tl::Variant get_instance_property_name (const db::LEFDEFReaderOptions *config)
{
if (config->produce_inst_names ()) {
return config->inst_property_name ();
} else {
return tl::Variant ();
}
}
static void set_instance_property_name (db::LEFDEFReaderOptions *config, const tl::Variant &name)
{
config->set_produce_inst_names (! name.is_nil ());
config->set_inst_property_name (name);
}
static tl::Variant get_pin_property_name (const db::LEFDEFReaderOptions *config)
{
if (config->produce_pin_names ()) {
return config->pin_property_name ();
} else {
return tl::Variant ();
}
}
static void set_pin_property_name (db::LEFDEFReaderOptions *config, const tl::Variant &name)
{
config->set_produce_pin_names (! name.is_nil ());
config->set_pin_property_name (name);
}
static
gsi::Class<db::LEFDEFReaderOptions> decl_lefdef_config ("db", "LEFDEFReaderConfiguration",
gsi::method ("layer_map", (db::LayerMap &(db::LEFDEFReaderOptions::*) ()) &db::LEFDEFReaderOptions::layer_map,
@@ -112,7 +142,7 @@ gsi::Class<db::LEFDEFReaderOptions> decl_lefdef_config ("db", "LEFDEFReaderConfi
) +
gsi::method_ext ("net_property_name", &get_net_property_name,
"@brief Gets a value indicating whether and how to produce net names as properties.\n"
"If set to a value not nil, net names will be attached to the shapes and instances generated as user properties.\n"
"If set to a value not nil, net names will be attached to the net shapes generated as user properties.\n"
"This attribute then specifies the user property name to be used for attaching the net names.\n"
"If set to nil, no net names will be produced.\n"
"\n"
@@ -122,6 +152,38 @@ gsi::Class<db::LEFDEFReaderOptions> decl_lefdef_config ("db", "LEFDEFReaderConfi
"@brief Sets a value indicating whether and how to produce net names as properties.\n"
"See \\net_property_name for details."
) +
gsi::method_ext ("pin_property_name", &get_pin_property_name,
"@brief Gets a value indicating whether and how to produce pin names as properties.\n"
"If set to a value not nil, pin names will be attached to the pin shapes generated as user properties.\n"
"This attribute then specifies the user property name to be used for attaching the pin names.\n"
"If set to nil, no pin names will be produced.\n"
"\n"
"The corresponding setter is \\pin_property_name=.\n"
"\n"
"This method has been introduced in version 0.26.4."
) +
gsi::method_ext ("pin_property_name=", &set_pin_property_name, gsi::arg ("name"),
"@brief Sets a value indicating whether and how to produce pin names as properties.\n"
"See \\pin_property_name for details.\n"
"\n"
"This method has been introduced in version 0.26.4."
) +
gsi::method_ext ("instance_property_name", &get_instance_property_name,
"@brief Gets a value indicating whether and how to produce instance names as properties.\n"
"If set to a value not nil, instance names will be attached to the instances generated as user properties.\n"
"This attribute then specifies the user property name to be used for attaching the instance names.\n"
"If set to nil, no instance names will be produced.\n"
"\n"
"The corresponding setter is \\instance_property_name=.\n"
"\n"
"This method has been introduced in version 0.26.4."
) +
gsi::method_ext ("instance_property_name=", &set_instance_property_name, gsi::arg ("name"),
"@brief Sets a value indicating whether and how to produce instance names as properties.\n"
"See \\instance_property_name for details.\n"
"\n"
"This method has been introduced in version 0.26.4."
) +
gsi::method ("produce_cell_outlines", &db::LEFDEFReaderOptions::produce_cell_outlines,
"@brief Gets a value indicating whether to produce cell outlines.\n"
"If set to true, cell outlines will be produced on the layer given by \\cell_outline_layer. "
@@ -264,24 +264,8 @@
<property name="spacing">
<number>6</number>
</property>
<item row="2" column="1">
<widget class="QLabel" name="label_18">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../../../lay/lay/layResources.qrc">:/right.png</pixmap>
</property>
</widget>
</item>
<item row="5" column="7">
<widget class="QLineEdit" name="suffix_labels"/>
</item>
<item row="1" column="2" colspan="2">
<widget class="QLineEdit" name="net_prop_name"/>
</item>
<item row="5" column="6">
<widget class="QLabel" name="label_16">
<item row="7" column="1">
<widget class="QLabel" name="label_10">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -296,122 +280,6 @@
</property>
</widget>
</item>
<item row="6" column="8">
<widget class="QLineEdit" name="datatype_blockages"/>
</item>
<item row="6" column="5">
<widget class="QCheckBox" name="produce_blockages">
<property name="text">
<string>Blockages</string>
</property>
</widget>
</item>
<item row="2" column="6">
<widget class="QLabel" name="label_13">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../../../lay/lay/layResources.qrc">:/right.png</pixmap>
</property>
</widget>
</item>
<item row="4" column="8">
<widget class="QLineEdit" name="datatype_routing"/>
</item>
<item row="4" column="2" colspan="2">
<widget class="QLabel" name="label_7">
<property name="text">
<string>On layer with spec ...</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
<item row="5" column="5">
<widget class="QCheckBox" name="produce_labels">
<property name="text">
<string>Pin labels</string>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QCheckBox" name="produce_pins">
<property name="text">
<string>Pins</string>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QCheckBox" name="produce_via_geometry">
<property name="text">
<string>Via geometry</string>
</property>
</widget>
</item>
<item row="4" column="5">
<widget class="QCheckBox" name="produce_routing">
<property name="text">
<string>Routing</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Produce ...</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="produce_outlines">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Cell outlines</string>
</property>
</widget>
</item>
<item row="0" column="8">
<widget class="QLabel" name="label_3">
<property name="text">
<string>GDS datatype ...</string>
</property>
</widget>
</item>
<item row="4" column="7">
<widget class="QLineEdit" name="suffix_routing"/>
</item>
<item row="1" column="8">
<widget class="QLineEdit" name="datatype_via_geometry"/>
</item>
<item row="5" column="2" colspan="2">
<widget class="QLineEdit" name="outline_layer"/>
</item>
<item row="0" column="7">
<widget class="QLabel" name="lbl1">
<property name="text">
<string>Layer name suffix ...</string>
</property>
</widget>
</item>
<item row="2" column="8">
<widget class="QLineEdit" name="datatype_pins"/>
</item>
<item row="0" column="2" colspan="2">
<widget class="QLabel" name="label_8">
<property name="text">
@@ -419,53 +287,8 @@
</property>
</widget>
</item>
<item row="5" column="8">
<widget class="QLineEdit" name="datatype_labels"/>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="produce_placement_blockages">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Blockages</string>
</property>
</widget>
</item>
<item row="6" column="6">
<widget class="QLabel" name="label_17">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../../../lay/lay/layResources.qrc">:/right.png</pixmap>
</property>
</widget>
</item>
<item row="3" column="0" colspan="4">
<widget class="QLabel" name="help_label">
<property name="text">
<string>&lt;html&gt;&lt;body&gt;(&lt;a href=&quot;int:/about/variant_notation.xml&quot;&gt;See here for the name notation&lt;/a&gt;)&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
</widget>
</item>
<item row="6" column="7">
<widget class="QLineEdit" name="suffix_blockages"/>
</item>
<item row="2" column="7">
<widget class="QLineEdit" name="suffix_pins"/>
<item row="2" column="2" colspan="2">
<widget class="QLineEdit" name="inst_prop_name"/>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="produce_net_names">
@@ -481,8 +304,8 @@
</property>
</widget>
</item>
<item row="3" column="6">
<widget class="QLabel" name="label_14">
<item row="1" column="1">
<widget class="QLabel" name="label_11">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -497,8 +320,31 @@
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Produce ...</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="produce_outlines">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Cell outlines</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="label_10">
<widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -513,6 +359,71 @@
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
</font>
</property>
<property name="text">
<string>Produce ...</string>
</property>
</widget>
</item>
<item row="2" column="8">
<widget class="QLineEdit" name="datatype_pins"/>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="produce_inst_names">
<property name="text">
<string>Inst names</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="produce_placement_blockages">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Blockages</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="4">
<widget class="QLabel" name="help_label">
<property name="text">
<string>&lt;html&gt;&lt;body&gt;(&lt;a href=&quot;int:/about/variant_notation.xml&quot;&gt;See here for the name notation&lt;/a&gt;)&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
</widget>
</item>
<item row="1" column="2" colspan="2">
<widget class="QLineEdit" name="net_prop_name"/>
</item>
<item row="0" column="8">
<widget class="QLabel" name="label_3">
<property name="text">
<string>GDS datatype ...</string>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QLabel" name="lbl1">
<property name="text">
<string>Layer name suffix ...</string>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QLabel" name="label_12">
<property name="sizePolicy">
@@ -529,8 +440,75 @@
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_9">
<item row="5" column="2" colspan="2">
<widget class="QLabel" name="label_7">
<property name="text">
<string>On layer with spec ...</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
<item row="8" column="2" colspan="2">
<widget class="QLineEdit" name="region_layer"/>
</item>
<item row="7" column="2" colspan="2">
<widget class="QLineEdit" name="placement_blockage_layer"/>
</item>
<item row="6" column="2" colspan="2">
<widget class="QLineEdit" name="outline_layer"/>
</item>
<item row="1" column="7">
<widget class="QLineEdit" name="suffix_via_geometry"/>
</item>
<item row="1" column="5">
<widget class="QCheckBox" name="produce_via_geometry">
<property name="text">
<string>Via geometry</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="label_19">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../../../lay/lay/layResources.qrc">:/right.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="4" rowspan="9">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="5" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>Produce ...</string>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QCheckBox" name="produce_pins">
<property name="text">
<string>Pins</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QCheckBox" name="produce_regions">
<property name="text">
<string>Regions</string>
</property>
</widget>
</item>
<item row="2" column="6">
<widget class="QLabel" name="label_13">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -545,33 +523,77 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="produce_inst_names">
<item row="2" column="1">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Inst names</string>
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../../../lay/lay/layResources.qrc">:/right.png</pixmap>
</property>
</widget>
</item>
<item row="6" column="2" colspan="2">
<widget class="QLineEdit" name="placement_blockage_layer"/>
<item row="2" column="7">
<widget class="QLineEdit" name="suffix_pins"/>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
</font>
</property>
<item row="1" column="8">
<widget class="QLineEdit" name="datatype_via_geometry"/>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="produce_pin_names">
<property name="text">
<string>Produce ...</string>
<string>Pin names</string>
</property>
</widget>
</item>
<item row="2" column="2" colspan="2">
<widget class="QLineEdit" name="inst_prop_name"/>
<item row="3" column="1">
<widget class="QLabel" name="label_20">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../../../lay/lay/layResources.qrc">:/right.png</pixmap>
</property>
</widget>
</item>
<item row="3" column="2" colspan="2">
<widget class="QLineEdit" name="pin_prop_name"/>
</item>
<item row="3" column="5">
<widget class="QCheckBox" name="produce_obstructions">
<property name="text">
<string>Obstructions</string>
</property>
</widget>
</item>
<item row="3" column="6">
<widget class="QLabel" name="label_14">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../../../lay/lay/layResources.qrc">:/right.png</pixmap>
</property>
</widget>
</item>
<item row="3" column="7">
<widget class="QLineEdit" name="suffix_obstructions"/>
</item>
<item row="3" column="8">
<widget class="QLineEdit" name="datatype_obstructions"/>
</item>
<item row="4" column="5">
<widget class="QCheckBox" name="produce_routing">
<property name="text">
<string>Routing</string>
</property>
</widget>
</item>
<item row="4" column="6">
<widget class="QLabel" name="label_15">
@@ -589,11 +611,28 @@
</property>
</widget>
</item>
<item row="3" column="8">
<widget class="QLineEdit" name="datatype_obstructions"/>
<item row="4" column="7">
<widget class="QLineEdit" name="suffix_routing"/>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_11">
<item row="4" column="8">
<widget class="QLineEdit" name="datatype_routing"/>
</item>
<item row="5" column="5">
<widget class="QCheckBox" name="produce_labels">
<property name="text">
<string>Pin labels</string>
</property>
</widget>
</item>
<item row="6" column="5">
<widget class="QCheckBox" name="produce_blockages">
<property name="text">
<string>Blockages</string>
</property>
</widget>
</item>
<item row="5" column="6">
<widget class="QLabel" name="label_16">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -608,35 +647,14 @@
</property>
</widget>
</item>
<item row="1" column="7">
<widget class="QLineEdit" name="suffix_via_geometry"/>
</item>
<item row="3" column="5">
<widget class="QCheckBox" name="produce_obstructions">
<property name="text">
<string>Obstructions</string>
<item row="6" column="6">
<widget class="QLabel" name="label_17">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="7">
<widget class="QLineEdit" name="suffix_obstructions"/>
</item>
<item row="0" column="5" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>Produce ...</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="produce_regions">
<property name="text">
<string>Regions</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_19">
<property name="text">
<string/>
</property>
@@ -645,15 +663,17 @@
</property>
</widget>
</item>
<item row="0" column="4" rowspan="8">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<item row="5" column="7">
<widget class="QLineEdit" name="suffix_labels"/>
</item>
<item row="7" column="2" colspan="2">
<widget class="QLineEdit" name="region_layer"/>
<item row="5" column="8">
<widget class="QLineEdit" name="datatype_labels"/>
</item>
<item row="6" column="7">
<widget class="QLineEdit" name="suffix_blockages"/>
</item>
<item row="6" column="8">
<widget class="QLineEdit" name="datatype_blockages"/>
</item>
</layout>
</widget>
@@ -759,18 +779,6 @@
<tabstop>produce_pins</tabstop>
<tabstop>suffix_pins</tabstop>
<tabstop>datatype_pins</tabstop>
<tabstop>produce_obstructions</tabstop>
<tabstop>suffix_obstructions</tabstop>
<tabstop>datatype_obstructions</tabstop>
<tabstop>produce_routing</tabstop>
<tabstop>suffix_routing</tabstop>
<tabstop>datatype_routing</tabstop>
<tabstop>produce_labels</tabstop>
<tabstop>suffix_labels</tabstop>
<tabstop>datatype_labels</tabstop>
<tabstop>produce_blockages</tabstop>
<tabstop>suffix_blockages</tabstop>
<tabstop>datatype_blockages</tabstop>
<tabstop>read_all_cbx</tabstop>
</tabstops>
<resources>
@@ -347,6 +347,7 @@ LEFDEFReaderOptionsEditor::LEFDEFReaderOptionsEditor (QWidget *parent)
connect (produce_net_names, SIGNAL (stateChanged (int)), this, SLOT (checkbox_changed ()));
connect (produce_inst_names, SIGNAL (stateChanged (int)), this, SLOT (checkbox_changed ()));
connect (produce_pin_names, SIGNAL (stateChanged (int)), this, SLOT (checkbox_changed ()));
connect (produce_outlines, SIGNAL (stateChanged (int)), this, SLOT (checkbox_changed ()));
connect (produce_placement_blockages, SIGNAL (stateChanged (int)), this, SLOT (checkbox_changed ()));
connect (produce_regions, SIGNAL (stateChanged (int)), this, SLOT (checkbox_changed ()));
@@ -376,6 +377,7 @@ LEFDEFReaderOptionsEditor::commit (db::FormatSpecificReaderOptions *options, con
data->set_layer_map (layer_map->get_layer_map ());
data->set_produce_net_names (produce_net_names->isChecked ());
data->set_produce_inst_names (produce_inst_names->isChecked ());
data->set_produce_pin_names (produce_pin_names->isChecked ());
double dbu_value = 0.0;
tl::from_string (tl::to_string (dbu->text ()), dbu_value);
@@ -404,6 +406,16 @@ LEFDEFReaderOptionsEditor::commit (db::FormatSpecificReaderOptions *options, con
data->set_inst_property_name (v);
}
// parse the pin property name (may throw an exception)
{
std::string np = tl::to_string (pin_prop_name->text ());
tl::Extractor ex (np.c_str ());
tl::Variant v;
ex.read (v);
ex.expect_end ();
data->set_pin_property_name (v);
}
data->set_produce_cell_outlines (produce_outlines->isChecked ());
data->set_cell_outline_layer (tl::to_string (outline_layer->text ()));
data->set_produce_regions (produce_regions->isChecked ());
@@ -454,6 +466,8 @@ LEFDEFReaderOptionsEditor::setup (const db::FormatSpecificReaderOptions *options
net_prop_name->setText (tl::to_qstring (data->net_property_name ().to_parsable_string ()));
produce_inst_names->setChecked (data->produce_inst_names ());
inst_prop_name->setText (tl::to_qstring (data->inst_property_name ().to_parsable_string ()));
produce_pin_names->setChecked (data->produce_pin_names ());
pin_prop_name->setText (tl::to_qstring (data->pin_property_name ().to_parsable_string ()));
produce_outlines->setChecked (data->produce_cell_outlines ());
outline_layer->setText (tl::to_qstring (data->cell_outline_layer ()));
produce_regions->setChecked (data->produce_regions ());
@@ -499,6 +513,7 @@ LEFDEFReaderOptionsEditor::checkbox_changed ()
{
net_prop_name->setEnabled (produce_net_names->isChecked ());
inst_prop_name->setEnabled (produce_inst_names->isChecked ());
pin_prop_name->setEnabled (produce_pin_names->isChecked ());
outline_layer->setEnabled (produce_outlines->isChecked ());
region_layer->setEnabled (produce_regions->isChecked ());
placement_blockage_layer->setEnabled (produce_placement_blockages->isChecked ());
@@ -30,7 +30,7 @@
#include <cstdlib>
static void run_test (tl::TestBase *_this, const char *lef_dir, const char *filename, const char *au, bool priv = true)
static db::LEFDEFReaderOptions default_options ()
{
db::LEFDEFReaderOptions tc;
tc.set_via_geometry_datatype (0);
@@ -45,6 +45,12 @@ static void run_test (tl::TestBase *_this, const char *lef_dir, const char *file
tc.set_labels_suffix (".LABEL");
tc.set_blockages_datatype (4);
tc.set_blockages_suffix (".BLK");
return tc;
}
static void run_test (tl::TestBase *_this, const char *lef_dir, const char *filename, const char *au, const db::LEFDEFReaderOptions &tc, bool priv = true)
{
db::LEFDEFLayerDelegate ld (&tc);
db::Manager m;
@@ -150,91 +156,107 @@ static void run_test (tl::TestBase *_this, const char *lef_dir, const char *file
TEST(1)
{
run_test (_this, "lef1", "lef:in.lef", 0);
run_test (_this, "lef1", "lef:in.lef", 0, default_options ());
}
TEST(2)
{
run_test (_this, "lef2", "lef:in.lef", "au.oas.gz");
run_test (_this, "lef2", "lef:in.lef", "au.oas.gz", default_options ());
}
TEST(3)
{
run_test (_this, "lef3", "lef:in.lef", "au.oas.gz");
run_test (_this, "lef3", "lef:in.lef", "au.oas.gz", default_options ());
}
TEST(4)
{
run_test (_this, "lef4", "lef:in.lef", 0);
run_test (_this, "lef4", "lef:in.lef", 0, default_options ());
}
TEST(5)
{
run_test (_this, "lef5", "lef:in.lef", 0);
run_test (_this, "lef5", "lef:in.lef", 0, default_options ());
}
TEST(6)
{
run_test (_this, "lef6", "lef:in.lef", 0);
run_test (_this, "lef6", "lef:in.lef", 0, default_options ());
}
TEST(7)
{
run_test (_this, "lef7", "lef:in_tech.lef+lef:in.lef", "au.oas.gz");
run_test (_this, "lef7", "lef:in_tech.lef+lef:in.lef", "au.oas.gz", default_options ());
}
TEST(10)
{
run_test (_this, "def1", "lef:in.lef+def:in.def", "au.oas.gz");
run_test (_this, "def1", "lef:in.lef+def:in.def", "au.oas.gz", default_options ());
}
TEST(11)
{
run_test (_this, "def2", "lef:0.lef+lef:1.lef+def:in.def.gz", "au.oas.gz");
run_test (_this, "def2", "lef:0.lef+lef:1.lef+def:in.def.gz", "au.oas.gz", default_options ());
}
TEST(12)
{
run_test (_this, "def3", "lef:in.lef+def:in.def", "au.oas.gz");
run_test (_this, "def3", "lef:in.lef+def:in.def", "au.oas.gz", default_options ());
}
TEST(13)
{
run_test (_this, "def4", "lef:in.lef+def:in.def", "au.oas.gz");
run_test (_this, "def4", "lef:in.lef+def:in.def", "au.oas.gz", default_options ());
}
TEST(14)
{
run_test (_this, "def5", "lef:in.lef+def:in.def", "au.oas.gz");
run_test (_this, "def5", "lef:in.lef+def:in.def", "au.oas.gz", default_options ());
}
TEST(15)
{
run_test (_this, "def6", "lef:cells.lef+lef:tech.lef+def:in.def.gz", "au.oas.gz");
run_test (_this, "def6", "lef:cells.lef+lef:tech.lef+def:in.def.gz", "au.oas.gz", default_options ());
}
TEST(16)
{
run_test (_this, "def7", "lef:cells.lef+lef:tech.lef+def:in.def.gz", "au.oas.gz");
run_test (_this, "def7", "lef:cells.lef+lef:tech.lef+def:in.def.gz", "au.oas.gz", default_options ());
}
TEST(17)
{
run_test (_this, "def8", "lef:tech.lef+def:in.def", "au.oas.gz");
run_test (_this, "def8", "lef:tech.lef+def:in.def", "au.oas.gz", default_options ());
}
TEST(18)
{
run_test (_this, "def9", "lef:tech.lef+lef:cells_modified.lef+def:in.def", "au.oas.gz");
run_test (_this, "def9", "lef:tech.lef+lef:cells_modified.lef+def:in.def", "au.oas.gz", default_options ());
}
TEST(19)
{
run_test (_this, "def10", "def:in.def", "au.oas.gz");
run_test (_this, "def10", "def:in.def", "au.oas.gz", default_options ());
}
TEST(20)
{
run_test (_this, "issue-172", "lef:in.lef+def:in.def", "au.oas.gz", false);
run_test (_this, "issue-172", "lef:in.lef+def:in.def", "au.oas.gz", default_options (), false);
}
TEST(21)
{
db::LEFDEFReaderOptions opt = default_options ();
opt.set_produce_pin_names (true);
opt.set_pin_property_name (2);
run_test (_this, "issue-489", "lef:in.lef+def:in.def", "au.oas", opt, false);
}
TEST(22)
{
db::LEFDEFReaderOptions opt = default_options ();
opt.set_produce_pin_names (true);
opt.set_pin_property_name (3);
run_test (_this, "issue-489b", "lef:in_tech.lef+lef:in.lef", "au.oas.gz", opt, false);
}