diff options
author | gatecat <gatecat@ds0.me> | 2021-02-28 18:20:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-28 18:20:11 +0000 |
commit | 6ff02248a3f625829c9bd041c369247ee926d8d0 (patch) | |
tree | 144415525c99df17319d2f9e1ed2626fbade6473 /gowin/arch.cc | |
parent | 6689bfe923791e7c1c2dd46134f8420f11abee29 (diff) | |
parent | 354d497a577afa5800924a6217d6edf1e6bf6c23 (diff) | |
download | nextpnr-6ff02248a3f625829c9bd041c369247ee926d8d0.tar.gz nextpnr-6ff02248a3f625829c9bd041c369247ee926d8d0.tar.bz2 nextpnr-6ff02248a3f625829c9bd041c369247ee926d8d0.zip |
Merge pull request #606 from pepijndevos/gowin_fixes
Gowin DFF fixes
Diffstat (limited to 'gowin/arch.cc')
-rw-r--r-- | gowin/arch.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gowin/arch.cc b/gowin/arch.cc index 72051b3f..5e1811ea 100644 --- a/gowin/arch.cc +++ b/gowin/arch.cc @@ -1129,6 +1129,7 @@ void Arch::assignArchInfo() if (ci->type == id("SLICE")) { ci->is_slice = true; ci->ff_used = ci->params.at(id_FF_USED).as_bool(); + ci->ff_type = id(ci->params.at(id_FF_TYPE).as_string()); ci->slice_clk = get_net_or_empty(ci, id("CLK")); ci->slice_ce = get_net_or_empty(ci, id("CE")); ci->slice_lsr = get_net_or_empty(ci, id("LSR")); @@ -1162,9 +1163,10 @@ bool Arch::cellsCompatible(const CellInfo **cells, int count) const const NetInfo *clk[4] = {nullptr, nullptr, nullptr, nullptr}; const NetInfo *ce[4] = {nullptr, nullptr, nullptr, nullptr}; const NetInfo *lsr[4] = {nullptr, nullptr, nullptr, nullptr}; + IdString mode[4] = {IdString(), IdString(), IdString(), IdString()}; for (int i = 0; i < count; i++) { const CellInfo *ci = cells[i]; - if (ci->is_slice && ci->slice_clk != nullptr) { + if (ci->is_slice) { Loc loc = getBelLocation(ci->bel); int cls = loc.z / 2; if (loc.z >= 6 && ci->ff_used) // top slice have no ff @@ -1181,6 +1183,10 @@ bool Arch::cellsCompatible(const CellInfo **cells, int count) const lsr[cls] = ci->slice_lsr; else if (lsr[cls] != ci->slice_lsr) return false; + if (mode[cls] == IdString()) + mode[cls] = ci->ff_type; + else if (mode[cls] != ci->ff_type) + return false; } } return true; |