Add optimization to rtlil back-end for all-x parameter values

Signed-off-by: Claire Xenia Wolf <claire@clairexen.net>
This commit is contained in:
Claire Xenia Wolf 2021-09-27 16:02:20 +02:00
parent 1cac671c70
commit 89df26e4bc
1 changed files with 13 additions and 9 deletions

View File

@ -51,6 +51,9 @@ void RTLIL_BACKEND::dump_const(std::ostream &f, const RTLIL::Const &data, int wi
}
}
f << stringf("%d'", width);
if (data.is_fully_undef()) {
f << "x";
} else {
for (int i = offset+width-1; i >= offset; i--) {
log_assert(i < (int)data.bits.size());
switch (data.bits[i]) {
@ -62,6 +65,7 @@ void RTLIL_BACKEND::dump_const(std::ostream &f, const RTLIL::Const &data, int wi
case RTLIL::Sm: f << stringf("m"); break;
}
}
}
} else {
f << stringf("\"");
std::string str = data.decode_string();