diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-06-19 12:08:51 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-06-19 12:08:51 +0200 |
commit | 8067ed9af0742f552ae19fb2d8ac3755511c4998 (patch) | |
tree | 4187440c431750976255a2900cfa5eae2b97abb7 /ice40/cells.cc | |
parent | c910846c5cefe03ce60d50418389f158846f8341 (diff) | |
parent | 6f7070a36550f7910aeedaa3a14284d9063ab4fd (diff) | |
download | nextpnr-8067ed9af0742f552ae19fb2d8ac3755511c4998.tar.gz nextpnr-8067ed9af0742f552ae19fb2d8ac3755511c4998.tar.bz2 nextpnr-8067ed9af0742f552ae19fb2d8ac3755511c4998.zip |
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr
Diffstat (limited to 'ice40/cells.cc')
-rw-r--r-- | ice40/cells.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ice40/cells.cc b/ice40/cells.cc index d21d5b3b..6a8e7b5e 100644 --- a/ice40/cells.cc +++ b/ice40/cells.cc @@ -31,15 +31,15 @@ void add_port(const Context *ctx, CellInfo *cell, std::string name, cell->ports[id] = PortInfo{id, nullptr, dir}; } -CellInfo *create_ice_cell(Context *ctx, IdString type, IdString name) +CellInfo *create_ice_cell(Context *ctx, IdString type, std::string name) { static int auto_idx = 0; CellInfo *new_cell = new CellInfo(); - if (name == IdString()) { - new_cell->name = IdString("$nextpnr_" + type.str() + "_" + + if (name.empty()) { + new_cell->name = IdString(ctx, "$nextpnr_" + type.str() + "_" + std::to_string(auto_idx++)); } else { - new_cell->name = name; + new_cell->name = ctx->id(name); } new_cell->type = type; if (type == ctx->id("ICESTORM_LC")) { @@ -251,7 +251,7 @@ bool is_enable_port(const Context *ctx, const PortRef &port) bool is_global_net(const Context *ctx, const NetInfo *net) { - return bool(net_driven_by(ctx, net, is_gbuf, "GLOBAL_BUFFER_OUTPUT")); + return bool(net_driven_by(ctx, net, is_gbuf, ctx->id("GLOBAL_BUFFER_OUTPUT"))); } NEXTPNR_NAMESPACE_END |