diff --git a/src/db/db/dbNetlist.cc b/src/db/db/dbNetlist.cc index 39c04268d..0d7e1cc5a 100644 --- a/src/db/db/dbNetlist.cc +++ b/src/db/db/dbNetlist.cc @@ -812,8 +812,12 @@ void Circuit::combine_devices () tl_assert (netlist () != 0); for (Netlist::device_class_iterator dc = netlist ()->begin_device_classes (); dc != netlist ()->end_device_classes (); ++dc) { - combine_parallel_devices (*dc); - combine_serial_devices (*dc); + if (dc->supports_parallel_combination ()) { + combine_parallel_devices (*dc); + } + if (dc->supports_serial_combination ()) { + combine_serial_devices (*dc); + } } } diff --git a/src/db/db/dbNetlist.h b/src/db/db/dbNetlist.h index b3d911144..160d97634 100644 --- a/src/db/db/dbNetlist.h +++ b/src/db/db/dbNetlist.h @@ -1431,6 +1431,22 @@ public: return false; } + /** + * @brief Returns true if the device class supports device combination in parallel mode + */ + virtual bool supports_parallel_combination () const + { + return false; + } + + /** + * @brief Returns true if the device class supports device combination in serial mode + */ + virtual bool supports_serial_combination () const + { + return false; + } + private: friend class Netlist; diff --git a/src/db/db/dbNetlistDeviceClasses.h b/src/db/db/dbNetlistDeviceClasses.h index 76184f152..a338193f1 100644 --- a/src/db/db/dbNetlistDeviceClasses.h +++ b/src/db/db/dbNetlistDeviceClasses.h @@ -40,6 +40,8 @@ public: virtual void parallel (Device *a, Device *b) const = 0; virtual void serial (Device *a, Device *b) const = 0; + virtual bool supports_parallel_combination () const { return true; } + virtual bool supports_serial_combination () const { return true; } }; /** @@ -120,6 +122,7 @@ public: } virtual bool combine_devices (Device *a, Device *b) const; + virtual bool supports_parallel_combination () const { return true; } }; /** @@ -140,6 +143,7 @@ public: } virtual bool combine_devices (Device *a, Device *b) const; + virtual bool supports_parallel_combination () const { return true; } }; /** @@ -159,6 +163,7 @@ public: } virtual bool combine_devices (Device *a, Device *b) const; + virtual bool supports_parallel_combination () const { return true; } }; }