aboutsummaryrefslogtreecommitdiffstats
path: root/frontend
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-02-03 13:55:07 +0000
committerGitHub <noreply@github.com>2020-02-03 13:55:07 +0000
commitb4d029a55cd67bafcc9c364d609208a818227204 (patch)
treeba83fbf0d6c4b1e3b7644c921960929a23f8735a /frontend
parentaed93a9390dd909111ab4526e7f3df8d24a2ee0a (diff)
parentf1dbb0c4f2242862dd365da8865e059d2c05a310 (diff)
downloadnextpnr-b4d029a55cd67bafcc9c364d609208a818227204.tar.gz
nextpnr-b4d029a55cd67bafcc9c364d609208a818227204.tar.bz2
nextpnr-b4d029a55cd67bafcc9c364d609208a818227204.zip
Merge pull request #385 from YosysHQ/router1-arc-fixes
Fixes for partial reconfig demo
Diffstat (limited to 'frontend')
-rw-r--r--frontend/frontend_base.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/frontend/frontend_base.h b/frontend/frontend_base.h
index df562c9a..fa0e30b9 100644
--- a/frontend/frontend_base.h
+++ b/frontend/frontend_base.h
@@ -284,6 +284,7 @@ template <typename FrontendType> struct GenericFrontend
}
import_module_netnames(m, data);
import_module_cells(m, data);
+ import_net_attrs(m, data);
if (m.is_toplevel) {
import_toplevel_ports(m, data);
// Mark design as loaded through nextpnr
@@ -410,6 +411,26 @@ template <typename FrontendType> struct GenericFrontend
});
}
+ void import_net_attrs(HierModuleState &m, const mod_dat_t &data)
+ {
+ impl.foreach_netname(data, [&](const std::string &basename, const netname_dat_t &nn) {
+ const auto &bits = impl.get_net_bits(nn);
+ int width = impl.get_vector_length(bits);
+ for (int i = 0; i < width; i++) {
+ if (impl.is_vector_bit_constant(bits, i))
+ continue;
+ int net_bit = impl.get_vector_bit_signal(bits, i);
+ int mapped_bit = m.net_by_idx(net_bit);
+ if (mapped_bit != -1) {
+ NetInfo *ni = net_flatindex.at(mapped_bit);
+ impl.foreach_attr(nn, [&](const std::string &name, const Property &value) {
+ ni->attrs[ctx->id(name)] = value;
+ });
+ }
+ }
+ });
+ }
+
// Create a new constant net; given a hint for what the name should be and its value
NetInfo *create_constant_net(HierModuleState &m, const std::string &name_hint, char constval)
{