From 3afcd812c9c4d586cf05daecc49a5f3f3f034da2 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 21 Jul 2018 13:55:17 +0200 Subject: add only missing net --- ice40/bitstream.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ice40/bitstream.cc b/ice40/bitstream.cc index 924868b5..16d801e8 100644 --- a/ice40/bitstream.cc +++ b/ice40/bitstream.cc @@ -592,10 +592,13 @@ void read_config(Context *ctx, std::istream &in, chipconfig_t &config) int wireIndex = atoi(strtok(nullptr, " \t\r\n")); const char *name = strtok(nullptr, " \t\r\n"); - std::unique_ptr created_net = std::unique_ptr(new NetInfo); IdString netName = ctx->id(name); - created_net->name = netName; - ctx->nets[netName] = std::move(created_net); + + if (ctx->nets.find(netName) == ctx->nets.end()) { + std::unique_ptr created_net = std::unique_ptr(new NetInfo); + created_net->name = netName; + ctx->nets[netName] = std::move(created_net); + } WireId wire; wire.index = wireIndex; -- cgit v1.2.3