mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-03 21:01:23 +00:00
Support using IDs as const values
This commit is contained in:
parent
de37070c28
commit
0275f979c8
2 changed files with 7 additions and 1 deletions
|
@ -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)
|
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;
|
bool set_signed = (data.flags & RTLIL::CONST_FLAG_SIGNED) != 0;
|
||||||
if (width < 0)
|
if (width < 0)
|
||||||
width = data.bits.size() - offset;
|
width = data.bits.size() - offset;
|
||||||
|
|
|
@ -50,7 +50,8 @@ namespace RTLIL
|
||||||
CONST_FLAG_NONE = 0,
|
CONST_FLAG_NONE = 0,
|
||||||
CONST_FLAG_STRING = 1,
|
CONST_FLAG_STRING = 1,
|
||||||
CONST_FLAG_SIGNED = 2, // only used for parameters
|
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;
|
struct Const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue