aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/arch.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-07-18 12:21:02 +0200
committerDavid Shah <davey1576@gmail.com>2018-07-18 12:21:02 +0200
commit70cfa7a6a4bbc796f1ddf23f53a932538eb3b84d (patch)
tree901cae782b630b4852b9ffef548e1e170b969362 /ice40/arch.cc
parentc75a924c3f9dba4fd7d5c4e9674b29f7869a4e52 (diff)
downloadnextpnr-70cfa7a6a4bbc796f1ddf23f53a932538eb3b84d.tar.gz
nextpnr-70cfa7a6a4bbc796f1ddf23f53a932538eb3b84d.tar.bz2
nextpnr-70cfa7a6a4bbc796f1ddf23f53a932538eb3b84d.zip
ice40: Make assignArchArgs a Arch method; call also after legaliser
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/arch.cc')
-rw-r--r--ice40/arch.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index 1c6dd6a5..a5c920bb 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -697,4 +697,34 @@ bool Arch::isGlobalNet(const NetInfo *net) const
return net->driver.cell != nullptr && net->driver.port == id_glb_buf_out;
}
+// Assign arch arg info
+void Arch::assignArchArgs()
+{
+ for (auto &net : getCtx()->nets) {
+ NetInfo *ni = net.second.get();
+ if (isGlobalNet(ni))
+ ni->is_global = true;
+ }
+ 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++;
+ }
+ }
+}
+
NEXTPNR_NAMESPACE_END