aboutsummaryrefslogtreecommitdiffstats
path: root/backends/cxxrtl/cxxrtl.h
diff options
context:
space:
mode:
Diffstat (limited to 'backends/cxxrtl/cxxrtl.h')
-rw-r--r--backends/cxxrtl/cxxrtl.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/backends/cxxrtl/cxxrtl.h b/backends/cxxrtl/cxxrtl.h
index d066530f2..a67591885 100644
--- a/backends/cxxrtl/cxxrtl.h
+++ b/backends/cxxrtl/cxxrtl.h
@@ -296,6 +296,10 @@ struct value : public expr_base<value<Bits>> {
return result;
}
+ value<Bits> update(const value<Bits> &mask, const value<Bits> &val) const {
+ return bit_and(mask.bit_not()).bit_or(val.bit_and(mask));
+ }
+
template<size_t AmountBits>
value<Bits> shl(const value<AmountBits> &amount) const {
// Ensure our early return is correct by prohibiting values larger than 4 Gbit.