diff options
author | gatecat <gatecat@ds0.me> | 2022-02-16 16:15:26 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-16 16:15:26 +0000 |
commit | 25c47e5b7e12d232cac9408b7d6d339ee11793b7 (patch) | |
tree | 7700f5ce4d8b40255aa54e08d2c4489e74b906ff /ecp5/globals.cc | |
parent | 02e6d2dbca0433e6f873c6af635cee701e84f5f5 (diff) | |
parent | 30fd86ce69fa65e89dec119e23b5bccb54de70a3 (diff) | |
download | nextpnr-25c47e5b7e12d232cac9408b7d6d339ee11793b7.tar.gz nextpnr-25c47e5b7e12d232cac9408b7d6d339ee11793b7.tar.bz2 nextpnr-25c47e5b7e12d232cac9408b7d6d339ee11793b7.zip |
Merge pull request #917 from YosysHQ/gatecat/netlist-i
refactor: New NetInfo and CellInfo constructors
Diffstat (limited to 'ecp5/globals.cc')
-rw-r--r-- | ecp5/globals.cc | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/ecp5/globals.cc b/ecp5/globals.cc index 8ee49c02..cc2208e0 100644 --- a/ecp5/globals.cc +++ b/ecp5/globals.cc @@ -456,11 +456,10 @@ class Ecp5GlobalRouter dccptr = net->driver.cell; } else { auto dcc = create_ecp5_cell(ctx, id_DCCA, "$gbuf$" + net->name.str(ctx)); - std::unique_ptr<NetInfo> glbnet = std::unique_ptr<NetInfo>(new NetInfo); - glbnet->name = ctx->id("$glbnet$" + net->name.str(ctx)); - glbnet->driver.cell = dcc.get(); - glbnet->driver.port = id_CLKO; - dcc->ports[id_CLKO].net = glbnet.get(); + glbptr = ctx->createNet(ctx->id("$glbnet$" + net->name.str(ctx))); + glbptr->driver.cell = dcc.get(); + glbptr->driver.port = id_CLKO; + dcc->ports[id_CLKO].net = glbptr; std::vector<PortRef> keep_users; for (auto user : net->users) { if (dcs_cell != nullptr && user.cell != dcs_cell) { @@ -473,8 +472,8 @@ class Ecp5GlobalRouter } else if (is_logic_port(user)) { keep_users.push_back(user); } else { - glbnet->users.push_back(user); - user.cell->ports.at(user.port).net = glbnet.get(); + glbptr->users.push_back(user); + user.cell->ports.at(user.port).net = glbptr; } } net->users = keep_users; @@ -485,13 +484,11 @@ class Ecp5GlobalRouter clki_pr.cell = dcc.get(); net->users.push_back(clki_pr); if (net->clkconstr) { - glbnet->clkconstr = std::unique_ptr<ClockConstraint>(new ClockConstraint()); - glbnet->clkconstr->low = net->clkconstr->low; - glbnet->clkconstr->high = net->clkconstr->high; - glbnet->clkconstr->period = net->clkconstr->period; + glbptr->clkconstr = std::unique_ptr<ClockConstraint>(new ClockConstraint()); + glbptr->clkconstr->low = net->clkconstr->low; + glbptr->clkconstr->high = net->clkconstr->high; + glbptr->clkconstr->period = net->clkconstr->period; } - glbptr = glbnet.get(); - ctx->nets[glbnet->name] = std::move(glbnet); dccptr = dcc.get(); ctx->cells[dcc->name] = std::move(dcc); } |