mirror of https://github.com/YosysHQ/yosys.git
Bugfixes for empty signal vectors
This commit is contained in:
parent
ed62fcdbe2
commit
a9fefc6ce1
|
@ -217,6 +217,7 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bool cons
|
||||||
assign_map.apply(a); \
|
assign_map.apply(a); \
|
||||||
if (a.is_fully_const()) { \
|
if (a.is_fully_const()) { \
|
||||||
a.optimize(); \
|
a.optimize(); \
|
||||||
|
if (a.chunks.empty()) a.chunks.push_back(RTLIL::SigChunk()); \
|
||||||
RTLIL::Const dummy_arg(RTLIL::State::S0, 1); \
|
RTLIL::Const dummy_arg(RTLIL::State::S0, 1); \
|
||||||
RTLIL::SigSpec y(RTLIL::const_ ## _t(a.chunks[0].data, dummy_arg, \
|
RTLIL::SigSpec y(RTLIL::const_ ## _t(a.chunks[0].data, dummy_arg, \
|
||||||
cell->parameters["\\A_SIGNED"].as_bool(), false, \
|
cell->parameters["\\A_SIGNED"].as_bool(), false, \
|
||||||
|
@ -232,6 +233,8 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bool cons
|
||||||
assign_map.apply(a), assign_map.apply(b); \
|
assign_map.apply(a), assign_map.apply(b); \
|
||||||
if (a.is_fully_const() && b.is_fully_const()) { \
|
if (a.is_fully_const() && b.is_fully_const()) { \
|
||||||
a.optimize(), b.optimize(); \
|
a.optimize(), b.optimize(); \
|
||||||
|
if (a.chunks.empty()) a.chunks.push_back(RTLIL::SigChunk()); \
|
||||||
|
if (b.chunks.empty()) b.chunks.push_back(RTLIL::SigChunk()); \
|
||||||
RTLIL::SigSpec y(RTLIL::const_ ## _t(a.chunks[0].data, b.chunks[0].data, \
|
RTLIL::SigSpec y(RTLIL::const_ ## _t(a.chunks[0].data, b.chunks[0].data, \
|
||||||
cell->parameters["\\A_SIGNED"].as_bool(), \
|
cell->parameters["\\A_SIGNED"].as_bool(), \
|
||||||
cell->parameters["\\B_SIGNED"].as_bool(), \
|
cell->parameters["\\B_SIGNED"].as_bool(), \
|
||||||
|
|
Loading…
Reference in New Issue