mirror of https://github.com/YosysHQ/yosys.git
cxxrtl: Mask `bmux` result appropriately
This commit is contained in:
parent
39fdde87a7
commit
449e3dbbd3
|
@ -475,6 +475,7 @@ struct value : public expr_base<value<Bits>> {
|
|||
carry = (shift_bits == 0) ? 0
|
||||
: data[result.chunks + shift_chunks - 1 - n] << (chunk::bits - shift_bits);
|
||||
}
|
||||
result.data[result.chunks - 1] &= result.msb_mask;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,4 +42,11 @@ int main()
|
|||
cxxrtl::value<32> a(0x00040000u);
|
||||
assert(a.ctlz() == 13);
|
||||
}
|
||||
|
||||
{
|
||||
// bmux clears top bits of result
|
||||
cxxrtl::value<8> val(0x1fu);
|
||||
cxxrtl::value<1> sel(0u);
|
||||
assert(val.template bmux<4>(sel).get<uint64_t>() == 0xfu);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue