aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/arch.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.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.cc')
-rw-r--r--ice40/arch.cc39
1 files changed, 22 insertions, 17 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index a5c920bb..1825c142 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -707,23 +707,28 @@ void Arch::assignArchArgs()
}
for (auto &cell : getCtx()->cells) {
CellInfo *ci = cell.second.get();
- ci->belType = belTypeFromId(ci->type);
- if (ci->type == id_icestorm_lc) {
- ci->lcInfo.dffEnable = bool_or_default(ci->params, id_dff_en);
- ci->lcInfo.negClk = bool_or_default(ci->params, id_neg_clk);
- ci->lcInfo.clk = get_net_or_empty(ci, id_clk);
- ci->lcInfo.cen = get_net_or_empty(ci, id_cen);
- ci->lcInfo.sr = get_net_or_empty(ci, id_sr);
- ci->lcInfo.inputCount = 0;
- if (get_net_or_empty(ci, id_i0))
- ci->lcInfo.inputCount++;
- if (get_net_or_empty(ci, id_i1))
- ci->lcInfo.inputCount++;
- if (get_net_or_empty(ci, id_i2))
- ci->lcInfo.inputCount++;
- if (get_net_or_empty(ci, id_i3))
- ci->lcInfo.inputCount++;
- }
+ assignCellArgs(ci);
+ }
+}
+
+void Arch::assignCellArgs(CellInfo *cell)
+{
+ cell->belType = belTypeFromId(cell->type);
+ if (cell->type == id_icestorm_lc) {
+ cell->lcInfo.dffEnable = bool_or_default(cell->params, id_dff_en);
+ cell->lcInfo.negClk = bool_or_default(cell->params, id_neg_clk);
+ cell->lcInfo.clk = get_net_or_empty(cell, id_clk);
+ cell->lcInfo.cen = get_net_or_empty(cell, id_cen);
+ cell->lcInfo.sr = get_net_or_empty(cell, id_sr);
+ cell->lcInfo.inputCount = 0;
+ if (get_net_or_empty(cell, id_i0))
+ cell->lcInfo.inputCount++;
+ if (get_net_or_empty(cell, id_i1))
+ cell->lcInfo.inputCount++;
+ if (get_net_or_empty(cell, id_i2))
+ cell->lcInfo.inputCount++;
+ if (get_net_or_empty(cell, id_i3))
+ cell->lcInfo.inputCount++;
}
}