summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-03-15 10:22:23 +0100
committerClifford Wolf <clifford@clifford.at>2013-03-15 10:22:23 +0100
commit89f009d17187690fe0446fd95a1f623516a33f3d (patch)
tree1f8329839c3c25536fc57faa1e9f03c94e0b7d9a /kernel
parent3377a04bf26b9310017a71b2df587bad661e0da2 (diff)
Added additional functionality and cleanups in sigtools.h and celltypes.h
Diffstat (limited to 'kernel')
-rw-r--r--kernel/celltypes.h9
-rw-r--r--kernel/sigtools.h24
2 files changed, 33 insertions, 0 deletions
diff --git a/kernel/celltypes.h b/kernel/celltypes.h
index 6273e926..bf5ef4b3 100644
--- a/kernel/celltypes.h
+++ b/kernel/celltypes.h
@@ -29,6 +29,15 @@ struct CellTypes
std::set<std::string> cell_types;
std::vector<const RTLIL::Design*> designs;
+ CellTypes()
+ {
+ }
+
+ CellTypes(const RTLIL::Design *design)
+ {
+ setup(design);
+ }
+
void setup(const RTLIL::Design *design = NULL)
{
if (design)
diff --git a/kernel/sigtools.h b/kernel/sigtools.h
index e6c09331..f081957c 100644
--- a/kernel/sigtools.h
+++ b/kernel/sigtools.h
@@ -164,6 +164,18 @@ struct SigSet
}
}
+ void insert(RTLIL::SigSpec sig, const std::set<T> &data)
+ {
+ sig.expand();
+ for (auto &c : sig.chunks) {
+ if (c.wire == NULL)
+ continue;
+ assert(c.width == 1);
+ bitDef_t bit(c.wire, c.offset);
+ bits[bit].insert(data.begin(), data.end());
+ }
+ }
+
void erase(RTLIL::SigSpec sig)
{
sig.expand();
@@ -188,6 +200,18 @@ struct SigSet
}
}
+ void erase(RTLIL::SigSpec sig, const std::set<T> &data)
+ {
+ sig.expand();
+ for (auto &c : sig.chunks) {
+ if (c.wire == NULL)
+ continue;
+ assert(c.width == 1);
+ bitDef_t bit(c.wire, c.offset);
+ bits[bit].erase(data.begin(), data.end());
+ }
+ }
+
void find(RTLIL::SigSpec sig, std::set<T> &result)
{
sig.expand();