diff --git a/src/db/db/dbLayoutToNetlist.cc b/src/db/db/dbLayoutToNetlist.cc index 3e54f5cac..29e5cc66e 100644 --- a/src/db/db/dbLayoutToNetlist.cc +++ b/src/db/db/dbLayoutToNetlist.cc @@ -302,17 +302,6 @@ void LayoutToNetlist::extract_devices (db::NetlistDeviceExtractor &extractor, co } } - if (! extractor.device_class ()) { - db::DeviceClass *ddc = extractor.default_device_class (); - if (ddc) { - extractor.register_device_class (ddc); - } - } - - if (! extractor.device_class ()) { - throw tl::Exception (tl::to_string (tr ("No device class registered for device extractor '%s' - cannot extract devices.")), extractor.name ()); - } - extractor.extract (dss (), m_layout_index, layers, m_net_clusters, m_device_scaling); // transfer errors to log entries diff --git a/src/db/db/dbNetlistDeviceExtractor.cc b/src/db/db/dbNetlistDeviceExtractor.cc index db7f31c73..6735cfa04 100644 --- a/src/db/db/dbNetlistDeviceExtractor.cc +++ b/src/db/db/dbNetlistDeviceExtractor.cc @@ -94,6 +94,15 @@ static void insert_into_region (const db::NetShape &s, const db::ICplxTrans &tr, void NetlistDeviceExtractor::extract (db::DeepShapeStore &dss, unsigned int layout_index, const NetlistDeviceExtractor::input_layers &layer_map, hier_clusters_type &clusters, double device_scaling) { + // If no device class is registered, use the default device class + if (! device_class ()) { + db::DeviceClass *ddc = default_device_class (); + if (! ddc) { + throw tl::Exception (tl::to_string (tr ("No device class registered for device extractor '%s' - cannot extract devices.")), name ()); + } + register_device_class (ddc); + } + std::vector layers; layers.reserve (m_layer_definitions.size ());