| 47 | // Note: the iterator provides the hierarchical selection (enabling/disabling cells etc.) |
| 48 | |
| 49 | LayoutToNetlist::LayoutToNetlist (const db::RecursiveShapeIterator &iter) |
| 50 | : m_iter (iter), m_layout_index (0), m_netlist_extracted (false), m_is_flat (false), m_device_scaling (1.0), m_include_floating_subcircuits (false), m_top_level_mode (false), m_make_soft_connection_diodes (false) |
| 51 | { |
| 52 | // check the iterator |
| 53 | if (iter.has_complex_region () || iter.region () != db::Box::world ()) { |
| 54 | throw tl::Exception (tl::to_string (tr ("The netlist extractor cannot work on clipped layouts"))); |
| 55 | } |
| 56 | |
| 57 | mp_internal_dss.reset (new db::DeepShapeStore ()); |
| 58 | mp_dss.reset (mp_internal_dss.get ()); |
| 59 | |
| 60 | // the dummy layer acts as a reference holder for the layout |
| 61 | // NOTE: this probably can be done better |
| 62 | db::RecursiveShapeIterator empty_iter = iter; |
| 63 | empty_iter.set_layers (std::vector<unsigned int> ()); |
| 64 | m_dummy_layer = dss ().create_polygon_layer (empty_iter); |
| 65 | |
| 66 | init (); |
| 67 | } |
| 68 | |
| 69 | LayoutToNetlist::LayoutToNetlist (db::DeepShapeStore *dss, unsigned int layout_index) |
| 70 | : mp_dss (dss), m_layout_index (layout_index), m_netlist_extracted (false), m_is_flat (false), m_device_scaling (1.0), m_include_floating_subcircuits (false), m_top_level_mode (false), m_make_soft_connection_diodes (false) |