mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-06 17:44:09 +00:00
splitcells: Fix the assertion bug caused by out-of-bound offset
This commit is contained in:
parent
78960292d0
commit
9a14ab8d98
|
@ -103,8 +103,7 @@ struct SplitcellsWorker
|
||||||
|
|
||||||
auto slice_signal = [&](SigSpec old_sig) -> SigSpec {
|
auto slice_signal = [&](SigSpec old_sig) -> SigSpec {
|
||||||
SigSpec new_sig;
|
SigSpec new_sig;
|
||||||
for (int i = 0; i < GetSize(old_sig); i += GetSize(outsig)) {
|
for (int offset = slice_lsb; offset <= GetSize(old_sig); offset += GetSize(outsig)) {
|
||||||
int offset = i+slice_lsb;
|
|
||||||
int length = std::min(GetSize(old_sig)-offset, slice_msb-slice_lsb+1);
|
int length = std::min(GetSize(old_sig)-offset, slice_msb-slice_lsb+1);
|
||||||
new_sig.append(old_sig.extract(offset, length));
|
new_sig.append(old_sig.extract(offset, length));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue