aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/arch_place.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-07-18 12:51:07 +0200
committerDavid Shah <davey1576@gmail.com>2018-07-18 12:51:07 +0200
commitd392b5f63587339c27a30c247f4a045f923edc4b (patch)
tree6b115a144356e94224d4ae695605f424bed6c47f /ice40/arch_place.cc
parent70cfa7a6a4bbc796f1ddf23f53a932538eb3b84d (diff)
downloadnextpnr-d392b5f63587339c27a30c247f4a045f923edc4b.tar.gz
nextpnr-d392b5f63587339c27a30c247f4a045f923edc4b.tar.bz2
nextpnr-d392b5f63587339c27a30c247f4a045f923edc4b.zip
ice40: Use xArchArgs in validity check
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/arch_place.cc')
-rw-r--r--ice40/arch_place.cc36
1 files changed, 14 insertions, 22 deletions
diff --git a/ice40/arch_place.cc b/ice40/arch_place.cc
index dc1bc3eb..1f2943a0 100644
--- a/ice40/arch_place.cc
+++ b/ice40/arch_place.cc
@@ -31,45 +31,37 @@ bool Arch::logicCellsCompatible(const std::vector<const CellInfo *> &cells) cons
int locals_count = 0;
for (auto cell : cells) {
- if (bool_or_default(cell->params, id_dff_en)) {
+ NPNR_ASSERT(cell->belType == TYPE_ICESTORM_LC);
+ if (cell->lcInfo.dffEnable) {
if (!dffs_exist) {
dffs_exist = true;
- cen = get_net_or_empty(cell, id_cen);
- clk = get_net_or_empty(cell, id_clk);
- sr = get_net_or_empty(cell, id_sr);
+ cen = cell->lcInfo.cen;
+ clk = cell->lcInfo.clk;
+ sr = cell->lcInfo.sr;
- if (!isGlobalNet(cen) && cen != nullptr)
+ if (cen != nullptr && !cen->is_global)
locals_count++;
- if (!isGlobalNet(clk) && clk != nullptr)
+ if (clk != nullptr && !clk->is_global)
locals_count++;
- if (!isGlobalNet(sr) && sr != nullptr)
+ if (sr != nullptr && !sr->is_global)
locals_count++;
- if (bool_or_default(cell->params, id_neg_clk)) {
+ if (cell->lcInfo.negClk) {
dffs_neg = true;
}
} else {
- if (cen != get_net_or_empty(cell, id_cen))
+ if (cen != cell->lcInfo.cen)
return false;
- if (clk != get_net_or_empty(cell, id_clk))
+ if (clk != cell->lcInfo.clk)
return false;
- if (sr != get_net_or_empty(cell, id_sr))
+ if (sr != cell->lcInfo.sr)
return false;
- if (dffs_neg != bool_or_default(cell->params, id_neg_clk))
+ if (dffs_neg != cell->lcInfo.negClk)
return false;
}
}
- const NetInfo *i0 = get_net_or_empty(cell, id_i0), *i1 = get_net_or_empty(cell, id_i1),
- *i2 = get_net_or_empty(cell, id_i2), *i3 = get_net_or_empty(cell, id_i3);
- if (i0 != nullptr)
- locals_count++;
- if (i1 != nullptr)
- locals_count++;
- if (i2 != nullptr)
- locals_count++;
- if (i3 != nullptr)
- locals_count++;
+ locals_count += cell->lcInfo.inputCount;
}
return locals_count <= 32;