summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-06-10 08:13:56 +0200
committerClifford Wolf <clifford@clifford.at>2015-06-10 08:13:56 +0200
commite5348817947be85cb69f42c7e0ec0706d0511f0f (patch)
tree0a3aff9dd4f85d9d62e681c1e17aed93370b1b3b /kernel
parent56d48227195139f9b85c9f868a192c116266dac4 (diff)
Added "json -aig"
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cellaigs.cc10
-rw-r--r--kernel/cellaigs.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/kernel/cellaigs.cc b/kernel/cellaigs.cc
index 483aa7d5..1d9612e8 100644
--- a/kernel/cellaigs.cc
+++ b/kernel/cellaigs.cc
@@ -41,6 +41,16 @@ unsigned int AigNode::hash() const
return h;
}
+bool Aig::operator==(const Aig &other) const
+{
+ return name == other.name;
+}
+
+unsigned int Aig::hash() const
+{
+ return hash_ops<std::string>::hash(name);
+}
+
struct AigMaker
{
Aig *aig;
diff --git a/kernel/cellaigs.h b/kernel/cellaigs.h
index db635ba9..efe9d83c 100644
--- a/kernel/cellaigs.h
+++ b/kernel/cellaigs.h
@@ -41,6 +41,9 @@ struct Aig
string name;
vector<AigNode> nodes;
Aig(Cell *cell);
+
+ bool operator==(const Aig &other) const;
+ unsigned int hash() const;
};
YOSYS_NAMESPACE_END