aboutsummaryrefslogtreecommitdiffstats
path: root/common/nextpnr.h
diff options
context:
space:
mode:
authorSergiusz Bazanski <q3k@q3k.org>2018-07-13 20:53:52 +0100
committerSergiusz Bazanski <q3k@q3k.org>2018-07-13 20:53:52 +0100
commita8c84e90a39c54174dd24b5b76bd17aed8311481 (patch)
tree2de94b976fd882e1ce3b83e8880e80f97d043775 /common/nextpnr.h
parenta71b576de6c404572439e30a56c4ff19497523a2 (diff)
downloadnextpnr-a8c84e90a39c54174dd24b5b76bd17aed8311481.tar.gz
nextpnr-a8c84e90a39c54174dd24b5b76bd17aed8311481.tar.bz2
nextpnr-a8c84e90a39c54174dd24b5b76bd17aed8311481.zip
Make GUI nice and smooth.
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r--common/nextpnr.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h
index 50465869..efcab9fc 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -238,6 +238,16 @@ struct CellInfo
std::unordered_map<IdString, IdString> pins;
};
+struct UIUpdatesRequired
+{
+ bool allUIReload;
+ bool frameUIReload;
+ std::unordered_set<BelId> belUIReload;
+ std::unordered_set<WireId> wireUIReload;
+ std::unordered_set<PipId> pipUIReload;
+ std::unordered_set<GroupId> groupUIReload;
+};
+
struct BaseCtx
{
// --------------------------------------------------------------
@@ -260,6 +270,8 @@ struct BaseCtx
idstring_idx_to_str = new std::vector<const std::string *>;
IdString::initialize_add(this, "", 0);
IdString::initialize_arch(this);
+
+ allUiReload = true;
}
~BaseCtx()
@@ -292,6 +304,25 @@ struct BaseCtx
void refreshUiPip(PipId pip) { pipUiReload.insert(pip); }
void refreshUiGroup(GroupId group) { groupUiReload.insert(group); }
+
+ UIUpdatesRequired getUIUpdatesRequired(void)
+ {
+ UIUpdatesRequired req;
+ req.allUIReload = allUiReload;
+ req.frameUIReload = frameUiReload;
+ req.belUIReload = belUiReload;
+ req.wireUIReload = wireUiReload;
+ req.pipUIReload = pipUiReload;
+ req.groupUIReload = groupUiReload;
+
+ allUiReload = false;
+ frameUiReload = false;
+ belUiReload.clear();
+ wireUiReload.clear();
+ pipUiReload.clear();
+ groupUiReload.clear();
+ return req;
+ }
};
NEXTPNR_NAMESPACE_END