mirror of https://github.com/KLayout/klayout.git
WIP: first version of reading with MASK
This commit is contained in:
parent
b9c49f0603
commit
0d52da77ee
|
|
@ -64,7 +64,6 @@ DEFImporter::read_lef (tl::InputStream &stream, db::Layout &layout, LEFDEFReader
|
|||
m_lef_importer.read (stream, layout, state);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DEFImporter::read_polygon (db::Polygon &poly, double scale)
|
||||
{
|
||||
|
|
@ -152,7 +151,7 @@ DEFImporter::read_diearea (db::Layout &layout, db::Cell &design, double scale)
|
|||
if (points.size () >= 2) {
|
||||
|
||||
// create outline shape
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, std::string (), Outline);
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, std::string (), Outline, 0);
|
||||
if (dl.first) {
|
||||
if (points.size () == 2) {
|
||||
design.shapes (dl.second).insert (db::Box (points [0], points [1]));
|
||||
|
|
@ -300,7 +299,7 @@ DEFImporter::read_blockages (db::Layout &layout, db::Cell &design, double scale)
|
|||
db::Polygon p;
|
||||
read_polygon (p, scale);
|
||||
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, layer, layer.empty () ? PlacementBlockage : Blockage);
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, layer, layer.empty () ? PlacementBlockage : Blockage, 0);
|
||||
if (dl.first) {
|
||||
design.shapes (dl.second).insert (p);
|
||||
}
|
||||
|
|
@ -310,7 +309,7 @@ DEFImporter::read_blockages (db::Layout &layout, db::Cell &design, double scale)
|
|||
db::Polygon p;
|
||||
read_rect (p, scale);
|
||||
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, layer, layer.empty () ? PlacementBlockage : Blockage);
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, layer, layer.empty () ? PlacementBlockage : Blockage, 0);
|
||||
if (dl.first) {
|
||||
design.shapes (dl.second).insert (p);
|
||||
}
|
||||
|
|
@ -517,12 +516,12 @@ DEFImporter::read_single_net (std::string &nondefaultrule, Layout &layout, db::C
|
|||
std::vector<db::Point> pts;
|
||||
|
||||
double x = 0.0, y = 0.0;
|
||||
unsigned int mask = 0;
|
||||
|
||||
while (true) {
|
||||
|
||||
if (test ("MASK")) {
|
||||
// ignore mask spec
|
||||
get_long ();
|
||||
mask = get_mask (get_long ());
|
||||
}
|
||||
|
||||
if (test ("RECT")) {
|
||||
|
|
@ -543,7 +542,7 @@ DEFImporter::read_single_net (std::string &nondefaultrule, Layout &layout, db::C
|
|||
|
||||
test (")");
|
||||
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, ln, specialnets ? SpecialRouting : Routing);
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, ln, specialnets ? SpecialRouting : Routing, mask);
|
||||
if (dl.first) {
|
||||
|
||||
db::Point p (x, y);
|
||||
|
|
@ -568,8 +567,7 @@ DEFImporter::read_single_net (std::string &nondefaultrule, Layout &layout, db::C
|
|||
while (peek ("(") || peek ("MASK")) {
|
||||
|
||||
if (test ("MASK")) {
|
||||
// ignore MASK spec
|
||||
get_long ();
|
||||
mask = get_mask (get_long ());
|
||||
}
|
||||
|
||||
if (! test ("(")) {
|
||||
|
|
@ -597,7 +595,7 @@ DEFImporter::read_single_net (std::string &nondefaultrule, Layout &layout, db::C
|
|||
}
|
||||
|
||||
if (pts.size () > 1) {
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, ln, specialnets ? SpecialRouting : Routing);
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, ln, specialnets ? SpecialRouting : Routing, mask);
|
||||
if (dl.first) {
|
||||
produce_routing_geometry (design, style, dl.second, prop_id, pts, ext, w);
|
||||
}
|
||||
|
|
@ -695,6 +693,7 @@ DEFImporter::read_nets (db::Layout &layout, db::Cell &design, double scale, bool
|
|||
while (test ("+")) {
|
||||
|
||||
bool was_shield = false;
|
||||
unsigned int mask = 0;
|
||||
|
||||
if (! specialnets && test ("SUBNET")) {
|
||||
|
||||
|
|
@ -748,7 +747,7 @@ DEFImporter::read_nets (db::Layout &layout, db::Cell &design, double scale, bool
|
|||
test ("+");
|
||||
}
|
||||
if (test ("MASK")) {
|
||||
get_long ();
|
||||
mask = get_mask (get_long ());
|
||||
test ("+");
|
||||
}
|
||||
}
|
||||
|
|
@ -760,7 +759,7 @@ DEFImporter::read_nets (db::Layout &layout, db::Cell &design, double scale, bool
|
|||
db::Polygon p;
|
||||
read_polygon (p, scale);
|
||||
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, ln, specialnets ? SpecialRouting : Routing);
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, ln, specialnets ? SpecialRouting : Routing, mask);
|
||||
if (dl.first) {
|
||||
if (prop_id != 0) {
|
||||
design.shapes (dl.second).insert (db::object_with_properties<db::Polygon> (p, prop_id));
|
||||
|
|
@ -778,7 +777,7 @@ DEFImporter::read_nets (db::Layout &layout, db::Cell &design, double scale, bool
|
|||
db::Polygon p;
|
||||
read_rect (p, scale);
|
||||
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, ln, specialnets ? SpecialRouting : Routing);
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, ln, specialnets ? SpecialRouting : Routing, mask);
|
||||
if (dl.first) {
|
||||
if (prop_id != 0) {
|
||||
design.shapes (dl.second).insert (db::object_with_properties<db::Polygon> (p, prop_id));
|
||||
|
|
@ -866,6 +865,7 @@ DEFImporter::read_vias (db::Layout &layout, db::Cell & /*design*/, double scale)
|
|||
db::Point offset;
|
||||
int rows = 1, columns = 1;
|
||||
std::string pattern;
|
||||
unsigned int mask = 0;
|
||||
|
||||
std::map<std::string, std::vector<db::Polygon> > geometry;
|
||||
std::vector<db::Polygon> *top = 0, *cut = 0, *bottom = 0;
|
||||
|
|
@ -927,7 +927,7 @@ DEFImporter::read_vias (db::Layout &layout, db::Cell & /*design*/, double scale)
|
|||
|
||||
if (test ("+")) {
|
||||
expect ("MASK");
|
||||
get_long ();
|
||||
mask = get_mask (get_long ());
|
||||
}
|
||||
|
||||
std::vector<db::Polygon> &polygons = geometry.insert (std::make_pair (ln, std::vector<db::Polygon> ())).first->second;
|
||||
|
|
@ -940,7 +940,7 @@ DEFImporter::read_vias (db::Layout &layout, db::Cell & /*design*/, double scale)
|
|||
|
||||
if (test ("+")) {
|
||||
expect ("MASK");
|
||||
get_long ();
|
||||
mask = get_mask (get_long ());
|
||||
}
|
||||
|
||||
std::vector<db::Polygon> &polygons = geometry.insert (std::make_pair (ln, std::vector<db::Polygon> ())).first->second;
|
||||
|
|
@ -978,7 +978,7 @@ DEFImporter::read_vias (db::Layout &layout, db::Cell & /*design*/, double scale)
|
|||
}
|
||||
|
||||
for (std::map<std::string, std::vector<db::Polygon> >::const_iterator g = geometry.begin (); g != geometry.end (); ++g) {
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, g->first, ViaGeometry);
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, g->first, ViaGeometry, mask);
|
||||
if (dl.first) {
|
||||
for (std::vector<db::Polygon>::const_iterator p = g->second.begin (); p != g->second.end (); ++p) {
|
||||
cell.shapes (dl.second).insert (*p);
|
||||
|
|
@ -1000,6 +1000,7 @@ DEFImporter::read_pins (db::Layout &layout, db::Cell &design, double scale)
|
|||
std::string dir;
|
||||
std::map <std::string, std::vector <db::Polygon> > geometry;
|
||||
db::Trans trans;
|
||||
unsigned int mask = 0;
|
||||
|
||||
while (test ("+")) {
|
||||
|
||||
|
|
@ -1090,7 +1091,7 @@ DEFImporter::read_pins (db::Layout &layout, db::Cell &design, double scale)
|
|||
// Produce geometry collected so far
|
||||
for (std::map<std::string, std::vector<db::Polygon> >::const_iterator g = geometry.begin (); g != geometry.end (); ++g) {
|
||||
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, g->first, Pins);
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, g->first, Pins, mask);
|
||||
if (dl.first) {
|
||||
|
||||
db::properties_id_type prop_id = 0;
|
||||
|
|
@ -1111,7 +1112,7 @@ DEFImporter::read_pins (db::Layout &layout, db::Cell &design, double scale)
|
|||
|
||||
}
|
||||
|
||||
dl = open_layer (layout, g->first, Label);
|
||||
dl = open_layer (layout, g->first, Label, 0);
|
||||
if (dl.first) {
|
||||
db::Box bbox;
|
||||
if (! g->second.empty ()) {
|
||||
|
|
@ -1427,7 +1428,7 @@ DEFImporter::do_read (db::Layout &layout)
|
|||
|
||||
} else {
|
||||
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, std::string (), Regions);
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, std::string (), Regions, 0);
|
||||
if (dl.first) {
|
||||
for (std::vector<db::Polygon>::const_iterator p = r->second.begin (); p != r->second.end (); ++p) {
|
||||
group_cell->shapes (dl.second).insert (*p);
|
||||
|
|
@ -1470,7 +1471,7 @@ DEFImporter::do_read (db::Layout &layout)
|
|||
|
||||
if (! regions.empty ()) {
|
||||
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, std::string (), Regions);
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, std::string (), Regions, 0);
|
||||
if (dl.first) {
|
||||
|
||||
for (std::map<std::string, std::vector<db::Polygon> >::const_iterator r = regions.begin (); r != regions.end (); ++r) {
|
||||
|
|
|
|||
|
|
@ -457,10 +457,10 @@ LEFDEFReaderState::register_layer (const std::string &ln)
|
|||
}
|
||||
|
||||
void
|
||||
LEFDEFReaderState::map_layer_explicit (const std::string &n, LayerPurpose purpose, const db::LayerProperties &lp, unsigned int layer)
|
||||
LEFDEFReaderState::map_layer_explicit (const std::string &n, LayerPurpose purpose, const db::LayerProperties &lp, unsigned int layer, unsigned int mask)
|
||||
{
|
||||
tl_assert (m_has_explicit_layer_mapping);
|
||||
m_layers [std::make_pair (n, purpose)] = std::make_pair (true, layer);
|
||||
m_layers [std::make_pair (n, std::make_pair (purpose, mask))] = std::make_pair (true, layer);
|
||||
m_layer_map.map (lp, layer);
|
||||
}
|
||||
|
||||
|
|
@ -581,18 +581,18 @@ LEFDEFReaderState::read_map_file (const std::string &path, db::Layout &layout)
|
|||
}
|
||||
|
||||
std::pair <bool, unsigned int>
|
||||
LEFDEFReaderState::open_layer (db::Layout &layout, const std::string &n, LayerPurpose purpose)
|
||||
LEFDEFReaderState::open_layer (db::Layout &layout, const std::string &n, LayerPurpose purpose, unsigned int mask)
|
||||
{
|
||||
std::map <std::pair<std::string, LayerPurpose>, std::pair<bool, unsigned int> >::const_iterator nl = m_layers.find (std::make_pair (n, purpose));
|
||||
std::map <std::pair<std::string, std::pair<LayerPurpose, unsigned int> >, std::pair<bool, unsigned int> >::const_iterator nl = m_layers.find (std::make_pair (n, std::make_pair (purpose, mask)));
|
||||
if (nl == m_layers.end ()) {
|
||||
|
||||
std::pair <bool, unsigned int> ll (false, 0);
|
||||
|
||||
if (n.empty () || ! m_has_explicit_layer_mapping) {
|
||||
ll = open_layer_uncached (layout, n, purpose);
|
||||
ll = open_layer_uncached (layout, n, purpose, mask);
|
||||
}
|
||||
|
||||
m_layers.insert (std::make_pair (std::make_pair (n, purpose), ll));
|
||||
m_layers.insert (std::make_pair (std::make_pair (n, std::make_pair (purpose, mask)), ll));
|
||||
return ll;
|
||||
|
||||
} else {
|
||||
|
|
@ -601,7 +601,7 @@ LEFDEFReaderState::open_layer (db::Layout &layout, const std::string &n, LayerPu
|
|||
}
|
||||
|
||||
std::pair <bool, unsigned int>
|
||||
LEFDEFReaderState::open_layer_uncached (db::Layout &layout, const std::string &n, LayerPurpose purpose)
|
||||
LEFDEFReaderState::open_layer_uncached (db::Layout &layout, const std::string &n, LayerPurpose purpose, unsigned int mask)
|
||||
{
|
||||
if (n.empty ()) {
|
||||
|
||||
|
|
@ -698,28 +698,28 @@ LEFDEFReaderState::open_layer_uncached (db::Layout &layout, const std::string &n
|
|||
switch (purpose) {
|
||||
case Routing:
|
||||
default:
|
||||
name += mp_tech_comp->routing_suffix ();
|
||||
dt += mp_tech_comp->routing_datatype ();
|
||||
name += mp_tech_comp->routing_suffix_per_mask (mask);
|
||||
dt += mp_tech_comp->routing_datatype_per_mask (mask);
|
||||
break;
|
||||
case SpecialRouting:
|
||||
name += mp_tech_comp->special_routing_suffix ();
|
||||
dt += mp_tech_comp->special_routing_datatype ();
|
||||
name += mp_tech_comp->special_routing_suffix_per_mask (mask);
|
||||
dt += mp_tech_comp->special_routing_datatype_per_mask (mask);
|
||||
break;
|
||||
case ViaGeometry:
|
||||
name += mp_tech_comp->via_geometry_suffix ();
|
||||
dt += mp_tech_comp->via_geometry_datatype ();
|
||||
name += mp_tech_comp->via_geometry_suffix_per_mask (mask);
|
||||
dt += mp_tech_comp->via_geometry_datatype_per_mask (mask);
|
||||
break;
|
||||
case Label:
|
||||
name += mp_tech_comp->labels_suffix ();
|
||||
dt += mp_tech_comp->labels_datatype ();
|
||||
break;
|
||||
case Pins:
|
||||
name += mp_tech_comp->pins_suffix ();
|
||||
dt += mp_tech_comp->pins_datatype ();
|
||||
name += mp_tech_comp->pins_suffix_per_mask (mask);
|
||||
dt += mp_tech_comp->pins_datatype_per_mask (mask);
|
||||
break;
|
||||
case LEFPins:
|
||||
name += mp_tech_comp->lef_pins_suffix ();
|
||||
dt += mp_tech_comp->lef_pins_datatype ();
|
||||
name += mp_tech_comp->lef_pins_suffix_per_mask (mask);
|
||||
dt += mp_tech_comp->lef_pins_datatype_per_mask (mask);
|
||||
break;
|
||||
case Obstructions:
|
||||
name += mp_tech_comp->obstructions_suffix ();
|
||||
|
|
@ -755,12 +755,12 @@ LEFDEFReaderState::open_layer_uncached (db::Layout &layout, const std::string &n
|
|||
|
||||
} else {
|
||||
|
||||
std::map <std::pair<std::string, LayerPurpose>, unsigned int>::const_iterator l = m_unassigned_layers.find (std::make_pair (n, purpose));
|
||||
std::map <std::pair<std::string, std::pair<LayerPurpose, unsigned int> >, unsigned int>::const_iterator l = m_unassigned_layers.find (std::make_pair (n, std::make_pair (purpose, mask)));
|
||||
if (l != m_unassigned_layers.end ()) {
|
||||
return std::pair<bool, unsigned int> (true, l->second);
|
||||
} else {
|
||||
unsigned int li = layout.insert_layer (db::LayerProperties (name));
|
||||
m_unassigned_layers.insert (std::make_pair (std::make_pair (n, purpose), li));
|
||||
m_unassigned_layers.insert (std::make_pair (std::make_pair (n, std::make_pair (purpose, mask)), li));
|
||||
m_layer_map.map (db::LayerProperties (name), li);
|
||||
return std::pair<bool, unsigned int> (true, li);
|
||||
}
|
||||
|
|
@ -788,28 +788,28 @@ LEFDEFReaderState::finish (db::Layout &layout)
|
|||
used_numbers.insert (ln->second);
|
||||
}
|
||||
|
||||
for (std::map<std::pair<std::string, LayerPurpose>, unsigned int>::const_iterator l = m_unassigned_layers.begin (); l != m_unassigned_layers.end (); ++l) {
|
||||
for (std::map<std::pair<std::string, std::pair<LayerPurpose, unsigned int> >, unsigned int>::const_iterator l = m_unassigned_layers.begin (); l != m_unassigned_layers.end (); ++l) {
|
||||
|
||||
int dt = 0;
|
||||
switch (l->first.second) {
|
||||
switch (l->first.second.first) {
|
||||
case Routing:
|
||||
default:
|
||||
dt = mp_tech_comp->routing_datatype ();
|
||||
dt = mp_tech_comp->routing_datatype_per_mask (l->first.second.second);
|
||||
break;
|
||||
case SpecialRouting:
|
||||
dt = mp_tech_comp->special_routing_datatype ();
|
||||
dt = mp_tech_comp->special_routing_datatype_per_mask (l->first.second.second);
|
||||
break;
|
||||
case ViaGeometry:
|
||||
dt = mp_tech_comp->via_geometry_datatype ();
|
||||
dt = mp_tech_comp->via_geometry_datatype_per_mask (l->first.second.second);
|
||||
break;
|
||||
case Label:
|
||||
dt = mp_tech_comp->labels_datatype ();
|
||||
break;
|
||||
case Pins:
|
||||
dt = mp_tech_comp->pins_datatype ();
|
||||
dt = mp_tech_comp->pins_datatype_per_mask (l->first.second.second);
|
||||
break;
|
||||
case LEFPins:
|
||||
dt = mp_tech_comp->lef_pins_datatype ();
|
||||
dt = mp_tech_comp->lef_pins_datatype_per_mask (l->first.second.second);
|
||||
break;
|
||||
case Obstructions:
|
||||
dt = mp_tech_comp->obstructions_datatype ();
|
||||
|
|
@ -869,6 +869,15 @@ LEFDEFImporter::~LEFDEFImporter ()
|
|||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
unsigned int
|
||||
LEFDEFImporter::get_mask (long m)
|
||||
{
|
||||
if (m < 1 || m > 16) {
|
||||
error (tl::to_string (tr ("Invalid mask number: ")) + tl::to_string (m));
|
||||
}
|
||||
return (unsigned int) (m - 1);
|
||||
}
|
||||
|
||||
void
|
||||
LEFDEFImporter::read (tl::InputStream &stream, db::Layout &layout, LEFDEFReaderState &state)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -879,7 +879,7 @@ public:
|
|||
/**
|
||||
* @brief Create a new layer or return the index of the given layer
|
||||
*/
|
||||
std::pair <bool, unsigned int> open_layer (db::Layout &layout, const std::string &name, LayerPurpose purpose);
|
||||
std::pair <bool, unsigned int> open_layer (db::Layout &layout, const std::string &name, LayerPurpose purpose, unsigned int mask);
|
||||
|
||||
/**
|
||||
* @brief Registers a layer (assign a new default layer number)
|
||||
|
|
@ -910,8 +910,8 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
std::map <std::pair<std::string, LayerPurpose>, std::pair<bool, unsigned int> > m_layers;
|
||||
std::map <std::pair<std::string, LayerPurpose>, unsigned int> m_unassigned_layers;
|
||||
std::map <std::pair<std::string, std::pair<LayerPurpose, unsigned int> >, std::pair<bool, unsigned int> > m_layers;
|
||||
std::map <std::pair<std::string, std::pair<LayerPurpose, unsigned int> >, unsigned int> m_unassigned_layers;
|
||||
db::LayerMap m_layer_map;
|
||||
bool m_create_layers;
|
||||
bool m_has_explicit_layer_mapping;
|
||||
|
|
@ -920,8 +920,8 @@ private:
|
|||
std::map<std::string, db::Cell *> m_via_cells;
|
||||
const LEFDEFReaderOptions *mp_tech_comp;
|
||||
|
||||
std::pair <bool, unsigned int> open_layer_uncached (db::Layout &layout, const std::string &name, LayerPurpose purpose);
|
||||
void map_layer_explicit (const std::string &n, LayerPurpose purpose, const LayerProperties &lp, unsigned int layer);
|
||||
std::pair <bool, unsigned int> open_layer_uncached (db::Layout &layout, const std::string &name, LayerPurpose purpose, unsigned int mask);
|
||||
void map_layer_explicit (const std::string &n, LayerPurpose purpose, const LayerProperties &lp, unsigned int layer, unsigned int mask);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1051,12 +1051,17 @@ protected:
|
|||
*/
|
||||
db::Vector get_vector (double scale);
|
||||
|
||||
/**
|
||||
* @brief Turns a number into a mask number
|
||||
*/
|
||||
unsigned int get_mask (long m);
|
||||
|
||||
/**
|
||||
* @brief Create a new layer or return the index of the given layer
|
||||
*/
|
||||
std::pair <bool, unsigned int> open_layer (db::Layout &layout, const std::string &name, LayerPurpose purpose)
|
||||
std::pair <bool, unsigned int> open_layer (db::Layout &layout, const std::string &name, LayerPurpose purpose, unsigned int mask)
|
||||
{
|
||||
return mp_reader_state->open_layer (layout, name, purpose);
|
||||
return mp_reader_state->open_layer (layout, name, purpose, mask);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -160,10 +160,10 @@ static db::Shape insert_shape (db::Cell &cell, unsigned int layer_id, const Shap
|
|||
void
|
||||
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;
|
||||
double dbu = layout.dbu ();
|
||||
double w = 0.0;
|
||||
unsigned int mask = 0;
|
||||
|
||||
while (true) {
|
||||
|
||||
|
|
@ -177,12 +177,6 @@ LEFImporter::read_geometries (db::Layout &layout, db::Cell &cell, LayerPurpose p
|
|||
} else if (test ("LAYER")) {
|
||||
|
||||
layer_name = get ();
|
||||
layer_id = -1;
|
||||
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, layer_name, purpose);
|
||||
if (dl.first) {
|
||||
layer_id = int (dl.second);
|
||||
}
|
||||
|
||||
w = 0.0;
|
||||
std::map<std::string, std::pair<double, double> >::const_iterator dw = m_default_widths.find (layer_name);
|
||||
|
|
@ -204,8 +198,13 @@ LEFImporter::read_geometries (db::Layout &layout, db::Cell &cell, LayerPurpose p
|
|||
std::vector<db::Point> points;
|
||||
|
||||
if (test ("MASK")) {
|
||||
// ignore mask number
|
||||
get_long ();
|
||||
mask = get_mask (get_long ());
|
||||
}
|
||||
|
||||
int layer_id = -1;
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, layer_name, purpose, mask);
|
||||
if (dl.first) {
|
||||
layer_id = int (dl.second);
|
||||
}
|
||||
|
||||
bool iterate = test ("ITERATE");
|
||||
|
|
@ -245,8 +244,13 @@ LEFImporter::read_geometries (db::Layout &layout, db::Cell &cell, LayerPurpose p
|
|||
std::vector<db::Point> points;
|
||||
|
||||
if (test ("MASK")) {
|
||||
// ignore mask number
|
||||
get_long ();
|
||||
mask = get_mask (get_long ());
|
||||
}
|
||||
|
||||
int layer_id = -1;
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, layer_name, purpose, mask);
|
||||
if (dl.first) {
|
||||
layer_id = int (dl.second);
|
||||
}
|
||||
|
||||
bool iterate = test ("ITERATE");
|
||||
|
|
@ -286,8 +290,13 @@ LEFImporter::read_geometries (db::Layout &layout, db::Cell &cell, LayerPurpose p
|
|||
std::vector<db::Point> points;
|
||||
|
||||
if (test ("MASK")) {
|
||||
// ignore mask number
|
||||
get_long ();
|
||||
mask = get_mask (get_long ());
|
||||
}
|
||||
|
||||
int layer_id = -1;
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, layer_name, purpose, mask);
|
||||
if (dl.first) {
|
||||
layer_id = int (dl.second);
|
||||
}
|
||||
|
||||
bool iterate = test ("ITERATE");
|
||||
|
|
@ -329,8 +338,13 @@ LEFImporter::read_geometries (db::Layout &layout, db::Cell &cell, LayerPurpose p
|
|||
bool iterate = test ("ITERATE");
|
||||
|
||||
if (test ("MASK")) {
|
||||
// ignore mask number
|
||||
get_long ();
|
||||
mask = get_mask (get_long ());
|
||||
}
|
||||
|
||||
int layer_id = -1;
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, layer_name, purpose, mask);
|
||||
if (dl.first) {
|
||||
layer_id = int (dl.second);
|
||||
}
|
||||
|
||||
double x = 0.0, y = 0.0;
|
||||
|
|
@ -432,10 +446,11 @@ LEFImporter::read_viadef_by_rule (Layout &layout, db::Cell &cell, ViaDesc &via_d
|
|||
int rows = 1, columns = 1;
|
||||
std::string pattern;
|
||||
|
||||
std::vector<std::pair<std::string, std::vector<db::Polygon> > > geometry;
|
||||
geometry.push_back (std::pair<std::string, std::vector<db::Polygon> > ());
|
||||
geometry.push_back (std::pair<std::string, std::vector<db::Polygon> > ());
|
||||
geometry.push_back (std::pair<std::string, std::vector<db::Polygon> > ());
|
||||
// @@@ there is something with masks here ...
|
||||
std::vector<std::pair<std::pair<std::string, unsigned int>, std::vector<db::Polygon> > > geometry;
|
||||
geometry.push_back (std::pair<std::pair<std::string, unsigned int>, std::vector<db::Polygon> > ());
|
||||
geometry.push_back (std::pair<std::pair<std::string, unsigned int>, std::vector<db::Polygon> > ());
|
||||
geometry.push_back (std::pair<std::pair<std::string, unsigned int>, std::vector<db::Polygon> > ());
|
||||
|
||||
while (! test ("END")) {
|
||||
|
||||
|
|
@ -504,9 +519,9 @@ LEFImporter::read_viadef_by_rule (Layout &layout, db::Cell &cell, ViaDesc &via_d
|
|||
|
||||
} else if (test ("LAYERS")) {
|
||||
|
||||
via_desc.m1 = geometry[0].first = get ();
|
||||
geometry[1].first = get ();
|
||||
via_desc.m2 = geometry[2].first = get ();
|
||||
via_desc.m1 = geometry[0].first.first = get ();
|
||||
geometry[1].first.first = get ();
|
||||
via_desc.m2 = geometry[2].first.first = get ();
|
||||
|
||||
test (";");
|
||||
|
||||
|
|
@ -523,8 +538,8 @@ LEFImporter::read_viadef_by_rule (Layout &layout, db::Cell &cell, ViaDesc &via_d
|
|||
create_generated_via (geometry [0].second, geometry [1].second, geometry [2].second,
|
||||
cutsize, cutspacing, be, te, bo, to, offset, rows, columns, pattern);
|
||||
|
||||
for (std::vector<std::pair<std::string, std::vector<db::Polygon> > >::const_iterator g = geometry.begin (); g != geometry.end (); ++g) {
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, g->first, ViaGeometry);
|
||||
for (std::vector<std::pair<std::pair<std::string, unsigned int>, std::vector<db::Polygon> > >::const_iterator g = geometry.begin (); g != geometry.end (); ++g) {
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, g->first.first, ViaGeometry, g->first.second);
|
||||
if (dl.first) {
|
||||
for (std::vector<db::Polygon>::const_iterator p = g->second.begin (); p != g->second.end (); ++p) {
|
||||
cell.shapes (dl.second).insert (*p);
|
||||
|
|
@ -807,7 +822,7 @@ LEFImporter::read_macro (Layout &layout)
|
|||
read_geometries (layout, cell, LEFPins, &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);
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, b->first, Label, 0);
|
||||
if (dl.first) {
|
||||
cell.shapes (dl.second).insert (db::Text (label.c_str (), db::Trans (b->second.center () - db::Point ())));
|
||||
}
|
||||
|
|
@ -881,7 +896,7 @@ LEFImporter::read_macro (Layout &layout)
|
|||
|
||||
layout.rename_cell (cell.cell_index (), mn.c_str ());
|
||||
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, std::string (), Outline);
|
||||
std::pair <bool, unsigned int> dl = open_layer (layout, std::string (), Outline, 0);
|
||||
if (dl.first) {
|
||||
cell.shapes (dl.second).insert (db::Box (-origin, -origin + size));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue