3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-27 19:05:52 +00:00

Support using IDs as const values

This commit is contained in:
Gus Smith 2022-06-22 11:01:43 -07:00
parent de37070c28
commit 0275f979c8
2 changed files with 7 additions and 1 deletions

View file

@ -188,6 +188,11 @@ bool is_reg_wire(RTLIL::SigSpec sig, std::string &reg_name)
void dump_const(std::ostream &f, const RTLIL::Const &data, int width = -1, int offset = 0, bool no_decimal = false, bool escape_comment = false)
{
if (data.flags & RTLIL::CONST_FLAG_ID) {
f << stringf("%s", data.decode_string().c_str());
return;
}
bool set_signed = (data.flags & RTLIL::CONST_FLAG_SIGNED) != 0;
if (width < 0)
width = data.bits.size() - offset;