cxxrtl: Add internal cell "bwmux"

Mirrors the implementation for the smt2 backend

Co-authored-by: Martin Povišer <[email protected]>
This commit is contained in:
David Sawatzke
2025-04-16 13:58:08 +01:00
committed by Catherine
co-authored by Martin Povišer
parent c894685f26
commit 04098933c7
2 changed files with 14 additions and 1 deletions
+5
View File
@@ -498,6 +498,11 @@ struct value : public expr_base<value<Bits>> {
return result;
}
CXXRTL_ALWAYS_INLINE
value<Bits> bwmux(const value<Bits> &b, const value<Bits> &s) const {
return (bit_and(s.bit_not())).bit_or(b.bit_and(s));
}
template<size_t ResultBits, size_t SelBits>
value<ResultBits> demux(const value<SelBits> &sel) const {
static_assert(Bits << SelBits == ResultBits, "invalid sizes used in demux()");