diff options
author | David Shah <davey1576@gmail.com> | 2018-06-19 11:21:16 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-06-19 11:21:16 +0200 |
commit | 6f7070a36550f7910aeedaa3a14284d9063ab4fd (patch) | |
tree | 1bef380aee61f27e486d9b91693fe022f9c65997 /ice40/cells.cc | |
parent | e3519ddfcdfa0e0d3a2942ecf4802c3751db0e17 (diff) | |
download | nextpnr-6f7070a36550f7910aeedaa3a14284d9063ab4fd.tar.gz nextpnr-6f7070a36550f7910aeedaa3a14284d9063ab4fd.tar.bz2 nextpnr-6f7070a36550f7910aeedaa3a14284d9063ab4fd.zip |
ice40: More IdString API updates
Signed-off-by: David Shah <davey1576@gmail.com>
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 |