summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-02-27 16:27:20 +0100
committerClifford Wolf <clifford@clifford.at>2013-02-27 16:27:20 +0100
commitf28b6aff40a65aa30a04b77cd51e6c0a346e739e (patch)
tree918542380d8baa1ef7484cd481ec67f6c4496acf /kernel
parentc59d77aa30d81a248063181ec8e3f746c2aec1c3 (diff)
Implemented basic functionality of "extract" pass
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sigtools.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/sigtools.h b/kernel/sigtools.h
index e76fd602..e6c09331 100644
--- a/kernel/sigtools.h
+++ b/kernel/sigtools.h
@@ -207,6 +207,20 @@ struct SigSet
find(sig, result);
return result;
}
+
+ bool has(RTLIL::SigSpec sig)
+ {
+ sig.expand();
+ for (auto &c : sig.chunks) {
+ if (c.wire == NULL)
+ continue;
+ assert(c.width == 1);
+ bitDef_t bit(c.wire, c.offset);
+ if (bits.count(bit))
+ return true;
+ }
+ return false;
+ }
};
struct SigMap