mirror of https://github.com/YosysHQ/yosys.git
passes: show: Simplify wire bit range logic
Signed-off-by: Martin Povišer <povik@cutebit.org>
This commit is contained in:
parent
ad149cc42a
commit
8b1f5fba62
|
@ -261,18 +261,20 @@ struct ShowWorker
|
|||
for (int rep, i = int(sig.chunks().size())-1; i >= 0; i -= rep) {
|
||||
const RTLIL::SigChunk &c = sig.chunks().at(i);
|
||||
int cl, cr;
|
||||
if (c.wire) {
|
||||
if (c.wire->upto) {
|
||||
cr = c.wire->start_offset + (c.wire->width - c.offset - 1);
|
||||
cl = cr - (c.width - 1);
|
||||
} else {
|
||||
cr = c.wire->start_offset + c.offset;
|
||||
cl = cr + c.width - 1;
|
||||
}
|
||||
} else {
|
||||
|
||||
cl = c.offset + c.width - 1;
|
||||
cr = c.offset;
|
||||
|
||||
if (c.is_wire()) {
|
||||
if (c.wire->upto) {
|
||||
cr = (c.wire->width - 1) - c.offset;
|
||||
cl = cr - (c.width - 1);
|
||||
}
|
||||
|
||||
cl += c.wire->start_offset;
|
||||
cr += c.wire->start_offset;
|
||||
}
|
||||
|
||||
if (!driver && c.wire == nullptr) {
|
||||
RTLIL::State s1 = c.data.front();
|
||||
for (auto s2 : c.data)
|
||||
|
|
Loading…
Reference in New Issue