3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-06 14:13:23 +00:00

rtlil: add Const:: as_int_compressed function

This commit is contained in:
Philippe Sauter 2024-09-23 13:57:07 +02:00 committed by Emil J. Tywoniak
parent 07fb8af05b
commit c53c87e1f4
2 changed files with 29 additions and 3 deletions

View file

@ -703,9 +703,14 @@ struct RTLIL::Const
return ret;
}
// find the MSB without redundant leading bits
size_t get_min_size(bool is_signed) const;
// compress representation to the minimum required bits
void compress(bool is_signed = false);
std::optional<int> as_int_compress(bool is_signed) const;
void extu(int width) {
bits.resize(width, RTLIL::State::S0);
}