3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-11-04 21:39:14 +00:00

Add try_as_const and use the const iterator a bit more

This commit is contained in:
Robert O'Callahan 2025-10-28 15:48:24 +00:00
parent 04a6dbc562
commit 000c081965
2 changed files with 29 additions and 11 deletions

View file

@ -1453,6 +1453,9 @@ public:
int as_int_saturating(bool is_signed = false) const;
std::string as_string() const;
// Returns std::nullopt if there are any non-constant bits. Returns an empty
// Const if this has zero width.
std::optional<RTLIL::Const> try_as_const() const;
RTLIL::Const as_const() const;
RTLIL::Wire *as_wire() const;
RTLIL::SigChunk as_chunk() const;