From 7532334875208bf7f0171c9185f5a22b0bbda1b5 Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Mon, 24 Jun 2024 13:05:56 +0200 Subject: [PATCH] failed trick with tag_dict to track which dict of consts takes up space --- kernel/hashlib.h | 34 ++++++++++++++++++++++++++++++++++ kernel/rtlil.h | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/kernel/hashlib.h b/kernel/hashlib.h index e8ddddd33..208e5eeab 100644 --- a/kernel/hashlib.h +++ b/kernel/hashlib.h @@ -211,6 +211,7 @@ inline int hashtable_size(int min_size) throw std::length_error("hash table exceeded maximum size."); } +template> class tag_dict; template> class dict; template> class idict; template> class pool; @@ -671,6 +672,39 @@ public: const_iterator end() const { return const_iterator(nullptr, -1); } }; +template +class tag_dict : public dict { + public: + tag_dict& operator = (const tag_dict& rhs) { + dict::operator =(rhs); + return *this; + } + tag_dict& operator = (tag_dict&& rhs) { + dict::operator =(rhs); + return *this; + } + constexpr tag_dict() : dict() + { + } + + tag_dict(const dict &other) : dict(other) { } + tag_dict(const tag_dict &other) : dict(other) { } + // tag_dict(const tag_dict &other) + // { + // dict(other); + // // entries = other.entries; + // // do_rehash(); + // } + + tag_dict(dict &&other) : dict(other) { } + tag_dict(tag_dict &&other) : dict(other) { } + // tag_dict(tag_dict &&other) + // { + // dict(other); + // // swap(other); + // } +}; + template class pool { diff --git a/kernel/rtlil.h b/kernel/rtlil.h index f9da29495..08457f4f0 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -1565,7 +1565,7 @@ public: RTLIL::IdString name; RTLIL::IdString type; dict connections_; - dict parameters; + hashlib::tag_dict parameters; // access cell ports bool hasPort(const RTLIL::IdString &portname) const;