From a40d9dc514b680538d0ffa99873974a15bff9e97 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 23 Jun 2018 15:58:24 +0200 Subject: Improve router ripup handling Signed-off-by: Clifford Wolf --- ice40/arch.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'ice40/arch.h') diff --git a/ice40/arch.h b/ice40/arch.h index f13e3f72..ad69363e 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -617,7 +617,18 @@ struct Arch : BaseCtx { assert(wire != WireId()); assert(wire_to_net[wire.index] != IdString()); - nets[wire_to_net[wire.index]]->wires.erase(wire); + + auto &net_wires = nets[wire_to_net[wire.index]]->wires; + auto it = net_wires.find(wire); + assert(it != net_wires.end()); + + auto pip = it->second.pip; + if (pip != PipId()) { + pip_to_net[pip.index] = IdString(); + switches_locked[chip_info->pip_data[pip.index].switch_index] = IdString(); + } + + net_wires.erase(it); wire_to_net[wire.index] = IdString(); } -- cgit v1.2.3