Proper SigBit forming in sim

This commit is contained in:
Miodrag Milanovic 2022-03-22 14:43:18 +01:00
parent ff3b0c2c46
commit 322ab1cd54
1 changed files with 4 additions and 4 deletions

View File

@ -1708,13 +1708,13 @@ struct AIWWriter : public OutputWriter
if (index < w->start_offset || index > w->start_offset + w->width) if (index < w->start_offset || index > w->start_offset + w->width)
log_error("Index %d for wire %s is out of range\n", index, log_signal(w)); log_error("Index %d for wire %s is out of range\n", index, log_signal(w));
if (type == "input") { if (type == "input") {
aiw_inputs[variable] = SigBit(w,index); aiw_inputs[variable] = SigBit(w,index-w->start_offset);
} else if (type == "init") { } else if (type == "init") {
aiw_inits[variable] = SigBit(w,index); aiw_inits[variable] = SigBit(w,index-w->start_offset);
} else if (type == "latch") { } else if (type == "latch") {
aiw_latches[variable] = {SigBit(w,index), false}; aiw_latches[variable] = {SigBit(w,index-w->start_offset), false};
} else if (type == "invlatch") { } else if (type == "invlatch") {
aiw_latches[variable] = {SigBit(w,index), true}; aiw_latches[variable] = {SigBit(w,index-w->start_offset), true};
} }
} }