diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2018-07-21 13:55:17 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2018-07-21 14:41:04 +0200 |
commit | 3afcd812c9c4d586cf05daecc49a5f3f3f034da2 (patch) | |
tree | 50dc86523910ac1b5ff3fcfb57f793ba7914f31a /ice40 | |
parent | a8eadb5ba26013f9ec732f431e349fcbcfc8fbe9 (diff) | |
download | nextpnr-3afcd812c9c4d586cf05daecc49a5f3f3f034da2.tar.gz nextpnr-3afcd812c9c4d586cf05daecc49a5f3f3f034da2.tar.bz2 nextpnr-3afcd812c9c4d586cf05daecc49a5f3f3f034da2.zip |
add only missing net
Diffstat (limited to 'ice40')
-rw-r--r-- | ice40/bitstream.cc | 9 |
1 files 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<NetInfo> created_net = std::unique_ptr<NetInfo>(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<NetInfo> created_net = std::unique_ptr<NetInfo>(new NetInfo);
+ created_net->name = netName;
+ ctx->nets[netName] = std::move(created_net);
+ }
WireId wire;
wire.index = wireIndex;
|