diff options
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r-- | common/nextpnr.h | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h index 37e193b9..50465869 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -136,7 +136,7 @@ NEXTPNR_NAMESPACE_BEGIN struct GraphicElement { - enum + enum type_t { G_NONE, G_LINE, @@ -145,6 +145,14 @@ struct GraphicElement G_LABEL } type = G_NONE; + enum style_t + { + G_FRAME, + G_HIDDEN, + G_INACTIVE, + G_ACTIVE, + } style = G_FRAME; + float x1 = 0, y1 = 0, x2 = 0, y2 = 0, z = 0; std::string text; }; @@ -155,6 +163,12 @@ NEXTPNR_NAMESPACE_END NEXTPNR_NAMESPACE_BEGIN +struct DecalXY +{ + DecalId decal; + float x = 0, y = 0; +}; + struct BelPin { BelId bel; @@ -253,6 +267,31 @@ struct BaseCtx delete idstring_str_to_idx; delete idstring_idx_to_str; } + + Context *getCtx() { return reinterpret_cast<Context *>(this); } + + const Context *getCtx() const { return reinterpret_cast<const Context *>(this); } + + // -------------------------------------------------------------- + + bool allUiReload = false; + bool frameUiReload = false; + std::unordered_set<BelId> belUiReload; + std::unordered_set<WireId> wireUiReload; + std::unordered_set<PipId> pipUiReload; + std::unordered_set<GroupId> groupUiReload; + + void refreshUi() { allUiReload = true; } + + void refreshUiFrame() { frameUiReload = true; } + + void refreshUiBel(BelId bel) { belUiReload.insert(bel); } + + void refreshUiWire(WireId wire) { wireUiReload.insert(wire); } + + void refreshUiPip(PipId pip) { pipUiReload.insert(pip); } + + void refreshUiGroup(GroupId group) { groupUiReload.insert(group); } }; NEXTPNR_NAMESPACE_END @@ -273,6 +312,11 @@ struct Context : Arch // -------------------------------------------------------------- + // provided by router1.cc + bool getActualRouteDelay(WireId src_wire, WireId dst_wire, delay_t &delay); + + // -------------------------------------------------------------- + uint64_t rngstate = 0x3141592653589793; uint64_t rng64() |