From 11cfe36ed1df703cf222fa1d3afb92091ae24e2d Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 1 Feb 2019 23:18:54 +0100 Subject: [PATCH] Some MSVC build issues fixed (hopefully) --- src/db/db/dbAsIfFlatRegion.cc | 2 +- src/db/db/dbDeepRegion.cc | 2 + src/db/db/dbDeepShapeStore.cc | 2 +- src/db/db/dbDeepShapeStore.h | 2 +- src/db/db/dbHierNetworkProcessor.cc | 11 +- src/db/db/dbHierNetworkProcessor.h | 2 +- src/db/db/dbLayoutToNetlistFormatDefs.cc | 122 +++++++++++++------ src/db/db/dbLayoutToNetlistFormatDefs.h | 30 +++-- src/db/db/dbNetlistDeviceExtractor.h | 1 - src/db/db/dbNetlistDeviceExtractorClasses.cc | 7 +- src/db/db/dbNetlistSpiceWriter.h | 1 - src/db/db/gsiDeclDbNetlist.cc | 5 - src/db/db/gsiDeclDbNetlistDeviceExtractor.cc | 14 +-- 13 files changed, 116 insertions(+), 85 deletions(-) diff --git a/src/db/db/dbAsIfFlatRegion.cc b/src/db/db/dbAsIfFlatRegion.cc index c5b4c3b64..5e3ac458a 100644 --- a/src/db/db/dbAsIfFlatRegion.cc +++ b/src/db/db/dbAsIfFlatRegion.cc @@ -670,7 +670,7 @@ namespace /** * @brief A helper class to implement the strange polygon detector */ - struct StrangePolygonInsideFunc + struct DB_PUBLIC StrangePolygonInsideFunc { inline bool operator() (int wc) const { diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index f05396ff5..dd056b17c 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -52,6 +52,8 @@ namespace set (); } + virtual ~DeepRegionIterator () { } + virtual bool at_end () const { return m_iter.at_end (); diff --git a/src/db/db/dbDeepShapeStore.cc b/src/db/db/dbDeepShapeStore.cc index cf7c48bcf..d05ab60f8 100644 --- a/src/db/db/dbDeepShapeStore.cc +++ b/src/db/db/dbDeepShapeStore.cc @@ -390,7 +390,7 @@ DeepShapeStore::invalidate_hier () } const db::CellMapping & -DeepShapeStore::cell_mapping_to_original (size_t layout_index, db::Layout *into_layout, db::cell_index_type into_cell, const std::set *excluded_cells) +DeepShapeStore::cell_mapping_to_original (unsigned int layout_index, db::Layout *into_layout, db::cell_index_type into_cell, const std::set *excluded_cells) { const db::Layout *source_layout = &m_layouts [layout_index]->layout; if (source_layout->begin_top_down () == source_layout->end_top_cells ()) { diff --git a/src/db/db/dbDeepShapeStore.h b/src/db/db/dbDeepShapeStore.h index 306b8f429..f8dac096b 100644 --- a/src/db/db/dbDeepShapeStore.h +++ b/src/db/db/dbDeepShapeStore.h @@ -242,7 +242,7 @@ public: * * "excluded_cells" - if not 0 - will exclude the given cells (and flatten them). */ - const db::CellMapping &cell_mapping_to_original (size_t layout_index, db::Layout *into_layout, db::cell_index_type into_cell, const std::set *excluded_cells = 0); + const db::CellMapping &cell_mapping_to_original (unsigned int layout_index, db::Layout *into_layout, db::cell_index_type into_cell, const std::set *excluded_cells = 0); /** * @brief For testing diff --git a/src/db/db/dbHierNetworkProcessor.cc b/src/db/db/dbHierNetworkProcessor.cc index 670d19851..dd3c40e0f 100644 --- a/src/db/db/dbHierNetworkProcessor.cc +++ b/src/db/db/dbHierNetworkProcessor.cc @@ -301,17 +301,14 @@ local_cluster::ensure_sorted () m_needs_update = false; } -namespace -{ - template -struct interaction_receiver +struct DB_PUBLIC hnp_interaction_receiver : public box_scanner_receiver2 { public: typedef typename local_cluster::box_type box_type; - interaction_receiver (const Connectivity &conn, const db::ICplxTrans &trans) + hnp_interaction_receiver (const Connectivity &conn, const db::ICplxTrans &trans) : mp_conn (&conn), m_any (false), m_trans (trans) { // .. nothing yet .. @@ -357,8 +354,6 @@ private: Trans m_trans; }; -} - template typename local_cluster::shape_iterator local_cluster::begin (unsigned int l) const { @@ -464,7 +459,7 @@ local_cluster::interacts (const local_cluster &other, const db::ICplxTrans } } - interaction_receiver rec (conn, trans); + hnp_interaction_receiver rec (conn, trans); return ! scanner.process (rec, 1 /*==touching*/, bc, bc_t); } diff --git a/src/db/db/dbHierNetworkProcessor.h b/src/db/db/dbHierNetworkProcessor.h index d34d0b7dd..d57db4211 100644 --- a/src/db/db/dbHierNetworkProcessor.h +++ b/src/db/db/dbHierNetworkProcessor.h @@ -330,7 +330,7 @@ public: private: template friend class local_clusters; - template friend class interaction_receiver; + template friend class hnp_interaction_receiver; void set_id (id_type id) { diff --git a/src/db/db/dbLayoutToNetlistFormatDefs.cc b/src/db/db/dbLayoutToNetlistFormatDefs.cc index 572fdccb8..382c408bd 100644 --- a/src/db/db/dbLayoutToNetlistFormatDefs.cc +++ b/src/db/db/dbLayoutToNetlistFormatDefs.cc @@ -27,47 +27,89 @@ namespace db namespace l2n_std_format { - template<> DB_PUBLIC const std::string keys::version_key ("version"); - template<> DB_PUBLIC const std::string keys::description_key ("description"); - template<> DB_PUBLIC const std::string keys::top_key ("top"); - template<> DB_PUBLIC const std::string keys::unit_key ("unit"); - template<> DB_PUBLIC const std::string keys::layer_key ("layer"); - template<> DB_PUBLIC const std::string keys::connect_key ("connect"); - template<> DB_PUBLIC const std::string keys::global_key ("global"); - template<> DB_PUBLIC const std::string keys::circuit_key ("circuit"); - template<> DB_PUBLIC const std::string keys::net_key ("net"); - template<> DB_PUBLIC const std::string keys::device_key ("device"); - template<> DB_PUBLIC const std::string keys::polygon_key ("polygon"); - template<> DB_PUBLIC const std::string keys::rect_key ("rect"); - template<> DB_PUBLIC const std::string keys::terminal_key ("terminal"); - template<> DB_PUBLIC const std::string keys::abstract_key ("abstract"); - template<> DB_PUBLIC const std::string keys::param_key ("param"); - template<> DB_PUBLIC const std::string keys::location_key ("location"); - template<> DB_PUBLIC const std::string keys::rotation_key ("rotation"); - template<> DB_PUBLIC const std::string keys::mirror_key ("mirror"); - template<> DB_PUBLIC const std::string keys::scale_key ("scale"); - template<> DB_PUBLIC const std::string keys::pin_key ("pin"); + static const std::string long_version_key ("version"); + static const std::string long_description_key ("description"); + static const std::string long_top_key ("top"); + static const std::string long_unit_key ("unit"); + static const std::string long_layer_key ("layer"); + static const std::string long_connect_key ("connect"); + static const std::string long_global_key ("global"); + static const std::string long_circuit_key ("circuit"); + static const std::string long_net_key ("net"); + static const std::string long_device_key ("device"); + static const std::string long_polygon_key ("polygon"); + static const std::string long_rect_key ("rect"); + static const std::string long_terminal_key ("terminal"); + static const std::string long_abstract_key ("abstract"); + static const std::string long_param_key ("param"); + static const std::string long_location_key ("location"); + static const std::string long_rotation_key ("rotation"); + static const std::string long_mirror_key ("mirror"); + static const std::string long_scale_key ("scale"); + static const std::string long_pin_key ("pin"); - template<> DB_PUBLIC const std::string keys::version_key ("V"); - template<> DB_PUBLIC const std::string keys::description_key ("B"); - template<> DB_PUBLIC const std::string keys::top_key ("W"); - template<> DB_PUBLIC const std::string keys::unit_key ("U"); - template<> DB_PUBLIC const std::string keys::layer_key ("L"); - template<> DB_PUBLIC const std::string keys::connect_key ("C"); - template<> DB_PUBLIC const std::string keys::global_key ("G"); - template<> DB_PUBLIC const std::string keys::circuit_key ("X"); - template<> DB_PUBLIC const std::string keys::net_key ("N"); - template<> DB_PUBLIC const std::string keys::device_key ("D"); - template<> DB_PUBLIC const std::string keys::polygon_key ("Q"); - template<> DB_PUBLIC const std::string keys::rect_key ("R"); - template<> DB_PUBLIC const std::string keys::terminal_key ("T"); - template<> DB_PUBLIC const std::string keys::abstract_key ("A"); - template<> DB_PUBLIC const std::string keys::param_key ("E"); - template<> DB_PUBLIC const std::string keys::location_key ("Y"); - template<> DB_PUBLIC const std::string keys::rotation_key ("O"); - template<> DB_PUBLIC const std::string keys::mirror_key ("M"); - template<> DB_PUBLIC const std::string keys::scale_key ("S"); - template<> DB_PUBLIC const std::string keys::pin_key ("P"); + static const std::string short_version_key ("V"); + static const std::string short_description_key ("B"); + static const std::string short_top_key ("W"); + static const std::string short_unit_key ("U"); + static const std::string short_layer_key ("L"); + static const std::string short_connect_key ("C"); + static const std::string short_global_key ("G"); + static const std::string short_circuit_key ("X"); + static const std::string short_net_key ("N"); + static const std::string short_device_key ("D"); + static const std::string short_polygon_key ("Q"); + static const std::string short_rect_key ("R"); + static const std::string short_terminal_key ("T"); + static const std::string short_abstract_key ("A"); + static const std::string short_param_key ("E"); + static const std::string short_location_key ("Y"); + static const std::string short_rotation_key ("O"); + static const std::string short_mirror_key ("M"); + static const std::string short_scale_key ("S"); + static const std::string short_pin_key ("P"); + + template<> const std::string &keys::version_key = long_version_key; + template<> const std::string &keys::description_key = long_description_key; + template<> const std::string &keys::top_key = long_top_key; + template<> const std::string &keys::unit_key = long_unit_key; + template<> const std::string &keys::layer_key = long_layer_key; + template<> const std::string &keys::connect_key = long_connect_key; + template<> const std::string &keys::global_key = long_global_key; + template<> const std::string &keys::circuit_key = long_circuit_key; + template<> const std::string &keys::net_key = long_net_key; + template<> const std::string &keys::device_key = long_device_key; + template<> const std::string &keys::polygon_key = long_polygon_key; + template<> const std::string &keys::rect_key = long_rect_key; + template<> const std::string &keys::terminal_key = long_terminal_key; + template<> const std::string &keys::abstract_key = long_abstract_key; + template<> const std::string &keys::param_key = long_param_key; + template<> const std::string &keys::location_key = long_location_key; + template<> const std::string &keys::rotation_key = long_rotation_key; + template<> const std::string &keys::mirror_key = long_mirror_key; + template<> const std::string &keys::scale_key = long_scale_key; + template<> const std::string &keys::pin_key = long_pin_key; + + template<> const std::string &keys::version_key = short_version_key; + template<> const std::string &keys::description_key = short_description_key; + template<> const std::string &keys::top_key = short_top_key; + template<> const std::string &keys::unit_key = short_unit_key; + template<> const std::string &keys::layer_key = short_layer_key; + template<> const std::string &keys::connect_key = short_connect_key; + template<> const std::string &keys::global_key = short_global_key; + template<> const std::string &keys::circuit_key = short_circuit_key; + template<> const std::string &keys::net_key = short_net_key; + template<> const std::string &keys::device_key = short_device_key; + template<> const std::string &keys::polygon_key = short_polygon_key; + template<> const std::string &keys::rect_key = short_rect_key; + template<> const std::string &keys::terminal_key = short_terminal_key; + template<> const std::string &keys::abstract_key = short_abstract_key; + template<> const std::string &keys::param_key = short_param_key; + template<> const std::string &keys::location_key = short_location_key; + template<> const std::string &keys::rotation_key = short_rotation_key; + template<> const std::string &keys::mirror_key = short_mirror_key; + template<> const std::string &keys::scale_key = short_scale_key; + template<> const std::string &keys::pin_key = short_pin_key; } } diff --git a/src/db/db/dbLayoutToNetlistFormatDefs.h b/src/db/db/dbLayoutToNetlistFormatDefs.h index fd6793473..ed57f2d03 100644 --- a/src/db/db/dbLayoutToNetlistFormatDefs.h +++ b/src/db/db/dbLayoutToNetlistFormatDefs.h @@ -103,13 +103,29 @@ namespace l2n_std_format template struct DB_PUBLIC keys { - static const std::string version_key, description_key, top_key, unit_key, - layer_key, connect_key, global_key, - circuit_key, net_key, device_key, subcircuit_key, - polygon_key, rect_key, terminal_key, abstract_key, - param_key, location_key, rotation_key, - mirror_key, scale_key, pin_key, - indent1, indent2; + static const std::string &version_key, + &description_key, + &top_key, + &unit_key, + &layer_key, + &connect_key, + &global_key, + &circuit_key, + &net_key, + &device_key, + &subcircuit_key, + &polygon_key, + &rect_key, + &terminal_key, + &abstract_key, + ¶m_key, + &location_key, + &rotation_key, + &mirror_key, + &scale_key, + &pin_key, + &indent1, + &indent2; inline static bool is_short () { return Short; } }; diff --git a/src/db/db/dbNetlistDeviceExtractor.h b/src/db/db/dbNetlistDeviceExtractor.h index c82e189d4..db7fca2e3 100644 --- a/src/db/db/dbNetlistDeviceExtractor.h +++ b/src/db/db/dbNetlistDeviceExtractor.h @@ -308,7 +308,6 @@ public: return m_layer_definitions.end (); } -protected: /** * @brief Sets the name of the device class and the device extractor */ diff --git a/src/db/db/dbNetlistDeviceExtractorClasses.cc b/src/db/db/dbNetlistDeviceExtractorClasses.cc index a82fa11ff..15531fea8 100644 --- a/src/db/db/dbNetlistDeviceExtractorClasses.cc +++ b/src/db/db/dbNetlistDeviceExtractorClasses.cc @@ -108,12 +108,7 @@ void NetlistDeviceExtractorMOS3Transistor::extract_devices (const std::vectorbox().to_string().c_str()); - printf("@@@ rdiff=%s\n", rdiff.to_string().c_str()); - printf("@@@ rgates=%s\n", rgates.to_string().c_str()); fflush(stdout); - } + size_t n = rgates.selected_interacting (db::Region (*d)).size (); tl_assert (n > 0); device->set_parameter_value (diff_index == 0 ? db::DeviceClassMOS3Transistor::param_id_AS : db::DeviceClassMOS3Transistor::param_id_AD, dbu () * dbu () * d->area () / double (n)); diff --git a/src/db/db/dbNetlistSpiceWriter.h b/src/db/db/dbNetlistSpiceWriter.h index d8dd294d3..2a5dfb418 100644 --- a/src/db/db/dbNetlistSpiceWriter.h +++ b/src/db/db/dbNetlistSpiceWriter.h @@ -57,7 +57,6 @@ public: virtual void write_device_intro (const db::DeviceClass &cls) const; virtual void write_device (const db::Device &dev) const; -protected: std::string net_to_string (const db::Net *net) const; void emit_line (const std::string &line) const; void emit_comment (const std::string &comment) const; diff --git a/src/db/db/gsiDeclDbNetlist.cc b/src/db/db/gsiDeclDbNetlist.cc index e3124665c..0b5b4d0d8 100644 --- a/src/db/db/gsiDeclDbNetlist.cc +++ b/src/db/db/gsiDeclDbNetlist.cc @@ -1083,11 +1083,6 @@ public: gsi::Callback cb_write_header; gsi::Callback cb_write_device_intro; gsi::Callback cb_write_device; - - using db::NetlistSpiceWriterDelegate::emit_comment; - using db::NetlistSpiceWriterDelegate::emit_line; - using db::NetlistSpiceWriterDelegate::net_to_string; - using db::NetlistSpiceWriterDelegate::format_name; }; Class db_NetlistSpiceWriterDelegate ("db", "NetlistSpiceWriterDelegate", diff --git a/src/db/db/gsiDeclDbNetlistDeviceExtractor.cc b/src/db/db/gsiDeclDbNetlistDeviceExtractor.cc index 7ccacac19..29c04a5eb 100644 --- a/src/db/db/gsiDeclDbNetlistDeviceExtractor.cc +++ b/src/db/db/gsiDeclDbNetlistDeviceExtractor.cc @@ -39,18 +39,6 @@ public: // .. nothing yet .. } - using db::NetlistDeviceExtractor::set_name; - using db::NetlistDeviceExtractor::define_layer; - using db::NetlistDeviceExtractor::define_terminal; - using db::NetlistDeviceExtractor::create_device; - using db::NetlistDeviceExtractor::dbu; - using db::NetlistDeviceExtractor::layout; - using db::NetlistDeviceExtractor::cell_index; - using db::NetlistDeviceExtractor::cell_name; - using db::NetlistDeviceExtractor::error; - using db::NetlistDeviceExtractor::get_connectivity; - using db::NetlistDeviceExtractor::extract_devices; - void register_device_class (db::DeviceClass *device_class) { // the class is owned by the extractor @@ -190,7 +178,7 @@ static const std::string &ld_description (const db::NetlistDeviceExtractorLayerD return ld->description; } -static int ld_index (const db::NetlistDeviceExtractorLayerDefinition *ld) +static size_t ld_index (const db::NetlistDeviceExtractorLayerDefinition *ld) { return ld->index; }