summaryrefslogtreecommitdiff
path: root/kernel/yosys.h
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-12-28 17:51:16 +0100
committerClifford Wolf <clifford@clifford.at>2014-12-28 17:51:16 +0100
commit3da46d3437f076c27cef5121f26a1fa151dde1f6 (patch)
tree2116520ceba65cb28603ef6685b07d25bdc9a47c /kernel/yosys.h
parent3e8e483233321d7efadbb78ba746a7797c102a3a (diff)
Renamed hashmap.h to hashlib.h, some related improvements
Diffstat (limited to 'kernel/yosys.h')
-rw-r--r--kernel/yosys.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/kernel/yosys.h b/kernel/yosys.h
index d47f3a95..b653941c 100644
--- a/kernel/yosys.h
+++ b/kernel/yosys.h
@@ -124,17 +124,51 @@
YOSYS_NAMESPACE_BEGIN
-#include "kernel/hashmap.h"
+#include "kernel/hashlib.h"
using std::vector;
+using std::string;
+using hashlib::mkhash;
+using hashlib::mkhash_add;
+using hashlib::hash_ops;
+using hashlib::hash_cstr_ops;
+using hashlib::hash_ptr_ops;
+using hashlib::hash_obj_ops;
+using hashlib::dict;
+using hashlib::pool;
namespace RTLIL {
struct IdString;
+ struct Const;
struct SigBit;
struct SigSpec;
struct Wire;
struct Cell;
+ struct Module;
+ struct Design;
+ struct Monitor;
}
+using RTLIL::IdString;
+using RTLIL::Const;
+using RTLIL::SigBit;
+using RTLIL::SigSpec;
+using RTLIL::Wire;
+using RTLIL::Cell;
+using RTLIL::Module;
+using RTLIL::Design;
+
+template<> struct hash_ops<RTLIL::Wire*> : hash_obj_ops {};
+template<> struct hash_ops<RTLIL::Cell*> : hash_obj_ops {};
+template<> struct hash_ops<RTLIL::Module*> : hash_obj_ops {};
+template<> struct hash_ops<RTLIL::Design*> : hash_obj_ops {};
+template<> struct hash_ops<RTLIL::Monitor*> : hash_obj_ops {};
+
+template<> struct hash_ops<const RTLIL::Wire*> : hash_obj_ops {};
+template<> struct hash_ops<const RTLIL::Cell*> : hash_obj_ops {};
+template<> struct hash_ops<const RTLIL::Module*> : hash_obj_ops {};
+template<> struct hash_ops<const RTLIL::Design*> : hash_obj_ops {};
+template<> struct hash_ops<const RTLIL::Monitor*> : hash_obj_ops {};
+
std::string stringf(const char *fmt, ...) YS_ATTRIBUTE(format(printf, 1, 2));
std::string vstringf(const char *fmt, va_list ap);
int readsome(std::istream &f, char *s, int n);