mirror of
https://github.com/YosysHQ/yosys
synced 2025-07-29 23:43:16 +00:00
Added support for unsized constants, fixes #1022
Includes work from @sumit0190 and @AaronKel
This commit is contained in:
parent
2058c7c53b
commit
34417ce55f
5 changed files with 45 additions and 13 deletions
|
@ -963,8 +963,13 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
|
|||
detectSignWidth(width_hint, sign_hint);
|
||||
is_signed = sign_hint;
|
||||
|
||||
if (type == AST_CONSTANT)
|
||||
return RTLIL::SigSpec(bitsAsConst());
|
||||
if (type == AST_CONSTANT) {
|
||||
if (is_unsized) {
|
||||
return RTLIL::SigSpec(bitsAsUnsizedConst(width_hint));
|
||||
} else {
|
||||
return RTLIL::SigSpec(bitsAsConst());
|
||||
}
|
||||
}
|
||||
|
||||
RTLIL::SigSpec sig = realAsConst(width_hint);
|
||||
log_file_warning(filename, linenum, "converting real value %e to binary %s.\n", realvalue, log_signal(sig));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue