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:
parent
de37070c28
commit
0275f979c8
|
@ -188,6 +188,11 @@ bool is_reg_wire(RTLIL::SigSpec sig, std::string ®_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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue