diff options
author | David Shah <dave@ds0.me> | 2019-12-27 11:19:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-27 11:19:45 +0000 |
commit | 4e0ca50db137eb9d10098582be607c98601f8375 (patch) | |
tree | 7dd586694d7c3bca458502f3e6d677da1a6954b3 /ice40 | |
parent | b6e2159cecdf79d0d94d0e6a9dda8cef6389cac1 (diff) | |
parent | 5774b13984bb151909b90ee2c668bdfb08387a2b (diff) | |
download | nextpnr-4e0ca50db137eb9d10098582be607c98601f8375.tar.gz nextpnr-4e0ca50db137eb9d10098582be607c98601f8375.tar.bz2 nextpnr-4e0ca50db137eb9d10098582be607c98601f8375.zip |
Merge pull request #353 from YosysHQ/generic-frontend
New hierarchy-capable generic frontend framework and json11 based JSON frontend
Diffstat (limited to 'ice40')
-rw-r--r-- | ice40/arch_pybindings.cc | 2 | ||||
-rw-r--r-- | ice40/cells.cc | 4 | ||||
-rw-r--r-- | ice40/main.cc | 1 | ||||
-rw-r--r-- | ice40/pack.cc | 5 |
4 files changed, 10 insertions, 2 deletions
diff --git a/ice40/arch_pybindings.cc b/ice40/arch_pybindings.cc index cef7c58f..e2022091 100644 --- a/ice40/arch_pybindings.cc +++ b/ice40/arch_pybindings.cc @@ -59,6 +59,7 @@ void arch_wrap_python() typedef std::unordered_map<IdString, std::unique_ptr<CellInfo>> CellMap; typedef std::unordered_map<IdString, std::unique_ptr<NetInfo>> NetMap; + typedef std::unordered_map<IdString, HierarchicalCell> HierarchyMap; typedef std::unordered_map<IdString, IdString> AliasMap; auto belpin_cls = class_<ContextualWrapper<BelPin>>("BelPin", no_init); @@ -75,6 +76,7 @@ void arch_wrap_python() WRAP_MAP_UPTR(CellMap, "IdCellMap"); WRAP_MAP_UPTR(NetMap, "IdNetMap"); + WRAP_MAP(HierarchyMap, wrap_context<HierarchicalCell &>, "HierarchyMap"); } NEXTPNR_NAMESPACE_END diff --git a/ice40/cells.cc b/ice40/cells.cc index 3def82bf..f1901c43 100644 --- a/ice40/cells.cc +++ b/ice40/cells.cc @@ -346,6 +346,8 @@ std::unique_ptr<CellInfo> create_ice_cell(Context *ctx, IdString type, std::stri void lut_to_lc(const Context *ctx, CellInfo *lut, CellInfo *lc, bool no_dff) { + if (lc->hierpath == IdString()) + lc->hierpath = lut->hierpath; lc->params[ctx->id("LUT_INIT")] = lut->params[ctx->id("LUT_INIT")].extract(0, 16, Property::State::S0); replace_port(lut, ctx->id("I0"), lc, ctx->id("I0")); replace_port(lut, ctx->id("I1"), lc, ctx->id("I1")); @@ -359,6 +361,8 @@ void lut_to_lc(const Context *ctx, CellInfo *lut, CellInfo *lc, bool no_dff) void dff_to_lc(const Context *ctx, CellInfo *dff, CellInfo *lc, bool pass_thru_lut) { + if (lc->hierpath == IdString()) + lc->hierpath = dff->hierpath; lc->params[ctx->id("DFF_ENABLE")] = Property::State::S1; std::string config = dff->type.str(ctx).substr(6); auto citer = config.begin(); diff --git a/ice40/main.cc b/ice40/main.cc index 5a5fa0c7..3b512a5a 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -24,7 +24,6 @@ #include "bitstream.h" #include "command.h" #include "design_utils.h" -#include "jsonparse.h" #include "log.h" #include "pcf.h" #include "timing.h" diff --git a/ice40/pack.cc b/ice40/pack.cc index 90c6de31..5b13e9ee 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -527,7 +527,9 @@ static void pack_io(Context *ctx) std::copy(ci->attrs.begin(), ci->attrs.end(), std::inserter(sb->attrs, sb->attrs.begin())); } else if (is_sb_io(ctx, ci) || is_sb_gb_io(ctx, ci)) { NetInfo *net = ci->ports.at(ctx->id("PACKAGE_PIN")).net; - if ((net != nullptr) && (net->users.size() > 1)) + if ((net != nullptr) && ((net->users.size() > 2) || + (net->driver.cell != nullptr && + net->driver.cell->type == ctx->id("$nextpnr_obuf") && net->users.size() > 1))) log_error("PACKAGE_PIN of %s '%s' connected to more than a single top level IO.\n", ci->type.c_str(ctx), ci->name.c_str(ctx)); } @@ -1485,6 +1487,7 @@ bool Arch::pack() promote_globals(ctx); ctx->assignArchInfo(); constrain_chains(ctx); + ctx->fixupHierarchy(); ctx->assignArchInfo(); ctx->settings[ctx->id("pack")] = 1; archInfoToAttributes(); |