From c96619527a13ca52d723fe3cb26e5ebf5f191cad Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Fri, 9 Dec 2011 22:24:20 +0000 Subject: [PATCH] Fix for pr3452808. The tran island rework included an optimisation that meant that an island port would only be resolved once the initial value for the net attached to that port had propagated to the port. However, v0.9 does not propagate initial values in some cases, so this optimisation cannot be used. --- vvp/island_tran.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/vvp/island_tran.cc b/vvp/island_tran.cc index 751bee2ab..ddb375b5b 100644 --- a/vvp/island_tran.cc +++ b/vvp/island_tran.cc @@ -152,9 +152,24 @@ static void push_value_through_branch(const vvp_vector8_t&val, if (dst_port->value.size() == 0) dst_port->value = island_get_value(dst_net); - // If we don't yet have an initial value for the port, skip. - if (dst_port->value.size() == 0) + // If we don't yet have an initial value for this port, simply + // derive the port value from the pushed value. This does not + // need to be pushed back into the network. + if (dst_port->value.size() == 0) { + if (branch->width == 0) { + // There are no part selects. + dst_port->value = val; + } else if (dst_ab == 1) { + // The other side is a strict subset (part select) + // of this side. + dst_port->value = val.subvalue(branch->offset, branch->part); + } else { + // The other side is a superset of this side. + dst_port->value = part_expand(val, branch->width, + branch->offset); + } return; + } // Now resolve the pushed value with whatever values we have // previously collected (and resolved) for the port.