3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-14 21:08:47 +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;

View file

@ -50,7 +50,8 @@ namespace RTLIL
CONST_FLAG_NONE = 0,
CONST_FLAG_STRING = 1,
CONST_FLAG_SIGNED = 2, // only used for parameters
CONST_FLAG_REAL = 4 // only used for parameters
CONST_FLAG_REAL = 4, // only used for parameters
CONST_FLAG_ID = 5
};
struct Const;