Enhancements to implementation

- OASIS layers are turned into pure layer name (not lxdy_name) for
  MAG output
- Boxes of instances had been incorrect
- consistent naming of cell files in presence of special chars
This commit is contained in:
Matthias Koefferlein 2019-11-30 22:30:28 +01:00
parent f8743e7411
commit 9eb09c3a5d
5 changed files with 30 additions and 6 deletions

View File

@ -294,6 +294,17 @@ SaveLayoutOptions::get_valid_layers (const db::Layout &layout, std::vector <std:
} }
} }
} else if (lm == LP_AssignNameWithPriority) {
for (std::vector<std::pair <unsigned int, db::LayerProperties> >::const_iterator l = all_layers.begin (); l != all_layers.end (); ++l) {
layers.push_back (*l);
if (l->second.name.empty ()) {
layers.back ().second = tl::sprintf ("L%dD%d", l->second.layer, l->second.datatype);
} else if (l->second.layer >= 0 && l->second.datatype >= 0) {
layers.back ().second = l->second.name;
}
}
} else if (lm == LP_AssignNumber) { } else if (lm == LP_AssignNumber) {
int next_layer = 0; int next_layer = 0;

View File

@ -391,7 +391,8 @@ public:
LP_OnlyNumbered = 0, LP_OnlyNumbered = 0,
LP_OnlyNamed = 1, LP_OnlyNamed = 1,
LP_AssignName = 2, LP_AssignName = 2,
LP_AssignNumber = 3 LP_AssignNameWithPriority = 3,
LP_AssignNumber = 4
}; };
/** /**
@ -401,7 +402,8 @@ public:
* The lm mode specifies how to create layer properties for "halfway defined" layers - * The lm mode specifies how to create layer properties for "halfway defined" layers -
* - LP_OnlyNamed will only select named ones * - LP_OnlyNamed will only select named ones
* - LP_OnlyNumbered will select only numbered ones * - LP_OnlyNumbered will select only numbered ones
* - LP_AssignName will assign a name when no name is given * - LP_AssignName will assign a name when no name is given plus encode layer/datatype when given
* - LP_AssignNameWithPriority will assign a name when no name is given and does not encore layer/datatype together with a name
* - LP_AssignNumber will assign numbers when no number is given * - LP_AssignNumber will assign numbers when no number is given
*/ */
void get_valid_layers (const db::Layout &layout, std::vector <std::pair <unsigned int, db::LayerProperties> > &valid_layers, LayerAssignmentMode lm) const; void get_valid_layers (const db::Layout &layout, std::vector <std::pair <unsigned int, db::LayerProperties> > &valid_layers, LayerAssignmentMode lm) const;

View File

@ -160,6 +160,14 @@ public:
*/ */
void reserve (size_t n); void reserve (size_t n);
/**
* @brief Sets the base verbosity of the processor (see EdgeProcessor::set_base_verbosity for details)
*/
void set_base_verbosity (int bv)
{
m_processor.set_base_verbosity (bv);
}
/** /**
* @brief Enable progress * @brief Enable progress
* *

View File

@ -399,7 +399,10 @@ MAGReader::do_merge_part (Layout &layout, cell_index_type cell_index)
db::ShapeProcessor sp; db::ShapeProcessor sp;
if (tl::verbosity () >= 40) { if (tl::verbosity () >= 40) {
sp.enable_progress (tl::to_string (tr ("Merging shapes for MAG reader"))); sp.enable_progress (tl::to_string (tr ("Merging shapes for MAG reader")));
} else {
sp.disable_progress ();
} }
sp.set_base_verbosity (40);
std::vector<db::Text> saved_texts; std::vector<db::Text> saved_texts;

View File

@ -54,7 +54,7 @@ void
MAGWriter::write (db::Layout &layout, tl::OutputStream &stream, const db::SaveLayoutOptions &options) MAGWriter::write (db::Layout &layout, tl::OutputStream &stream, const db::SaveLayoutOptions &options)
{ {
std::vector <std::pair <unsigned int, db::LayerProperties> > layers; std::vector <std::pair <unsigned int, db::LayerProperties> > layers;
options.get_valid_layers (layout, layers, db::SaveLayoutOptions::LP_AssignName); options.get_valid_layers (layout, layers, db::SaveLayoutOptions::LP_AssignNameWithPriority);
std::set <db::cell_index_type> cell_set; std::set <db::cell_index_type> cell_set;
options.get_cells (layout, cell_set, layers); options.get_cells (layout, cell_set, layers);
@ -102,9 +102,9 @@ MAGWriter::filename_for_cell (db::cell_index_type ci, db::Layout &layout)
{ {
tl::URI uri (m_base_uri); tl::URI uri (m_base_uri);
if (uri.path ().empty ()) { if (uri.path ().empty ()) {
uri.set_path (std::string (layout.cell_name (ci)) + "." + m_ext); uri.set_path (make_string (layout.cell_name (ci)) + "." + m_ext);
} else { } else {
uri.set_path (uri.path () + "/" + std::string (layout.cell_name (ci)) + "." + m_ext); uri.set_path (uri.path () + "/" + make_string (layout.cell_name (ci)) + "." + m_ext);
} }
return uri.to_string (); return uri.to_string ();
} }
@ -320,7 +320,7 @@ MAGWriter::write_single_instance (db::cell_index_type ci, db::ICplxTrans trans,
db::Vector d = scaled (trans.disp ()); db::Vector d = scaled (trans.disp ());
os << "transform " << m.m11 () << " " << m.m12 () << " " << d.x () << " " << m.m21 () << " " << m.m22 () << " " << d.y () << "\n"; os << "transform " << m.m11 () << " " << m.m12 () << " " << d.x () << " " << m.m21 () << " " << m.m22 () << " " << d.y () << "\n";
db::Box bx = scaled (trans * layout.cell (ci).bbox ()); db::Box bx = scaled (layout.cell (ci).bbox ());
os << "box " << bx.left () << " " << bx.bottom () << " " << bx.right () << " " << bx.top () << "\n"; os << "box " << bx.left () << " " << bx.bottom () << " " << bx.right () << " " << bx.top () << "\n";
} }