diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-02-27 16:27:20 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-02-27 16:27:20 +0100 |
commit | f28b6aff40a65aa30a04b77cd51e6c0a346e739e (patch) | |
tree | 918542380d8baa1ef7484cd481ec67f6c4496acf /kernel | |
parent | c59d77aa30d81a248063181ec8e3f746c2aec1c3 (diff) | |
download | yosys-f28b6aff40a65aa30a04b77cd51e6c0a346e739e.tar.gz yosys-f28b6aff40a65aa30a04b77cd51e6c0a346e739e.tar.bz2 yosys-f28b6aff40a65aa30a04b77cd51e6c0a346e739e.zip |
Implemented basic functionality of "extract" pass
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sigtools.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/sigtools.h b/kernel/sigtools.h index e76fd6023..e6c09331d 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 |